decord/source/modules/multi_account/native/ChooseAccount.tsx
github-actions 67d978d9fb chore: update source for alpha 346.0
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9672_m.js (378.6 MB)
2026-09-07 16:44:02 +00:00

240 lines
10 KiB
TypeScript

// Module ID: 15953
// Function ID: 15954
// Name: ChooseAccount
// Dependencies: [5, 19, 17, 12417, 12418, 1074, 21, 4560, 576, 1483, 15954, 1242, 12421, 4905, 1114, 1178, 4527, 7195, 6972, 4556, 13867, 15955, 5123, 9805, 8598, 15956, 2]
// Exports: default
// Module 15953 (ChooseAccount)
import noopAll from "noop" /* 19 */;
import ThemesDefault from "Themes" /* 576 */;
import closure_4 from "asyncGeneratorStep" /* 5 */;
import { View } from "get ActivityIndicator" /* 17 */;
import { MultiAccountTokenStatus } from "initialize" /* 12417 */;
import MAX_ACCOUNTS from "MAX_ACCOUNTS" /* 12418 */;
import ME from "ME" /* 1074 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4560 */;
const require = arg1;
noopAll;
({ MAX_ACCOUNTS: error, MultiAccountSwitchLocation: closure_8 } = MAX_ACCOUNTS);
({ AnalyticEvents: c9, AuthStates: c10 } = ME);
({ jsx: unpackModuleId, jsxs: closure_12 } = jsxProd);
createCacheKey = { container: null, mainCard: null, addAccountLabel: null };
createCacheKey = { backgroundColor: ThemesDefault.colors.BACKGROUND_BASE_LOW, borderRadius: ThemesDefault.radii.sm, paddingTop: ThemesDefault.space.PX_16, margin: ThemesDefault.space.PX_16 };
createCacheKey[0] = createCacheKey;
createCacheKey[1] = { marginVertical: ThemesDefault.space.PX_16, borderRadius: ThemesDefault.radii.sm, flexDirection: "column", alignItems: "stretch", alignSelf: "stretch", display: "flex" };
let obj1 = { marginVertical: ThemesDefault.space.PX_16, borderRadius: ThemesDefault.radii.sm, flexDirection: "column", alignItems: "stretch", alignSelf: "stretch", display: "flex" };
createCacheKey[2] = { color: ThemesDefault.colors.TEXT_LINK };
let closure_13 = createCacheKey.createStyles(createCacheKey);
let obj2 = { color: ThemesDefault.colors.TEXT_LINK };
let result = require("set").fileFinishedImporting("modules/multi_account/native/ChooseAccount.tsx");
export default function ChooseAccount() {
function _handlePressRemove() {
const self = this;
const tmp = closure_1_4((arg0) => {
closure_0 = arg0;
c3 = 0;
c4 = 0;
return (function*(arg0) {
if (c4 === 2) {
c4 = 3;
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 {
return { value: "HermesInternal", done: null };
}
} else {
try {
c4 = 2;
if (0 === dependencyMap) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
closure_2 = tmp5;
closure_1 = tmp2;
let string = lib;
obj1 = { title: null, body: null, confirmText: null, confirmColor: null, cancelText: null, isDismissable: true };
const intl3 = lib(1114).intl;
obj1[0] = intl3.string(lib(1114).t.n0Fbg6);
const intl4 = lib(1114).intl;
let intl = intl4.formatToPlainString;
let intl2 = lib(1114).t.phEQmS;
if ("0" === lib.discriminator) {
const _HermesInternal2 = HermesInternal;
let combined = "" + string.username;
} else {
const _HermesInternal = HermesInternal;
combined = "" + string.username + "#" + string.discriminator;
}
const obj2 = { username: null };
obj2[0] = combined;
obj1[1] = intl(intl2, obj2);
intl = tmp31(1114).intl;
obj1[2] = intl.string(lib(1114).t.N86XcP);
obj1[3] = lib(1178).ButtonColors.RED;
intl2 = tmp31(1114).intl;
string = intl2.string;
obj1[4] = string(lib(1114).t["ETE/oC"]);
obj1 = closure_1_1(4905).confirm(obj1);
dependencyMap = 1;
c4 = 1;
const obj8 = closure_1_1(4905);
}
} else if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
const obj3 = { value: null, done: true };
obj3[0] = arg1;
return obj3;
} else {
if (arg1) {
obj = closure_1_1(4527);
obj.hideActionSheet();
obj1 = closure_1_2(12421);
obj1.removeAccount(lib.id);
}
c4 = 3;
return { value: "HermesInternal", done: null };
}
} catch (tmp23) {
c4 = tmp;
throw tmp23;
}
}
})();
});
closure_2 = tmp;
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
}
let tmp = callback3();
let obj = _require(1483);
_require = obj.useNavigation();
obj1 = _require(15954);
const multiAccountUsers = obj1.useMultiAccountUsers().multiAccountUsers;
obj = { headerText: null, subHeader: null, backgroundImageSource: null, backgroundImageCover: true, contentStyle: null, children: null };
let intl = _require(1114).intl;
obj[0] = intl.string(_require(1114).t.bVbB63);
obj = { variant: "text-sm/medium", color: "text-default", children: null };
let intl2 = _require(1114).intl;
obj[2] = intl2.string(_require(1114).t["0M5fN7"]);
obj[1] = callback(_require(4556).Text, obj);
obj[2] = multiAccountUsers(13867);
obj[4] = tmp.container;
obj1 = { style: tmp.mainCard, children: null };
let items = [
multiAccountUsers.map((id) => {
let obj = {
user: id,
onPressUser() {
if (arr.tokenStatus === closure_1_6.INVALID) {
arr = arr.push(closure_1_10.LOGIN);
closure_1_1(closure_1_3[11]).track(closure_1_9.LOGIN_VIEWED, { source: "choose_account_user_invalid" });
const obj2 = closure_1_1(closure_1_3[11]);
} else {
closure_1_2(closure_1_3[12]).switchAccount(tmp.id, undefined, closure_1_8.CHOOSE_ACCOUNT);
const obj = closure_1_2(closure_1_3[12]);
}
return tmp4;
},
trailing: null
};
obj = {
accessibilityRole: "button",
onPress() {
let obj = closure_1_1(closure_1_3[16]);
obj.hideActionSheet();
obj1 = arr(closure_1_3[17]);
obj = { key: "RemoveAccount", options: null, hasIcons: false };
obj = { label: null, onPress: null };
const intl = arr(closure_1_3[14]).intl;
obj[0] = intl.string(arr(closure_1_3[14]).t["DSN+hw"]);
obj[1] = function onPress() {
if (arr.tokenStatus === closure_1_6.INVALID) {
arr = arr.push(closure_1_10.LOGIN);
closure_1_1(closure_1_3[11]).track(closure_1_9.LOGIN_VIEWED, { source: "choose_account_user_invalid" });
const obj2 = closure_1_1(closure_1_3[11]);
} else {
closure_1_2(closure_1_3[12]).switchAccount(tmp.id, undefined, closure_1_8.CHOOSE_ACCOUNT);
const obj = closure_1_2(closure_1_3[12]);
}
return tmp4;
};
const items = [obj, ];
obj1 = { label: null, onPress: null, isDestructive: true };
const intl2 = arr(closure_1_3[14]).intl;
obj1[0] = intl2.string(arr(closure_1_3[14]).t.lSLMaU);
obj1[1] = function onPress() {
return (function handlePressRemove(closure_0) {
const self = this;
const apply = closure_2.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
})(closure_0);
};
items[1] = obj1;
obj[1] = items;
const result = obj1.showSimpleActionSheet(obj);
},
children: null
};
obj = { size: arr(closure_1_3[15]).Icon.Sizes.SMALL_20, source: multiAccountUsers(closure_1_3[23]), disableColor: true };
obj[2] = closure_1_11(id(closure_1_3[15]).Icon, obj);
obj[2] = closure_1_11(id(closure_1_3[22]).PressableOpacity, obj);
return closure_1_11(multiAccountUsers(closure_1_3[21]), obj, id.id);
}),
];
let obj2 = { leading: null, label: null, labelStyle: null, onPress: null };
const tmp2 = multiAccountUsers(6972);
obj2[0] = callback(_require(8598).FormRow.Icon, { themedColor: multiAccountUsers(576).colors.TEXT_LINK, size: _require(1178).Icon.Sizes.SMALL_20, source: multiAccountUsers(15956) });
let intl3 = _require(1114).intl;
obj2[1] = intl3.string(_require(1114).t.bPP34Q);
obj2[2] = tmp.addAccountLabel;
obj2[3] = function handlePressAddAccount() {
if (multiAccountUsers.length >= closure_1_7) {
let obj = { title: null, body: null, isDismissable: true };
const intl = arr(closure_1_3[14]).intl;
obj[0] = intl.string(arr(closure_1_3[14]).t.w7wfXi);
const intl2 = arr(closure_1_3[14]).intl;
obj = { maxNumAccounts: null };
obj[0] = tmp;
obj[1] = intl2.formatToPlainString(arr(closure_1_3[14]).t.WOyelG, obj);
multiAccountUsers(closure_1_3[13]).show(obj);
const obj2 = multiAccountUsers(closure_1_3[13]);
} else {
arr = arr.push(closure_1_10.LOGIN);
obj = multiAccountUsers(closure_1_3[11]);
obj.track(closure_1_9.LOGIN_VIEWED, { source: "choose_account_add_account" });
}
};
items[1] = callback(_require(8598).FormRow, obj2);
obj1[1] = items;
obj[5] = callback2(View, obj1);
return callback(tmp2, obj);
};