224 lines
7.8 KiB
TypeScript
224 lines
7.8 KiB
TypeScript
/* Metro module 11013; source: utils/MentionGuardUtils.tsx; dependencies: [57, 6875, 3784, 661, 44, 7076, 2] */
|
|
function _fun84372(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11199:6, offset: 0x01f4764f, size: 290 bytes, params: 8, frame: 21
|
|
var object2;
|
|
const _arrayLikeToArray_84375 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const closure = everyoneMemberCount;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(57) /* metro dependency 57 */;
|
|
const channelMemberStore = importDefault(6875) /* metro dependency 6875: ChannelMemberStore */;
|
|
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const env0_5 = constantsModule.Permissions;
|
|
const env0_6 = constantsModule.StatusTypes;
|
|
const RegExp = global.RegExp;
|
|
const regExp = new RegExp(RegExp('@(:?everyone|here)', ''));
|
|
object2 = {shouldShowEveryoneGuard: function(a0, a1) {
|
|
importDefault(dependencyMap[4])(a1.getGuildId(), 'isGuildChannel with null guildId');
|
|
value = everyoneMemberCount(a0, a1);
|
|
value = value > 30;
|
|
return value && PermissionStore.can(Permissions.MENTION_EVERYONE, a1);
|
|
}, everyoneMemberCount: closure, extractEveryoneRole: function(a0, a1) {
|
|
var value4;
|
|
var value5;
|
|
var value2 = _createForOfIteratorHelperLoose_84373(importDefault(dependencyMap[5]).parsePreprocessor(a1, a0));
|
|
var value3 = value2();
|
|
if (value3.done) {
|
|
return null;
|
|
}
|
|
var r3 = value3;
|
|
loopExit1: while (true) {
|
|
value4 = parsedItemUsesEveryoneRole(r3.value);
|
|
if (value4 != null) {
|
|
break loopExit1;
|
|
}
|
|
value5 = value2();
|
|
if (value5.done) {
|
|
return null;
|
|
}
|
|
r3 = value5;
|
|
continue;
|
|
}
|
|
return value4;
|
|
}};
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/MentionGuardUtils.tsx');
|
|
exports.default = object2;
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_84373(a0, a1) { // fn#84373, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11199:173, offset: 0x01f47771, size: 372 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun84374;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_84375(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_84375(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_84375(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun84374;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
}
|
|
|
|
function everyoneMemberCount(a0, a1) { // fn#84376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11199:1122, offset: 0x01f478e5, size: 119 bytes, params: 3, frame: 16
|
|
var r0;
|
|
const env0_0 = a0;
|
|
const value = 0;
|
|
if (a1.isThread()) {
|
|
r0 = a1.memberCount ?? value;
|
|
} else {
|
|
ChannelMemberStore.getProps(a1.getGuildId(), a1.id).groups.forEach(_fun84377);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function parsedItemUsesEveryoneRole(a0) { // fn#84378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11199:1321, offset: 0x01f479a1, size: 221 bytes, params: 2, frame: 18
|
|
var r4;
|
|
var r2;
|
|
var value2;
|
|
var value3;
|
|
var done;
|
|
var parsedItemUsesEveryoneRoleBinding;
|
|
var value4;
|
|
var value5;
|
|
var value6;
|
|
var type;
|
|
if (typeof a0.content === 'string') {
|
|
type = a0.type;
|
|
if (type === 'inlineCode') {
|
|
return null;
|
|
}
|
|
type = a0.type;
|
|
if (type === 'codeBlock') {
|
|
return null;
|
|
}
|
|
r2 = a0.content?.match(env0_7);
|
|
if (r2 != null) {
|
|
return env0_2(r2, 1)[0];
|
|
}
|
|
} else {
|
|
var Array = global.Array;
|
|
if (Array.isArray(a0.content)) {
|
|
value2 = _createForOfIteratorHelperLoose_84373(a0.content);
|
|
value3 = value2();
|
|
done = value3.done;
|
|
if (done) {
|
|
return null;
|
|
}
|
|
r4 = value3;
|
|
loopExit3: while (true) {
|
|
parsedItemUsesEveryoneRoleBinding = parsedItemUsesEveryoneRole;
|
|
value4 = r4.value;
|
|
value5 = parsedItemUsesEveryoneRoleBinding(value4);
|
|
if (value5 != null) {
|
|
break loopExit3;
|
|
}
|
|
value6 = value2();
|
|
done = value6.done;
|
|
if (done) {
|
|
return null;
|
|
}
|
|
r4 = value6;
|
|
continue;
|
|
}
|
|
return value5;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function _fun84377(a0) { // fn#84377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11199:1263, offset: 0x01f4795c, size: 69 bytes, params: 2, frame: 5
|
|
if (!(env0_0 !== '@everyone' && a0.id === StatusTypes.OFFLINE)) {
|
|
env0_1 = env0_1 + a0.count;
|
|
}
|
|
}
|
|
|