decord/source/modules/guild_onboarding/doGuildOnboarding.native.tsx

353 lines
11 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 6820
// Function ID: 6821
2026-07-20 16:05:17 +00:00
// Name: getBaseAnimationData
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 17, 4201, 6821, 6822, 676, 6823, 4346, 5265, 6815, 6824, 1435, 1896, 6826, 6827, 6828, 6837, 2008, 1222, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, discardOnboardingPromise, isOnboardingActiveForGuild
2026-08-24 06:08:38 +00:00
// Module 6820 (getBaseAnimationData)
import _mod6823 from "module_6823" /* 6823 */;
import closure_3 from "asyncGeneratorStep" /* 5 */;
import { NativeModules } from "get ActivityIndicator" /* 17 */;
import closure_5 from "handleConnectionOpen" /* 4201 */;
import closure_6 from "shouldShowOnboarding" /* 6821 */;
import { GUILD_ONBOARDING_MODAL_KEY as closure_7 } from "GUILD_ONBOARDING_MODAL_KEY" /* 6822 */;
import ME from "ME" /* 676 */;
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 getBaseAnimationData() {
2026-08-24 06:08:38 +00:00
return JSON.parse(JSON.stringify(_mod6823));
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
function _doGuildOnboarding() {
let self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c5 = 0;
c6 = 0;
2026-07-29 08:29:29 +00:00
const iter = (function*(arg0) {
if (c6 === 2) {
c6 = 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 {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c6 = 2;
if (0 === c5) {
if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
closure_3 = tmp2;
closure_4 = tmp5;
2026-07-29 08:29:29 +00:00
let guildId;
guildId = guildId.guildId;
let lib;
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) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: true };
2026-07-29 08:29:29 +00:00
obj1[0] = arg1;
return obj1;
} else {
2026-08-24 06:08:38 +00:00
let obj8 = lib(4346);
2026-07-29 08:29:29 +00:00
obj8.hideActionSheet();
2026-08-24 06:08:38 +00:00
lib(5265).popAll();
const obj10 = lib(5265);
2026-07-29 08:29:29 +00:00
c5 = 2;
c6 = 1;
const obj2 = { value: null, done: false };
2026-08-24 06:08:38 +00:00
obj2[0] = guildId(6815).waitForGuild(closure_0);
2026-07-29 08:29:29 +00:00
return obj2;
}
} else {
if (2 === tmp5) {
if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
const obj3 = { value: null, done: true };
obj3[0] = arg1;
return obj3;
} else {
lib = arg1;
const features2 = lib.features;
2026-08-24 06:08:38 +00:00
let hasItem = features2.has(closure_1_8.GUILD_ONBOARDING);
2026-07-29 08:29:29 +00:00
if (hasItem) {
const features = lib.features;
hasItem = features.has(constants.COMMUNITY);
}
if (hasItem) {
2026-08-24 06:08:38 +00:00
let obj5 = guildId(6824);
2026-07-29 08:29:29 +00:00
c5 = 3;
c6 = 1;
const obj4 = { value: null, done: false };
obj4[0] = obj5.maybeFetchOnboardingPrompts(closure_0);
return obj4;
}
}
} else if (3 === tmp5) {
if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
obj5 = { value: null, done: true };
obj5[0] = arg1;
return obj5;
} else if (c6.shouldShowOnboarding(guildId)) {
2026-08-24 06:08:38 +00:00
dependencyMap = closure_12;
2026-07-29 08:29:29 +00:00
lib = guildId;
c5 = 4;
c6 = 1;
const obj6 = { value: null, done: false };
obj6[0] = (function fetchLandingAsset(closure_1) {
const self = this;
const apply = closure_14.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
})(lib);
return obj6;
}
} else if (4 === tmp5) {
if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
const obj7 = { value: null, done: true };
obj7[0] = arg1;
return obj7;
} else {
dependencyMap[lib] = arg1;
c5 = 5;
c6 = 1;
obj8 = { value: null, done: false };
obj8[0] = callback(lib.id);
return obj8;
}
} else if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
}
c6 = 3;
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} catch (tmp42) {
c6 = tmp;
throw tmp42;
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
})();
iter.next();
return iter;
});
2026-08-24 06:08:38 +00:00
closure_13 = tmp;
2026-07-29 08:29:29 +00:00
let apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
function _fetchLandingAsset() {
const self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c4 = 0;
c5 = 0;
c3 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0) {
if (c5 === 2) {
c5 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp6 === 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 {
c5 = 2;
if (0 === c4) {
if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 === 2) {
c5 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
dependencyMap = tmp3;
2026-07-29 08:29:29 +00:00
let callback = tmp7;
let guildIconSource;
callback = undefined;
dependencyMap = undefined;
2026-08-24 06:08:38 +00:00
obj1 = { id: null, icon: null, canAnimate: false, size: null };
2026-07-29 08:29:29 +00:00
({ id: obj10[0], icon: obj10[1] } = guildIconSource);
2026-08-24 06:08:38 +00:00
obj1[3] = 96 / closure_1_1(closure_1_2[12])();
guildIconSource = closure_1_1(closure_1_2[11]).getGuildIconSource(obj1);
c3 = 1;
2026-07-29 08:29:29 +00:00
const ImageManager2 = c4.ImageManager;
c4 = 2;
c5 = 1;
const obj2 = { value: null, done: false };
obj2[0] = ImageManager2.getAvatarBase64(guildIconSource);
return obj2;
}
} else if (1 === tmp7) {
c3 = 0;
c5 = 3;
const obj3 = { value: null, done: true };
obj3[0] = callback2();
return obj3;
} else if (2 === tmp7) {
if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 === 2) {
c3 = 0;
c5 = 3;
const obj4 = { value: null, done: true };
obj4[0] = arg1;
return obj4;
} else {
callback = arg1;
const ImageManager = c4.ImageManager;
c4 = 3;
c5 = 1;
const obj5 = { value: null, done: false };
obj5[0] = ImageManager.getDominantColors(guildIconSource);
return obj5;
}
} else if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 === 2) {
c3 = 0;
c5 = 3;
const obj6 = { value: null, done: true };
obj6[0] = arg1;
return obj6;
} else {
dependencyMap = arg1;
const _HermesInternal = HermesInternal;
2026-08-24 06:08:38 +00:00
const tmp12 = callback(6826);
2026-07-29 08:29:29 +00:00
c3 = 0;
c5 = 3;
obj = { value: null, done: true };
obj[0] = tmp12(callback2(), "data:image/png;base64," + callback, 5);
return obj;
}
} catch (tmp23) {
if (tmp4 === c3) {
c5 = tmp2;
throw tmp23;
} else {
c4 = tmp;
}
}
}
})();
});
2026-08-24 06:08:38 +00:00
closure_14 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function openAndWaitForOnboarding(arg0) {
2026-07-29 08:29:29 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
const result = _require(6827).waitForOnboardingCompletion(arg0);
2026-07-29 08:29:29 +00:00
result.then(() => {
2026-08-24 06:08:38 +00:00
if (null != closure_1_11[closure_0]) {
2026-07-29 08:29:29 +00:00
tmp4();
}
delete tmp[tmp2];
2026-08-24 06:08:38 +00:00
closure_1_1(closure_1_2[15]).finishOnboarding(closure_0);
2026-07-29 08:29:29 +00:00
});
2026-08-24 06:08:38 +00:00
let obj = _require(6827);
2026-07-20 16:05:17 +00:00
return new Promise((arg0) => {
2026-08-24 06:08:38 +00:00
if (null == closure_1_11[callback]) {
2026-07-29 08:29:29 +00:00
tmp[tmp2] = arg0;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
let obj = closure_1_1(closure_1_2[8]);
2026-07-20 16:05:17 +00:00
obj = {
2026-07-29 08:29:29 +00:00
guildId: tmp2,
2026-07-20 16:05:17 +00:00
backShouldLeaveGuild: true,
2026-08-06 08:05:19 +00:00
onFinish() {
2026-07-20 16:05:17 +00:00
},
2026-08-24 06:08:38 +00:00
landingAnimation: closure_1_12[tmp2],
2026-07-20 16:05:17 +00:00
isFirstOpen: true
};
2026-08-24 06:08:38 +00:00
obj.pushLazy(callback(closure_1_2[17])(closure_1_2[16], closure_1_2.paths), obj, closure_1_7).then(() => {
if (closure_1_5.getGuildId() !== closure_0) {
closure_1_0(closure_1_2[18]).transitionTo(closure_1_9.CHANNEL(tmp));
const obj = closure_1_0(closure_1_2[18]);
2026-07-20 16:05:17 +00:00
}
});
});
}
2026-08-24 06:08:38 +00:00
({ GuildFeatures: closure_8, Routes: c9 } = ME);
2026-07-20 16:05:17 +00:00
let closure_11 = {};
2026-07-29 08:29:29 +00:00
let closure_12 = {};
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/guild_onboarding/doGuildOnboarding.native.tsx");
2026-07-20 16:05:17 +00:00
export default function doGuildOnboarding() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _doGuildOnboarding.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};
export { openAndWaitForOnboarding };
export const discardOnboardingPromise = function discardOnboardingPromise(id) {
2026-07-23 10:11:24 +00:00
delete tmp2[tmp];
2026-07-20 16:05:17 +00:00
};
export const isOnboardingActiveForGuild = function isOnboardingActiveForGuild(arg0) {
2026-07-23 10:11:24 +00:00
return null != table[arg0];
2026-07-20 16:05:17 +00:00
};