decord/source/modules/premium/native/PremiumPlanSelectYearlyUpsellModal.tsx

150 lines
6.4 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 13026
// Function ID: 13027
2026-07-20 16:05:17 +00:00
// Name: PremiumPlanSelectYearlyUpsellModal
2026-08-25 06:04:03 +00:00
// Dependencies: [32, 19, 17, 1996, 5965, 13017, 1924, 505, 21, 4380, 5342, 5265, 7014, 589, 1898, 4833, 13027, 1297, 1236, 4043, 4815, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-25 06:04:03 +00:00
// Module 13026 (PremiumPlanSelectYearlyUpsellModal)
import componentDidMountDefault from "componentDidMount" /* 4833 */;
import createTextStyleDefault from "createTextStyle" /* 5342 */;
import registerAssetDefault from "registerAsset" /* 13027 */;
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 */;
2026-08-25 06:04:03 +00:00
import closure_7 from "_getSystemLocale" /* 1996 */;
import closure_8 from "updateProduct" /* 5965 */;
import { usePremiumPlanSelectStore } from "usePremiumPlanSelectStore" /* 13017 */;
2026-08-24 06:08:38 +00:00
import { PREMIUM_YEARLY_DISCOUNT_PERCENT as closure_10 } from "GuildFeatures" /* 1924 */;
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
const require = arg1;
2026-07-29 08:29:29 +00:00
({ Image: c5, View: closure_6 } = get_ActivityIndicator);
({ jsx: unpackModuleId, jsxs: closure_12 } = jsxProd);
createCacheKey = { container: { marginHorizontal: 26 }, image: { alignSelf: "center", marginVertical: 32 }, header: null, description: null, upsellButton: null, continueButton: null, cancelButton: null };
createCacheKey = {};
2026-08-24 06:08:38 +00:00
const merged = Object.assign(createTextStyleDefault(require("sum").Fonts.DISPLAY_EXTRABOLD, undefined, 24));
2026-07-29 08:29:29 +00:00
createCacheKey.alignSelf = "center";
createCacheKey.textAlign = "center";
createCacheKey.paddingBottom = 8;
createCacheKey.color = require("result").DARK_WHITE_500_LIGHT_BLACK_500;
createCacheKey[2] = createCacheKey;
createCacheKey[3] = { alignSelf: "center", textAlign: "center", paddingBottom: 32, color: require("result").DARK_WHITE_500_LIGHT_BLACK_500 };
createCacheKey[4] = { marginBottom: 16 };
createCacheKey[5] = { marginBottom: 4 };
createCacheKey[6] = { marginTop: 8, marginBottom: 4 };
2026-08-24 06:08:38 +00:00
let closure_13 = createCacheKey.createStyles(createCacheKey);
2026-07-23 10:11:24 +00:00
let obj1 = { alignSelf: "center", textAlign: "center", paddingBottom: 32, color: require("result").DARK_WHITE_500_LIGHT_BLACK_500 };
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/premium/native/PremiumPlanSelectYearlyUpsellModal.tsx");
2026-07-20 16:05:17 +00:00
export default function PremiumPlanSelectYearlyUpsellModal(arg0) {
({ onClose, productId } = arg0);
2026-07-23 10:11:24 +00:00
({ orderPriceString, continueWithUpsell: importDefault, continueWithDefault: dependencyMap } = arg0);
2026-07-29 08:29:29 +00:00
let callback;
2026-07-20 16:05:17 +00:00
let React;
2026-08-24 06:08:38 +00:00
const tmp = callback3();
2026-07-20 16:05:17 +00:00
const tmp2 = usePremiumPlanSelectStore((isPurchasing) => isPurchasing.isPurchasing);
2026-07-29 08:29:29 +00:00
let obj = React;
[tmp4, c3] = callback(React.useState(null), 2);
2026-08-25 06:04:03 +00:00
obj1 = productId(7014);
2026-07-29 08:29:29 +00:00
const premiumBundledItemsFromProductId = obj1.getPremiumBundledItemsFromProductId(productId);
let obj2 = productId(589);
2026-08-24 06:08:38 +00:00
let items = [closure_7];
2026-07-29 08:29:29 +00:00
const stateFromStores = obj2.useStateFromStores(items, () => locale.locale);
let obj3 = productId(589);
2026-08-24 06:08:38 +00:00
const items1 = [closure_8];
2026-07-29 08:29:29 +00:00
const tmp9 = callback(obj3.useStateFromStoresArray(items1, () => {
2026-08-24 06:08:38 +00:00
const items = [closure_1_8.getProduct(productId), closure_1_8.isBusy()];
2026-07-20 16:05:17 +00:00
return items;
}), 2);
2026-07-29 08:29:29 +00:00
const first = tmp9[0];
let tmp11 = tmp2;
2026-07-20 16:05:17 +00:00
if (!tmp2) {
2026-07-29 08:29:29 +00:00
tmp11 = tmp9[1];
2026-07-20 16:05:17 +00:00
}
const premiumTier = premiumBundledItemsFromProductId.premiumTier;
2026-07-29 08:29:29 +00:00
if (orderPriceString == null) {
2026-07-20 16:05:17 +00:00
let priceString;
2026-07-29 08:29:29 +00:00
if (first != null) {
priceString = first.priceString;
2026-07-20 16:05:17 +00:00
}
orderPriceString = priceString;
}
2026-07-29 08:29:29 +00:00
React = tmp13;
const effect = obj.useEffect(() => {
2026-08-24 06:08:38 +00:00
if (closure_4) {
2026-07-20 16:05:17 +00:00
callback2();
}
});
if (null == premiumTier || null == orderPriceString) {
return null;
} else {
2026-08-11 06:20:06 +00:00
let tmp5Result = tmp5(1898);
2026-07-29 08:29:29 +00:00
const formatPercentResult = tmp5Result.formatPercent(stateFromStores, closure_10 / 100);
obj = { onClose: null, noDefaultButtons: true, children: null };
obj[0] = onClose;
obj = { style: null, children: null };
obj[0] = tmp.container;
obj1 = { style: null, source: null };
obj1[0] = tmp.image;
2026-08-24 06:08:38 +00:00
obj1[1] = registerAssetDefault;
2026-07-20 16:05:17 +00:00
const items2 = [callback2(closure_5, obj1), , , , , ];
2026-07-29 08:29:29 +00:00
obj2 = { style: null, accessibilityRole: "header", children: null };
obj2[0] = tmp.header;
const intl = tmp5(1236).intl;
obj3 = { discountPercentage: null, planName: null };
obj3[0] = formatPercentResult;
2026-08-25 06:04:03 +00:00
tmp5Result = tmp5(4043);
2026-07-29 08:29:29 +00:00
obj3[1] = tmp5Result.getPremiumTypeDisplayName(premiumTier);
obj2[2] = intl.format(tmp5(1236).t.LQCVfK, obj3);
items2[1] = callback2(tmp5(1297).LegacyText, obj2);
const obj4 = { style: null, children: null };
obj4[0] = tmp.description;
const intl2 = tmp5(1236).intl;
const obj5 = { discountPercentage: null };
obj5[0] = formatPercentResult;
obj4[1] = intl2.format(tmp5(1236).t["7chOVL"], obj5);
items2[2] = callback2(tmp5(1297).LegacyText, obj4);
const obj6 = { style: null, children: null };
obj6[0] = tmp.upsellButton;
const obj7 = { variant: "active", text: null, onPress: null, disabled: null, loading: null };
const intl3 = tmp5(1236).intl;
const obj8 = { price: null };
obj8[0] = orderPriceString;
obj7[1] = intl3.formatToPlainString(tmp5(1236).t.Qvq6GE, obj8);
obj7[2] = function onPress() {
_undefined("upsell");
2026-07-20 16:05:17 +00:00
callback();
};
2026-07-29 08:29:29 +00:00
obj7[3] = tmp11;
obj7[4] = "upsell" === tmp4 && tmp2;
2026-08-25 06:04:03 +00:00
obj6[1] = callback2(tmp5(4815).Button, obj7);
2026-07-20 16:05:17 +00:00
items2[3] = callback2(closure_6, obj6);
2026-07-29 08:29:29 +00:00
const obj9 = { style: null, children: null };
obj9[0] = tmp.continueButton;
const obj10 = { variant: "secondary", text: null, onPress: null, disabled: null, loading: null };
const intl4 = tmp5(1236).intl;
obj10[1] = intl4.string(tmp5(1236).t.YwEyQM);
obj10[2] = function onPress() {
_undefined("default");
2026-07-20 16:05:17 +00:00
callback2();
};
2026-07-29 08:29:29 +00:00
obj10[3] = tmp11;
obj10[4] = "default" === tmp4 && tmp2;
2026-08-25 06:04:03 +00:00
obj9[1] = callback2(tmp5(4815).Button, obj10);
2026-07-20 16:05:17 +00:00
items2[4] = callback2(closure_6, obj9);
2026-07-29 08:29:29 +00:00
const obj11 = { style: null, children: null };
obj11[0] = tmp.cancelButton;
const obj12 = { variant: "tertiary", text: null, onPress: null };
const intl5 = tmp5(1236).intl;
obj12[1] = intl5.string(tmp5(1236).t.cpT0Cq);
obj12[2] = onClose;
2026-08-25 06:04:03 +00:00
obj11[1] = callback2(tmp5(4815).Button, obj12);
2026-07-20 16:05:17 +00:00
items2[5] = callback2(closure_6, obj11);
2026-07-29 08:29:29 +00:00
obj[1] = items2;
obj[2] = closure_12(closure_6, obj);
2026-08-24 06:08:38 +00:00
return callback2(componentDidMountDefault, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const tmp3 = callback(React.useState(null), 2);
2026-07-20 16:05:17 +00:00
};