/* Metro module 6834; source: modules/storefront/SKUPricesStore.tsx; dependencies: [6, 7, 15, 17, 18, 1949, 1360, 566, 694, 2] */ import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */ import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */ import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */ import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */ import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */ import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */ import LocaleStore from '../user_settings/LocaleStore.tsx'; /* Metro dependency 1949 */ import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ function _fun53816(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#53816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7012:6, offset: 0x01356644, size: 370 bytes, params: 8, frame: 20 const env0_0 = require; const serializeStorefrontPriceId = function(a0) { return a0.type === 'application' ? 'application:' + a0.applicationId : 'skus:' + a0.skuId; }; const closure = function() { env0_8 = {}; env0_9 = {}; env0_10 = {}; env0_11 = {}; }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let env0_8 = {}; let env0_9 = {}; let env0_10 = {}; let env0_11 = {}; const Store = (Flux).Store; let value = _fun53824(Store); value.displayName = 'SKUPricesStore'; value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {LOGOUT: closure, SKUS_PRICING_FETCH_START: function({priceId}) { setPriceIdState(priceId, {type: 'loading'}); }, SKUS_PRICING_FETCH_SUCCESS: SKUS_PRICING_FETCH_SUCCESS, SKUS_PRICING_FETCH_FAIL: function({priceId}) { var setPriceIdStateBinding = setPriceIdState; var object = {type: 'error'}; var Date = global.Date; object.fetchedAt = Date.now(); setPriceIdStateBinding(priceId, object); }, STOREFRONT_PROMOTION_ID_OVERRIDE_SET: closure}); (FileImportTrackerModule).fileFinishedImporting('modules/storefront/SKUPricesStore.tsx'); exports.default = value; function _isNativeReflectConstruct_53817() { // fn#53817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7012:158, offset: 0x013567b6, 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_53817_isNativeReflectConstruct = function() { return !!result; })(); } function setPriceIdState(a0, a1) { // fn#53821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7012:494, offset: 0x01356862, size: 154 bytes, params: 3, frame: 18 var object; var Object; var fromEntries; var skuIds; var serializeStorefrontPriceIdBinding; var object2; const env0_0 = a1; if (a0.type === 'application') { object = {}; copyDataProperties(object, env0_8, undefined); serializeStorefrontPriceIdBinding = serializeStorefrontPriceId; object2 = {type: 'application'}; object2.applicationId = a0.applicationId; object[serializeStorefrontPriceIdBinding(object2)] = a1; } else { object = {}; copyDataProperties(object, env0_8, undefined); Object = global.Object; fromEntries = Object.fromEntries; skuIds = a0.skuIds; copyDataProperties(object, Reflect.apply(fromEntries, Object, [skuIds.map(_fun53822)]), skuIds); } function _fun53822(a0) { // fn#53822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7012:681, offset: 0x013568fc, size: 52 bytes, params: 2, frame: 11 const value = environment.__proto__; const serializeStorefrontPriceIdBinding = serializeStorefrontPriceId; let object = {type: 'sku', skuId: a0}; object = [serializeStorefrontPriceIdBinding(object)]; object[1] = require; return object; } } function _fun53824(a0) { // fn#53824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7012:794, offset: 0x0135694f, size: 168 bytes, params: 2, frame: 16 const SKUPricesStore2 = SKUPricesStore; Inherits(SKUPricesStore2, a0); return CreateClass(SKUPricesStore2, [{key: 'initialize', value: function() { var localeStoreBinding = LocaleStore; this.waitFor(localeStoreBinding); this.syncWith([localeStoreBinding], LOGOUT_53823); }}, {key: 'getPricesForSkuId', value: value_53827}, {key: 'getFetchStateForSkuId', value: value_53828}, {key: 'getFetchStateForApplicationId', value: value_53829}, {key: 'getRewardsForSkuId', value: value_53830}]); function SKUPricesStore() { // fn#53825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7012:806, offset: 0x00de700a, size: 113 bytes, params: 1, frame: 20 const value = environment.__proto__; env1_2(this, SKUPricesStore); const value3 = env1_5(SKUPricesStore); return env1_4(this, _isNativeReflectConstruct_53817() ? global.Reflect.construct(value3, arguments, env1_5(this).constructor) : value3.apply(this, arguments)); } function value_53827(a0) { // fn#53827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7012:1189, offset: 0x01356a28, size: 53 bytes, params: 2, frame: 5 if (a0 != null) { var pricingResultId = env1_11[a0]?.pricingResultId; if (pricingResultId != null) { return env1_9[pricingResultId]; } } } function value_53828(a0) { // fn#53828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7012:1326, offset: 0x01356a5d, size: 51 bytes, params: 2, frame: 13 var value; if (a0 != null) { value = environment.__proto__; return env1_8[serializeStorefrontPriceId({type: 'sku', skuId: a0})]; } } function value_53829(a0) { // fn#53829, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7012:1453, offset: 0x01356a90, size: 51 bytes, params: 2, frame: 13 var value; if (a0 != null) { value = environment.__proto__; return env1_8[serializeStorefrontPriceId({type: 'application', applicationId: a0})]; } } function value_53830(a0) { // fn#53830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7012:1585, offset: 0x01356ac3, size: 91 bytes, params: 2, frame: 13 var value2; if (a0 != null) { var property = env1_11[a0]; if (property != null) { value2 = property.rewardResultIds.map(_fun53831); return value2.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish); } } function _fun53831(a0) { // fn#53831, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7012:1661, offset: 0x01356b1e, size: 16 bytes, params: 2, frame: 2 return env2_10[a0]; } } } function SKUS_PRICING_FETCH_SUCCESS({priceId, data}) { // fn#53833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7012:1924, offset: 0x01356b52, size: 224 bytes, params: 2, frame: 19 var r9; var Object; const Date = global.Date; const value = Date.now(); setPriceIdState(priceId, {type: 'success', fetchedAt: value}); if (priceId.type === 'application') { setPriceIdStateBinding = setPriceIdState; Object = global.Object; setPriceIdStateBinding({type: 'skus', skuIds: Object.keys(data.skuPriceMap)}, {type: 'success', fetchedAt: value}); r9 = Object; } object = {}; copyDataProperties(object, env0_9, r9); copyDataProperties(object, data.pricingResultIdMap, r9); object = {}; copyDataProperties(object, env0_11, r9); copyDataProperties(object, data.skuPriceMap, r9); object = {}; copyDataProperties(object, env0_10, r9); copyDataProperties(object, data.rewardResultIdMap, r9); } } global.__d(_fun53816, 6834, [6, 7, 15, 17, 18, 1949, 1360, 566, 694, 2]) /* metro module 6834, dependencies: [6, 7, 15, 17, 18, 1949, 1360, 566, 694, 2] */;