decord/source/modules/accept_invite/native/AcceptInvite.tsx

155 lines
5.8 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 12273
// Function ID: 12274
2026-07-20 16:05:17 +00:00
// Name: getInviteState
2026-08-25 06:04:03 +00:00
// Dependencies: [32, 19, 17, 676, 21, 4380, 712, 1370, 4101, 5477, 12274, 12277, 1435, 1469, 12282, 1494, 5482, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-25 06:04:03 +00:00
// Module 12273 (getInviteState)
2026-08-24 06:08:38 +00:00
import ThemesDefault from "Themes" /* 712 */;
import isDiscordFrontendDevelopment from "isDiscordFrontendDevelopment" /* 1370 */;
import handleImageLoad from "handleImageLoad" /* 1469 */;
import useWindowDimensionsDefault from "useWindowDimensions" /* 1494 */;
2026-08-25 06:04:03 +00:00
import map from "map" /* 4101 */;
import PressableCard from "PressableCard" /* 5482 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import { InviteStates } from "ME" /* 676 */;
import jsxProd from "jsxProd" /* 21 */;
2026-08-25 06:04:03 +00:00
import createCacheKey from "createCacheKey" /* 4380 */;
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
function getInviteState(invite) {
let state;
2026-07-29 08:29:29 +00:00
if (invite != null) {
2026-07-20 16:05:17 +00:00
state = invite.state;
}
let tmp2 = null == state;
if (tmp2) {
let channel;
2026-07-29 08:29:29 +00:00
if (invite != null) {
2026-07-20 16:05:17 +00:00
channel = invite.channel;
}
tmp2 = null == channel;
}
if (null != invite) {
if (null != invite.state) {
if (!tmp2) {
state = invite.state;
if (InviteStates.RESOLVED !== state) {
2026-07-29 08:29:29 +00:00
if (tmp4.ACCEPTED !== state) {
if (tmp4.EXPIRED !== state) {
if (tmp4.BANNED !== state) {
if (tmp4.ERROR !== state) {
if (tmp4.RESOLVING !== state) {
if (tmp4.APP_NOT_OPENED !== state) {
if (tmp4.APP_OPENED !== state) {
if (tmp4.APP_OPENING !== state) {
if (tmp4.ACCEPTING !== state) {
2026-08-24 06:08:38 +00:00
isDiscordFrontendDevelopment.assertNever(state);
2026-07-20 16:05:17 +00:00
}
}
}
}
}
return constants.LOADING;
}
}
}
return constants.ERROR;
}
}
return constants.DETAILS;
}
}
}
return constants.LOADING;
}
function InviteResolving() {
2026-08-24 06:08:38 +00:00
let obj = map;
obj = { style: callback4().resolvingContainer, children: null };
obj = { color: obj.useToken(ThemesDefault.colors.INTERACTIVE_TEXT_DEFAULT), size: "large" };
2026-07-29 08:29:29 +00:00
obj[1] = callback2(closure_5, obj);
2026-07-20 16:05:17 +00:00
return callback2(closure_7, obj);
}
function AcceptInviteCardComponent(invite) {
invite = invite.invite;
2026-07-23 10:11:24 +00:00
let tmp = callback(React.useState(getInviteState(invite)), 2);
2026-07-20 16:05:17 +00:00
const first = tmp[0];
2026-08-24 06:08:38 +00:00
dependencyMap = tmp[1];
2026-07-20 16:05:17 +00:00
const items = [invite, first];
const effect = React.useEffect(() => {
2026-08-24 06:08:38 +00:00
const tmp = closure_1_13(invite);
2026-07-20 16:05:17 +00:00
if (tmp !== first) {
2026-08-25 06:04:03 +00:00
const result = invite(5477).DeprecatedLayoutAnimation();
2026-07-23 10:11:24 +00:00
dependencyMap(tmp);
2026-08-25 06:04:03 +00:00
const obj = invite(5477);
2026-07-20 16:05:17 +00:00
}
}, items);
if (null == invite) {
return callback2(InviteResolving, {});
} else if (constants.DETAILS === first) {
let obj = {};
const merged = Object.assign(invite);
2026-07-29 08:29:29 +00:00
obj.invite = invite;
2026-08-25 06:04:03 +00:00
return callback2(first(12274), obj);
2026-07-29 08:29:29 +00:00
} else if (tmp22.ERROR === first) {
2026-07-20 16:05:17 +00:00
obj = {};
const merged1 = Object.assign(invite);
2026-07-29 08:29:29 +00:00
obj.invite = invite;
2026-08-25 06:04:03 +00:00
return callback2(first(12277), obj);
2026-07-20 16:05:17 +00:00
} else {
return callback2(InviteResolving, {});
}
}
2026-07-29 08:29:29 +00:00
({ ActivityIndicator: c5, ImageBackground: closure_6, View: error } = get_ActivityIndicator);
({ jsx: c9, jsxs: c10 } = jsxProd);
createCacheKey = { parentContainer: null, imageStyle: null, cardContainer: null, cardContent: null, resolvingContainer: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { backgroundColor: ThemesDefault.colors.BACKGROUND_BASE_LOW, alignItems: "center", justifyContent: "center" };
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
createCacheKey[1] = { marginVertical: 0, resizeMode: "cover" };
2026-08-24 06:08:38 +00:00
createCacheKey[2] = { position: "absolute", flex: 1, width: "90%", alignItems: "center", justifyContent: "center", padding: 0, backgroundColor: ThemesDefault.colors.BACKGROUND_SURFACE_HIGH };
2026-07-29 08:29:29 +00:00
createCacheKey[3] = { padding: 16, flex: 1, justifyContent: "center", alignItems: "center", width: "100%" };
createCacheKey[4] = { padding: 64 };
2026-08-24 06:08:38 +00:00
let closure_11 = createCacheKey.createStyles(createCacheKey);
2026-07-20 16:05:17 +00:00
let closure_12 = { LOADING: 0, [0]: "LOADING", DETAILS: 1, [1]: "DETAILS", ERROR: 2, [2]: "ERROR" };
2026-08-24 06:08:38 +00:00
const obj1 = { position: "absolute", flex: 1, width: "90%", alignItems: "center", justifyContent: "center", padding: 0, backgroundColor: ThemesDefault.colors.BACKGROUND_SURFACE_HIGH };
let result = require("set").fileFinishedImporting("modules/accept_invite/native/AcceptInvite.tsx");
2026-07-20 16:05:17 +00:00
export default function AcceptInvite(invite) {
invite = invite.invite;
2026-07-29 08:29:29 +00:00
const merged = Object.assign(invite, Object.create(null));
2026-08-24 06:08:38 +00:00
const tmp2 = callback4();
({ height, width } = useWindowDimensionsDefault());
2026-07-29 08:29:29 +00:00
let obj = invite;
if (invite == null) {
2026-07-20 16:05:17 +00:00
obj = {};
}
const guild = obj.guild;
let splash;
2026-07-29 08:29:29 +00:00
if (guild != null) {
2026-07-20 16:05:17 +00:00
splash = guild.splash;
}
if (null == splash) {
2026-08-25 06:04:03 +00:00
let guildSplashSource = tmp3(12282);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { id: null, splash: null, size: null };
({ id: obj3[0], splash: obj3[1] } = guild);
2026-08-24 06:08:38 +00:00
let obj3 = handleImageLoad;
2026-07-29 08:29:29 +00:00
obj[2] = width * obj3.getDevicePixelRatio();
2026-08-11 06:20:06 +00:00
guildSplashSource = tmp3(1435).getGuildSplashSource(obj);
const tmp3Result = tmp3(1435);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { style: items, children: null };
items = [tmp2.parentContainer, { height, width }];
const items1 = [callback2(closure_6, { source: guildSplashSource, imageStyle: tmp2.imageStyle, style: { height, width } }), ];
const obj2 = { style: tmp2.cardContainer, children: null };
obj3 = { style: tmp2.cardContent, children: null };
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
obj3[1] = callback2(AcceptInviteCardComponent, { invite });
obj2[1] = callback2(closure_7, obj3);
2026-08-24 06:08:38 +00:00
items1[1] = callback2(PressableCard.Card, obj2);
2026-07-29 08:29:29 +00:00
obj[1] = items1;
return callback3(closure_7, obj);
2026-07-20 16:05:17 +00:00
};