decord/source/modules/oauth2/native/ConnectAccountStep.tsx

230 lines
11 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 9817
// Function ID: 9818
2026-07-20 16:05:17 +00:00
// Name: ConnectAccountStep
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 17, 4482, 1218, 1922, 21, 4668, 712, 4314, 589, 5102, 1435, 1363, 7178, 1297, 9452, 4739, 1236, 4750, 9818, 4334, 4330, 2]
2026-07-20 16:05:17 +00:00
// Exports: ConnectedAccountCard, default
2026-08-24 06:08:38 +00:00
// Module 9817 (ConnectAccountStep)
import ThemesDefault from "Themes" /* 712 */;
import getSystemLocale from "getSystemLocale" /* 1236 */;
import AccessibilityAnnouncer from "AccessibilityAnnouncer" /* 1363 */;
import getAvatarURL from "getAvatarURL" /* 1435 */;
import CheckmarkLargeIcon from "CheckmarkLargeIcon" /* 4330 */;
import Text from "Text" /* 4739 */;
import getPlatformUserUrlDefault from "getPlatformUserUrl" /* 5102 */;
import closure_3 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
import closure_5 from "addApplication" /* 4482 */;
import closure_6 from "fetchFingerprint" /* 1218 */;
import closure_7 from "mergeGuildAvatar" /* 1922 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
({ jsx: closure_8, jsxs: c9 } = jsxProd);
2026-07-29 08:29:29 +00:00
createCacheKey = { container: { flexDirection: "column", gap: 16, width: "100%" }, header: { flexDirection: "column", alignItems: "center", gap: 8, marginBottom: 8 }, headerIcons: { flexDirection: "row", alignItems: "center", gap: 16, marginBottom: 8 }, card: null, cardName: null, cardInfo: null, platformIcon: null, platformIconSmall: null, infoNotice: null, infoText: null, divider: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { flexDirection: "row", alignItems: "center", gap: 12, padding: 16, backgroundColor: ThemesDefault.colors.BACKGROUND_SURFACE_HIGH, borderColor: ThemesDefault.colors.BORDER_SUBTLE, borderWidth: 1, borderRadius: ThemesDefault.radii.md };
2026-07-29 08:29:29 +00:00
createCacheKey[3] = createCacheKey;
createCacheKey[4] = { flex: 1, minWidth: 0 };
createCacheKey[5] = { flex: 1, minWidth: 0, flexDirection: "column", gap: 2 };
2026-08-24 06:08:38 +00:00
createCacheKey[6] = { width: 40, height: 40, borderRadius: ThemesDefault.radii.sm };
let obj1 = { width: 40, height: 40, borderRadius: ThemesDefault.radii.sm };
createCacheKey[7] = { width: 32, height: 32, borderRadius: ThemesDefault.radii.sm };
let obj2 = { width: 32, height: 32, borderRadius: ThemesDefault.radii.sm };
createCacheKey[8] = { flexDirection: "row", alignItems: "flex-start", gap: 8, padding: 12, backgroundColor: ThemesDefault.colors.BACKGROUND_FEEDBACK_INFO, borderColor: ThemesDefault.colors.ICON_FEEDBACK_INFO, borderWidth: 1, borderRadius: ThemesDefault.radii.sm };
2026-07-29 08:29:29 +00:00
createCacheKey[9] = { flex: 1 };
2026-08-24 06:08:38 +00:00
let obj3 = { flexDirection: "row", alignItems: "flex-start", gap: 8, padding: 12, backgroundColor: ThemesDefault.colors.BACKGROUND_FEEDBACK_INFO, borderColor: ThemesDefault.colors.ICON_FEEDBACK_INFO, borderWidth: 1, borderRadius: ThemesDefault.radii.sm };
createCacheKey[10] = { height: 1, backgroundColor: ThemesDefault.colors.BORDER_SUBTLE, marginVertical: 8 };
let closure_10 = createCacheKey.createStyles(createCacheKey);
let obj4 = { height: 1, backgroundColor: ThemesDefault.colors.BORDER_SUBTLE, marginVertical: 8 };
const result = require("set").fileFinishedImporting("modules/oauth2/native/ConnectAccountStep.tsx");
2026-07-20 16:05:17 +00:00
export default function ConnectAccountStep(clientId) {
clientId = clientId.clientId;
const platformType = clientId.platformType;
const platformName = clientId.platformName;
2026-08-24 06:08:38 +00:00
const tmp = callback3();
2026-07-29 08:29:29 +00:00
let obj = clientId(589);
2026-08-24 06:08:38 +00:00
const items = [closure_5];
2026-07-20 16:05:17 +00:00
const items1 = [clientId];
2026-08-24 06:08:38 +00:00
const stateFromStores = obj.useStateFromStores(items, () => closure_1_5.getApplication(clientId), items1);
obj1 = clientId(589);
const items2 = [closure_6, closure_7];
2026-07-20 16:05:17 +00:00
const stateFromStores1 = obj1.useStateFromStores(items2, () => {
let currentUser = null;
2026-07-29 08:29:29 +00:00
if (null != id.getId()) {
currentUser = currentUser.getCurrentUser();
2026-07-20 16:05:17 +00:00
}
return currentUser;
});
2026-08-24 06:08:38 +00:00
let obj2 = platformType(5102);
2026-07-20 16:05:17 +00:00
const value = obj2.get(platformType);
if (null == value) {
let applicationIconSource;
if (null != stateFromStores) {
2026-08-11 06:20:06 +00:00
let tmp2Result = tmp2(1435);
2026-07-29 08:29:29 +00:00
obj = { id: null, icon: null };
({ id: obj7[0], icon: obj7[1] } = stateFromStores);
applicationIconSource = tmp2Result.getApplicationIconSource(obj);
2026-07-20 16:05:17 +00:00
}
let userAvatarSource;
if (null != stateFromStores1) {
2026-08-11 06:20:06 +00:00
tmp2Result = tmp2(1435);
2026-07-29 08:29:29 +00:00
userAvatarSource = tmp2Result.getUserAvatarSource(stateFromStores1);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let str;
if (stateFromStores != null) {
str = stateFromStores.name;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (str == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
const items3 = [clientId];
const effect = React.useEffect(() => {
2026-08-24 06:08:38 +00:00
const application = platformType(closure_1_2[13]).fetchApplication(clientId);
2026-07-20 16:05:17 +00:00
}, items3);
2026-07-29 08:29:29 +00:00
obj = { style: null, children: null };
obj[0] = tmp.container;
obj1 = { style: null, children: null };
obj1[0] = tmp.header;
obj2 = { style: null, children: null };
obj2[0] = tmp.headerIcons;
const obj3 = { source: null, size: null };
obj3[0] = applicationIconSource;
obj3[1] = tmp5(1297).AvatarSizes.XLARGE;
const items4 = [callback(tmp5(1297).Avatar, obj3), , ];
const obj4 = { color: null, size: "md" };
obj4[0] = tmp2(712).colors.INTERACTIVE_TEXT_DEFAULT;
2026-08-24 06:08:38 +00:00
items4[1] = callback(tmp5(9452).MoreHorizontalIcon, obj4);
2026-07-29 08:29:29 +00:00
const obj5 = { source: null, size: null };
obj5[0] = userAvatarSource;
obj5[1] = tmp5(1297).AvatarSizes.XLARGE;
items4[2] = callback(tmp5(1297).Avatar, obj5);
obj2[1] = items4;
2026-07-20 16:05:17 +00:00
const items5 = [callback2(View, obj2), , ];
2026-07-29 08:29:29 +00:00
const obj6 = { variant: "text-lg/normal", color: "text-default", children: null };
const intl = tmp5(1236).intl;
obj6[2] = intl.string(tmp5(1236).t.uT1CPa);
2026-08-24 06:08:38 +00:00
items5[1] = callback(tmp5(4739).Text, obj6);
2026-07-29 08:29:29 +00:00
const obj7 = { variant: "heading-xl/semibold", color: "mobile-text-heading-primary", children: null };
obj7[2] = str;
2026-08-24 06:08:38 +00:00
items5[2] = callback(tmp5(4739).Text, obj7);
2026-07-29 08:29:29 +00:00
obj1[1] = items5;
2026-07-20 16:05:17 +00:00
const items6 = [callback2(View, obj1), , , ];
2026-07-29 08:29:29 +00:00
const obj8 = { variant: "text-sm/normal", color: "text-default", children: null };
const intl2 = tmp5(1236).intl;
const obj9 = { applicationName: null, platformName: null };
obj9[0] = str;
obj9[1] = platformName;
obj8[2] = intl2.format(tmp5(1236).t["aJRE/Q"], obj9);
2026-08-24 06:08:38 +00:00
items6[1] = callback(tmp5(4739).Text, obj8);
2026-07-29 08:29:29 +00:00
const obj10 = { style: null, children: null };
obj10[0] = tmp.card;
let tmp16Result = null;
2026-07-20 16:05:17 +00:00
if (null != null) {
2026-07-29 08:29:29 +00:00
const obj11 = { source: null, style: null, disableColor: true };
obj11[0] = null;
obj11[1] = tmp.platformIcon;
tmp16Result = tmp16(tmp5(1297).Icon, obj11);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const items7 = [tmp16Result, , ];
const obj12 = { variant: "text-md/medium", style: null, color: "text-default", children: null };
obj12[1] = tmp.cardName;
obj12[3] = platformName;
2026-08-24 06:08:38 +00:00
items7[1] = callback(tmp5(4739).Text, obj12);
2026-07-29 08:29:29 +00:00
const obj13 = { variant: "primary", size: "sm", onPress: null, text: null };
obj13[2] = function onPress() {
2026-08-24 06:08:38 +00:00
platformType(closure_1_2[19])({ platformType, location: "OAuth2 Connect Account Step" });
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
const intl3 = tmp5(1236).intl;
obj13[3] = intl3.string(tmp5(1236).t.S0W8Z5);
2026-08-24 06:08:38 +00:00
items7[2] = callback(tmp5(4750).Button, obj13);
2026-07-29 08:29:29 +00:00
obj10[1] = items7;
2026-07-20 16:05:17 +00:00
items6[2] = callback2(View, obj10);
2026-07-29 08:29:29 +00:00
const obj14 = { style: null, children: null };
obj14[0] = tmp.infoNotice;
const obj15 = { color: null, size: "sm" };
obj15[0] = tmp2(712).colors.ICON_FEEDBACK_INFO;
2026-08-24 06:08:38 +00:00
const items8 = [callback(tmp5(4334).CircleInformationIcon, obj15), ];
2026-07-29 08:29:29 +00:00
const obj16 = { variant: "text-sm/normal", color: "text-default", style: null, children: null };
obj16[2] = tmp.infoText;
const intl4 = tmp5(1236).intl;
const obj17 = { platformName: null, applicationName: null };
obj17[0] = platformName;
obj17[1] = str;
obj16[3] = intl4.format(tmp5(1236).t["8psEFX"], obj17);
2026-08-24 06:08:38 +00:00
items8[1] = callback(tmp5(4739).Text, obj16);
2026-07-29 08:29:29 +00:00
obj14[1] = items8;
2026-07-20 16:05:17 +00:00
items6[3] = callback2(View, obj14);
2026-07-29 08:29:29 +00:00
obj[1] = items6;
2026-07-20 16:05:17 +00:00
return callback2(View, obj);
} else {
2026-08-11 06:20:06 +00:00
let tmp5Result = tmp5(1435);
tmp5Result = tmp5(1363);
2026-07-20 16:05:17 +00:00
const icon = value.icon;
2026-07-29 08:29:29 +00:00
const source = tmp5Result.makeSource(tmp5Result.isThemeLight(tmp4) ? icon.lightPNG : icon.darkPNG);
2026-07-20 16:05:17 +00:00
}
};
export const ConnectedAccountCard = function ConnectedAccountCard(arg0) {
({ platformName, connectedAccount } = arg0);
({ platformType, applicationName } = arg0);
2026-08-24 06:08:38 +00:00
const tmp = callback3();
let obj = getPlatformUserUrlDefault;
2026-07-20 16:05:17 +00:00
const value = obj.get(platformType);
if (null == value) {
2026-07-29 08:29:29 +00:00
obj = { style: null, children: null };
obj[0] = tmp.container;
obj = { variant: "text-sm/normal", color: "text-default", children: null };
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale.intl;
obj1 = { platformName: null };
2026-07-29 08:29:29 +00:00
obj1[0] = platformName;
2026-08-24 06:08:38 +00:00
obj[2] = intl.format(getSystemLocale.t["+oaRw3"], obj1);
const items = [callback(Text.Text, obj), , , ];
2026-07-29 08:29:29 +00:00
let obj2 = { style: null, children: null };
obj2[0] = tmp.card;
let tmp10Result = null;
2026-07-20 16:05:17 +00:00
if (null != null) {
2026-07-29 08:29:29 +00:00
const obj3 = { source: null, style: null, disableColor: true };
obj3[0] = null;
obj3[1] = tmp.platformIconSmall;
tmp10Result = tmp10(tmp11(1297).Icon, obj3);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const items1 = [tmp10Result, , ];
const obj4 = { style: null, children: null };
obj4[0] = tmp.cardInfo;
const obj5 = { variant: "text-md/medium", color: "mobile-text-heading-primary", children: null };
obj5[2] = connectedAccount.name;
2026-08-24 06:08:38 +00:00
const items2 = [callback(Text.Text, obj5), ];
2026-07-29 08:29:29 +00:00
const obj6 = { variant: "text-xs/normal", color: "text-muted", children: null };
const intl2 = tmp11(1236).intl;
const obj7 = { platformName: null, connectedAccountId: null };
obj7[0] = platformName;
obj7[1] = connectedAccount.id;
2026-08-24 06:08:38 +00:00
obj6[2] = intl2.format(getSystemLocale.t.Dkd7sE, obj7);
items2[1] = callback(Text.Text, obj6);
2026-07-29 08:29:29 +00:00
obj4[1] = items2;
items1[1] = closure_9(View, obj4);
const obj8 = { color: null, size: "sm" };
2026-08-24 06:08:38 +00:00
obj8[0] = ThemesDefault.colors.TEXT_FEEDBACK_POSITIVE;
items1[2] = callback(CheckmarkLargeIcon.CheckmarkLargeIcon, obj8);
2026-07-29 08:29:29 +00:00
obj2[1] = items1;
items[1] = closure_9(View, obj2);
const obj9 = { variant: "text-sm/normal", color: "text-default", children: null };
const intl3 = tmp11(1236).intl;
const obj10 = { applicationName: null };
obj10[0] = applicationName;
2026-08-24 06:08:38 +00:00
obj9[2] = intl3.format(getSystemLocale.t.pyRNXJ, obj10);
items[2] = callback(Text.Text, obj9);
2026-07-29 08:29:29 +00:00
const obj11 = { style: null };
obj11[0] = tmp.divider;
2026-07-20 16:05:17 +00:00
items[3] = callback(View, obj11);
2026-07-29 08:29:29 +00:00
obj[1] = items;
return closure_9(View, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
obj1 = getAvatarURL;
obj2 = AccessibilityAnnouncer;
2026-07-20 16:05:17 +00:00
const icon = value.icon;
2026-07-29 08:29:29 +00:00
const source = obj1.makeSource(obj2.isThemeLight(tmp4) ? icon.lightPNG : icon.darkPNG);
2026-07-20 16:05:17 +00:00
}
};