decord/source/modules/guild_boosting/native/GuildBoostPurchasingUtils.tsx

222 lines
8.1 KiB
TypeScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 6865
// Function ID: 6866
2026-07-20 16:05:17 +00:00
// Name: _launchGuildBoostFlowOrAlert
2026-08-08 06:10:11 +00:00
// Dependencies: [5, 3953, 676, 1905, 4643, 1236, 698, 4623, 6866, 6871, 5861, 6872, 6873, 3947, 2]
2026-07-20 16:05:17 +00:00
// Exports: launchGuildBoostFlowOrAlert
2026-08-08 06:10:11 +00:00
// Module 6865 (_launchGuildBoostFlowOrAlert)
2026-07-23 10:11:24 +00:00
import getSystemLocale from "getSystemLocale";
2026-07-29 08:29:29 +00:00
import reset from "reset";
2026-07-23 10:11:24 +00:00
import ME from "ME";
import GuildFeatures from "GuildFeatures";
2026-07-29 08:29:29 +00:00
let c5;
2026-07-31 08:44:05 +00:00
let c9;
2026-07-23 10:11:24 +00:00
let closure_6;
2026-07-29 08:29:29 +00:00
let error;
let metroImportAll;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-25 08:10:48 +00:00
function _launchGuildBoostFlowOrAlert() {
2026-07-29 08:29:29 +00:00
const self = this;
2026-07-31 08:44:05 +00:00
let tmp = callback((arg0) => {
2026-07-29 08:29:29 +00:00
let closure_0 = arg0;
2026-07-31 08:44:05 +00:00
let c5 = 0;
let c6 = 0;
2026-07-29 08:29:29 +00:00
let c4 = 0;
const iter = (function*(arg0) {
let c0;
let c1;
let c2;
let c3;
let c4;
let c5;
2026-07-31 08:44:05 +00:00
if (premiumTypeSubscription === 2) {
premiumTypeSubscription = 3;
2026-07-29 08:29:29 +00:00
HermesBuiltin.throwTypeError();
2026-07-31 08:44:05 +00:00
} else if (tmp5 === 3) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-08 06:10:11 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
2026-07-31 08:44:05 +00:00
premiumTypeSubscription = 2;
if (0 === c5) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
2026-07-31 08:44:05 +00:00
premiumTypeSubscription = 3;
2026-07-29 08:29:29 +00:00
throw arg1;
} else if (arg0 === 2) {
2026-07-31 08:44:05 +00:00
premiumTypeSubscription = 3;
2026-07-29 08:29:29 +00:00
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-07-31 08:44:05 +00:00
c3 = tmp2;
let dependencyMap = tmp6;
2026-07-29 08:29:29 +00:00
let callback;
c1 = undefined;
dependencyMap = undefined;
c3 = undefined;
c4 = undefined;
c5 = undefined;
({ source: c0, analyticsLocations: c1, guildId: c2, onBack: c3, onPaymentSuccess: c4, onPaymentDismiss: c5 } = callback);
2026-07-31 08:44:05 +00:00
premiumTypeSubscription = undefined;
2026-07-29 08:29:29 +00:00
let externalManagementMessage;
2026-07-31 08:44:05 +00:00
let c8;
let constants;
let mobileBoostingEnabled;
c5 = 1;
premiumTypeSubscription = 1;
2026-08-08 06:10:11 +00:00
return { value: "ct", done: "Array" };
2026-07-29 08:29:29 +00:00
}
} else {
2026-07-31 08:44:05 +00:00
if (1 === tmp6) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
2026-07-31 08:44:05 +00:00
premiumTypeSubscription = 3;
2026-07-29 08:29:29 +00:00
throw arg1;
} else if (arg0 === 2) {
2026-07-31 08:44:05 +00:00
premiumTypeSubscription = 3;
2026-07-29 08:29:29 +00:00
let obj1 = { value: null, done: true };
obj1[0] = arg1;
return obj1;
2026-07-31 08:44:05 +00:00
} else if (c4.hasFetchedSubscriptions()) {
premiumTypeSubscription = c4.getPremiumTypeSubscription();
2026-08-08 06:10:11 +00:00
let obj3 = callback(6866);
2026-07-31 08:44:05 +00:00
externalManagementMessage = obj3.getExternalManagementMessage(premiumTypeSubscription);
if (null != externalManagementMessage) {
(function alertUnableToManageSub(closure_7, c0) {
let obj = _null(_undefined2[4]);
obj = { title: null, body: null };
const intl = _undefined(_undefined2[5]).intl;
obj[0] = intl.string(_undefined(_undefined2[5]).t["8P7MX0"]);
obj[1] = closure_7;
obj.show(obj);
obj = { type: c6.IOS_CANNOT_MANAGE_SUBSCRIPTION, source: c0 };
_null(_undefined2[6]).track(constants.OPEN_MODAL, obj);
})(externalManagementMessage, callback);
} else {
c8 = null;
if (null != premiumTypeSubscription) {
c4 = 1;
2026-08-08 06:10:11 +00:00
constants = callback(6871).getProductIdFromSubscription(premiumTypeSubscription, true);
const tmp65 = callback(5861).AppStorePremiumProductIdsToPremiumBundledItems[constants];
2026-07-31 08:44:05 +00:00
let interval;
if (tmp65 != null) {
interval = tmp65.interval;
}
c1 = interval;
if (interval == null) {
c1 = null;
}
c8 = c1;
c4 = 0;
2026-08-08 06:10:11 +00:00
const obj11 = callback(6871);
2026-07-31 08:44:05 +00:00
}
}
premiumTypeSubscription = 3;
} else {
2026-08-08 06:10:11 +00:00
obj1 = callback(4623);
2026-07-31 08:44:05 +00:00
c5 = 2;
premiumTypeSubscription = 1;
2026-07-29 08:29:29 +00:00
let obj2 = { value: null, done: false };
obj2[0] = obj1.fetchSubscriptions();
return obj2;
}
2026-07-31 08:44:05 +00:00
} else if (2 === tmp6) {
if (arg0 === 1) {
premiumTypeSubscription = 3;
throw arg1;
} else if (arg0 === 2) {
premiumTypeSubscription = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
}
2026-07-29 08:29:29 +00:00
} else {
2026-07-31 08:44:05 +00:00
c4 = 0;
c8 = null;
}
2026-08-08 06:10:11 +00:00
mobileBoostingEnabled = callback(6872).getMobileBoostingEnabled("GuildBoostPurchasing");
2026-07-31 08:44:05 +00:00
if (mobileBoostingEnabled) {
mobileBoostingEnabled = c8 === constants.YEAR;
}
2026-08-08 06:10:11 +00:00
const obj5 = callback(6872);
2026-07-31 08:44:05 +00:00
obj3 = { showCurrentPlan: false, isBoostPurchaseFlow: true, allowYearlyBundles: null, predicate: null, analyticsLocation: null, analyticsLocations: null, guildId: null, onBack: null, onPaymentSuccess: null, onPaymentDismiss: null };
obj3[2] = mobileBoostingEnabled;
obj3[3] = function predicate(interval) {
let tmp = !mobileBoostingEnabled;
if (mobileBoostingEnabled) {
let tmp3 = interval.interval !== constants2.YEAR;
if (!tmp3) {
tmp3 = interval.numPremiumGuild > 5;
2026-07-29 08:29:29 +00:00
}
2026-07-31 08:44:05 +00:00
tmp = !tmp3;
}
if (tmp) {
2026-07-29 08:29:29 +00:00
let num2 = 0;
2026-07-31 08:44:05 +00:00
if (interval.premiumTier === _null2.TIER_2) {
num2 = closure_7;
2026-07-29 08:29:29 +00:00
}
2026-07-31 08:44:05 +00:00
let num3 = 0;
const sum = interval.numPremiumGuild + num2;
if (null != c6) {
const numPremiumGuildSubscriptions = _undefined(_undefined2[13]).getNumPremiumGuildSubscriptions(c6.additionalPlans);
const obj = _undefined(_undefined2[13]);
num3 = numPremiumGuildSubscriptions + _null(_undefined2[13]).getNumIncludedPremiumGuildSubscriptionSlots(c6.planId);
const obj2 = _null(_undefined2[13]);
}
tmp = sum > num3;
}
return tmp;
};
obj3[4] = callback;
obj3[5] = c1;
obj3[6] = dependencyMap;
obj3[7] = c3;
obj3[8] = c4;
obj3[9] = c5;
2026-08-08 06:10:11 +00:00
const result = callback(6873).launchPremiumPlanSelect(obj3);
const obj6 = callback(6873);
2026-07-31 08:44:05 +00:00
}
} catch (tmp45) {
if (tmp3 === c4) {
premiumTypeSubscription = tmp;
throw tmp45;
} else {
c5 = tmp;
2026-07-29 08:29:29 +00:00
}
}
}
})();
iter.next();
return iter;
});
const _launchGuildBoostFlowOrAlert = tmp;
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
}
2026-07-29 08:29:29 +00:00
({ AnalyticEvents: c5, AnalyticsSections: closure_6 } = ME);
2026-07-31 08:44:05 +00:00
({ NUM_FREE_GUILD_BOOSTS_WITH_PREMIUM: error, PremiumTypes: metroImportAll, SubscriptionIntervalTypes: c9 } = GuildFeatures);
2026-07-29 08:29:29 +00:00
let result = require("ME").fileFinishedImporting("modules/guild_boosting/native/GuildBoostPurchasingUtils.tsx");
2026-07-20 16:05:17 +00:00
export const launchGuildBoostFlowOrAlert = function launchGuildBoostFlowOrAlert(arg0) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _launchGuildBoostFlowOrAlert.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
};