338 lines
16 KiB
TypeScript
338 lines
16 KiB
TypeScript
/* Metro module 10146; source: modules/collectibles/native/useHandleBuyNow.tsx; dependencies: [5, 57, 31, 661, 3, 10147, 5120, 4080, 7589, 1581, 6906, 3817, 3857, 1244, 2] */
|
|
import Logger from '../../debug/Logger.tsx'; /* Metro dependency 3 */
|
|
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
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 '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
function _fun79086(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10332:6, offset: 0x01e447f3, size: 225 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = Logger;
|
|
value = new value('useHandleBuyNow');
|
|
const useHandleBuyNow2 = useHandleBuyNow;
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/collectibles/native/useHandleBuyNow.tsx');
|
|
exports.default = useHandleBuyNow2;
|
|
exports.useHandleBuyNow = useHandleBuyNow2;
|
|
function useHandleBuyNow({product, analyticsLocations, onBuy, orderId}) { // fn#79087, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10332:195, offset: 0x01e448d4, size: 255 bytes, params: 2, frame: 21
|
|
const [property, env0_3] = Module00057(ReactModule.useState(false), 2);
|
|
const value4 = (importDefault(10147) /* metro dependency 10147: useMobileCollectiblesPurchaseSKUAndroid */)({product: product,
|
|
analyticsLocations: analyticsLocations, onPurchaseComplete: function() {
|
|
return _onPurchaseComplete.apply(this, arguments);
|
|
}, onPurchaseError: onPurchaseError_79092, onPurchasePending: function() {
|
|
}, orderId: orderId});
|
|
const useCallback = ReactModule.useCallback;
|
|
return {handleBuyNow: Reflect.apply(useCallback, ReactModule, [env0_3(_fun79095), [value4, property, onBuy,
|
|
product.skuId]]), isBuying: property};
|
|
function _onPurchaseComplete() { // fn#79088, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10332:546, owner: useHandleBuyNow._onPurchaseComplete, offset: 0x01e449d3, size: 53 bytes, params: 1, frame: 13
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
return env1_3(_fun79090).apply(this, arguments);
|
|
function* _fun79090() { // fn#79090, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10332:607, offset: 0x01e44a13, size: 149 bytes, params: 1, frame: 16
|
|
if (true) {
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
var binding = env3_0;
|
|
var value3 = binding(env3_2[6]);
|
|
yield value3.fetchCollectiblesPurchases();
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
env2_3(false);
|
|
binding = env3_1;
|
|
var binding2 = env3_2;
|
|
binding(binding2[7]).hideActionSheet();
|
|
value = binding(binding2[8]);
|
|
value.open({product: require, useCategoryImage: true});
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function useHandleBuyNowOnPurchaseError() { // fn#79092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10332:451, owner: useHandleBuyNow.onPurchaseError, offset: 0x01e44aa8, size: 18 bytes, params: 1, frame: 11
|
|
env0_3(false);
|
|
}
|
|
|
|
function* _fun79095() { // fn#79095, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10332:803, offset: 0x01e44ac5, size: 619 bytes, params: 1, frame: 21
|
|
var binding;
|
|
var value3;
|
|
var isMetaQuest;
|
|
var value4;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var value8;
|
|
var error;
|
|
var error2;
|
|
var JSON;
|
|
var stringify;
|
|
var value9;
|
|
var HermesInternal;
|
|
var concat;
|
|
var captureBillingException;
|
|
var object;
|
|
var skuId;
|
|
var COLLECTIBLES_SHOP;
|
|
var value10;
|
|
var value11;
|
|
var binding2;
|
|
var property;
|
|
var value12;
|
|
var redirectWithHandoffToken;
|
|
var value13;
|
|
var value14;
|
|
var value15;
|
|
var binding3;
|
|
var value16;
|
|
var hideActionSheet;
|
|
var error3;
|
|
var value17;
|
|
var binding4;
|
|
var value18;
|
|
var value19;
|
|
var binding5;
|
|
var open;
|
|
var intl;
|
|
var string;
|
|
var t;
|
|
let value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
reduciblePort53: while (true) {
|
|
exceptionLanding52: while (true) {
|
|
exceptionLanding20: while (true) {
|
|
value = environment.__proto__.__proto__;
|
|
binding = env2_0;
|
|
value3 = binding(env2_2[9]);
|
|
isMetaQuest = value3.isMetaQuest;
|
|
if (Reflect.apply(isMetaQuest, value3, [])) {
|
|
try {
|
|
binding = env2_6;
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
try {
|
|
COLLECTIBLES_SHOP = binding.COLLECTIBLES_SHOP;
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
value10 = environment.__proto__;
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
try {
|
|
skuId = require.skuId;
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
try {
|
|
HermesInternal = global.HermesInternal;
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
try {
|
|
concat = HermesInternal.concat;
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
try {
|
|
value11 = '' + COLLECTIBLES_SHOP + '#itemSkuId=' + skuId;
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
try {
|
|
binding = env2_1;
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
try {
|
|
binding2 = env2_2;
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
try {
|
|
property = binding2[10];
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
try {
|
|
value12 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
try {
|
|
redirectWithHandoffToken = value12.redirectWithHandoffToken;
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
try {
|
|
object = {};
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
try {
|
|
object.forceExternalBrowser = true;
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
try {
|
|
value13 = Reflect.apply(redirectWithHandoffToken, value12, [value11, object]);
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
yield value13;
|
|
try {
|
|
value14 = undefined;
|
|
value15 = false;
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
if (value15) {
|
|
return value14;
|
|
}
|
|
try {
|
|
binding = env2_1;
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
try {
|
|
binding3 = env2_2;
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
try {
|
|
property = binding3[7];
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
try {
|
|
value16 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
try {
|
|
hideActionSheet = value16.hideActionSheet;
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
try {
|
|
Reflect.apply(hideActionSheet, value16, []);
|
|
} catch (error) {
|
|
break exceptionLanding52;
|
|
}
|
|
break reduciblePort53;
|
|
}
|
|
value4 = environment.__proto__;
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
if (dependencyMap) {
|
|
break reduciblePort53;
|
|
}
|
|
try {
|
|
binding = env1_3;
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
binding(true);
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
binding = env1_4;
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
value5 = binding();
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
yield value5;
|
|
try {
|
|
value6 = undefined;
|
|
value7 = false;
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
if (value7) {
|
|
return value6;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
value8 = importDefault == null;
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
if (value8) {
|
|
break reduciblePort53;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
importDefault();
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
break reduciblePort53;
|
|
}
|
|
env1_3(false);
|
|
binding = env2_7;
|
|
error2 = binding.error;
|
|
JSON = global.JSON;
|
|
stringify = JSON.stringify;
|
|
value9 = Reflect.apply(stringify, JSON, [error]);
|
|
HermesInternal = global.HermesInternal;
|
|
concat = HermesInternal.concat;
|
|
Reflect.apply(error2, binding, ['Error running purchase: ' + value9]);
|
|
binding = env2_0;
|
|
value = binding(env2_2[11]);
|
|
captureBillingException = value.captureBillingException;
|
|
skuId = require.skuId;
|
|
Reflect.apply(captureBillingException, value, [error, {tags: {source: 'useHandleBuyNow', skuId: skuId}}]);
|
|
break reduciblePort53;
|
|
}
|
|
binding = env2_7;
|
|
error3 = binding.error;
|
|
JSON = global.JSON;
|
|
stringify = JSON.stringify;
|
|
value17 = Reflect.apply(stringify, JSON, [error]);
|
|
HermesInternal = global.HermesInternal;
|
|
concat = HermesInternal.concat;
|
|
Reflect.apply(error3, binding, ['Error performing web handoff: ' + value17]);
|
|
binding = env2_0;
|
|
binding4 = env2_2;
|
|
value18 = binding(binding4[11]);
|
|
captureBillingException = value18.captureBillingException;
|
|
value19 = environment.__proto__;
|
|
skuId = require.skuId;
|
|
Reflect.apply(captureBillingException, value18, [error, {tags: {source: 'useHandleBuyNow', skuId: skuId}}]);
|
|
binding5 = env2_1;
|
|
value = binding5(binding4[12]);
|
|
open = value.open;
|
|
intl = binding(binding4[13]).intl;
|
|
string = intl.string;
|
|
t = binding(binding4[13]).t;
|
|
Reflect.apply(open, value, [{key: 'SHOP_ITEM_HANDOFF_ERROR', content: Reflect.apply(string, intl,
|
|
[t['rTU7/z']])}]);
|
|
break reduciblePort53;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun79086, 10146, [5, 57, 31, 661, 3, 10147, 5120, 4080, 7589, 1581, 6906, 3817, 3857, 1244,
|
|
2]) /* metro module 10146, dependencies: [5, 57, 31, 661, 3, 10147, 5120, 4080, 7589, 1581, 6906, 3817, 3857, 1244, 2] */;
|