375 lines
20 KiB
JavaScript
375 lines
20 KiB
JavaScript
/* Metro module 1093; source: unknown; dependencies: [57, 826, 1041, 1080] */
|
|
import * as Module00057Module from './module-00057.js'; /* Metro dependency 57 */
|
|
import * as Module00826Module from './module-00826.js'; /* Metro dependency 826 */
|
|
|
|
function _fun11365(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#11365, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:6, offset: 0x00daa917, size: 170 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const _getResponseSizeFromHeaders = function(a0) {
|
|
var r3;
|
|
if (a0) {
|
|
r3 = a0['Content-Length'] || a0['content-length'];
|
|
if (r3) {
|
|
return (0, global.parseInt)(r3, 10);
|
|
}
|
|
}
|
|
};
|
|
const _parseCookieString = function(a0) {
|
|
return a0.split('; ').reduce(_fun11371, {});
|
|
};
|
|
const Object = global.Object;
|
|
const defineProperty = Object.defineProperty;
|
|
const Symbol = global.Symbol;
|
|
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
|
|
exports.httpClientIntegration = (require(826) /* metro dependency 826 */).defineIntegration(_httpClientIntegration);
|
|
function _parseCookieHeaders(a0, {headers}) { // fn#11366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:2255, offset: 0x00daa9c1, size: 115 bytes, params: 3, frame: 17
|
|
var environment;
|
|
var r5;
|
|
var r3;
|
|
var r1;
|
|
var property;
|
|
var value3;
|
|
var value4;
|
|
var value5;
|
|
var error;
|
|
const value2 = ((a0) => {
|
|
a0.forEach(_fun11368);
|
|
return {};
|
|
})(headers);
|
|
try {
|
|
property = value2[a0];
|
|
if (property) {
|
|
r5 = property;
|
|
} else {
|
|
value3 = a0.toLowerCase();
|
|
property = value2[value3];
|
|
r5 = property;
|
|
}
|
|
r3 = r5 || undefined;
|
|
if (r3) {
|
|
value4 = environment;
|
|
value5 = _parseCookieString(r3);
|
|
r1 = value5;
|
|
} else {
|
|
r1 = undefined;
|
|
}
|
|
} catch (error) {
|
|
r1 = undefined;
|
|
}
|
|
return [value2, r1];
|
|
function _extractFetchHeaders(a0) { // fn#11367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:2297, owner: _parseCookieHeaders._extractFetchHeaders, offset: 0x00daaa34, size: 28 bytes, params: 2, frame: 12
|
|
a0.forEach(_fun11368);
|
|
return {};
|
|
function _fun11368(a0, a1) { // fn#11368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:2357, offset: 0x00daaa50, size: 21 bytes, params: 3, frame: 3
|
|
env0_0[a1] = a0;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _parseCookieString(a0) { // fn#11370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:2610, offset: 0x00daaa98, size: 42 bytes, params: 2, frame: 13
|
|
return a0.split('; ').reduce(_fun11371, {});
|
|
function _fun11371(a0, a1) { // fn#11371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:2670, offset: 0x00daaac2, size: 69 bytes, params: 3, frame: 14
|
|
let value = a1.split('=');
|
|
value = env1_2(value, 2);
|
|
const property = value[0];
|
|
const property2 = value[1];
|
|
if (property && property2) {
|
|
a0[property] = property2;
|
|
}
|
|
return a0;
|
|
}
|
|
|
|
}
|
|
|
|
function _shouldCaptureResponse(a0, a1, a2) { // fn#11372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:2756, offset: 0x00daab07, size: 112 bytes, params: 4, frame: 17
|
|
var isSentryRequestUrl;
|
|
var moduleValue;
|
|
let value = ((a0, a1) => {
|
|
var env0_0 = a1;
|
|
return a0.some(_fun11374);
|
|
})(a0.failedRequestStatusCodes, a1);
|
|
let r0 = value && ((a0, a1) => {
|
|
var env0_0 = a1;
|
|
return a0.some(_fun11376);
|
|
})(a0.failedRequestTargets, a2);
|
|
if (r0) {
|
|
value = require(826) /* metro dependency 826 */;
|
|
isSentryRequestUrl = value.isSentryRequestUrl;
|
|
moduleValue = require(826) /* metro dependency 826 */;
|
|
value = !Reflect.apply(isSentryRequestUrl, value, [a2, moduleValue.getClient()]);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
function _isInGivenStatusRanges(a0, a1) { // fn#11373, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:2802, owner: _shouldCaptureResponse._isInGivenStatusRanges, offset: 0x00daab77, size: 30 bytes, params: 3, frame: 11
|
|
const env0_0 = a1;
|
|
return a0.some(_fun11374);
|
|
function _fun11374(a0) { // fn#11374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:2854, offset: 0x00daab95, size: 64 bytes, params: 2, frame: 4
|
|
return typeof a0 === 'number' ? a0 === require : require >= a0[0] && require <= a0[1];
|
|
}
|
|
|
|
}
|
|
|
|
function _isInGivenRequestTargets(a0, a1) { // fn#11375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:2949, owner: _shouldCaptureResponse._isInGivenRequestTargets, offset: 0x00daabd5, size: 30 bytes, params: 3, frame: 11
|
|
const env0_0 = a1;
|
|
return a0.some(_fun11376);
|
|
function _fun11376(a0) { // fn#11376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:3003, offset: 0x00daabf3, size: 52 bytes, params: 2, frame: 12
|
|
return typeof a0 === 'string' ? require.includes(a0) : a0.test(require);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _createEvent(a0) { // fn#11377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:3146, offset: 0x00daac27, size: 397 bytes, params: 2, frame: 21
|
|
const value2 = undefined;
|
|
const client = (Module00826Module).getClient();
|
|
const stack = client && a0.error && a0.error instanceof global.Error ? a0.error.stack : value2;
|
|
const r10 = stack && client ? client.getOptions().stackParser(stack, 0, 1) : value2;
|
|
const value6 = 'HTTP Client Error with status code: ' + a0.status;
|
|
const object = {message: value6};
|
|
object.exception = {values: [{type: 'Error', value: value6, stacktrace: r10 ? {frames: r10} : value2}]};
|
|
object.request = {url: a0.url, method: a0.method, headers: a0.requestHeaders, cookies: a0.requestCookies};
|
|
const object4 = {};
|
|
object4.status_code = a0.status;
|
|
object4.headers = a0.responseHeaders;
|
|
object4.cookies = a0.responseCookies;
|
|
object4.body_size = _getResponseSizeFromHeaders(a0.responseHeaders);
|
|
object.contexts = {response: object4};
|
|
(Module00826Module).addExceptionMechanism(object, {type: 'auto.http.client.' + a0.type,
|
|
handled: false});
|
|
return object;
|
|
}
|
|
|
|
function _shouldSendDefaultPii() { // fn#11378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:3773, offset: 0x00daadb4, size: 75 bytes, params: 1, frame: 13
|
|
var r0;
|
|
let value = Module00826Module;
|
|
value = value.getClient();
|
|
if (value) {
|
|
value = global.Boolean(value.getOptions().sendDefaultPii);
|
|
r0 = value;
|
|
} else {
|
|
r0 = !!value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _httpClientIntegration() { // fn#11379, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:140, offset: 0x00daadff, size: 130 bytes, params: 1, frame: 16
|
|
const r4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
const Object = global.Object;
|
|
const assign = Object.assign;
|
|
const object = {};
|
|
object.failedRequestStatusCodes = [[500, 599]];
|
|
object.failedRequestTargets = [RegExp('.*', '')];
|
|
const env0_0 = Reflect.apply(assign, Object, [object, r4]);
|
|
return {name: 'HttpClient', setup: setup_11380};
|
|
function _httpClientIntegrationSetup(a0) { // fn#11380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:355, owner: _httpClientIntegration.setup, offset: 0x00daae81, size: 42 bytes, params: 2, frame: 15
|
|
_wrapFetch(a0, env0_0);
|
|
setup_wrapXHR(a0, env0_0);
|
|
function _wrapFetch(a0, a1) { // fn#11381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:374, owner: _httpClientIntegration.setup._wrapFetch, offset: 0x00daaeab, size: 94 bytes, params: 3, frame: 15
|
|
var environment;
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const value = environment.__proto__.__proto__;
|
|
if (Module00826Module.supportsNativeFetch()) {
|
|
Module00826Module.addFetchInstrumentationHandler(_fun11382, false);
|
|
}
|
|
function _fun11382(a0) { // fn#11382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:480, offset: 0x00daaf09, size: 138 bytes, params: 2, frame: 21
|
|
var environment;
|
|
var response;
|
|
var args;
|
|
var error;
|
|
var virtualError;
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
if ((require(826) /* metro dependency 826 */).getClient() === env0_0) {
|
|
response = a0.response;
|
|
args = a0.args;
|
|
error = a0.error;
|
|
virtualError = a0.virtualError;
|
|
value = env3_2(args, 2);
|
|
if (response) {
|
|
_fetchResponseHandler(require, value[0], response, value[1], error || virtualError);
|
|
}
|
|
}
|
|
function _fetchResponseHandler(a0, a1, a2, a3, a4) { // fn#11383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:599, offset: 0x00daaf93, size: 323 bytes, params: 6, frame: 25
|
|
var r9;
|
|
var r4;
|
|
var r5;
|
|
var r6;
|
|
var r7;
|
|
var _parseCookieHeadersBinding;
|
|
var property;
|
|
var property2;
|
|
var property3;
|
|
let value = a1;
|
|
const _shouldCaptureResponseBinding = _shouldCaptureResponse;
|
|
const status = a2.status;
|
|
const url = a2.url;
|
|
const value3 = undefined;
|
|
if (_shouldCaptureResponseBinding(a0, status, url)) {
|
|
r9 = a3 ? value instanceof global.Request && value.bodyUsed ? value : new global.Request(value,
|
|
a3) : value instanceof global.Request || value instanceof global.Request && value.bodyUsed ? value : new global.Request(value,
|
|
|
|
a3);
|
|
if (_shouldSendDefaultPii()) {
|
|
_parseCookieHeadersBinding = _parseCookieHeaders;
|
|
value = _parseCookieHeadersBinding('Cookie', r9);
|
|
value = env4_2(value, 2);
|
|
property = value[0];
|
|
property2 = value[1];
|
|
value = _parseCookieHeadersBinding('Set-Cookie', a2);
|
|
value = env4_2(value, 2);
|
|
property3 = value[0];
|
|
r4 = value[1];
|
|
r5 = property2;
|
|
r6 = property3;
|
|
r7 = property;
|
|
} else {
|
|
r4 = value3;
|
|
r5 = value3;
|
|
r6 = value3;
|
|
r7 = value3;
|
|
}
|
|
value = _createEvent({url: r9.url, method: r9.method, status: a2.status, requestHeaders: r7,
|
|
responseHeaders: r6,
|
|
requestCookies: r5, responseCookies: r4, error: a4, type: 'fetch'});
|
|
(require(826) /* metro dependency 826 */).captureEvent(value);
|
|
}
|
|
return value3;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function setup_wrapXHR(a0, a1) { // fn#11384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:1200, owner: _httpClientIntegration.setup._wrapXHR, offset: 0x00dab0d6, size: 98 bytes, params: 3, frame: 13
|
|
var environment;
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const value = environment.__proto__.__proto__;
|
|
const GLOBAL_OBJ = (Module00826Module).GLOBAL_OBJ;
|
|
if ('XMLHttpRequest' in GLOBAL_OBJ) {
|
|
(require(1041) /* metro dependency 1041 */).addXhrInstrumentationHandler(_fun11385);
|
|
}
|
|
function _fun11385(a0) { // fn#11385, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:1312, offset: 0x00dab138, size: 263 bytes, params: 2, frame: 27
|
|
var r3;
|
|
var error;
|
|
var virtualError;
|
|
var xhr;
|
|
var property;
|
|
var _xhrResponseHandler2;
|
|
var DEBUG_BUILD;
|
|
var debug;
|
|
if ((require(826) /* metro dependency 826 */).getClient() === env0_0) {
|
|
error = a0.error;
|
|
virtualError = a0.virtualError;
|
|
xhr = a0.xhr;
|
|
property = xhr[(require(1041) /* metro dependency 1041 */).SENTRY_XHR_DATA_KEY];
|
|
if (property) {
|
|
try {
|
|
r3 = error || virtualError;
|
|
_xhrResponseHandler2 = _xhrResponseHandler;
|
|
_xhrResponseHandler2(require, xhr, property.method, property.request_headers, r3);
|
|
} catch (error) {
|
|
DEBUG_BUILD = (require(1080) /* metro dependency 1080 */).DEBUG_BUILD;
|
|
if (DEBUG_BUILD) {
|
|
debug = (require(826) /* metro dependency 826 */).debug;
|
|
debug.warn('Error while extracting response event form XHR response', error);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function _xhrResponseHandler(a0, a1, a2, a3, a4) { // fn#11386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:1470, offset: 0x00dab23f, size: 260 bytes, params: 6, frame: 23
|
|
var r9;
|
|
var r8;
|
|
var r4;
|
|
var r5;
|
|
var r6;
|
|
var responseHeader;
|
|
var responseHeader2;
|
|
var value6;
|
|
var error;
|
|
var closure;
|
|
var value7;
|
|
let value = a3;
|
|
const value2 = undefined;
|
|
if (_shouldCaptureResponse(a0, a1.status, a1.responseURL)) {
|
|
if (_shouldSendDefaultPii()) {
|
|
try {
|
|
responseHeader = a1.getResponseHeader('Set-Cookie');
|
|
if (responseHeader) {
|
|
r9 = responseHeader;
|
|
} else {
|
|
responseHeader2 = a1.getResponseHeader('set-cookie');
|
|
r9 = responseHeader2;
|
|
}
|
|
r8 = r9 || value2;
|
|
if (r8) {
|
|
value6 = _parseCookieString(r8);
|
|
r4 = value6;
|
|
} else {
|
|
r4 = value2;
|
|
}
|
|
} catch (error) {
|
|
r4 = value2;
|
|
}
|
|
try {
|
|
closure = function(a0) {
|
|
var value = a0.getAllResponseHeaders();
|
|
if (value) {
|
|
value = value.split('\r\n');
|
|
return value.reduce(_fun11388, {});
|
|
}
|
|
return {};
|
|
};
|
|
value7 = closure(a1);
|
|
r5 = value7;
|
|
} catch (error) {
|
|
r5 = value2;
|
|
}
|
|
r6 = value;
|
|
} else {
|
|
r4 = value2;
|
|
r5 = value2;
|
|
r6 = value2;
|
|
}
|
|
value = _createEvent({url: a1.responseURL, method: a2, status: a1.status, requestHeaders: r6,
|
|
responseHeaders: r5,
|
|
responseCookies: r4, error: a4, type: 'xhr'});
|
|
(require(826) /* metro dependency 826 */).captureEvent(value);
|
|
}
|
|
return value2;
|
|
function _getXHRResponseHeaders(a0) { // fn#11387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:1733, owner: _xhrResponseHandler._getXHRResponseHeaders, offset: 0x00dab343, size: 59 bytes, params: 2, frame: 13
|
|
let value = a0.getAllResponseHeaders();
|
|
if (value) {
|
|
value = value.split('\r\n');
|
|
return value.reduce(_fun11388, {});
|
|
}
|
|
return {};
|
|
function _fun11388(a0, a1) { // fn#11388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1220:1846, offset: 0x00dab37e, size: 71 bytes, params: 3, frame: 14
|
|
let value = a1.split(': ');
|
|
value = env6_2(value, 2);
|
|
const property = value[0];
|
|
const property2 = value[1];
|
|
if (property && property2) {
|
|
a0[property] = property2;
|
|
}
|
|
return a0;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun11365, 1093, [57, 826, 1041, 1080]) /* metro module 1093, dependencies: [57, 826, 1041, 1080] */;
|