1140 lines
62 KiB
TypeScript
1140 lines
62 KiB
TypeScript
/* Metro module 7041; source: modules/premium/native/PremiumPlanSelectionActionSheet.tsx; dependencies: [5, 57, 31, 27, 7042, 1949, 5140, 7039, 1880, 661, 1309, 4095, 482, 33, 4501, 697, 4573, 1244, 44, 7046, 1856, 566, 7253, 3802, 5137, 4578, 7254, 7035, 4048, 7062, 7258, 7260, 7027, 7325, 7326, 6771, 6789, 6518, 7294, 4247, 4594, 7295, 4080, 683, 7023, 1581, 4496, 7256, 4223, 4002, 7314, 7315, 7316, 7317, 7318, 7319, 477, 6766, 1948, 6275, 7327, 6515, 5475, 7330, 7333, 1305, 7334, 7335, 2] */
|
|
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import LocaleStore from '../../user_settings/LocaleStore.tsx'; /* Metro dependency 1949 */
|
|
import UseTheme from '../../../hooks/useTheme.tsx'; /* Metro dependency 4048 */
|
|
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
|
|
import UseMountEffect from '../../../hooks/useMountEffect.tsx'; /* Metro dependency 4594 */
|
|
import IAPStoreAndroid from '../../../stores/native/IAPStore.android.tsx'; /* Metro dependency 5140 */
|
|
import UseInitialValue from '../../../hooks/useInitialValue.tsx'; /* Metro dependency 6518 */
|
|
import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
|
|
import AnalyticsLocation from '../../app_analytics/AnalyticsLocation.tsx'; /* Metro dependency 6789 */
|
|
import FormSection from '../../../design/void/Form/native/FormSection.tsx'; /* Metro dependency 7330 */
|
|
import NativeCheckoutStoreProvider from '../../checkout/native/stores/NativeCheckoutStoreProvider.tsx'; /* Metro dependency 7335 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as FormConstantsModule from '../../../design/void/Form/native/FormConstants.tsx'; /* Metro dependency 1309 */
|
|
import * as PremiumUtilsModule from '../../../utils/PremiumUtils.tsx'; /* Metro dependency 3802 */
|
|
import * as PaymentConstantsModule from '../../payments/PaymentConstants.tsx'; /* Metro dependency 4095 */
|
|
import * as MobileWebRedirectCheckoutUtilsModule from '../../payments/utils/MobileWebRedirectCheckoutUtils.tsx'; /* Metro dependency 4247 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
|
|
import * as BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
|
|
import * as TextWithIOSLinkWorkaroundModule from '../../a11y/native/TextWithIOSLinkWorkaround.tsx'; /* Metro dependency 6766 */
|
|
import * as BlockedPaymentsCountryExperimentModule from '../../billing/experiments/BlockedPaymentsCountryExperiment.tsx'; /* Metro dependency 7035 */
|
|
import * as NativeCheckoutStoreModule from '../../checkout/native/NativeCheckoutStore.tsx'; /* Metro dependency 7042 */
|
|
import * as UsePremiumTrialOfferNativeModule from '../hooks/usePremiumTrialOffer.native.tsx'; /* Metro dependency 7062 */
|
|
import * as UseCheckoutPlanPriceStringModule from './hooks/useCheckoutPlanPriceString.tsx'; /* Metro dependency 7253 */
|
|
import * as HandlePremiumPurchaseAndroidModule from './handlePremiumPurchase.android.tsx'; /* Metro dependency 7254 */
|
|
import * as UsePremiumDiscountOfferAndroidModule from '../hooks/usePremiumDiscountOffer.android.tsx'; /* Metro dependency 7258 */
|
|
import * as PremiumBogoPromotionUtilsCommonModule from '../PremiumBogoPromotionUtilsCommon.tsx'; /* Metro dependency 7260 */
|
|
import * as PremiumAnalyticsUtilsModule from './PremiumAnalyticsUtils.tsx'; /* Metro dependency 7294 */
|
|
import * as PaymentFlowStartedTriggerPointModule from '../../experiments/trigger_points/PaymentFlowStartedTriggerPoint.tsx'; /* Metro dependency 7295 */
|
|
import * as UseDiscountedPremiumProductInfoModule from './hooks/useDiscountedPremiumProductInfo.tsx'; /* Metro dependency 7325 */
|
|
import * as UseBottomSheetRefModule from '../../../design/components/Sheet/native/useBottomSheetRef.tsx'; /* Metro dependency 7326 */
|
|
import * as ACOMExperimentsModule from '../../billing/native/ACOMExperiments.tsx'; /* Metro dependency 7334 */
|
|
|
|
function _fun55868(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:6, offset: 0x013b5481, size: 1116 bytes, params: 8, frame: 29
|
|
let env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_6 = value.View;
|
|
const env0_7 = value.ActivityIndicator;
|
|
value = require(7039) /* metro dependency 7039: PremiumPlanPurchasedStore */;
|
|
const env0_11 = value.setInitiatedPurchaseFromNewFlow;
|
|
const env0_12 = value.setMobileWebRedirectCheckoutStatus;
|
|
const env0_13 = value.usePremiumPlanPurchasedStore;
|
|
const env0_14 = value.reset;
|
|
value = require(1880) /* metro dependency 1880: PremiumConstants */;
|
|
const env0_15 = value.DISCOUNTS;
|
|
const env0_16 = value.PremiumTypes;
|
|
const env0_17 = value.SubscriptionIntervalTypes;
|
|
const env0_18 = value.SubscriptionPlans;
|
|
const env0_19 = value.SubscriptionPlanInfo;
|
|
const env0_20 = value.PremiumSubscriptionSKUs;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_21 = value.AnalyticEvents;
|
|
const env0_22 = value.AnalyticsObjects;
|
|
const env0_23 = value.AnalyticsObjectTypes;
|
|
const env0_24 = value.MarketingURLs;
|
|
const env0_25 = value.HelpdeskArticles;
|
|
value = require(482) /* metro dependency 482: Constants */;
|
|
const env0_28 = value.CurrencyCodes;
|
|
const env0_29 = value.PaymentGateways;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_30 = value.jsx;
|
|
const env0_31 = value.jsxs;
|
|
const env0_32 = value.Fragment;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
object.body = {padding: 16};
|
|
object.headerText = {'paddingTop': 30, 'paddingHorizontal': 20};
|
|
object.contentSelectPlan = {marginBottom: 16};
|
|
object.contentActivated = {'alignItems': 'center', 'paddingTop': 40, 'paddingBottom': 56};
|
|
object.contentActivatedText = {'width': 328, 'marginTop': 16, 'textAlign': 'center'};
|
|
object.formTitle = {'paddingTop': 0, 'paddingLeft': 0};
|
|
object.formSectionBody = {backgroundColor: 'none'};
|
|
object.formSectionBodyWithNoTitle = {marginTop: -24};
|
|
object.planOptionRowContainer = {paddingHorizontal: 10};
|
|
object.planOptionContainer = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center'};
|
|
object.planOptionPriceContainer = {'flexGrow': 1, 'flexShrink': 1, 'display': 'flex', 'flexDirection': 'column',
|
|
'alignItems': 'flex-end'};
|
|
object.planOptionDiscountContainer = {'display': 'flex', 'flexDirection': 'row', 'flexShrink': 1};
|
|
const object4 = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'justifyContent': 'center',
|
|
'borderRadius': null, 'backgroundColor': null, 'paddingVertical': 2, 'paddingHorizontal': 8, 'marginRight': 8};
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
const GREEN_360 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.GREEN_360;
|
|
object4.backgroundColor = GREEN_360;
|
|
object.planOptionDiscount = object4;
|
|
const WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
|
|
object.planOptionDiscountWhite = {backgroundColor: WHITE};
|
|
object.planOptionDiscountText = {textTransform: 'uppercase'};
|
|
object.blockedPaymentContainer = {marginVertical: 40};
|
|
object.legalDisclaimerText = {marginTop: 16};
|
|
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object.divider = {'height': 1, 'width': '100%', backgroundColor: BORDER_SUBTLE};
|
|
object.offerDividerMargin = {marginBottom: 8};
|
|
object.trialDisclaimer = {marginBottom: 8};
|
|
object.discountDisclaimer = {marginBottom: 20};
|
|
object.loadingIndicator = {marginVertical: 30};
|
|
object.discountSubTextContainer = {alignItems: 'flex-end'};
|
|
object.priceText = {flexShrink: 1};
|
|
const env0_33 = Reflect.apply(createStyles, value, [object]);
|
|
const closure = function(a0) {
|
|
var env0_0 = a0;
|
|
return _fun55905;
|
|
};
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/premium/native/PremiumPlanSelectionActionSheet.tsx');
|
|
exports.default = PremiumPlanSelectionActionSheetWithOrderCTX;
|
|
exports.getItemsByPremiumTypePredicate = closure;
|
|
function getPlanOptions(a0, a1, a2, a3, a4, a5, a6, a7) { // fn#55869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:6073, offset: 0x013b58dd, size: 130 bytes, params: 9, frame: 13
|
|
const env0_0 = a1;
|
|
const env0_1 = a2;
|
|
const env0_2 = a3;
|
|
const env0_3 = a4;
|
|
const env0_4 = a5;
|
|
const env0_5 = a6;
|
|
const env0_6 = a7;
|
|
const Set = global.Set;
|
|
const value = a0.map(function(a0) {
|
|
return a0.premiumTier;
|
|
});
|
|
const value2 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
const set = new Set(value);
|
|
const result = (set instanceof Object ? set : value2).size > 1;
|
|
return a0.map(_fun55871);
|
|
function _fun55871(a0) { // fn#55871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:6176, offset: 0x013b596a, size: 129 bytes, params: 2, frame: 18
|
|
const object = {};
|
|
object.name = (
|
|
<PlanOption
|
|
premiumItem={a0}
|
|
selectedProductId={require}
|
|
optionNeedsProductNameLabel={result}
|
|
trialOffer={importDefault}
|
|
discountOffer={importAll}
|
|
discountedPriceString={a0.productId !== env0_3 ? null : env0_4}
|
|
userIsEligibleForBogoPromotion={dependencyMap}
|
|
selectedPremiumType={env0_6}
|
|
/>
|
|
);
|
|
object.value = a0.productId;
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
function Header_55872({premiumType, isPaymentSuccess, selectedPremiumType, trialOffer, discountOffer}) { // fn#55872, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:2196, offset: 0x013b59eb, size: 252 bytes, params: 2, frame: 25
|
|
var r6;
|
|
const styles = useStyles();
|
|
if (premiumType != null) {
|
|
r6 = isPaymentSuccess ? selectedPremiumType : premiumType;
|
|
(importDefault(44) /* metro dependency 44 */)(r6 != null,
|
|
'If isPaymentSuccess is true, a value must be given for selectedPremiumType. Or premiumType must be given.');
|
|
return ((Component) => <Component premiumType={r6} trialOffer={trialOffer} discountOffer={discountOffer} />)(importDefault(7046) /* metro dependency 7046: PremiumPlanActionSheetHeader */);
|
|
}
|
|
if (isPaymentSuccess) {
|
|
r6 = isPaymentSuccess ? selectedPremiumType : premiumType;
|
|
(importDefault(44) /* metro dependency 44 */)(r6 != null,
|
|
'If isPaymentSuccess is true, a value must be given for selectedPremiumType. Or premiumType must be given.');
|
|
return ((Component) => <Component premiumType={r6} trialOffer={trialOffer} discountOffer={discountOffer} />)(importDefault(7046) /* metro dependency 7046: PremiumPlanActionSheetHeader */);
|
|
}
|
|
const Text = (TextModule).Text;
|
|
const intl = (IndexNativeModule).intl;
|
|
return (
|
|
<Text
|
|
style={styles.headerText}
|
|
variant="text-md/semibold"
|
|
color="text-default"
|
|
accessibilityRole="header"
|
|
>
|
|
{intl.string((IndexNativeModule).t.vLz3Zs)}
|
|
</Text>
|
|
);
|
|
}
|
|
|
|
function PlanOptionBadgeComponent({text, backgroundColorType}) { // fn#55873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:2708, offset: 0x013b5ae7, size: 178 bytes, params: 2, frame: 20
|
|
backgroundColorType = backgroundColorType === undefined ? 'green' : backgroundColorType;
|
|
const styles = useStyles();
|
|
const items2 = [styles.planOptionDiscount];
|
|
const value2 = backgroundColorType === 'white';
|
|
items2[1] = value2 ? styles.planOptionDiscountWhite : null;
|
|
const Text = (TextModule).Text;
|
|
return (
|
|
<View style={items2}>
|
|
<Text
|
|
style={styles.planOptionDiscountText}
|
|
variant="text-xs/bold"
|
|
color={value2 ? 'black' : 'always-white'}
|
|
>
|
|
{text}
|
|
</Text>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function renderPlanOptionBadge({customBadgeComponent, discount, userLocale, showBogoPromotionBadge, hideDefaultDiscountBadges}) { // fn#55874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:3004, offset: 0x013b5b99, size: 276 bytes, params: 2, frame: 25
|
|
var r2;
|
|
var r1;
|
|
var r0;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var format;
|
|
var IAybsG;
|
|
var object2;
|
|
let value = null;
|
|
if (value != customBadgeComponent) {
|
|
r0 = customBadgeComponent;
|
|
} else {
|
|
if (hideDefaultDiscountBadges) {
|
|
r1 = value;
|
|
} else {
|
|
if (showBogoPromotionBadge) {
|
|
r2 = <PlanOptionBadgeComponent text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.iQTfWx)} />;
|
|
} else if (value != discount) {
|
|
format = intl.format;
|
|
IAybsG = (require(1244) /* metro dependency 1244: indexNative */).t.IAybsG;
|
|
object2 = {};
|
|
value = require(1856) /* metro dependency 1856: NumberUtils */;
|
|
object2.discount = value.formatPercent(userLocale, discount / 100);
|
|
value = <PlanOptionBadgeComponent text={Reflect.apply(format, intl, [IAybsG, object2])} />;
|
|
r2 = value;
|
|
} else {
|
|
r2 = value;
|
|
}
|
|
r1 = r2;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function PlanOption({premiumItem, selectedProductId, optionNeedsProductNameLabel, customBadgeComponent, trialOffer, discountOffer, discountedPriceString, userIsEligibleForBogoPromotion, selectedPremiumType}) { // fn#55875, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:3345, offset: 0x013b5cad, size: 1890 bytes, params: 2, frame: 47
|
|
var sku_id;
|
|
var r10;
|
|
var r29;
|
|
var r27;
|
|
var r14;
|
|
var defaultImport;
|
|
var moduleValue4;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var formatToPlainString;
|
|
var hXcaLT;
|
|
var object3;
|
|
userIsEligibleForBogoPromotion = !(userIsEligibleForBogoPromotion === undefined) && userIsEligibleForBogoPromotion;
|
|
const styles = useStyles();
|
|
const locale = LocaleStore.locale;
|
|
let [property, env0_2] = Module00057(ReactModule.useState(0), 2);
|
|
const useStateFromStores = FluxModule.useStateFromStores;
|
|
let object = [IAPStoreAndroid];
|
|
const product = Reflect.apply(useStateFromStores, FluxModule, [object, function() {
|
|
return IAPStoreAndroid.getProduct(premiumItem.productId);
|
|
}]);
|
|
const value7 = (UseCheckoutPlanPriceStringModule).useCheckoutPlanPriceString(premiumItem.productId,
|
|
product);
|
|
const value9 = trialOffer != null;
|
|
if (value9) {
|
|
sku_id = trialOffer.subscription_trial?.sku_id;
|
|
defaultImport = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
|
|
r10 = sku_id === defaultImport.getSkuIdForPremiumType(premiumItem.premiumTier);
|
|
} else {
|
|
r10 = value9;
|
|
}
|
|
const getTierDisplayNameByPlanId = PremiumUtilsModule.getTierDisplayNameByPlanId;
|
|
let basePlanId = premiumItem.basePlanId;
|
|
const value11 = Reflect.apply(getTierDisplayNameByPlanId, PremiumUtilsModule, [basePlanId]);
|
|
const intervalString = (importDefault(3802) /* metro dependency 3802: PremiumUtils */).getIntervalString(premiumItem.interval,
|
|
false);
|
|
basePlanId = premiumItem.basePlanId;
|
|
const PREMIUM_YEAR_TIER_2 = SubscriptionPlans.PREMIUM_YEAR_TIER_2;
|
|
const value13 = basePlanId === PREMIUM_YEAR_TIER_2;
|
|
let r28 = r10 || discountOffer != null;
|
|
r28 = !r28 ? userIsEligibleForBogoPromotion && value13 : r28;
|
|
const r30 = r28 ? null : DISCOUNTS[premiumItem.basePlanId];
|
|
const r16 = userIsEligibleForBogoPromotion && premiumItem.basePlanId === SubscriptionPlans.PREMIUM_MONTH_TIER_2;
|
|
const value16 = premiumItem.productId === selectedProductId;
|
|
const r24 = product == null ? CurrencyCodes.USD : product.currencyCode.toLowerCase() in CurrencyCodes ? product.currencyCode.toLowerCase() : CurrencyCodes.USD;
|
|
const property3 = SubscriptionPlanInfo[premiumItem.basePlanId];
|
|
if (discountedPriceString != null) {
|
|
moduleValue4 = require(5137) /* metro dependency 5137: PriceUtils */;
|
|
r29 = moduleValue4.formatRate(discountedPriceString, property3.interval, property3.intervalCount);
|
|
} else {
|
|
r29 = null;
|
|
}
|
|
if (r10) {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
hXcaLT = (require(1244) /* metro dependency 1244: indexNative */).t.hXcaLT;
|
|
object = {};
|
|
object.price = (require(5137) /* metro dependency 5137: PriceUtils */).formatPrice(0, r24,
|
|
{'minimumFractionDigits': 0, 'maximumFractionDigits': 0});
|
|
r27 = Reflect.apply(formatToPlainString, intl, [hXcaLT, object]);
|
|
} else {
|
|
r27 = discountedPriceString ?? (value7 ?? '$...');
|
|
}
|
|
const priceUtilsModule = require(5137) /* metro dependency 5137: PriceUtils */;
|
|
const value22 = '$...';
|
|
const value23 = priceUtilsModule.formatRate(value7 ?? value22, property3.interval, property3.intervalCount);
|
|
const r8 = property > 0 ? [styles.planOptionPriceContainer,
|
|
{transform: [{translateY: property / 2}]}] : styles.planOptionPriceContainer;
|
|
const Text = (TextModule).Text;
|
|
const value26 = 'interactive-text-default';
|
|
const text = (
|
|
<Text
|
|
variant={discountOffer != null || r10 ? 'text-lg/medium' : 'text-md/medium'}
|
|
color={value16 ? 'interactive-text-active' : value26}
|
|
>
|
|
{optionNeedsProductNameLabel ? '' + value11 + ' ' + intervalString : intervalString}
|
|
</Text>
|
|
);
|
|
const view = (
|
|
<View style={styles.planOptionDiscountContainer}>
|
|
{renderPlanOptionBadge({userLocale: locale, discount: r30, hideDefaultDiscountBadges: r28,
|
|
customBadgeComponent: customBadgeComponent, showBogoPromotionBadge: r16})}
|
|
<Text
|
|
style={styles.priceText}
|
|
variant="text-lg/medium"
|
|
color={value16 ? 'interactive-text-active' : value26}
|
|
>
|
|
{r27}
|
|
</Text>
|
|
</View>
|
|
);
|
|
const r9 = (
|
|
r10
|
|
? (
|
|
<Text variant="text-xs/medium" color={value16 ? 'text-default' : value26}>
|
|
{premiumItem.interval === SubscriptionIntervalTypes.YEAR ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.ECT4A5,
|
|
{price: value7 ?? value22}) : intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.v9QeON,
|
|
{price: value7 ?? value22})}
|
|
</Text>
|
|
)
|
|
: null
|
|
);
|
|
const viewBinding3Props = {style: styles.discountSubTextContainer, onLayout: onLayout_55877};
|
|
if (r29 != null) {
|
|
if (discountOffer != null) {
|
|
if (selectedPremiumType == null) {
|
|
var textProps = {variant: 'text-sm/medium', color: value16 ? 'text-default' : value26};
|
|
formatToPlainString = intl.formatToPlainString;
|
|
property = (require(1244) /* metro dependency 1244: indexNative */).t['02Gmgm'];
|
|
object3 = {discountedPrice: r29};
|
|
r29 = discountOffer.discount?.userUsageLimit ?? 1;
|
|
object3.numMonths = r29;
|
|
r14 = (
|
|
<Text {...textProps}>
|
|
{Reflect.apply(formatToPlainString, intl, [property, object3])}
|
|
</Text>
|
|
);
|
|
} else {
|
|
r14 = null;
|
|
}
|
|
} else {
|
|
r14 = null;
|
|
}
|
|
} else {
|
|
r14 = null;
|
|
}
|
|
return (
|
|
<View style={styles.planOptionContainer}>
|
|
{text}
|
|
<View style={r8}>
|
|
{view}
|
|
{r9}
|
|
<View {...viewBinding3Props}>
|
|
{r14}
|
|
{discountedPriceString != null && discountOffer != null && <Text variant="text-sm/medium" color={value16 ? 'text-default' : value26}>{intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['vZk+c/'],
|
|
{regularPrice: value23, numMonths: discountOffer.discount?.userUsageLimit ?? 1})}</Text>}
|
|
</View>
|
|
</View>
|
|
</View>
|
|
);
|
|
function PlanOptionOnLayout({nativeEvent}) { // fn#55877, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:5460, owner: PlanOption.onLayout, offset: 0x013b6430, size: 46 bytes, params: 2, frame: 11
|
|
const height = nativeEvent.layout.height;
|
|
if (height !== env0_1) {
|
|
env0_2(height);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function PremiumPlanSelectionActionSheetCTA({isPaymentSuccess, onClose, ctaText, onStartPayment, shouldUseMobileWebRedirectCheckout, disabled, loading}) { // fn#55878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:6456, offset: 0x013b645e, size: 307 bytes, params: 2, frame: 19
|
|
const Button = (ButtonNativeModule).Button;
|
|
var intl;
|
|
if (isPaymentSuccess) {
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
return (
|
|
<Button
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.WAI6xu)}
|
|
size="md"
|
|
grow
|
|
onPress={onClose}
|
|
/>
|
|
);
|
|
}
|
|
return (
|
|
<Button
|
|
text={ctaText}
|
|
{...shouldUseMobileWebRedirectCheckout ? {'size': 'lg', 'variant': 'primary'} : {'size': 'md',
|
|
'variant': 'active'}}
|
|
{...{['grow']: true}}
|
|
{...{['onPress']: function() {
|
|
return onStartPayment({shouldRedirectToMobileWeb: shouldUseMobileWebRedirectCheckout});
|
|
}}}
|
|
{...{['loading']: loading}}
|
|
{...{['disabled']: disabled}}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function PremiumPlanSelectionActionSheet({applicationId, analyticsLocation, analyticsLocations, premiumType, predicate = getItemsByPremiumTypePredicate(premiumType ?? PremiumTypes.TIER_2), initialSelectedCriteria = function({interval}) {
|
|
return interval === SubscriptionIntervalTypes.YEAR;
|
|
}, sortFn = function(a0, {interval}) {
|
|
return interval - a0.interval;
|
|
}, onPaymentSuccess, onPaymentDismiss, showFormTitle}) { // fn#55880, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:6896, offset: 0x013b65ac, size: 1848 bytes, params: 2, frame: 41
|
|
var object2;
|
|
var sku_id;
|
|
var defaultImport;
|
|
const onPaymentDismiss2 = onPaymentDismiss;
|
|
showFormTitle = showFormTitle === undefined || showFormTitle;
|
|
const showFormTitle2 = showFormTitle;
|
|
const onClose_558832 = onClose_55883;
|
|
const styles = useStyles();
|
|
const styles2 = styles;
|
|
const value6 = usePremiumPlanPurchasedStore(function(a0) {
|
|
return a0.isPaymentSuccess;
|
|
});
|
|
const value7 = usePremiumPlanPurchasedStore(function(a0) {
|
|
return a0.mobileWebRedirectCheckoutStatus;
|
|
});
|
|
const value8 = (require(566) /* metro dependency 566: flux */).useStateFromStores([IAPStoreAndroid], function() {
|
|
return IAPStoreAndroid.isBusy();
|
|
});
|
|
const value9 = (HandlePremiumPurchaseAndroidModule).useHandlePremiumPurchase();
|
|
const value10 = (BlockedPaymentsCountryExperimentModule).useIsPaymentsBlocked();
|
|
const env0_9 = (UseTheme)();
|
|
const value11 = useNativeCheckoutStore(function(a0) {
|
|
return a0.orderRecord;
|
|
});
|
|
const value12 = (UsePremiumTrialOfferNativeModule).usePremiumTrialOffer();
|
|
const value13 = (UsePremiumDiscountOfferAndroidModule).usePremiumDiscountOffer();
|
|
const value14 = (PremiumBogoPromotionUtilsCommonModule).useIsEligibleForBogoPromotion(false);
|
|
let r0 = value12 != null && premiumType != null;
|
|
if (r0) {
|
|
sku_id = value12.subscription_trial?.sku_id;
|
|
defaultImport = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
|
|
r0 = sku_id === defaultImport.getSkuIdForPremiumType(premiumType);
|
|
}
|
|
const r5 = sortFn == null ? (require(7027) /* metro dependency 7027: PremiumBundledPlansUtils */).getPremiumBundlesWithPredicate(predicate) : (require(7027) /* metro dependency 7027: PremiumBundledPlansUtils */).getPremiumBundlesWithPredicate(predicate).sort(sortFn);
|
|
const value22 = (UseDiscountedPremiumProductInfoModule).useDiscountedPremiumProductInfo(value13,
|
|
r5);
|
|
const env0_16 = value22.discountedProduct;
|
|
const discountedPriceString = value22.discountedPriceString;
|
|
initialSelectedCriteria = value14 ? function({interval}) {
|
|
return interval === SubscriptionIntervalTypes.MONTH;
|
|
} : initialSelectedCriteria;
|
|
let binding = styles2;
|
|
const useState = binding.useState;
|
|
const value24 = showFormTitle2(Reflect.apply(useState, binding, [r5.find(initialSelectedCriteria)]), 2);
|
|
const property = value24[0];
|
|
const env0_19 = value24[1];
|
|
const env0_20 = (require(566) /* metro dependency 566: flux */).useStateFromStores([IAPStoreAndroid], _fun55889);
|
|
const useBottomSheetRef = UseBottomSheetRefModule.useBottomSheetRef;
|
|
const bottomSheetRef = Reflect.apply(useBottomSheetRef, UseBottomSheetRefModule, []).bottomSheetRef;
|
|
const defaultImport2 = UseAnalyticsLocations;
|
|
const PREMIUM_PAYMENT_ACTION_SHEET = (AnalyticsLocation).PREMIUM_PAYMENT_ACTION_SHEET;
|
|
analyticsLocations = defaultImport2(analyticsLocations, PREMIUM_PAYMENT_ACTION_SHEET).analyticsLocations;
|
|
const value25 = (UseInitialValue)(_fun55890);
|
|
const value26 = binding.useMemo(_fun55891, [premiumType]);
|
|
const getBasePurchaseFlowAnalyticsFields = PremiumAnalyticsUtilsModule.getBasePurchaseFlowAnalyticsFields;
|
|
object2 = {analyticsLoadId: value25};
|
|
const object = {};
|
|
const BUTTON_CTA = AnalyticsObjects.BUTTON_CTA;
|
|
object.object = BUTTON_CTA;
|
|
const BUY = AnalyticsObjectTypes.BUY;
|
|
object.object_type = BUY;
|
|
copyDataProperties(object, analyticsLocation, value26);
|
|
object2.analyticsLocation = object;
|
|
object2.analyticsLocations = analyticsLocations;
|
|
const value27 = Reflect.apply(getBasePurchaseFlowAnalyticsFields, PremiumAnalyticsUtilsModule, [object2]);
|
|
const env0_25 = property != null ? property.basePlanId : null;
|
|
const isMobileWebRedirectCheckoutEnabled2 = (MobileWebRedirectCheckoutUtilsModule).isMobileWebRedirectCheckoutEnabled();
|
|
(UseMountEffect)(_fun55892);
|
|
binding = styles2;
|
|
const value29 = binding.useCallback(onPaymentDismiss2(_fun55894), [value26, value27, value25, analyticsLocations,
|
|
value9, isMobileWebRedirectCheckoutEnabled2, onPaymentDismiss, onPaymentSuccess, value11, property]);
|
|
const value30 = binding.useMemo(_fun55899, [r0, isMobileWebRedirectCheckoutEnabled2]);
|
|
const value31 = binding.useMemo(_fun55900, [value6, property, r0, discountedPriceString, value30,
|
|
styles.legalDisclaimerText]);
|
|
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
|
|
return (
|
|
<BottomSheet
|
|
ref={bottomSheetRef}
|
|
handleDisabled
|
|
onDismiss={reset}
|
|
startExpanded
|
|
>
|
|
{
|
|
value10
|
|
? (
|
|
<View style={styles.blockedPaymentContainer}>
|
|
{((Component) => <Component />)(importDefault(7327) /* metro dependency 7327: BlockedPaymentsCountryDisplay */)}
|
|
{((ActionSheetHeaderBar) => <ActionSheetHeaderBar variant="floating" onPress={onClose_558832} />)((require(6515) /* metro dependency 6515: ActionSheetHeaderBarNative */).ActionSheetHeaderBar)}
|
|
</View>
|
|
)
|
|
: (
|
|
<>
|
|
<Header_55872
|
|
premiumType={premiumType}
|
|
isPaymentSuccess={value6}
|
|
selectedPremiumType={property?.premiumTier}
|
|
trialOffer={value12}
|
|
discountOffer={discountedPriceString != null ? value13 : null}
|
|
/>
|
|
<View style={styles.body}>
|
|
{
|
|
value7 === 'in_mobile_web'
|
|
? (
|
|
<ActivityIndicator size="large" style={styles.loadingIndicator} />
|
|
)
|
|
: (
|
|
<>
|
|
{_fun55901()}
|
|
<PremiumPlanSelectionActionSheetCTA
|
|
isPaymentSuccess={value6}
|
|
onClose={onClose_558832}
|
|
ctaText={value30}
|
|
onStartPayment={value29}
|
|
shouldUseMobileWebRedirectCheckout={isMobileWebRedirectCheckoutEnabled2}
|
|
disabled={value8}
|
|
loading={value8}
|
|
/>
|
|
</>
|
|
)
|
|
}
|
|
{!isMobileWebRedirectCheckoutEnabled2 && value31}
|
|
</View>
|
|
{((ActionSheetHeaderBar) => <ActionSheetHeaderBar variant="floating" onPress={onClose_558832} />)((require(6515) /* metro dependency 6515: ActionSheetHeaderBarNative */).ActionSheetHeaderBar)}
|
|
</>
|
|
)
|
|
}
|
|
</BottomSheet>
|
|
);
|
|
function PremiumPlanSelectionActionSheetOnClose() { // fn#55883, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:8527, owner: PremiumPlanSelectionActionSheet.onClose, offset: 0x013b6d18, size: 45 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
reset();
|
|
(ActionSheetActionCreators).hideActionSheet();
|
|
}
|
|
|
|
function _fun55889() { // fn#55889, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:7975, offset: 0x013b6d95, size: 46 bytes, params: 1, frame: 12
|
|
const value2 = null;
|
|
return value2 != env0_18 ? IAPStoreAndroid.getProduct(env0_18.productId) : value2;
|
|
}
|
|
|
|
function _fun55890() { // fn#55890, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:8154, offset: 0x013b6dc3, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (PremiumAnalyticsUtilsModule).getNewAnalyticsLoadId();
|
|
}
|
|
|
|
function _fun55891() { // fn#55891, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:8207, offset: 0x013b6de8, size: 69 bytes, params: 1, frame: 14
|
|
let value = environment.__proto__;
|
|
const castPremiumSubscriptionAsSkuId = PremiumUtilsModule.castPremiumSubscriptionAsSkuId;
|
|
value = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
|
|
const getSkuIdForPremiumType = value.getSkuIdForPremiumType;
|
|
return Reflect.apply(castPremiumSubscriptionAsSkuId, PremiumUtilsModule, [Reflect.apply(getSkuIdForPremiumType,
|
|
value, [premiumType])]);
|
|
}
|
|
|
|
function _fun55892() { // fn#55892, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:8587, offset: 0x013b6e2d, size: 141 bytes, params: 1, frame: 17
|
|
var r5;
|
|
let value = environment.__proto__;
|
|
const value2 = undefined;
|
|
const trackPaymentFlowStartedAnalyticsAndCTP = PaymentFlowStartedTriggerPointModule.trackPaymentFlowStartedAnalyticsAndCTP;
|
|
const object = {};
|
|
copyDataProperties(object, env0_24, undefined);
|
|
object['application_id'] = applicationId;
|
|
object['subscription_plan_id'] = basePlanId;
|
|
object['sku_id'] = env0_23;
|
|
if (FormConstantsModule.TitleStyleType) {
|
|
value = require(4247) /* metro dependency 4247: MobileWebRedirectCheckoutUtils */;
|
|
value = value.getCustomCheckoutFlowForAnalytics();
|
|
r5 = value;
|
|
} else {
|
|
r5 = value2;
|
|
}
|
|
object['custom_checkout_flow'] = r5;
|
|
Reflect.apply(trackPaymentFlowStartedAnalyticsAndCTP, PaymentFlowStartedTriggerPointModule, [object]);
|
|
return value2;
|
|
}
|
|
|
|
async function _fun55894() { // fn#55894, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:8803, offset: 0x013b6ecc, size: 745 bytes, params: 1, frame: 29
|
|
var environment;
|
|
var r1;
|
|
var id;
|
|
var value10;
|
|
var track;
|
|
var PAYMENT_FLOW_STEP;
|
|
var location;
|
|
var iapStoreAndroidBinding;
|
|
var value11;
|
|
var value12;
|
|
var value13;
|
|
var value14;
|
|
var error;
|
|
var binding3;
|
|
var value15;
|
|
var fetchSubscriptions;
|
|
var binding4;
|
|
var show;
|
|
var intl;
|
|
var string;
|
|
var t;
|
|
var F9ktNa;
|
|
var goToStandalonePremiumCheckoutFromMobileApp;
|
|
var closure;
|
|
let value = a0;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
const value4 = undefined;
|
|
reducibleJoin3: while (true) {
|
|
if (value !== value4) {
|
|
r1 = value;
|
|
break reducibleJoin3;
|
|
}
|
|
r1 = {shouldRedirectToMobileWeb: false};
|
|
break reducibleJoin3;
|
|
}
|
|
const shouldRedirectToMobileWeb = r1.shouldRedirectToMobileWeb;
|
|
await value4;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
let binding = env2_1;
|
|
binding(env2_2[18])(SubscriptionPlans != null, 'cannot start payment without a selectedItem');
|
|
const basePlanId = SubscriptionPlans.basePlanId;
|
|
const r8 = TitleStyleType && shouldRedirectToMobileWeb;
|
|
let PaymentFlowStep = env2_0(env2_2[38]).PaymentFlowStep;
|
|
const r14 = r8 ? PaymentFlowStep.MOBILE_WEB_REDIRECT_CHECKOUT : PaymentFlowStep.EXTERNAL_PAYMENT;
|
|
binding = env2_0;
|
|
const binding2 = env2_2;
|
|
const value8 = binding(binding2[38]);
|
|
const getPaymentFlowStepAnalyticsFields = value8.getPaymentFlowStepAnalyticsFields;
|
|
let object = {};
|
|
PaymentFlowStep = binding(binding2[38]).PaymentFlowStep;
|
|
const PLAN_SELECT = PaymentFlowStep.PLAN_SELECT;
|
|
object.from_step = PLAN_SELECT;
|
|
object.to_step = r14;
|
|
let productId = SubscriptionPlans.productId;
|
|
object.subscription_plan_gateway_plan_id = productId;
|
|
object.sku_id = AnalyticsObjectTypes;
|
|
reducibleJoin11: while (true) {
|
|
if (r8) {
|
|
break reducibleJoin11;
|
|
}
|
|
binding = env2_1;
|
|
value10 = binding(env2_2[43]);
|
|
track = value10.track;
|
|
PAYMENT_FLOW_STEP = env2_21.PAYMENT_FLOW_STEP;
|
|
Reflect.apply(track, value10, [PAYMENT_FLOW_STEP, Reflect.apply(getPaymentFlowStepAnalyticsFields, value8,
|
|
[MarketingURLs, object])]);
|
|
break reducibleJoin11;
|
|
}
|
|
reduciblePort39: while (true) {
|
|
exceptionLanding35: while (true) {
|
|
binding = env2_11;
|
|
productId = SubscriptionPlans.productId;
|
|
binding({productId: productId, onPaymentSuccess: dependencyMap, onPaymentDismiss: env1_3});
|
|
if (r8) {
|
|
binding = env2_0;
|
|
value = binding(env2_2[44]);
|
|
goToStandalonePremiumCheckoutFromMobileApp = value.goToStandalonePremiumCheckoutFromMobileApp;
|
|
closure = _fun55895;
|
|
Reflect.apply(goToStandalonePremiumCheckoutFromMobileApp, value, ['premium_plan_selection_action_sheet',
|
|
{planId: basePlanId, isGift: false, loadId: AnalyticsObjects}, closure, _fun55896]);
|
|
break reduciblePort39;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
object = {};
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
productId = SubscriptionPlans.productId;
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
object.productId = productId;
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
location = MarketingURLs.location;
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
object.analyticsLocation = location;
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
object.analyticsLoadId = AnalyticsObjects;
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
object.analyticsLocations = AnalyticEvents;
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
iapStoreAndroidBinding = IAPStoreAndroid;
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
value11 = iapStoreAndroidBinding == null;
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
reducibleJoin29: while (true) {
|
|
if (value11) {
|
|
id = value4;
|
|
break reducibleJoin29;
|
|
}
|
|
try {
|
|
iapStoreAndroidBinding = IAPStoreAndroid;
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
id = iapStoreAndroidBinding.id;
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
break reducibleJoin29;
|
|
}
|
|
try {
|
|
object.orderId = id;
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
value12 = useNativeCheckoutStore(object);
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
await value12;
|
|
try {
|
|
value13 = undefined;
|
|
value14 = false;
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
if (value14) {
|
|
return value13;
|
|
}
|
|
break reduciblePort39;
|
|
}
|
|
binding = env2_1;
|
|
if (!(error instanceof binding(env2_2[47]))) {
|
|
throw error;
|
|
}
|
|
binding = env2_0;
|
|
binding3 = env2_2;
|
|
value15 = binding(binding3[48]);
|
|
fetchSubscriptions = value15.fetchSubscriptions;
|
|
Reflect.apply(fetchSubscriptions, value15, []);
|
|
binding4 = env2_1;
|
|
value = binding4(binding3[46]);
|
|
show = value.show;
|
|
object = {};
|
|
intl = binding(binding3[17]).intl;
|
|
string = intl.string;
|
|
t = binding(binding3[17]).t;
|
|
object.title = Reflect.apply(string, intl, [t['U+H+kd']]);
|
|
intl = binding(binding3[17]).intl;
|
|
string = intl.string;
|
|
t = binding(binding3[17]).t;
|
|
F9ktNa = t.F9ktNa;
|
|
object.body = Reflect.apply(string, intl, [F9ktNa]);
|
|
object.hideActionSheet = true;
|
|
Reflect.apply(show, value, [object]);
|
|
break reduciblePort39;
|
|
}
|
|
return value4;
|
|
function _fun55895() { // fn#55895, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:9467, offset: 0x013b71b5, size: 116 bytes, params: 1, frame: 14
|
|
var value3;
|
|
const value2 = env3_0(env3_2[45]);
|
|
if (value2.isMetaQuest()) {
|
|
value = environment.__proto__.__proto__;
|
|
env2_30();
|
|
} else {
|
|
env3_12('in_mobile_web');
|
|
value3 = env3_1(env3_2[43]);
|
|
value3.track(env3_21.PAYMENT_FLOW_STEP, env0_0);
|
|
}
|
|
}
|
|
|
|
function _fun55896() { // fn#55896, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:9567, offset: 0x013b7229, size: 150 bytes, params: 1, frame: 18
|
|
let binding = env3_1;
|
|
const binding2 = env3_2;
|
|
const value2 = binding(binding2[46]);
|
|
const show = value2.show;
|
|
const object = {};
|
|
binding = env3_0;
|
|
let intl = binding(binding2[17]).intl;
|
|
const string = intl.string;
|
|
const NrBVjw = binding(binding2[17]).t.NrBVjw;
|
|
object.title = Reflect.apply(string, intl, [NrBVjw]);
|
|
intl = binding(binding2[17]).intl;
|
|
object.body = intl.string(binding(binding2[17]).t['gD+grx']);
|
|
object.hideActionSheet = true;
|
|
Reflect.apply(show, value2, [object]);
|
|
}
|
|
|
|
}
|
|
|
|
function getActivatedImageSource() { // fn#55897, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:10109, owner: PremiumPlanSelectionActionSheet.getActivatedImageSource, offset: 0x013b72bf, size: 302 bytes, params: 1, frame: 15
|
|
const value2 = undefined;
|
|
const premiumTier = env0_18 == null ? value2 : env0_18.premiumTier;
|
|
const TIER_0 = PremiumTypes.TIER_0;
|
|
if (TIER_0 === premiumTier) {
|
|
return (require(4002) /* metro dependency 4002: shared */).isThemeDark(env0_9) ? importDefault(7314) /* metro dependency 7314 */ : importDefault(7315) /* metro dependency 7315 */;
|
|
}
|
|
const TIER_1 = PremiumTypes.TIER_1;
|
|
if (TIER_1 === premiumTier) {
|
|
return (require(4002) /* metro dependency 4002: shared */).isThemeDark(env0_9) ? importDefault(7316) /* metro dependency 7316 */ : importDefault(7317) /* metro dependency 7317 */;
|
|
}
|
|
const TIER_2 = PremiumTypes.TIER_2;
|
|
if (TIER_2 === premiumTier) {
|
|
return (require(4002) /* metro dependency 4002: shared */).isThemeDark(env0_9) ? importDefault(7318) /* metro dependency 7318 */ : importDefault(7319) /* metro dependency 7319 */;
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function getActivatedText() { // fn#55898, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:10361, owner: PremiumPlanSelectionActionSheet.getActivatedText, offset: 0x013b73ed, size: 257 bytes, params: 1, frame: 15
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const value2 = undefined;
|
|
const premiumTier = env0_18 == null ? value2 : env0_18.premiumTier;
|
|
const TIER_0 = PremiumTypes.TIER_0;
|
|
if (TIER_0 === premiumTier) {
|
|
return intl.string(t['6WWrVM']);
|
|
}
|
|
const TIER_1 = PremiumTypes.TIER_1;
|
|
if (TIER_1 === premiumTier) {
|
|
return intl.string(t.LAAgsy);
|
|
}
|
|
const TIER_2 = PremiumTypes.TIER_2;
|
|
if (TIER_2 === premiumTier) {
|
|
return intl.string(t.I7xNzI);
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function _fun55899() { // fn#55899, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:10607, offset: 0x013b74ee, size: 249 bytes, params: 1, frame: 17
|
|
var r0;
|
|
const intl = (IndexNativeModule).intl;
|
|
var string;
|
|
const t = (IndexNativeModule).t;
|
|
var value;
|
|
if (FormConstantsModule.TitleStyleType) {
|
|
r0 = intl.string(t.rylrdY);
|
|
} else if (env0_14) {
|
|
value = require(477) /* metro dependency 477: PlatformUtils */;
|
|
value = value.isAndroid();
|
|
string = intl.string;
|
|
r0 = value ? Reflect.apply(string, intl, [t.rKD72m]) : Reflect.apply(string, intl, [t.bboTul]);
|
|
} else {
|
|
r0 = intl.string(t.nIlrxd);
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun55900() { // fn#55900, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:10820, offset: 0x013b75e7, size: 792 bytes, params: 1, frame: 27
|
|
var r6;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var property;
|
|
const TextWithIOSLinkWorkaround = (TextWithIOSLinkWorkaroundModule).TextWithIOSLinkWorkaround;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var format;
|
|
var value4;
|
|
var object2;
|
|
var value5;
|
|
var object3;
|
|
var value;
|
|
if (env0_6) {
|
|
return null;
|
|
}
|
|
const interval = env0_18?.interval;
|
|
if (interval == null) {
|
|
return null;
|
|
}
|
|
if (env0_14) {
|
|
value5 = environment.__proto__;
|
|
var textWithIOSLinkWorkaroundProps = {style: styles.legalDisclaimerText, variant: 'text-xxs/medium'};
|
|
format = intl.format;
|
|
value = require(477) /* metro dependency 477: PlatformUtils */;
|
|
value = value.isAndroid();
|
|
r6 = value ? t.tINI9V : t.ZWXtAj;
|
|
object3 = {};
|
|
object3.paidURL = MarketingURLs.PAID_TERMS;
|
|
value = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
|
|
object3.interval = value.getIntervalStringAsNoun(interval);
|
|
value = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */;
|
|
object3.cancelURL = value.getArticleURL(HelpdeskArticles.PREMIUM_DETAILS_CANCEL_SUB);
|
|
return (
|
|
<TextWithIOSLinkWorkaround {...textWithIOSLinkWorkaroundProps}>
|
|
{Reflect.apply(format, intl, [r6, object3])}
|
|
</TextWithIOSLinkWorkaround>
|
|
);
|
|
}
|
|
if (discountedPriceString != null) {
|
|
value4 = environment.__proto__;
|
|
var textWithIOSLinkWorkaroundProps = {style: styles.legalDisclaimerText, variant: 'text-xxs/medium'};
|
|
format = intl.format;
|
|
property = (require(1244) /* metro dependency 1244: indexNative */).t['3uC7vj'];
|
|
object2 = {buttonText: env0_29};
|
|
value = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
|
|
object2.interval = value.formatInterval(interval);
|
|
value = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */;
|
|
object2.cancelSubscriptionArticle = value.getArticleURL(HelpdeskArticles.PREMIUM_DETAILS_CANCEL_SUB);
|
|
value = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */;
|
|
object2.paidServiceTermsArticle = value.getArticleURL(HelpdeskArticles.PAID_TERMS);
|
|
return (
|
|
<TextWithIOSLinkWorkaround {...textWithIOSLinkWorkaroundProps}>
|
|
{Reflect.apply(format, intl, [property, object2])}
|
|
</TextWithIOSLinkWorkaround>
|
|
);
|
|
}
|
|
const r9 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? t.COObWR : t['7wpqfj'];
|
|
format = intl.format;
|
|
const object4 = {};
|
|
const PAID_TERMS = MarketingURLs.PAID_TERMS;
|
|
object4.paidURL = PAID_TERMS;
|
|
object4.interval = (importDefault(3802) /* metro dependency 3802: PremiumUtils */).getIntervalStringAsNoun(interval);
|
|
object4.ctaText = env0_29;
|
|
return (
|
|
<TextWithIOSLinkWorkaround style={styles.legalDisclaimerText} variant="text-xxs/medium">
|
|
{Reflect.apply(format, intl, [r9, object4])}
|
|
</TextWithIOSLinkWorkaround>
|
|
);
|
|
}
|
|
|
|
function _fun55901() { // fn#55901, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:12394, offset: 0x013b78ff, size: 1305 bytes, params: 1, frame: 40
|
|
var r6;
|
|
var discountedPriceStringBinding;
|
|
var value5;
|
|
const Text = (TextModule).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var items2;
|
|
var PaymentFlowWarningMessage;
|
|
var formatToPlainString;
|
|
var property;
|
|
var moduleValue2;
|
|
if (env0_6) {
|
|
return (
|
|
<View style={styles.contentActivated}>
|
|
{((Component) => <Component source={getActivatedImageSource()} />)(importDefault(5475) /* metro dependency 5475: FastImage */)}
|
|
<Text style={styles.contentActivatedText} variant="text-md/semibold">
|
|
{getActivatedText()}
|
|
</Text>
|
|
</View>
|
|
);
|
|
}
|
|
const object = {};
|
|
const value3 = undefined;
|
|
object.convertToMajorUnits = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid();
|
|
let r11 = showFormTitle && !env0_14;
|
|
if (env0_14) {
|
|
r6 = (
|
|
<Text
|
|
variant="text-md/normal"
|
|
color="text-strong"
|
|
style={styles.trialDisclaimer}
|
|
>
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.u95Dt4)}
|
|
</Text>
|
|
);
|
|
} else {
|
|
discountedPriceStringBinding = discountedPriceString;
|
|
value5 = null;
|
|
if (value5 != discountedPriceStringBinding) {
|
|
if (value5 != discountedProduct) {
|
|
if (value5 != premiumType) {
|
|
items2 = [
|
|
<Text
|
|
variant="text-md/normal"
|
|
color="text-strong"
|
|
style={styles.discountDisclaimer}
|
|
>
|
|
{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.yBn7uz,
|
|
{regularPrice: discountedProduct.priceString, discountedPrice: discountedPriceString})}
|
|
</Text>,
|
|
];
|
|
items2[1] = <View style={[styles.divider, styles.offerDividerMargin]} />;
|
|
r6 = (
|
|
<View>
|
|
{items2}
|
|
</View>
|
|
);
|
|
} else {
|
|
r6 = value5;
|
|
}
|
|
} else {
|
|
r6 = value5;
|
|
}
|
|
} else {
|
|
r6 = value5;
|
|
}
|
|
}
|
|
const r10 = r11 ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.u95Dt4) : value3;
|
|
const NO_BORDER_OR_MARGIN = TitleStyleType.NO_BORDER_OR_MARGIN;
|
|
const items4 = [styles.formSectionBody];
|
|
r11 = !r11 && styles.formSectionBodyWithNoTitle;
|
|
items4[1] = r11;
|
|
r11 = env0_20 != null && env0_20.countryCode === 'HR' && env0_20.currencyCode.toLowerCase() === CurrencyCodes.EUR;
|
|
if (r11) {
|
|
PaymentFlowWarningMessage = importDefault(7333) /* metro dependency 7333: PaymentFlowWarningMessage */;
|
|
formatToPlainString = intl.formatToPlainString;
|
|
property = (require(1244) /* metro dependency 1244: indexNative */).t['9hnZoK'];
|
|
moduleValue2 = require(5137) /* metro dependency 5137: PriceUtils */;
|
|
r11 = (
|
|
<PaymentFlowWarningMessage
|
|
message={Reflect.apply(formatToPlainString, intl, [property,
|
|
{kunaPriceWithCurrency: moduleValue2.formatPrice(env0_20.price * EUR_TO_HRK_CONVERSION_RATE,
|
|
CurrencyCodes.HRK, object)}])}
|
|
/>
|
|
);
|
|
}
|
|
const RadioGroup = (NativeModule).RadioGroup;
|
|
return (
|
|
<View style={styles.contentSelectPlan}>
|
|
{r6}
|
|
<FormSection
|
|
title={r10}
|
|
titleStyleType={NO_BORDER_OR_MARGIN}
|
|
titleViewStyle={styles.formTitle}
|
|
sectionBodyStyle={items4}
|
|
inset
|
|
>
|
|
{r11}
|
|
<RadioGroup
|
|
value={env0_18 == null ? value3 : env0_18.productId}
|
|
options={getPlanOptions(env0_15, env0_18 == null ? value3 : env0_18.productId, env0_11, env0_12,
|
|
discountedProduct == null ? value3 : discountedProduct.identifier, discountedPriceString,
|
|
env0_13, premiumType)}
|
|
onChange={onChange_55902}
|
|
withDividers={false}
|
|
style={styles.planOptionRowContainer}
|
|
disabled={env0_7}
|
|
indicatorLeft
|
|
/>
|
|
</FormSection>
|
|
</View>
|
|
);
|
|
function onChange_55902({value}) { // fn#55902, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:13732, offset: 0x013b7e18, size: 52 bytes, params: 2, frame: 12
|
|
var environment;
|
|
value = environment.__proto__;
|
|
env1_19(env1_15.find(function({productId}) {
|
|
return productId === value;
|
|
}));
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function getItemsByPremiumTypePredicate(a0) { // fn#55904, offset: 0x013b7e62, size: 16 bytes, params: 2, frame: 2
|
|
const env0_0 = a0;
|
|
return _fun55905;
|
|
function _fun55905({additionalPlans, isDeprecated, numPremiumGuild, premiumTier}) { // fn#55905, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:14176, offset: 0x013b7e72, size: 67 bytes, params: 2, frame: 6
|
|
return additionalPlans.length === 0 && !isDeprecated && numPremiumGuild === 0 && premiumTier === env0_0;
|
|
}
|
|
|
|
}
|
|
|
|
function PremiumPlanSelectionActionSheetWithOrderCTX(a0) { // fn#55906, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7219:14283, offset: 0x013b7eb5, size: 306 bytes, params: 2, frame: 17
|
|
const NitroACOMSubscriptionExperiment = (ACOMExperimentsModule).NitroACOMSubscriptionExperiment;
|
|
const useConfig = NitroACOMSubscriptionExperiment.useConfig;
|
|
const r7 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS() ? Reflect.apply(useConfig,
|
|
NitroACOMSubscriptionExperiment,
|
|
[{location: 'PremiumPlanSelectionActionSheetWithOrderCTX'}]).enabled ? PaymentGateways.APPLE_ADVANCED_COMMERCE : PaymentGateways.APPLE : PaymentGateways.GOOGLE;
|
|
object = {};
|
|
const PREMIUM_YEAR_TIER_2 = SubscriptionPlans.PREMIUM_YEAR_TIER_2;
|
|
object.subscriptionPlanId = PREMIUM_YEAR_TIER_2;
|
|
const castPremiumSubscriptionAsSkuId = PremiumUtilsModule.castPremiumSubscriptionAsSkuId;
|
|
const TIER_2 = PremiumSubscriptionSKUs.TIER_2;
|
|
object.skuId = Reflect.apply(castPremiumSubscriptionAsSkuId, PremiumUtilsModule, [TIER_2]);
|
|
object.quantity = 1;
|
|
const items2 = [object];
|
|
const APPLE_ADVANCED_COMMERCE = PaymentGateways.APPLE_ADVANCED_COMMERCE;
|
|
return (
|
|
<NativeCheckoutStoreProvider
|
|
paymentGateway={r7}
|
|
waitAndCreateOrder={r7 === APPLE_ADVANCED_COMMERCE}
|
|
skuIds={[]}
|
|
defaultPlans={items2}
|
|
isGift={false}
|
|
activeSubscription={null}
|
|
>
|
|
<PremiumPlanSelectionActionSheet {...a0} />
|
|
</NativeCheckoutStoreProvider>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun55868, 7041, [5, 57, 31, 27, 7042, 1949, 5140, 7039, 1880, 661, 1309, 4095, 482, 33, 4501, 697, 4573,
|
|
1244, 44, 7046, 1856, 566, 7253, 3802, 5137, 4578, 7254, 7035, 4048, 7062, 7258, 7260, 7027, 7325, 7326, 6771,
|
|
6789, 6518, 7294, 4247, 4594, 7295, 4080, 683, 7023, 1581, 4496, 7256, 4223, 4002, 7314, 7315, 7316, 7317, 7318,
|
|
7319, 477, 6766, 1948, 6275, 7327, 6515, 5475, 7330, 7333, 1305, 7334, 7335,
|
|
2]) /* metro module 7041, dependencies: [5, 57, 31, 27, 7042, 1949, 5140, 7039, 1880, 661, 1309, 4095, 482, 33, 4501, 697, 4573, 1244, 44, 7046, 1856, 566, 7253, 3802, 5137, 4578, 7254, 7035, 4048, 7062, 7258, 7260, 7027, 7325, 7326, 6771, 6789, 6518, 7294, 4247, 4594, 7295, 4080, 683, 7023, 1581, 4496, 7256, 4223, 4002, 7314, 7315, 7316, 7317, 7318, 7319, 477, 6766, 1948, 6275, 7327, 6515, 5475, 7330, 7333, 1305, 7334, 7335, 2] */;
|