Files
2026-07-28 01:06:53 +03:00

307 lines
12 KiB
JavaScript

/* Metro module 1077; source: unknown; dependencies: [57, 826, 1043] */
import * as Module00057Module from './module-00057.js'; /* Metro dependency 57 */
import * as Module00826Module from './module-00826.js'; /* Metro dependency 826 */
import * as DEBUG_BUILDModule from './module-01043-DEBUG_BUILD.js'; /* Metro dependency 1043 */
function _fun11257(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#11257, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1204:6, offset: 0x00da6a1e, size: 165 bytes, params: 8, frame: 20
const env0_0 = require;
const closure = function(a0) {
var URLSearchParams = global.URLSearchParams;
return new URLSearchParams(a0).toString();
};
const Object = global.Object;
const defineProperty = Object.defineProperty;
let Symbol = global.Symbol;
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
Symbol = global.Symbol;
exports.ORIGINAL_REQ_BODY = Symbol.for('sentry__originalRequestBody');
exports.getBodyString = getBodyString;
exports.getFetchRequestArgBody = getFetchRequestArgBody;
exports.parseXhrResponseHeaders = parseXhrResponseHeaders;
exports.serializeFormData = closure;
function getBodyString(a0) { // fn#11259, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1204:262, offset: 0x00da6aed, size: 346 bytes, params: 2, frame: 19
var value;
const debug = (Module00826Module).debug;
var URLSearchParams;
var FormData;
var items2;
const DEBUG_BUILD = (DEBUG_BUILDModule).DEBUG_BUILD;
var serializeFormDataBinding;
var toString;
var error;
const r4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : debug;
try {
value = typeof a0 === 'string';
} catch (error) {
value = environment;
if (DEBUG_BUILD) {
r4.error(error, 'Failed to serialize body', a0);
return [undefined, 'BODY_PARSE_ERROR'];
}
return [undefined, 'BODY_PARSE_ERROR'];
}
if (value) {
try {
items2 = [];
} catch (error) {
value = environment;
if (DEBUG_BUILD) {
r4.error(error, 'Failed to serialize body', a0);
return [undefined, 'BODY_PARSE_ERROR'];
}
return [undefined, 'BODY_PARSE_ERROR'];
}
try {
items2[0] = a0;
} catch (error) {
value = environment;
if (DEBUG_BUILD) {
r4.error(error, 'Failed to serialize body', a0);
return [undefined, 'BODY_PARSE_ERROR'];
}
return [undefined, 'BODY_PARSE_ERROR'];
}
} else {
try {
URLSearchParams = global.URLSearchParams;
} catch (error) {
value = environment;
if (DEBUG_BUILD) {
r4.error(error, 'Failed to serialize body', a0);
return [undefined, 'BODY_PARSE_ERROR'];
}
return [undefined, 'BODY_PARSE_ERROR'];
}
try {
value = a0 instanceof URLSearchParams;
} catch (error) {
value = environment;
if (DEBUG_BUILD) {
r4.error(error, 'Failed to serialize body', a0);
return [undefined, 'BODY_PARSE_ERROR'];
}
return [undefined, 'BODY_PARSE_ERROR'];
}
if (value) {
try {
toString = a0.toString;
} catch (error) {
value = environment;
if (DEBUG_BUILD) {
r4.error(error, 'Failed to serialize body', a0);
return [undefined, 'BODY_PARSE_ERROR'];
}
return [undefined, 'BODY_PARSE_ERROR'];
}
try {
value = Reflect.apply(toString, a0, []);
} catch (error) {
value = environment;
if (DEBUG_BUILD) {
r4.error(error, 'Failed to serialize body', a0);
return [undefined, 'BODY_PARSE_ERROR'];
}
return [undefined, 'BODY_PARSE_ERROR'];
}
try {
items2 = [];
} catch (error) {
value = environment;
if (DEBUG_BUILD) {
r4.error(error, 'Failed to serialize body', a0);
return [undefined, 'BODY_PARSE_ERROR'];
}
return [undefined, 'BODY_PARSE_ERROR'];
}
try {
items2[0] = value;
} catch (error) {
value = environment;
if (DEBUG_BUILD) {
r4.error(error, 'Failed to serialize body', a0);
return [undefined, 'BODY_PARSE_ERROR'];
}
return [undefined, 'BODY_PARSE_ERROR'];
}
return items2;
}
try {
FormData = global.FormData;
} catch (error) {
value = environment;
if (DEBUG_BUILD) {
r4.error(error, 'Failed to serialize body', a0);
return [undefined, 'BODY_PARSE_ERROR'];
}
return [undefined, 'BODY_PARSE_ERROR'];
}
try {
value = a0 instanceof FormData;
} catch (error) {
value = environment;
if (DEBUG_BUILD) {
r4.error(error, 'Failed to serialize body', a0);
return [undefined, 'BODY_PARSE_ERROR'];
}
return [undefined, 'BODY_PARSE_ERROR'];
}
if (value) {
try {
serializeFormDataBinding = serializeFormData;
} catch (error) {
value = environment;
if (DEBUG_BUILD) {
r4.error(error, 'Failed to serialize body', a0);
return [undefined, 'BODY_PARSE_ERROR'];
}
return [undefined, 'BODY_PARSE_ERROR'];
}
try {
value = serializeFormDataBinding(a0);
} catch (error) {
value = environment;
if (DEBUG_BUILD) {
r4.error(error, 'Failed to serialize body', a0);
return [undefined, 'BODY_PARSE_ERROR'];
}
return [undefined, 'BODY_PARSE_ERROR'];
}
try {
items2 = [];
} catch (error) {
value = environment;
if (DEBUG_BUILD) {
r4.error(error, 'Failed to serialize body', a0);
return [undefined, 'BODY_PARSE_ERROR'];
}
return [undefined, 'BODY_PARSE_ERROR'];
}
try {
items2[0] = value;
} catch (error) {
value = environment;
if (DEBUG_BUILD) {
r4.error(error, 'Failed to serialize body', a0);
return [undefined, 'BODY_PARSE_ERROR'];
}
return [undefined, 'BODY_PARSE_ERROR'];
}
return items2;
}
if (a0) {
if (DEBUG_BUILD) {
r4.log('Skipping network body because of body type', a0);
}
return [undefined, 'UNPARSEABLE_BODY_TYPE'];
}
try {
items2 = [];
} catch (error) {
value = environment;
if (DEBUG_BUILD) {
r4.error(error, 'Failed to serialize body', a0);
return [undefined, 'BODY_PARSE_ERROR'];
}
return [undefined, 'BODY_PARSE_ERROR'];
}
try {
items2[0] = undefined;
} catch (error) {
value = environment;
if (DEBUG_BUILD) {
r4.error(error, 'Failed to serialize body', a0);
return [undefined, 'BODY_PARSE_ERROR'];
}
return [undefined, 'BODY_PARSE_ERROR'];
}
}
return items2;
}
function getFetchRequestArgBody() { // fn#11260, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1204:773, offset: 0x00da6c47, size: 153 bytes, params: 1, frame: 6
var property;
const value = undefined;
const r1 = arguments.length > 0 && value !== arguments[0] ? arguments[0] : [];
if (r1.length >= 2) {
if (r1[1]) {
if (typeof r1[1] !== 'object') {
if (r1.length >= 1) {
property = r1[0];
if (property instanceof global.Request) {
property = r1[0];
property = property[env0_3];
return value === property ? value : property;
}
return value;
}
return value;
}
if ('body' in r1[1]) {
return r1[1].body;
}
if (r1.length >= 1) {
property = r1[0];
if (property instanceof global.Request) {
property = r1[0];
property = property[env0_3];
return value === property ? value : property;
}
return value;
}
return value;
}
}
if (r1.length >= 1) {
property = r1[0];
if (property instanceof global.Request) {
property = r1[0];
property = property[env0_3];
return value === property ? value : property;
}
}
return value;
}
function parseXhrResponseHeaders(a0) { // fn#11261, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1204:1056, offset: 0x00da6ce0, size: 160 bytes, params: 2, frame: 18
var environment;
var r2;
var value;
var error;
var DEBUG_BUILD;
var debug;
try {
value = a0.getAllResponseHeaders();
} catch (error) {
value = environment;
DEBUG_BUILD = (require(1043) /* metro dependency 1043 */).DEBUG_BUILD;
if (DEBUG_BUILD) {
debug = (require(826) /* metro dependency 826 */).debug;
debug.error(error, 'Failed to get xhr response headers', a0);
}
return {};
}
if (value) {
value = value.split('\r\n');
value = value.reduce(_fun11262, {});
r2 = value;
} else {
r2 = {};
}
return r2;
function _fun11262(a0, a1) { // fn#11262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1204:1265, offset: 0x00da6d80, size: 72 bytes, params: 3, frame: 14
let value = a1.split(': ');
value = env1_2(value, 2);
const property = value[0];
const property2 = value[1];
if (property2) {
a0[property.toLowerCase()] = property2;
}
return a0;
}
}
}
global.__d(_fun11257, 1077, [57, 826, 1043]) /* metro module 1077, dependencies: [57, 826, 1043] */;