Files
discord-decomp/sources/by-id/module-07351-useIAP.js
T
2026-07-28 01:06:53 +03:00

425 lines
21 KiB
JavaScript

/* Metro module 7351; source: unknown; dependencies: [5, 31, 7352, 7337] */
import Module00005 from './module-00005.js'; /* Metro dependency 5 */
import * as ReactModule from './module-00031-React.js'; /* Metro dependency 31 */
import * as Module07352Module from './module-07352.jsx'; /* Metro dependency 7352 */
function _fun59205(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#59205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7529:6, offset: 0x016e300e, size: 116 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = ReactModule;
const env0_3 = value.useCallback;
const env0_4 = value.useEffect;
exports.useIAP = useIAP;
function useIAP() { // fn#59206, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7529:155, offset: 0x016e3082, size: 482 bytes, params: 1, frame: 32
const value2 = undefined;
const value3 = (Module07352Module).useIAPContext();
const connected = value3.connected;
const products = value3.products;
const promotedProductsIOS = value3.promotedProductsIOS;
const subscriptions = value3.subscriptions;
const purchaseHistory = value3.purchaseHistory;
const availablePurchases = value3.availablePurchases;
const currentPurchase = value3.currentPurchase;
const currentPurchaseError = value3.currentPurchaseError;
const initConnectionError = value3.initConnectionError;
const setConnected = value3.setConnected;
const setProducts = value3.setProducts;
const setSubscriptions = value3.setSubscriptions;
const setAvailablePurchases = value3.setAvailablePurchases;
const setPurchaseHistory = value3.setPurchaseHistory;
const setCurrentPurchase = value3.setCurrentPurchase;
const setCurrentPurchaseError = value3.setCurrentPurchaseError;
const value5 = useCallback(_fun59207(), [setProducts]);
const value7 = useCallback(_fun59211(), [setSubscriptions]);
const binding = setConnected;
const value9 = useCallback(binding(_fun59216), [setAvailablePurchases]);
const value11 = useCallback(binding(_fun59218), [setPurchaseHistory]);
const value13 = useCallback(_fun59219(), [currentPurchase == null ? value2 : currentPurchase.productId,
currentPurchaseError == null ? value2 : currentPurchaseError.productId, setCurrentPurchase,
setCurrentPurchaseError]);
useEffect(function() {
setConnected(true);
return _fun59224;
}, []);
object = {connected: connected, products: products, promotedProductsIOS: promotedProductsIOS,
subscriptions: subscriptions, purchaseHistory: purchaseHistory, availablePurchases: availablePurchases,
currentPurchase: currentPurchase, currentPurchaseError: currentPurchaseError,
initConnectionError: initConnectionError, finishTransaction: value13, getProducts: value5,
getSubscriptions: value7, getAvailablePurchases: value9, getPurchaseHistory: value11};
object.requestPurchase = (require(7337) /* metro dependency 7337 */).requestPurchase;
object.requestSubscription = (require(7337) /* metro dependency 7337 */).requestSubscription;
return object;
function _fun59207() { // fn#59207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7529:542, offset: 0x016e3264, size: 32 bytes, params: 1, frame: 12
const env0_0 = env1_2(_fun59209);
return _fun59210;
function* _fun59209({skus}) { // fn#59209, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7529:562, offset: 0x016e328d, size: 90 bytes, params: 2, frame: 15
if (true) {
value = environment.__proto__.__proto__;
value = environment.__proto__.__proto__.__proto__;
value = env3_0(env3_1[3]);
var getProducts = value.getProducts;
yield Reflect.apply(getProducts, value, [{skus: skus}]);
value = undefined;
if (false) {
return value;
}
useCallback(value);
}
}
function _fun59210(a0) { // fn#59210, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7529:637, offset: 0x00c3945f, size: 30 bytes, params: 2, frame: 13
return env0_0.apply(this, arguments);
}
}
function _fun59211() { // fn#59211, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7529:693, offset: 0x016e32e7, size: 32 bytes, params: 1, frame: 12
const env0_0 = env1_2(_fun59213);
return _fun59214;
function* _fun59213({skus}) { // fn#59213, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7529:713, offset: 0x016e3310, size: 90 bytes, params: 2, frame: 15
if (true) {
value = environment.__proto__.__proto__;
value = environment.__proto__.__proto__.__proto__;
value = env3_0(env3_1[3]);
var getSubscriptions = value.getSubscriptions;
yield Reflect.apply(getSubscriptions, value, [{skus: skus}]);
value = undefined;
if (false) {
return value;
}
useEffect(value);
}
}
function _fun59214(a0) { // fn#59214, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7529:793, offset: 0x00c3945f, size: 30 bytes, params: 2, frame: 13
return env0_0.apply(this, arguments);
}
}
function* _fun59216() { // fn#59216, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7529:852, offset: 0x016e3373, size: 73 bytes, params: 1, frame: 13
if (true) {
value = environment.__proto__;
var binding = env1_5;
value = environment.__proto__.__proto__;
value = env2_0(env2_1[3]);
var getAvailablePurchases = value.getAvailablePurchases;
yield Reflect.apply(getAvailablePurchases, value, []);
value = undefined;
if (false) {
return value;
}
binding(value);
}
}
function* _fun59218() { // fn#59218, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7529:920, offset: 0x016e33c5, size: 73 bytes, params: 1, frame: 13
if (true) {
value = environment.__proto__;
var binding = env1_6;
value = environment.__proto__.__proto__;
value = env2_0(env2_1[3]);
var getPurchaseHistory = value.getPurchaseHistory;
yield Reflect.apply(getPurchaseHistory, value, []);
value = undefined;
if (false) {
return value;
}
binding(value);
}
}
function _fun59219() { // fn#59219, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7529:982, offset: 0x016e340e, size: 32 bytes, params: 1, frame: 12
const env0_0 = env1_2(_fun59221);
return _fun59222;
function* _fun59221(a0) { // fn#59221, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7529:1002, offset: 0x016e3437, size: 402 bytes, params: 2, frame: 17
var productId;
var value;
var value2;
var purchase;
var isConsumable;
var developerPayloadAndroid;
var value3;
var binding;
var binding2;
var property;
var value4;
var finishTransaction;
var object;
var value5;
var value6;
var value7;
var productId2;
var value8;
var productId3;
var productId4;
var value9;
var productId5;
var error;
var productId6;
var value10;
var productId7;
exceptionSkip38: while (true) {
exceptionLanding38: while (true) {
exceptionSkip36: while (true) {
exceptionLanding36: while (true) {
value = undefined;
value2 = false;
if (value2) {
return value;
}
value = undefined;
purchase = a0.purchase;
isConsumable = a0.isConsumable;
developerPayloadAndroid = a0.developerPayloadAndroid;
value3 = environment.__proto__.__proto__.__proto__;
try {
try {
binding = env3_0;
} catch (error) {
break exceptionLanding36;
}
} catch (error) {
break exceptionLanding38;
}
try {
try {
binding2 = env3_1;
} catch (error) {
break exceptionLanding36;
}
} catch (error) {
break exceptionLanding38;
}
try {
try {
property = binding2[3];
} catch (error) {
break exceptionLanding36;
}
} catch (error) {
break exceptionLanding38;
}
try {
try {
value4 = binding(property);
} catch (error) {
break exceptionLanding36;
}
} catch (error) {
break exceptionLanding38;
}
try {
try {
finishTransaction = value4.finishTransaction;
} catch (error) {
break exceptionLanding36;
}
} catch (error) {
break exceptionLanding38;
}
try {
try {
object = {};
} catch (error) {
break exceptionLanding36;
}
} catch (error) {
break exceptionLanding38;
}
try {
try {
object.purchase = purchase;
} catch (error) {
break exceptionLanding36;
}
} catch (error) {
break exceptionLanding38;
}
try {
try {
object.isConsumable = isConsumable;
} catch (error) {
break exceptionLanding36;
}
} catch (error) {
break exceptionLanding38;
}
try {
try {
object.developerPayloadAndroid = developerPayloadAndroid;
} catch (error) {
break exceptionLanding36;
}
} catch (error) {
break exceptionLanding38;
}
try {
try {
value5 = Reflect.apply(finishTransaction, value4, [object]);
} catch (error) {
break exceptionLanding36;
}
} catch (error) {
break exceptionLanding38;
}
yield value5;
try {
try {
value6 = undefined;
value7 = false;
} catch (error) {
break exceptionLanding36;
}
} catch (error) {
break exceptionLanding38;
}
if (value7) {
productId4 = purchase.productId;
value9 = environment.__proto__.__proto__;
if (require == null) {
productId = value;
} else {
productId = require.productId;
}
if (productId4 === productId) {
env2_7(value);
}
productId5 = purchase.productId;
if (dependencyMap == null) {
productId = value;
} else {
productId = dependencyMap.productId;
}
if (productId5 === productId) {
env2_8(value);
}
return value6;
}
productId2 = purchase.productId;
value8 = environment.__proto__.__proto__;
if (require == null) {
productId = value;
} else {
productId = require.productId;
}
if (productId2 === productId) {
env2_7(value);
}
productId3 = purchase.productId;
if (dependencyMap == null) {
productId = value;
} else {
productId = dependencyMap.productId;
}
if (productId3 === productId) {
env2_8(value);
}
return value6;
break exceptionSkip36;
}
try {
throw error;
} catch (error) {
break exceptionLanding38;
}
break exceptionSkip36;
}
break exceptionSkip38;
}
productId6 = purchase.productId;
value10 = environment.__proto__.__proto__;
if (require == null) {
productId = value;
if (productId6 !== productId) {
productId7 = purchase.productId;
if (dependencyMap == null) {
if (productId7 !== value) {
throw error;
}
env2_8(value);
throw error;
}
if (productId7 !== dependencyMap.productId) {
throw error;
}
env2_8(value);
throw error;
}
env2_7(value);
productId7 = purchase.productId;
if (dependencyMap == null) {
if (productId7 !== value) {
throw error;
}
env2_8(value);
throw error;
}
productId = dependencyMap.productId;
if (productId7 !== productId) {
throw error;
}
env2_8(value);
throw error;
}
productId = require.productId;
if (productId6 !== productId) {
productId7 = purchase.productId;
if (dependencyMap == null) {
if (productId7 !== value) {
throw error;
}
env2_8(value);
throw error;
}
if (productId7 !== dependencyMap.productId) {
throw error;
}
env2_8(value);
throw error;
}
env2_7(value);
productId7 = purchase.productId;
if (dependencyMap == null) {
if (productId7 !== value) {
throw error;
}
env2_8(value);
throw error;
}
productId = dependencyMap.productId;
if (productId7 !== productId) {
throw error;
}
env2_8(value);
throw error;
break exceptionSkip38;
}
}
function _fun59222(a0) { // fn#59222, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7529:1319, offset: 0x00c3945f, size: 30 bytes, params: 2, frame: 13
return env0_0.apply(this, arguments);
}
}
function _fun59223() { // fn#59223, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7529:1437, offset: 0x016e35c9, size: 25 bytes, params: 1, frame: 11
setConnected(true);
return function() {
setConnected(false);
setCurrentPurchaseError(undefined);
};
function _fun59224() { // fn#59224, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7529:1461, offset: 0x016e35e2, size: 27 bytes, params: 1, frame: 12
setConnected(false);
setCurrentPurchaseError(undefined);
}
}
}
}
global.__d(_fun59205, 7351, [5, 31, 7352, 7337]) /* metro module 7351, dependencies: [5, 31, 7352, 7337] */;