/* Metro module 7942; source: modules/premium/native/hooks/usePremiumPlanPrice.tsx; dependencies: [3807, 3808, 5140, 566, 7334, 7943, 7944, 5143, 477, 5137, 2] */ function _fun63377(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#63377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8120:6, offset: 0x01b7d848, size: 148 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const subscriptionPlanStore = importDefault(3807) /* metro dependency 3807: SubscriptionPlanStore */; const subscriptionStore = importDefault(3808) /* metro dependency 3808: SubscriptionStore */; const iapStoreAndroid = importDefault(5140) /* metro dependency 5140: IAPStoreAndroid */; (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/hooks/usePremiumPlanPrice.tsx'); exports.default = usePremiumPlanPrice; } function usePremiumPlanPrice(a0) { // fn#63378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8120:223, offset: 0x01b7d8dc, size: 632 bytes, params: 2, frame: 26 var r1; var r2; var r0; var moduleValue4; const PriceStates = (require(7944) /* metro dependency 7944: useStoreFrontPrice */).PriceStates; var amount; var currency; var formatPrice; const env0_0 = a0; var value; const value2 = undefined; const fluxModule = require(566) /* metro dependency 566: flux */; let useStateFromStores = fluxModule.useStateFromStores; let object = [SubscriptionStore]; const premiumSubscription = Reflect.apply(useStateFromStores, fluxModule, [object, function() { return SubscriptionStore.getPremiumSubscription(); }]); const NitroACOMSubscriptionExperiment = (require(7334) /* metro dependency 7334: ACOMExperiments */).NitroACOMSubscriptionExperiment; const useConfig = NitroACOMSubscriptionExperiment.useConfig; const enabled = Reflect.apply(useConfig, NitroACOMSubscriptionExperiment, [{location: 'usePremiumPlanPrice'}]).enabled; const defaultImport = importDefault(7943) /* metro dependency 7943: NativePaymentHooksAndroid */; const useNativeIAPPayments = defaultImport.useNativeIAPPayments; const storeFront = Reflect.apply(useNativeIAPPayments, defaultImport, []).storeFront; const moduleValue2 = fluxModule; useStateFromStores = moduleValue2.useStateFromStores; const {price, priceState} = (importDefault(7944) /* metro dependency 7944: useStoreFrontPrice */)(Reflect.apply(useStateFromStores, moduleValue2, [[SubscriptionPlanStore], _fun63380, [a0]]), storeFront); const value5 = null; const value6 = fluxModule.useStateFromStores([IAPStoreAndroid], _fun63381, [value5 != a0 ? (require(5143) /* metro dependency 5143: ProductIdsAndroid */).BasePlanIdToProductId[a0] : value5]); if (value5 == a0) { r0 = value5; } else { moduleValue4 = require(477) /* metro dependency 477: PlatformUtils */; if (moduleValue4.isIOS()) { if (enabled) { if (priceState !== PriceStates.PRICE_AVAILABLE) { r2 = value5; } else if (value5 != price) { object = {}; amount = price.amount; object.price = amount; currency = price.currency; object.currency = currency; object.countryCode = value5 == storeFront ? value2 : storeFront.country; value = require(5137) /* metro dependency 5137: PriceUtils */; formatPrice = value.formatPrice; amount = price.amount; currency = price.currency; object.priceString = Reflect.apply(formatPrice, value, [amount, currency]); object.source = 'API'; r2 = object; } else { r2 = value5; } r1 = r2; } else if ((value5 == premiumSubscription ? value2 : premiumSubscription.isACOM) === true) { if (priceState !== PriceStates.PRICE_AVAILABLE) { r2 = value5; } else if (value5 != price) { object = {}; amount = price.amount; object.price = amount; currency = price.currency; object.currency = currency; object.countryCode = value5 == storeFront ? value2 : storeFront.country; value = require(5137) /* metro dependency 5137: PriceUtils */; formatPrice = value.formatPrice; amount = price.amount; currency = price.currency; object.priceString = Reflect.apply(formatPrice, value, [amount, currency]); object.source = 'API'; r2 = object; } else { r2 = value5; } r1 = r2; } else { r1 = value5 != value6 ? {price: value6.price, currency: value6.currencyCode, countryCode: value5 != (value5 == storeFront ? value2 : storeFront.country) ? value5 == storeFront ? value2 : storeFront.country : value6.countryCode, priceString: value6.priceString, source: 'IAP'} : value5; } } else { r1 = value5 != value6 ? {price: value6.price, currency: value6.currencyCode, countryCode: value5 != (value5 == storeFront ? value2 : storeFront.country) ? value5 == storeFront ? value2 : storeFront.country : value6.countryCode, priceString: value6.priceString, source: 'IAP'} : value5; } r0 = r1; } return r0; } function _fun63380() { // fn#63380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8120:500, offset: 0x01b7db67, size: 39 bytes, params: 1, frame: 12 const value2 = null; return value2 != env0_0 ? SubscriptionPlanStore.get(env0_0) : value2; } function _fun63381() { // fn#63381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8120:654, offset: 0x01b7db8e, size: 40 bytes, params: 1, frame: 12 const value2 = null; return value2 != env0_1 ? IAPStoreAndroid.getProduct(env0_1) : value2; }