Files
discord-decomp/sources/modules/premium/native/handlePremiumPurchase.android.tsx
2026-07-28 01:06:53 +03:00

1294 lines
58 KiB
TypeScript

/* Metro module 7254; source: modules/premium/native/handlePremiumPurchase.android.tsx; dependencies: [5, 31, 7255, 1226, 3808, 5140, 661, 482, 507, 7256, 1244, 4131, 3824, 4647, 5143, 566, 7062, 7257, 7260, 7294, 7295, 7297, 7298, 683, 3817, 2] */
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
import AuthenticationStore from '../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
import SubscriptionStore from '../../../stores/billing/SubscriptionStore.tsx'; /* Metro dependency 3808 */
import IAPStoreAndroid from '../../../stores/native/IAPStore.android.tsx'; /* Metro dependency 5140 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as ConstantsModule from '../../../external/discord_common/js/shared/Constants.tsx'; /* Metro dependency 482 */
import * as ConstantsModule2 from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as GPlayAnalyticsStoreModule from '../../gplay/native/GPlayAnalyticsStore.tsx'; /* Metro dependency 7255 */
function _fun58278(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#58278, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7432:6, offset: 0x016c38bd, size: 277 bytes, params: 8, frame: 19
const env0_0 = require;
const validatePurchase = function() {
return _validatePurchase.apply(this, arguments);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const constantsModule = ConstantsModule2;
const env0_9 = constantsModule.AnalyticEvents;
const env0_10 = constantsModule.Endpoints;
(FileImportTrackerModule).fileFinishedImporting('modules/premium/native/handlePremiumPurchase.android.tsx');
exports.useHandlePremiumPurchase = useHandlePremiumPurchase;
function _validatePurchase() { // fn#58280, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7432:320, offset: 0x016c39d2, size: 48 bytes, params: 1, frame: 14
return Module00005(_fun58282).apply(this, arguments);
function* _fun58282(a0, a1, a2, a3, a4) { // fn#58282, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7432:377, offset: 0x016c3a0b, size: 209 bytes, params: 6, frame: 19
var id;
var binding;
var binding2;
var property;
var value4;
var HTTP;
var post;
var object;
var GOOGLE_PLAY_VALIDATE_PURCHASE;
var object2;
var value5;
var value6;
var value7;
var value8;
var error;
var prototype;
var value9;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
try {
binding = env2_0;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
binding2 = env2_2;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
property = binding2[8];
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
const value3 = undefined;
try {
value4 = binding(property);
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
HTTP = value4.HTTP;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
post = HTTP.post;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object = {};
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
binding = env2_10;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
GOOGLE_PLAY_VALIDATE_PURCHASE = binding.GOOGLE_PLAY_VALIDATE_PURCHASE;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object.url = GOOGLE_PLAY_VALIDATE_PURCHASE;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object2 = {};
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object2.product_id = a0;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object2.offer_id = a2;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
value5 = a1 == null;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
if (value5) {
try {
object2.subscription_id = value3;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object2.currency = a3;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object2.is_gift = a4;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object.body = object2;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object.rejectWithError = false;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
value6 = Reflect.apply(post, HTTP, [object]);
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
yield value6;
try {
value7 = undefined;
value8 = false;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
} else {
try {
id = a1.id;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object2.subscription_id = id;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object2.currency = a3;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object2.is_gift = a4;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object.body = object2;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object.rejectWithError = false;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
value6 = Reflect.apply(post, HTTP, [object]);
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
yield value6;
try {
value7 = undefined;
value8 = false;
} catch (error) {
binding = env2_1;
value = binding(env2_2[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
}
return value8 ? value7 : value3;
}
}
function useHandlePremiumPurchase() { // fn#58283, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7432:749, offset: 0x016c3adc, size: 268 bytes, params: 1, frame: 21
const value2 = undefined;
const premiumTypeSubscription = (require(566) /* metro dependency 566: flux */).useStateFromStores([SubscriptionStore],
function() {
return SubscriptionStore.getPremiumTypeSubscription();
});
return ReactModule.useCallback(_fun58285(), [premiumTypeSubscription != null,
premiumTypeSubscription == null ? value2 : premiumTypeSubscription.paymentGatewayPlanId,
premiumTypeSubscription == null ? value2 : premiumTypeSubscription.paymentGatewaySubscriptionId,
premiumTypeSubscription == null ? value2 : premiumTypeSubscription.id,
(require(7062) /* metro dependency 7062: usePremiumTrialOfferNative */).usePremiumTrialOffer(),
(require(7257) /* metro dependency 7257: usePremiumDiscountOfferNative */).usePremiumDiscountOffer(),
premiumTypeSubscription,
(require(7260) /* metro dependency 7260: PremiumBogoPromotionUtilsCommon */).useIsEligibleForBogoPromotion(false)]);
function _fun58285() { // fn#58285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7432:1118, offset: 0x016c3bfb, size: 32 bytes, params: 1, frame: 12
const env0_0 = env1_3(_fun58287);
return _fun58288;
async function _fun58287({productId, skuId, analyticsLoadId, analyticsLocation, analyticsLocations, isGift, isOneTimePurchase, allowPlanChange, applicationId, giftInfoOptions, onPurchaseComplete, onPurchaseError}) { // fn#58287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7432:1138, offset: 0x016c3c2d, size: 1709 bytes, params: 2, frame: 44
var r34;
var price;
var r26;
var offerIds;
var BOGO_OFFER_ID;
var r27;
var r25;
var r9;
var r21;
var r8;
var r4;
var r6;
var r10;
var value3;
var value4;
var value5;
var currencyCode;
var toLowerCase;
var value14;
var ProductIds;
var PREMIUM_TIER_2_MONTHLY;
var DiscountIdToProductOfferId;
var discountId;
var property;
var TrialIdToProductOfferId;
var trial_id;
var value17;
var authenticationStoreBinding;
var value18;
var subscriptionStoreBinding;
var value19;
var setGPlayAnalyticsBinding;
var value20;
var binding2;
var value21;
var updatePendingDowngrade;
var value22;
var value23;
var value24;
var binding3;
var value25;
var subscribe;
var value26;
var value27;
var value28;
var value29;
var binding4;
var value30;
var giftInfoOptionsCache;
var value31;
var binding5;
var value32;
var value33;
var binding6;
var value34;
var binding7;
var value35;
var value36;
var value37;
var value38;
var value39;
var value40;
var value41;
var binding8;
var value42;
var purchase;
var value43;
var value44;
var value45;
var value46;
var error;
var value47;
var track;
var PAYMENT_FLOW_FAILED;
var message;
var binding9;
var value48;
var captureBillingException;
var intl;
var string;
var t;
var LFFx5G;
var value49;
var BillingError;
var prototype;
var value50;
var billingError;
var value51;
var code;
var ErrorCodes;
var UNKNOWN;
var value52;
var value53;
var value54;
var binding10;
var value55;
var show;
var binding11;
if (false) {
return undefined;
}
value = undefined;
reducibleJoin3: while (true) {
if (isGift !== value) {
break reducibleJoin3;
}
value3 = false;
isGift = value3;
break reducibleJoin3;
}
reducibleJoin5: while (true) {
if (isOneTimePurchase !== value) {
break reducibleJoin5;
}
value4 = false;
isOneTimePurchase = value4;
break reducibleJoin5;
}
reducibleJoin7: while (true) {
if (allowPlanChange !== value) {
break reducibleJoin7;
}
value5 = true;
allowPlanChange = value5;
break reducibleJoin7;
}
await value;
if (false) {
return undefined;
}
let binding = env3_6;
const id = binding.getId();
const product = env3_8.getProduct(productId);
const basePurchaseFlowAnalyticsFields = env3_0(env3_2[19]).getBasePurchaseFlowAnalyticsFields({isGift: isGift,
analyticsLoadId: analyticsLoadId, analyticsLocation: analyticsLocation, analyticsLocations: analyticsLocations});
binding = env3_5;
object = {};
copyDataProperties(object, basePurchaseFlowAnalyticsFields, r34);
object['subscription_plan_gateway_plan_id'] = productId;
object['sku_id'] = skuId;
reducibleJoin11: while (true) {
if (product == null) {
price = value;
break reducibleJoin11;
}
price = product.price;
break reducibleJoin11;
}
object['price'] = price;
reducibleJoin13: while (true) {
if (product == null) {
price = value;
break reducibleJoin13;
}
price = product.price;
break reducibleJoin13;
}
object['regular_price'] = price;
reducibleJoin15: while (true) {
if (product == null) {
r26 = value;
break reducibleJoin15;
}
currencyCode = product.currencyCode;
toLowerCase = currencyCode.toLowerCase;
value14 = Reflect.apply(toLowerCase, currencyCode, []);
r26 = value14;
break reducibleJoin15;
}
object['currency'] = r26;
object['application_id'] = applicationId;
binding(productId, object);
binding = env2_3;
reducibleJoin17: while (true) {
if (product == null) {
offerIds = value;
break reducibleJoin17;
}
offerIds = product.offerIds;
break reducibleJoin17;
}
reducibleJoin30: while (true) {
reducibleJoin23: while (true) {
if (offerIds == null) {
if (binding) {
binding = env3_0;
ProductIds = binding(env3_2[14]).ProductIds;
PREMIUM_TIER_2_MONTHLY = ProductIds.PREMIUM_TIER_2_MONTHLY;
if (productId !== PREMIUM_TIER_2_MONTHLY) {
BOGO_OFFER_ID = null;
break reducibleJoin23;
}
binding = env3_0;
BOGO_OFFER_ID = binding(env3_2[14]).BOGO_OFFER_ID;
break reducibleJoin23;
}
BOGO_OFFER_ID = null;
break reducibleJoin23;
}
if (importDefault != null) {
binding = env3_0;
TrialIdToProductOfferId = binding(env3_2[14]).TrialIdToProductOfferId;
trial_id = importDefault.trial_id;
property = TrialIdToProductOfferId[trial_id];
reducibleJoin29: while (true) {
if (property == null) {
r26 = value;
break reducibleJoin29;
}
property = property[productId];
r26 = property;
break reducibleJoin29;
}
r25 = r26;
break reducibleJoin30;
}
if (dependencyMap != null) {
binding = env3_0;
DiscountIdToProductOfferId = binding(env3_2[14]).DiscountIdToProductOfferId;
discountId = dependencyMap.discountId;
property = DiscountIdToProductOfferId[discountId];
reducibleJoin26: while (true) {
if (property == null) {
r27 = value;
break reducibleJoin26;
}
property = property[productId];
r27 = property;
break reducibleJoin26;
}
r25 = r27;
break reducibleJoin30;
}
if (binding) {
binding = env3_0;
ProductIds = binding(env3_2[14]).ProductIds;
PREMIUM_TIER_2_MONTHLY = ProductIds.PREMIUM_TIER_2_MONTHLY;
if (productId !== PREMIUM_TIER_2_MONTHLY) {
BOGO_OFFER_ID = null;
break reducibleJoin23;
}
binding = env3_0;
BOGO_OFFER_ID = binding(env3_2[14]).BOGO_OFFER_ID;
break reducibleJoin23;
}
BOGO_OFFER_ID = null;
break reducibleJoin23;
}
r25 = BOGO_OFFER_ID;
break reducibleJoin30;
}
const value16 = env3_0(env3_2[20]);
const trackPaymentFlowStartedAnalyticsAndCTP = value16.trackPaymentFlowStartedAnalyticsAndCTP;
object = {};
copyDataProperties(object, basePurchaseFlowAnalyticsFields, r34);
object['subscription_plan_gateway_plan_id'] = productId;
object['sku_id'] = skuId;
let GOOGLE = env3_11.GOOGLE;
object['payment_gateway'] = GOOGLE;
object['application_id'] = applicationId;
Reflect.apply(trackPaymentFlowStartedAnalyticsAndCTP, value16, [object]);
reducibleJoin82: while (true) {
reduciblePort165: while (true) {
exceptionLanding154: while (true) {
if (isGift) {
break reducibleJoin82;
}
if (isOneTimePurchase) {
break reducibleJoin82;
}
try {
binding = env2_4;
} catch (error) {
break exceptionLanding154;
}
reducibleJoin36: while (true) {
if (binding) {
value17 = !allowPlanChange;
r9 = value17;
break reducibleJoin36;
}
r9 = binding;
break reducibleJoin36;
}
reducibleJoin149: while (true) {
if (r9) {
break reducibleJoin149;
}
try {
authenticationStoreBinding = AuthenticationStore;
} catch (error) {
break exceptionLanding154;
}
try {
value18 = authenticationStoreBinding != null;
} catch (error) {
break exceptionLanding154;
}
reducibleJoin42: while (true) {
if (value18) {
try {
subscriptionStoreBinding = SubscriptionStore;
} catch (error) {
break exceptionLanding154;
}
try {
value19 = subscriptionStoreBinding != null;
} catch (error) {
break exceptionLanding154;
}
r21 = value19;
break reducibleJoin42;
}
r21 = value18;
break reducibleJoin42;
}
reducibleJoin45: while (true) {
if (r21) {
try {
setGPlayAnalyticsBinding = setGPlayAnalytics;
} catch (error) {
break exceptionLanding154;
}
try {
value20 = setGPlayAnalyticsBinding != null;
} catch (error) {
break exceptionLanding154;
}
r9 = value20;
break reducibleJoin45;
}
r9 = r21;
break reducibleJoin45;
}
reducibleJoin58: while (true) {
if (r9) {
try {
binding = env3_0;
} catch (error) {
break exceptionLanding154;
}
try {
binding2 = env3_2;
} catch (error) {
break exceptionLanding154;
}
try {
property = binding2[22];
} catch (error) {
break exceptionLanding154;
}
try {
value21 = binding(property);
} catch (error) {
break exceptionLanding154;
}
try {
updatePendingDowngrade = value21.updatePendingDowngrade;
} catch (error) {
break exceptionLanding154;
}
try {
authenticationStoreBinding = AuthenticationStore;
} catch (error) {
break exceptionLanding154;
}
try {
subscriptionStoreBinding = SubscriptionStore;
} catch (error) {
break exceptionLanding154;
}
try {
setGPlayAnalyticsBinding = setGPlayAnalytics;
} catch (error) {
r34 = subscriptionStoreBinding;
break exceptionLanding154;
}
try {
Reflect.apply(updatePendingDowngrade, value21, [productId, authenticationStoreBinding,
subscriptionStoreBinding,
setGPlayAnalyticsBinding]);
} catch (error) {
r34 = subscriptionStoreBinding;
break exceptionLanding154;
}
r34 = subscriptionStoreBinding;
break reducibleJoin58;
}
break reducibleJoin58;
}
try {
binding = env3_12;
} catch (error) {
break exceptionLanding154;
}
try {
} catch (error) {
break exceptionLanding154;
}
try {
value22 = binding(productId, require, r25);
} catch (error) {
break exceptionLanding154;
}
await value22;
try {
value23 = undefined;
value24 = false;
} catch (error) {
break exceptionLanding154;
}
if (value24) {
return value23;
}
try {
binding = env3_0;
} catch (error) {
break exceptionLanding154;
}
try {
binding3 = env3_2;
} catch (error) {
break exceptionLanding154;
}
try {
property = binding3[22];
} catch (error) {
break exceptionLanding154;
}
try {
value25 = binding(property);
} catch (error) {
break exceptionLanding154;
}
try {
subscribe = value25.subscribe;
} catch (error) {
break exceptionLanding154;
}
try {
authenticationStoreBinding = AuthenticationStore;
} catch (error) {
break exceptionLanding154;
}
try {
subscriptionStoreBinding = SubscriptionStore;
} catch (error) {
r34 = authenticationStoreBinding;
break exceptionLanding154;
}
try {
value26 = Reflect.apply(subscribe, value25, [productId, id, authenticationStoreBinding,
subscriptionStoreBinding,
r25]);
} catch (error) {
r34 = authenticationStoreBinding;
break exceptionLanding154;
}
await value26;
try {
value27 = undefined;
value28 = false;
} catch (error) {
r34 = authenticationStoreBinding;
break exceptionLanding154;
}
if (value28) {
return value27;
}
r34 = authenticationStoreBinding;
break reducibleJoin149;
}
try {
value46 = onPurchaseComplete == null;
} catch (error) {
break exceptionLanding154;
}
if (value46) {
break reduciblePort165;
}
try {
onPurchaseComplete();
} catch (error) {
break exceptionLanding154;
}
break reduciblePort165;
}
binding = env3_1;
value47 = binding(env3_2[23]);
track = value47.track;
PAYMENT_FLOW_FAILED = env3_9.PAYMENT_FLOW_FAILED;
object = {};
copyDataProperties(object, basePurchaseFlowAnalyticsFields, r34);
object['subscription_plan_gateway_plan_id'] = productId;
object['sku_id'] = skuId;
GOOGLE = env3_11.GOOGLE;
object['payment_gateway'] = GOOGLE;
object['application_id'] = applicationId;
message = error.message;
object['error_message'] = message;
Reflect.apply(track, value47, [PAYMENT_FLOW_FAILED, object]);
reducibleJoin156: while (true) {
if (onPurchaseError == null) {
break reducibleJoin156;
}
onPurchaseError();
break reducibleJoin156;
}
binding = env3_0;
binding9 = env3_2;
value48 = binding(binding9[24]);
captureBillingException = value48.captureBillingException;
Reflect.apply(captureBillingException, value48, [error]);
intl = binding(binding9[10]).intl;
string = intl.string;
t = binding(binding9[10]).t;
LFFx5G = t.LFFx5G;
value49 = Reflect.apply(string, intl, [LFFx5G]);
BillingError = binding(binding9[11]).BillingError;
reducibleJoin158: while (true) {
if (error instanceof BillingError) {
r4 = error;
break reducibleJoin158;
}
binding = env3_0;
BillingError = binding(env3_2[11]).BillingError;
prototype = BillingError.prototype;
value50 = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value51 = billingError instanceof Object ? billingError : value50;
r4 = value51;
break reducibleJoin158;
}
code = r4.code;
binding = env3_0;
ErrorCodes = binding(env3_2[12]).ErrorCodes;
UNKNOWN = ErrorCodes.UNKNOWN;
value52 = code !== UNKNOWN;
reducibleJoin160: while (true) {
if (value52) {
code = r4.code;
value53 = code !== -1;
r6 = value53;
break reducibleJoin160;
}
r6 = value52;
break reducibleJoin160;
}
reducibleJoin162: while (true) {
if (r6) {
message = r4.message;
value54 = message != null;
r6 = value54;
break reducibleJoin162;
}
break reducibleJoin162;
}
reducibleJoin164: while (true) {
if (r6) {
message = r4.message;
r10 = message;
break reducibleJoin164;
}
r10 = value49;
break reducibleJoin164;
}
binding = env3_1;
binding10 = env3_2;
value55 = binding(binding10[13]);
show = value55.show;
binding11 = env3_0;
intl = binding11(binding10[10]).intl;
string = intl.string;
t = binding11(binding10[10]).t;
Reflect.apply(show, value55, [{title: Reflect.apply(string, intl, [t['U+H+kd']]), body: r10,
isDismissable: true}]);
reducibleJoin165: while (true) {
if (error instanceof binding(binding9[9])) {
throw error;
}
break reducibleJoin165;
}
break reduciblePort165;
}
return value;
}
reducibleJoin85: while (true) {
if (isGift) {
try {
value29 = giftInfoOptions != null;
} catch (error) {
break exceptionLanding154;
}
r9 = value29;
break reducibleJoin85;
}
r9 = isGift;
break reducibleJoin85;
}
reducibleJoin120: while (true) {
if (r9) {
try {
binding = env3_1;
} catch (error) {
break exceptionLanding154;
}
try {
binding4 = env3_2;
} catch (error) {
break exceptionLanding154;
}
try {
property = binding4[21];
} catch (error) {
break exceptionLanding154;
}
try {
value30 = binding(property);
} catch (error) {
break exceptionLanding154;
}
try {
giftInfoOptionsCache = value30.giftInfoOptionsCache;
} catch (error) {
break exceptionLanding154;
}
try {
value31 = giftInfoOptionsCache != null;
} catch (error) {
break exceptionLanding154;
}
reducibleJoin102: while (true) {
if (value31) {
try {
binding = env3_1;
} catch (error) {
break exceptionLanding154;
}
try {
binding5 = env3_2;
} catch (error) {
break exceptionLanding154;
}
try {
property = binding5[21];
} catch (error) {
break exceptionLanding154;
}
try {
value32 = binding(property);
} catch (error) {
break exceptionLanding154;
}
try {
giftInfoOptionsCache = value32.giftInfoOptionsCache;
} catch (error) {
break exceptionLanding154;
}
try {
property = giftInfoOptionsCache[productId];
} catch (error) {
break exceptionLanding154;
}
try {
value33 = property != null;
} catch (error) {
break exceptionLanding154;
}
r9 = value33;
break reducibleJoin102;
}
r9 = value31;
break reducibleJoin102;
}
reducibleJoin110: while (true) {
if (r9) {
try {
binding = env3_1;
} catch (error) {
break exceptionLanding154;
}
try {
binding6 = env3_2;
} catch (error) {
break exceptionLanding154;
}
try {
property = binding6[21];
} catch (error) {
break exceptionLanding154;
}
try {
value34 = binding(property);
} catch (error) {
break exceptionLanding154;
}
try {
giftInfoOptionsCache = value34.giftInfoOptionsCache;
} catch (error) {
break exceptionLanding154;
}
try {
delete giftInfoOptionsCache[productId];
} catch (error) {
break exceptionLanding154;
}
break reducibleJoin110;
}
break reducibleJoin110;
}
try {
binding = env3_1;
} catch (error) {
break exceptionLanding154;
}
try {
binding7 = env3_2;
} catch (error) {
break exceptionLanding154;
}
try {
property = binding7[21];
} catch (error) {
break exceptionLanding154;
}
try {
value35 = binding(property);
} catch (error) {
break exceptionLanding154;
}
try {
giftInfoOptionsCache = value35.giftInfoOptionsCache;
} catch (error) {
break exceptionLanding154;
}
try {
object = {};
} catch (error) {
break exceptionLanding154;
}
try {
copyDataProperties(object, giftInfoOptions, r34);
} catch (error) {
break exceptionLanding154;
}
try {
giftInfoOptionsCache[productId] = object;
} catch (error) {
break exceptionLanding154;
}
break reducibleJoin120;
}
break reducibleJoin120;
}
try {
binding = env3_12;
} catch (error) {
break exceptionLanding154;
}
try {
} catch (error) {
break exceptionLanding154;
}
try {
value36 = product == null;
} catch (error) {
break exceptionLanding154;
}
reducibleJoin133: while (true) {
if (value36) {
r8 = value;
break reducibleJoin133;
}
try {
currencyCode = product.currencyCode;
} catch (error) {
break exceptionLanding154;
}
try {
value37 = currencyCode == null;
} catch (error) {
break exceptionLanding154;
}
if (value37) {
r8 = value;
break reducibleJoin133;
}
try {
toLowerCase = currencyCode.toLowerCase;
} catch (error) {
break exceptionLanding154;
}
try {
value38 = Reflect.apply(toLowerCase, currencyCode, []);
} catch (error) {
break exceptionLanding154;
}
r8 = value38;
break reducibleJoin133;
}
try {
value39 = binding(productId, require, null, r8, isGift);
} catch (error) {
r34 = null;
break exceptionLanding154;
}
await value39;
try {
value40 = undefined;
value41 = false;
} catch (error) {
r34 = null;
break exceptionLanding154;
}
if (value41) {
return value40;
}
try {
binding = env3_0;
} catch (error) {
r34 = null;
break exceptionLanding154;
}
try {
binding8 = env3_2;
} catch (error) {
r34 = null;
break exceptionLanding154;
}
try {
property = binding8[22];
} catch (error) {
r34 = null;
break exceptionLanding154;
}
try {
value42 = binding(property);
} catch (error) {
r34 = null;
break exceptionLanding154;
}
try {
purchase = value42.purchase;
} catch (error) {
r34 = null;
break exceptionLanding154;
}
try {
value43 = Reflect.apply(purchase, value42, [productId, id]);
} catch (error) {
r34 = null;
break exceptionLanding154;
}
await value43;
try {
value44 = undefined;
value45 = false;
} catch (error) {
r34 = null;
break exceptionLanding154;
}
if (value45) {
return value44;
}
try {
value46 = onPurchaseComplete == null;
} catch (error) {
break exceptionLanding154;
}
reducibleJoin165: while (true) {
if (value46) {
break reducibleJoin165;
}
try {
onPurchaseComplete();
} catch (error) {
break exceptionLanding154;
}
break reducibleJoin165;
}
return value;
}
function _fun58288() { // fn#58288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7432:3255, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
}
}
}
global.__d(_fun58278, 7254, [5, 31, 7255, 1226, 3808, 5140, 661, 482, 507, 7256, 1244, 4131, 3824, 4647, 5143, 566,
7062, 7257, 7260, 7294, 7295, 7297, 7298, 683, 3817,
2]) /* metro module 7254, dependencies: [5, 31, 7255, 1226, 3808, 5140, 661, 482, 507, 7256, 1244, 4131, 3824, 4647, 5143, 566, 7062, 7257, 7260, 7294, 7295, 7297, 7298, 683, 3817, 2] */;