265 lines
12 KiB
TypeScript
265 lines
12 KiB
TypeScript
/* Metro module 11986; source: modules/hub/HubProgressBarUtils.tsx; dependencies: [31, 1348, 5040, 6928, 661, 566, 1314, 1244, 1360, 1391, 2] */
|
|
import UserSettingsProtoStore from '../user_settings/UserSettingsProtoStore.tsx'; /* Metro dependency 1348 */
|
|
import ConnectedAccountsStore from '../../stores/ConnectedAccountsStore.tsx'; /* Metro dependency 5040 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as Preloaded_user_settingsModule from '../../external/discord_common/js/packages/protos/discord_protos/discord_users/v1/preloaded_user_settings.tsx'; /* Metro dependency 1314 */
|
|
import * as GlobalUtilsModule from '../../utils/GlobalUtils.tsx'; /* Metro dependency 1360 */
|
|
import * as HubProgressBarConstantsModule from './HubProgressBarConstants.tsx'; /* Metro dependency 6928 */
|
|
|
|
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});
|
|
(FileImportTrackerModule).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 _fun92016() { // fn#92016, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12172:762, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return env0_1 >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
|
|
}
|
|
|
|
}
|
|
|
|
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 ReactModule.useMemo(_fun92020,
|
|
[(FluxModule).useStateFromStores([UserSettingsProtoStore], _fun92019)]);
|
|
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 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 = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const HubProgressStep = (Preloaded_user_settingsModule).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;
|
|
}
|
|
(GlobalUtilsModule).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 ReactModule.useMemo(_fun92025, [useCompletedStepsFromSettings(a0?.id),
|
|
(() => (require(566) /* metro dependency 566: flux */).useStateFromStores([ConnectedAccountsStore],
|
|
_fun92024))()]);
|
|
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 (FluxModule).useStateFromStores([ConnectedAccountsStore], _fun92024);
|
|
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 connectedAccountsStoreBinding = ConnectedAccountsStore;
|
|
const getLocalAccount = connectedAccountsStoreBinding.getLocalAccount;
|
|
const CONTACTS = PlatformTypes.CONTACTS;
|
|
return Reflect.apply(getLocalAccount, connectedAccountsStoreBinding, [CONTACTS]) != null;
|
|
}
|
|
|
|
}
|
|
|
|
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 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;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun92014, 11986, [31, 1348, 5040, 6928, 661, 566, 1314, 1244, 1360, 1391,
|
|
2]) /* metro module 11986, dependencies: [31, 1348, 5040, 6928, 661, 566, 1314, 1244, 1360, 1391, 2] */;
|