Files
discord-decomp/sources/by-id/module-01069.js
T
2026-07-28 01:06:53 +03:00

108 lines
5.8 KiB
JavaScript

/* Metro module 1069; source: unknown; dependencies: [77, 1067, 1042, 1043, 826] */
import * as Module00077Module from './module-00077.js'; /* Metro dependency 77 */
import * as Module01067Module from './module-01067.js'; /* Metro dependency 1067 */
function _fun11205(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#11205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1196:6, offset: 0x00da4984, size: 110 bytes, params: 8, frame: 19
const env0_0 = require;
const _sendStandaloneLcpSpan2 = _sendStandaloneLcpSpan;
const Object = global.Object;
const defineProperty = Object.defineProperty;
const Symbol = global.Symbol;
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
exports._sendStandaloneLcpSpan = _sendStandaloneLcpSpan2;
exports.trackLcpAsStandaloneSpan = trackLcpAsStandaloneSpan;
function _sendStandaloneLcpSpan(a0, a1, a2, a3) { // fn#11206, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1196:44, offset: 0x00da49f2, size: 715 bytes, params: 5, frame: 26
var r10;
var moduleValue4;
var moduleValue5;
var addEvent;
var value;
const value2 = undefined;
if ((require(1043) /* metro dependency 1043 */).DEBUG_BUILD) {
(require(826) /* metro dependency 826 */).debug.log('Sending LCP span (' + a0 + ')');
}
const msToSec = Module01067Module.msToSec;
const r8 = (require(826) /* metro dependency 826 */).browserPerformanceTimeOrigin() || 0;
let startTime = a1 == null ? value2 : a1.startTime;
startTime = !startTime ? 0 : startTime;
const value6 = Reflect.apply(msToSec, Module01067Module, [r8 + startTime]);
const currentScope = (require(826) /* metro dependency 826 */).getCurrentScope();
const getScopeData = currentScope.getScopeData;
const transactionName = Reflect.apply(getScopeData, currentScope, []).transactionName;
if (a1) {
moduleValue4 = require(826) /* metro dependency 826 */;
r10 = moduleValue4.htmlTreeAsString(a1.element);
} else {
r10 = 'Largest contentful paint';
}
let binding = Module00077Module;
const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = (require(826) /* metro dependency 826 */).SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN;
const value10 = binding({}, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.http.browser.lcp');
const SEMANTIC_ATTRIBUTE_SENTRY_OP = (require(826) /* metro dependency 826 */).SEMANTIC_ATTRIBUTE_SENTRY_OP;
const value11 = binding(value10, SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ui.webvital.lcp');
const SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = (require(826) /* metro dependency 826 */).SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME;
const value14 = binding(binding(binding(value11, SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, 0), 'sentry.pageload.span_id',
a2), 'sentry.report_event', a3);
if (a1) {
if (a1.element) {
moduleValue5 = require(826) /* metro dependency 826 */;
value14['lcp.element'] = moduleValue5.htmlTreeAsString(a1.element);
}
if (a1.id) {
value14['lcp.id'] = a1.id;
}
if (a1.url) {
value14['lcp.url'] = a1.url;
}
if (a1.loadTime != null) {
value14['lcp.loadTime'] = a1.loadTime;
}
if (a1.renderTime != null) {
value14['lcp.renderTime'] = a1.renderTime;
}
if (a1.size != null) {
value14['lcp.size'] = a1.size;
}
}
const value15 = Module01067Module.startStandaloneWebVitalSpan({name: r10, transaction: transactionName,
attributes: value14, startTime: value6});
if (value15) {
addEvent = value15.addEvent;
binding = Module00077Module;
value = binding({}, (require(826) /* metro dependency 826 */).SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT,
'millisecond');
value = binding(value, (require(826) /* metro dependency 826 */).SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE,
a0);
Reflect.apply(addEvent, value15, ['lcp', value]);
value15.end(value6);
}
return value2;
}
function trackLcpAsStandaloneSpan(a0) { // fn#11207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1196:1266, offset: 0x00da4cbd, size: 127 bytes, params: 2, frame: 18
var value;
if (Module01067Module.supportsWebVital('largest-contentful-paint')) {
value = require(1042) /* metro dependency 1042 */;
var env0_2 = value.addLcpInstrumentationHandler(_fun11208, true);
value = Module01067Module;
value.listenForWebVitalReportEvents(a0, _fun11209);
}
function _fun11208({metric}) { // fn#11208, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1196:1414, offset: 0x00da4d3c, size: 60 bytes, params: 2, frame: 4
var value;
if (metric.entries[metric.entries.length - 1]) {
value = metric.value;
}
}
function _fun11209(a0, a1) { // fn#11209, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1196:1539, offset: 0x00da4d78, size: 42 bytes, params: 3, frame: 18
_sendStandaloneLcpSpan(env0_1, env0_0, a1, a0);
env0_2();
}
}
}
global.__d(_fun11205, 1069, [77, 1067, 1042, 1043,
826]) /* metro module 1069, dependencies: [77, 1067, 1042, 1043, 826] */;