@blueking/open-telemetry 0.0.32 → 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -19
- package/dist/bk-rum.global.js +2 -2
- package/dist/bk-rum.global.js.map +1 -1
- package/dist/core/plugin.d.ts +3 -0
- package/dist/index.js +507 -356
- package/dist/index.js.map +1 -1
- package/dist/plugins/resource.d.ts +11 -0
- package/dist/plugins/web-vitals.d.ts +1 -1
- package/dist/schema/attributes.d.ts +19 -0
- package/dist/schema/span.d.ts +10 -0
- package/package.json +1 -1
- package/skills/bk-rum-otele/SKILL.md +1 -1
- package/skills/bk-rum-otele/evals/evals.json +1 -1
- package/skills/bk-rum-otele/references/actions.md +3 -3
- package/skills/bk-rum-otele/references/api.md +3 -3
- package/skills/bk-rum-otele/references/architecture.md +2 -2
- package/skills/bk-rum-otele/references/blank-screen.md +2 -2
- package/skills/bk-rum-otele/references/capabilities.md +17 -17
- package/skills/bk-rum-otele/references/configuration.md +1 -1
- package/skills/bk-rum-otele/references/data-model.md +3 -3
- package/skills/bk-rum-otele/references/errors-security.md +4 -4
- package/skills/bk-rum-otele/references/getting-started.md +3 -2
- package/skills/bk-rum-otele/references/network.md +5 -5
- package/skills/bk-rum-otele/references/performance.md +2 -2
- package/skills/bk-rum-otele/references/session-context.md +3 -3
- package/skills/bk-rum-otele/references/span-protocol.md +333 -239
- package/skills/bk-rum-otele/references/telemetry-reference.md +36 -33
- package/skills/bk-rum-otele/references/transport-sampling.md +2 -2
- package/skills/bk-rum-otele/references/troubleshooting.md +3 -3
- package/skills/bk-rum-otele/references/views-routing.md +4 -4
package/dist/index.js
CHANGED
|
@@ -6,13 +6,14 @@ import { resourceFromAttributes as c } from "@opentelemetry/resources";
|
|
|
6
6
|
import { BatchSpanProcessor as l, SamplingDecision as u, SimpleSpanProcessor as d } from "@opentelemetry/sdk-trace-base";
|
|
7
7
|
import { WebTracerProvider as f } from "@opentelemetry/sdk-trace-web";
|
|
8
8
|
//#region package.json
|
|
9
|
-
var p = "0.0.
|
|
9
|
+
var p = "0.0.34", m = (e) => {
|
|
10
10
|
let t = 5381;
|
|
11
11
|
for (let n = 0; n < e.length; n++) t = t * 33 ^ e.charCodeAt(n);
|
|
12
12
|
return (t >>> 0).toString(36);
|
|
13
13
|
}, h = (e) => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${e}-${Date.now()}-${Math.random().toString(16).slice(2)}`, g = {
|
|
14
14
|
actionFrustrationType: "action.frustration.type",
|
|
15
15
|
actionId: "action.id",
|
|
16
|
+
actionName: "action.name",
|
|
16
17
|
actionTargetName: "action.target.name",
|
|
17
18
|
actionTargetTag: "action.target.tag",
|
|
18
19
|
actionType: "action.type",
|
|
@@ -26,6 +27,24 @@ var p = "0.0.32", m = (e) => {
|
|
|
26
27
|
networkStatus: "network.status",
|
|
27
28
|
nextHopProtocol: "resource.protocol",
|
|
28
29
|
outcomeType: "outcome.type",
|
|
30
|
+
resourceTimingConnectEnd: "resource.timing.connect_end",
|
|
31
|
+
resourceTimingConnectStart: "resource.timing.connect_start",
|
|
32
|
+
resourceTimingDomainLookupEnd: "resource.timing.domain_lookup_end",
|
|
33
|
+
resourceTimingDomainLookupStart: "resource.timing.domain_lookup_start",
|
|
34
|
+
resourceTimingFetchStart: "resource.timing.fetch_start",
|
|
35
|
+
resourceTimingFinalResponseHeadersStart: "resource.timing.final_response_headers_start",
|
|
36
|
+
resourceTimingRedirectEnd: "resource.timing.redirect_end",
|
|
37
|
+
resourceTimingRedirectStart: "resource.timing.redirect_start",
|
|
38
|
+
resourceTimingRequestStart: "resource.timing.request_start",
|
|
39
|
+
resourceTimingResponseEnd: "resource.timing.response_end",
|
|
40
|
+
resourceTimingResponseStart: "resource.timing.response_start",
|
|
41
|
+
resourceTimingSecureConnectionStart: "resource.timing.secure_connection_start",
|
|
42
|
+
resourceTimingStartTime: "resource.timing.start_time",
|
|
43
|
+
resourceTimingWorkerCacheLookupStart: "resource.timing.worker_cache_lookup_start",
|
|
44
|
+
resourceTimingWorkerFinalRouterSource: "resource.timing.worker_final_router_source",
|
|
45
|
+
resourceTimingWorkerMatchedRouterSource: "resource.timing.worker_matched_router_source",
|
|
46
|
+
resourceTimingWorkerRouterEvaluationStart: "resource.timing.worker_router_evaluation_start",
|
|
47
|
+
resourceTimingWorkerStart: "resource.timing.worker_start",
|
|
29
48
|
serviceName: "service.name",
|
|
30
49
|
serviceVersion: "service.version",
|
|
31
50
|
sessionHasReplay: "session.has_replay",
|
|
@@ -385,21 +404,99 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
385
404
|
}
|
|
386
405
|
})();
|
|
387
406
|
}
|
|
388
|
-
},
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
407
|
+
}, A = {
|
|
408
|
+
abort: "abort",
|
|
409
|
+
error: "error",
|
|
410
|
+
success: "success",
|
|
411
|
+
timeout: "timeout",
|
|
412
|
+
warning: "warning"
|
|
413
|
+
}, j = {
|
|
414
|
+
action: "action",
|
|
415
|
+
custom: "custom",
|
|
416
|
+
error: "error",
|
|
417
|
+
longTask: "long_task",
|
|
418
|
+
resource: "resource",
|
|
419
|
+
session: "session",
|
|
420
|
+
vital: "vital",
|
|
421
|
+
view: "view",
|
|
422
|
+
websocket: "websocket"
|
|
423
|
+
}, M = (e, t) => {
|
|
424
|
+
let n = e[t];
|
|
425
|
+
return typeof n == "string" && n.trim() ? n.trim() : void 0;
|
|
426
|
+
}, N = ({ attributes: e, nameHint: t, spanType: n }) => {
|
|
427
|
+
if (n === j.session) {
|
|
428
|
+
let t = M(e, g.sessionPhase);
|
|
429
|
+
return t ? `session.${t}` : "session";
|
|
430
|
+
}
|
|
431
|
+
if (n === j.view) {
|
|
432
|
+
var r, i;
|
|
433
|
+
return (r = (i = M(e, g.viewName)) == null ? M(e, g.viewUrlTemplate) : i) == null ? "view" : r;
|
|
434
|
+
}
|
|
435
|
+
if (n === j.resource) {
|
|
436
|
+
var a;
|
|
437
|
+
let t = (a = M(e, "http.request.method")) == null ? void 0 : a.toUpperCase(), n = M(e, "url.template");
|
|
438
|
+
if (t && n) return `${t} ${n}`;
|
|
439
|
+
let r = M(e, "resource.type");
|
|
440
|
+
return r ? `resource.${r}` : "resource";
|
|
441
|
+
}
|
|
442
|
+
if (n === j.action) {
|
|
443
|
+
var o, s;
|
|
444
|
+
return (o = (s = M(e, g.actionName)) == null ? M(e, g.actionType) : s) == null ? "action" : o;
|
|
445
|
+
}
|
|
446
|
+
if (n === j.error) {
|
|
447
|
+
let n = M(e, "blank_screen.reason");
|
|
448
|
+
if (n) return `blank_screen.${n}`;
|
|
449
|
+
let r = M(e, "csp.effective_directive");
|
|
450
|
+
return r ? `csp.${r}` : (t == null ? void 0 : t.trim()) || M(e, "error.source") || "error";
|
|
451
|
+
}
|
|
452
|
+
if (n === j.vital) {
|
|
453
|
+
var c, l;
|
|
454
|
+
return (c = (l = M(e, g.vitalMetric)) == null ? void 0 : l.toUpperCase()) == null ? "vital" : c;
|
|
455
|
+
}
|
|
456
|
+
if (n === j.longTask) {
|
|
457
|
+
var u;
|
|
458
|
+
return (u = M(e, g.longTaskEntryType)) == null ? "long-task" : u;
|
|
459
|
+
}
|
|
460
|
+
if (n === j.websocket) {
|
|
461
|
+
let t = M(e, g.websocketPhase);
|
|
462
|
+
return t ? `websocket.${t}` : "websocket";
|
|
463
|
+
}
|
|
464
|
+
return n === j.custom ? t === void 0 ? "custom" : `custom.${t}` : n;
|
|
465
|
+
}, Ie = (e) => e === 408 || e === 504 ? A.timeout : typeof e == "number" && e >= 400 ? A.error : A.success, Le = (e) => e === "good" ? A.success : A.warning, Re = (e) => {
|
|
466
|
+
if (!e) return {};
|
|
467
|
+
try {
|
|
468
|
+
let t = new URL(e, typeof location > "u" ? "http://localhost" : location.href);
|
|
469
|
+
return {
|
|
470
|
+
serverAddress: t.hostname,
|
|
471
|
+
serverPort: t.port ? Number(t.port) : void 0
|
|
472
|
+
};
|
|
473
|
+
} catch (e) {
|
|
474
|
+
return {};
|
|
475
|
+
}
|
|
476
|
+
}, P = ({ outcome: e = A.success, spanType: t }) => ({
|
|
477
|
+
[g.spanType]: t,
|
|
478
|
+
[g.outcomeType]: e
|
|
479
|
+
}), ze = ({ initiatorType: e = "other", method: t, outcome: n, url: r }) => {
|
|
480
|
+
let i = Re(r), a = (n == null ? void 0 : n.type) === "response" && typeof n.statusCode == "number" && n.statusCode > 0 ? n.statusCode : void 0, o = (n == null ? void 0 : n.type) === "abort" ? A.abort : (n == null ? void 0 : n.type) === "timeout" ? A.timeout : (n == null ? void 0 : n.type) === "network_error" ? A.error : typeof a == "number" ? Ie(a) : A.success, s = t == null ? void 0 : t.toUpperCase();
|
|
481
|
+
return S(S(S(S(S({}, P({
|
|
482
|
+
outcome: o,
|
|
483
|
+
spanType: j.resource
|
|
484
|
+
})), i.serverAddress ? { "server.address": i.serverAddress } : {}), i.serverPort === void 0 ? {} : { "server.port": i.serverPort }), {}, { "resource.type": e }, s ? { "http.request.method": s } : {}), typeof a == "number" ? { "http.response.status_code": a } : {});
|
|
485
|
+
}, Be = ["http.url", "url.full"], Ve = /* @__PURE__ */ new WeakSet(), He = (e) => {
|
|
486
|
+
Ve.add(e);
|
|
487
|
+
}, Ue = (e) => {
|
|
488
|
+
for (let n of Be) {
|
|
392
489
|
var t;
|
|
393
490
|
let r = (t = e.attributes) == null ? void 0 : t[n];
|
|
394
491
|
if (typeof r == "string") return r;
|
|
395
492
|
}
|
|
396
|
-
},
|
|
493
|
+
}, We = (e) => {
|
|
397
494
|
let t = e == null ? void 0 : e[g.sessionId];
|
|
398
495
|
return typeof t == "string" && t.length > 0;
|
|
399
|
-
},
|
|
496
|
+
}, Ge = (e) => {
|
|
400
497
|
let t = e == null ? void 0 : e[g.viewId];
|
|
401
498
|
return typeof t == "string" && t.length > 0;
|
|
402
|
-
},
|
|
499
|
+
}, Ke = (e) => We(e) && Ge(e), qe = (e) => (e == null ? void 0 : e[g.spanType]) === j.session, Je = class {
|
|
403
500
|
constructor(e, t, n) {
|
|
404
501
|
this.inner = e, this.config = t, this.getRuntimeAttributes = n;
|
|
405
502
|
}
|
|
@@ -407,8 +504,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
407
504
|
return this.inner.forceFlush();
|
|
408
505
|
}
|
|
409
506
|
onEnd(e) {
|
|
410
|
-
let t =
|
|
411
|
-
if (!(
|
|
507
|
+
let t = Ue(e);
|
|
508
|
+
if (!(Ve.delete(e) || t && me(this.config, t) || !Ke(e.attributes) && !(qe(e.attributes) && We(e.attributes)))) {
|
|
412
509
|
try {
|
|
413
510
|
var n, r;
|
|
414
511
|
if (((n = this.config.hooks) == null || (r = n.beforeSend) == null ? void 0 : r.call(n, {
|
|
@@ -432,13 +529,13 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
432
529
|
shutdown() {
|
|
433
530
|
return this.inner.shutdown();
|
|
434
531
|
}
|
|
435
|
-
},
|
|
532
|
+
}, Ye = new Set(Object.values(g)), Xe = (e) => {
|
|
436
533
|
if (typeof e == "string" && e.length > 0) return e;
|
|
437
534
|
if (Array.isArray(e)) for (let t = e.length - 1; t >= 0; --t) {
|
|
438
535
|
let n = e[t];
|
|
439
536
|
if (typeof n == "string" && n.length > 0) return n;
|
|
440
537
|
}
|
|
441
|
-
},
|
|
538
|
+
}, Ze = class {
|
|
442
539
|
constructor(e = {}, t) {
|
|
443
540
|
b(this, "actionHistory", []), b(this, "attributes", {}), b(this, "queuedViewCommands", []), b(this, "recordAssociation", (e, t, n, r) => {
|
|
444
541
|
let i = e.at(-1);
|
|
@@ -491,7 +588,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
491
588
|
this.attributes[t] = n;
|
|
492
589
|
}
|
|
493
590
|
if (g.sessionId in e && this.recordAssociation(this.sessionHistory, [g.sessionId, g.sessionHasReplay], t, typeof this.attributes[g.sessionId] == "string"), g.actionId in e) {
|
|
494
|
-
let e =
|
|
591
|
+
let e = Xe(this.attributes[g.actionId]);
|
|
495
592
|
e === void 0 ? delete this.attributes[g.actionId] : this.attributes[g.actionId] = e, this.recordAssociation(this.actionHistory, [g.actionId], t, typeof this.attributes[g.actionId] == "string");
|
|
496
593
|
}
|
|
497
594
|
}), b(this, "setUser", (e) => {
|
|
@@ -513,7 +610,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
513
610
|
var n;
|
|
514
611
|
this.viewAttributeKeys.forEach((e) => delete this.attributes[e]), this.viewAttributeKeys.clear();
|
|
515
612
|
let r = {};
|
|
516
|
-
for (let [t, i] of Object.entries((n = e.attributes) == null ? {} : n)) i === void 0 ||
|
|
613
|
+
for (let [t, i] of Object.entries((n = e.attributes) == null ? {} : n)) i === void 0 || Ye.has(t) || (r[t] = i, this.attributes[t] = i, this.viewAttributeKeys.add(t), this.viewScopedAttributeKeys.add(t));
|
|
517
614
|
this.view = S(S({}, e), {}, { attributes: r }), this.setOptionalAttribute(g.viewId, e.id), this.setOptionalAttribute(g.viewUrl, e.url), this.setOptionalAttribute(g.viewUrlTemplate, e.urlTemplate), this.setOptionalAttribute(g.viewLoadingType, e.loadingType), this.setOptionalAttribute(g.viewName, e.name), [
|
|
518
615
|
g.viewId,
|
|
519
616
|
g.viewUrl,
|
|
@@ -523,43 +620,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
523
620
|
].forEach((e) => this.viewScopedAttributeKeys.add(e)), this.recordAssociation(this.viewHistory, this.viewScopedAttributeKeys, t, typeof e.id == "string" && e.id.length > 0), this.viewChangeListeners.forEach((e) => e(this.getView()));
|
|
524
621
|
}), this.setAttributes(e), t && this.setUser(t);
|
|
525
622
|
}
|
|
526
|
-
},
|
|
527
|
-
abort: "abort",
|
|
528
|
-
error: "error",
|
|
529
|
-
success: "success",
|
|
530
|
-
timeout: "timeout",
|
|
531
|
-
warning: "warning"
|
|
532
|
-
}, j = {
|
|
533
|
-
action: "action",
|
|
534
|
-
custom: "custom",
|
|
535
|
-
error: "error",
|
|
536
|
-
longTask: "long_task",
|
|
537
|
-
resource: "resource",
|
|
538
|
-
session: "session",
|
|
539
|
-
vital: "vital",
|
|
540
|
-
view: "view",
|
|
541
|
-
websocket: "websocket"
|
|
542
|
-
}, qe = (e) => e === 408 || e === 504 ? A.timeout : typeof e == "number" && e >= 400 ? A.error : A.success, Je = (e) => e === "good" ? A.success : A.warning, Ye = (e) => {
|
|
543
|
-
if (!e) return {};
|
|
544
|
-
try {
|
|
545
|
-
let t = new URL(e, typeof location > "u" ? "http://localhost" : location.href);
|
|
546
|
-
return {
|
|
547
|
-
serverAddress: t.hostname,
|
|
548
|
-
serverPort: t.port ? Number(t.port) : void 0
|
|
549
|
-
};
|
|
550
|
-
} catch (e) {
|
|
551
|
-
return {};
|
|
552
|
-
}
|
|
553
|
-
}, M = ({ outcome: e = A.success, spanType: t }) => ({
|
|
554
|
-
[g.spanType]: t,
|
|
555
|
-
[g.outcomeType]: e
|
|
556
|
-
}), Xe = ({ initiatorType: e = "other", method: t, outcome: n, url: r }) => {
|
|
557
|
-
let i = Ye(r), a = (n == null ? void 0 : n.type) === "response" && typeof n.statusCode == "number" && n.statusCode > 0 ? n.statusCode : void 0, o = (n == null ? void 0 : n.type) === "abort" ? A.abort : (n == null ? void 0 : n.type) === "timeout" ? A.timeout : (n == null ? void 0 : n.type) === "network_error" ? A.error : typeof a == "number" ? qe(a) : A.success, s = t == null ? void 0 : t.toUpperCase();
|
|
558
|
-
return S(S(S(S(S({}, M({
|
|
559
|
-
outcome: o,
|
|
560
|
-
spanType: j.resource
|
|
561
|
-
})), i.serverAddress ? { "server.address": i.serverAddress } : {}), i.serverPort === void 0 ? {} : { "server.port": i.serverPort }), {}, { "resource.type": e }, s ? { "http.request.method": s } : {}), typeof a == "number" ? { "http.response.status_code": a } : {});
|
|
562
|
-
}, Ze = 100, Qe = 100, $e = 1e3, et = 100, tt = 1e4, nt = "data-bk-action-name", rt = 100, it = 10, at = (e) => e.replace(/\s+/g, " ").trim().slice(0, rt), N = (e) => {
|
|
623
|
+
}, Qe = 100, $e = 100, et = 1e3, tt = 100, nt = 1e4, rt = "data-bk-action-name", it = 100, at = 10, F = (e) => e.replace(/\s+/g, " ").trim().slice(0, it), I = (e) => {
|
|
563
624
|
var t;
|
|
564
625
|
if (e.parentElement) return e.parentElement;
|
|
565
626
|
let n = (t = e.getRootNode) == null ? void 0 : t.call(e);
|
|
@@ -568,12 +629,12 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
568
629
|
let n = e;
|
|
569
630
|
for (; n;) {
|
|
570
631
|
let e = n.getAttribute(t);
|
|
571
|
-
if (e) return
|
|
572
|
-
n =
|
|
632
|
+
if (e) return F(e);
|
|
633
|
+
n = I(n);
|
|
573
634
|
}
|
|
574
635
|
}, st = (e) => {
|
|
575
636
|
var t;
|
|
576
|
-
return e.isContentEditable ? "" :
|
|
637
|
+
return e.isContentEditable ? "" : F((t = e.textContent) == null ? "" : t);
|
|
577
638
|
}, ct = (e) => {
|
|
578
639
|
var t, n;
|
|
579
640
|
let r = e, i = (t = r.labels) == null ? void 0 : t[0];
|
|
@@ -588,7 +649,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
588
649
|
"submit"
|
|
589
650
|
].includes(o == null ? "" : o)) {
|
|
590
651
|
var s;
|
|
591
|
-
let e =
|
|
652
|
+
let e = F((s = r.value) == null ? "" : s);
|
|
592
653
|
if (e) return e;
|
|
593
654
|
}
|
|
594
655
|
if (a === "button" || a === "label" || e.getAttribute("role") === "button") {
|
|
@@ -603,29 +664,29 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
603
664
|
"placeholder"
|
|
604
665
|
]) {
|
|
605
666
|
var c;
|
|
606
|
-
let n =
|
|
667
|
+
let n = F((c = e.getAttribute(t)) == null ? "" : c);
|
|
607
668
|
if (n) return n;
|
|
608
669
|
}
|
|
609
|
-
}, lt = (e, t =
|
|
670
|
+
}, lt = (e, t = rt, n = !1) => {
|
|
610
671
|
let r = ot(e, t);
|
|
611
672
|
if (r) return r;
|
|
612
673
|
if (!n) return e.tagName.toLowerCase();
|
|
613
674
|
let i = e, a = 0;
|
|
614
|
-
for (; i && a <=
|
|
675
|
+
for (; i && a <= at;) {
|
|
615
676
|
let e = i.tagName.toLowerCase();
|
|
616
677
|
if (e === "body" || e === "html" || e === "head") break;
|
|
617
678
|
let t = ct(i);
|
|
618
679
|
if (t) return t;
|
|
619
680
|
if (e === "form") break;
|
|
620
|
-
i =
|
|
681
|
+
i = I(i), a += 1;
|
|
621
682
|
}
|
|
622
|
-
for (i = e, a = 0; i && a <=
|
|
683
|
+
for (i = e, a = 0; i && a <= at;) {
|
|
623
684
|
let e = i.tagName.toLowerCase();
|
|
624
685
|
if (e === "body" || e === "html" || e === "head") break;
|
|
625
686
|
let t = st(i);
|
|
626
687
|
if (t) return t;
|
|
627
688
|
if (e === "form") break;
|
|
628
|
-
i =
|
|
689
|
+
i = I(i), a += 1;
|
|
629
690
|
}
|
|
630
691
|
return e.tagName.toLowerCase();
|
|
631
692
|
}, ut = (e) => {
|
|
@@ -655,11 +716,11 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
655
716
|
"submit"
|
|
656
717
|
].includes((r = (i = t.getAttribute("type")) == null ? void 0 : i.toLowerCase()) == null ? "text" : r);
|
|
657
718
|
}
|
|
658
|
-
t =
|
|
719
|
+
t = I(t);
|
|
659
720
|
}
|
|
660
721
|
return !1;
|
|
661
722
|
}, mt = (e = {}) => {
|
|
662
|
-
let t = [], n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = e.actionNameAttribute ||
|
|
723
|
+
let t = [], n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = e.actionNameAttribute || rt, a = ft(e.maxDuration, nt), o = [], s, c = () => {
|
|
663
724
|
s == null || s.setRuntimeAttributes({ [g.actionId]: [...n.keys()].at(-1) });
|
|
664
725
|
}, l = (e) => !e.hadActivity && !e.userActivity.input && !e.userActivity.scroll && !e.userActivity.selection && !pt(e.target), u = (e) => {
|
|
665
726
|
if (!r.delete(e) || !s || !e.completed) return;
|
|
@@ -668,29 +729,36 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
668
729
|
"rage_click",
|
|
669
730
|
"dead_click",
|
|
670
731
|
"error_click"
|
|
671
|
-
].filter((t) => e.frustrations.has(t)), { endTime: n, hasLoadingTime: i } = e.completed, a = e.hadError || t.length > 0
|
|
672
|
-
s.startSpan("action.click", S(S(S(S({}, s.config.hooks.getPageAttributes()), M({
|
|
732
|
+
].filter((t) => e.frustrations.has(t)), { endTime: n, hasLoadingTime: i } = e.completed, a = e.hadError || t.length > 0, o = `click ${e.targetName}`, c = S(S(S(S({}, s.config.hooks.getPageAttributes()), P({
|
|
673
733
|
outcome: a ? A.warning : A.success,
|
|
674
734
|
spanType: j.action
|
|
675
735
|
})), e.runtimeAttributes), {}, {
|
|
676
736
|
[g.actionId]: e.id,
|
|
737
|
+
[g.actionName]: o,
|
|
677
738
|
[g.actionType]: "click",
|
|
678
739
|
[g.actionTargetName]: e.targetName,
|
|
679
740
|
[g.actionTargetTag]: e.targetTag
|
|
680
|
-
}, t.length ? { [g.actionFrustrationType]: t } : {})
|
|
741
|
+
}, t.length ? { [g.actionFrustrationType]: t } : {});
|
|
742
|
+
s.startSpan(N({
|
|
743
|
+
attributes: c,
|
|
744
|
+
spanType: j.action
|
|
745
|
+
}), c, {
|
|
746
|
+
rumSpanType: j.action,
|
|
747
|
+
startTime: e.startTime
|
|
748
|
+
}).end(i ? n : e.startTime);
|
|
681
749
|
}, d = (e, t, i) => {
|
|
682
750
|
if (!n.delete(e.id) || !s) return;
|
|
683
751
|
clearTimeout(e.validationTimer), clearTimeout(e.quietTimer), clearTimeout(e.maxDurationTimer), c(), e.completed = {
|
|
684
752
|
endTime: t,
|
|
685
753
|
hasLoadingTime: i
|
|
686
754
|
}, r.add(e);
|
|
687
|
-
let a = Math.max(0, e.startTime +
|
|
755
|
+
let a = Math.max(0, e.startTime + et - Date.now());
|
|
688
756
|
e.reportTimer = setTimeout(() => u(e), a);
|
|
689
757
|
}, f = () => {
|
|
690
758
|
[...r].forEach(u);
|
|
691
759
|
}, p = (e) => {
|
|
692
760
|
if (clearTimeout(e.quietTimer), !e.hadActivity || e.pendingRequests.size) return;
|
|
693
|
-
let t = Math.max(0, e.lastActivityTime +
|
|
761
|
+
let t = Math.max(0, e.lastActivityTime + $e - Date.now());
|
|
694
762
|
e.quietTimer = setTimeout(() => d(e, e.lastActivityTime, !0), t);
|
|
695
763
|
}, m = (e, t) => {
|
|
696
764
|
e.hadActivity = !0, e.lastActivityTime = Math.max(e.lastActivityTime, t), p(e);
|
|
@@ -723,14 +791,14 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
723
791
|
[...n.values()].forEach((t) => d(t, e, t.hadActivity));
|
|
724
792
|
}, b = (e, t) => {
|
|
725
793
|
let n = "clientX" in t && typeof t.clientX == "number" ? t.clientX : 0, r = "clientY" in t && typeof t.clientY == "number" ? t.clientY : 0;
|
|
726
|
-
o = o.filter((t) => e.startTime - t.action.startTime <=
|
|
727
|
-
let i = o.at(-1), a = o.some((e) => e.action.userActivity.scroll || e.action.userActivity.selection), s = (i == null ? void 0 : i.target) === e.target && Math.hypot(i.x - n, i.y - r) <=
|
|
794
|
+
o = o.filter((t) => e.startTime - t.action.startTime <= et);
|
|
795
|
+
let i = o.at(-1), a = o.some((e) => e.action.userActivity.scroll || e.action.userActivity.selection), s = (i == null ? void 0 : i.target) === e.target && Math.hypot(i.x - n, i.y - r) <= tt;
|
|
728
796
|
(a || i && !s) && (o = []), o.push({
|
|
729
797
|
action: e,
|
|
730
798
|
target: e.target,
|
|
731
799
|
x: n,
|
|
732
800
|
y: r
|
|
733
|
-
}), o.length >= 3 && e.startTime - o[o.length - 3].action.startTime <=
|
|
801
|
+
}), o.length >= 3 && e.startTime - o[o.length - 3].action.startTime <= et && (o.slice(-3).map((e) => e.action).forEach((e) => e.frustrations.add("rage_click")), o = []);
|
|
734
802
|
};
|
|
735
803
|
return {
|
|
736
804
|
name: "action",
|
|
@@ -764,7 +832,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
764
832
|
},
|
|
765
833
|
validationTimer: setTimeout(() => {
|
|
766
834
|
u.hadActivity || d(u, u.startTime, !1);
|
|
767
|
-
},
|
|
835
|
+
}, Qe)
|
|
768
836
|
};
|
|
769
837
|
n.set(s, u), b(u, t), c();
|
|
770
838
|
};
|
|
@@ -929,15 +997,18 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
929
997
|
}, p = (t, n) => {
|
|
930
998
|
if (s !== t || c === t || !e.isSampled()) return;
|
|
931
999
|
c = t;
|
|
932
|
-
let r = Date.now()
|
|
933
|
-
e.startSpan("browser.blank_screen", S(S({}, M({
|
|
1000
|
+
let r = Date.now(), i = S(S({}, P({
|
|
934
1001
|
outcome: A.error,
|
|
935
1002
|
spanType: j.error
|
|
936
1003
|
})), {}, {
|
|
937
1004
|
"blank_screen.empty_ratio": n.score,
|
|
938
1005
|
"blank_screen.empty_sample_count": n.emptyCount,
|
|
939
1006
|
"blank_screen.reason": n.reason
|
|
940
|
-
})
|
|
1007
|
+
});
|
|
1008
|
+
e.startSpan(N({
|
|
1009
|
+
attributes: i,
|
|
1010
|
+
spanType: j.error
|
|
1011
|
+
}), i, { startTime: r }).end(r);
|
|
941
1012
|
}, m = (t) => {
|
|
942
1013
|
if (s !== t || c === t || document.visibilityState === "hidden") return;
|
|
943
1014
|
let n;
|
|
@@ -980,44 +1051,44 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
980
1051
|
clearTimeout(u), u = void 0, d(), l == null || l(), l = void 0, f == null || f(), f = void 0, s = void 0, c = void 0;
|
|
981
1052
|
}
|
|
982
1053
|
};
|
|
983
|
-
}, Nt = 100, Pt = 200,
|
|
984
|
-
let t =
|
|
985
|
-
t >= 0 &&
|
|
986
|
-
},
|
|
1054
|
+
}, Nt = 100, Pt = 200, L = [], Ft = (e) => e.replace(/#.*$/, ""), It = (e) => {
|
|
1055
|
+
let t = L.indexOf(e);
|
|
1056
|
+
t >= 0 && L.splice(t, 1), e.timer !== void 0 && clearTimeout(e.timer);
|
|
1057
|
+
}, R = (e, t) => {
|
|
987
1058
|
let n = e.callback;
|
|
988
1059
|
It(e), e.callback = void 0, n == null || n(t);
|
|
989
1060
|
}, Lt = (e) => {
|
|
990
|
-
let t = performance.timeOrigin + e.startTime, n =
|
|
991
|
-
n && (n.entry = e, n.callback &&
|
|
1061
|
+
let t = performance.timeOrigin + e.startTime, n = L.filter((n) => !n.entry && Ft(n.url) === Ft(e.name) && t >= n.startTime - 50).sort((e, n) => Math.abs(e.startTime - t) - Math.abs(n.startTime - t))[0];
|
|
1062
|
+
n && (n.entry = e, n.callback && R(n, e));
|
|
992
1063
|
}, Rt = (e, t = Date.now()) => {
|
|
993
1064
|
let n = {
|
|
994
1065
|
startTime: t,
|
|
995
1066
|
url: e
|
|
996
1067
|
};
|
|
997
|
-
return
|
|
998
|
-
cancel: () =>
|
|
1068
|
+
return L.push(n), L.length > Nt && R(L[0]), {
|
|
1069
|
+
cancel: () => R(n),
|
|
999
1070
|
complete: (e) => {
|
|
1000
1071
|
if (n.callback = e, n.entry) {
|
|
1001
|
-
|
|
1072
|
+
R(n, n.entry);
|
|
1002
1073
|
return;
|
|
1003
1074
|
}
|
|
1004
|
-
n.timer = setTimeout(() =>
|
|
1075
|
+
n.timer = setTimeout(() => R(n), Pt);
|
|
1005
1076
|
}
|
|
1006
1077
|
};
|
|
1007
|
-
},
|
|
1078
|
+
}, z = "traceparent", B = 32, V = 16, zt = "0123456789abcdef", Bt = /^[\da-f]+$/, Vt = /^0+$/, Ht = /^\d+$/, Ut = /^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})(?:-.*)?$/, Wt = /^([\da-f]{32})-([\da-f]{16})(?:-([01]))?$/, Gt = /(?:^|,)_dd\.p\.tid=([\da-f]{16})(?:,|$)/, Kt = "0000000000000000", H = (e, t) => e.length === t && Bt.test(e) && !Vt.test(e), qt = (e) => {
|
|
1008
1079
|
let t = e.toLowerCase();
|
|
1009
|
-
return
|
|
1080
|
+
return H(t, B) ? t : H(t, V) ? t.padStart(B, "0") : void 0;
|
|
1010
1081
|
}, Jt = (e) => {
|
|
1011
1082
|
let t = e.toLowerCase();
|
|
1012
|
-
return
|
|
1013
|
-
},
|
|
1083
|
+
return H(t, V) ? t : void 0;
|
|
1084
|
+
}, U = (e) => {
|
|
1014
1085
|
let t = new Uint8Array(e / 2);
|
|
1015
1086
|
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") crypto.getRandomValues(t);
|
|
1016
1087
|
else for (let e = 0; e < t.length; e += 1) t[e] = Math.floor(Math.random() * 256);
|
|
1017
1088
|
let n = "";
|
|
1018
1089
|
for (let e of t) n += zt[e >> 4] + zt[e & 15];
|
|
1019
1090
|
return Vt.test(n) ? `${n.slice(1)}1` : n;
|
|
1020
|
-
},
|
|
1091
|
+
}, Yt = (e) => {
|
|
1021
1092
|
if (!Ht.test(e)) return;
|
|
1022
1093
|
let t = [];
|
|
1023
1094
|
for (let n = 0; n < e.length; n += 1) {
|
|
@@ -1028,11 +1099,11 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1028
1099
|
}
|
|
1029
1100
|
for (; r > 0;) t.push(r % 16), r = (r - r % 16) / 16;
|
|
1030
1101
|
}
|
|
1031
|
-
if (t.length >
|
|
1102
|
+
if (t.length > V) return;
|
|
1032
1103
|
let n = "";
|
|
1033
1104
|
for (let e = t.length - 1; e >= 0; --e) n += zt[t[e]];
|
|
1034
|
-
return n.padStart(
|
|
1035
|
-
},
|
|
1105
|
+
return n.padStart(V, "0");
|
|
1106
|
+
}, W = (e, t) => {
|
|
1036
1107
|
let n = {};
|
|
1037
1108
|
for (let i of t) {
|
|
1038
1109
|
var r;
|
|
@@ -1040,7 +1111,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1040
1111
|
t && (n[i] = t);
|
|
1041
1112
|
}
|
|
1042
1113
|
return n;
|
|
1043
|
-
},
|
|
1114
|
+
}, Xt = [
|
|
1044
1115
|
(e) => {
|
|
1045
1116
|
var t;
|
|
1046
1117
|
let n = (t = e("traceparent")) == null ? void 0 : t.trim().toLowerCase();
|
|
@@ -1048,9 +1119,9 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1048
1119
|
let r = Ut.exec(n);
|
|
1049
1120
|
if (!r || r[1] === "ff") return;
|
|
1050
1121
|
let [, , i, a, o] = r;
|
|
1051
|
-
if (!(!
|
|
1122
|
+
if (!(!H(i, B) || !H(a, V))) return {
|
|
1052
1123
|
format: "traceparent",
|
|
1053
|
-
headers:
|
|
1124
|
+
headers: W(e, [z]),
|
|
1054
1125
|
sampled: (Number.parseInt(o, 16) & 1) == 1,
|
|
1055
1126
|
spanId: a,
|
|
1056
1127
|
traceId: i
|
|
@@ -1060,7 +1131,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1060
1131
|
var t;
|
|
1061
1132
|
let n = (t = e("sentry-trace")) == null ? void 0 : t.trim().toLowerCase();
|
|
1062
1133
|
if (!n) return;
|
|
1063
|
-
let r =
|
|
1134
|
+
let r = W(e, ["sentry-trace"]), i = Wt.exec(n);
|
|
1064
1135
|
if (!i) return {
|
|
1065
1136
|
format: "sentry-trace",
|
|
1066
1137
|
headers: r
|
|
@@ -1069,7 +1140,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1069
1140
|
return S(S({
|
|
1070
1141
|
format: "sentry-trace",
|
|
1071
1142
|
headers: r
|
|
1072
|
-
}, s === void 0 ? {} : { sampled: s === "1" }),
|
|
1143
|
+
}, s === void 0 ? {} : { sampled: s === "1" }), H(a, B) && H(o, V) ? {
|
|
1073
1144
|
spanId: o,
|
|
1074
1145
|
traceId: a
|
|
1075
1146
|
} : {});
|
|
@@ -1081,7 +1152,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1081
1152
|
let [r, i, a] = n.split("-"), o = r ? qt(r) : void 0, s = i ? Jt(i) : void 0;
|
|
1082
1153
|
return S(S({
|
|
1083
1154
|
format: "b3",
|
|
1084
|
-
headers:
|
|
1155
|
+
headers: W(e, ["b3"])
|
|
1085
1156
|
}, o && s ? {
|
|
1086
1157
|
spanId: s,
|
|
1087
1158
|
traceId: o
|
|
@@ -1094,7 +1165,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1094
1165
|
let s = i ? qt(i) : void 0, c = a ? Jt(a) : void 0;
|
|
1095
1166
|
return S(S({
|
|
1096
1167
|
format: "b3-multi",
|
|
1097
|
-
headers:
|
|
1168
|
+
headers: W(e, [
|
|
1098
1169
|
"x-b3-traceid",
|
|
1099
1170
|
"x-b3-spanid",
|
|
1100
1171
|
"x-b3-parentspanid",
|
|
@@ -1110,10 +1181,10 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1110
1181
|
var t, n, r, i, a, o;
|
|
1111
1182
|
let s = (t = e("x-datadog-trace-id")) == null ? void 0 : t.trim(), c = (n = e("x-datadog-parent-id")) == null ? void 0 : n.trim(), l = (r = e("x-datadog-sampling-priority")) == null ? void 0 : r.trim();
|
|
1112
1183
|
if (!s && !c && !l) return;
|
|
1113
|
-
let u = (i = e("x-datadog-tags")) == null ? void 0 : i.trim().toLowerCase(), d = (a = u ? (o = Gt.exec(u)) == null ? void 0 : o[1] : void 0) == null ? Kt : a, f = s ?
|
|
1184
|
+
let u = (i = e("x-datadog-tags")) == null ? void 0 : i.trim().toLowerCase(), d = (a = u ? (o = Gt.exec(u)) == null ? void 0 : o[1] : void 0) == null ? Kt : a, f = s ? Yt(s) : void 0, p = f ? qt(`${d}${f}`) : void 0, m = c ? Yt(c) : void 0, h = m ? Jt(m) : void 0;
|
|
1114
1185
|
return S(S({
|
|
1115
1186
|
format: "datadog",
|
|
1116
|
-
headers:
|
|
1187
|
+
headers: W(e, [
|
|
1117
1188
|
"x-datadog-trace-id",
|
|
1118
1189
|
"x-datadog-parent-id",
|
|
1119
1190
|
"x-datadog-sampling-priority",
|
|
@@ -1132,42 +1203,42 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1132
1203
|
let r = n.split("-")[0];
|
|
1133
1204
|
return S({
|
|
1134
1205
|
format: "sw8",
|
|
1135
|
-
headers:
|
|
1206
|
+
headers: W(e, ["sw8"])
|
|
1136
1207
|
}, r ? { sampled: r === "1" } : {});
|
|
1137
1208
|
}
|
|
1138
|
-
],
|
|
1139
|
-
for (let t of
|
|
1209
|
+
], Zt = (e) => {
|
|
1210
|
+
for (let t of Xt) {
|
|
1140
1211
|
let n = t(e);
|
|
1141
1212
|
if (n) return n;
|
|
1142
1213
|
}
|
|
1143
|
-
},
|
|
1214
|
+
}, Qt = (e, t, r, i) => ({
|
|
1144
1215
|
attributes: r,
|
|
1145
1216
|
context: {
|
|
1146
1217
|
spanId: t,
|
|
1147
1218
|
traceFlags: i === !1 ? n.NONE : n.SAMPLED,
|
|
1148
1219
|
traceId: e
|
|
1149
1220
|
}
|
|
1150
|
-
}),
|
|
1221
|
+
}), $t = (e) => {
|
|
1151
1222
|
var t, n;
|
|
1152
|
-
let r =
|
|
1223
|
+
let r = Zt(e);
|
|
1153
1224
|
if (!r) {
|
|
1154
|
-
let e =
|
|
1225
|
+
let e = U(B), t = U(V), n = `00-${e}-${t}-01`;
|
|
1155
1226
|
return {
|
|
1156
|
-
links: [
|
|
1227
|
+
links: [Qt(e, t, {
|
|
1157
1228
|
format: "traceparent",
|
|
1158
1229
|
injected: !0,
|
|
1159
|
-
[
|
|
1230
|
+
[z]: n
|
|
1160
1231
|
})],
|
|
1161
1232
|
traceparent: n
|
|
1162
1233
|
};
|
|
1163
1234
|
}
|
|
1164
|
-
return { links: [
|
|
1235
|
+
return { links: [Qt((t = r.traceId) == null ? U(B) : t, (n = r.spanId) == null ? U(V) : n, S({
|
|
1165
1236
|
format: r.format,
|
|
1166
1237
|
injected: !1
|
|
1167
1238
|
}, r.headers), r.sampled)] };
|
|
1168
|
-
},
|
|
1169
|
-
|
|
1170
|
-
},
|
|
1239
|
+
}, en = (e) => e.deliveryType === "cache" || e.transferSize === 0 && e.decodedBodySize > 0 ? !0 : void 0, tn = (e) => e.transferSize === 0 && e.encodedBodySize === 0 && e.decodedBodySize === 0 && e.requestStart === 0 && e.responseStart === 0 && !e.nextHopProtocol, nn = (...e) => e.every((t, n) => n === 0 || e[n - 1] <= t), G = (e, t, n, r, i) => {
|
|
1240
|
+
nn(n, r, i) && (e[`resource.${t}.start`] = r - n, e[`resource.${t}.duration`] = i - r);
|
|
1241
|
+
}, rn = (e) => {
|
|
1171
1242
|
let t = {}, n = [
|
|
1172
1243
|
e.startTime,
|
|
1173
1244
|
e.fetchStart,
|
|
@@ -1179,16 +1250,42 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1179
1250
|
e.responseStart,
|
|
1180
1251
|
e.responseEnd
|
|
1181
1252
|
];
|
|
1182
|
-
return !n.every(Number.isFinite) || !
|
|
1183
|
-
},
|
|
1184
|
-
|
|
1185
|
-
|
|
1253
|
+
return !n.every(Number.isFinite) || !nn(...n) ? t : (G(t, "first_byte", e.startTime, e.requestStart, e.responseStart), G(t, "download", e.startTime, e.responseStart, e.responseEnd), e.workerStart > 0 && e.workerStart < e.fetchStart && G(t, "worker", e.startTime, e.workerStart, e.fetchStart), e.fetchStart < e.domainLookupEnd && G(t, "dns", e.startTime, e.domainLookupStart, e.domainLookupEnd), e.fetchStart < e.connectEnd && (G(t, "connect", e.startTime, e.connectStart, e.connectEnd), e.connectStart <= e.secureConnectionStart && e.secureConnectionStart <= e.connectEnd && G(t, "ssl", e.startTime, e.secureConnectionStart, e.connectEnd)), e.redirectEnd > e.startTime && nn(e.startTime, e.redirectStart, e.redirectEnd, e.fetchStart) && G(t, "redirect", e.startTime, e.redirectStart, e.redirectEnd), t);
|
|
1254
|
+
}, an = [
|
|
1255
|
+
["startTime", g.resourceTimingStartTime],
|
|
1256
|
+
["redirectStart", g.resourceTimingRedirectStart],
|
|
1257
|
+
["redirectEnd", g.resourceTimingRedirectEnd],
|
|
1258
|
+
["fetchStart", g.resourceTimingFetchStart],
|
|
1259
|
+
["workerStart", g.resourceTimingWorkerStart],
|
|
1260
|
+
["workerRouterEvaluationStart", g.resourceTimingWorkerRouterEvaluationStart],
|
|
1261
|
+
["workerCacheLookupStart", g.resourceTimingWorkerCacheLookupStart],
|
|
1262
|
+
["domainLookupStart", g.resourceTimingDomainLookupStart],
|
|
1263
|
+
["domainLookupEnd", g.resourceTimingDomainLookupEnd],
|
|
1264
|
+
["connectStart", g.resourceTimingConnectStart],
|
|
1265
|
+
["secureConnectionStart", g.resourceTimingSecureConnectionStart],
|
|
1266
|
+
["connectEnd", g.resourceTimingConnectEnd],
|
|
1267
|
+
["requestStart", g.resourceTimingRequestStart],
|
|
1268
|
+
["responseStart", g.resourceTimingResponseStart],
|
|
1269
|
+
["finalResponseHeadersStart", g.resourceTimingFinalResponseHeadersStart],
|
|
1270
|
+
["responseEnd", g.resourceTimingResponseEnd],
|
|
1271
|
+
["workerMatchedRouterSource", g.resourceTimingWorkerMatchedRouterSource],
|
|
1272
|
+
["workerFinalRouterSource", g.resourceTimingWorkerFinalRouterSource]
|
|
1273
|
+
], on = (e) => {
|
|
1274
|
+
let t = {};
|
|
1275
|
+
for (let [n, r] of an) {
|
|
1276
|
+
let i = e[n];
|
|
1277
|
+
(typeof i == "number" && Number.isFinite(i) || typeof i == "string" && i !== "") && (t[r] = i);
|
|
1278
|
+
}
|
|
1279
|
+
return t;
|
|
1280
|
+
}, sn = (e) => e.duration === 0 && e.responseEnd > e.startTime ? e.responseEnd - e.startTime : e.duration, cn = (e) => {
|
|
1281
|
+
let t = tn(e), n = typeof e.deliveryType == "string" && e.deliveryType ? e.deliveryType : void 0;
|
|
1282
|
+
return S(S(S(S(S(S({ [g.cacheHit]: en(e) }, e.nextHopProtocol ? { [g.nextHopProtocol]: e.nextHopProtocol } : {}), rn(e)), on(e)), n ? { "resource.delivery_type": n } : {}), e.renderBlockingStatus ? { "resource.render_blocking_status": e.renderBlockingStatus } : {}), t ? {} : {
|
|
1186
1283
|
"resource.size": e.decodedBodySize,
|
|
1187
1284
|
"resource.encoded_body_size": e.encodedBodySize,
|
|
1188
1285
|
"resource.decoded_body_size": e.decodedBodySize,
|
|
1189
1286
|
"resource.transfer_size": e.transferSize
|
|
1190
1287
|
});
|
|
1191
|
-
},
|
|
1288
|
+
}, ln = (t = !0) => {
|
|
1192
1289
|
let n;
|
|
1193
1290
|
return {
|
|
1194
1291
|
name: "resource",
|
|
@@ -1202,21 +1299,30 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1202
1299
|
return;
|
|
1203
1300
|
}
|
|
1204
1301
|
if (n.duration < 0) return;
|
|
1205
|
-
let i = r.config.hooks.redactUrl(n.name), a =
|
|
1206
|
-
t && r.isSampled()
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1302
|
+
let i = r.config.hooks.redactUrl(n.name), a = sn(n), o = performance.timeOrigin + n.startTime, s = o + a;
|
|
1303
|
+
if (t && r.isSampled()) {
|
|
1304
|
+
let t = S(S(S({}, r.config.hooks.getPageAttributes()), ze({
|
|
1305
|
+
initiatorType: n.initiatorType || "other",
|
|
1306
|
+
method: "GET",
|
|
1307
|
+
outcome: typeof n.responseStatus == "number" ? {
|
|
1308
|
+
statusCode: n.responseStatus,
|
|
1309
|
+
type: "response"
|
|
1310
|
+
} : void 0,
|
|
1311
|
+
url: i
|
|
1312
|
+
})), {}, {
|
|
1313
|
+
"url.full": i,
|
|
1314
|
+
"url.template": r.config.hooks.getRequestUrlTemplate(i)
|
|
1315
|
+
}, cn(n));
|
|
1316
|
+
r.startSpan(N({
|
|
1317
|
+
attributes: t,
|
|
1318
|
+
spanType: j.resource
|
|
1319
|
+
}), t, {
|
|
1320
|
+
kind: e.CLIENT,
|
|
1321
|
+
rumSpanType: j.resource,
|
|
1322
|
+
startTime: o
|
|
1323
|
+
}).end(s);
|
|
1324
|
+
}
|
|
1325
|
+
r.notifyActivity({
|
|
1220
1326
|
endTime: s,
|
|
1221
1327
|
startTime: o,
|
|
1222
1328
|
type: "resource",
|
|
@@ -1238,31 +1344,31 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1238
1344
|
n == null || n.disconnect(), n = void 0;
|
|
1239
1345
|
}
|
|
1240
1346
|
};
|
|
1241
|
-
},
|
|
1347
|
+
}, un = (e) => typeof e.config.tracking.request == "object" ? e.config.tracking.request : void 0, dn = (e) => {
|
|
1242
1348
|
var t;
|
|
1243
|
-
let n = (t =
|
|
1349
|
+
let n = (t = un(e)) == null ? void 0 : t.allowedTracingUrls;
|
|
1244
1350
|
return Array.isArray(n) ? n.length > 0 : n !== void 0;
|
|
1245
|
-
},
|
|
1351
|
+
}, fn = (e) => typeof e == "object" && e && "name" in e && typeof e.name == "string" ? e.name : "", pn = (e, t) => {
|
|
1246
1352
|
let n = e.signal;
|
|
1247
|
-
return
|
|
1353
|
+
return fn(n == null ? void 0 : n.reason) === "TimeoutError" || fn(t) === "TimeoutError" ? {
|
|
1248
1354
|
error: t,
|
|
1249
1355
|
type: "timeout"
|
|
1250
|
-
} : n != null && n.aborted ||
|
|
1356
|
+
} : n != null && n.aborted || fn(t) === "AbortError" ? { type: "abort" } : {
|
|
1251
1357
|
error: t,
|
|
1252
1358
|
type: "network_error"
|
|
1253
1359
|
};
|
|
1254
|
-
},
|
|
1360
|
+
}, mn = (e, t) => e === "abort" ? { type: "abort" } : e === "timeout" ? { type: "timeout" } : e === "error" || t.status === 0 ? { type: "network_error" } : {
|
|
1255
1361
|
statusCode: t.status,
|
|
1256
1362
|
type: "response"
|
|
1257
|
-
},
|
|
1363
|
+
}, hn = (e) => e.type === "network_error" || e.type === "timeout" || e.type === "response" && typeof e.statusCode == "number" && e.statusCode >= 400, gn = (e) => typeof e == "string" || e instanceof URL ? E(String(e)) : E(e.url), _n = (e, t) => {
|
|
1258
1364
|
var n;
|
|
1259
1365
|
return ((n = t == null ? void 0 : t.method) == null ? typeof Request < "u" && e instanceof Request ? e.method : "GET" : n).toUpperCase();
|
|
1260
|
-
},
|
|
1366
|
+
}, vn = (e, t) => typeof Request < "u" && e instanceof Request ? e : t == null ? {} : t, yn = (e, t) => {
|
|
1261
1367
|
var n;
|
|
1262
1368
|
let r = typeof Request < "u" && e instanceof Request ? e.headers : void 0;
|
|
1263
1369
|
return new Headers((n = t == null ? void 0 : t.headers) == null ? r : n);
|
|
1264
|
-
},
|
|
1265
|
-
if (
|
|
1370
|
+
}, bn = (e, t, n) => n.traceparent ? (t.set(z, n.traceparent), S(S({}, e), {}, { headers: t })) : e, xn = (e) => (t) => e == null ? void 0 : e[t.toLowerCase()], Sn = (e, t) => D(e.config, t) || O(e.config.view.excludedActivityUrls, t), Cn = (e, t) => {
|
|
1371
|
+
if (Sn(e, t)) return () => {};
|
|
1266
1372
|
let n = h("request");
|
|
1267
1373
|
e.notifyActivity({
|
|
1268
1374
|
id: n,
|
|
@@ -1278,28 +1384,32 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1278
1384
|
type: "request_end"
|
|
1279
1385
|
}));
|
|
1280
1386
|
};
|
|
1281
|
-
},
|
|
1387
|
+
}, wn = (e, t) => e.isSampled() ? Rt(t) : {
|
|
1282
1388
|
cancel() {},
|
|
1283
1389
|
complete(e) {
|
|
1284
1390
|
e();
|
|
1285
1391
|
}
|
|
1286
|
-
},
|
|
1392
|
+
}, Tn = (t, n, r, i) => {
|
|
1287
1393
|
var a, o;
|
|
1288
|
-
let s = (a = r.startedAt) == null ? Date.now() : a
|
|
1289
|
-
return t.startSpan("browser.resource", S(S(S({}, t.config.hooks.getPageAttributes()), Xe({
|
|
1394
|
+
let s = (a = r.startedAt) == null ? Date.now() : a, c = S(S(S({}, t.config.hooks.getPageAttributes()), ze({
|
|
1290
1395
|
initiatorType: n,
|
|
1291
1396
|
method: r.method,
|
|
1292
1397
|
url: (o = r.url) == null ? "" : o
|
|
1293
1398
|
})), r.url ? {
|
|
1294
1399
|
"url.full": t.config.hooks.redactUrl(r.url),
|
|
1295
1400
|
"url.template": t.config.hooks.getRequestUrlTemplate(r.url)
|
|
1296
|
-
} : {})
|
|
1401
|
+
} : {});
|
|
1402
|
+
return t.startSpan(N({
|
|
1403
|
+
attributes: c,
|
|
1404
|
+
spanType: j.resource
|
|
1405
|
+
}), c, S({
|
|
1297
1406
|
kind: e.CLIENT,
|
|
1407
|
+
rumSpanType: j.resource,
|
|
1298
1408
|
startTime: s
|
|
1299
1409
|
}, i ? { links: i.links } : {}));
|
|
1300
|
-
},
|
|
1410
|
+
}, En = (e, n, r, i, a, o = {}) => {
|
|
1301
1411
|
let s = o.url, c = s ? e.config.hooks.redactUrl(s) : void 0, l = o.method, u = {
|
|
1302
|
-
attributes: S(S(S(S({}, e.config.hooks.getPageAttributes()),
|
|
1412
|
+
attributes: S(S(S(S({}, e.config.hooks.getPageAttributes()), ze({
|
|
1303
1413
|
initiatorType: r,
|
|
1304
1414
|
method: l,
|
|
1305
1415
|
outcome: a,
|
|
@@ -1315,17 +1425,21 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1315
1425
|
}, d = !0;
|
|
1316
1426
|
try {
|
|
1317
1427
|
var f, p;
|
|
1318
|
-
d = (f =
|
|
1428
|
+
d = (f = un(e)) == null || (p = f.beforeSend) == null ? void 0 : p.call(f, u, i);
|
|
1319
1429
|
} catch (t) {
|
|
1320
1430
|
var m;
|
|
1321
1431
|
e.config.debug && ((m = globalThis.console) == null || m.warn("[bk-ot] request.beforeSend failed:", t));
|
|
1322
1432
|
}
|
|
1323
|
-
|
|
1324
|
-
|
|
1433
|
+
let h = e.applyRedact(u.attributes);
|
|
1434
|
+
if (n.setAttributes(h), n.updateName(N({
|
|
1435
|
+
attributes: h,
|
|
1436
|
+
spanType: j.resource
|
|
1437
|
+
})), d === !1) {
|
|
1438
|
+
He(n);
|
|
1325
1439
|
return;
|
|
1326
1440
|
}
|
|
1327
|
-
|
|
1328
|
-
},
|
|
1441
|
+
hn(a) && n.setStatus({ code: t.ERROR });
|
|
1442
|
+
}, Dn = (e) => {
|
|
1329
1443
|
let t = [], n = /* @__PURE__ */ new Set();
|
|
1330
1444
|
return {
|
|
1331
1445
|
name: "request",
|
|
@@ -1335,19 +1449,19 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1335
1449
|
if (typeof window.fetch == "function") {
|
|
1336
1450
|
let r = window.fetch, i = /* @__PURE__ */ function() {
|
|
1337
1451
|
var t = k(function* (t, i) {
|
|
1338
|
-
let a =
|
|
1452
|
+
let a = gn(t);
|
|
1339
1453
|
if (!e.isSampled() || _e(e.config, a)) return r.call(this, t, i);
|
|
1340
1454
|
let o = {
|
|
1341
|
-
method:
|
|
1455
|
+
method: _n(t, i),
|
|
1342
1456
|
startedAt: Date.now(),
|
|
1343
1457
|
url: a
|
|
1344
|
-
}, s = ve(e.config, a) ?
|
|
1458
|
+
}, s = ve(e.config, a) ? yn(t, i) : void 0, c = s ? $t((e) => {
|
|
1345
1459
|
var t;
|
|
1346
1460
|
return (t = s.get(e)) == null ? void 0 : t;
|
|
1347
|
-
}) : void 0, l =
|
|
1461
|
+
}) : void 0, l = Tn(e, "fetch", o, c), u = wn(e, a), d = Cn(e, a), f = vn(t, i), p = s && c ? bn(i, s, c) : i, m = !1, h = (t, r = Date.now()) => {
|
|
1348
1462
|
if (!m) {
|
|
1349
1463
|
if (m = !0, n.delete(g), t) {
|
|
1350
|
-
l.setAttributes(e.applyRedact(
|
|
1464
|
+
l.setAttributes(e.applyRedact(cn(t))), l.end(performance.timeOrigin + t.startTime + sn(t));
|
|
1351
1465
|
return;
|
|
1352
1466
|
}
|
|
1353
1467
|
l.end(r);
|
|
@@ -1358,7 +1472,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1358
1472
|
n.add(g);
|
|
1359
1473
|
try {
|
|
1360
1474
|
let n = yield r.call(this, t, p), i = S(S({}, n.status > 0 ? { statusCode: n.status } : {}), {}, { type: "response" });
|
|
1361
|
-
|
|
1475
|
+
En(e, l, "fetch", {
|
|
1362
1476
|
request: f,
|
|
1363
1477
|
response: n,
|
|
1364
1478
|
type: "fetch"
|
|
@@ -1366,8 +1480,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1366
1480
|
let a = Date.now();
|
|
1367
1481
|
return u.complete((e) => h(e, a)), n;
|
|
1368
1482
|
} catch (t) {
|
|
1369
|
-
let n =
|
|
1370
|
-
|
|
1483
|
+
let n = pn(f, t);
|
|
1484
|
+
En(e, l, "fetch", {
|
|
1371
1485
|
error: t,
|
|
1372
1486
|
request: f,
|
|
1373
1487
|
type: "fetch"
|
|
@@ -1397,8 +1511,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1397
1511
|
let s = (a = r.get(this)) == null ? {} : a;
|
|
1398
1512
|
if (!e.isSampled() || !s.url || _e(e.config, s.url)) return o.call(this, t);
|
|
1399
1513
|
s.startedAt = Date.now();
|
|
1400
|
-
let c = ve(e.config, s.url) ?
|
|
1401
|
-
c != null && c.traceparent && this.setRequestHeader(
|
|
1514
|
+
let c = ve(e.config, s.url) ? $t(xn(i.get(this))) : void 0, l = Tn(e, "xhr", s, c), u = wn(e, s.url), d = Cn(e, s.url);
|
|
1515
|
+
c != null && c.traceparent && this.setRequestHeader(z, c.traceparent);
|
|
1402
1516
|
let f = !1, p = !1, m = () => {}, h = () => {
|
|
1403
1517
|
m(), u.cancel(), !p && (p = !0, n.delete(h), d(), l.end());
|
|
1404
1518
|
};
|
|
@@ -1406,8 +1520,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1406
1520
|
let g = (t) => {
|
|
1407
1521
|
if (f || p) return;
|
|
1408
1522
|
f = !0, m();
|
|
1409
|
-
let r =
|
|
1410
|
-
|
|
1523
|
+
let r = mn(t, this);
|
|
1524
|
+
En(e, l, "xhr", {
|
|
1411
1525
|
type: "xhr",
|
|
1412
1526
|
xhr: this
|
|
1413
1527
|
}, r, s), d();
|
|
@@ -1415,7 +1529,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1415
1529
|
u.complete((t) => {
|
|
1416
1530
|
if (!p) {
|
|
1417
1531
|
if (p = !0, n.delete(h), t) {
|
|
1418
|
-
l.setAttributes(e.applyRedact(
|
|
1532
|
+
l.setAttributes(e.applyRedact(cn(t))), l.end(performance.timeOrigin + t.startTime + sn(t));
|
|
1419
1533
|
return;
|
|
1420
1534
|
}
|
|
1421
1535
|
l.end(i);
|
|
@@ -1433,7 +1547,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1433
1547
|
};
|
|
1434
1548
|
if (XMLHttpRequest.prototype.open = s, XMLHttpRequest.prototype.send = c, t.push(() => {
|
|
1435
1549
|
XMLHttpRequest.prototype.open === s && (XMLHttpRequest.prototype.open = a), XMLHttpRequest.prototype.send === c && (XMLHttpRequest.prototype.send = o);
|
|
1436
|
-
}),
|
|
1550
|
+
}), dn(e) && typeof XMLHttpRequest.prototype.setRequestHeader == "function") {
|
|
1437
1551
|
let e = XMLHttpRequest.prototype.setRequestHeader, n = function(t, n) {
|
|
1438
1552
|
var r;
|
|
1439
1553
|
let a = t.toLowerCase(), o = (r = i.get(this)) == null ? {} : r;
|
|
@@ -1452,9 +1566,9 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1452
1566
|
for (; t.length;) (e = t.pop()) == null || e();
|
|
1453
1567
|
}
|
|
1454
1568
|
};
|
|
1455
|
-
},
|
|
1456
|
-
if (t) return
|
|
1457
|
-
},
|
|
1569
|
+
}, On = /^https?:|^\/\//i, kn = (e, t) => {
|
|
1570
|
+
if (t) return On.test(t) ? e(t) : t;
|
|
1571
|
+
}, An = () => {
|
|
1458
1572
|
let e;
|
|
1459
1573
|
return {
|
|
1460
1574
|
name: "csp-violation",
|
|
@@ -1462,8 +1576,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1462
1576
|
if (typeof window > "u" || typeof document > "u") return;
|
|
1463
1577
|
let n = (e) => {
|
|
1464
1578
|
if (!t.isSampled()) return;
|
|
1465
|
-
let n = Date.now(), r =
|
|
1466
|
-
t.startSpan("csp.violation", S(S(S({}, t.config.hooks.getPageAttributes()), M({
|
|
1579
|
+
let n = Date.now(), r = kn(t.config.hooks.redactUrl, e.blockedURI), i = e.sourceFile ? t.config.hooks.redactUrl(e.sourceFile) : void 0, a = S(S(S({}, t.config.hooks.getPageAttributes()), P({
|
|
1467
1580
|
outcome: A.error,
|
|
1468
1581
|
spanType: j.error
|
|
1469
1582
|
})), {}, {
|
|
@@ -1477,7 +1590,11 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1477
1590
|
"csp.status_code": e.statusCode,
|
|
1478
1591
|
"csp.original_policy": e.originalPolicy,
|
|
1479
1592
|
"error.source": "csp"
|
|
1480
|
-
})
|
|
1593
|
+
});
|
|
1594
|
+
t.startSpan(N({
|
|
1595
|
+
attributes: a,
|
|
1596
|
+
spanType: j.error
|
|
1597
|
+
}), a, { startTime: n }).end(n);
|
|
1481
1598
|
};
|
|
1482
1599
|
document.addEventListener("securitypolicyviolation", n), e = () => document.removeEventListener("securitypolicyviolation", n);
|
|
1483
1600
|
},
|
|
@@ -1485,7 +1602,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1485
1602
|
e == null || e(), e = void 0;
|
|
1486
1603
|
}
|
|
1487
1604
|
};
|
|
1488
|
-
},
|
|
1605
|
+
}, jn = (e) => {
|
|
1489
1606
|
if (e instanceof Error) return e.message;
|
|
1490
1607
|
if (typeof e == "string") return e;
|
|
1491
1608
|
try {
|
|
@@ -1493,29 +1610,33 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1493
1610
|
} catch (t) {
|
|
1494
1611
|
return String(e);
|
|
1495
1612
|
}
|
|
1496
|
-
},
|
|
1613
|
+
}, Mn = ({ context: e, error: n, exceptionType: r, extra: i = {}, source: a }) => {
|
|
1497
1614
|
if (!e.isSampled()) return;
|
|
1498
|
-
let
|
|
1615
|
+
let o = Date.now(), s = jn(n);
|
|
1499
1616
|
e.notifyActivity({
|
|
1500
|
-
time:
|
|
1617
|
+
time: o,
|
|
1501
1618
|
type: "error"
|
|
1502
1619
|
});
|
|
1503
|
-
let l = n instanceof Error ? n : {
|
|
1504
|
-
message:
|
|
1505
|
-
name:
|
|
1506
|
-
}, u = S(S(S(S({}, e.config.hooks.getPageAttributes()), e.config.hooks.getErrorAttributes()),
|
|
1620
|
+
let c = r == null ? n instanceof Error ? n.name || "Error" : a : r, l = n instanceof Error ? n : {
|
|
1621
|
+
message: s,
|
|
1622
|
+
name: c
|
|
1623
|
+
}, u = S(S(S(S({}, e.config.hooks.getPageAttributes()), e.config.hooks.getErrorAttributes()), P({
|
|
1507
1624
|
outcome: A.error,
|
|
1508
1625
|
spanType: j.error
|
|
1509
1626
|
})), {}, {
|
|
1510
|
-
"error.message":
|
|
1627
|
+
"error.message": s,
|
|
1511
1628
|
"error.handled": !1,
|
|
1512
1629
|
"error.source": a
|
|
1513
|
-
}, i), d = e.startSpan(
|
|
1630
|
+
}, i), d = e.startSpan(N({
|
|
1631
|
+
attributes: u,
|
|
1632
|
+
nameHint: c,
|
|
1633
|
+
spanType: j.error
|
|
1634
|
+
}), u, { startTime: o });
|
|
1514
1635
|
d.recordException(l), d.setStatus({
|
|
1515
1636
|
code: t.ERROR,
|
|
1516
|
-
message:
|
|
1637
|
+
message: s
|
|
1517
1638
|
}), d.end();
|
|
1518
|
-
},
|
|
1639
|
+
}, Nn = () => {
|
|
1519
1640
|
let e = [];
|
|
1520
1641
|
return {
|
|
1521
1642
|
name: "error",
|
|
@@ -1523,9 +1644,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1523
1644
|
if (typeof window > "u") return;
|
|
1524
1645
|
let n = (e) => {
|
|
1525
1646
|
var n;
|
|
1526
|
-
|
|
1647
|
+
Mn({
|
|
1527
1648
|
context: t,
|
|
1528
|
-
spanName: "browser.error",
|
|
1529
1649
|
source: "window.error",
|
|
1530
1650
|
error: (n = e.error) == null ? e.message : n,
|
|
1531
1651
|
extra: {
|
|
@@ -1535,9 +1655,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1535
1655
|
}
|
|
1536
1656
|
});
|
|
1537
1657
|
}, r = (e) => {
|
|
1538
|
-
|
|
1658
|
+
Mn({
|
|
1539
1659
|
context: t,
|
|
1540
|
-
spanName: "browser.unhandledrejection",
|
|
1541
1660
|
source: "unhandledrejection",
|
|
1542
1661
|
error: e.reason,
|
|
1543
1662
|
exceptionType: e.reason instanceof Error ? e.reason.name : "UnhandledRejection"
|
|
@@ -1547,9 +1666,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1547
1666
|
let n = e.target;
|
|
1548
1667
|
if (!(n instanceof Element)) return;
|
|
1549
1668
|
let r = n, i = r.src || r.href || n.currentSrc || "";
|
|
1550
|
-
|
|
1669
|
+
Mn({
|
|
1551
1670
|
context: t,
|
|
1552
|
-
spanName: "browser.resource_error",
|
|
1553
1671
|
source: "resource",
|
|
1554
1672
|
error: /* @__PURE__ */ Error(`Resource load failed: ${n.tagName.toLowerCase()} ${i}`),
|
|
1555
1673
|
exceptionType: "ResourceError",
|
|
@@ -1565,7 +1683,7 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1565
1683
|
}
|
|
1566
1684
|
}
|
|
1567
1685
|
};
|
|
1568
|
-
},
|
|
1686
|
+
}, Pn = 50, Fn = (e, t) => typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : t, In = (e) => Number.isFinite(e) ? e : void 0, Ln = (e, t) => S(S(S(S(S({}, e.containerId ? { "long_task.attribution.container_id": e.containerId } : {}), e.containerName ? { "long_task.attribution.container_name": e.containerName } : {}), e.containerSrc ? { "long_task.attribution.container_src": t(e.containerSrc) } : {}), e.containerType ? { "long_task.attribution.container_type": e.containerType } : {}), e.name ? { "long_task.attribution.name": e.name } : {}), Rn = (e, t) => ({
|
|
1569
1687
|
"long_task.script.duration": e.duration,
|
|
1570
1688
|
"long_task.script.execution_start": e.executionStart,
|
|
1571
1689
|
"long_task.script.forced_style_and_layout_duration": e.forcedStyleAndLayoutDuration,
|
|
@@ -1577,8 +1695,8 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1577
1695
|
"long_task.script.source_url": e.sourceURL ? t(e.sourceURL) : "",
|
|
1578
1696
|
"long_task.script.start_time": e.startTime,
|
|
1579
1697
|
"long_task.script.window_attribution": e.windowAttribution
|
|
1580
|
-
}),
|
|
1581
|
-
let t =
|
|
1698
|
+
}), zn = (e = {}) => {
|
|
1699
|
+
let t = Fn(e.threshold, Pn), n, r, i = [];
|
|
1582
1700
|
return {
|
|
1583
1701
|
name: "long-task",
|
|
1584
1702
|
init(e) {
|
|
@@ -1589,16 +1707,19 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1589
1707
|
let c = (n) => {
|
|
1590
1708
|
var r, i;
|
|
1591
1709
|
if (!e.isSampled() || !Number.isFinite(n.duration) || n.duration < t) return;
|
|
1592
|
-
let a = n.entryType === "long-animation-frame", o = a ? n : void 0, s = (r = o == null ? void 0 : o.scripts) == null ? [] : r, c = h("long-task"), l = performance.timeOrigin + n.startTime, u = l + n.duration, d = a ? "long-animation-frame" : "long-task", f = a || (i = n.attribution) == null ? [] : i, p =
|
|
1710
|
+
let a = n.entryType === "long-animation-frame", o = a ? n : void 0, s = (r = o == null ? void 0 : o.scripts) == null ? [] : r, c = h("long-task"), l = performance.timeOrigin + n.startTime, u = l + n.duration, d = a ? "long-animation-frame" : "long-task", f = a || (i = n.attribution) == null ? [] : i, p = S(S(S(S(S(S({}, e.config.hooks.getPageAttributes()), P({ spanType: j.longTask })), In(o == null ? void 0 : o.blockingDuration) === void 0 ? {} : { [g.longTaskBlockingDuration]: o.blockingDuration }), {}, {
|
|
1593
1711
|
[g.longTaskEntryType]: d,
|
|
1594
1712
|
[g.longTaskId]: c,
|
|
1595
1713
|
"long_task.name": n.name
|
|
1596
|
-
},
|
|
1714
|
+
}, In(o == null ? void 0 : o.firstUIEventTimestamp) === void 0 ? {} : { "long_task.first_ui_event_timestamp": o.firstUIEventTimestamp }), In(o == null ? void 0 : o.renderStart) === void 0 ? {} : { "long_task.render_start": o.renderStart }), In(o == null ? void 0 : o.styleAndLayoutStart) === void 0 ? {} : { "long_task.style_and_layout_start": o.styleAndLayoutStart }), m = e.startSpan(N({
|
|
1715
|
+
attributes: p,
|
|
1716
|
+
spanType: j.longTask
|
|
1717
|
+
}), p, { startTime: l });
|
|
1597
1718
|
s.forEach((t) => {
|
|
1598
|
-
|
|
1719
|
+
m.addEvent("long_task.script", e.applyRedact(Rn(t, e.config.hooks.redactUrl)), performance.timeOrigin + t.startTime);
|
|
1599
1720
|
}), f.forEach((t, n) => {
|
|
1600
|
-
|
|
1601
|
-
}),
|
|
1721
|
+
m.addEvent("long_task.attribution", e.applyRedact(S({ "long_task.attribution.index": n }, Ln(t, e.config.hooks.redactUrl))), l);
|
|
1722
|
+
}), m.end(u), e.notifyActivity({
|
|
1602
1723
|
endTime: u,
|
|
1603
1724
|
startTime: l,
|
|
1604
1725
|
type: "long_task"
|
|
@@ -1624,43 +1745,43 @@ var Ne = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1624
1745
|
n == null || n.disconnect(), n = void 0, clearTimeout(r), r = void 0, i = [];
|
|
1625
1746
|
}
|
|
1626
1747
|
};
|
|
1627
|
-
},
|
|
1628
|
-
let n =
|
|
1629
|
-
|
|
1748
|
+
}, Bn = /* @__PURE__ */ new Set(), K = "", q, J, Vn = !1, Y = () => typeof location > "u" ? "" : location.href, Hn = (e, t) => {
|
|
1749
|
+
let n = Y();
|
|
1750
|
+
K = n;
|
|
1630
1751
|
let r = {
|
|
1631
1752
|
fromUrl: t,
|
|
1632
1753
|
source: e,
|
|
1633
1754
|
toUrl: n
|
|
1634
1755
|
};
|
|
1635
|
-
for (let e of Array.from(
|
|
1636
|
-
},
|
|
1637
|
-
|
|
1638
|
-
},
|
|
1639
|
-
|
|
1640
|
-
},
|
|
1641
|
-
|
|
1642
|
-
let r =
|
|
1756
|
+
for (let e of Array.from(Bn)) e(r);
|
|
1757
|
+
}, Un = () => {
|
|
1758
|
+
Hn("popstate", K || Y());
|
|
1759
|
+
}, Wn = () => {
|
|
1760
|
+
Hn("hashchange", K || Y());
|
|
1761
|
+
}, Gn = () => {
|
|
1762
|
+
Vn || typeof window > "u" || typeof history > "u" || (Vn = !0, K = Y(), q = history.pushState, J = history.replaceState, history.pushState = function(e, t, n) {
|
|
1763
|
+
let r = K || Y(), i = q == null ? void 0 : q.apply(this, [
|
|
1643
1764
|
e,
|
|
1644
1765
|
t,
|
|
1645
1766
|
n
|
|
1646
1767
|
]);
|
|
1647
|
-
return
|
|
1768
|
+
return Hn("pushState", r), i;
|
|
1648
1769
|
}, history.replaceState = function(e, t, n) {
|
|
1649
|
-
let r =
|
|
1770
|
+
let r = K || Y(), i = J == null ? void 0 : J.apply(this, [
|
|
1650
1771
|
e,
|
|
1651
1772
|
t,
|
|
1652
1773
|
n
|
|
1653
1774
|
]);
|
|
1654
|
-
return
|
|
1655
|
-
}, window.addEventListener("popstate",
|
|
1656
|
-
},
|
|
1657
|
-
!
|
|
1658
|
-
},
|
|
1659
|
-
|
|
1775
|
+
return Hn("replaceState", r), i;
|
|
1776
|
+
}, window.addEventListener("popstate", Un), window.addEventListener("hashchange", Wn));
|
|
1777
|
+
}, Kn = () => {
|
|
1778
|
+
!Vn || typeof window > "u" || typeof history > "u" || (q && (history.pushState = q), J && (history.replaceState = J), window.removeEventListener("popstate", Un), window.removeEventListener("hashchange", Wn), q = void 0, J = void 0, Vn = !1, K = "");
|
|
1779
|
+
}, qn = (e) => typeof window > "u" || typeof history > "u" ? () => {} : (Gn(), Bn.add(e), () => {
|
|
1780
|
+
Bn.delete(e), Bn.size === 0 && Kn();
|
|
1660
1781
|
});
|
|
1661
1782
|
//#endregion
|
|
1662
1783
|
//#region \0@oxc-project+runtime@0.128.0/helpers/objectWithoutPropertiesLoose.js
|
|
1663
|
-
function
|
|
1784
|
+
function Jn(e, t) {
|
|
1664
1785
|
if (e == null) return {};
|
|
1665
1786
|
var n = {};
|
|
1666
1787
|
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
|
|
@@ -1671,9 +1792,9 @@ function Un(e, t) {
|
|
|
1671
1792
|
}
|
|
1672
1793
|
//#endregion
|
|
1673
1794
|
//#region \0@oxc-project+runtime@0.128.0/helpers/objectWithoutProperties.js
|
|
1674
|
-
function
|
|
1795
|
+
function Yn(e, t) {
|
|
1675
1796
|
if (e == null) return {};
|
|
1676
|
-
var n, r, i =
|
|
1797
|
+
var n, r, i = Jn(e, t);
|
|
1677
1798
|
if (Object.getOwnPropertySymbols) {
|
|
1678
1799
|
var a = Object.getOwnPropertySymbols(e);
|
|
1679
1800
|
for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
|
|
@@ -1682,7 +1803,7 @@ function Wn(e, t) {
|
|
|
1682
1803
|
}
|
|
1683
1804
|
//#endregion
|
|
1684
1805
|
//#region src/plugins/page-view.ts
|
|
1685
|
-
var
|
|
1806
|
+
var Xn = ["stopLoadingTime"], Zn = new Set(Object.values(g)), Qn = () => typeof location > "u" ? "" : location.href, $n = () => {
|
|
1686
1807
|
if (typeof performance > "u") return {};
|
|
1687
1808
|
let e = performance.getEntriesByType("navigation")[0];
|
|
1688
1809
|
if (!e) return {};
|
|
@@ -1690,10 +1811,10 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
1690
1811
|
Number.isFinite(n) && n > 0 && (t[e] = n);
|
|
1691
1812
|
};
|
|
1692
1813
|
return n(g.viewFirstByte, e.responseStart), n(g.viewDomInteractive, e.domInteractive), n(g.viewDomContentLoaded, e.domContentLoadedEventEnd), n(g.viewDomComplete, e.domComplete), n(g.viewLoadEvent, e.loadEventEnd), t;
|
|
1693
|
-
},
|
|
1814
|
+
}, er = (e) => {
|
|
1694
1815
|
let t = e.indexOf("?");
|
|
1695
1816
|
return t < 0 ? e : e.slice(0, t);
|
|
1696
|
-
},
|
|
1817
|
+
}, tr = (e) => {
|
|
1697
1818
|
let t = e.slice(1);
|
|
1698
1819
|
if (!t || typeof document > "u" || typeof document.getElementById != "function") return !1;
|
|
1699
1820
|
try {
|
|
@@ -1701,29 +1822,35 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
1701
1822
|
} catch (e) {
|
|
1702
1823
|
return !!document.getElementById(t);
|
|
1703
1824
|
}
|
|
1704
|
-
},
|
|
1825
|
+
}, nr = (e, t) => {
|
|
1705
1826
|
try {
|
|
1706
1827
|
let n = typeof location > "u" ? "http://localhost" : location.href, r = new URL(e, n), i = new URL(t, n);
|
|
1707
|
-
return r.pathname !== i.pathname || !
|
|
1828
|
+
return r.pathname !== i.pathname || !tr(i.hash) && er(r.hash) !== er(i.hash);
|
|
1708
1829
|
} catch (n) {
|
|
1709
1830
|
return e !== t;
|
|
1710
1831
|
}
|
|
1711
|
-
},
|
|
1832
|
+
}, rr = () => {
|
|
1712
1833
|
let e = [];
|
|
1713
1834
|
return {
|
|
1714
1835
|
name: "page-view",
|
|
1715
1836
|
init(t) {
|
|
1716
1837
|
if (typeof window > "u") return;
|
|
1717
1838
|
let n, r, i, a = (e = Date.now()) => t.setView({}, e), o = (e, n, r = Date.now(), i) => {
|
|
1718
|
-
e.version += 1
|
|
1839
|
+
e.version += 1;
|
|
1840
|
+
let a = S(S(S(S(S({}, t.config.hooks.getPageAttributes()), e.attributes), e.snapshotAttributes), {}, {
|
|
1719
1841
|
[g.viewPhase]: n,
|
|
1720
1842
|
[g.viewStartedAt]: e.startedAt,
|
|
1721
1843
|
[g.viewVersion]: e.version
|
|
1722
1844
|
}, i ? { "view.end_reason": i } : {}), e.loadingTime === void 0 ? {} : {
|
|
1723
1845
|
[g.viewLoadingTime]: e.loadingTime,
|
|
1724
1846
|
[g.viewLoadingTimeSource]: e.loadingTimeSource
|
|
1725
|
-
})
|
|
1847
|
+
});
|
|
1848
|
+
t.startSpan(N({
|
|
1849
|
+
attributes: a,
|
|
1850
|
+
spanType: j.view
|
|
1851
|
+
}), a, {
|
|
1726
1852
|
contextTime: r,
|
|
1853
|
+
rumSpanType: j.view,
|
|
1727
1854
|
startTime: r
|
|
1728
1855
|
}).end(r);
|
|
1729
1856
|
}, s = (e, t = !0, r = Date.now()) => {
|
|
@@ -1735,10 +1862,10 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
1735
1862
|
let s = S({}, n);
|
|
1736
1863
|
(i = n.stopLoadingTime) == null || i.call(n), o(n, "end", r, e), n = void 0, t && a(r);
|
|
1737
1864
|
let { stopLoadingTime: c } = s;
|
|
1738
|
-
return
|
|
1865
|
+
return Yn(s, Xn);
|
|
1739
1866
|
}, c = (e, t, r) => {
|
|
1740
1867
|
if (n !== e || !Number.isFinite(t) || t < 0) return;
|
|
1741
|
-
let i = S(S({}, e.loadingType === "initial_load" ?
|
|
1868
|
+
let i = S(S({}, e.loadingType === "initial_load" ? $n() : {}), {}, {
|
|
1742
1869
|
[g.viewLoadingTime]: t,
|
|
1743
1870
|
[g.viewLoadingTimeSource]: r
|
|
1744
1871
|
});
|
|
@@ -1774,39 +1901,39 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
1774
1901
|
}, d();
|
|
1775
1902
|
}, u = (e) => {
|
|
1776
1903
|
let n = t.applyRedact(e == null ? {} : e);
|
|
1777
|
-
return Object.fromEntries(Object.entries(n).filter(([e, t]) => t !== void 0 && !
|
|
1904
|
+
return Object.fromEntries(Object.entries(n).filter(([e, t]) => t !== void 0 && !Zn.has(e)));
|
|
1778
1905
|
}, d = (e, r, i, a = ((e) => (e = n == null ? void 0 : n.rawUrl) == null ? "" : e)()) => {
|
|
1779
|
-
var c;
|
|
1906
|
+
var c, d;
|
|
1780
1907
|
if (!t.isSessionActive()) return;
|
|
1781
|
-
let
|
|
1908
|
+
let f = (c = e.url) == null ? Qn() : c, p = t.config.hooks.getViewUrlTemplate(f), m = a ? t.config.hooks.getViewUrlTemplate(a) : "", _ = (d = e.name) == null ? p : d, v = u(e.attributes);
|
|
1782
1909
|
s(r, !1);
|
|
1783
|
-
let
|
|
1910
|
+
let y = h("view"), b = t.config.hooks.redactUrl(f), x = t.config.hooks.redactUrl(a), C = i === "initial_load", w = C && typeof performance < "u" ? performance.timeOrigin : Date.now(), T = C ? $n() : {};
|
|
1784
1911
|
t.setView({
|
|
1785
|
-
attributes:
|
|
1786
|
-
id:
|
|
1912
|
+
attributes: v,
|
|
1913
|
+
id: y,
|
|
1787
1914
|
loadingType: i,
|
|
1788
|
-
name:
|
|
1789
|
-
startedAt:
|
|
1790
|
-
url:
|
|
1791
|
-
urlTemplate:
|
|
1792
|
-
},
|
|
1793
|
-
attributes:
|
|
1915
|
+
name: _,
|
|
1916
|
+
startedAt: w,
|
|
1917
|
+
url: b,
|
|
1918
|
+
urlTemplate: p
|
|
1919
|
+
}, w), n = {
|
|
1920
|
+
attributes: v,
|
|
1794
1921
|
version: 0,
|
|
1795
|
-
id:
|
|
1922
|
+
id: y,
|
|
1796
1923
|
loadingType: i,
|
|
1797
|
-
name:
|
|
1798
|
-
rawUrl:
|
|
1799
|
-
snapshotAttributes: S(S(S(S(S(S({},
|
|
1800
|
-
[g.viewUrl]:
|
|
1801
|
-
[g.viewUrlTemplate]:
|
|
1924
|
+
name: _,
|
|
1925
|
+
rawUrl: f,
|
|
1926
|
+
snapshotAttributes: S(S(S(S(S(S({}, v), t.config.hooks.getPageAttributes()), T), P({ spanType: j.view })), {}, { [g.viewId]: y }, _ ? { [g.viewName]: _ } : {}), {}, {
|
|
1927
|
+
[g.viewUrl]: b,
|
|
1928
|
+
[g.viewUrlTemplate]: p,
|
|
1802
1929
|
[g.viewLoadingType]: i,
|
|
1803
|
-
[g.viewPrevious]:
|
|
1804
|
-
[g.viewPreviousUrlTemplate]:
|
|
1805
|
-
},
|
|
1806
|
-
startedAt:
|
|
1807
|
-
url:
|
|
1808
|
-
urlTemplate:
|
|
1809
|
-
}, o(n, "start",
|
|
1930
|
+
[g.viewPrevious]: x,
|
|
1931
|
+
[g.viewPreviousUrlTemplate]: m
|
|
1932
|
+
}, C && document.referrer ? { [g.viewReferrer]: t.config.hooks.redactUrl(document.referrer) } : {}),
|
|
1933
|
+
startedAt: w,
|
|
1934
|
+
url: b,
|
|
1935
|
+
urlTemplate: p
|
|
1936
|
+
}, o(n, "start", w), l(n);
|
|
1810
1937
|
}, f = t.onViewCommand((e) => {
|
|
1811
1938
|
if (e.type === "start") {
|
|
1812
1939
|
d(e.options, "manual", n ? "route_change" : "initial_load");
|
|
@@ -1829,8 +1956,8 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
1829
1956
|
}), o(n, "update"));
|
|
1830
1957
|
}
|
|
1831
1958
|
}), p = () => {};
|
|
1832
|
-
t.config.view.tracking === "auto" && (n || d({}, "load", "initial_load"), p =
|
|
1833
|
-
|
|
1959
|
+
t.config.view.tracking === "auto" && (n || d({}, "load", "initial_load"), p = qn((e) => {
|
|
1960
|
+
nr(e.fromUrl, e.toUrl) && d({}, e.source, "route_change", e.fromUrl);
|
|
1834
1961
|
}));
|
|
1835
1962
|
let m = (e) => {
|
|
1836
1963
|
if (e.persisted) {
|
|
@@ -1872,7 +1999,7 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
1872
1999
|
}
|
|
1873
2000
|
}
|
|
1874
2001
|
};
|
|
1875
|
-
},
|
|
2002
|
+
}, ir = 5e3, ar = (e) => typeof e == "number" && Number.isFinite(e) && e > 0, or = (e, t, n, r) => ({
|
|
1876
2003
|
expiresAt: Math.min(t + n, t + r),
|
|
1877
2004
|
id: e,
|
|
1878
2005
|
startedAt: t,
|
|
@@ -1880,19 +2007,19 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
1880
2007
|
}), X = (e, t, n) => {
|
|
1881
2008
|
if (t >= e.startedAt + n) return "maxLifetime";
|
|
1882
2009
|
if (t >= e.expiresAt) return "inactivity";
|
|
1883
|
-
},
|
|
2010
|
+
}, sr = (e, t, n, r) => S(S({}, e), {}, { expiresAt: Math.min(t + n, e.startedAt + r) }), cr = (e, t, n) => {
|
|
1884
2011
|
if (!e) return null;
|
|
1885
2012
|
try {
|
|
1886
2013
|
let r = JSON.parse(e);
|
|
1887
|
-
if (r.status === "active" && typeof r.id == "string" && r.id.length > 0 &&
|
|
2014
|
+
if (r.status === "active" && typeof r.id == "string" && r.id.length > 0 && ar(r.startedAt) && r.startedAt <= t + ir && ar(r.expiresAt) && r.expiresAt >= r.startedAt && r.expiresAt <= r.startedAt + n || r.status === "expired" && typeof r.previousId == "string" && r.previousId.length > 0 && (r.reason === "inactivity" || r.reason === "maxLifetime") && ar(r.expiredAt) && r.expiredAt <= t + ir) return r;
|
|
1888
2015
|
} catch (e) {}
|
|
1889
2016
|
return null;
|
|
1890
|
-
},
|
|
2017
|
+
}, lr = 900 * 1e3, Z = 14400 * 1e3, ur = 1e3, dr = 6e4, fr = [
|
|
1891
2018
|
"click",
|
|
1892
2019
|
"keydown",
|
|
1893
2020
|
"scroll",
|
|
1894
2021
|
"touchstart"
|
|
1895
|
-
],
|
|
2022
|
+
], pr = /* @__PURE__ */ new Map(), mr = (e) => {
|
|
1896
2023
|
let t = typeof window < "u", n = () => {
|
|
1897
2024
|
var n;
|
|
1898
2025
|
if (t) try {
|
|
@@ -1900,21 +2027,21 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
1900
2027
|
} catch (e) {
|
|
1901
2028
|
t = !1;
|
|
1902
2029
|
}
|
|
1903
|
-
return (n =
|
|
2030
|
+
return (n = pr.get(e)) == null ? null : n;
|
|
1904
2031
|
};
|
|
1905
2032
|
return n(), {
|
|
1906
2033
|
isLocalStorage: () => t,
|
|
1907
2034
|
read: n,
|
|
1908
2035
|
write: (n) => {
|
|
1909
2036
|
let r = JSON.stringify(n);
|
|
1910
|
-
if (
|
|
2037
|
+
if (pr.set(e, r), t) try {
|
|
1911
2038
|
window.localStorage.setItem(e, r);
|
|
1912
2039
|
} catch (e) {
|
|
1913
2040
|
t = !1;
|
|
1914
2041
|
}
|
|
1915
2042
|
}
|
|
1916
2043
|
};
|
|
1917
|
-
},
|
|
2044
|
+
}, hr = (e, t) => {
|
|
1918
2045
|
let n = "";
|
|
1919
2046
|
try {
|
|
1920
2047
|
n = new URL(e).host;
|
|
@@ -1922,17 +2049,21 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
1922
2049
|
n = e;
|
|
1923
2050
|
}
|
|
1924
2051
|
return `bk_ot_session__${m(`${t}\0${n || "default"}`)}`;
|
|
1925
|
-
},
|
|
1926
|
-
|
|
2052
|
+
}, gr = (e, t, n, r) => {
|
|
2053
|
+
let i = S(S(S({}, e.config.hooks.getPageAttributes()), P({ spanType: j.session })), {}, {
|
|
1927
2054
|
[g.sessionPhase]: t,
|
|
1928
2055
|
[g.sessionHasReplay]: !1,
|
|
1929
2056
|
[g.sessionId]: n,
|
|
1930
2057
|
[g.sessionType]: "user"
|
|
1931
|
-
})
|
|
2058
|
+
});
|
|
2059
|
+
e.startSpan(N({
|
|
2060
|
+
attributes: i,
|
|
2061
|
+
spanType: j.session
|
|
2062
|
+
}), i, {
|
|
1932
2063
|
contextTime: r,
|
|
1933
2064
|
startTime: r
|
|
1934
2065
|
}).end(r);
|
|
1935
|
-
},
|
|
2066
|
+
}, _r = (e = {}) => {
|
|
1936
2067
|
let t = [];
|
|
1937
2068
|
return {
|
|
1938
2069
|
name: "session",
|
|
@@ -1947,7 +2078,7 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
1947
2078
|
}, e);
|
|
1948
2079
|
return;
|
|
1949
2080
|
}
|
|
1950
|
-
let i = (r = e.storageKey) == null ?
|
|
2081
|
+
let i = (r = e.storageKey) == null ? hr(n.config.transport.endpoint, n.config.application.name) : r, a = mr(i), o = typeof performance < "u" && Number.isFinite(performance.timeOrigin) ? performance.timeOrigin : Date.now(), s, c, l = (e = Date.now()) => cr(a.read(), e, Z), u = () => {
|
|
1951
2082
|
c !== void 0 && (clearTimeout(c), c = void 0);
|
|
1952
2083
|
}, d = (e, t = Date.now()) => {
|
|
1953
2084
|
let r = s;
|
|
@@ -1956,7 +2087,7 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
1956
2087
|
id: r,
|
|
1957
2088
|
reason: e,
|
|
1958
2089
|
type: "expired"
|
|
1959
|
-
}),
|
|
2090
|
+
}), gr(n, "end", r, t), u(), s = void 0, n.setRuntimeAttributes({
|
|
1960
2091
|
[g.sessionHasReplay]: void 0,
|
|
1961
2092
|
[g.sessionId]: void 0,
|
|
1962
2093
|
[g.sessionType]: void 0
|
|
@@ -2007,15 +2138,15 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2007
2138
|
}, _ = (e = !1) => {
|
|
2008
2139
|
let t = Date.now(), r = l(t);
|
|
2009
2140
|
if ((r == null ? void 0 : r.status) === "active" && !X(r, t, Z)) {
|
|
2010
|
-
let e =
|
|
2141
|
+
let e = sr(r, t, lr, Z);
|
|
2011
2142
|
a.write(e), m(e, s ? void 0 : { reason: "shared" });
|
|
2012
2143
|
return;
|
|
2013
2144
|
}
|
|
2014
|
-
let i = (r == null ? void 0 : r.status) === "expired" ? r.previousId : r == null ? void 0 : r.id, o = (r == null ? void 0 : r.status) === "expired" ? r.reason : r ? X(r, t, Z) : e ? "init" : void 0, c =
|
|
2145
|
+
let i = (r == null ? void 0 : r.status) === "expired" ? r.previousId : r == null ? void 0 : r.id, o = (r == null ? void 0 : r.status) === "expired" ? r.reason : r ? X(r, t, Z) : e ? "init" : void 0, c = or(h("session"), t, lr, Z);
|
|
2015
2146
|
a.write(c), m(c, {
|
|
2016
2147
|
previousId: i,
|
|
2017
2148
|
reason: o == null ? "init" : o
|
|
2018
|
-
}),
|
|
2149
|
+
}), gr(n, (o == null ? "init" : o) === "init" ? "start" : "rotate", c.id, c.startedAt);
|
|
2019
2150
|
}, v = () => {
|
|
2020
2151
|
if (!s) return;
|
|
2021
2152
|
let e = Date.now(), t = l(e);
|
|
@@ -2023,31 +2154,31 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2023
2154
|
f();
|
|
2024
2155
|
return;
|
|
2025
2156
|
}
|
|
2026
|
-
let n =
|
|
2157
|
+
let n = sr(t, e, lr, Z);
|
|
2027
2158
|
a.write(n), m(n);
|
|
2028
2159
|
};
|
|
2029
2160
|
_(!0);
|
|
2030
2161
|
let y = 0, b = () => {
|
|
2031
2162
|
let e = Date.now();
|
|
2032
|
-
e - y <
|
|
2163
|
+
e - y < ur || (y = e, _());
|
|
2033
2164
|
}, x = {
|
|
2034
2165
|
capture: !0,
|
|
2035
2166
|
passive: !0
|
|
2036
2167
|
};
|
|
2037
|
-
|
|
2038
|
-
|
|
2168
|
+
fr.forEach((e) => window.addEventListener(e, b, x)), t.push(() => {
|
|
2169
|
+
fr.forEach((e) => window.removeEventListener(e, b, x));
|
|
2039
2170
|
});
|
|
2040
2171
|
let S = () => {
|
|
2041
2172
|
document.visibilityState === "visible" && v();
|
|
2042
2173
|
};
|
|
2043
2174
|
document.addEventListener("visibilitychange", S);
|
|
2044
|
-
let C = window.setInterval(S,
|
|
2175
|
+
let C = window.setInterval(S, dr);
|
|
2045
2176
|
t.push(() => {
|
|
2046
2177
|
document.removeEventListener("visibilitychange", S), window.clearInterval(C);
|
|
2047
2178
|
});
|
|
2048
2179
|
let w = (e) => {
|
|
2049
2180
|
if (!a.isLocalStorage() || e.storageArea !== window.localStorage || e.key !== i) return;
|
|
2050
|
-
let t = Date.now(), n =
|
|
2181
|
+
let t = Date.now(), n = cr(e.newValue, t, Z);
|
|
2051
2182
|
if ((n == null ? void 0 : n.status) === "active" && n.id === s && !X(n, t, Z)) {
|
|
2052
2183
|
p(n);
|
|
2053
2184
|
return;
|
|
@@ -2060,38 +2191,38 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2060
2191
|
for (var e; t.length;) (e = t.pop()) == null || e();
|
|
2061
2192
|
}
|
|
2062
2193
|
};
|
|
2063
|
-
},
|
|
2194
|
+
}, vr = 10, yr = 6e4, br = 5e3, xr = 1e3, Sr = (e, t) => !!t && e === t, Cr = (e, t) => {
|
|
2064
2195
|
let [n, r] = e === "CLS" ? [.1, .25] : [200, 500];
|
|
2065
2196
|
return t <= n ? "good" : t <= r ? "needs-improvement" : "poor";
|
|
2066
|
-
},
|
|
2197
|
+
}, wr = (e) => {
|
|
2067
2198
|
var t, n, r;
|
|
2068
2199
|
if (!(typeof Element > "u" || !(e instanceof Element))) return (t = (n = (r = e.getAttribute("data-bk-action-name")) == null ? e.getAttribute("aria-label") : r) == null ? e.getAttribute("name") : n) == null ? e.tagName.toLowerCase() : t;
|
|
2069
|
-
},
|
|
2200
|
+
}, Tr = () => {
|
|
2070
2201
|
if (typeof performance > "u") return;
|
|
2071
2202
|
let e = performance.interactionCount;
|
|
2072
2203
|
return typeof e == "number" && Number.isFinite(e) ? e : void 0;
|
|
2073
|
-
},
|
|
2204
|
+
}, Er = (e, t) => {
|
|
2074
2205
|
var n, r;
|
|
2075
2206
|
let i = (n = t.value) == null ? 0 : n;
|
|
2076
|
-
t.hadRecentInput || !Number.isFinite(i) || (e.clsWindowStart === void 0 || t.startTime - ((r = e.clsWindowEnd) == null ? t.startTime : r) >=
|
|
2077
|
-
},
|
|
2207
|
+
t.hadRecentInput || !Number.isFinite(i) || (e.clsWindowStart === void 0 || t.startTime - ((r = e.clsWindowEnd) == null ? t.startTime : r) >= xr || t.startTime - e.clsWindowStart >= br ? (e.clsWindowStart = t.startTime, e.clsWindowValue = i) : e.clsWindowValue += i, e.clsWindowEnd = t.startTime, e.clsWindowValue > e.cls && (e.cls = Math.round(e.clsWindowValue * 1e4) / 1e4));
|
|
2208
|
+
}, Dr = (e, t) => {
|
|
2078
2209
|
var n, r;
|
|
2079
2210
|
if (!t.interactionId || !Number.isFinite(t.duration)) return;
|
|
2080
2211
|
e.interactionIdMin = Math.min(e.interactionIdMin, t.interactionId), e.interactionIdMax = Math.max(e.interactionIdMax, t.interactionId);
|
|
2081
2212
|
let i = (n = t.processingStart) == null ? t.startTime : n, a = (r = t.processingEnd) == null ? i : r, o = {
|
|
2082
|
-
duration: Math.min(t.duration,
|
|
2213
|
+
duration: Math.min(t.duration, yr),
|
|
2083
2214
|
inputDelay: Math.max(0, i - t.startTime),
|
|
2084
2215
|
interactionId: t.interactionId,
|
|
2085
|
-
interactionTarget:
|
|
2216
|
+
interactionTarget: wr(t.target),
|
|
2086
2217
|
interactionType: t.name,
|
|
2087
2218
|
presentationDelay: Math.max(0, t.startTime + t.duration - a),
|
|
2088
2219
|
processingDuration: Math.max(0, a - i)
|
|
2089
2220
|
}, s = e.inpCandidates.findIndex((e) => e.interactionId === t.interactionId);
|
|
2090
|
-
s >= 0 ? o.duration > e.inpCandidates[s].duration && (e.inpCandidates[s] = o) : e.inpCandidates.push(o), e.inpCandidates.sort((e, t) => t.duration - e.duration).splice(
|
|
2091
|
-
},
|
|
2092
|
-
let t =
|
|
2221
|
+
s >= 0 ? o.duration > e.inpCandidates[s].duration && (e.inpCandidates[s] = o) : e.inpCandidates.push(o), e.inpCandidates.sort((e, t) => t.duration - e.duration).splice(vr);
|
|
2222
|
+
}, Or = (e) => {
|
|
2223
|
+
let t = Tr(), n = t !== void 0 && e.interactionCountAtStart !== void 0 ? Math.max(0, t - e.interactionCountAtStart) : e.interactionIdMin === Infinity ? 0 : (e.interactionIdMax - e.interactionIdMin) / 7 + 1;
|
|
2093
2224
|
if (e.inpCandidates.length) return e.inpCandidates[Math.min(e.inpCandidates.length - 1, Math.floor(n / 50))];
|
|
2094
|
-
},
|
|
2225
|
+
}, kr = (e, t) => {
|
|
2095
2226
|
var n;
|
|
2096
2227
|
let r = (n = e.attribution) == null ? {} : n, i = {}, a = (e) => r[e], o = (e, t, n) => {
|
|
2097
2228
|
t != null && (typeof t == "string" || typeof t == "number" || typeof t == "boolean") && (i[e] = typeof t == "string" && n ? n(t) : t);
|
|
@@ -2112,7 +2243,7 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2112
2243
|
default: break;
|
|
2113
2244
|
}
|
|
2114
2245
|
return i;
|
|
2115
|
-
},
|
|
2246
|
+
}, Ar = () => {
|
|
2116
2247
|
let e, t = !1;
|
|
2117
2248
|
return {
|
|
2118
2249
|
name: "web-vitals",
|
|
@@ -2132,15 +2263,18 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2132
2263
|
if (t) return;
|
|
2133
2264
|
let { onFCP: a, onLCP: o, onTTFB: s } = r, c = (e, t, r, i = r == null ? Date.now() : r) => {
|
|
2134
2265
|
if (!n.isSampled()) return;
|
|
2135
|
-
let a = e.name.toLowerCase()
|
|
2136
|
-
|
|
2137
|
-
outcome: Je(e.rating),
|
|
2266
|
+
let a = e.name.toLowerCase(), o = S(S(S(S({}, n.config.hooks.getPageAttributes()), t), P({
|
|
2267
|
+
outcome: Le(e.rating),
|
|
2138
2268
|
spanType: j.vital
|
|
2139
2269
|
})), {}, {
|
|
2140
2270
|
[g.vitalMetric]: a,
|
|
2141
2271
|
[g.vitalValue]: e.value,
|
|
2142
2272
|
"vital.id": e.id
|
|
2143
|
-
},
|
|
2273
|
+
}, kr(e, n.config.hooks.redactUrl));
|
|
2274
|
+
n.startSpan(N({
|
|
2275
|
+
attributes: o,
|
|
2276
|
+
spanType: j.vital
|
|
2277
|
+
}), o, {
|
|
2144
2278
|
contextTime: r,
|
|
2145
2279
|
startTime: i
|
|
2146
2280
|
}).end(i);
|
|
@@ -2158,10 +2292,10 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2158
2292
|
entries: [],
|
|
2159
2293
|
id: h("vital"),
|
|
2160
2294
|
name: "CLS",
|
|
2161
|
-
rating:
|
|
2295
|
+
rating: Cr("CLS", e.cls),
|
|
2162
2296
|
value: e.cls
|
|
2163
2297
|
}, e.runtimeAttributes, e.startedAt);
|
|
2164
|
-
let t =
|
|
2298
|
+
let t = Or(e);
|
|
2165
2299
|
t && p({
|
|
2166
2300
|
attribution: {
|
|
2167
2301
|
inputDelay: t.inputDelay,
|
|
@@ -2173,13 +2307,13 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2173
2307
|
entries: [],
|
|
2174
2308
|
id: h("vital"),
|
|
2175
2309
|
name: "INP",
|
|
2176
|
-
rating:
|
|
2310
|
+
rating: Cr("INP", t.duration),
|
|
2177
2311
|
value: t.duration
|
|
2178
2312
|
}, e.runtimeAttributes, e.startedAt);
|
|
2179
2313
|
}, _ = n.onViewChange((e) => {
|
|
2180
2314
|
var t;
|
|
2181
2315
|
let r = u;
|
|
2182
|
-
if (r &&
|
|
2316
|
+
if (r && Sr(r.id, e.id)) {
|
|
2183
2317
|
r.runtimeAttributes = S(S(S({}, r.runtimeAttributes), {}, { [g.viewId]: e.id }, e.name ? { [g.viewName]: e.name } : {}), {}, {
|
|
2184
2318
|
[g.viewUrl]: e.url,
|
|
2185
2319
|
[g.viewUrlTemplate]: e.urlTemplate
|
|
@@ -2189,7 +2323,7 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2189
2323
|
m(), u = e.id ? {
|
|
2190
2324
|
cls: 0,
|
|
2191
2325
|
clsWindowValue: 0,
|
|
2192
|
-
interactionCountAtStart:
|
|
2326
|
+
interactionCountAtStart: Tr(),
|
|
2193
2327
|
interactionIdMax: 0,
|
|
2194
2328
|
interactionIdMin: Infinity,
|
|
2195
2329
|
inpCandidates: [],
|
|
@@ -2201,12 +2335,12 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2201
2335
|
if (typeof PerformanceObserver < "u") {
|
|
2202
2336
|
var v, y;
|
|
2203
2337
|
(v = PerformanceObserver.supportedEntryTypes) != null && v.includes("layout-shift") && (f = new PerformanceObserver((e) => {
|
|
2204
|
-
if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt ||
|
|
2338
|
+
if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt || Er(u, t);
|
|
2205
2339
|
}), f.observe({
|
|
2206
2340
|
buffered: !0,
|
|
2207
2341
|
type: "layout-shift"
|
|
2208
2342
|
})), (y = PerformanceObserver.supportedEntryTypes) != null && y.includes("event") && (d = new PerformanceObserver((e) => {
|
|
2209
|
-
if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt || !t.interactionId || !Number.isFinite(t.duration) ||
|
|
2343
|
+
if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt || !t.interactionId || !Number.isFinite(t.duration) || Dr(u, t);
|
|
2210
2344
|
}), d.observe({
|
|
2211
2345
|
buffered: !0,
|
|
2212
2346
|
durationThreshold: 40,
|
|
@@ -2222,7 +2356,7 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2222
2356
|
t = !0, e == null || e(), e = void 0;
|
|
2223
2357
|
}
|
|
2224
2358
|
};
|
|
2225
|
-
},
|
|
2359
|
+
}, jr = (e, t) => {
|
|
2226
2360
|
let n = {
|
|
2227
2361
|
"network.protocol.name": "websocket",
|
|
2228
2362
|
"url.full": t(e)
|
|
@@ -2232,17 +2366,20 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2232
2366
|
n["server.address"] = t.hostname, t.port && (n["server.port"] = Number(t.port)), n["url.scheme"] = t.protocol.replace(":", "");
|
|
2233
2367
|
} catch (e) {}
|
|
2234
2368
|
return n;
|
|
2235
|
-
},
|
|
2236
|
-
let a = h("websocket"), o =
|
|
2369
|
+
}, Mr = (t, n, r, i) => {
|
|
2370
|
+
let a = h("websocket"), o = jr(r, n.config.hooks.redactUrl), s = !1, c = (t, r, s = {}) => {
|
|
2237
2371
|
if (i() || !n.isSampled()) return;
|
|
2238
|
-
let c = t === "error"
|
|
2239
|
-
n.startSpan("browser.websocket", S(S(S({}, o), M({
|
|
2372
|
+
let c = t === "error", l = S(S(S({}, o), P({
|
|
2240
2373
|
outcome: c ? A.error : A.success,
|
|
2241
2374
|
spanType: j.websocket
|
|
2242
2375
|
})), {}, {
|
|
2243
2376
|
[g.websocketPhase]: t,
|
|
2244
2377
|
"websocket.connection.id": a
|
|
2245
|
-
}, s)
|
|
2378
|
+
}, s);
|
|
2379
|
+
n.startSpan(N({
|
|
2380
|
+
attributes: l,
|
|
2381
|
+
spanType: j.websocket
|
|
2382
|
+
}), l, {
|
|
2246
2383
|
kind: e.CLIENT,
|
|
2247
2384
|
startTime: r
|
|
2248
2385
|
}).end(r);
|
|
@@ -2258,7 +2395,7 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2258
2395
|
"websocket.close.was_clean": e.wasClean
|
|
2259
2396
|
});
|
|
2260
2397
|
});
|
|
2261
|
-
},
|
|
2398
|
+
}, Nr = () => {
|
|
2262
2399
|
let e, t, n = !1;
|
|
2263
2400
|
return {
|
|
2264
2401
|
name: "websocket",
|
|
@@ -2269,29 +2406,29 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2269
2406
|
let a = Reflect.construct(e, t, i);
|
|
2270
2407
|
if (n || !r.isSampled()) return a;
|
|
2271
2408
|
let o = t[0] == null ? "" : String(t[0]);
|
|
2272
|
-
return o && !D(r.config, o) &&
|
|
2409
|
+
return o && !D(r.config, o) && Mr(a, r, o, () => n), a;
|
|
2273
2410
|
} }), window.WebSocket = t;
|
|
2274
2411
|
},
|
|
2275
2412
|
shutdown() {
|
|
2276
2413
|
n = !0, typeof window < "u" && e && window.WebSocket === t && (window.WebSocket = e), t = void 0, e = void 0;
|
|
2277
2414
|
}
|
|
2278
2415
|
};
|
|
2279
|
-
},
|
|
2416
|
+
}, Pr = class {
|
|
2280
2417
|
constructor() {
|
|
2281
2418
|
b(this, "listeners", /* @__PURE__ */ new Set()), b(this, "notify", (e) => {
|
|
2282
2419
|
this.listeners.forEach((t) => t(e));
|
|
2283
2420
|
}), b(this, "subscribe", (e) => (this.listeners.add(e), () => this.listeners.delete(e)));
|
|
2284
2421
|
}
|
|
2285
|
-
},
|
|
2422
|
+
}, Fr = (e) => {
|
|
2286
2423
|
let t = 2166136261;
|
|
2287
2424
|
for (let n = 0; n < e.length; n += 1) t = Math.imul(t ^ e.charCodeAt(n), 16777619);
|
|
2288
2425
|
return t += t << 13, t ^= t >>> 7, t += t << 3, t ^= t >>> 17, t += t << 5, (t >>> 0) / 4294967296;
|
|
2289
|
-
},
|
|
2426
|
+
}, Ir = ({ application: e, session: t }, n) => t.sampleRate <= 0 ? !1 : t.sampleRate >= 1 ? !0 : Fr(`${e.name}\0${n}`) < t.sampleRate, Lr = (e) => ({
|
|
2290
2427
|
url: e.endpoint,
|
|
2291
2428
|
headers: e.headers,
|
|
2292
2429
|
concurrencyLimit: e.concurrencyLimit,
|
|
2293
2430
|
timeoutMillis: e.timeoutMillis
|
|
2294
|
-
}),
|
|
2431
|
+
}), Rr = "bk-rum", zr = class {
|
|
2295
2432
|
constructor(e) {
|
|
2296
2433
|
this.isSampled = e;
|
|
2297
2434
|
}
|
|
@@ -2301,7 +2438,7 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2301
2438
|
toString() {
|
|
2302
2439
|
return "RumSessionSampler";
|
|
2303
2440
|
}
|
|
2304
|
-
}, Q,
|
|
2441
|
+
}, Q, Br = () => {
|
|
2305
2442
|
if (Q) Q.users += 1;
|
|
2306
2443
|
else {
|
|
2307
2444
|
let e = new a().enable(), t = r.setGlobalContextManager(e);
|
|
@@ -2316,28 +2453,28 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2316
2453
|
return () => {
|
|
2317
2454
|
e || !Q || (e = !0, --Q.users, !(Q.users > 0) && (Q.ownsContext && r.disable(), Q.ownsPropagator && i.disable(), Q = void 0));
|
|
2318
2455
|
};
|
|
2319
|
-
},
|
|
2456
|
+
}, Vr = (e, t) => t ? new Proxy(e, { get(e, t, n) {
|
|
2320
2457
|
if (t === "export") return (t, n) => {
|
|
2321
2458
|
var r;
|
|
2322
2459
|
return (r = globalThis.console) == null || r.log("[bk-ot][rum]", t), e.export(t, n);
|
|
2323
2460
|
};
|
|
2324
2461
|
let r = Reflect.get(e, t, n);
|
|
2325
2462
|
return typeof r == "function" ? r.bind(e) : r;
|
|
2326
|
-
} }) : e,
|
|
2327
|
-
|
|
2463
|
+
} }) : e, Hr = (e) => [Dn(e.tracking.request)], Ur = (e) => [
|
|
2464
|
+
_r(e.session),
|
|
2328
2465
|
...$(e.tracking.device, !0, ce),
|
|
2329
2466
|
_t(),
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
],
|
|
2333
|
-
...$(e.error, !0,
|
|
2334
|
-
...$(e.webVitals, !0,
|
|
2467
|
+
rr(),
|
|
2468
|
+
ln(Wr(e.tracking.resource, !0))
|
|
2469
|
+
], Wr = (e, t) => e === void 0 ? t : e !== !1, Gr = (e) => typeof e == "object" && e ? e : void 0, $ = (e, t, n) => Wr(e, t) ? [n(Gr(e))] : [], Kr = (e) => [
|
|
2470
|
+
...$(e.error, !0, Nn),
|
|
2471
|
+
...$(e.webVitals, !0, Ar),
|
|
2335
2472
|
...$(e.blankScreen, !0, Mt),
|
|
2336
2473
|
...$(e.action, !0, mt),
|
|
2337
|
-
...$(e.websocket, !1,
|
|
2338
|
-
...$(e.longTask, !1,
|
|
2339
|
-
...$(e.cspViolation, !1,
|
|
2340
|
-
],
|
|
2474
|
+
...$(e.websocket, !1, Nr),
|
|
2475
|
+
...$(e.longTask, !1, zn),
|
|
2476
|
+
...$(e.cspViolation, !1, An)
|
|
2477
|
+
], qr = class {
|
|
2341
2478
|
assertBeforeStart(e) {
|
|
2342
2479
|
if (this.phase !== "idle") throw Error(`[bk-ot] ${e}() must be called before start(); set autoStart: false before registration.`);
|
|
2343
2480
|
}
|
|
@@ -2368,19 +2505,19 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2368
2505
|
createPluginManager() {
|
|
2369
2506
|
var e;
|
|
2370
2507
|
return new Fe([
|
|
2371
|
-
...
|
|
2372
|
-
...
|
|
2373
|
-
...
|
|
2508
|
+
...Ur(this.config),
|
|
2509
|
+
...Hr(this.config),
|
|
2510
|
+
...Kr(this.config.tracking),
|
|
2374
2511
|
...(e = this.config.extensions.plugins) == null ? [] : e
|
|
2375
2512
|
]);
|
|
2376
2513
|
}
|
|
2377
2514
|
constructor(n) {
|
|
2378
2515
|
var r = this;
|
|
2379
|
-
b(this, "activityObserver", new
|
|
2516
|
+
b(this, "activityObserver", new Pr()), b(this, "flushProviders", k(function* () {
|
|
2380
2517
|
yield r.tracerProvider.forceFlush();
|
|
2381
2518
|
})), b(this, "phase", "idle"), b(this, "pluginManager", void 0), b(this, "registeredInstrumentations", void 0), b(this, "releaseOtelGlobals", void 0), b(this, "runtimeContext", void 0), b(this, "sampled", !1), b(this, "startCollection", k(function* () {
|
|
2382
2519
|
if (r.pluginManager || !r.config.enabled || r.config.trackingConsent !== "granted") return;
|
|
2383
|
-
r.releaseOtelGlobals =
|
|
2520
|
+
r.releaseOtelGlobals = Br();
|
|
2384
2521
|
let e = r.createPluginManager();
|
|
2385
2522
|
r.pluginManager = e;
|
|
2386
2523
|
try {
|
|
@@ -2417,11 +2554,18 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2417
2554
|
}), this.registeredInstrumentations.push(...e));
|
|
2418
2555
|
}), b(this, "reportAction", ({ attributes: e = {}, name: t }) => {
|
|
2419
2556
|
if (!this.isSampled()) return;
|
|
2420
|
-
let n = h("action"), r = Date.now()
|
|
2421
|
-
this.startSpan(`action.${t}`, S(S(S(S({}, this.config.hooks.getPageAttributes()), e), M({ spanType: j.action })), {}, {
|
|
2557
|
+
let n = h("action"), r = Date.now(), i = S(S(S(S({}, this.config.hooks.getPageAttributes()), e), P({ spanType: j.action })), {}, {
|
|
2422
2558
|
[g.actionId]: n,
|
|
2559
|
+
[g.actionName]: t,
|
|
2423
2560
|
[g.actionType]: "custom"
|
|
2424
|
-
})
|
|
2561
|
+
});
|
|
2562
|
+
this.startSpan(N({
|
|
2563
|
+
attributes: i,
|
|
2564
|
+
spanType: j.action
|
|
2565
|
+
}), i, {
|
|
2566
|
+
rumSpanType: j.action,
|
|
2567
|
+
startTime: r
|
|
2568
|
+
}).end(r);
|
|
2425
2569
|
}), b(this, "reportCustomEvent", ({ attributes: e = {}, error: n, name: r }) => {
|
|
2426
2570
|
if (!this.isSampled()) {
|
|
2427
2571
|
if (this.config.debug) {
|
|
@@ -2430,19 +2574,23 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2430
2574
|
}
|
|
2431
2575
|
return;
|
|
2432
2576
|
}
|
|
2433
|
-
let a = Date.now(), o =
|
|
2577
|
+
let a = Date.now(), o = S(S(S(S({}, this.config.hooks.getPageAttributes()), this.config.hooks.getCustomAttributes()), e), P({
|
|
2434
2578
|
outcome: n ? A.error : A.success,
|
|
2435
2579
|
spanType: j.custom
|
|
2436
|
-
})),
|
|
2437
|
-
|
|
2580
|
+
})), s = this.startSpan(N({
|
|
2581
|
+
attributes: o,
|
|
2582
|
+
nameHint: r,
|
|
2583
|
+
spanType: j.custom
|
|
2584
|
+
}), o, { startTime: a });
|
|
2585
|
+
n && (s.recordException(n), s.setStatus({
|
|
2438
2586
|
code: t.ERROR,
|
|
2439
2587
|
message: n.message
|
|
2440
|
-
})),
|
|
2588
|
+
})), s.end(a);
|
|
2441
2589
|
}), b(this, "setRuntimeAttributes", (e, t) => {
|
|
2442
2590
|
let n = S({}, e), r = t == null ? Date.now() : t;
|
|
2443
2591
|
if (g.sessionId in e) {
|
|
2444
2592
|
let t = e[g.sessionId];
|
|
2445
|
-
this.sampled = this.config.enabled && typeof t == "string" && t.length > 0 ?
|
|
2593
|
+
this.sampled = this.config.enabled && typeof t == "string" && t.length > 0 ? Ir(this.config, t) : !1, this.runtimeContext.setSessionSampled(this.sampled, r);
|
|
2446
2594
|
}
|
|
2447
2595
|
this.runtimeContext.setAttributes(n, r);
|
|
2448
2596
|
}), b(this, "setTrackingConsent", function() {
|
|
@@ -2502,12 +2650,15 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2502
2650
|
var i, a;
|
|
2503
2651
|
let o = (i = r == null ? void 0 : r.contextTime) == null ? typeof (r == null ? void 0 : r.startTime) == "number" ? r.startTime : void 0 : i;
|
|
2504
2652
|
if (!this.isSampled() || o !== void 0 && !this.runtimeContext.isSessionSampledAt(o)) return this.tracer.startSpan(t);
|
|
2505
|
-
let s = o === void 0 ? this.getRuntimeAttributes() : this.runtimeContext.getAttributesAt(o)
|
|
2506
|
-
|
|
2653
|
+
let s = o === void 0 ? this.getRuntimeAttributes() : this.runtimeContext.getAttributesAt(o), c = this.applyRedact(S(S({}, s), n)), l = r != null && r.rumSpanType ? N({
|
|
2654
|
+
attributes: c,
|
|
2655
|
+
spanType: r.rumSpanType
|
|
2656
|
+
}) : t;
|
|
2657
|
+
return this.tracer.startSpan(l, {
|
|
2507
2658
|
kind: (a = r == null ? void 0 : r.kind) == null ? e.INTERNAL : a,
|
|
2508
2659
|
links: r == null ? void 0 : r.links,
|
|
2509
2660
|
startTime: r == null ? void 0 : r.startTime,
|
|
2510
|
-
attributes:
|
|
2661
|
+
attributes: c
|
|
2511
2662
|
});
|
|
2512
2663
|
}), b(this, "startView", (e = {}) => {
|
|
2513
2664
|
this.isSampled() && this.runtimeContext.dispatchViewCommand({
|
|
@@ -2520,20 +2671,20 @@ var Gn = ["stopLoadingTime"], Kn = new Set(Object.values(g)), qn = () => typeof
|
|
|
2520
2671
|
}), b(this, "useInstrumentation", (e) => {
|
|
2521
2672
|
var t;
|
|
2522
2673
|
return this.assertBeforeStart("useInstrumentation"), this.config.enabled && ((t = this.config.extensions.instrumentations) == null || t.push(e)), this;
|
|
2523
|
-
}), this.config = je(n), this.runtimeContext = new
|
|
2674
|
+
}), this.config = je(n), this.runtimeContext = new Ze({}, this.config.user);
|
|
2524
2675
|
let i = c(this.config.resourceAttributes), a = (() => {
|
|
2525
|
-
let e =
|
|
2526
|
-
return [new
|
|
2676
|
+
let e = Vr(new s(Lr(this.config.transport)), this.config.debug);
|
|
2677
|
+
return [new Je(this.config.spanProcessor === "simple" ? new d(e) : new l(e, this.config.spanBatch), this.config, () => this.applyRedact(S(S({}, this.runtimeContext.getAttributes()), this.config.hooks.getPageAttributes())))];
|
|
2527
2678
|
})();
|
|
2528
2679
|
this.tracerProvider = new f({
|
|
2529
2680
|
resource: i,
|
|
2530
|
-
sampler: new
|
|
2681
|
+
sampler: new zr(this.isSampled),
|
|
2531
2682
|
spanProcessors: a
|
|
2532
|
-
}), this.tracer = this.tracerProvider.getTracer(
|
|
2683
|
+
}), this.tracer = this.tracerProvider.getTracer(Rr), this.registeredInstrumentations = [], this.config.autoStart && this.start().catch((e) => {
|
|
2533
2684
|
var t;
|
|
2534
2685
|
(t = globalThis.console) == null || t.warn("[bk-ot] auto start failed:", e);
|
|
2535
2686
|
});
|
|
2536
2687
|
}
|
|
2537
2688
|
};
|
|
2538
2689
|
//#endregion
|
|
2539
|
-
export {
|
|
2690
|
+
export { qr as BkOpenTelemetry, ht as EXCLUDED_ACTIVITY_MUTATIONS_ATTRIBUTE, Je as FilteringSpanProcessor, g as RUM_ATTRIBUTES, A as RUM_SPAN_OUTCOME, j as RUM_SPAN_TYPE, Ze as RumRuntimeContext, P as buildRumSpanAttributes, mt as createActionPlugin, Mt as createBlankScreenPlugin, Dn as createCommonInstrumentationsPlugin, An as createCspViolationPlugin, ce as createDevicePlugin, Nn as createErrorPlugin, zn as createLongTaskPlugin, Pe as createPlugin, ln as createResourcePlugin, _r as createSessionPlugin, Nr as createWebSocketPlugin, Ar as createWebVitalsPlugin, je as resolveConfig };
|