362 lines
16 KiB
React
362 lines
16 KiB
React
/* Metro module 861; source: unknown; dependencies: [65, 862, 857, 863, 864, 865, 828, 847, 867, 853, 848, 849, 833, 832, 868, 874] */
|
|
function _fun9275(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#9275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:988:6, offset: 0x00d61b78, size: 133 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const env0_2 = require(65) /* metro dependency 65 */;
|
|
const env0_3 = require(862) /* metro dependency 862 */;
|
|
const Object = global.Object;
|
|
const defineProperty = Object.defineProperty;
|
|
const Symbol = global.Symbol;
|
|
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
|
|
exports.TRACING_DEFAULTS = {'idleTimeout': 1000, 'finalTimeout': 30000, 'childSpanTimeout': 15000};
|
|
exports.startIdleSpan = startIdleSpan;
|
|
}
|
|
|
|
function startIdleSpan(a0) { // fn#9276, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:988:215, offset: 0x00d61bfd, size: 823 bytes, params: 2, frame: 27
|
|
var moduleValue2;
|
|
const SentryNonRecordingSpan = (require(864) /* metro dependency 864 */).SentryNonRecordingSpan;
|
|
var value5;
|
|
var moduleValue8;
|
|
var _setSpanForScope;
|
|
var moduleValue9;
|
|
var Proxy;
|
|
var end;
|
|
var object2;
|
|
var push;
|
|
var on;
|
|
const closure = function(a0) {
|
|
var env0_0 = a0;
|
|
startIdleSpan_cancelIdleTimeout();
|
|
env0_0 = global.setTimeout(_fun9279, idleTimeout);
|
|
};
|
|
const startIdleSpan_restartChildSpanTimeout = function(a0) {
|
|
var env0_0 = a0;
|
|
env0_0 = global.setTimeout(_fun9281, childSpanTimeout);
|
|
};
|
|
const r6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
const Map = global.Map;
|
|
const map = new Map();
|
|
const result = !r6.disableAutoFinish;
|
|
const items = [];
|
|
let idleTimeout = r6.idleTimeout;
|
|
if (idleTimeout === undefined) {
|
|
idleTimeout = env0_4.idleTimeout;
|
|
}
|
|
let finalTimeout = r6.finalTimeout;
|
|
finalTimeout = finalTimeout === undefined ? env0_4.finalTimeout : finalTimeout;
|
|
let childSpanTimeout = r6.childSpanTimeout;
|
|
if (childSpanTimeout === undefined) {
|
|
childSpanTimeout = env0_4.childSpanTimeout;
|
|
}
|
|
const env0_9 = r6.beforeSpanEnd;
|
|
const trimIdleSpanEndTimestamp = r6.trimIdleSpanEndTimestamp;
|
|
const env0_10 = trimIdleSpanEndTimestamp === undefined || trimIdleSpanEndTimestamp;
|
|
const client = (require(857) /* metro dependency 857 */).getClient();
|
|
if (client) {
|
|
moduleValue2 = require(863) /* metro dependency 863 */;
|
|
if (moduleValue2.hasSpansEnabled()) {
|
|
var env0_12 = (require(857) /* metro dependency 857 */).getCurrentScope();
|
|
var env0_13 = (require(828) /* metro dependency 828 */).getActiveSpan();
|
|
value5 = (require(874) /* metro dependency 874 */).startInactiveSpan(a0);
|
|
moduleValue8 = require(853) /* metro dependency 853 */;
|
|
_setSpanForScope = moduleValue8._setSpanForScope;
|
|
moduleValue9 = require(857) /* metro dependency 857 */;
|
|
Reflect.apply(_setSpanForScope, moduleValue8, [moduleValue9.getCurrentScope(), value5]);
|
|
if ((require(832) /* metro dependency 832 */).DEBUG_BUILD) {
|
|
(require(833) /* metro dependency 833 */).debug.log('[Tracing] Started span is an idle span');
|
|
}
|
|
Proxy = global.Proxy;
|
|
end = value5.end;
|
|
object2 = {apply: apply_9286};
|
|
value5.end = new Proxy();
|
|
push = items.push;
|
|
on = client.on;
|
|
Reflect.apply(push, items, [Reflect.apply(on, client, ['spanStart', _fun9289])]);
|
|
push = items.push;
|
|
on = client.on;
|
|
Reflect.apply(push, items, [Reflect.apply(on, client, ['spanEnd', _fun9290])]);
|
|
push = items.push;
|
|
on = client.on;
|
|
Reflect.apply(push, items, [Reflect.apply(on, client, ['idleSpanEnableAutoFinish', _fun9291])]);
|
|
if (!r6.disableAutoFinish) {
|
|
closure();
|
|
}
|
|
global.setTimeout(_fun9292, finalTimeout);
|
|
return value5;
|
|
}
|
|
}
|
|
const sentryNonRecordingSpan = new SentryNonRecordingSpan();
|
|
const Object = global.Object;
|
|
(require(865) /* metro dependency 865 */).freezeDscOnSpan(sentryNonRecordingSpan, Object.assign({'sample_rate': '0',
|
|
'sampled': 'false'},
|
|
(require(865) /* metro dependency 865 */).getDynamicSamplingContextFromSpan(sentryNonRecordingSpan)));
|
|
return sentryNonRecordingSpan;
|
|
}
|
|
|
|
function startIdleSpan_restartIdleTimeout(a0) { // fn#9278, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:988:1145, owner: startIdleSpan._restartIdleTimeout, offset: 0x00d61f59, size: 51 bytes, params: 2, frame: 14
|
|
let env0_0 = a0;
|
|
startIdleSpan_cancelIdleTimeout();
|
|
env0_0 = global.setTimeout(_fun9279, idleTimeout);
|
|
}
|
|
|
|
function startIdleSpan_restartChildSpanTimeout(a0) { // fn#9280, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:988:1274, owner: startIdleSpan._restartChildSpanTimeout, offset: 0x00d61fd3, size: 43 bytes, params: 2, frame: 14
|
|
let env0_0 = a0;
|
|
env0_0 = global.setTimeout(_fun9281, childSpanTimeout);
|
|
}
|
|
|
|
function startIdleSpanOnIdleSpanEnded(a0) { // fn#9282, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:988:1379, owner: startIdleSpan.onIdleSpanEnded, offset: 0x00d62035, size: 454 bytes, params: 2, frame: 21
|
|
const SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = (require(848) /* metro dependency 848 */).SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON;
|
|
var status;
|
|
var setStatus;
|
|
var object2;
|
|
var debug;
|
|
var value6;
|
|
const env0_0 = a0;
|
|
let binding = env0_1;
|
|
binding.clear();
|
|
env0_5.forEach(function(a0) {
|
|
return a0();
|
|
});
|
|
const moduleValue = require(853) /* metro dependency 853 */;
|
|
moduleValue._setSpanForScope(env0_12, env0_13);
|
|
const value3 = (require(828) /* metro dependency 828 */).spanToJSON(env0_14);
|
|
if (value3.start_timestamp) {
|
|
if (!value3.data[SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON]) {
|
|
env0_14.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, env0_3);
|
|
}
|
|
status = value3.status;
|
|
if (!(status && status !== 'unknown')) {
|
|
binding = env0_14;
|
|
setStatus = binding.setStatus;
|
|
object2 = {};
|
|
object2.code = (require(849) /* metro dependency 849 */).SPAN_STATUS_OK;
|
|
Reflect.apply(setStatus, binding, [object2]);
|
|
}
|
|
debug = (require(833) /* metro dependency 833 */).debug;
|
|
debug.log('[Tracing] Idle span "' + value3.op + '" finished');
|
|
value6 = (require(828) /* metro dependency 828 */).getSpanDescendants(env0_14).filter(_fun9284);
|
|
var env0_1 = 0;
|
|
value6.forEach(_fun9285);
|
|
if (env0_1 > 0) {
|
|
env0_14.setAttribute('sentry.idle_span_discarded_spans', env0_1);
|
|
}
|
|
}
|
|
}
|
|
|
|
function startIdleSpanApply(a0, a1, a2) { // fn#9286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:988:2661, owner: startIdleSpan.apply, offset: 0x00d623fa, size: 527 bytes, params: 4, frame: 29
|
|
var r15;
|
|
var r7;
|
|
var start_timestamp;
|
|
var Reflect;
|
|
var apply;
|
|
var items2;
|
|
var binding;
|
|
var ignoreSpans;
|
|
var Math;
|
|
var min;
|
|
var value12;
|
|
var Math2;
|
|
var max;
|
|
var Math3;
|
|
var min2;
|
|
var value15;
|
|
if (beforeSpanEnd) {
|
|
beforeSpanEnd(env0_14);
|
|
}
|
|
const value3 = undefined;
|
|
const SentryNonRecordingSpan = (require(864) /* metro dependency 864 */).SentryNonRecordingSpan;
|
|
if (a1 instanceof SentryNonRecordingSpan) {
|
|
return value3;
|
|
}
|
|
const value4 = env1_3(a2);
|
|
const property = value4[0];
|
|
const value5 = value4.slice(1);
|
|
const value7 = (require(828) /* metro dependency 828 */).spanTimeInputToSeconds(property || (require(847) /* metro dependency 847 */).timestampInSeconds());
|
|
const value9 = (require(828) /* metro dependency 828 */).getSpanDescendants(env0_14).filter(_fun9287);
|
|
if (value9.length) {
|
|
if (env0_10) {
|
|
binding = env0_11;
|
|
ignoreSpans = binding.getOptions().ignoreSpans;
|
|
r15 = value9 == null ? value3 : value9.reduce(_fun9288, value3);
|
|
start_timestamp = (require(828) /* metro dependency 828 */).spanToJSON(env0_14).start_timestamp;
|
|
Math = global.Math;
|
|
min = Math.min;
|
|
value12 = Infinity;
|
|
r7 = start_timestamp ? start_timestamp + finalTimeout / 1000 : value12;
|
|
Math2 = global.Math;
|
|
max = Math2.max;
|
|
start_timestamp = !start_timestamp ? -Infinity : start_timestamp;
|
|
Math3 = global.Math;
|
|
min2 = Math3.min;
|
|
r15 = !r15 ? value12 : r15;
|
|
value15 = Reflect.apply(min, Math, [r7, Reflect.apply(max, Math2, [start_timestamp, Reflect.apply(min2,
|
|
Math3,
|
|
[value7, r15])])]);
|
|
startIdleSpanOnIdleSpanEnded(value15);
|
|
Reflect = global.Reflect;
|
|
apply = Reflect.apply;
|
|
items2 = [value15];
|
|
return Reflect.apply(apply, Reflect, [a0, a1, items2.concat(env1_2(value5))]);
|
|
}
|
|
}
|
|
startIdleSpanOnIdleSpanEnded(value7);
|
|
Reflect = global.Reflect;
|
|
apply = Reflect.apply;
|
|
items2 = [value7];
|
|
return Reflect.apply(apply, Reflect, [a0, a1, items2.concat(env1_2(value5))]);
|
|
}
|
|
|
|
function _fun9289(a0) { // fn#9289, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:988:3394, offset: 0x00d6269f, size: 281 bytes, params: 2, frame: 16
|
|
var value3;
|
|
var moduleValue;
|
|
var value6;
|
|
var spanDescendants;
|
|
var spanId;
|
|
let r1 = env0_2 || a0 === env0_14;
|
|
if (!r1) {
|
|
value3 = environment.__proto__;
|
|
moduleValue = require(828) /* metro dependency 828 */;
|
|
r1 = moduleValue.spanToJSON(a0).timestamp;
|
|
}
|
|
r1 = !r1 ? a0 instanceof (require(868) /* metro dependency 868 */).SentrySpan && a0.isStandaloneSpan() : r1;
|
|
if (!r1) {
|
|
value6 = environment.__proto__;
|
|
spanDescendants = (require(828) /* metro dependency 828 */).getSpanDescendants(env0_14);
|
|
if (spanDescendants.includes(a0)) {
|
|
spanId = a0.spanContext().spanId;
|
|
startIdleSpan_cancelIdleTimeout();
|
|
env0_1.set(spanId, true);
|
|
startIdleSpan_restartChildSpanTimeout((require(847) /* metro dependency 847 */).timestampInSeconds() + childSpanTimeout / 1000);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun9290(a0) { // fn#9290, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:988:3720, offset: 0x00d627b8, size: 144 bytes, params: 2, frame: 13
|
|
var spanId;
|
|
var binding;
|
|
var startIdleSpan_restartIdleTimeoutBinding;
|
|
var value2;
|
|
if (!env0_2) {
|
|
spanId = a0.spanContext().spanId;
|
|
binding = env0_1;
|
|
if (binding.has(spanId)) {
|
|
env0_1.delete(spanId);
|
|
}
|
|
if (env0_1.size === 0) {
|
|
startIdleSpan_restartIdleTimeoutBinding = startIdleSpan_restartIdleTimeout;
|
|
value2 = environment.__proto__;
|
|
startIdleSpan_restartIdleTimeoutBinding((require(847) /* metro dependency 847 */).timestampInSeconds() + idleTimeout / 1000);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun9291(a0) { // fn#9291, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:988:3919, offset: 0x00d62848, size: 54 bytes, params: 2, frame: 10
|
|
if (a0 === env0_14) {
|
|
startIdleSpan_restartIdleTimeout();
|
|
if (env0_1.size) {
|
|
startIdleSpan_restartChildSpanTimeout();
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun9292() { // fn#9292, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:988:4061, offset: 0x00d6287e, size: 97 bytes, params: 1, frame: 15
|
|
var binding;
|
|
var setStatus;
|
|
var object2;
|
|
var value2;
|
|
if (!env0_2) {
|
|
binding = env0_14;
|
|
setStatus = binding.setStatus;
|
|
object2 = {};
|
|
value2 = environment.__proto__;
|
|
object2.code = (require(849) /* metro dependency 849 */).SPAN_STATUS_ERROR;
|
|
object2.message = 'deadline_exceeded';
|
|
Reflect.apply(setStatus, binding, [object2]);
|
|
binding = env0_14;
|
|
binding.end();
|
|
}
|
|
}
|
|
|
|
function _fun9279() { // fn#9279, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:988:1212, offset: 0x00d61f8c, size: 71 bytes, params: 1, frame: 12
|
|
if (!env1_2 && env1_1.size === 0 && result) {
|
|
env1_14.end(env0_0);
|
|
}
|
|
}
|
|
|
|
function _fun9281() { // fn#9281, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:988:1325, offset: 0x00d61ffe, size: 55 bytes, params: 1, frame: 11
|
|
if (!env1_2 && result) {
|
|
env1_14.end(env0_0);
|
|
}
|
|
}
|
|
|
|
function _fun9284(a0) { // fn#9284, offset: 0x00d621fb, size: 16 bytes, params: 2, frame: 2
|
|
return a0 !== env1_14;
|
|
}
|
|
|
|
function _fun9285(a0) { // fn#9285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:988:1909, offset: 0x00d6220b, size: 495 bytes, params: 2, frame: 22
|
|
var setStatus;
|
|
var object2;
|
|
var value;
|
|
const DEBUG_BUILD = (require(832) /* metro dependency 832 */).DEBUG_BUILD;
|
|
const debug = (require(833) /* metro dependency 833 */).debug;
|
|
var value10;
|
|
var binding;
|
|
if (a0.isRecording()) {
|
|
setStatus = a0.setStatus;
|
|
object2 = {};
|
|
value = environment.__proto__.__proto__;
|
|
object2.code = (require(849) /* metro dependency 849 */).SPAN_STATUS_ERROR;
|
|
object2.message = 'cancelled';
|
|
Reflect.apply(setStatus, a0, [object2]);
|
|
a0.end(env0_0);
|
|
if (DEBUG_BUILD) {
|
|
debug.log('[Tracing] Cancelling span since span ended early', global.JSON.stringify(a0, undefined, 2));
|
|
}
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
const value3 = (require(828) /* metro dependency 828 */).spanToJSON(a0);
|
|
const timestamp = value3.timestamp;
|
|
const value4 = 0;
|
|
const r1 = timestamp === undefined ? value4 : timestamp;
|
|
const start_timestamp = value3.start_timestamp;
|
|
const r4 = start_timestamp === undefined ? value4 : start_timestamp;
|
|
const value6 = r4 <= env0_0;
|
|
const value9 = r1 - r4 <= (finalTimeout + idleTimeout) / 1000;
|
|
if (DEBUG_BUILD) {
|
|
value10 = global.JSON.stringify(a0, undefined, 2);
|
|
if (value6) {
|
|
if (!value9) {
|
|
debug.log('[Tracing] Discarding span since it finished after idle span final timeout', value10);
|
|
}
|
|
} else {
|
|
debug.log('[Tracing] Discarding span since it happened after idle span was finished', value10);
|
|
}
|
|
}
|
|
if (!(value9 && value6)) {
|
|
(require(828) /* metro dependency 828 */).removeChildSpanFromSpan(env1_14, a0);
|
|
binding = env0_1;
|
|
env0_1 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
|
|
}
|
|
}
|
|
|
|
function _fun9288(a0, a1) { // fn#9288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:988:3074, offset: 0x00d62609, size: 150 bytes, params: 3, frame: 17
|
|
var r1;
|
|
var r0;
|
|
var moduleValue2;
|
|
const value = a0;
|
|
const value3 = (require(828) /* metro dependency 828 */).spanToJSON(a1);
|
|
if (value3.timestamp) {
|
|
if (ignoreSpans) {
|
|
moduleValue2 = require(867) /* metro dependency 867 */;
|
|
r1 = moduleValue2.shouldIgnoreSpan(value3, ignoreSpans) ? value : value ? global.Math.max(value,
|
|
value3.timestamp) : value3.timestamp;
|
|
} else {
|
|
r1 = value ? global.Math.max(value, value3.timestamp) : value3.timestamp;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|