decord/source/modules/nuf/native/NewUserManager.tsx

306 lines
9.9 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 16740
// Function ID: 16741
2026-07-29 08:29:29 +00:00
// Name: items
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 8620, 5226, 1922, 4498, 11927, 676, 11946, 16741, 11898, 11926, 691, 8955, 709, 5043, 11905, 11974, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 16740 (items)
import keys from "keys" /* 691 */;
import dispatcherDefault from "dispatcher" /* 709 */;
import initializeDefault from "initialize" /* 5043 */;
import _startContactSyncForDiscoverability from "_startContactSyncForDiscoverability" /* 11926 */;
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "handleSetLocationMetadata" /* 8620 */;
import closure_5 from "set" /* 5226 */;
import closure_6 from "mergeGuildAvatar" /* 1922 */;
import closure_7 from "initialize" /* 4498 */;
import { NewUserTypes } from "NewUserTypes" /* 11927 */;
import { PlatformTypes } from "ME" /* 676 */;
import { HUBS_IN_ONBOARDING_COUNTRIES as closure_10 } from "HubEmailConnectionSteps" /* 11946 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
let obj = { REGISTRATION: "Registration", ADD_AVATAR: "Add Avatar", CONTACT_SYNC: "Contact Sync", GUILD_TEMPLATE: "Guild Template", STUDENT_HUB: "Student Hub", NEW_USER_INTENT: "New User Intent", ACCEPT_INVITE: "Accept Invite", DISCOVERABILITY: "Discoverability" };
obj = {
key: obj.ADD_AVATAR,
shouldShowStep() {
const currentUser = authStore.getCurrentUser();
let avatar;
2026-07-29 08:29:29 +00:00
if (currentUser != null) {
2026-07-20 16:05:17 +00:00
avatar = currentUser.avatar;
}
return null == avatar;
},
2026-07-29 08:29:29 +00:00
transitionToStep: require("handlePressNext").openAddAvatarModal
2026-07-20 16:05:17 +00:00
};
obj = {
key: obj.CONTACT_SYNC,
shouldShowStep() {
const localAccount = store.getLocalAccount(PlatformTypes.CONTACTS);
2026-07-29 08:29:29 +00:00
let friendSync;
if (localAccount != null) {
friendSync = localAccount.friendSync;
}
let tmp3 = !friendSync;
if (!friendSync) {
2026-07-20 16:05:17 +00:00
const currentUser = authStore.getCurrentUser();
let phone;
2026-07-29 08:29:29 +00:00
if (currentUser != null) {
2026-07-20 16:05:17 +00:00
phone = currentUser.phone;
}
2026-07-29 08:29:29 +00:00
tmp3 = null != phone;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp3;
2026-07-20 16:05:17 +00:00
},
2026-07-23 10:11:24 +00:00
transitionToStep: require("handleNameInputScreenOrSuggestions").openContactSyncModalOnboarding
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
const items = [
2026-07-20 16:05:17 +00:00
obj,
{
key: obj.DISCOVERABILITY,
shouldShowStep() {
return null == store.getLocalAccount(PlatformTypes.CONTACTS);
},
2026-07-23 10:11:24 +00:00
transitionToStep: require("_startContactSyncForDiscoverability").openDiscoverabilityModal
2026-07-20 16:05:17 +00:00
},
obj,
{
key: obj.STUDENT_HUB,
shouldShowStep() {
if (store2.getType() !== NewUserTypes.ORGANIC_REGISTERED) {
return false;
} else {
2026-07-23 10:11:24 +00:00
countryCode = countryCode.getCountryCode();
2026-07-20 16:05:17 +00:00
let alpha2;
2026-07-29 08:29:29 +00:00
if (countryCode != null) {
2026-07-20 16:05:17 +00:00
alpha2 = countryCode.alpha2;
}
2026-07-29 08:29:29 +00:00
return closure_10.includes(alpha2);
2026-07-20 16:05:17 +00:00
}
},
transitionToStep() {
2026-08-24 06:08:38 +00:00
const result = _startContactSyncForDiscoverability.transitionToHubEmailConnectionModal(keys.ModalAnimation.SLIDE_IN, true);
2026-07-20 16:05:17 +00:00
}
},
{
key: obj.GUILD_TEMPLATE,
shouldShowStep() {
return store2.getType() === NewUserTypes.ORGANIC_REGISTERED;
},
transitionToStep() {
2026-08-24 06:08:38 +00:00
return _startContactSyncForDiscoverability.transitionToNUFGuildTemplatesModal(keys.ModalAnimation.SLIDE_IN);
2026-07-20 16:05:17 +00:00
}
},
];
2026-07-29 08:29:29 +00:00
let obj1 = {
2026-07-20 16:05:17 +00:00
key: obj.DISCOVERABILITY,
shouldShowStep() {
return null == store.getLocalAccount(PlatformTypes.CONTACTS);
},
2026-07-23 10:11:24 +00:00
transitionToStep: require("_startContactSyncForDiscoverability").openDiscoverabilityModal
2026-07-20 16:05:17 +00:00
};
items[5] = {
key: obj.ACCEPT_INVITE,
2026-07-23 10:11:24 +00:00
shouldShowStep: require("showInstantInviteActionSheet").hasDeferredInvite,
2026-07-20 16:05:17 +00:00
transitionToStep() {
2026-08-24 06:08:38 +00:00
dispatcherDefault.dispatch({ type: "DEFERRED_INVITE_SHOW" });
2026-07-20 16:05:17 +00:00
}
};
2026-08-24 06:08:38 +00:00
initializeDefault;
2026-07-29 08:29:29 +00:00
let prototype = function NewUserManager() {
let applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
2026-08-24 06:08:38 +00:00
closure_0 = applyArgumentsResult;
2026-07-29 08:29:29 +00:00
applyArgumentsResult._onboardingStepIndex = -1;
applyArgumentsResult._lastStep = null;
applyArgumentsResult.actions = {
ONBOARDING_STEP(guildId) {
closure_0.handleOnboardingStep(guildId);
}
};
closure_0 = undefined;
2026-08-24 06:08:38 +00:00
importDefault = applyArgumentsResult;
2026-07-29 08:29:29 +00:00
closure_0 = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
let transitionToStep = 0;
2026-07-29 08:29:29 +00:00
const iter = (function*(arg0) {
2026-08-24 06:08:38 +00:00
if (c6 === 2) {
c6 = 3;
2026-07-29 08:29:29 +00:00
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
2026-08-24 06:08:38 +00:00
c6 = 2;
if (0 === c5) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
2026-08-24 06:08:38 +00:00
c6 = 3;
2026-07-29 08:29:29 +00:00
throw arg1;
} else if (arg0 === 2) {
2026-08-24 06:08:38 +00:00
c6 = 3;
2026-07-29 08:29:29 +00:00
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
c4 = 0;
2026-07-29 08:29:29 +00:00
let _onboardingStepIndex = tmp2;
let flag;
2026-08-24 06:08:38 +00:00
c1 = undefined;
c2 = undefined;
2026-07-29 08:29:29 +00:00
flag = flag.skip;
if (flag === undefined) {
flag = false;
}
let flag2 = tmp83.skipAttempt;
if (flag2 === undefined) {
flag2 = false;
}
c1 = flag2;
let flag3 = tmp83.back;
if (flag3 === undefined) {
flag3 = false;
}
c2 = flag3;
_onboardingStepIndex = undefined;
c4 = undefined;
2026-08-24 06:08:38 +00:00
c5 = undefined;
c6 = undefined;
c7 = undefined;
c8 = undefined;
c9 = undefined;
transitionToStep = undefined;
c5 = 1;
c6 = 1;
2026-08-12 06:57:52 +00:00
return { value: "ct", done: true };
2026-07-29 08:29:29 +00:00
}
} else if (1 === tmp5) {
if (arg0 === 1) {
2026-08-24 06:08:38 +00:00
c6 = 3;
2026-07-29 08:29:29 +00:00
throw arg1;
} else if (arg0 === 2) {
2026-08-24 06:08:38 +00:00
c6 = 3;
obj1 = { value: null, done: true };
2026-07-29 08:29:29 +00:00
obj1[0] = arg1;
return obj1;
} else {
_onboardingStepIndex = c1._onboardingStepIndex;
if (c2) {
2026-08-24 06:08:38 +00:00
key = undefined;
if (closure_1_11[closure_1_3] != null) {
2026-07-29 08:29:29 +00:00
key = tmp53.key;
}
c1 = key;
if (key == null) {
c1 = null;
}
c1._lastStep = c1;
2026-08-24 06:08:38 +00:00
closure_1_1._onboardingStepIndex = closure_1_1._onboardingStepIndex - 1;
closure_4 = closure_1_11[closure_1_1._onboardingStepIndex];
key = closure_4.key;
transitionToStep = closure_4.transitionToStep;
callback(closure_1_2[15]).trackNUFStep(closure_1_1._lastStep, key, { back: true });
transitionToStep();
c6 = 3;
2026-07-29 08:29:29 +00:00
const obj2 = { value: null, done: true };
obj2[0] = undefined;
return obj2;
} else {
c1._onboardingStepIndex = c1._onboardingStepIndex + 1;
2026-08-24 06:08:38 +00:00
if (c1._onboardingStepIndex >= closure_1_11.length) {
let obj5 = callback(closure_1_2[15]);
2026-07-29 08:29:29 +00:00
const obj3 = { skip_attempt: null };
obj3[0] = c1;
obj5.trackNUFStep(c1._lastStep, "NUF Complete", obj3);
2026-08-24 06:08:38 +00:00
let obj7 = callback(closure_1_2[16]);
2026-07-29 08:29:29 +00:00
const result = obj7.setNewUserFlowCompleted();
2026-08-24 06:08:38 +00:00
c6 = 3;
2026-07-29 08:29:29 +00:00
const obj4 = { value: null, done: true };
obj4[0] = undefined;
return obj4;
} else {
2026-08-24 06:08:38 +00:00
closure_7 = closure_1_11[c1._onboardingStepIndex];
key = closure_7.key;
shouldShowStep = closure_7.shouldShowStep;
transitionToStep = closure_7.transitionToStep;
c5 = 2;
c6 = 1;
2026-07-29 08:29:29 +00:00
obj5 = { value: null, done: false };
2026-08-24 06:08:38 +00:00
obj5[0] = shouldShowStep();
2026-07-29 08:29:29 +00:00
return obj5;
}
}
}
} else if (arg0 === 1) {
2026-08-24 06:08:38 +00:00
c6 = 3;
2026-07-29 08:29:29 +00:00
throw arg1;
} else if (arg0 === 2) {
2026-08-24 06:08:38 +00:00
c6 = 3;
2026-07-29 08:29:29 +00:00
const obj6 = { value: null, done: true };
obj6[0] = arg1;
return obj6;
} else {
if (arg1) {
2026-08-24 06:08:38 +00:00
obj1 = callback(closure_1_2[15]);
2026-07-29 08:29:29 +00:00
obj7 = { skip: null, skip_attempt: null };
obj7[0] = flag;
obj7[1] = c1;
obj1.trackNUFStep(c1._lastStep, c8, obj7);
let key1;
2026-08-24 06:08:38 +00:00
if (closure_1_11[_onboardingStepIndex] != null) {
2026-07-29 08:29:29 +00:00
key1 = tmp19.key;
}
c2 = key1;
if (key1 == null) {
c2 = null;
}
c1._lastStep = c2;
2026-08-24 06:08:38 +00:00
transitionToStep();
2026-07-29 08:29:29 +00:00
const tmp16 = c1;
} else {
obj = { skip: null };
obj[0] = flag;
c1.handleOnboardingStep(obj);
}
2026-08-24 06:08:38 +00:00
c6 = 3;
2026-07-29 08:29:29 +00:00
}
} catch (tmp71) {
2026-08-24 06:08:38 +00:00
c6 = tmp;
2026-07-29 08:29:29 +00:00
throw tmp71;
}
}
})();
iter.next();
return iter;
});
applyArgumentsResult.handleOnboardingStep = function() {
const self = this;
const apply = closure_0.apply;
if (typeof apply === "unknown") {
2026-08-24 06:08:38 +00:00
applyArgumentsResult = HermesBuiltin.applyArguments(self);
2026-07-29 08:29:29 +00:00
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
};
return applyArgumentsResult;
}.prototype;
class prototype extends tmp2 {
}
prototype = new prototype();
let obj2 = {
2026-07-20 16:05:17 +00:00
key: obj.ACCEPT_INVITE,
2026-07-23 10:11:24 +00:00
shouldShowStep: require("showInstantInviteActionSheet").hasDeferredInvite,
2026-07-20 16:05:17 +00:00
transitionToStep() {
2026-08-24 06:08:38 +00:00
dispatcherDefault.dispatch({ type: "DEFERRED_INVITE_SHOW" });
2026-07-20 16:05:17 +00:00
}
};
2026-07-29 08:29:29 +00:00
let result = require("set").fileFinishedImporting("modules/nuf/native/NewUserManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default prototype;