decord/alpha/source/modules/billing/native/subscriptionSettingsDeepLink.tsx

174 lines
5.5 KiB
TypeScript
Raw Normal View History

2026-10-10 08:08:14 +00:00
// Module ID: 14192
// Function ID: 14193
2026-10-08 09:57:35 +00:00
// Name: subscriptionSettingsDeepLink
2026-10-10 08:08:14 +00:00
// Dependencies: [5, 4775, 1085, 7093, 14193, 5056, 1126, 1265, 5724, 2]
2026-10-08 09:57:35 +00:00
// Exports: openSubscriptionSettingsFromDeepLink
2026-10-10 08:08:14 +00:00
// Module 14192 (subscriptionSettingsDeepLink)
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1265 */;
import actions_BillingActionCreators from "actions/BillingActionCreators" /* 5724 */;
import openUserSettings from "openUserSettings" /* 7093 */;
2026-10-08 09:57:35 +00:00
import _asyncToGenerator from "_asyncToGenerator" /* 5 */;
2026-10-10 08:08:14 +00:00
import SubscriptionStore from "SubscriptionStore" /* 4775 */;
import Constants from "Constants" /* 1085 */;
2026-10-08 09:57:35 +00:00
import size from "module_2" /* 2 */;
2026-10-10 08:08:14 +00:00
let c4, c5, closure_0;
2026-10-08 09:57:35 +00:00
2026-10-10 08:08:14 +00:00
let hasOwnProperty;
let metroRequire;
2026-10-08 09:57:35 +00:00
function openNitroHome() {
obj = openUserSettings;
2026-10-10 08:08:14 +00:00
const obj2 = { screen: metroRequire.PREMIUM };
2026-10-08 09:57:35 +00:00
obj.openUserSettings(obj2);
}
function openNitroManage() {
obj = openUserSettings;
2026-10-10 08:08:14 +00:00
const obj2 = { screen: metroRequire.PREMIUM_MANAGE_PLAN };
2026-10-08 09:57:35 +00:00
obj.openUserSettings(obj2);
}
function openGuildManage() {
obj = openUserSettings;
2026-10-10 08:08:14 +00:00
const obj2 = { screen: metroRequire.GUILD_ROLE_SUBSCRIPTIONS };
2026-10-08 09:57:35 +00:00
obj.openUserSettings(obj2);
}
2026-10-10 08:08:14 +00:00
function trackDeepLinkOpened(arg0) {
let tmp2;
const track = AnalyticsUtilsDefault.track;
const MOBILE_SUBSCRIPTION_DEEP_LINK_OPENED = hasOwnProperty.MOBILE_SUBSCRIPTION_DEEP_LINK_OPENED;
AnalyticsUtilsDefault;
if (null != arg0) {
obj = { has_premium_subscription: null, has_guild_subscription: null };
({ hasNitro: obj.has_premium_subscription, hasGuild: obj.has_guild_subscription } = arg0);
tmp2 = obj;
}
track(MOBILE_SUBSCRIPTION_DEEP_LINK_OPENED, tmp2);
}
2026-10-08 09:57:35 +00:00
let obj = function _openSubscriptionSettingsFromDeepLink() {
obj = _asyncToGenerator(async (arg0, value) => {
function showSubscriptionPicker() {
let intl;
let intl2;
let intl3;
let items;
let obj2;
2026-10-10 08:08:14 +00:00
const showSimpleActionSheet = closure_0(closure_2[4]).showSimpleActionSheet;
closure_0 = closure_0(closure_2[5]).default;
2026-10-08 09:57:35 +00:00
obj = { key, hasIcons: false, header: obj2, options: items };
obj2 = {
2026-10-10 08:08:14 +00:00
title: intl.string(closure_0(closure_2[6]).t["z5YcJ+"]),
2026-10-08 09:57:35 +00:00
onClose() {
closure_0.hideActionSheet(key);
}
};
2026-10-10 08:08:14 +00:00
intl = closure_0(closure_2[6]).intl;
const obj3 = { label: intl2.string(closure_0(closure_2[6]).t["8jmdON"]), onPress };
intl2 = closure_0(closure_2[6]).intl;
2026-10-08 09:57:35 +00:00
items = [obj3, ];
2026-10-10 08:08:14 +00:00
const obj4 = { label: intl3.string(closure_0(closure_2[6]).t["KzCF/6"]), onPress: onPress2 };
intl3 = closure_0(closure_2[6]).intl;
2026-10-08 09:57:35 +00:00
items[1] = obj4;
const result = showSimpleActionSheet(obj);
}
if (c5 === 2) {
c5 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw value;
} else if (arg0 === 2) {
let obj3 = { value, done: true };
return obj3;
} else {
2026-10-10 08:08:14 +00:00
return { value: "IconComponent", done: "+51" };
2026-10-08 09:57:35 +00:00
}
} else {
let c3;
try {
2026-10-10 08:08:14 +00:00
let hasNitro;
let hasGuild;
2026-10-08 09:57:35 +00:00
c5 = 2;
if (0 === c4) {
if (arg0 === 1) {
c5 = 3;
throw value;
} else if (arg0 === 2) {
c5 = 3;
let obj4 = { value, done: true };
return obj4;
} else {
let closure_2 = tmp;
2026-10-10 08:08:14 +00:00
hasNitro = undefined;
hasGuild = undefined;
2026-10-08 09:57:35 +00:00
if (!SubscriptionStore.hasFetchedSubscriptions()) {
c3 = 1;
let obj2 = actions_BillingActionCreators;
c4 = 2;
c5 = 1;
const obj5 = { value: obj2.fetchSubscriptions(), done: false };
return obj5;
}
}
} else if (1 === c4) {
c3 = 0;
2026-10-10 08:08:14 +00:00
closure_130_11();
closure_130_8();
2026-10-08 09:57:35 +00:00
c5 = 3;
2026-10-10 08:08:14 +00:00
return { value: "IconComponent", done: "+51" };
2026-10-08 09:57:35 +00:00
} else if (arg0 === 1) {
c5 = 3;
throw value;
} else if (arg0 === 2) {
c3 = 0;
c5 = 3;
obj = { value, done: true };
return obj;
} else {
c3 = 0;
}
2026-10-10 08:08:14 +00:00
null != closure_130_4.getPremiumTypeSubscription();
const activeGuildSubscriptions = closure_130_4.getActiveGuildSubscriptions();
hasNitro = activeGuildSubscriptions;
2026-10-08 09:57:35 +00:00
if (activeGuildSubscriptions == null) {
2026-10-10 08:08:14 +00:00
hasNitro = [];
2026-10-08 09:57:35 +00:00
}
2026-10-10 08:08:14 +00:00
hasGuild = hasNitro.length > 0;
const obj6 = { hasNitro, hasGuild };
closure_130_11(obj6);
const tmp24 = hasNitro;
if (tmp24) {
const tmp26 = hasGuild;
if (tmp26) {
2026-10-08 09:57:35 +00:00
showSubscriptionPicker();
}
c5 = 3;
2026-10-10 08:08:14 +00:00
return { value: "IconComponent", done: "+51" };
2026-10-08 09:57:35 +00:00
}
2026-10-10 08:08:14 +00:00
const tmp28 = hasGuild;
if (tmp28) {
closure_130_10();
} else if (hasNitro) {
closure_130_9();
2026-10-08 09:57:35 +00:00
} else {
2026-10-10 08:08:14 +00:00
closure_130_8();
2026-10-08 09:57:35 +00:00
}
2026-10-10 08:08:14 +00:00
} catch (tmp39) {
2026-10-08 09:57:35 +00:00
if (0 === c3) {
c5 = 3;
2026-10-10 08:08:14 +00:00
throw tmp39;
2026-10-08 09:57:35 +00:00
} else {
c4 = 1;
}
}
}
});
return obj(...arguments);
};
2026-10-10 08:08:14 +00:00
({ AnalyticEvents: hasOwnProperty, UserSettingsSections: metroRequire } = Constants);
let c7 = "subscription-settings-deep-link";
2026-10-08 09:57:35 +00:00
let result = size.fileFinishedImporting("modules/billing/native/subscriptionSettingsDeepLink.tsx");
export const openSubscriptionSettingsFromDeepLink = function openSubscriptionSettingsFromDeepLink() {
return obj(...arguments);
};