/* Metro module 7262; source: records/PromotionRecord.tsx; dependencies: [6, 7, 15, 17, 18, 1886, 1880, 7263, 1391, 2] */ function _fun58384(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#58384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7440:6, offset: 0x016c62b6, size: 224 bytes, params: 8, frame: 19 const env0_0 = require; 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 */; let value = importDefault(1886) /* metro dependency 1886: Record */; const env0_7 = (require(1880) /* metro dependency 1880: PremiumConstants */).PromotionFlags; value = _fun58388(value); (require(2) /* metro dependency 2 */).fileFinishedImporting('records/PromotionRecord.tsx'); exports.default = value; } function _isNativeReflectConstruct_58385() { // fn#58385, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7440:183, offset: 0x016c6396, 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_58385_isNativeReflectConstruct = function() { return !!result; })(); } function _fun58388(a0) { // fn#58388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7440:382, offset: 0x016c63f4, size: 194 bytes, params: 2, frame: 17 const closure = PromotionRecord; env0_6(closure, a0); return env0_3(closure, [{key: 'isBogo', get: function() { return this.promotionType === require(dependencyMap[7]).PromotionTypes.BOGO; }}, {key: 'isMarketingMoment', get: function() { return this.promotionType === require(dependencyMap[7]).PromotionTypes.MARKETING_MOMENT; }}, {key: 'hasFlag', value: value_58392}, {key: 'isCountryRestricted', value: value_58393}, {key: 'isRedeemableByTrialUsers', value: function() { return this.hasFlag(PromotionFlags.IS_OUTBOUND_REDEEMABLE_BY_TRIAL_USERS); }}], [{key: 'createFromServer', value: value_58395}]); } function PromotionRecord({id, trialId, startDate, endDate, outboundRedemptionEndDate, inboundHeaderText, inboundBodyText, inboundHelpCenterLink, outboundTitle, outboundRedemptionModalBody, outboundTermsAndConditions, outboundRedemptionPageLink, outboundRedemptionUrlFormat, flags, inboundRestrictedCountries, outboundRestrictedCountries, allowedCountries, countryListMode, promotionType, partnerId, marketingComponents, rewardSkuIds, promotionKey}) { // fn#58389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7440:394, offset: 0x016c64b6, size: 459 bytes, params: 2, frame: 21 env1_2(this, PromotionRecord); const value3 = env1_5(PromotionRecord); const value6 = env1_4(this, _isNativeReflectConstruct_58385() ? global.Reflect.construct(value3, [], env1_5(this).constructor) : value3.apply(this, undefined)); value6.id = id; value6.trialId = trialId; value6.startDate = startDate; value6.endDate = endDate; value6.outboundRedemptionEndDate = outboundRedemptionEndDate; value6.inboundHeaderText = inboundHeaderText; value6.inboundBodyText = inboundBodyText; value6.inboundHelpCenterLink = inboundHelpCenterLink; value6.outboundTitle = outboundTitle; value6.outboundRedemptionModalBody = outboundRedemptionModalBody; value6.outboundTermsAndConditions = outboundTermsAndConditions; value6.outboundRedemptionPageLink = outboundRedemptionPageLink; value6.outboundRedemptionUrlFormat = outboundRedemptionUrlFormat; value6.flags = flags ?? 0; value6.inboundRestrictedCountries = inboundRestrictedCountries ?? []; value6.outboundRestrictedCountries = outboundRestrictedCountries ?? []; value6.allowedCountries = allowedCountries ?? []; value6.countryListMode = countryListMode ?? (require(7263) /* metro dependency 7263: constants */).CountryListMode.BLOCKLIST; value6.promotionType = promotionType; value6.partnerId = partnerId; value6.marketingComponents = marketingComponents; value6.rewardSkuIds = rewardSkuIds; value6.promotionKey = promotionKey; return value6; } function value_58392(a0) { // fn#58392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7440:1887, offset: 0x016c66e9, size: 50 bytes, params: 2, frame: 13 let value = environment.__proto__; value = require(1391) /* metro dependency 1391: FlagUtils */; return value.hasFlag(this.flags, a0); } function value_58393(a0) { // fn#58393, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7440:1971, offset: 0x016c671b, size: 258 bytes, params: 2, frame: 16 var allowedCountries; const countryListMode = this.countryListMode; const CountryListMode = (require(7263) /* metro dependency 7263: constants */).CountryListMode; const ALLOWLIST = CountryListMode.ALLOWLIST; if (countryListMode === ALLOWLIST) { allowedCountries = this.allowedCountries; return !allowedCountries.includes(a0); } const promotionType = this.promotionType; const PromotionTypes = (require(7263) /* metro dependency 7263: constants */).PromotionTypes; const THIRD_PARTY_INBOUND = PromotionTypes.THIRD_PARTY_INBOUND; if (THIRD_PARTY_INBOUND === promotionType) { return this.inboundRestrictedCountries.includes(a0); } const THIRD_PARTY_DIRECT_FULFILLMENT = PromotionTypes.THIRD_PARTY_DIRECT_FULFILLMENT; if (THIRD_PARTY_DIRECT_FULFILLMENT === promotionType) { return this.inboundRestrictedCountries.includes(a0); } const THIRD_PARTY_OUTBOUND = PromotionTypes.THIRD_PARTY_OUTBOUND; if (THIRD_PARTY_OUTBOUND === promotionType) { return this.outboundRestrictedCountries.includes(a0); } const THIRD_PARTY_OUTBOUND_RECURRING = PromotionTypes.THIRD_PARTY_OUTBOUND_RECURRING; if (THIRD_PARTY_OUTBOUND_RECURRING === promotionType) { return this.outboundRestrictedCountries.includes(a0); } return false; } function value_58395(a0) { // fn#58395, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7440:2593, offset: 0x016c683a, size: 687 bytes, params: 2, frame: 18 var r1; const object2 = {}; object2.id = a0.id; object2.trialId = a0.trial_id; let Date = global.Date; let date = new Date(a0.start_date); object2.startDate = date; Date = global.Date; object2.endDate = new Date(a0.end_date); const outbound_redemption_end_date = a0.outbound_redemption_end_date; date = null; if (date != outbound_redemption_end_date) { date = new global.Date(a0.outbound_redemption_end_date); } else { r1 = date; } object2.outboundRedemptionEndDate = r1; const inbound_header_text = a0.inbound_header_text; const value4 = ''; let r5 = date != inbound_header_text ? inbound_header_text : value4; object2.inboundHeaderText = r5; const inbound_body_text = a0.inbound_body_text; object2.inboundBodyText = date != inbound_body_text ? inbound_body_text : value4; const inbound_help_center_link = a0.inbound_help_center_link; object2.inboundHelpCenterLink = date != inbound_help_center_link ? inbound_help_center_link : value4; const outbound_title = a0.outbound_title; object2.outboundTitle = date != outbound_title ? outbound_title : value4; const outbound_redemption_modal_body = a0.outbound_redemption_modal_body; object2.outboundRedemptionModalBody = date != outbound_redemption_modal_body ? outbound_redemption_modal_body : value4; const outbound_terms_and_conditions = a0.outbound_terms_and_conditions; object2.outboundTermsAndConditions = date != outbound_terms_and_conditions ? outbound_terms_and_conditions : value4; const outbound_redemption_page_link = a0.outbound_redemption_page_link; object2.outboundRedemptionPageLink = date != outbound_redemption_page_link ? outbound_redemption_page_link : value4; const outbound_redemption_url_format = a0.outbound_redemption_url_format; object2.outboundRedemptionUrlFormat = date != outbound_redemption_url_format ? outbound_redemption_url_format : value4; object2.flags = a0.flags; object2.inboundRestrictedCountries = a0.inbound_restricted_countries; object2.outboundRestrictedCountries = a0.outbound_restricted_countries; const allowed_countries = a0.allowed_countries; object2.allowedCountries = date != allowed_countries ? allowed_countries : []; const country_list_mode = a0.country_list_mode; object2.countryListMode = date != country_list_mode ? country_list_mode : (require(7263) /* metro dependency 7263: constants */).CountryListMode.BLOCKLIST; object2.promotionType = a0.promotion_type; const partner_id = a0.partner_id; object2.partnerId = date != partner_id ? partner_id : date; const marketing_components = a0.marketing_components; object2.marketingComponents = date != marketing_components ? marketing_components : []; const metadata = a0.metadata; const value6 = undefined; const reward_sku_ids = date == metadata || date == metadata.premium_promotion ? value6 : metadata.premium_promotion.reward_sku_ids; r5 = date != reward_sku_ids ? reward_sku_ids : date == a0.metadata || date == a0.metadata.gift_promotion ? value6 : a0.metadata.gift_promotion.reward_sku_ids; r5 = date == r5 ? [] : r5; object2.rewardSkuIds = r5; const promotion_key = a0.promotion_key; object2.promotionKey = date != promotion_key ? promotion_key : value4; date = Object.create(PromotionRecord.prototype, {constructor: {value: PromotionRecord}}); const promotionRecord = new PromotionRecord(object2); return promotionRecord instanceof Object ? promotionRecord : date; }