/* Metro module 852; source: unknown; dependencies: [77, 65, 6, 7, 838, 840, 853, 854, 836, 847, 841, 855, 839, 832, 833] */ function _fun9196(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#9196, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:979:6, offset: 0x00d5f9f7, size: 145 bytes, params: 8, frame: 18 const env0_0 = require; const env0_2 = require(77) /* metro dependency 77 */; const env0_3 = require(65) /* metro dependency 65 */; const env0_4 = require(6) /* metro dependency 6 */; const env0_5 = require(7) /* metro dependency 7 */; const Object = global.Object; const defineProperty = Object.defineProperty; const Symbol = global.Symbol; Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]); exports.Scope = _fun9197(); } function _fun9197() { // fn#9197, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:979:141, offset: 0x00d5fa88, size: 895 bytes, params: 1, frame: 15 return env0_5(Scope_9198, [{key: 'clone', value: value_9199}, {key: 'setClient', value: function(a0) { this._client = a0; }}, {key: 'setLastEventId', value: function(a0) { this._lastEventId = a0; }}, {key: 'getClient', value: function() { return this._client; }}, {key: 'lastEventId', value: function() { return this._lastEventId; }}, {key: 'addScopeListener', value: function(a0) { this._scopeListeners.push(a0); }}, {key: 'addEventProcessor', value: function(a0) { this._eventProcessors.push(a0); return this; }}, {key: 'setUser', value: value_9206}, {key: 'getUser', value: function() { return this._user; }}, {key: 'setTags', value: function(a0) { var Object = global.Object; this._tags = Object.assign({}, this._tags, a0); this._notifyScopeListeners(); return this; }}, {key: 'setTag', value: value_9209}, {key: 'setAttributes', value: function(a0) { var Object = global.Object; this._attributes = Object.assign({}, this._attributes, a0); this._notifyScopeListeners(); return this; }}, {key: 'setAttribute', value: value_9211}, {key: 'removeAttribute', value: function(a0) { if (a0 in this._attributes) { delete this._attributes[a0]; this._notifyScopeListeners(); } return this; }}, {key: 'setExtras', value: function(a0) { var Object = global.Object; this._extra = Object.assign({}, this._extra, a0); this._notifyScopeListeners(); return this; }}, {key: 'setExtra', value: value_9214}, {key: 'setFingerprint', value: function(a0) { this._fingerprint = a0; this._notifyScopeListeners(); return this; }}, {key: 'setLevel', value: function(a0) { this._level = a0; this._notifyScopeListeners(); return this; }}, {key: 'setTransactionName', value: function(a0) { this._transactionName = a0; this._notifyScopeListeners(); return this; }}, {key: 'setContext', value: function(a0, a1) { if (a1 === null) { delete this._contexts[a0]; } else { this._contexts[a0] = a1; } this._notifyScopeListeners(); return this; }}, {key: 'setSession', value: function(a0) { if (a0) { this._session = a0; } else { delete this._session; } this._notifyScopeListeners(); return this; }}, {key: 'getSession', value: function() { return this._session; }}, {key: 'update', value: value_9221}, {key: 'clear', value: value_9222}, {key: 'addBreadcrumb', value: value_9223}, {key: 'getLastBreadcrumb', value: function() { return this._breadcrumbs[this._breadcrumbs.length - 1]; }}, {key: 'clearBreadcrumbs', value: function() { this._breadcrumbs = []; this._notifyScopeListeners(); return this; }}, {key: 'addAttachment', value: function(a0) { this._attachments.push(a0); return this; }}, {key: 'clearAttachments', value: function() { this._attachments = []; return this; }}, {key: 'getScopeData', value: value_9228}, {key: 'setSDKProcessingMetadata', value: value_9229}, {key: 'setPropagationContext', value: function(a0) { this._propagationContext = a0; return this; }}, {key: 'getPropagationContext', value: function() { return this._propagationContext; }}, {key: 'captureException', value: value_9232}, {key: 'captureMessage', value: value_9233}, {key: 'captureEvent', value: value_9234}, {key: '_notifyScopeListeners', value: function() { var env0_0 = this; if (!this._notifyingListeners) { this._notifyingListeners = true; this._scopeListeners.forEach(_fun9236); this._notifyingListeners = false; } }}]); } function Scope_9198() { // fn#9198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:979:165, offset: 0x00d5fe07, size: 193 bytes, params: 1, frame: 16 const value = environment.__proto__; env1_4(this, Scope_9198); this._notifyingListeners = false; this._scopeListeners = []; this._eventProcessors = []; this._breadcrumbs = []; this._attachments = []; this._user = {}; this._tags = {}; this._attributes = {}; this._extra = {}; this._contexts = {}; this._sdkProcessingMetadata = {}; const object2 = {}; object2.traceId = (require(838) /* metro dependency 838 */).generateTraceId(); object2.sampleRand = (require(840) /* metro dependency 840 */).safeMathRandom(); this._propagationContext = object2; } function value_9199() { // fn#9199, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:979:559, offset: 0x00d5fec8, size: 477 bytes, params: 1, frame: 18 var object2; const scope_9198 = new Scope_9198(); let binding = env1_3; scope_9198._breadcrumbs = binding(this._breadcrumbs); let Object = global.Object; let assign = Object.assign; scope_9198._tags = Reflect.apply(assign, Object, [{}, this._tags]); Object = global.Object; scope_9198._attributes = Object.assign({}, this._attributes); Object = global.Object; scope_9198._extra = Object.assign({}, this._extra); Object = global.Object; assign = Object.assign; let _contexts = this._contexts; scope_9198._contexts = Reflect.apply(assign, Object, [{}, _contexts]); if (this._contexts.flags) { _contexts = scope_9198._contexts; object2 = {}; object2.values = env1_3(this._contexts.flags.values); _contexts.flags = object2; } scope_9198._user = this._user; scope_9198._level = this._level; scope_9198._session = this._session; scope_9198._transactionName = this._transactionName; scope_9198._fingerprint = this._fingerprint; binding = env1_3; scope_9198._eventProcessors = binding(this._eventProcessors); scope_9198._attachments = binding(this._attachments); Object = global.Object; scope_9198._sdkProcessingMetadata = Object.assign({}, this._sdkProcessingMetadata); Object = global.Object; scope_9198._propagationContext = Object.assign({}, this._propagationContext); scope_9198._client = this._client; scope_9198._lastEventId = this._lastEventId; const moduleValue = require(853) /* metro dependency 853 */; const _setSpanForScope = moduleValue._setSpanForScope; const moduleValue2 = moduleValue; Reflect.apply(_setSpanForScope, moduleValue, [scope_9198, moduleValue2._getSpanForScope(this)]); return scope_9198; } function value_9209(a0, a1) { // fn#9209, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:979:2260, offset: 0x00d601b3, size: 40 bytes, params: 3, frame: 17 return this.setTags(env1_2({}, a0, a1)); } function value_9211(a0, a1) { // fn#9211, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:979:2490, offset: 0x00d6020f, size: 40 bytes, params: 3, frame: 17 return this.setAttributes(env1_2({}, a0, a1)); } function value_9214(a0, a1) { // fn#9214, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:979:2862, offset: 0x00d60294, size: 73 bytes, params: 3, frame: 19 const Object = global.Object; const assign = Object.assign; const _extra = this._extra; const value = environment.__proto__; this._extra = Reflect.apply(assign, Object, [{}, _extra, env1_2({}, a0, a1)]); this._notifyScopeListeners(); return this; } function value_9221(a0) { // fn#9221, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:979:3692, offset: 0x00d60383, size: 362 bytes, params: 2, frame: 24 var r3; var r1; var r2; var value4; var value5; var moduleValue; var tags; var attributes; var extra; var user; var contexts; var level; var fingerprint; var propagationContext; var Object; var assign; const value = a0; if (value) { r3 = typeof value !== 'function' ? value : value(this); if (r3 instanceof Scope_9198) { r1 = r3.getScopeData(); } else { value4 = environment.__proto__; value5 = undefined; moduleValue = require(836) /* metro dependency 836 */; r1 = moduleValue.isPlainObject(r3) ? value : value5; } r1 = !r1 ? {} : r1; tags = r1.tags; attributes = r1.attributes; extra = r1.extra; user = r1.user; contexts = r1.contexts; level = r1.level; fingerprint = r1.fingerprint; r2 = fingerprint !== undefined ? fingerprint : []; propagationContext = r1.propagationContext; Object = global.Object; assign = Object.assign; this._tags = Reflect.apply(assign, Object, [{}, this._tags, tags]); Object = global.Object; assign = Object.assign; this._attributes = Reflect.apply(assign, Object, [{}, this._attributes, attributes]); Object = global.Object; assign = Object.assign; this._extra = Reflect.apply(assign, Object, [{}, this._extra, extra]); Object = global.Object; assign = Object.assign; this._contexts = Reflect.apply(assign, Object, [{}, this._contexts, contexts]); if (user && global.Object.keys(user).length) { this._user = user; } if (level) { this._level = level; } if (r2.length) { this._fingerprint = r2; } if (propagationContext) { this._propagationContext = propagationContext; } } return this; } function value_9222() { // fn#9222, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:979:4314, offset: 0x00d604ed, size: 203 bytes, params: 1, frame: 17 this._breadcrumbs = []; this._tags = {}; this._attributes = {}; this._extra = {}; this._user = {}; this._contexts = {}; this._level = undefined; this._transactionName = undefined; this._fingerprint = undefined; this._session = undefined; const value = environment.__proto__; (require(853) /* metro dependency 853 */)._setSpanForScope(this, undefined); this._attachments = []; const setPropagationContext = this.setPropagationContext; const object2 = {}; object2.traceId = (require(838) /* metro dependency 838 */).generateTraceId(); object2.sampleRand = (require(840) /* metro dependency 840 */).safeMathRandom(); Reflect.apply(setPropagationContext, this, [object2]); this._notifyScopeListeners(); return this; } function value_9223(a0, a1) { // fn#9223, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:979:4756, offset: 0x00d605b8, size: 267 bytes, params: 3, frame: 22 var r7; var _client; let value = a1; const r1 = typeof value !== 'number' ? 100 : value; if (!(r1 <= 0)) { var Object = global.Object; var assign = Object.assign; var object2 = {}; value = environment.__proto__; object2.timestamp = (require(847) /* metro dependency 847 */).dateTimestampInSeconds(); if (a0.message) { value = require(841) /* metro dependency 841 */; value = value.truncate(a0.message, 2048); r7 = value; } else { r7 = a0.message; } value = Reflect.apply(assign, Object, [object2, a0, {message: r7}]); var _breadcrumbs = this._breadcrumbs; _breadcrumbs.push(value); _breadcrumbs = this._breadcrumbs; if (_breadcrumbs.length > r1) { _breadcrumbs = this._breadcrumbs; this._breadcrumbs = _breadcrumbs.slice(-r1); _client = this._client; if (_client != null) { _client.recordDroppedEvent('buffer_overflow', 'log_item'); } } this._notifyScopeListeners(); } return this; } function value_9228() { // fn#9228, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:979:5640, offset: 0x00d60724, size: 197 bytes, params: 1, frame: 13 const object2 = {}; object2.breadcrumbs = this._breadcrumbs; object2.attachments = this._attachments; object2.contexts = this._contexts; object2.tags = this._tags; object2.attributes = this._attributes; object2.extra = this._extra; object2.user = this._user; object2.level = this._level; object2.fingerprint = this._fingerprint || []; object2.eventProcessors = this._eventProcessors; object2.propagationContext = this._propagationContext; object2.sdkProcessingMetadata = this._sdkProcessingMetadata; object2.transactionName = this._transactionName; const value = environment.__proto__; object2.span = (require(853) /* metro dependency 853 */)._getSpanForScope(this); return object2; } function value_9229(a0) { // fn#9229, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:979:6132, offset: 0x00d607e9, size: 61 bytes, params: 2, frame: 16 let value = environment.__proto__; value = require(855) /* metro dependency 855 */; this._sdkProcessingMetadata = value.merge(this._sdkProcessingMetadata, a0, 2); return this; } function value_9232(a0, a1) { // fn#9232, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:979:6501, offset: 0x00d6083f, size: 241 bytes, params: 3, frame: 21 var error; var captureException; var Object; const r0 = a1?.event_id || (require(839) /* metro dependency 839 */).uuid4(); let _client = this._client; if (_client) { error = new global.Error('Sentry syntheticException'); _client = this._client; captureException = _client.captureException; Object = global.Object; Reflect.apply(captureException, _client, [a0, Object.assign({originalException: a0, syntheticException: error}, a1, {event_id: r0}), this]); } else if ((require(832) /* metro dependency 832 */).DEBUG_BUILD) { (require(833) /* metro dependency 833 */).debug.warn('No client configured on scope - will not capture exception!'); } return r0; } function value_9233(a0, a1, a2) { // fn#9233, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:979:6910, offset: 0x00d60930, size: 268 bytes, params: 4, frame: 22 var r1; var captureMessage; var Object; let value = undefined; const r0 = (a2 == null ? value : a2.event_id) || (require(839) /* metro dependency 839 */).uuid4(); let _client = this._client; if (_client) { r1 = (a2 == null ? value : a2.syntheticException) ?? new global.Error(a0); _client = this._client; captureMessage = _client.captureMessage; Object = global.Object; value = Object.assign({originalException: a0, syntheticException: r1}, a2, {event_id: r0}); Reflect.apply(captureMessage, _client, [a0, a1, value, this]); } else if ((require(832) /* metro dependency 832 */).DEBUG_BUILD) { (require(833) /* metro dependency 833 */).debug.warn('No client configured on scope - will not capture message!'); } return r0; } function value_9234(a0, a1) { // fn#9234, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:979:7339, offset: 0x00d60a3c, size: 199 bytes, params: 3, frame: 19 var value4; var captureEvent; var Object; const r0 = a1?.event_id || (require(839) /* metro dependency 839 */).uuid4(); let _client = this._client; if (_client) { _client = this._client; captureEvent = _client.captureEvent; Object = global.Object; Reflect.apply(captureEvent, _client, [a0, Object.assign({}, a1, {event_id: r0}), this]); } else { value4 = environment.__proto__; if ((require(832) /* metro dependency 832 */).DEBUG_BUILD) { (require(833) /* metro dependency 833 */).debug.warn('No client configured on scope - will not capture event!'); } } return r0; } function value_9235() { // fn#9235, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:979:7651, offset: 0x00d60b03, size: 59 bytes, params: 1, frame: 12 if (!this._notifyingListeners) { this._notifyingListeners = true; this._scopeListeners.forEach(_fun9236); this._notifyingListeners = false; } }