/* Metro module 7300; source: modules/payments/OrderActionCreators.tsx; dependencies: [5, 7, 6, 15, 17, 18, 661, 3, 3824, 507, 3817, 2] */ function _fun58957(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#58957, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:6, offset: 0x016dc39b, size: 380 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_2 = importDefault(5) /* metro dependency 5 */; const env0_3 = importDefault(7) /* metro dependency 7 */; const env0_4 = importDefault(6) /* metro dependency 6 */; const env0_5 = importDefault(15) /* metro dependency 15 */; const env0_6 = importDefault(17) /* metro dependency 17 */; const env0_7 = importDefault(18) /* metro dependency 18 */; const env0_8 = (require(661) /* metro dependency 661: Constants */).Endpoints; let value = importDefault(3) /* metro dependency 3: Logger */; value = new value('OrderActionCreators'); value = importDefault(3824) /* metro dependency 3824: BillingError */; value = _fun58971(value); const value4 = _fun58973(importDefault(3824) /* metro dependency 3824: BillingError */); (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/payments/OrderActionCreators.tsx'); exports.OrderSigningFailedWithConstraintsError = value; exports.OrderProcessingPendingError = value4; exports.signOrder = function() { return _signOrder.apply(this, arguments); }; exports.getOrder = function() { return _getOrder.apply(this, arguments); }; exports.fetchOrderEntitlements = function() { return _fetchOrderEntitlements.apply(this, arguments); }; } function _callSuper_58958(a0, a1, a2) { // fn#58958, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:178, offset: 0x016dc517, size: 100 bytes, params: 4, frame: 20 var r0; var Reflect; let value = a2; const value3 = env0_6(a1); const binding = env0_5; if (_isNativeReflectConstruct_58959()) { Reflect = global.Reflect; value = Reflect.construct(value3, value || [], env0_6(a0).constructor); r0 = value; } else { value = value3.apply(a0, value); r0 = value; } return binding(a0, r0); } function _isNativeReflectConstruct_58959() { // fn#58959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:309, offset: 0x016dc57b, 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_58959_isNativeReflectConstruct = function() { return !!result; })(); } function _signOrder() { // fn#58962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:1184, offset: 0x016dc5d9, size: 48 bytes, params: 1, frame: 14 return env0_2(_fun58964).apply(this, arguments); } function _getOrder() { // fn#58965, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:1736, offset: 0x016dc7ab, size: 48 bytes, params: 1, frame: 14 return env0_2(_fun58967).apply(this, arguments); } function _fetchOrderEntitlements() { // fn#58968, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:2079, offset: 0x016dc8c5, size: 48 bytes, params: 1, frame: 14 return env0_2(_fun58970).apply(this, arguments); } function _fun58971(a0) { // fn#58971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:546, offset: 0x016dc985, size: 40 bytes, params: 2, frame: 14 const closure = OrderSigningFailedWithConstraintsError; env0_7(closure, a0); return env0_3(closure); } function _fun58973(a0) { // fn#58973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:900, offset: 0x016dc9e6, size: 40 bytes, params: 2, frame: 14 const closure = OrderProcessingPendingError; env0_7(closure, a0); return env0_3(closure); } async function _fun58964(a0) { // fn#58964, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:1227, offset: 0x016dc61b, size: 400 bytes, params: 2, frame: 22 var r9; var r4; var value; var value2; var orderId; var expectedRevision; var loadId; var value3; var value4; var object3; var value5; var binding; var binding2; var property; var value6; var HTTP; var post; var object4; var ORDER_SIGN; var value7; var value8; var value9; var value10; var value11; var value12; var body; var error; var HTTPResponseError; exceptionSkip39: while (true) { exceptionLanding39: while (true) { value = undefined; value2 = false; if (value2) { return value; } orderId = a0.orderId; expectedRevision = a0.expectedRevision; loadId = a0.loadId; value = undefined; await value; value3 = undefined; value4 = false; if (value4) { return value3; } object3 = {}; if (expectedRevision != null) { object3.expected_revision = expectedRevision; } value5 = environment.__proto__.__proto__; try { binding = env2_0; } catch (error) { break exceptionLanding39; } try { binding2 = env2_1; } catch (error) { break exceptionLanding39; } try { property = binding2[9]; } catch (error) { break exceptionLanding39; } try { value6 = binding(property); } catch (error) { break exceptionLanding39; } try { HTTP = value6.HTTP; } catch (error) { break exceptionLanding39; } try { post = HTTP.post; } catch (error) { break exceptionLanding39; } try { object4 = {}; } catch (error) { break exceptionLanding39; } try { binding = env2_8; } catch (error) { break exceptionLanding39; } try { ORDER_SIGN = binding.ORDER_SIGN; } catch (error) { break exceptionLanding39; } try { value7 = Reflect.apply(ORDER_SIGN, binding, [orderId]); } catch (error) { break exceptionLanding39; } try { object4.url = value7; } catch (error) { break exceptionLanding39; } try { object4.body = object3; } catch (error) { break exceptionLanding39; } try { value8 = loadId != null; } catch (error) { break exceptionLanding39; } if (value8) { try { value9 = loadId === ''; } catch (error) { break exceptionLanding39; } if (value9) { r9 = value; break; } try { object3 = {}; } catch (error) { break exceptionLanding39; } try { object3.load_id = loadId; } catch (error) { break exceptionLanding39; } r9 = object3; break; } r9 = value; try { object4.context = r9; } catch (error) { break exceptionLanding39; } try { object4.rejectWithError = true; } catch (error) { break exceptionLanding39; } try { value10 = Reflect.apply(post, HTTP, [object4]); } catch (error) { break exceptionLanding39; } await value10; try { value11 = undefined; value12 = false; } catch (error) { break exceptionLanding39; } if (value12) { return value11; } body = value11.body; if (body == null) { throw new global.Error('Invalid sign order response'); } return value11.body; break exceptionSkip39; } binding = env2_0; HTTPResponseError = binding(env2_1[9]).HTTPResponseError; if (error instanceof HTTPResponseError) { if (error.status !== 400) { throw error; } body = error.body; value = body != null; if (value) { r4 = typeof body === 'object'; if (r4) { r4 = 'id' in body; if (r4) { if ('status' in body) { binding = env2_10; body = error.body; throw new binding(); } throw error; } if (r4) { binding = env2_10; body = error.body; throw new binding(); } throw error; } if (r4) { if ('status' in body) { binding = env2_10; body = error.body; throw new binding(); } throw error; } if (r4) { binding = env2_10; body = error.body; throw new binding(); } throw error; } r4 = value; if (r4) { r4 = 'id' in body; if (r4) { if ('status' in body) { binding = env2_10; body = error.body; throw new binding(); } throw error; } if (r4) { binding = env2_10; body = error.body; throw new binding(); } throw error; } if (r4) { if ('status' in body) { binding = env2_10; body = error.body; throw new binding(); } throw error; } if (r4) { binding = env2_10; body = error.body; throw new binding(); } throw error; } throw error; break exceptionSkip39; } } function* _fun58967(a0) { // fn#58967, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:1777, offset: 0x016dc7e4, size: 225 bytes, params: 2, frame: 18 var binding; var binding2; var property; var value3; var HTTP; var get; var object2; var ORDER_GET; var value4; var value5; var value6; var value7; var body; var error; if (false) { return undefined; } value = environment.__proto__.__proto__; try { binding = env2_0; } catch (error) { binding = env2_9; binding.error('failed to fetch order', {error: error, orderId: a0}); binding = env2_0; value = binding(env2_1[10]); value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}}); return null; } try { binding2 = env2_1; } catch (error) { binding = env2_9; binding.error('failed to fetch order', {error: error, orderId: a0}); binding = env2_0; value = binding(env2_1[10]); value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}}); return null; } try { property = binding2[9]; } catch (error) { binding = env2_9; binding.error('failed to fetch order', {error: error, orderId: a0}); binding = env2_0; value = binding(env2_1[10]); value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}}); return null; } try { value3 = binding(property); } catch (error) { binding = env2_9; binding.error('failed to fetch order', {error: error, orderId: a0}); binding = env2_0; value = binding(env2_1[10]); value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}}); return null; } try { HTTP = value3.HTTP; } catch (error) { binding = env2_9; binding.error('failed to fetch order', {error: error, orderId: a0}); binding = env2_0; value = binding(env2_1[10]); value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}}); return null; } try { get = HTTP.get; } catch (error) { binding = env2_9; binding.error('failed to fetch order', {error: error, orderId: a0}); binding = env2_0; value = binding(env2_1[10]); value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}}); return null; } try { object2 = {}; } catch (error) { binding = env2_9; binding.error('failed to fetch order', {error: error, orderId: a0}); binding = env2_0; value = binding(env2_1[10]); value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}}); return null; } try { binding = env2_8; } catch (error) { binding = env2_9; binding.error('failed to fetch order', {error: error, orderId: a0}); binding = env2_0; value = binding(env2_1[10]); value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}}); return null; } try { ORDER_GET = binding.ORDER_GET; } catch (error) { binding = env2_9; binding.error('failed to fetch order', {error: error, orderId: a0}); binding = env2_0; value = binding(env2_1[10]); value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}}); return null; } try { value4 = Reflect.apply(ORDER_GET, binding, [a0]); } catch (error) { binding = env2_9; binding.error('failed to fetch order', {error: error, orderId: a0}); binding = env2_0; value = binding(env2_1[10]); value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}}); return null; } try { object2.url = value4; } catch (error) { binding = env2_9; binding.error('failed to fetch order', {error: error, orderId: a0}); binding = env2_0; value = binding(env2_1[10]); value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}}); return null; } try { object2.rejectWithError = true; } catch (error) { binding = env2_9; binding.error('failed to fetch order', {error: error, orderId: a0}); binding = env2_0; value = binding(env2_1[10]); value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}}); return null; } try { value5 = Reflect.apply(get, HTTP, [object2]); } catch (error) { binding = env2_9; binding.error('failed to fetch order', {error: error, orderId: a0}); binding = env2_0; value = binding(env2_1[10]); value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}}); return null; } yield value5; try { value6 = undefined; value7 = false; } catch (error) { binding = env2_9; binding.error('failed to fetch order', {error: error, orderId: a0}); binding = env2_0; value = binding(env2_1[10]); value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}}); return null; } if (value7) { return value6; } try { body = value6.body; } catch (error) { binding = env2_9; binding.error('failed to fetch order', {error: error, orderId: a0}); binding = env2_0; value = binding(env2_1[10]); value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}}); return null; } return body || null; } function* _fun58970(a0) { // fn#58970, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:2148, offset: 0x016dc8fe, size: 135 bytes, params: 2, frame: 16 var r2; var binding; var binding2; var property; var value3; var HTTP; var get; var object; var ORDER_ENTITLEMENTS; var value4; var body; var value5; var error; if (false) { return undefined; } value = environment.__proto__.__proto__; try { binding = env2_0; } catch (error) { return []; } try { binding2 = env2_1; } catch (error) { return []; } try { property = binding2[9]; } catch (error) { return []; } try { value3 = binding(property); } catch (error) { return []; } try { HTTP = value3.HTTP; } catch (error) { return []; } try { get = HTTP.get; } catch (error) { return []; } try { object = {}; } catch (error) { return []; } try { binding = env2_8; } catch (error) { return []; } try { ORDER_ENTITLEMENTS = binding.ORDER_ENTITLEMENTS; } catch (error) { return []; } try { value = Reflect.apply(ORDER_ENTITLEMENTS, binding, [a0]); } catch (error) { return []; } try { object.url = value; } catch (error) { return []; } try { object.rejectWithError = false; } catch (error) { return []; } try { value = Reflect.apply(get, HTTP, [object]); } catch (error) { return []; } yield value; try { value = undefined; value4 = false; } catch (error) { return []; } if (value4) { return value; } try { body = value.body; } catch (error) { return []; } try { value5 = body != null; } catch (error) { return []; } if (value5) { try { body = value.body; } catch (error) { return []; } r2 = body; } else { try { object = []; } catch (error) { return []; } r2 = object; } return r2; } function OrderSigningFailedWithConstraintsError(a0) { // fn#58972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:558, offset: 0x016dc9ad, size: 57 bytes, params: 2, frame: 15 let value = environment.__proto__; env1_4(this, OrderSigningFailedWithConstraintsError); value = _callSuper_58958(this, OrderSigningFailedWithConstraintsError, ['Order signing failed due to unsatisfied constraints']); value.order = a0; return value; } function OrderProcessingPendingError() { // fn#58974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:912, offset: 0x016dca0e, size: 48 bytes, params: 1, frame: 15 env1_4(this, OrderProcessingPendingError); return _callSuper_58958(this, OrderProcessingPendingError, ['Order signed but entitlements not yet visible after polling']); }