Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
139 lines
6 KiB
TypeScript
139 lines
6 KiB
TypeScript
// Module ID: 13638
|
|
// Function ID: 13639
|
|
// Name: PremiumPlanSelectYearlyUpsellModal
|
|
// Dependencies: [32, 19, 17, 2025, 7340, 13629, 1373, 1085, 21, 4636, 5605, 5522, 7512, 504, 1880, 5075, 13639, 1178, 1114, 4294, 5056, 2]
|
|
// Exports: default
|
|
|
|
// Module 13638 (PremiumPlanSelectYearlyUpsellModal)
|
|
import common_AlertDefault from "common/Alert" /* 5075 */;
|
|
import TextStylesDefault from "TextStyles" /* 5605 */;
|
|
import _modDef13639 from "module_13639" /* 13639 */;
|
|
import _slicedToArray from "module_32" /* 32 */;
|
|
import noop from "module_19" /* 19 */;
|
|
import LocaleStore from "LocaleStore" /* 2025 */;
|
|
import IAPStore from "IAPStore" /* 7340 */;
|
|
|
|
const require = fn;
|
|
get_ActivityIndicator = fn(17);
|
|
({ Image: hasOwnProperty, View: metroRequire } = get_ActivityIndicator);
|
|
const usePremiumPlanSelectStore = fn(13629).usePremiumPlanSelectStore;
|
|
let closure_10 = fn(1373).PREMIUM_YEARLY_DISCOUNT_PERCENT;
|
|
const jsxProd = fn(21);
|
|
({ jsx: closure_11, jsxs: closure_12 } = jsxProd);
|
|
const createStyles = fn(4636);
|
|
let obj2 = { container: { marginHorizontal: 26 }, image: { alignSelf: "center", marginVertical: 32 }, header: null, description: null, upsellButton: null, continueButton: null, cancelButton: null };
|
|
let obj3 = {};
|
|
const merged = Object.assign(TextStylesDefault(fn(1085).Fonts.DISPLAY_EXTRABOLD, undefined, 24));
|
|
obj3.alignSelf = "center";
|
|
obj3.textAlign = "center";
|
|
obj3.paddingBottom = 8;
|
|
obj3.color = fn(5522).DARK_WHITE_500_LIGHT_BLACK_500;
|
|
obj2.header = obj3;
|
|
obj2.description = { alignSelf: "center", textAlign: "center", paddingBottom: 32, color: fn(5522).DARK_WHITE_500_LIGHT_BLACK_500 };
|
|
obj2.upsellButton = { marginBottom: 16 };
|
|
obj2.continueButton = { marginBottom: 4 };
|
|
obj2.cancelButton = { marginTop: 8, marginBottom: 4 };
|
|
let closure_13 = createStyles.createStyles(obj2);
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/premium/native/PremiumPlanSelectYearlyUpsellModal.tsx");
|
|
|
|
export default function PremiumPlanSelectYearlyUpsellModal(arg0) {
|
|
({ onClose, productId } = arg0);
|
|
({ orderPriceString, continueWithUpsell: importDefault, continueWithDefault: dependencyMap } = arg0);
|
|
_slicedToArray = undefined;
|
|
noop = undefined;
|
|
const tmp = closure_13();
|
|
const tmp2 = usePremiumPlanSelectStore((isPurchasing) => isPurchasing.isPurchasing);
|
|
[tmp4, c3] = noop.useState(null);
|
|
const obj = noop;
|
|
const tmp3 = _slicedToArray(noop.useState(null), 2);
|
|
const premiumBundledItemsFromProductId = productId(7512).getPremiumBundledItemsFromProductId(productId);
|
|
const obj2 = productId(7512);
|
|
let items = [LocaleStore];
|
|
const stateFromStores = productId(504).useStateFromStores(items, () => locale.locale);
|
|
const obj3 = productId(504);
|
|
const items1 = [IAPStore];
|
|
const tmp9 = _slicedToArray(productId(504).useStateFromStoresArray(items1, () => {
|
|
const items = [IAPStore.getProduct(productId), IAPStore.isBusy()];
|
|
return items;
|
|
}), 2);
|
|
const first = tmp9[0];
|
|
let tmp11 = tmp2;
|
|
if (!tmp2) {
|
|
tmp11 = tmp9[1];
|
|
}
|
|
const premiumTier = premiumBundledItemsFromProductId.premiumTier;
|
|
if (orderPriceString == null) {
|
|
let priceString;
|
|
if (first != null) {
|
|
priceString = first.priceString;
|
|
}
|
|
orderPriceString = priceString;
|
|
}
|
|
noop = tmp13;
|
|
const effect = obj.useEffect(() => {
|
|
if (closure_4) {
|
|
dependencyMap();
|
|
}
|
|
});
|
|
if (null == premiumTier || null == orderPriceString) {
|
|
return null;
|
|
} else {
|
|
const formatPercentResult = tmp5(1880).formatPercent(stateFromStores, closure_10 / 100);
|
|
const obj5 = { onClose, noDefaultButtons: true, children: null };
|
|
const obj6 = { style: tmp.container, children: null };
|
|
const obj7 = { style: tmp.image, source: null };
|
|
const tmp5Result = tmp5(1880);
|
|
obj7.source = _modDef13639;
|
|
const items2 = [closure_11(closure_5, obj7), , , , , ];
|
|
const obj8 = { style: tmp.header, accessibilityRole: "header", children: null };
|
|
const intl = tmp5(1114).intl;
|
|
const obj9 = { discountPercentage: formatPercentResult, planName: null };
|
|
const tmp19 = common_AlertDefault;
|
|
const tmp20 = closure_12;
|
|
obj9.planName = tmp5(4294).getPremiumTypeDisplayName(premiumTier);
|
|
obj8.children = intl.format(tmp5(1114).t.LQCVfK, obj9);
|
|
items2[1] = closure_11(tmp5(1178).LegacyText, obj8);
|
|
const obj10 = { style: tmp.description, children: null };
|
|
const intl2 = tmp5(1114).intl;
|
|
const obj11 = { discountPercentage: formatPercentResult };
|
|
obj10.children = intl2.format(tmp5(1114).t["7chOVL"], obj11);
|
|
items2[2] = closure_11(tmp5(1178).LegacyText, obj10);
|
|
const obj12 = { style: tmp.upsellButton, children: null };
|
|
const obj13 = { variant: "active", text: null, onPress: null, disabled: null, loading: null };
|
|
const intl3 = tmp5(1114).intl;
|
|
const obj14 = { price: orderPriceString };
|
|
obj13.text = intl3.formatToPlainString(tmp5(1114).t.Qvq6GE, obj14);
|
|
obj13.onPress = function onPress() {
|
|
_undefined("upsell");
|
|
importDefault();
|
|
};
|
|
obj13.disabled = tmp11;
|
|
obj13.loading = "upsell" === tmp4 && tmp2;
|
|
obj12.children = closure_11(tmp5(5056).Button, obj13);
|
|
items2[3] = closure_11(closure_6, obj12);
|
|
const obj15 = { style: tmp.continueButton, children: null };
|
|
const obj16 = { variant: "secondary", text: null, onPress: null, disabled: null, loading: null };
|
|
const intl4 = tmp5(1114).intl;
|
|
obj16.text = intl4.string(tmp5(1114).t.YwEyQM);
|
|
obj16.onPress = function onPress() {
|
|
_undefined("default");
|
|
dependencyMap();
|
|
};
|
|
obj16.disabled = tmp11;
|
|
obj16.loading = "default" === tmp4 && tmp2;
|
|
obj15.children = closure_11(tmp5(5056).Button, obj16);
|
|
items2[4] = closure_11(closure_6, obj15);
|
|
const obj17 = { style: tmp.cancelButton, children: null };
|
|
const obj18 = { variant: "tertiary", text: null, onPress: null };
|
|
const intl5 = tmp5(1114).intl;
|
|
obj18.text = intl5.string(tmp5(1114).t.cpT0Cq);
|
|
obj18.onPress = onClose;
|
|
obj17.children = closure_11(tmp5(5056).Button, obj18);
|
|
items2[5] = closure_11(closure_6, obj17);
|
|
obj6.children = items2;
|
|
obj5.children = tmp20(closure_6, obj6);
|
|
return closure_11(tmp19, obj5);
|
|
}
|
|
const obj4 = productId(504);
|
|
};
|