251 lines
10 KiB
TypeScript
251 lines
10 KiB
TypeScript
/* Metro module 11986; source: modules/hub/HubProgressBarUtils.tsx; dependencies: [31, 1348, 5040, 6928, 661, 566, 1314, 1244, 1360, 1391, 2] */
|
|
function _fun92014(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#92014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12172:6, offset: 0x0207a833, size: 252 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_92017 = 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 = importAll(31) /* metro dependency 31 */;
|
|
const userSettingsProtoStore = importDefault(1348) /* metro dependency 1348: UserSettingsProtoStore */;
|
|
const connectedAccountsStore = importDefault(5040) /* metro dependency 5040: ConnectedAccountsStore */;
|
|
const env0_5 = (require(6928) /* metro dependency 6928: HubProgressBarConstants */).HUB_PROGRESS_STEP_ORDER;
|
|
const env0_6 = (require(661) /* metro dependency 661: Constants */).PlatformTypes;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/hub/HubProgressBarUtils.tsx');
|
|
exports.getHubProgressTitleForStep = getHubProgressTitleForStep;
|
|
exports.useHubProgressBarCompletedSteps = useHubProgressBarCompletedSteps;
|
|
exports.getNextHubProgressStep = getNextHubProgressStep;
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_92015(a0, a1) { // fn#92015, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12172:191, offset: 0x0207a92f, 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 _fun92016;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_92017(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_92017(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_92017(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun92016;
|
|
}
|
|
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 useCompletedStepsFromSettings(a0) { // fn#92018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12172:1101, offset: 0x0207aaa3, size: 100 bytes, params: 2, frame: 15
|
|
const env0_0 = a0;
|
|
return env0_2.useMemo(_fun92020,
|
|
[(require(566) /* metro dependency 566: flux */).useStateFromStores([UserSettingsProtoStore], _fun92019)]);
|
|
}
|
|
|
|
function getHubProgressTitleForStep(a0) { // fn#92021, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12172:1605, offset: 0x0207abe7, size: 357 bytes, params: 2, frame: 15
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const HubProgressStep = (require(1314) /* metro dependency 1314: preloaded_user_settings */).HubProgressStep;
|
|
const JOIN_GUILD = HubProgressStep.JOIN_GUILD;
|
|
if (JOIN_GUILD === a0) {
|
|
return intl.string(t.iNR25n);
|
|
}
|
|
const INVITE_USER = HubProgressStep.INVITE_USER;
|
|
if (INVITE_USER === a0) {
|
|
return intl.string(t['3NlTYU']);
|
|
}
|
|
const CONTACT_SYNC = HubProgressStep.CONTACT_SYNC;
|
|
if (CONTACT_SYNC === a0) {
|
|
return intl.string(t.HFvFte);
|
|
}
|
|
const NO_PROGRESS = HubProgressStep.NO_PROGRESS;
|
|
if (NO_PROGRESS === a0) {
|
|
return null;
|
|
}
|
|
(require(1360) /* metro dependency 1360: GlobalUtils */).assertNever(a0);
|
|
}
|
|
|
|
function useHubProgressBarCompletedSteps(a0) { // fn#92022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12172:2047, offset: 0x0207ad4c, size: 90 bytes, params: 2, frame: 16
|
|
return env0_2.useMemo(_fun92025, [useCompletedStepsFromSettings(a0?.id),
|
|
(() => (require(566) /* metro dependency 566: flux */).useStateFromStores([ConnectedAccountsStore],
|
|
_fun92024))()]);
|
|
}
|
|
|
|
function getNextHubProgressStep(a0) { // fn#92026, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12172:2417, offset: 0x0207ae66, size: 72 bytes, params: 2, frame: 14
|
|
var value3;
|
|
var has;
|
|
var value4;
|
|
const value = _createForOfIteratorHelperLoose_92015(HUB_PROGRESS_STEP_ORDER);
|
|
const value2 = value();
|
|
let done = value2.done;
|
|
if (done) {
|
|
return null;
|
|
}
|
|
let r1 = value2;
|
|
loopExit1: while (true) {
|
|
value3 = r1.value;
|
|
has = a0.has;
|
|
if (Reflect.apply(has, a0, [value3])) {
|
|
value4 = value();
|
|
done = value4.done;
|
|
if (done) {
|
|
return null;
|
|
}
|
|
r1 = value4;
|
|
continue;
|
|
}
|
|
break loopExit1;
|
|
}
|
|
return value3;
|
|
}
|
|
|
|
function _fun92019() { // fn#92019, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12172:1182, offset: 0x0207ab07, size: 92 bytes, params: 1, frame: 8
|
|
const value2 = 0;
|
|
return env0_0 == null ? value2 : (UserSettingsProtoStore.settings.guilds == null || UserSettingsProtoStore.settings.guilds.guilds[env0_0] == null ? undefined : UserSettingsProtoStore.settings.guilds.guilds[env0_0].hubProgress) ?? value2;
|
|
}
|
|
|
|
function _fun92020() { // fn#92020, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12172:1319, offset: 0x0207ab63, size: 132 bytes, params: 1, frame: 19
|
|
var r2;
|
|
var value5;
|
|
var moduleValue;
|
|
var hasFlag;
|
|
var value6;
|
|
const binding = env0_1;
|
|
const Set = global.Set;
|
|
const set = new Set();
|
|
const value3 = _createForOfIteratorHelperLoose_92015(HUB_PROGRESS_STEP_ORDER);
|
|
const value4 = value3();
|
|
let done = value4.done;
|
|
if (!done) {
|
|
r2 = value4;
|
|
while (true) {
|
|
value5 = r2.value;
|
|
moduleValue = require(1391) /* metro dependency 1391: FlagUtils */;
|
|
hasFlag = moduleValue.hasFlag;
|
|
if (Reflect.apply(hasFlag, moduleValue, [binding, value5])) {
|
|
set.add(value5);
|
|
}
|
|
value6 = value3();
|
|
done = value6.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r2 = value6;
|
|
continue;
|
|
}
|
|
}
|
|
return set;
|
|
}
|
|
|
|
function useContactSyncEverEnabled() { // fn#92023, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12172:2150, owner: useHubProgressBarCompletedSteps.useContactSyncEverEnabled, offset: 0x0207ada6, size: 59 bytes, params: 1, frame: 13
|
|
return (require(566) /* metro dependency 566: flux */).useStateFromStores([ConnectedAccountsStore], _fun92024);
|
|
}
|
|
|
|
function _fun92025() { // fn#92025, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12172:2290, offset: 0x0207ae05, size: 97 bytes, params: 1, frame: 13
|
|
var Set;
|
|
var binding;
|
|
var set;
|
|
var add;
|
|
var value2;
|
|
if (env0_1) {
|
|
Set = global.Set;
|
|
binding = env0_0;
|
|
set = new Set();
|
|
add = set.add;
|
|
value2 = environment.__proto__;
|
|
Reflect.apply(add, set,
|
|
[(require(1314) /* metro dependency 1314: preloaded_user_settings */).HubProgressStep.CONTACT_SYNC]);
|
|
return set;
|
|
}
|
|
return env0_0;
|
|
}
|
|
|
|
function _fun92024() { // fn#92024, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12172:2227, offset: 0x0207ade1, size: 36 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__.__proto__;
|
|
const getLocalAccount = ConnectedAccountsStore.getLocalAccount;
|
|
const CONTACTS = PlatformTypes.CONTACTS;
|
|
return Reflect.apply(getLocalAccount, ConnectedAccountsStore, [CONTACTS]) != null;
|
|
}
|
|
|