/* Metro module 15811; source: modules/premium/promotions/PromotionsManager.tsx; dependencies: [5, 6, 7, 15, 17, 18, 1878, 1880, 661, 482, 3802, 7260, 7289, 4860, 2] */ function _fun121506(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#121506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:6, offset: 0x02549a94, size: 328 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_3 = importDefault(5) /* metro dependency 5 */; const env0_4 = importDefault(6) /* metro dependency 6 */; const env0_5 = importDefault(7) /* metro dependency 7 */; const env0_6 = importDefault(15) /* metro dependency 15 */; const env0_7 = importDefault(17) /* metro dependency 17 */; const env0_8 = importDefault(18) /* metro dependency 18 */; const userStore = importDefault(1878) /* metro dependency 1878: UserStore */; const env0_10 = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumTypes; const env0_11 = (require(661) /* metro dependency 661: Constants */).EntitlementTypes; const env0_12 = (require(482) /* metro dependency 482: Constants */).SubscriptionTypes; let value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */; value = _fun121510(value); value = new value(); (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/PromotionsManager.tsx'); exports.default = value; } function _isNativeReflectConstruct_121507() { // fn#121507, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:246, offset: 0x02549bdc, size: 98 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_121507_isNativeReflectConstruct = function() { return !!result; })(); } function _fun121510(a0) { // fn#121510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:445, offset: 0x02549c3e, size: 196 bytes, params: 2, frame: 16 const closure = PromotionsManager; env0_8(closure, a0); const binding = env0_5; const env0_0 = env0_3(_fun121515); return binding(closure, [{key: 'onPostConnectionOpen', value: value_121516}, {key: 'onSubscriptionUpdated', value: value_121517}, {key: 'onMobilePurchaseSuccess', value: value_121518}, {key: 'onOfferUpdated', value: value_121519}, {key: 'onVCRedeemed', value: value_121520}]); } function PromotionsManager(a0) { // fn#121511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:457, offset: 0x02549d02, size: 334 bytes, params: 2, frame: 20 var r0; var Reflect; let value = copyRestArgs(0, undefined); let binding = env1_4; binding(this, PromotionsManager); let object = []; arraySpread(object, value, 0, object); value = env1_7(PromotionsManager); binding = env1_6; if (_isNativeReflectConstruct_121507()) { Reflect = global.Reflect; value = Reflect.construct(value, object, env1_7(this).constructor); r0 = value; } else { value = value.apply(this, object); r0 = value; } value = binding(this, r0); object = {}; object.POST_CONNECTION_OPEN = value.onPostConnectionOpen.bind(value); object.EXPERIMENTS_FETCH_SUCCESS = value.onPostConnectionOpen.bind(value); object.BILLING_SUBSCRIPTION_UPDATE_SUCCESS = value.onSubscriptionUpdated.bind(value); object.IAP_PURCHASE_PRODUCT_SUCCESS = value.onMobilePurchaseSuccess.bind(value); object.GPLAY_PURCHASE_VERIFIED = value.onMobilePurchaseSuccess.bind(value); object.BILLING_USER_OFFER_ACKNOWLEDGED_SUCCESS = value.onOfferUpdated.bind(value); object.BILLING_USER_TRIAL_OFFER_ACKNOWLEDGED_SUCCESS = value.onOfferUpdated.bind(value); object.VIRTUAL_CURRENCY_REDEEM_SUCCESS = value.onVCRedeemed.bind(value); value.actions = object; value.maybeFetchBogoPromotion = env1_3(_fun121513); return value; } function* _fun121515() { // fn#121515, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:1445, offset: 0x02549edd, size: 74 bytes, params: 1, frame: 13 if (true) { value = environment.__proto__.__proto__; env2_0(env2_2[12]).maybeFetchActivePromotions(); yield this.maybeFetchBogoPromotion(); } } function value_121517({subscription}) { // fn#121517, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:1636, offset: 0x02549f27, size: 70 bytes, params: 2, frame: 11 const type = subscription.type; const value = environment.__proto__; const PREMIUM = SubscriptionTypes.PREMIUM; if (type === PREMIUM) { (require(7289) /* metro dependency 7289: PromotionsActionCreators */).maybeFetchActivePromotions(false); } } function value_121518() { // fn#121518, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:1762, offset: 0x02549f6d, size: 40 bytes, params: 1, frame: 12 const value = environment.__proto__; (require(7289) /* metro dependency 7289: PromotionsActionCreators */).maybeFetchActivePromotions(false); } function value_121520({entitlements}) { // fn#121520, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:1922, offset: 0x02549f95, size: 74 bytes, params: 2, frame: 11 var environment; var value; if (entitlements.some(function({type}) { return type === EntitlementTypes.FRACTIONAL_REDEMPTION; })) { value = environment.__proto__; value = require(7289) /* metro dependency 7289: PromotionsActionCreators */; value.maybeFetchActivePromotions(false); } } function* _fun121513() { // fn#121513, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:1224, offset: 0x02549e5b, size: 119 bytes, params: 1, frame: 16 if (true) { value = environment.__proto__.__proto__.__proto__; var currentUser = env3_9.getCurrentUser(); var value4 = env3_1(env3_2[10]); var isPremiumExactly = value4.isPremiumExactly; var TIER_2 = env3_10.TIER_2; if (Reflect.apply(isPremiumExactly, value4, [currentUser, TIER_2])) { return undefined; } value = env3_0(env3_2[11]); yield value.maybeFetchActiveBogoPromotion(); } }