359 lines
17 KiB
JavaScript
359 lines
17 KiB
JavaScript
/* Metro module 828; source: unknown; dependencies: [77, 29, 829, 838, 843, 847, 848, 849, 831, 834, 850, 853, 857, 833] */
|
|
import * as ObjectWithoutPropertiesModule from './module-00029-ObjectWithoutProperties.js'; /* Metro dependency 29 */
|
|
import * as Module00077Module from './module-00077.js'; /* Metro dependency 77 */
|
|
import * as Module00829Module from './module-00829.js'; /* Metro dependency 829 */
|
|
import * as Module00834Module from './module-00834.js'; /* Metro dependency 834 */
|
|
import * as Module00843Module from './module-00843.js'; /* Metro dependency 843 */
|
|
import * as SEMANTIC_Module from './module-00848-SEMANTIC_.js'; /* Metro dependency 848 */
|
|
import * as Module00850Module from './module-00850.js'; /* Metro dependency 850 */
|
|
|
|
function _fun8995(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#8995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:955:6, offset: 0x00d5a8a9, size: 335 bytes, params: 8, frame: 25
|
|
let env0_0 = require;
|
|
let closure = function(a0) {
|
|
return a0 && a0.length > 0 ? a0.map(_fun8997) : undefined;
|
|
};
|
|
const spanTimeInputToSeconds2 = spanTimeInputToSeconds;
|
|
const ensureTimestampInSeconds = function(a0) {
|
|
var r0;
|
|
var value = a0;
|
|
if (value > 9999999999) {
|
|
value /= 1000;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
};
|
|
const spanToJSON2 = spanToJSON;
|
|
const closure4 = function(a0) {
|
|
return a0.spanContext().traceFlags === 1;
|
|
};
|
|
const getStatusMessage2 = getStatusMessage;
|
|
const env0_4 = ['spanId', 'traceId', 'traceFlags'];
|
|
const Object = global.Object;
|
|
const defineProperty = Object.defineProperty;
|
|
const Symbol = global.Symbol;
|
|
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
|
|
exports.TRACE_FLAG_NONE = 0;
|
|
exports.TRACE_FLAG_SAMPLED = 1;
|
|
exports.addChildSpanToSpan = addChildSpanToSpan;
|
|
exports.convertSpanLinksForEnvelope = closure;
|
|
exports.getActiveSpan = getActiveSpan;
|
|
exports.getRootSpan = function(a0) {
|
|
var value = a0;
|
|
return value._sentryRootSpan || value;
|
|
};
|
|
exports.getSpanDescendants = function(a0) {
|
|
var value2 = new global.Set();
|
|
var env0_0 = value2;
|
|
var closure = _fun9007;
|
|
var env0_1 = closure;
|
|
closure(a0);
|
|
return global.Array.from(value2);
|
|
};
|
|
exports.getStatusMessage = getStatusMessage2;
|
|
exports.removeChildSpanFromSpan = function(a0, a1) {
|
|
if (a0._sentryChildSpans) {
|
|
a0._sentryChildSpans.delete(a1);
|
|
}
|
|
};
|
|
exports.showSpanDropWarning = showSpanDropWarning;
|
|
exports.spanIsSampled = closure4;
|
|
exports.spanTimeInputToSeconds = spanTimeInputToSeconds2;
|
|
exports.spanToJSON = spanToJSON2;
|
|
exports.spanToTraceContext = spanToTraceContext;
|
|
exports.spanToTraceHeader = spanToTraceHeader;
|
|
exports.spanToTraceparentHeader = spanToTraceparentHeader;
|
|
exports.spanToTransactionTraceContext = spanToTransactionTraceContext;
|
|
exports.updateSpanName = updateSpanName;
|
|
function convertSpanLinksForEnvelope(a0) { // fn#8996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:955:160, offset: 0x00d5a9f8, size: 43 bytes, params: 2, frame: 13
|
|
return a0 && a0.length > 0 ? a0.map(_fun8997) : undefined;
|
|
function _fun8997({context, attributes}) { // fn#8997, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:955:228, offset: 0x00d5aa23, size: 101 bytes, params: 2, frame: 17
|
|
const spanId = context.spanId;
|
|
const traceId = context.traceId;
|
|
const traceFlags = context.traceFlags;
|
|
let value = environment.__proto__;
|
|
value = env1_3(context, env1_4);
|
|
const Object = global.Object;
|
|
return Object.assign({span_id: spanId, trace_id: traceId, sampled: traceFlags === 1, attributes: attributes}, value);
|
|
}
|
|
|
|
}
|
|
|
|
function spanTimeInputToSeconds(a0) { // fn#8998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:955:402, offset: 0x00d5aa88, size: 156 bytes, params: 2, frame: 13
|
|
var r0;
|
|
var Array;
|
|
var value;
|
|
var ensureTimestampInSecondsBinding;
|
|
if (typeof a0 === 'number') {
|
|
r0 = ensureTimestampInSeconds(a0);
|
|
} else {
|
|
Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
r0 = a0[0] + a0[1] / 1000000000;
|
|
} else if (a0 instanceof global.Date) {
|
|
ensureTimestampInSecondsBinding = ensureTimestampInSeconds;
|
|
value = a0.getTime();
|
|
value = ensureTimestampInSecondsBinding(value);
|
|
r0 = value;
|
|
} else {
|
|
value = require(847) /* metro dependency 847 */;
|
|
value = value.timestampInSeconds();
|
|
r0 = value;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function spanToJSON(a0) { // fn#9000, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:955:671, offset: 0x00d5ab44, size: 375 bytes, params: 2, frame: 21
|
|
var startTime;
|
|
var name;
|
|
var endTime;
|
|
var status;
|
|
var links;
|
|
var object;
|
|
var spanTimeInputToSecondsBinding;
|
|
var value2;
|
|
const getSpanJSON = a0.getSpanJSON;
|
|
if (typeof getSpanJSON === 'function') {
|
|
return a0.getSpanJSON();
|
|
}
|
|
const {spanId, traceId} = a0.spanContext();
|
|
let attributes = a0.attributes;
|
|
let r0 = attributes && a0.startTime && a0.name;
|
|
r0 = r0 && a0.endTime && a0.status;
|
|
if (r0) {
|
|
attributes = a0.attributes;
|
|
startTime = a0.startTime;
|
|
name = a0.name;
|
|
endTime = a0.endTime;
|
|
status = a0.status;
|
|
links = a0.links;
|
|
object = {span_id: spanId, trace_id: traceId, data: attributes, description: name};
|
|
object.parent_span_id = 'parentSpanId' in a0 ? a0.parentSpanId : 'parentSpanContext' in a0 ? a0.parentSpanContext?.spanId : undefined;
|
|
spanTimeInputToSecondsBinding = spanTimeInputToSeconds;
|
|
value2 = undefined;
|
|
object.start_timestamp = spanTimeInputToSecondsBinding(startTime);
|
|
object.timestamp = spanTimeInputToSecondsBinding(endTime) || value2;
|
|
object.status = getStatusMessage(status);
|
|
object.op = attributes[(require(848) /* metro dependency 848 */).SEMANTIC_ATTRIBUTE_SENTRY_OP];
|
|
object.origin = attributes[(require(848) /* metro dependency 848 */).SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN];
|
|
object.links = convertSpanLinksForEnvelope(links);
|
|
return object;
|
|
}
|
|
return {span_id: spanId, trace_id: traceId, start_timestamp: 0, data: {}};
|
|
}
|
|
|
|
function getStatusMessage(a0) { // fn#9002, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:955:1582, offset: 0x00d5acd7, size: 105 bytes, params: 2, frame: 15
|
|
var message;
|
|
var r0;
|
|
if (a0) {
|
|
if (a0.code !== (require(849) /* metro dependency 849 */).SPAN_STATUS_UNSET) {
|
|
if (a0.code === (require(849) /* metro dependency 849 */).SPAN_STATUS_OK) {
|
|
r0 = 'ok';
|
|
} else {
|
|
message = a0.message;
|
|
message = !message ? 'internal_error' : message;
|
|
r0 = message;
|
|
}
|
|
return r0;
|
|
}
|
|
}
|
|
}
|
|
|
|
function addChildSpanToSpan(a0, a1) { // fn#9003, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:955:1834, offset: 0x00d5ad40, size: 162 bytes, params: 3, frame: 19
|
|
var moduleValue2;
|
|
var Set;
|
|
var value3;
|
|
var set;
|
|
const value = a0;
|
|
(require(831) /* metro dependency 831 */).addNonEnumerableProperty(a1, '_sentryRootSpan',
|
|
value._sentryRootSpan || value);
|
|
if (value._sentryChildSpans) {
|
|
value._sentryChildSpans.add(a1);
|
|
} else {
|
|
moduleValue2 = require(831) /* metro dependency 831 */;
|
|
addNonEnumerableProperty = moduleValue2.addNonEnumerableProperty;
|
|
Set = global.Set;
|
|
value3 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
set = new Set([a1]);
|
|
Reflect.apply(addNonEnumerableProperty, moduleValue2, [value, '_sentryChildSpans',
|
|
set instanceof Object ? set : value3]);
|
|
}
|
|
}
|
|
|
|
function getActiveSpan() { // fn#9004, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:955:2064, offset: 0x00d5ade2, size: 134 bytes, params: 1, frame: 15
|
|
var r0;
|
|
var _getSpanForScope;
|
|
var moduleValue3;
|
|
var value;
|
|
const asyncContextStrategy = (Module00850Module).getAsyncContextStrategy((Module00834Module).getMainCarrier());
|
|
const getActiveSpan = asyncContextStrategy.getActiveSpan;
|
|
if (getActiveSpan) {
|
|
r0 = asyncContextStrategy.getActiveSpan();
|
|
} else {
|
|
value = require(853) /* metro dependency 853 */;
|
|
_getSpanForScope = value._getSpanForScope;
|
|
moduleValue3 = require(857) /* metro dependency 857 */;
|
|
value = Reflect.apply(_getSpanForScope, value, [moduleValue3.getCurrentScope()]);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function getSpanDescendants(a0) { // fn#9006, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:955:2329, offset: 0x00d5ae79, size: 71 bytes, params: 2, frame: 13
|
|
const Set = global.Set;
|
|
const set = new Set();
|
|
addSpanChildren(a0);
|
|
const Array = global.Array;
|
|
return Array.from(set);
|
|
function addSpanChildren(a0) { // fn#9007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:955:2381, owner: getSpanDescendants.addSpanChildren, offset: 0x00d5aec0, size: 132 bytes, params: 2, frame: 14
|
|
var r4;
|
|
var r1;
|
|
var value;
|
|
var binding;
|
|
var has;
|
|
var value2;
|
|
var add;
|
|
var _sentryChildSpans;
|
|
var Array;
|
|
var from;
|
|
var value3;
|
|
var iterator;
|
|
var iterator2;
|
|
var item;
|
|
var item2;
|
|
var addSpanChildrenBinding;
|
|
var error;
|
|
exceptionSkip9: while (true) {
|
|
exceptionLanding9: while (true) {
|
|
value = environment;
|
|
binding = env0_0;
|
|
has = binding.has;
|
|
if (!Reflect.apply(has, binding, [a0])) {
|
|
value2 = environment.__proto__;
|
|
if (!spanIsSampled(a0)) {
|
|
break;
|
|
}
|
|
binding = env0_0;
|
|
add = binding.add;
|
|
Reflect.apply(add, binding, [a0]);
|
|
_sentryChildSpans = a0._sentryChildSpans;
|
|
if (_sentryChildSpans) {
|
|
Array = global.Array;
|
|
from = Array.from;
|
|
_sentryChildSpans = a0._sentryChildSpans;
|
|
value3 = Reflect.apply(from, Array, [_sentryChildSpans]);
|
|
r4 = value3;
|
|
} else {
|
|
r4 = [];
|
|
}
|
|
iterator = r4[Symbol.iterator]();
|
|
iterator2 = iterator.next;
|
|
for (r1 = iterator; true; r1 = item2) {
|
|
item2 = Reflect.apply(iterator2, r1, []);
|
|
item = item2.value;
|
|
item2 = item2.done ? undefined : r1;
|
|
if (item2 === undefined) {
|
|
break;
|
|
}
|
|
try {
|
|
addSpanChildrenBinding = addSpanChildren;
|
|
} catch (error) {
|
|
break exceptionLanding9;
|
|
}
|
|
try {
|
|
addSpanChildrenBinding(item);
|
|
} catch (error) {
|
|
break exceptionLanding9;
|
|
}
|
|
}
|
|
}
|
|
return undefined;
|
|
break exceptionSkip9;
|
|
}
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
break exceptionSkip9;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function showSpanDropWarning() { // fn#9009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:955:2679, offset: 0x00d5af67, size: 60 bytes, params: 1, frame: 12
|
|
if (!env0_5) {
|
|
(require(833) /* metro dependency 833 */).consoleSandbox(function() {
|
|
global.console.warn('[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.');
|
|
});
|
|
}
|
|
}
|
|
|
|
function spanToTraceContext(a0) { // fn#9011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:955:3052, offset: 0x00d5afbf, size: 184 bytes, params: 2, frame: 17
|
|
var propagationSpanId;
|
|
var r3;
|
|
var r2;
|
|
let value = a0.spanContext();
|
|
const spanId = value.spanId;
|
|
const traceId = value.traceId;
|
|
const isRemote = value.isRemote;
|
|
const r5 = isRemote ? spanId : spanToJSON(a0).parent_span_id;
|
|
const value2 = undefined;
|
|
const getCapturedScopesOnSpan = Module00829Module.getCapturedScopesOnSpan;
|
|
const scope = Reflect.apply(getCapturedScopesOnSpan, Module00829Module, [a0]).scope;
|
|
const object = {parent_span_id: r5};
|
|
if (isRemote) {
|
|
propagationSpanId = scope == null ? value2 : scope.getPropagationContext().propagationSpanId;
|
|
if (propagationSpanId) {
|
|
r3 = propagationSpanId;
|
|
} else {
|
|
value = require(838) /* metro dependency 838 */;
|
|
value = value.generateSpanId();
|
|
r3 = value;
|
|
}
|
|
r2 = r3;
|
|
} else {
|
|
r2 = spanId;
|
|
}
|
|
object.span_id = r2;
|
|
object.trace_id = traceId;
|
|
return object;
|
|
}
|
|
|
|
function spanToTraceHeader(a0) { // fn#9012, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:955:3375, offset: 0x00d5b077, size: 74 bytes, params: 2, frame: 17
|
|
const value = a0.spanContext();
|
|
return (Module00843Module).generateSentryTraceHeader(value.traceId, value.spanId,
|
|
spanIsSampled(a0));
|
|
}
|
|
|
|
function spanToTraceparentHeader(a0) { // fn#9013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:955:3544, offset: 0x00d5b0c1, size: 74 bytes, params: 2, frame: 17
|
|
const value = a0.spanContext();
|
|
return (Module00843Module).generateTraceparentHeader(value.traceId, value.spanId,
|
|
spanIsSampled(a0));
|
|
}
|
|
|
|
function spanToTransactionTraceContext(a0) { // fn#9014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:955:3725, offset: 0x00d5b10b, size: 113 bytes, params: 2, frame: 15
|
|
let value = a0.spanContext();
|
|
const spanId = value.spanId;
|
|
const traceId = value.traceId;
|
|
value = spanToJSON(a0);
|
|
return {parent_span_id: value.parent_span_id, span_id: spanId, trace_id: traceId, data: value.data, op: value.op,
|
|
status: value.status, origin: value.origin, links: value.links};
|
|
}
|
|
|
|
function updateSpanName(a0, a1) { // fn#9015, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:955:3981, offset: 0x00d5b17c, size: 100 bytes, params: 3, frame: 21
|
|
a0.updateName(a1);
|
|
const setAttributes = a0.setAttributes;
|
|
const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = (SEMANTIC_Module).SEMANTIC_ATTRIBUTE_SENTRY_SOURCE;
|
|
const value = Module00077Module({}, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'custom');
|
|
const SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME = (SEMANTIC_Module).SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME;
|
|
Reflect.apply(setAttributes, a0, [Module00077Module(value, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME, a1)]);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun8995, 828, [77, 29, 829, 838, 843, 847, 848, 849, 831, 834, 850, 853, 857,
|
|
833]) /* metro module 828, dependencies: [77, 29, 829, 838, 843, 847, 848, 849, 831, 834, 850, 853, 857, 833] */;
|