400 lines
16 KiB
TypeScript
400 lines
16 KiB
TypeScript
/* Metro module 11933; source: modules/guild_progress/GuildProgressStore.tsx; dependencies: [6, 7, 15, 17, 18, 1226, 1379, 1867, 11927, 21, 566, 694, 2] */
|
|
function _fun91578(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#91578, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12119:6, offset: 0x0206a7bf, size: 502 bytes, params: 8, frame: 19
|
|
const _arrayLikeToArray_91584 = 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 Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_3 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_4 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_5 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_6 = importDefault(18) /* metro dependency 18 */;
|
|
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const env0_10 = (require(11927) /* metro dependency 11927: GuildProgressConstants */).Steps;
|
|
const env0_11 = {};
|
|
const PersistedStore = (importDefault(566) /* metro dependency 566: flux */).PersistedStore;
|
|
let value = _fun91586(PersistedStore);
|
|
value.displayName = 'GuildProgressStore';
|
|
value.persistKey = 'GuildProgressStore';
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{CONNECTION_OPEN: CONNECTION_OPEN_91593, GUILD_PROGRESS_INITIALIZE: GUILD_PROGRESS_INITIALIZE,
|
|
GUILD_PROGRESS_COMPLETED_SEEN: GUILD_PROGRESS_COMPLETED_SEEN, GUILD_PROGRESS_DISMISS: function({guildId}) {
|
|
return completeStep(guildId, Steps.DISMISSED);
|
|
}, GUILD_CREATE: GUILD_CREATE_91599, CHANNEL_CREATE: CHANNEL_CREATE_91600, CHANNEL_UPDATES: CHANNEL_UPDATES_91601,
|
|
GUILD_SETTINGS_SUBMIT_SUCCESS: GUILD_SETTINGS_SUBMIT_SUCCESS_91602, MESSAGE_CREATE: MESSAGE_CREATE_91603,
|
|
GUILD_MEMBER_LIST_UPDATE: GUILD_MEMBER_LIST_UPDATE_91604});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_progress/GuildProgressStore.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_91579() { // fn#91579, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12119:197, offset: 0x0206a9b5, size: 98 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_91579_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_91582(a0, a1) { // fn#91582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12119:390, offset: 0x0206aa17, 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 _fun91583;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_91584(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_91584(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_91584(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun91583;
|
|
}
|
|
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 completeStep(a0, a1) { // fn#91585, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12119:1309, offset: 0x0206ab8b, size: 95 bytes, params: 3, frame: 16
|
|
var r1;
|
|
var r0;
|
|
var value3;
|
|
var binding;
|
|
var Set;
|
|
var set;
|
|
var value;
|
|
const property = env0_11[a0];
|
|
const value2 = property != null;
|
|
if (value2) {
|
|
value3 = property.has(a1);
|
|
if (value3) {
|
|
r1 = !value3;
|
|
} else {
|
|
binding = env0_11;
|
|
Set = global.Set;
|
|
value = property.add(a1);
|
|
set = new Set();
|
|
binding[a0] = set;
|
|
set = true;
|
|
r1 = set;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun91586(a0) { // fn#91586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12119:1410, offset: 0x0206abea, size: 149 bytes, params: 2, frame: 16
|
|
const closure = GuildProgressStore;
|
|
env0_6(closure, a0);
|
|
return env0_3(closure, [{key: 'initialize', value: value_91588}, {key: 'getProgress', value: value_91590},
|
|
{key: 'hasProgress', value: value_91591}, {key: 'getState', value: value_91592}]);
|
|
}
|
|
|
|
function CONNECTION_OPEN_91593() { // fn#91593, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12119:2203, offset: 0x0206ad7d, size: 85 bytes, params: 1, frame: 14
|
|
(importDefault(21) /* metro dependency 21: SnowflakeUtils */).keys(env0_11).forEach(_fun91594);
|
|
[].forEach(function(a0) {
|
|
return completeStep(a0, Steps.DISMISSED);
|
|
});
|
|
}
|
|
|
|
function GUILD_PROGRESS_INITIALIZE({guildId}) { // fn#91596, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12119:2380, offset: 0x0206ae2a, size: 124 bytes, params: 2, frame: 13
|
|
var binding;
|
|
var Set;
|
|
var value2;
|
|
var set;
|
|
if (env0_11[guildId] == null) {
|
|
binding = env0_11;
|
|
Set = global.Set;
|
|
value2 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
set = new Set();
|
|
binding[guildId] = set instanceof Object ? set : value2;
|
|
}
|
|
const property = env0_11[guildId];
|
|
const has = property.has;
|
|
const COMPLETED = Steps.COMPLETED;
|
|
if (!Reflect.apply(has, property, [COMPLETED])) {
|
|
env0_11[guildId].delete(Steps.DISMISSED);
|
|
}
|
|
}
|
|
|
|
function GUILD_PROGRESS_COMPLETED_SEEN({guildId}) { // fn#91597, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12119:2525, offset: 0x0206aea6, size: 97 bytes, params: 2, frame: 14
|
|
if (env0_11[guildId] == null) {
|
|
return false;
|
|
}
|
|
const binding = env0_11;
|
|
const Set = global.Set;
|
|
const property = env0_11[guildId];
|
|
const add = property.add;
|
|
const COMPLETED = Steps.COMPLETED;
|
|
const value = Reflect.apply(add, property, [COMPLETED]);
|
|
const value2 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
const set = new Set(value);
|
|
binding[guildId] = set instanceof Object ? set : value2;
|
|
}
|
|
|
|
function GUILD_CREATE_91599({guild}) { // fn#91599, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12119:2748, offset: 0x0206af2a, size: 183 bytes, params: 2, frame: 15
|
|
var property;
|
|
const id = guild.id;
|
|
const member_count = guild.member_count;
|
|
const guild2 = GuildStore.getGuild(id);
|
|
if (guild2 == null) {
|
|
return false;
|
|
}
|
|
const ownerId = guild2.ownerId;
|
|
const getId = AuthenticationStore.getId;
|
|
if (ownerId === Reflect.apply(getId, AuthenticationStore, []) && env0_11[guild2.id] != null) {
|
|
if (guild2.icon != null) {
|
|
property = env0_11[guild2.id];
|
|
property.add(Steps.AVATAR);
|
|
}
|
|
if (member_count > 1) {
|
|
property = env0_11[guild2.id];
|
|
property.add(Steps.INVITE);
|
|
}
|
|
}
|
|
}
|
|
|
|
function CHANNEL_CREATE_91600({channel}) { // fn#91600, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12119:2965, offset: 0x0206afe1, size: 84 bytes, params: 2, frame: 14
|
|
return channel != null && channel.guild_id != null && env0_11[channel.guild_id] != null && completeStep(channel.guild_id,
|
|
Steps.CHANNEL);
|
|
}
|
|
|
|
function CHANNEL_UPDATES_91601({channels}) { // fn#91601, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12119:3114, offset: 0x0206b035, size: 144 bytes, params: 2, frame: 22
|
|
var r2;
|
|
var r3;
|
|
var r1;
|
|
var r0;
|
|
var value5;
|
|
var value6;
|
|
var guild_id;
|
|
var value7;
|
|
var binding;
|
|
var value8;
|
|
var completeStepBinding;
|
|
var CHANNEL;
|
|
var value9;
|
|
var value10;
|
|
var value11;
|
|
const value2 = _createForOfIteratorHelperLoose_91582(channels);
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (done) {
|
|
r0 = false;
|
|
} else {
|
|
r2 = false;
|
|
r3 = value3;
|
|
while (true) {
|
|
value5 = r3.value;
|
|
value6 = value5 != null;
|
|
if (value6) {
|
|
value7 = value5.guild_id != null;
|
|
r1 = value7;
|
|
} else {
|
|
r1 = value6;
|
|
}
|
|
if (!r1) {
|
|
continue;
|
|
}
|
|
binding = env0_11;
|
|
guild_id = value5.guild_id;
|
|
value8 = binding[guild_id] != null;
|
|
r1 = value8;
|
|
if (!r1) {
|
|
continue;
|
|
}
|
|
completeStepBinding = completeStep;
|
|
guild_id = value5.guild_id;
|
|
CHANNEL = Steps.CHANNEL;
|
|
value9 = completeStepBinding(guild_id, CHANNEL) !== false;
|
|
r1 = value9;
|
|
if (!r1) {
|
|
continue;
|
|
}
|
|
value10 = true;
|
|
r2 = value10;
|
|
value11 = value2();
|
|
done = value11.done;
|
|
if (done) {
|
|
r0 = r2;
|
|
break;
|
|
}
|
|
r3 = value11;
|
|
continue;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function GUILD_SETTINGS_SUBMIT_SUCCESS_91602({guild}) { // fn#91602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12119:3376, offset: 0x0206b0c5, size: 99 bytes, params: 2, frame: 15
|
|
var r1;
|
|
var r0;
|
|
const value = guild != null;
|
|
if (value) {
|
|
r1 = guild.id != null && env0_11[guild.id] != null;
|
|
r1 = r1 && guild.icon != null;
|
|
r1 = r1 && completeStep(guild.id, Steps.AVATAR);
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function MESSAGE_CREATE_91603({channelId, message}) { // fn#91603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12119:3519, offset: 0x0206b128, size: 129 bytes, params: 2, frame: 16
|
|
const channel = ChannelStore.getChannel(channelId);
|
|
const id = message.author?.id;
|
|
const getId = AuthenticationStore.getId;
|
|
return id === Reflect.apply(getId, AuthenticationStore,
|
|
[]) && channel != null && env0_11[channel.guild_id] != null && completeStep(channel.guild_id, Steps.MESSAGE);
|
|
}
|
|
|
|
function GUILD_MEMBER_LIST_UPDATE_91604({guildId, memberCount}) { // fn#91604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12119:3734, offset: 0x0206b1a9, size: 68 bytes, params: 2, frame: 14
|
|
return env0_11[guildId] != null && memberCount > 1 && completeStep(guildId, Steps.INVITE);
|
|
}
|
|
|
|
function value_91588(a0) { // fn#91588, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12119:1730, offset: 0x0206ac7f, size: 105 bytes, params: 2, frame: 18
|
|
var environment;
|
|
const env0_0 = a0;
|
|
const waitFor = this.waitFor;
|
|
let value = environment.__proto__;
|
|
Reflect.apply(waitFor, this, [AuthenticationStore, ChannelStore, GuildStore]);
|
|
env1_11 = {};
|
|
if (a0 != null) {
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = value.keys(a0);
|
|
value.forEach(_fun91589);
|
|
}
|
|
}
|
|
|
|
function value_91591(a0) { // fn#91591, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12119:1963, offset: 0x0206ad4d, size: 48 bytes, params: 2, frame: 12
|
|
const value = environment.__proto__;
|
|
const property = env1_11[a0];
|
|
return property != null && !property.has(Steps.DISMISSED);
|
|
}
|
|
|
|
function _fun91594(a0) { // fn#91594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12119:2269, offset: 0x0206add2, size: 58 bytes, params: 2, frame: 12
|
|
const property = env1_11[a0];
|
|
const has = property.has;
|
|
const COMPLETED = Steps.COMPLETED;
|
|
if (Reflect.apply(has, property, [COMPLETED])) {
|
|
env0_0.push(a0);
|
|
}
|
|
}
|
|
|
|
function _fun91589(a0) { // fn#91589, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12119:1801, offset: 0x0206ace8, size: 101 bytes, params: 2, frame: 13
|
|
var value;
|
|
const property = env0_0[a0];
|
|
if (property != null && typeof property[global.Symbol.iterator] === 'function') {
|
|
value = environment.__proto__.__proto__;
|
|
env2_11[a0] = new global.Set(property);
|
|
}
|
|
}
|
|
|