237 lines
12 KiB
TypeScript
237 lines
12 KiB
TypeScript
/* Metro module 7246; source: modules/guild_automod/AutomodErrorUtils.tsx; dependencies: [7, 6, 15, 17, 18, 162, 1379, 661, 1244, 4862, 2] */
|
|
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import Module00162 from '../../by-id/module-00162.js'; /* Metro dependency 162 */
|
|
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as MessageQueueModule from '../../lib/MessageQueue.tsx'; /* Metro dependency 4862 */
|
|
|
|
function _fun58240(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#58240, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7424:6, offset: 0x016c2994, size: 403 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const getAutomodErrorMessageFromErrorResponse2 = getAutomodErrorMessageFromErrorResponse;
|
|
const getAutomodErrorMessageFromMessageData2 = getAutomodErrorMessageFromMessageData;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = Module00162;
|
|
const AbortCodes = (ConstantsModule).AbortCodes;
|
|
let Error = global.Error;
|
|
const value3 = _fun58247(value(Error));
|
|
Error = global.Error;
|
|
value = value(Error);
|
|
value = _fun58249(value);
|
|
const Set = global.Set;
|
|
const AUTOMOD_MESSAGE_BLOCKED = AbortCodes.AUTOMOD_MESSAGE_BLOCKED;
|
|
const AUTOMOD_TITLE_BLOCKED = AbortCodes.AUTOMOD_TITLE_BLOCKED;
|
|
const AUTOMOD_INVALID_RUST_SERVICE_RESPONSE = AbortCodes.AUTOMOD_INVALID_RUST_SERVICE_RESPONSE;
|
|
const set = new Set([AUTOMOD_MESSAGE_BLOCKED, AUTOMOD_TITLE_BLOCKED, AUTOMOD_INVALID_RUST_SERVICE_RESPONSE]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/guild_automod/AutomodErrorUtils.tsx');
|
|
exports.InvalidKeywordError = value3;
|
|
exports.InvalidRegexPatternError = value;
|
|
exports.AUTOMOD_ERROR_CODES = set;
|
|
exports.getAutomodErrorMessageFromErrorResponse = getAutomodErrorMessageFromErrorResponse2;
|
|
exports.getAutomodErrorMessageFromMessageData = getAutomodErrorMessageFromMessageData2;
|
|
exports.getAutomodErrorMessage = getAutomodErrorMessage;
|
|
function _callSuper_58241(a0, a1, a2) { // fn#58241, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7424:189, offset: 0x016c2b27, size: 100 bytes, params: 4, frame: 20
|
|
var r0;
|
|
var Reflect;
|
|
let value = a2;
|
|
const value3 = Module00017(a1);
|
|
if (_isNativeReflectConstruct_58242()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value3, value || [], Module00017(a0).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value3.apply(a0, value);
|
|
r0 = value;
|
|
}
|
|
return PossibleConstructorReturn(a0, r0);
|
|
}
|
|
|
|
function _isNativeReflectConstruct_58242() { // fn#58242, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7424:320, offset: 0x016c2b8b, size: 94 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_58242_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function getAutomodErrorMessageFromErrorResponse(a0, a1) { // fn#58245, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7424:1031, offset: 0x016c2be9, size: 342 bytes, params: 3, frame: 17
|
|
var channel;
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
if (a0 != null) {
|
|
var code = a0.code;
|
|
var message = a0.message;
|
|
var binding = env0_9;
|
|
if (binding.has(code)) {
|
|
if (message != null) {
|
|
return message;
|
|
}
|
|
if (a1 == null) {
|
|
return null;
|
|
}
|
|
channel = ChannelStore.getChannel(a1);
|
|
if (channel == null) {
|
|
if (channel == null) {
|
|
if (channel == null) {
|
|
return null;
|
|
}
|
|
if (channel.isForumLikeChannel()) {
|
|
if (code === AbortCodes.AUTOMOD_TITLE_BLOCKED) {
|
|
return intl.string(t.ipgKDg);
|
|
}
|
|
if (code === AbortCodes.AUTOMOD_MESSAGE_BLOCKED) {
|
|
return intl.string(t.ipgKDg);
|
|
}
|
|
return null;
|
|
}
|
|
return null;
|
|
}
|
|
if (channel.isForumPost()) {
|
|
if (code === AbortCodes.AUTOMOD_TITLE_BLOCKED) {
|
|
return intl.string(t.ipgKDg);
|
|
}
|
|
if (code === AbortCodes.AUTOMOD_MESSAGE_BLOCKED) {
|
|
return intl.string(t.ipgKDg);
|
|
}
|
|
return null;
|
|
}
|
|
if (channel == null) {
|
|
return null;
|
|
}
|
|
if (channel.isForumLikeChannel()) {
|
|
if (code === AbortCodes.AUTOMOD_TITLE_BLOCKED) {
|
|
return intl.string(t.ipgKDg);
|
|
}
|
|
if (code === AbortCodes.AUTOMOD_MESSAGE_BLOCKED) {
|
|
return intl.string(t.ipgKDg);
|
|
}
|
|
return null;
|
|
}
|
|
return null;
|
|
}
|
|
if (channel.isThread()) {
|
|
return intl.string(t.DVdG9E);
|
|
}
|
|
if (channel == null) {
|
|
if (channel == null) {
|
|
return null;
|
|
}
|
|
if (channel.isForumLikeChannel()) {
|
|
if (code === AbortCodes.AUTOMOD_TITLE_BLOCKED) {
|
|
return intl.string(t.ipgKDg);
|
|
}
|
|
if (code === AbortCodes.AUTOMOD_MESSAGE_BLOCKED) {
|
|
return intl.string(t.ipgKDg);
|
|
}
|
|
return null;
|
|
}
|
|
return null;
|
|
}
|
|
if (channel.isForumPost()) {
|
|
if (code === AbortCodes.AUTOMOD_TITLE_BLOCKED) {
|
|
return intl.string(t.ipgKDg);
|
|
}
|
|
if (code === AbortCodes.AUTOMOD_MESSAGE_BLOCKED) {
|
|
return intl.string(t.ipgKDg);
|
|
}
|
|
return null;
|
|
}
|
|
if (channel == null) {
|
|
return null;
|
|
}
|
|
if (channel.isForumLikeChannel()) {
|
|
if (code === AbortCodes.AUTOMOD_TITLE_BLOCKED) {
|
|
return intl.string(t.ipgKDg);
|
|
}
|
|
if (code === AbortCodes.AUTOMOD_MESSAGE_BLOCKED) {
|
|
return intl.string(t.ipgKDg);
|
|
}
|
|
return null;
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function getAutomodErrorMessageFromMessageData(a0) { // fn#58246, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7424:1521, offset: 0x016c2d3f, size: 355 bytes, params: 2, frame: 16
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const channel = ChannelStore.getChannel(a0.message.channelId);
|
|
return MessageQueueModule.isMessageDataEdit(a0) ? intl.string(t.bU6o0z) : channel == null ? channel == null ? channel == null ? intl.string(t.zQ69pv) : channel.isForumLikeChannel() ? intl.string(t.ipgKDg) : intl.string(t.zQ69pv) : channel.isForumPost() ? intl.string(t.ipgKDg) : channel == null ? intl.string(t.zQ69pv) : channel.isForumLikeChannel() ? intl.string(t.ipgKDg) : intl.string(t.zQ69pv) : channel.isThread() ? intl.string(t.DVdG9E) : channel == null ? channel == null ? intl.string(t.zQ69pv) : channel.isForumLikeChannel() ? intl.string(t.ipgKDg) : intl.string(t.zQ69pv) : channel.isForumPost() ? intl.string(t.ipgKDg) : channel == null ? intl.string(t.zQ69pv) : channel.isForumLikeChannel() ? intl.string(t.ipgKDg) : intl.string(t.zQ69pv);
|
|
}
|
|
|
|
function _fun58247(a0) { // fn#58247, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7424:519, offset: 0x016c2ea2, size: 40 bytes, params: 2, frame: 14
|
|
const InvalidKeywordError2 = InvalidKeywordError;
|
|
Inherits(InvalidKeywordError2, a0);
|
|
return CreateClass(InvalidKeywordError2);
|
|
function InvalidKeywordError() { // fn#58248, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7424:531, offset: 0x016c2eca, size: 42 bytes, params: 1, frame: 16
|
|
env1_3(this, InvalidKeywordError);
|
|
return _callSuper_58241(this, InvalidKeywordError, arguments);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun58249(a0) { // fn#58249, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7424:712, offset: 0x016c2ef4, size: 40 bytes, params: 2, frame: 14
|
|
const InvalidRegexPatternError2 = InvalidRegexPatternError;
|
|
Inherits(InvalidRegexPatternError2, a0);
|
|
return CreateClass(InvalidRegexPatternError2);
|
|
function InvalidRegexPatternError() { // fn#58250, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7424:724, offset: 0x016c2eca, size: 42 bytes, params: 1, frame: 16
|
|
env1_3(this, InvalidRegexPatternError);
|
|
return _callSuper_58241(this, InvalidRegexPatternError, arguments);
|
|
}
|
|
|
|
}
|
|
|
|
function getAutomodErrorMessage(a0, a1) { // fn#58251, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7424:2225, offset: 0x016c2f1c, size: 101 bytes, params: 3, frame: 16
|
|
var r1;
|
|
var r0;
|
|
var intl;
|
|
const automodErrorMessageFromErrorResponse = getAutomodErrorMessageFromErrorResponse(a1);
|
|
if (automodErrorMessageFromErrorResponse != null) {
|
|
r0 = automodErrorMessageFromErrorResponse;
|
|
} else {
|
|
if (a0 == null) {
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r1 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.zQ69pv);
|
|
} else {
|
|
r1 = getAutomodErrorMessageFromMessageData(a0);
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun58240, 7246, [7, 6, 15, 17, 18, 162, 1379, 661, 1244, 4862,
|
|
2]) /* metro module 7246, dependencies: [7, 6, 15, 17, 18, 162, 1379, 661, 1244, 4862, 2] */;
|