510 lines
24 KiB
JavaScript
510 lines
24 KiB
JavaScript
/* Metro module 7480; source: unknown; dependencies: [57, 5, 7367, 7481, 7375, 7370, 7383, 7376] */
|
|
import * as Module00005Module from './module-00005.js'; /* Metro dependency 5 */
|
|
import * as Module00057Module from './module-00057.js'; /* Metro dependency 57 */
|
|
import * as Module07367Module from './module-07367.js'; /* Metro dependency 7367 */
|
|
import * as Module07370Module from './module-07370.js'; /* Metro dependency 7370 */
|
|
|
|
function _fun60323(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#60323, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7658:6, offset: 0x01701442, size: 168 bytes, params: 8, frame: 18
|
|
let env0_0 = require;
|
|
const streamHandler_60340 = function(a0) {
|
|
var value;
|
|
var error;
|
|
var env0_0 = a0;
|
|
try {
|
|
value = a0.clone();
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
_fun60341(value, _fun60342);
|
|
};
|
|
const hasProp_60343 = function(a0, a1) {
|
|
return (a0 ? typeof a0 === 'object' : !!a0) && !!a0[a1];
|
|
};
|
|
const parseFetchArgs_603452 = parseFetchArgs_60345;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
exports.addFetchEndInstrumentationHandler = addFetchEndInstrumentationHandler_60346;
|
|
exports.addFetchInstrumentationHandler = addFetchInstrumentationHandler_60348;
|
|
exports.parseFetchArgs = parseFetchArgs_603452;
|
|
function instrumentFetch_60324(a0) { // fn#60324, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7658:55, offset: 0x017014ea, size: 148 bytes, params: 2, frame: 17
|
|
let env0_0 = a0;
|
|
let value = arguments.length > 1;
|
|
let r2 = value && arguments[1] !== undefined && arguments[1];
|
|
if (r2) {
|
|
value = require(7481) /* metro dependency 7481 */;
|
|
value = !value.supportsNativeFetch();
|
|
r2 = value;
|
|
}
|
|
if (!r2) {
|
|
value = require(7375) /* metro dependency 7375 */;
|
|
value.fill((require(7370) /* metro dependency 7370 */).GLOBAL_OBJ, 'fetch', function(a0) {
|
|
var env0_0 = a0;
|
|
return _fun60326;
|
|
});
|
|
}
|
|
function _fun60325(a0) { // fn#60325, offset: 0x0170157e, size: 16 bytes, params: 2, frame: 2
|
|
const env0_0 = a0;
|
|
return _fun60326;
|
|
function _fun60326() { // fn#60326, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7658:232, offset: 0x0170158e, size: 330 bytes, params: 1, frame: 19
|
|
var environment;
|
|
var r1;
|
|
var value6;
|
|
var triggerHandlers;
|
|
var Object;
|
|
var assign;
|
|
var value9;
|
|
const Error = global.Error;
|
|
let error = new Error();
|
|
const error2 = error;
|
|
const length = arguments.length;
|
|
const Array = global.Array;
|
|
const array = new Array(length);
|
|
const value5 = 0;
|
|
if (value5 < length) {
|
|
r1 = value5;
|
|
reducibleLoop1: while (true) {
|
|
array[r1] = arguments[r1];
|
|
value6 = typeof r1 === 'bigint' ? r1 + 1n : +r1 + 1;
|
|
if (value6 < length) {
|
|
r1 = value6;
|
|
continue reducibleLoop1;
|
|
}
|
|
break reducibleLoop1;
|
|
}
|
|
}
|
|
const fetchArgs_60345 = parseFetchArgs_60345(array);
|
|
const object = {args: array};
|
|
object.fetchData = {method: fetchArgs_60345.method, url: fetchArgs_60345.url};
|
|
object.startTimestamp = 1000 * (require(7383) /* metro dependency 7383 */).timestampInSeconds();
|
|
object.virtualError = error;
|
|
error = environment.__proto__;
|
|
reducibleJoin4: while (true) {
|
|
if (env1_0) {
|
|
break reducibleJoin4;
|
|
}
|
|
error = require(7367) /* metro dependency 7367 */;
|
|
triggerHandlers = error.triggerHandlers;
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
value9 = Reflect.apply(assign, Object, [{}, object]);
|
|
Reflect.apply(triggerHandlers, error, ['fetch', value9]);
|
|
break reducibleJoin4;
|
|
}
|
|
const binding = error2;
|
|
const apply = binding.apply;
|
|
const GLOBAL_OBJ = (Module07370Module).GLOBAL_OBJ;
|
|
error = Reflect.apply(apply, binding, [GLOBAL_OBJ, array]);
|
|
return error.then(_fun60327(), _fun60331);
|
|
function _fun60327() { // fn#60327, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7658:561, offset: 0x017016d8, size: 32 bytes, params: 1, frame: 12
|
|
const env0_0 = env3_3(_fun60329);
|
|
return _fun60330;
|
|
function* _fun60329(a0) { // fn#60329, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7658:581, offset: 0x00d8dd4b, size: 156 bytes, params: 2, frame: 23
|
|
var binding;
|
|
var binding2;
|
|
var triggerHandlers;
|
|
var Object;
|
|
var assign;
|
|
var value3;
|
|
var binding3;
|
|
var object;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__.__proto__.__proto__;
|
|
if (require) {
|
|
require(a0);
|
|
} else {
|
|
value = environment.__proto__.__proto__.__proto__.__proto__.__proto__;
|
|
binding = env5_0;
|
|
binding2 = env5_1;
|
|
value = binding(binding2[2]);
|
|
triggerHandlers = value.triggerHandlers;
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
value3 = environment.__proto__.__proto__;
|
|
binding3 = env2_1;
|
|
object = {};
|
|
object.endTimestamp = 1000 * binding(binding2[6]).timestampInSeconds();
|
|
object.response = a0;
|
|
Reflect.apply(triggerHandlers, value, ['fetch', Reflect.apply(assign, Object, [{}, binding3, object])]);
|
|
}
|
|
return a0;
|
|
}
|
|
|
|
function _fun60330(a0) { // fn#60330, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7658:732, offset: 0x00d71197, size: 29 bytes, params: 2, frame: 13
|
|
return env0_0.apply(this, arguments);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun60331(a0) { // fn#60331, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7658:780, offset: 0x01701701, size: 213 bytes, params: 2, frame: 24
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
const triggerHandlers = Module07367Module.triggerHandlers;
|
|
const Object = global.Object;
|
|
const assign = Object.assign;
|
|
const binding = env0_1;
|
|
const object = {};
|
|
object.endTimestamp = 1000 * (require(7383) /* metro dependency 7383 */).timestampInSeconds();
|
|
object.error = a0;
|
|
Reflect.apply(triggerHandlers, Module07367Module, ['fetch', Reflect.apply(assign, Object, [{}, binding, object])]);
|
|
if ((require(7376) /* metro dependency 7376 */).isError(a0) && a0.stack === undefined) {
|
|
a0.stack = env0_0.stack;
|
|
(require(7375) /* metro dependency 7375 */).addNonEnumerableProperty(a0, 'framesToPop', 1);
|
|
}
|
|
throw a0;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _resolveResponse_60332() { // fn#60332, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7658:1024, offset: 0x017017d6, size: 47 bytes, params: 1, frame: 14
|
|
return Module00005Module(_fun60334).apply(this, arguments);
|
|
function* _fun60334(a0, a1) { // fn#60334, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7658:1079, offset: 0x0170180e, size: 288 bytes, params: 3, frame: 25
|
|
var r12;
|
|
var r2;
|
|
var value;
|
|
var value2;
|
|
var body;
|
|
var getReader;
|
|
var value3;
|
|
var setTimeout;
|
|
var value4;
|
|
var value5;
|
|
var closure;
|
|
var value6;
|
|
var read;
|
|
var value7;
|
|
var value8;
|
|
var value9;
|
|
var done;
|
|
var clearTimeout;
|
|
var value10;
|
|
var error;
|
|
var value11;
|
|
var releaseLock;
|
|
var cancel;
|
|
var value12;
|
|
var then;
|
|
exceptionLanding29: while (true) {
|
|
value = undefined;
|
|
value2 = false;
|
|
if (value2) {
|
|
return value;
|
|
}
|
|
value = undefined;
|
|
var env0_0 = value;
|
|
if (a0) {
|
|
body = a0.body;
|
|
reducibleJoin28: while (true) {
|
|
if (body) {
|
|
body = a0.body;
|
|
env0_0 = body;
|
|
getReader = body.getReader;
|
|
value3 = Reflect.apply(getReader, body, []);
|
|
setTimeout = global.setTimeout;
|
|
value4 = setTimeout(_fun60335, 90000);
|
|
value5 = true;
|
|
r12 = value5;
|
|
reducibleLoop4: while (true) {
|
|
reducibleJoin6: while (true) {
|
|
reduciblePort26: while (true) {
|
|
exceptionLanding24: while (true) {
|
|
try {
|
|
try {
|
|
setTimeout = global.setTimeout;
|
|
} catch (error) {
|
|
r2 = value;
|
|
break exceptionLanding24;
|
|
}
|
|
} catch (error) {
|
|
r2 = value;
|
|
break exceptionLanding29;
|
|
}
|
|
break reducibleJoin6;
|
|
}
|
|
value11 = false;
|
|
r12 = value11;
|
|
break reduciblePort26;
|
|
}
|
|
clearTimeout = global.clearTimeout;
|
|
clearTimeout(r2);
|
|
if (r12) {
|
|
continue reducibleLoop4;
|
|
}
|
|
break reducibleLoop4;
|
|
}
|
|
try {
|
|
try {
|
|
closure = _fun60337;
|
|
} catch (error) {
|
|
r2 = value;
|
|
break exceptionLanding24;
|
|
}
|
|
} catch (error) {
|
|
r2 = value;
|
|
break exceptionLanding29;
|
|
}
|
|
try {
|
|
try {
|
|
value6 = setTimeout(closure, 5000);
|
|
} catch (error) {
|
|
r2 = value;
|
|
break exceptionLanding24;
|
|
}
|
|
} catch (error) {
|
|
r2 = value;
|
|
break exceptionLanding29;
|
|
}
|
|
try {
|
|
try {
|
|
read = value3.read;
|
|
} catch (error) {
|
|
r2 = value6;
|
|
break exceptionLanding24;
|
|
}
|
|
} catch (error) {
|
|
r2 = value6;
|
|
break exceptionLanding29;
|
|
}
|
|
try {
|
|
try {
|
|
value7 = Reflect.apply(read, value3, []);
|
|
} catch (error) {
|
|
r2 = value6;
|
|
break exceptionLanding24;
|
|
}
|
|
} catch (error) {
|
|
r2 = value6;
|
|
break exceptionLanding29;
|
|
}
|
|
yield value7;
|
|
try {
|
|
try {
|
|
value8 = undefined;
|
|
value9 = false;
|
|
} catch (error) {
|
|
r2 = value6;
|
|
break exceptionLanding24;
|
|
}
|
|
} catch (error) {
|
|
r2 = value6;
|
|
break exceptionLanding29;
|
|
}
|
|
if (value9) {
|
|
global.clearTimeout(value6);
|
|
return value8;
|
|
}
|
|
try {
|
|
try {
|
|
done = value8.done;
|
|
} catch (error) {
|
|
r2 = value6;
|
|
break exceptionLanding24;
|
|
}
|
|
} catch (error) {
|
|
r2 = value6;
|
|
break exceptionLanding29;
|
|
}
|
|
try {
|
|
try {
|
|
clearTimeout = global.clearTimeout;
|
|
} catch (error) {
|
|
r2 = value6;
|
|
break exceptionLanding24;
|
|
}
|
|
} catch (error) {
|
|
r2 = value6;
|
|
break exceptionLanding29;
|
|
}
|
|
try {
|
|
try {
|
|
clearTimeout(value6);
|
|
} catch (error) {
|
|
r2 = value6;
|
|
break exceptionLanding24;
|
|
}
|
|
} catch (error) {
|
|
r2 = value6;
|
|
break exceptionLanding29;
|
|
}
|
|
reducibleJoin22: while (true) {
|
|
if (done) {
|
|
try {
|
|
try {
|
|
a1();
|
|
} catch (error) {
|
|
r2 = value6;
|
|
break exceptionLanding24;
|
|
}
|
|
} catch (error) {
|
|
r2 = value6;
|
|
break exceptionLanding29;
|
|
}
|
|
value10 = false;
|
|
r12 = value10;
|
|
break reducibleJoin22;
|
|
}
|
|
break reducibleJoin22;
|
|
}
|
|
r2 = value6;
|
|
clearTimeout = global.clearTimeout;
|
|
clearTimeout(r2);
|
|
if (r12) {
|
|
continue reducibleLoop4;
|
|
}
|
|
break reducibleLoop4;
|
|
}
|
|
clearTimeout = global.clearTimeout;
|
|
clearTimeout(value4);
|
|
releaseLock = value3.releaseLock;
|
|
Reflect.apply(releaseLock, value3, []);
|
|
cancel = body.cancel;
|
|
value12 = Reflect.apply(cancel, body, []);
|
|
then = value12.then;
|
|
Reflect.apply(then, value12, [null, function() {
|
|
}]);
|
|
break reducibleJoin28;
|
|
}
|
|
break reducibleJoin28;
|
|
}
|
|
}
|
|
return value;
|
|
}
|
|
global.clearTimeout(r2);
|
|
throw error;
|
|
function _fun60335() { // fn#60335, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7658:1155, offset: 0x0170192e, size: 41 bytes, params: 1, frame: 13
|
|
body.cancel().then(null, function() {
|
|
});
|
|
}
|
|
|
|
function _fun60337() { // fn#60337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7658:1250, offset: 0x01701957, size: 41 bytes, params: 1, frame: 13
|
|
body.cancel().then(null, function() {
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function streamHandler_60340(a0) { // fn#60340, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7658:1498, offset: 0x01701980, size: 57 bytes, params: 2, frame: 14
|
|
var value;
|
|
var error;
|
|
const env0_0 = a0;
|
|
try {
|
|
value = a0.clone();
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
(function(a0, a1) {
|
|
return _resolveResponse_60332.apply(this, arguments);
|
|
})(value, _fun60342);
|
|
function streamHandler_60340ResolveResponse(a0, a1) { // fn#60341, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7658:1563, owner: streamHandler_60340.resolveResponse, offset: 0x00d8e1e5, size: 29 bytes, params: 3, frame: 13
|
|
return _resolveResponse_60332.apply(this, arguments);
|
|
}
|
|
|
|
function _fun60342() { // fn#60342, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7658:1643, offset: 0x00d8e202, size: 96 bytes, params: 1, frame: 16
|
|
let value = environment.__proto__;
|
|
value = require(7367) /* metro dependency 7367 */;
|
|
const triggerHandlers = value.triggerHandlers;
|
|
const object = {};
|
|
object.endTimestamp = 1000 * (require(7383) /* metro dependency 7383 */).timestampInSeconds();
|
|
object.response = env0_0;
|
|
Reflect.apply(triggerHandlers, value, ['fetch-body-resolved', object]);
|
|
}
|
|
|
|
}
|
|
|
|
function getUrlFromResource_60344(a0) { // fn#60344, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7658:1823, offset: 0x00d8e28b, size: 81 bytes, params: 2, frame: 16
|
|
var r2;
|
|
var r1;
|
|
var r0;
|
|
var value2;
|
|
let value = a0;
|
|
if (typeof value === 'string') {
|
|
r0 = value;
|
|
} else {
|
|
value2 = '';
|
|
if (value) {
|
|
if (hasProp_60343(value, 'url')) {
|
|
r2 = value.url;
|
|
} else if (value.toString) {
|
|
value = value.toString();
|
|
r2 = value;
|
|
} else {
|
|
r2 = value2;
|
|
}
|
|
r1 = r2;
|
|
} else {
|
|
r1 = value2;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function parseFetchArgs_60345(a0) { // fn#60345, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7658:1936, offset: 0x017019b9, size: 228 bytes, params: 2, frame: 17
|
|
var r2;
|
|
var r1;
|
|
var property;
|
|
var object;
|
|
var value;
|
|
var value3;
|
|
var property2;
|
|
if (a0.length === 0) {
|
|
return {'method': 'GET', 'url': ''};
|
|
}
|
|
if (a0.length === 2) {
|
|
value3 = Module00057Module(a0, 2);
|
|
property = value3[0];
|
|
property2 = value3[1];
|
|
object = {};
|
|
object.url = getUrlFromResource_60344(property);
|
|
value = hasProp_60343(property2, 'method');
|
|
if (value) {
|
|
value = global.String(property2.method);
|
|
value = value.toUpperCase();
|
|
r1 = value;
|
|
} else {
|
|
r1 = 'GET';
|
|
}
|
|
object.method = r1;
|
|
} else {
|
|
property = a0[0];
|
|
object = {};
|
|
object.url = getUrlFromResource_60344(property);
|
|
value = hasProp_60343(property, 'method');
|
|
if (value) {
|
|
value = global.String(property.method);
|
|
value = value.toUpperCase();
|
|
r2 = value;
|
|
} else {
|
|
r2 = 'GET';
|
|
}
|
|
object.method = r2;
|
|
}
|
|
return object;
|
|
}
|
|
|
|
function addFetchEndInstrumentationHandler_60346(a0) { // fn#60346, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7658:2345, offset: 0x01701a9d, size: 76 bytes, params: 2, frame: 17
|
|
(require(7367) /* metro dependency 7367 */).addHandler('fetch-body-resolved', a0);
|
|
(require(7367) /* metro dependency 7367 */).maybeInstrument('fetch-body-resolved', function() {
|
|
instrumentFetch_60324(streamHandler_60340);
|
|
});
|
|
}
|
|
|
|
function addFetchInstrumentationHandler_60348(a0, a1) { // fn#60348, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7658:2557, offset: 0x01701ae9, size: 81 bytes, params: 3, frame: 18
|
|
const env0_0 = a1;
|
|
(require(7367) /* metro dependency 7367 */).addHandler('fetch', a0);
|
|
(require(7367) /* metro dependency 7367 */).maybeInstrument('fetch', function() {
|
|
instrumentFetch_60324(undefined, require);
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun60323, 7480, [57, 5, 7367, 7481, 7375, 7370, 7383,
|
|
7376]) /* metro module 7480, dependencies: [57, 5, 7367, 7481, 7375, 7370, 7383, 7376] */;
|