/* Metro module 1184; source: unknown; dependencies: [6, 7, 15, 17, 102, 18, 27, 1185, 1005, 1120, 826, 1032, 1009, 1186, 1187, 1136, 823, 1137] */ function _fun13139(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#13139, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:6, offset: 0x00de22ab, size: 223 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_2 = importDefault(6) /* metro dependency 6 */; const env0_3 = importDefault(7) /* metro dependency 7 */; const env0_4 = importDefault(15) /* metro dependency 15 */; const env0_5 = importDefault(17) /* metro dependency 17 */; const env0_6 = importDefault(102) /* metro dependency 102 */; const env0_7 = importDefault(18) /* metro dependency 18 */; (require(27) /* metro dependency 27 */).Alert; const Client = (require(826) /* metro dependency 826 */).Client; exports.ReactNativeClient = _fun13145(Client); } function _isNativeReflectConstruct_13140() { // fn#13140, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:174, offset: 0x00de238a, 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_13140_isNativeReflectConstruct = function() { return !!result; })(); } function _superPropGet_13143(a0, a1, a2, a3) { // fn#13143, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:393, offset: 0x00de23e8, size: 99 bytes, params: 5, frame: 18 let value = a0; const env0_0 = a2; const binding = env0_6; value = env0_5(1 & 3 ? value.prototype : value); value = binding(value, a1, a2); return 2 & 3 ? typeof value !== 'function' ? value : _fun13144 : value; } function _fun13145(a0) { // fn#13145, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:533, offset: 0x00de244b, size: 329 bytes, params: 2, frame: 16 const closure = ReactNativeClient; env0_7(closure, a0); return env0_3(closure, [{key: 'eventFromException', value: value_13150}, {key: 'eventFromMessage', value: value_13151}, {key: 'nativeCrash', value: function() { var NATIVE = require(dependencyMap[12]).NATIVE; NATIVE.nativeCrash(); }}, {key: 'close', value: value_13153}, {key: 'captureUserFeedback', value: value_13156}, {key: 'sendEnvelope', value: value_13157}, {key: 'init', value: value_13159}, {key: 'on', value: value_13160}, {key: 'emit', value: value_13161}, {key: '_initNativeSdk', value: value_13162}, {key: '_showCannotConnectDialog', value: function() { }}, {key: '_attachClientReportTo', value: value_13168}]); } function ReactNativeClient(a0) { // fn#13146, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:545, offset: 0x00de2594, size: 669 bytes, params: 2, frame: 32 const binding = env1_2; const value3 = undefined; binding(this, ReactNativeClient); const moduleValue = require(1185) /* metro dependency 1185 */; const ignoreRequireCycleLogs = moduleValue.ignoreRequireCycleLogs; const ReactNativeLibraries = (require(1005) /* metro dependency 1005 */).ReactNativeLibraries; const ReactNativeVersion = ReactNativeLibraries.ReactNativeVersion; Reflect.apply(ignoreRequireCycleLogs, moduleValue, [ReactNativeVersion === null || value3 === ReactNativeVersion ? value3 : ReactNativeVersion.version]); const Object = global.Object; const assign = Object.assign; const Object2 = global.Object; const assign2 = Object2.assign; let _metadata = a0._metadata; const value4 = Reflect.apply(assign2, Object2, [{}, _metadata]); const Object3 = global.Object; const assign3 = Object3.assign; const Object4 = global.Object; const assign4 = Object4.assign; _metadata = a0._metadata; let sdk = _metadata === null || value3 === _metadata ? value3 : _metadata.sdk; const value5 = Reflect.apply(assign4, Object4, [{}, sdk || (require(1120) /* metro dependency 1120 */).defaultSdkInfo]); const Object5 = global.Object; const assign5 = Object5.assign; _metadata = a0._metadata; sdk = _metadata === null || value3 === _metadata ? value3 : _metadata.sdk; a0._metadata = Reflect.apply(assign, Object, [value4, {sdk: Reflect.apply(assign3, Object3, [value5, {settings: Reflect.apply(assign5, Object5, [{infer_ip: a0.sendDefaultPii ? 'auto' : 'never'}, sdk === null || value3 === sdk ? value3 : sdk.settings])}])}]); a0.parentSpanIsAlwaysRootSpan = value3 === a0.parentSpanIsAlwaysRootSpan || a0.parentSpanIsAlwaysRootSpan; const enableLogs = a0.enableLogs; if (a0.enableLogs && a0.logsOrigin === 'native') { (require(826) /* metro dependency 826 */).debug.log('disabling Sentry logs on JavaScript due to rule set by logsOrigin'); a0.enableLogs = false; } items = [a0]; const value10 = env1_5(ReactNativeClient); const value13 = env1_4(this, _isNativeReflectConstruct_13140() ? global.Reflect.construct(value10, items, env1_5(this).constructor) : value10.apply(this, items)); value13._outcomesBuffer = []; if (a0.sendDefaultPii === true) { value13.on('beforeSendSession', (require(826) /* metro dependency 826 */).addAutoIpAddressToSession); } if (a0.enableLogs) { value13.on('flush', _fun13147); value13.on('afterCaptureLog', _fun13148); } a0.enableLogs = enableLogs; return value13; } function value_13150(a0) { // fn#13150, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:1977, offset: 0x00de28dd, size: 101 bytes, params: 2, frame: 17 const r5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; let value = environment.__proto__; value = require(1032) /* metro dependency 1032 */; return value.eventFromException(this._options.stackParser, a0, r5, this._options.attachStacktrace); } function value_13151(a0, a1, a2) { // fn#13151, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:2202, offset: 0x00de2942, size: 76 bytes, params: 4, frame: 19 let value = environment.__proto__; value = require(1032) /* metro dependency 1032 */; return value.eventFromMessage(this._options.stackParser, a0, a1, a2, this._options.attachStacktrace); } function value_13153() { // fn#13153, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:2435, offset: 0x00de29b9, size: 60 bytes, params: 1, frame: 17 var environment; let value = environment.__proto__; value = _superPropGet_13143(ReactNativeClient, 'close', this, 3); value = value([]); return value.then(_fun13154); } function value_13156(a0) { // fn#13156, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:2637, offset: 0x00de2a38, size: 95 bytes, params: 2, frame: 15 let value = environment.__proto__; const createUserFeedbackEnvelope = (require(1186) /* metro dependency 1186 */).createUserFeedbackEnvelope; const object2 = {}; object2.metadata = this._options._metadata; object2.dsn = this.getDsn(); object2.tunnel = undefined; value = Reflect.apply(createUserFeedbackEnvelope, value, [a0, object2]); this.sendEnvelope(value); } function value_13157(a0) { // fn#13157, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:2831, offset: 0x00de2a97, size: 275 bytes, params: 2, frame: 18 const debug = (require(826) /* metro dependency 826 */).debug; const value = this._clearOutcomes(); const moduleValue = require(1187) /* metro dependency 1187 */; this._outcomesBuffer = moduleValue.mergeOutcomes(this._outcomesBuffer, value); if (this._options.sendClientReports) { this._attachClientReportTo(this._outcomesBuffer, a0); } const env0_0 = true; if (this._isEnabled()) { if (this._transport) { if (this._dsn) { this.emit('beforeEnvelope', a0); this._transport.send(a0).then(null, _fun13158); } else { debug.error('Transport disabled'); } } else { debug.error('Transport disabled'); } } else { debug.error('Transport disabled'); } if (env0_0) { this._outcomesBuffer = []; } const Promise = global.Promise; return Promise.resolve({}); } function value_13159() { // fn#13159, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:3475, offset: 0x00de2c30, size: 58 bytes, params: 1, frame: 17 const value = environment.__proto__; _superPropGet_13143(ReactNativeClient, 'init', this, 3)([]); this._initNativeSdk(); } function value_13160(a0, a1) { // fn#13160, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:3582, offset: 0x00de2c6a, size: 57 bytes, params: 3, frame: 17 const value = environment.__proto__; return _superPropGet_13143(ReactNativeClient, 'on', this, 3)([a0, a1]); } function value_13161(a0) { // fn#13161, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:3678, offset: 0x00de2ca3, size: 141 bytes, params: 2, frame: 19 var r1; var value4; var value7; var value8; let value = arguments.length; const Array = global.Array; const value2 = 1; reducibleJoin2: while (true) { if (value > value2) { value4 = value - value2; r1 = value4; break reducibleJoin2; } r1 = 0; break reducibleJoin2; } const array = new Array(); if (value2 < value) { r1 = value2; reducibleLoop3: while (true) { value7 = r1 - value2; array[value7] = arguments[r1]; value8 = typeof r1 === 'bigint' ? r1 + 1n : +r1 + 1; if (value8 < value) { r1 = value8; continue reducibleLoop3; } break reducibleLoop3; } } value = environment.__proto__; value = _superPropGet_13143(ReactNativeClient, 'emit', this, 3); const items2 = [a0]; value(items2.concat(array)); } function value_13162() { // fn#13162, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:3869, offset: 0x00de2d30, size: 402 bytes, params: 1, frame: 25 var environment; let value = environment.__proto__; const value2 = undefined; const NATIVE = (require(1009) /* metro dependency 1009 */).NATIVE; const initNativeSdk = NATIVE.initNativeSdk; const Object = global.Object; const assign = Object.assign; const Object2 = global.Object; const value3 = Object2.assign({}, this._options); const object2 = {}; object2.defaultSidecarUrl = (require(1136) /* metro dependency 1136 */).getDefaultSidecarUrl(); const devServer = (require(823) /* metro dependency 823 */).getDevServer(); let url = devServer === null || value2 === devServer ? value2 : devServer.url; url = !url ? '' : url; object2.devServerUrl = url; const _integrations = this._integrations; const MOBILE_REPLAY_INTEGRATION_NAME = (require(1137) /* metro dependency 1137 */).MOBILE_REPLAY_INTEGRATION_NAME; object2.mobileReplayOptions = _integrations[MOBILE_REPLAY_INTEGRATION_NAME] && 'options' in this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] ? this._integrations[MOBILE_REPLAY_INTEGRATION_NAME].options : value2; const _experiments = this._options._experiments; object2.androidProfilingOptions = _experiments === null || value2 === _experiments ? value2 : _experiments.androidProfilingOptions; value = Reflect.apply(initNativeSdk, NATIVE, [Reflect.apply(assign, Object, [value3, object2])]); value = value.then(function(a0) { return a0; }, _fun13164); value = value.then(_fun13165); value.then(value2, function(a0) { require(dependencyMap[10]).debug.error('The OnReady callback threw an error: ', a0); }); return value2; } function value_13168(a0, a1) { // fn#13168, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:4878, offset: 0x00de2f63, size: 122 bytes, params: 3, frame: 16 var object2; var value; if (a0.length > 0) { object2 = {}; value = environment.__proto__; value = require(826) /* metro dependency 826 */; object2.timestamp = value.dateTimestampInSeconds(); object2.discarded_events = a0; a1[(require(1186) /* metro dependency 1186 */).items].push([{type: 'client_report'}, object2]); } } function _fun13147() { // fn#13147, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:1632, offset: 0x00de2831, size: 45 bytes, params: 1, frame: 12 const value = environment.__proto__.__proto__; (require(826) /* metro dependency 826 */)._INTERNAL_flushLogsBuffer(env0_0); } function _fun13148() { // fn#13148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:1709, offset: 0x00de285e, size: 82 bytes, params: 1, frame: 14 if (env0_0._logFlushIdleTimeout) { global.clearTimeout(env0_0._logFlushIdleTimeout); } env0_0._logFlushIdleTimeout = global.setTimeout(_fun13149, 5000); } function _fun13154(a0) { // fn#13154, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:2517, offset: 0x00de29f5, size: 67 bytes, params: 2, frame: 12 var environment; const env0_0 = a0; const value = environment.__proto__.__proto__; const NATIVE = (require(1009) /* metro dependency 1009 */).NATIVE; return NATIVE.closeNativeSdk().then(_fun13155); } function _fun13158(a0) { // fn#13158, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:3165, offset: 0x00de2baa, size: 134 bytes, params: 2, frame: 16 const debug = (require(826) /* metro dependency 826 */).debug; const SentryError = (require(826) /* metro dependency 826 */).SentryError; if (a0 instanceof SentryError) { debug.error('SentryError while sending event, keeping outcomes buffer:', a0); } else { debug.error('Error while sending event:', a0); } } function _fun13164() { // fn#13164, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:4490, offset: 0x00de2ec2, size: 23 bytes, params: 1, frame: 9 env0_0._showCannotConnectDialog(); return false; } function _fun13165(a0) { // fn#13165, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:4549, offset: 0x00de2ed9, size: 85 bytes, params: 2, frame: 15 const _options = env0_0._options; const onReady = _options.onReady; if (!(onReady === null || onReady === undefined)) { onReady.call(_options, {didCallNativeInit: a0}); } env0_0.emit('afterInit'); } function _fun13149() { // fn#13149, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1311:1816, offset: 0x00de28b0, size: 45 bytes, params: 1, frame: 12 const value = environment.__proto__.__proto__.__proto__; (require(826) /* metro dependency 826 */)._INTERNAL_flushLogsBuffer(env1_0); }