Files
2026-07-28 01:06:53 +03:00

195 lines
12 KiB
TypeScript

/* Metro module 7262; source: records/PromotionRecord.tsx; dependencies: [6, 7, 15, 17, 18, 1886, 1880, 7263, 1391, 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 Record from '../lib/Record.tsx'; /* Metro dependency 1886 */
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as PremiumConstantsModule from '../modules/premium/PremiumConstants.tsx'; /* Metro dependency 1880 */
import * as ConstantsModule from '../modules/premium/promotions/constants.tsx'; /* Metro dependency 7263 */
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});
let value = Record;
value = _fun58388(value);
(FileImportTrackerModule).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 PromotionRecord2 = PromotionRecord;
Inherits(PromotionRecord2, a0);
return CreateClass(PromotionRecord2, [{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 = (ConstantsModule).CountryListMode;
const ALLOWLIST = CountryListMode.ALLOWLIST;
if (countryListMode === ALLOWLIST) {
allowedCountries = this.allowedCountries;
return !allowedCountries.includes(a0);
}
const promotionType = this.promotionType;
const PromotionTypes = (ConstantsModule).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 object = {};
object.id = a0.id;
object.trialId = a0.trial_id;
let Date = global.Date;
let date = new Date(a0.start_date);
object.startDate = date;
Date = global.Date;
object.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;
}
object.outboundRedemptionEndDate = r1;
const inbound_header_text = a0.inbound_header_text;
const value4 = '';
let r5 = date != inbound_header_text ? inbound_header_text : value4;
object.inboundHeaderText = r5;
const inbound_body_text = a0.inbound_body_text;
object.inboundBodyText = date != inbound_body_text ? inbound_body_text : value4;
const inbound_help_center_link = a0.inbound_help_center_link;
object.inboundHelpCenterLink = date != inbound_help_center_link ? inbound_help_center_link : value4;
const outbound_title = a0.outbound_title;
object.outboundTitle = date != outbound_title ? outbound_title : value4;
const outbound_redemption_modal_body = a0.outbound_redemption_modal_body;
object.outboundRedemptionModalBody = date != outbound_redemption_modal_body ? outbound_redemption_modal_body : value4;
const outbound_terms_and_conditions = a0.outbound_terms_and_conditions;
object.outboundTermsAndConditions = date != outbound_terms_and_conditions ? outbound_terms_and_conditions : value4;
const outbound_redemption_page_link = a0.outbound_redemption_page_link;
object.outboundRedemptionPageLink = date != outbound_redemption_page_link ? outbound_redemption_page_link : value4;
const outbound_redemption_url_format = a0.outbound_redemption_url_format;
object.outboundRedemptionUrlFormat = date != outbound_redemption_url_format ? outbound_redemption_url_format : value4;
object.flags = a0.flags;
object.inboundRestrictedCountries = a0.inbound_restricted_countries;
object.outboundRestrictedCountries = a0.outbound_restricted_countries;
const allowed_countries = a0.allowed_countries;
object.allowedCountries = date != allowed_countries ? allowed_countries : [];
const country_list_mode = a0.country_list_mode;
object.countryListMode = date != country_list_mode ? country_list_mode : (require(7263) /* metro dependency 7263: constants */).CountryListMode.BLOCKLIST;
object.promotionType = a0.promotion_type;
const partner_id = a0.partner_id;
object.partnerId = date != partner_id ? partner_id : date;
const marketing_components = a0.marketing_components;
object.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;
object.rewardSkuIds = r5;
const promotion_key = a0.promotion_key;
object.promotionKey = date != promotion_key ? promotion_key : value4;
date = Object.create(PromotionRecord.prototype, {constructor: {value: PromotionRecord}});
const promotionRecord = new PromotionRecord(object);
return promotionRecord instanceof Object ? promotionRecord : date;
}
}
}
global.__d(_fun58384, 7262, [6, 7, 15, 17, 18, 1886, 1880, 7263, 1391,
2]) /* metro module 7262, dependencies: [6, 7, 15, 17, 18, 1886, 1880, 7263, 1391, 2] */;