// Module ID: 10629 // Function ID: 10630 // Name: _getCachedOrFetchActivityApplicationForLaunch // Dependencies: [5, 4341, 4326, 1372, 10613, 10606, 10630, 2] // Exports: default // Module 10629 (_getCachedOrFetchActivityApplicationForLaunch) import getShelfItemData from "getShelfItemData"; import addApplication from "addApplication"; import createExecutable from "createExecutable"; import ensureGuildLoaded from "ensureGuildLoaded"; const require = arg1; function _getCachedOrFetchActivityApplicationForLaunch() { const self = this; const tmp = callback((arg0, arg1) => { let closure_0 = arg0; let closure_1 = arg1; let c4 = 0; let c5 = 0; return (function*(arg0, arg1) { if (c5 === 2) { c5 = 3; HermesBuiltin.throwTypeError(); } else if (tmp5 === 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 { c5 = 2; if (0 === application) { if (arg0 === 1) { c5 = 3; throw arg1; } else if (arg0 === 2) { c5 = 3; obj = { value: null, done: true }; obj[0] = arg1; return obj; } else { let applications = tmp3; let activityConfigs = tmp2; let lib; activityConfigs = undefined; applications = undefined; application = undefined; c5 = undefined; application = application.getApplication(callback); if (outer1_8(application)) { c5 = 3; const obj1 = { value: null, done: true }; obj1[0] = application; return obj1; } else { const channel = outer1_6.getChannel(tmp42); let guild_id; if (channel != null) { guild_id = channel.guild_id; } let obj6 = callback(outer1_2[4]); let obj2 = { guildId: null }; obj2[0] = guild_id; application = 1; c5 = 1; const obj3 = { value: null, done: false }; obj3[0] = obj6.fetchShelf(obj2); return obj3; } tmp42 = lib; } } else if (1 === tmp6) { if (arg0 === 1) { c5 = 3; throw arg1; } else if (arg0 === 2) { c5 = 3; const obj4 = { value: null, done: true }; obj4[0] = arg1; return obj4; } else { lib = arg1; activityConfigs = lib.activityConfigs; applications = lib.applications; const obj5 = { applicationId: null, activityConfigs: null, applications: null }; obj5[0] = callback; obj5[1] = activityConfigs; obj5[2] = applications; application = lib(activityConfigs[5])(obj5); let application1; if (application != null) { application1 = application.application; } if (tmp39(application1)) { let application2; if (application != null) { application2 = application.application; } c5 = 3; obj6 = { value: null, done: true }; obj6[0] = application2; return obj6; } else { obj2 = callback(activityConfigs[6]); application = 2; c5 = 1; const obj7 = { value: null, done: false }; obj7[0] = obj2.fetchApplication(callback); return obj7; } tmp39 = closure_8; } } else if (arg0 === 1) { c5 = 3; throw arg1; } else if (arg0 === 2) { c5 = 3; const obj8 = { value: null, done: true }; obj8[0] = arg1; return obj8; } else { c5 = arg1; c5 = 3; obj = { value: null, done: true }; obj[0] = c5.createFromServer(c5); return obj; } } catch (tmp24) { c5 = tmp; throw tmp24; } } })(); }); const _getCachedOrFetchActivityApplicationForLaunch = tmp; const apply = tmp.apply; if (typeof apply === "unknown") { let applyArgumentsResult = HermesBuiltin.applyArguments(self); } else { applyArgumentsResult = apply(self, arguments); } return applyArgumentsResult; } function isUsableApplicationRecord(embeddedActivityConfig) { return null != embeddedActivityConfig && null != embeddedActivityConfig.embeddedActivityConfig; } const result = require("createExecutable").fileFinishedImporting("modules/activities/utils/getCachedOrFetchActivityApplicationForLaunch.tsx"); export default function getCachedOrFetchActivityApplicationForLaunch() { const self = this; const apply = _getCachedOrFetchActivityApplicationForLaunch.apply; if (typeof apply === "unknown") { let applyArgumentsResult = HermesBuiltin.applyArguments(self); } else { applyArgumentsResult = apply(self, arguments); } return applyArgumentsResult; };