/* Metro module 5140; source: stores/native/IAPStore.android.tsx; dependencies: [6, 7, 15, 17, 18, 5141, 482, 5137, 3817, 566, 694, 2] */ function _fun45333(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#45333, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5318:6, offset: 0x0118c266, size: 587 bytes, params: 8, frame: 21 const env0_0 = require; const closure = GPLAY_SUBSCRIPTION_SKUS_LOADED; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_2 = importDefault(6) /* metro dependency 6 */; const env0_3 = importDefault(7) /* metro dependency 7 */; const env0_4 = importDefault(15) /* metro dependency 15 */; const env0_5 = importDefault(17) /* metro dependency 17 */; const env0_6 = importDefault(18) /* metro dependency 18 */; const constantsModule = require(5141) /* metro dependency 5141: Constants */; const GPlayConnectionState = constantsModule.GPlayConnectionState; const env0_8 = constantsModule.GPlaySkusType; const env0_9 = (require(482) /* metro dependency 482: Constants */).CurrencyCodes; let env0_10 = GPlayConnectionState.DISCONNECTED; const Map = global.Map; const map = new Map(); let Set = global.Set; let set = new Set(); Set = global.Set; set = new Set(); const Store = (importDefault(566) /* metro dependency 566: flux */).Store; _fun45344(Store).displayName = 'IAPStore'; set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {GPLAY_UPDATE_CONNECTION_STATE: function(a0) { env0_10 = a0.connectionState; }, GPLAY_FETCH_SUBSCRIPTION_SKUS_START: function() { env0_18 = true; }, GPLAY_SUBSCRIPTION_SKUS_LOADED: closure, GPLAY_FETCH_SUBSCRIPTION_SKUS_FAILED: function() { env0_18 = false; }, GPLAY_FETCH_IN_APP_SKUS_START: function() { env0_17 = true; }, GPLAY_IN_APP_SKUS_LOADED: closure, GPLAY_FETCH_IN_APP_SKUS_FAILED: function() { env0_17 = false; }, GPLAY_VERIFICATION_START: GPLAY_VERIFICATION_START, GPLAY_VERIFICATION_END: GPLAY_VERIFICATION_END, GPLAY_UPDATE_PENDING_DOWNGRADE: function(a0) { env0_15 = a0.pendingDowngrade; }, GPLAY_UPDATE_IS_DOWNGRADING: function(a0) { env0_16 = a0.isDowngrading; }, GPLAY_SET_USER_COUNTRY: function(a0) { env0_19 = a0.countryCode; }}); (require(2) /* metro dependency 2 */).fileFinishedImporting('stores/native/IAPStore.android.tsx'); exports.default = set; } function _isNativeReflectConstruct_45334() { // fn#45334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5318:225, offset: 0x0118c4b1, size: 94 bytes, params: 1, frame: 18 var Boolean; var prototype; var valueOf; var call; var Reflect; var construct; var closure; var value; var error; try { Boolean = global.Boolean; prototype = Boolean.prototype; valueOf = prototype.valueOf; call = valueOf.call; Reflect = global.Reflect; construct = Reflect.construct; Boolean = global.Boolean; closure = function() { }; value = Reflect.apply(construct, Reflect, [Boolean, [], closure]); value = Reflect.apply(call, valueOf, [value]); var result = !value; } catch (error) { } return (_isNativeReflectConstruct_45334_isNativeReflectConstruct = function() { return !!result; })(); } function updateProduct(a0) { // fn#45337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5318:505, offset: 0x0118c50f, size: 197 bytes, params: 2, frame: 18 const value = a0.currencyCode.toLowerCase(); const value2 = a0.price / 100; const r2 = env0_19 !== 'BG' ? (require(5137) /* metro dependency 5137: PriceUtils */).formatSingleCurrencyPrice(value2, value, {convertToMajorUnits: false}) : value === CurrencyCodes.EUR ? (require(5137) /* metro dependency 5137: PriceUtils */).formatDualPriceForBG(value2, {convertToMajorUnits: false}) : (require(5137) /* metro dependency 5137: PriceUtils */).formatSingleCurrencyPrice(value2, value, {convertToMajorUnits: false}); const object2 = {}; copyDataProperties(object2, a0, undefined); object2['price'] = a0.price; object2['currencyCode'] = value; object2['priceString'] = r2; return object2; } function GPLAY_IN_APP_SKUS_LOADED({skus, skusType}) { // fn#45338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5318:779, offset: 0x0118c5d4, size: 269 bytes, params: 2, frame: 19 var r5; var value5; var value6; var error; var moduleValue; skus.forEach(_fun45339); const Array = global.Array; const from = Array.from; let binding = env0_12; const r9 = Reflect.apply(from, Array, [binding.values()])?.filter(function(a0) { return a0 != null; }); env0_11 = r9; if (r9 != null) { r9.forEach(function(a0) { var r3; var value = undefined; r3 = a0 == null ? value : a0.offerIds; if (r3 != null) { r3.forEach(_fun45342); } return value; }); } try { binding = env0_11; value5 = binding == null; if (value5) { r5 = undefined; } else { value6 = binding.map(updateProduct); r5 = value6; } env0_11 = r5; } catch (error) { moduleValue = require(3817) /* metro dependency 3817: BillingUtils */; moduleValue.captureBillingException(error); } binding = env0_11; if (binding != null) { binding.forEach(_fun45343); } const IN_APP = GPlaySkusType.IN_APP; if (IN_APP !== skusType) { if (GPlaySkusType.SUBSCRIPTION !== skusType) { } } } function _fun45344(a0) { // fn#45344, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5318:1246, offset: 0x0118c743, size: 302 bytes, params: 2, frame: 16 const closure = IAPStore; env0_6(closure, a0); return env0_3(closure, [{key: 'getProducts', value: value_45346}, {key: 'getOfferIds', value: value_45347}, {key: 'getProduct', value: value_45348}, {key: 'isBusy', value: value_45349}, {key: 'isPurchasingProduct', value: value_45350}, {key: 'isReady', value: function() { return DISCONNECTED === GPlayConnectionState.CONNECTED; }}, {key: 'hasConnectionError', value: function() { return DISCONNECTED === GPlayConnectionState.ERROR; }}, {key: 'getPendingDowngrade', value: value_45353}, {key: 'isFetchingGoogleSkus', value: value_45354}, {key: 'isFetchingProducts', value: value_45355}, {key: 'getUserCountry', value: value_45356}]); } function GPLAY_VERIFICATION_START({productId}) { // fn#45362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5318:2697, offset: 0x0118c927, size: 30 bytes, params: 2, frame: 11 env0_14.add(productId); } function GPLAY_VERIFICATION_END({productId}) { // fn#45363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5318:2778, offset: 0x0118c945, size: 99 bytes, params: 2, frame: 13 const binding = env0_14; if (binding.has(productId)) { env0_14.delete(productId); return undefined; } const Error = global.Error; const value = 'Tried verifying product without initialization: ' + productId; const value2 = Object.create(Error.prototype, {constructor: {value: Error}}); const error = new Error(value); throw error instanceof Object ? error : value2; } function _fun45339(a0) { // fn#45339, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5318:841, offset: 0x0118c6e1, size: 31 bytes, params: 2, frame: 13 const binding = env1_12; binding.set(a0.identifier, a0); } function _fun45341(a0) { // fn#45341, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5318:957, offset: 0x0118c700, size: 45 bytes, params: 2, frame: 13 const value = undefined; const offerIds = a0 == null ? value : a0.offerIds; if (offerIds != null) { offerIds.forEach(_fun45342); } return value; } function value_45348(a0) { // fn#45348, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5318:1610, offset: 0x0118c871, size: 34 bytes, params: 2, frame: 11 let value = environment.__proto__; value = env1_12.get(a0); const value2 = null; return value2 != value ? value : value2; } function value_45349() { // fn#45349, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5318:1683, offset: 0x0118c893, size: 27 bytes, params: 1, frame: 3 return env1_14.size > 0 || env1_16; } function value_45354() { // fn#45354, offset: 0x0118c8dc, size: 16 bytes, params: 1, frame: 3 return env1_18 || env1_17; } function _fun45342(a0) { // fn#45342, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5318:1013, offset: 0x0118c72d, size: 22 bytes, params: 2, frame: 11 return env2_13.add(a0); }