247 lines
10 KiB
TypeScript
247 lines
10 KiB
TypeScript
/* Metro module 3803; source: records/SubscriptionPlanRecord.tsx; dependencies: [6, 7, 15, 17, 18, 1886, 1880, 2] */
|
|
function _fun29196(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#29196, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3930:6, offset: 0x00fbcd98, size: 262 bytes, params: 8, frame: 20
|
|
const closure = function(a0, a1) {
|
|
return {amount: a0.amount, currency: a0.currency, tax: 0, taxInclusive: a1};
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_0 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_1 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_2 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_3 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_4 = importDefault(18) /* metro dependency 18 */;
|
|
let value = importDefault(1886) /* metro dependency 1886: Record */;
|
|
const premiumConstantsModule = require(1880) /* metro dependency 1880: PremiumConstants */;
|
|
const env0_5 = premiumConstantsModule.PremiumSubscriptionSKUs;
|
|
const env0_6 = premiumConstantsModule.PremiumTypes;
|
|
const env0_7 = premiumConstantsModule.SubscriptionPlans;
|
|
value = _fun29201(value);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('records/SubscriptionPlanRecord.tsx');
|
|
exports.default = value;
|
|
exports.getPriceFromServer = closure;
|
|
exports.isNoneSubscription = function(a0) {
|
|
var NONE_MONTH = SubscriptionPlans.NONE_MONTH;
|
|
return [NONE_MONTH, SubscriptionPlans.NONE_3_MONTH, SubscriptionPlans.NONE_6_MONTH,
|
|
SubscriptionPlans.NONE_YEAR].includes(a0);
|
|
};
|
|
}
|
|
|
|
function _isNativeReflectConstruct_29197() { // fn#29197, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3930:235, offset: 0x00fbce9e, 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_29197_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun29201(a0) { // fn#29201, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3930:532, offset: 0x00fbcf28, size: 121 bytes, params: 2, frame: 17
|
|
const closure = SubscriptionPlanRecord;
|
|
env0_4(closure, a0);
|
|
return env0_1(closure, [{key: 'premiumSubscriptionType', get: function() {
|
|
var skuId = this.skuId;
|
|
if (PremiumSubscriptionSKUs.LEGACY === skuId) {
|
|
return PremiumTypes.TIER_2;
|
|
}
|
|
if (PremiumSubscriptionSKUs.TIER_2 === skuId) {
|
|
return PremiumTypes.TIER_2;
|
|
}
|
|
if (PremiumSubscriptionSKUs.TIER_1 === skuId) {
|
|
return PremiumTypes.TIER_1;
|
|
}
|
|
if (PremiumSubscriptionSKUs.TIER_0 === skuId) {
|
|
return PremiumTypes.TIER_0;
|
|
}
|
|
return null;
|
|
}}, {key: 'toServerData', value: value_29204}], [{key: 'createFromServer', value: value_29206}]);
|
|
}
|
|
|
|
function SubscriptionPlanRecord({id, name, interval, intervalCount, taxInclusive, skuId, currency, price, prices}) { // fn#29202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3930:544, offset: 0x00fbcfa1, size: 216 bytes, params: 2, frame: 20
|
|
let value = environment.__proto__;
|
|
env1_0(this, SubscriptionPlanRecord);
|
|
const value3 = env1_3(SubscriptionPlanRecord);
|
|
value = env1_2(this, _isNativeReflectConstruct_29197() ? global.Reflect.construct(value3, [],
|
|
env1_3(this).constructor) : value3.apply(this, undefined));
|
|
value.id = id;
|
|
value.name = name;
|
|
value.interval = interval;
|
|
value.intervalCount = intervalCount;
|
|
value.taxInclusive = taxInclusive;
|
|
value.skuId = skuId;
|
|
value.currency = currency;
|
|
value.price = price;
|
|
value.prices = prices;
|
|
return value;
|
|
}
|
|
|
|
function value_29204() { // fn#29204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3930:1247, offset: 0x00fbd0e4, size: 157 bytes, params: 1, frame: 14
|
|
const Object = global.Object;
|
|
Object.keys(this.prices).forEach(_fun29205);
|
|
return {id: this.id, name: this.name, sku_id: this.skuId, interval: this.interval,
|
|
interval_count: this.intervalCount, tax_inclusive: this.taxInclusive, currency: this.currency,
|
|
price: this.price, prices: {}, price_tier: this.price};
|
|
}
|
|
|
|
function value_29206(a0) { // fn#29206, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3930:1715, offset: 0x00fbd1d7, size: 188 bytes, params: 2, frame: 15
|
|
var r1;
|
|
var Object;
|
|
var value;
|
|
const env0_0 = a0;
|
|
let object2 = {};
|
|
if (a0.prices == null) {
|
|
r1 = object2;
|
|
} else {
|
|
Object = global.Object;
|
|
value = Object.keys(a0.prices);
|
|
value = value.reduce(_fun29207, {});
|
|
r1 = value;
|
|
}
|
|
object2 = {};
|
|
object2.id = a0.id;
|
|
object2.name = a0.name;
|
|
object2.interval = a0.interval;
|
|
object2.intervalCount = a0.interval_count;
|
|
object2.taxInclusive = a0.tax_inclusive;
|
|
object2.skuId = a0.sku_id;
|
|
object2.currency = a0.currency;
|
|
object2.price = a0.price;
|
|
object2.prices = r1;
|
|
value = Object.create(SubscriptionPlanRecord.prototype, {constructor: {value: SubscriptionPlanRecord}});
|
|
const subscriptionPlanRecord = new SubscriptionPlanRecord(object2);
|
|
return subscriptionPlanRecord instanceof Object ? subscriptionPlanRecord : value;
|
|
}
|
|
|
|
function _fun29205(a0) { // fn#29205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3930:1308, offset: 0x00fbd181, size: 86 bytes, params: 2, frame: 6
|
|
const property = env0_0.prices[a0];
|
|
env0_1[a0] = {country_prices: {country_code: property.countryPrices.countryCode,
|
|
prices: property.countryPrices.prices}, payment_source_prices: property.paymentSourcePrices};
|
|
}
|
|
|
|
function _fun29207(a0, a1) { // fn#29207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3930:1792, offset: 0x00fbd293, size: 159 bytes, params: 3, frame: 18
|
|
let prices = env0_0.prices;
|
|
if (prices != null) {
|
|
prices = env0_0.prices;
|
|
var property = prices[a1];
|
|
var object3 = {};
|
|
var object4 = {};
|
|
var country_prices = property.country_prices;
|
|
object4.countryCode = country_prices.country_code;
|
|
country_prices = property.country_prices;
|
|
prices = country_prices.prices;
|
|
object4.prices = prices.map(_fun29208);
|
|
object3.countryPrices = object4;
|
|
var Object = global.Object;
|
|
object3.paymentSourcePrices = Object.entries(property.payment_source_prices).reduce(function(a0, a1) {
|
|
var r1;
|
|
var r3;
|
|
var r4;
|
|
var item3;
|
|
var value3;
|
|
var iterator = a1[Symbol.iterator]();
|
|
var iterator2 = iterator.next;
|
|
var item2 = Reflect.apply(iterator2, iterator, []);
|
|
var item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
var value = undefined;
|
|
var value2 = item2 === value;
|
|
var r2 = value2 ? value : item;
|
|
if (value2) {
|
|
r1 = item2;
|
|
r3 = value2;
|
|
r4 = value;
|
|
} else {
|
|
item3 = Reflect.apply(iterator2, item2, []);
|
|
item = item3.value;
|
|
item3 = item3.done ? undefined : item2;
|
|
value3 = item3 === value;
|
|
if (value3) {
|
|
r1 = item3;
|
|
r3 = value3;
|
|
r4 = value;
|
|
} else {
|
|
r1 = item3;
|
|
r3 = value3;
|
|
r4 = item;
|
|
}
|
|
}
|
|
if (!r3) {
|
|
r1.return();
|
|
}
|
|
a0[r2] = r4.map(_fun29210);
|
|
return a0;
|
|
}, {});
|
|
a0[a1] = object3;
|
|
}
|
|
return a0;
|
|
}
|
|
|
|
function _fun29208(a0) { // fn#29208, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3930:1951, offset: 0x00fbd332, size: 33 bytes, params: 2, frame: 13
|
|
return getPriceFromServer(a0, env1_0.tax_inclusive);
|
|
}
|
|
|
|
function _fun29209(a0, a1) { // fn#29209, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3930:2063, offset: 0x00fbd353, size: 89 bytes, params: 3, frame: 16
|
|
var r1;
|
|
var r3;
|
|
var r4;
|
|
var item3;
|
|
var value3;
|
|
const iterator = a1[Symbol.iterator]();
|
|
const iterator2 = iterator.next;
|
|
let item2 = Reflect.apply(iterator2, iterator, []);
|
|
let item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
const value = undefined;
|
|
const value2 = item2 === value;
|
|
const r2 = value2 ? value : item;
|
|
if (value2) {
|
|
r1 = item2;
|
|
r3 = value2;
|
|
r4 = value;
|
|
} else {
|
|
item3 = Reflect.apply(iterator2, item2, []);
|
|
item = item3.value;
|
|
item3 = item3.done ? undefined : item2;
|
|
value3 = item3 === value;
|
|
if (value3) {
|
|
r1 = item3;
|
|
r3 = value3;
|
|
r4 = value;
|
|
} else {
|
|
r1 = item3;
|
|
r3 = value3;
|
|
r4 = item;
|
|
}
|
|
}
|
|
if (!r3) {
|
|
r1.return();
|
|
}
|
|
a0[r2] = r4.map(_fun29210);
|
|
return a0;
|
|
}
|
|
|
|
function _fun29210(a0) { // fn#29210, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3930:2087, offset: 0x00fbd3ac, size: 33 bytes, params: 2, frame: 13
|
|
return getPriceFromServer(a0, env2_0.tax_inclusive);
|
|
}
|
|
|