@tracelog/lib 2.2.0 → 2.2.1
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/dist/browser/tracelog.esm.js +146 -184
- package/dist/browser/tracelog.esm.js.map +1 -1
- package/dist/browser/tracelog.js +1 -1
- package/dist/browser/tracelog.js.map +1 -1
- package/dist/public-api.cjs +23 -60
- package/dist/public-api.cjs.map +1 -1
- package/dist/public-api.d.mts +1 -2
- package/dist/public-api.d.ts +1 -2
- package/dist/public-api.js +24 -60
- package/dist/public-api.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
const Fr = 120, $r = 8192, Br = 10, Wr = 10, Gr = 20
|
|
3
|
-
const
|
|
1
|
+
const Hr = 9e5;
|
|
2
|
+
const Fr = 120, $r = 8192, Br = 10, Wr = 10, Gr = 20;
|
|
3
|
+
const Xr = 1e3, Qr = 500, jr = 100;
|
|
4
4
|
const w = "data-tlog", at = [
|
|
5
5
|
"button",
|
|
6
6
|
"a",
|
|
@@ -78,15 +78,15 @@ const m = {
|
|
|
78
78
|
/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi,
|
|
79
79
|
/<embed\b[^>]*>/gi,
|
|
80
80
|
/<object\b[^<]*(?:(?!<\/object>)<[^<]*)*<\/object>/gi
|
|
81
|
-
], I = "tlog",
|
|
82
|
-
var U = /* @__PURE__ */ ((s) => (s.Localhost = "localhost:8080", s.Fail = "localhost:9999", s))(U || {}),
|
|
81
|
+
], I = "tlog", H = `${I}:qa_mode`, ye = `${I}:uid`, We = "tlog_mode", be = "qa", Le = "qa_off", dt = (s) => s ? `${I}:${s}:queue` : `${I}:queue`, ht = (s) => s ? `${I}:${s}:session` : `${I}:session`, ft = (s) => s ? `${I}:${s}:broadcast` : `${I}:broadcast`, Ae = (s, e) => `${I}:${s}:session_counts:${e}`, Me = 10080 * 60 * 1e3, Ce = `${I}:session_counts_last_cleanup`, Re = 3600 * 1e3;
|
|
82
|
+
var U = /* @__PURE__ */ ((s) => (s.Localhost = "localhost:8080", s.Fail = "localhost:9999", s))(U || {}), A = /* @__PURE__ */ ((s) => (s.Mobile = "mobile", s.Tablet = "tablet", s.Desktop = "desktop", s.Unknown = "unknown", s))(A || {}), ae = /* @__PURE__ */ ((s) => (s.EVENT = "event", s.QUEUE = "queue", s))(ae || {});
|
|
83
83
|
class O extends Error {
|
|
84
84
|
constructor(e, t) {
|
|
85
85
|
super(e), this.statusCode = t, this.name = "PermanentError", Error.captureStackTrace && Error.captureStackTrace(this, O);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
var d = /* @__PURE__ */ ((s) => (s.PAGE_VIEW = "page_view", s.CLICK = "click", s.SCROLL = "scroll", s.SESSION_START = "session_start", s.CUSTOM = "custom", s.WEB_VITALS = "web_vitals", s.ERROR = "error", s.VIEWPORT_VISIBLE = "viewport_visible", s))(d || {}), Q = /* @__PURE__ */ ((s) => (s.UP = "up", s.DOWN = "down", s))(Q || {}),
|
|
89
|
-
const
|
|
88
|
+
var d = /* @__PURE__ */ ((s) => (s.PAGE_VIEW = "page_view", s.CLICK = "click", s.SCROLL = "scroll", s.SESSION_START = "session_start", s.CUSTOM = "custom", s.WEB_VITALS = "web_vitals", s.ERROR = "error", s.VIEWPORT_VISIBLE = "viewport_visible", s))(d || {}), Q = /* @__PURE__ */ ((s) => (s.UP = "up", s.DOWN = "down", s))(Q || {}), x = /* @__PURE__ */ ((s) => (s.JS_ERROR = "js_error", s.PROMISE_REJECTION = "promise_rejection", s))(x || {}), K = /* @__PURE__ */ ((s) => (s.QA = "qa", s))(K || {});
|
|
89
|
+
const zr = (s) => s.type === d.SCROLL && "scroll_data" in s && s.scroll_data.is_primary === !0, Kr = (s) => s.type === d.SCROLL && "scroll_data" in s && s.scroll_data.is_primary === !1;
|
|
90
90
|
class F extends Error {
|
|
91
91
|
constructor(e, t, r) {
|
|
92
92
|
super(e), this.errorCode = t, this.layer = r, this.name = this.constructor.name, Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
|
|
@@ -102,7 +102,7 @@ class mt extends F {
|
|
|
102
102
|
super(e, "SESSION_TIMEOUT_INVALID", t);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
class
|
|
105
|
+
class Ne extends F {
|
|
106
106
|
constructor(e, t = "config") {
|
|
107
107
|
super(e, "SAMPLING_RATE_INVALID", t);
|
|
108
108
|
}
|
|
@@ -112,12 +112,12 @@ class V extends F {
|
|
|
112
112
|
super(e, "INTEGRATION_INVALID", t);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
class
|
|
115
|
+
class Yr extends F {
|
|
116
116
|
constructor(e, t, r = "runtime") {
|
|
117
117
|
super(e, "INITIALIZATION_TIMEOUT", r), this.timeoutMs = t;
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
const
|
|
120
|
+
const Ge = "background: #ff9800; color: white; font-weight: bold; padding: 2px 8px; border-radius: 3px;", Xe = "background: #9e9e9e; color: white; font-weight: bold; padding: 2px 8px; border-radius: 3px;", gt = "background: #d32f2f; color: white; font-weight: bold; padding: 2px 8px; border-radius: 3px;", Et = (s, e) => {
|
|
121
121
|
if (e) {
|
|
122
122
|
if (e instanceof Error) {
|
|
123
123
|
const t = e.message.replace(/\s+at\s+.*$/gm, "").replace(/\s*\([^()]+:\d+:\d+\)/g, "");
|
|
@@ -140,7 +140,7 @@ const We = "background: #ff9800; color: white; font-weight: bold; padding: 2px 8
|
|
|
140
140
|
if (typeof window > "u" || typeof sessionStorage > "u")
|
|
141
141
|
return !1;
|
|
142
142
|
try {
|
|
143
|
-
return sessionStorage.getItem(
|
|
143
|
+
return sessionStorage.getItem(H) === "true";
|
|
144
144
|
} catch {
|
|
145
145
|
return !1;
|
|
146
146
|
}
|
|
@@ -167,9 +167,9 @@ const We = "background: #ff9800; color: white; font-weight: bold; padding: 2px 8
|
|
|
167
167
|
}
|
|
168
168
|
return e;
|
|
169
169
|
};
|
|
170
|
-
let ce,
|
|
170
|
+
let ce, Qe;
|
|
171
171
|
const _t = () => {
|
|
172
|
-
typeof window < "u" && !ce && (ce = window.matchMedia("(pointer: coarse)"),
|
|
172
|
+
typeof window < "u" && !ce && (ce = window.matchMedia("(pointer: coarse)"), Qe = window.matchMedia("(hover: none)"));
|
|
173
173
|
}, Y = "Unknown", It = (s) => {
|
|
174
174
|
const e = s.userAgentData?.platform;
|
|
175
175
|
if (e != null && e !== "") {
|
|
@@ -198,13 +198,13 @@ const _t = () => {
|
|
|
198
198
|
const s = navigator;
|
|
199
199
|
if (s.userAgentData != null && typeof s.userAgentData.mobile == "boolean") {
|
|
200
200
|
const c = s.userAgentData.platform;
|
|
201
|
-
return c != null && c !== "" && /ipad|tablet/i.test(c) ?
|
|
201
|
+
return c != null && c !== "" && /ipad|tablet/i.test(c) ? A.Tablet : s.userAgentData.mobile ? A.Mobile : A.Desktop;
|
|
202
202
|
}
|
|
203
203
|
_t();
|
|
204
|
-
const e = window.innerWidth, t = ce?.matches ?? !1, r =
|
|
205
|
-
return e <= 767 || o && n ?
|
|
204
|
+
const e = window.innerWidth, t = ce?.matches ?? !1, r = Qe?.matches ?? !1, n = "ontouchstart" in window || navigator.maxTouchPoints > 0, i = navigator.userAgent.toLowerCase(), o = /mobile|android|iphone|ipod|blackberry|iemobile|opera mini/.test(i), l = /tablet|ipad|android(?!.*mobile)/.test(i);
|
|
205
|
+
return e <= 767 || o && n ? A.Mobile : e >= 768 && e <= 1024 || l || t && r && n ? A.Tablet : A.Desktop;
|
|
206
206
|
} catch (s) {
|
|
207
|
-
return a("debug", "Device detection failed, defaulting to desktop", { error: s }),
|
|
207
|
+
return a("debug", "Device detection failed, defaulting to desktop", { error: s }), A.Desktop;
|
|
208
208
|
}
|
|
209
209
|
}, bt = () => {
|
|
210
210
|
try {
|
|
@@ -216,12 +216,12 @@ const _t = () => {
|
|
|
216
216
|
};
|
|
217
217
|
} catch (s) {
|
|
218
218
|
return a("debug", "Device info detection failed, using defaults", { error: s }), {
|
|
219
|
-
type:
|
|
219
|
+
type: A.Desktop,
|
|
220
220
|
os: Y,
|
|
221
221
|
browser: Y
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
|
-
},
|
|
224
|
+
}, je = [
|
|
225
225
|
// Email addresses
|
|
226
226
|
/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/gi,
|
|
227
227
|
// US Phone numbers (various formats)
|
|
@@ -236,7 +236,7 @@ const _t = () => {
|
|
|
236
236
|
/Bearer\s+[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?(?:\.[A-Za-z0-9_-]+)?/gi,
|
|
237
237
|
// Passwords in connection strings (protocol://user:password@host)
|
|
238
238
|
/:\/\/[^:/]+:([^@]+)@/gi
|
|
239
|
-
],
|
|
239
|
+
], Oe = 500, Pe = 5e3, j = 50, Lt = j * 2, ze = 1, At = 1e3, Mt = 10, De = 5e3, Ct = 6e4, qr = {
|
|
240
240
|
LCP: 2500,
|
|
241
241
|
// Good: ≤ 2.5s
|
|
242
242
|
FCP: 1800,
|
|
@@ -248,7 +248,7 @@ const _t = () => {
|
|
|
248
248
|
TTFB: 800,
|
|
249
249
|
// Good: ≤ 800ms
|
|
250
250
|
LONG_TASK: 50
|
|
251
|
-
},
|
|
251
|
+
}, ke = {
|
|
252
252
|
LCP: 2500,
|
|
253
253
|
// Needs improvement: > 2.5s (same as good boundary)
|
|
254
254
|
FCP: 1800,
|
|
@@ -272,53 +272,53 @@ const _t = () => {
|
|
|
272
272
|
TTFB: 1800,
|
|
273
273
|
// Poor: > 1800ms
|
|
274
274
|
LONG_TASK: 50
|
|
275
|
-
}, ue = "needs-improvement",
|
|
275
|
+
}, ue = "needs-improvement", Ve = (s = ue) => {
|
|
276
276
|
switch (s) {
|
|
277
277
|
case "all":
|
|
278
278
|
return { LCP: 0, FCP: 0, CLS: 0, INP: 0, TTFB: 0, LONG_TASK: 0 };
|
|
279
279
|
// Track everything
|
|
280
280
|
case "needs-improvement":
|
|
281
|
-
return
|
|
281
|
+
return ke;
|
|
282
282
|
case "poor":
|
|
283
283
|
return Rt;
|
|
284
284
|
default:
|
|
285
|
-
return
|
|
285
|
+
return ke;
|
|
286
286
|
}
|
|
287
|
-
}, Nt = 1e3, Ot = 50, Pt = "2.
|
|
287
|
+
}, Nt = 1e3, Ot = 50, Pt = "2.2.0", Dt = Pt, Ke = () => typeof window < "u" && typeof sessionStorage < "u", kt = () => {
|
|
288
288
|
try {
|
|
289
289
|
const s = new URLSearchParams(window.location.search);
|
|
290
|
-
s.delete(
|
|
290
|
+
s.delete(We);
|
|
291
291
|
const e = s.toString(), t = window.location.pathname + (e ? "?" + e : "") + window.location.hash;
|
|
292
292
|
window.history.replaceState({}, "", t);
|
|
293
293
|
} catch {
|
|
294
294
|
}
|
|
295
295
|
}, Vt = () => {
|
|
296
|
-
if (!
|
|
296
|
+
if (!Ke())
|
|
297
297
|
return !1;
|
|
298
298
|
try {
|
|
299
|
-
const e = new URLSearchParams(window.location.search).get(
|
|
299
|
+
const e = new URLSearchParams(window.location.search).get(We), t = sessionStorage.getItem(H);
|
|
300
300
|
let r = null;
|
|
301
|
-
return e ===
|
|
302
|
-
visibility: "qa",
|
|
303
|
-
style: We
|
|
304
|
-
})) : e === be && (r = !1, sessionStorage.setItem(x, "false"), a("info", "QA Mode DISABLED", {
|
|
301
|
+
return e === be ? (r = !0, sessionStorage.setItem(H, "true"), a("info", "QA Mode ACTIVE", {
|
|
305
302
|
visibility: "qa",
|
|
306
303
|
style: Ge
|
|
307
|
-
}))
|
|
304
|
+
})) : e === Le && (r = !1, sessionStorage.setItem(H, "false"), a("info", "QA Mode DISABLED", {
|
|
305
|
+
visibility: "qa",
|
|
306
|
+
style: Xe
|
|
307
|
+
})), (e === be || e === Le) && kt(), r ?? t === "true";
|
|
308
308
|
} catch {
|
|
309
309
|
return !1;
|
|
310
310
|
}
|
|
311
311
|
}, Ut = (s) => {
|
|
312
|
-
if (
|
|
312
|
+
if (Ke())
|
|
313
313
|
try {
|
|
314
|
-
sessionStorage.setItem(
|
|
314
|
+
sessionStorage.setItem(H, s ? "true" : "false"), a("info", s ? "QA Mode ACTIVE" : "QA Mode DISABLED", {
|
|
315
315
|
visibility: "qa",
|
|
316
|
-
style: s ?
|
|
316
|
+
style: s ? Ge : Xe
|
|
317
317
|
});
|
|
318
318
|
} catch {
|
|
319
319
|
a("debug", "Cannot set QA mode: sessionStorage unavailable");
|
|
320
320
|
}
|
|
321
|
-
},
|
|
321
|
+
}, xt = [
|
|
322
322
|
"co.uk",
|
|
323
323
|
"org.uk",
|
|
324
324
|
"com.au",
|
|
@@ -330,19 +330,19 @@ const _t = () => {
|
|
|
330
330
|
"co.in",
|
|
331
331
|
"com.cn",
|
|
332
332
|
"co.za"
|
|
333
|
-
],
|
|
333
|
+
], Ue = (s) => {
|
|
334
334
|
const e = s.toLowerCase().split(".");
|
|
335
335
|
if (e.length <= 2)
|
|
336
336
|
return s.toLowerCase();
|
|
337
337
|
const t = e.slice(-2).join(".");
|
|
338
|
-
return
|
|
339
|
-
},
|
|
338
|
+
return xt.includes(t) ? e.slice(-3).join(".") : e.slice(-2).join(".");
|
|
339
|
+
}, Ht = (s, e) => s === e ? !0 : Ue(s) === Ue(e), re = () => {
|
|
340
340
|
const s = document.referrer;
|
|
341
341
|
if (!s)
|
|
342
342
|
return "Direct";
|
|
343
343
|
try {
|
|
344
344
|
const e = new URL(s).hostname.toLowerCase(), t = window.location.hostname.toLowerCase();
|
|
345
|
-
return
|
|
345
|
+
return Ht(e, t) ? "Direct" : s;
|
|
346
346
|
} catch (e) {
|
|
347
347
|
return a("debug", "Failed to parse referrer URL, using raw value", { error: e, data: { referrer: s } }), s;
|
|
348
348
|
}
|
|
@@ -373,7 +373,7 @@ const $t = () => {
|
|
|
373
373
|
} catch {
|
|
374
374
|
}
|
|
375
375
|
return t || (t = Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")), `${s}-${e}-${t}`;
|
|
376
|
-
},
|
|
376
|
+
}, Ye = (s, e = !1) => {
|
|
377
377
|
try {
|
|
378
378
|
const t = new URL(s), r = t.protocol === "https:", n = t.protocol === "http:";
|
|
379
379
|
return r || e && n;
|
|
@@ -398,7 +398,7 @@ const $t = () => {
|
|
|
398
398
|
if (r.length === 2 ? n = r.join(".") : n = r.slice(-2).join("."), !n || n.split(".").length < 2)
|
|
399
399
|
throw new Error("Invalid domain structure for SaaS");
|
|
400
400
|
const i = `https://${s}.${n}/collect`;
|
|
401
|
-
if (!
|
|
401
|
+
if (!Ye(i))
|
|
402
402
|
throw new Error("Generated URL failed validation");
|
|
403
403
|
return i;
|
|
404
404
|
} catch (e) {
|
|
@@ -410,7 +410,7 @@ const $t = () => {
|
|
|
410
410
|
const t = s.integrations?.custom?.collectApiUrl;
|
|
411
411
|
if (t) {
|
|
412
412
|
const r = s.integrations?.custom?.allowHttp ?? !1;
|
|
413
|
-
if (!
|
|
413
|
+
if (!Ye(t, r))
|
|
414
414
|
throw new Error("Invalid custom API URL");
|
|
415
415
|
e.custom = t;
|
|
416
416
|
}
|
|
@@ -428,7 +428,7 @@ const $t = () => {
|
|
|
428
428
|
} catch (t) {
|
|
429
429
|
return a("warn", "URL normalization failed, returning original", { error: t, data: { urlLength: s?.length } }), s;
|
|
430
430
|
}
|
|
431
|
-
},
|
|
431
|
+
}, xe = (s) => {
|
|
432
432
|
if (!s || typeof s != "string" || s.trim().length === 0)
|
|
433
433
|
return "";
|
|
434
434
|
let e = s;
|
|
@@ -445,20 +445,22 @@ const $t = () => {
|
|
|
445
445
|
}
|
|
446
446
|
}), e = e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'").replaceAll("/", "/"), e.trim();
|
|
447
447
|
}, he = (s, e = 0) => {
|
|
448
|
-
if (
|
|
448
|
+
if (s == null)
|
|
449
449
|
return null;
|
|
450
450
|
if (typeof s == "string")
|
|
451
|
-
return
|
|
451
|
+
return xe(s);
|
|
452
452
|
if (typeof s == "number")
|
|
453
453
|
return !Number.isFinite(s) || s < -Number.MAX_SAFE_INTEGER || s > Number.MAX_SAFE_INTEGER ? 0 : s;
|
|
454
454
|
if (typeof s == "boolean")
|
|
455
455
|
return s;
|
|
456
|
+
if (e > 10)
|
|
457
|
+
return null;
|
|
456
458
|
if (Array.isArray(s))
|
|
457
459
|
return s.slice(0, 100).map((n) => he(n, e + 1)).filter((n) => n !== null);
|
|
458
460
|
if (typeof s == "object") {
|
|
459
461
|
const t = {}, n = Object.entries(s).slice(0, 20);
|
|
460
462
|
for (const [i, o] of n) {
|
|
461
|
-
const l =
|
|
463
|
+
const l = xe(i);
|
|
462
464
|
if (l) {
|
|
463
465
|
const c = he(o, e + 1);
|
|
464
466
|
c !== null && (t[l] = c);
|
|
@@ -493,9 +495,9 @@ const $t = () => {
|
|
|
493
495
|
throw new f("All sensitive query params must be strings", "config");
|
|
494
496
|
}
|
|
495
497
|
if (s.errorSampling !== void 0 && (typeof s.errorSampling != "number" || s.errorSampling < 0 || s.errorSampling > 1))
|
|
496
|
-
throw new
|
|
498
|
+
throw new Ne(m.INVALID_ERROR_SAMPLING_RATE, "config");
|
|
497
499
|
if (s.samplingRate !== void 0 && (typeof s.samplingRate != "number" || s.samplingRate < 0 || s.samplingRate > 1))
|
|
498
|
-
throw new
|
|
500
|
+
throw new Ne(m.INVALID_SAMPLING_RATE, "config");
|
|
499
501
|
if (s.primaryScrollSelector !== void 0) {
|
|
500
502
|
if (typeof s.primaryScrollSelector != "string" || !s.primaryScrollSelector.trim())
|
|
501
503
|
throw new f(m.INVALID_PRIMARY_SCROLL_SELECTOR, "config");
|
|
@@ -602,7 +604,7 @@ const $t = () => {
|
|
|
602
604
|
sessionTimeout: s?.sessionTimeout ?? 9e5,
|
|
603
605
|
globalMetadata: s?.globalMetadata ?? {},
|
|
604
606
|
sensitiveQueryParams: s?.sensitiveQueryParams ?? [],
|
|
605
|
-
errorSampling: s?.errorSampling ??
|
|
607
|
+
errorSampling: s?.errorSampling ?? ze,
|
|
606
608
|
samplingRate: s?.samplingRate ?? 1,
|
|
607
609
|
pageViewThrottleMs: s?.pageViewThrottleMs ?? 1e3,
|
|
608
610
|
clickThrottleMs: s?.clickThrottleMs ?? 300,
|
|
@@ -618,51 +620,12 @@ const $t = () => {
|
|
|
618
620
|
cooldownPeriod: e.viewport.cooldownPeriod ?? 6e4,
|
|
619
621
|
maxTrackedElements: e.viewport.maxTrackedElements ?? 100
|
|
620
622
|
}), e;
|
|
621
|
-
},
|
|
622
|
-
if (
|
|
623
|
+
}, fe = (s, e = /* @__PURE__ */ new Set()) => {
|
|
624
|
+
if (s == null)
|
|
623
625
|
return !0;
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
return !1;
|
|
628
|
-
for (const [, t] of e) {
|
|
629
|
-
if (t == null)
|
|
630
|
-
continue;
|
|
631
|
-
const r = typeof t;
|
|
632
|
-
if (r !== "string" && r !== "number" && r !== "boolean")
|
|
633
|
-
return !1;
|
|
634
|
-
}
|
|
635
|
-
return !0;
|
|
636
|
-
}
|
|
637
|
-
return !1;
|
|
638
|
-
}, Ye = (s, e = 0) => {
|
|
639
|
-
if (typeof s != "object" || s === null || e > 1)
|
|
640
|
-
return !1;
|
|
641
|
-
for (const t of Object.values(s)) {
|
|
642
|
-
if (t == null)
|
|
643
|
-
continue;
|
|
644
|
-
const r = typeof t;
|
|
645
|
-
if (!(r === "string" || r === "number" || r === "boolean")) {
|
|
646
|
-
if (Array.isArray(t)) {
|
|
647
|
-
if (t.length === 0)
|
|
648
|
-
continue;
|
|
649
|
-
if (typeof t[0] == "string") {
|
|
650
|
-
if (!t.every((o) => typeof o == "string"))
|
|
651
|
-
return !1;
|
|
652
|
-
} else if (!t.every((o) => Kt(o)))
|
|
653
|
-
return !1;
|
|
654
|
-
continue;
|
|
655
|
-
}
|
|
656
|
-
if (r === "object" && e === 0) {
|
|
657
|
-
if (!Ye(t, e + 1))
|
|
658
|
-
return !1;
|
|
659
|
-
continue;
|
|
660
|
-
}
|
|
661
|
-
return !1;
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
return !0;
|
|
665
|
-
}, Yt = (s) => typeof s != "string" ? {
|
|
626
|
+
const t = typeof s;
|
|
627
|
+
return t === "string" || t === "number" || t === "boolean" ? !0 : t === "function" || t === "symbol" || t === "bigint" || e.has(s) ? !1 : (e.add(s), Array.isArray(s) ? s.every((r) => fe(r, e)) : t === "object" ? Object.values(s).every((r) => fe(r, e)) : !1);
|
|
628
|
+
}, Kt = (s) => typeof s != "object" || s === null ? !1 : fe(s), Yt = (s) => typeof s != "string" ? {
|
|
666
629
|
valid: !1,
|
|
667
630
|
error: "Event name must be a string"
|
|
668
631
|
} : s.length === 0 ? {
|
|
@@ -679,7 +642,7 @@ const $t = () => {
|
|
|
679
642
|
error: "Event name cannot be a reserved word"
|
|
680
643
|
} : { valid: !0 }, He = (s, e, t) => {
|
|
681
644
|
const r = Gt(e), n = t && t === "customEvent" ? `${t} "${s}" metadata error` : `${s} metadata error`;
|
|
682
|
-
if (!
|
|
645
|
+
if (!Kt(r))
|
|
683
646
|
return {
|
|
684
647
|
valid: !1,
|
|
685
648
|
error: `${n}: object has invalid types. Valid types are string, number, boolean or string arrays.`
|
|
@@ -973,7 +936,7 @@ class _ {
|
|
|
973
936
|
return { ...ne };
|
|
974
937
|
}
|
|
975
938
|
}
|
|
976
|
-
class
|
|
939
|
+
class Fe extends _ {
|
|
977
940
|
storeManager;
|
|
978
941
|
integrationId;
|
|
979
942
|
apiUrl;
|
|
@@ -1846,8 +1809,8 @@ class tr extends _ {
|
|
|
1846
1809
|
constructor(e, t = null, r = {}, n = {}, i) {
|
|
1847
1810
|
super(), this.emitter = t, this.transformers = r, this.timeManager = new er(), this.dataSenders = [];
|
|
1848
1811
|
const o = this.get("collectApiUrls");
|
|
1849
|
-
o?.saas && this.dataSenders.push(new
|
|
1850
|
-
new
|
|
1812
|
+
o?.saas && this.dataSenders.push(new Fe(e, "saas", o.saas, r)), o?.custom && this.dataSenders.push(
|
|
1813
|
+
new Fe(
|
|
1851
1814
|
e,
|
|
1852
1815
|
"custom",
|
|
1853
1816
|
o.custom,
|
|
@@ -2030,7 +1993,7 @@ class tr extends _ {
|
|
|
2030
1993
|
if (!this.checkPerEventRateLimit(o.name, T))
|
|
2031
1994
|
return;
|
|
2032
1995
|
}
|
|
2033
|
-
const
|
|
1996
|
+
const we = E === d.SESSION_START, B = t || this.get("pageUrl"), k = this.buildEventPayload({
|
|
2034
1997
|
type: E,
|
|
2035
1998
|
page_url: B,
|
|
2036
1999
|
from_page_url: r,
|
|
@@ -2043,7 +2006,7 @@ class tr extends _ {
|
|
|
2043
2006
|
page_view: S
|
|
2044
2007
|
});
|
|
2045
2008
|
if (k && !(!p && !this.shouldSample())) {
|
|
2046
|
-
if (
|
|
2009
|
+
if (we) {
|
|
2047
2010
|
const T = this.get("sessionId");
|
|
2048
2011
|
if (!T) {
|
|
2049
2012
|
a("error", "Session start event requires sessionId - event will be ignored");
|
|
@@ -2618,7 +2581,7 @@ class tr extends _ {
|
|
|
2618
2581
|
if (!n)
|
|
2619
2582
|
return this.getInitialCounts();
|
|
2620
2583
|
const i = JSON.parse(n);
|
|
2621
|
-
return i._timestamp && Date.now() - i._timestamp >
|
|
2584
|
+
return i._timestamp && Date.now() - i._timestamp > Me ? (a("debug", "Session counts expired, clearing", {
|
|
2622
2585
|
data: { sessionId: e, age: Date.now() - i._timestamp }
|
|
2623
2586
|
}), localStorage.removeItem(r), this.getInitialCounts()) : typeof i.total == "number" && typeof i[d.CLICK] == "number" && typeof i[d.PAGE_VIEW] == "number" && typeof i[d.CUSTOM] == "number" && typeof i[d.VIEWPORT_VISIBLE] == "number" && typeof i[d.SCROLL] == "number" ? {
|
|
2624
2587
|
total: i.total,
|
|
@@ -2663,12 +2626,12 @@ class tr extends _ {
|
|
|
2663
2626
|
cleanupExpiredSessionCounts() {
|
|
2664
2627
|
if (!(typeof window > "u" || typeof localStorage > "u"))
|
|
2665
2628
|
try {
|
|
2666
|
-
const e = localStorage.getItem(
|
|
2629
|
+
const e = localStorage.getItem(Ce);
|
|
2667
2630
|
if (e) {
|
|
2668
2631
|
const i = Date.now() - parseInt(e, 10);
|
|
2669
|
-
if (i <
|
|
2632
|
+
if (i < Re) {
|
|
2670
2633
|
a("debug", "Skipping session counts cleanup (throttled)", {
|
|
2671
|
-
data: { timeSinceLastCleanup: i, throttleMs:
|
|
2634
|
+
data: { timeSinceLastCleanup: i, throttleMs: Re }
|
|
2672
2635
|
});
|
|
2673
2636
|
return;
|
|
2674
2637
|
}
|
|
@@ -2681,14 +2644,14 @@ class tr extends _ {
|
|
|
2681
2644
|
const l = localStorage.getItem(o);
|
|
2682
2645
|
if (l) {
|
|
2683
2646
|
const c = JSON.parse(l);
|
|
2684
|
-
c._timestamp && Date.now() - c._timestamp >
|
|
2647
|
+
c._timestamp && Date.now() - c._timestamp > Me && n.push(o);
|
|
2685
2648
|
}
|
|
2686
2649
|
} catch {
|
|
2687
2650
|
}
|
|
2688
2651
|
}
|
|
2689
2652
|
n.forEach((i) => {
|
|
2690
2653
|
localStorage.removeItem(i), a("debug", "Cleaned up expired session counts", { data: { key: i } });
|
|
2691
|
-
}), n.length > 0 && a("info", `Cleaned up ${n.length} expired session counts entries`), localStorage.setItem(
|
|
2654
|
+
}), n.length > 0 && a("info", `Cleaned up ${n.length} expired session counts entries`), localStorage.setItem(Ce, Date.now().toString());
|
|
2692
2655
|
} catch (e) {
|
|
2693
2656
|
a("warn", "Failed to cleanup expired session counts", { error: e });
|
|
2694
2657
|
}
|
|
@@ -2756,11 +2719,11 @@ class rr {
|
|
|
2756
2719
|
* @returns Persistent unique user ID (UUID v4 format)
|
|
2757
2720
|
*/
|
|
2758
2721
|
static getId(e) {
|
|
2759
|
-
const t = e.getItem(
|
|
2722
|
+
const t = e.getItem(ye);
|
|
2760
2723
|
if (t)
|
|
2761
2724
|
return t;
|
|
2762
2725
|
const r = Ft();
|
|
2763
|
-
return e.setItem(
|
|
2726
|
+
return e.setItem(ye, r), r;
|
|
2764
2727
|
}
|
|
2765
2728
|
}
|
|
2766
2729
|
const sr = /^\d{13}-[a-z0-9]{9}$/;
|
|
@@ -3466,7 +3429,7 @@ class ar extends _ {
|
|
|
3466
3429
|
*/
|
|
3467
3430
|
sanitizeText(e) {
|
|
3468
3431
|
let t = e;
|
|
3469
|
-
for (const r of
|
|
3432
|
+
for (const r of je) {
|
|
3470
3433
|
const n = new RegExp(r.source, r.flags);
|
|
3471
3434
|
t = t.replace(n, "[REDACTED]");
|
|
3472
3435
|
}
|
|
@@ -4188,7 +4151,7 @@ class dr extends _ {
|
|
|
4188
4151
|
navigationCounter = 0;
|
|
4189
4152
|
// Counter for handling simultaneous navigations edge case
|
|
4190
4153
|
constructor(e) {
|
|
4191
|
-
super(), this.eventManager = e, this.vitalThresholds =
|
|
4154
|
+
super(), this.eventManager = e, this.vitalThresholds = Ve(ue);
|
|
4192
4155
|
}
|
|
4193
4156
|
/**
|
|
4194
4157
|
* Starts tracking Web Vitals and performance metrics.
|
|
@@ -4206,7 +4169,7 @@ class dr extends _ {
|
|
|
4206
4169
|
*/
|
|
4207
4170
|
async startTracking() {
|
|
4208
4171
|
const e = this.get("config"), t = e?.webVitalsMode ?? ue;
|
|
4209
|
-
this.vitalThresholds =
|
|
4172
|
+
this.vitalThresholds = Ve(t), e?.webVitalsThresholds && (this.vitalThresholds = { ...this.vitalThresholds, ...e.webVitalsThresholds }), await this.initWebVitals(), this.observeLongTasks();
|
|
4210
4173
|
}
|
|
4211
4174
|
/**
|
|
4212
4175
|
* Stops tracking Web Vitals and cleans up resources.
|
|
@@ -4276,7 +4239,7 @@ class dr extends _ {
|
|
|
4276
4239
|
}
|
|
4277
4240
|
async initWebVitals() {
|
|
4278
4241
|
try {
|
|
4279
|
-
const { onLCP: e, onCLS: t, onFCP: r, onTTFB: n, onINP: i } = await Promise.resolve().then(() =>
|
|
4242
|
+
const { onLCP: e, onCLS: t, onFCP: r, onTTFB: n, onINP: i } = await Promise.resolve().then(() => xr), o = (l) => (c) => {
|
|
4280
4243
|
const u = Number(c.value.toFixed(2));
|
|
4281
4244
|
this.sendVital({ type: l, value: u });
|
|
4282
4245
|
};
|
|
@@ -4446,24 +4409,24 @@ class hr extends _ {
|
|
|
4446
4409
|
const e = Date.now();
|
|
4447
4410
|
if (e < this.burstBackoffUntil)
|
|
4448
4411
|
return !1;
|
|
4449
|
-
if (e - this.burstWindowStart >
|
|
4450
|
-
return this.burstBackoffUntil = e +
|
|
4412
|
+
if (e - this.burstWindowStart > At && (this.errorBurstCounter = 0, this.burstWindowStart = e), this.errorBurstCounter++, this.errorBurstCounter > Mt)
|
|
4413
|
+
return this.burstBackoffUntil = e + De, a("debug", "Error burst detected - entering cooldown", {
|
|
4451
4414
|
data: {
|
|
4452
4415
|
errorsInWindow: this.errorBurstCounter,
|
|
4453
|
-
cooldownMs:
|
|
4416
|
+
cooldownMs: De
|
|
4454
4417
|
}
|
|
4455
4418
|
}), !1;
|
|
4456
|
-
const r = this.get("config")?.errorSampling ??
|
|
4419
|
+
const r = this.get("config")?.errorSampling ?? ze;
|
|
4457
4420
|
return Math.random() < r;
|
|
4458
4421
|
}
|
|
4459
4422
|
handleError = (e) => {
|
|
4460
4423
|
if (!this.shouldSample())
|
|
4461
4424
|
return;
|
|
4462
4425
|
const t = this.sanitize(e.message || "Unknown error");
|
|
4463
|
-
this.shouldSuppressError(
|
|
4426
|
+
this.shouldSuppressError(x.JS_ERROR, t) || this.eventManager.track({
|
|
4464
4427
|
type: d.ERROR,
|
|
4465
4428
|
error_data: {
|
|
4466
|
-
type:
|
|
4429
|
+
type: x.JS_ERROR,
|
|
4467
4430
|
message: t,
|
|
4468
4431
|
...e.filename && { filename: e.filename },
|
|
4469
4432
|
...e.lineno && { line: e.lineno },
|
|
@@ -4475,10 +4438,10 @@ class hr extends _ {
|
|
|
4475
4438
|
if (!this.shouldSample())
|
|
4476
4439
|
return;
|
|
4477
4440
|
const t = this.extractRejectionMessage(e.reason), r = this.sanitize(t);
|
|
4478
|
-
this.shouldSuppressError(
|
|
4441
|
+
this.shouldSuppressError(x.PROMISE_REJECTION, r) || this.eventManager.track({
|
|
4479
4442
|
type: d.ERROR,
|
|
4480
4443
|
error_data: {
|
|
4481
|
-
type:
|
|
4444
|
+
type: x.PROMISE_REJECTION,
|
|
4482
4445
|
message: r
|
|
4483
4446
|
}
|
|
4484
4447
|
});
|
|
@@ -4497,8 +4460,8 @@ class hr extends _ {
|
|
|
4497
4460
|
}
|
|
4498
4461
|
}
|
|
4499
4462
|
sanitize(e) {
|
|
4500
|
-
let t = e.length >
|
|
4501
|
-
for (const r of
|
|
4463
|
+
let t = e.length > Oe ? e.slice(0, Oe) + "..." : e;
|
|
4464
|
+
for (const r of je) {
|
|
4502
4465
|
const n = new RegExp(r.source, r.flags);
|
|
4503
4466
|
t = t.replace(n, "[REDACTED]");
|
|
4504
4467
|
}
|
|
@@ -4506,12 +4469,12 @@ class hr extends _ {
|
|
|
4506
4469
|
}
|
|
4507
4470
|
shouldSuppressError(e, t) {
|
|
4508
4471
|
const r = Date.now(), n = `${e}:${t}`, i = this.recentErrors.get(n);
|
|
4509
|
-
return i && r - i <
|
|
4472
|
+
return i && r - i < Pe ? (this.recentErrors.set(n, r), !0) : (this.recentErrors.set(n, r), this.recentErrors.size > Lt ? (this.recentErrors.clear(), this.recentErrors.set(n, r), !1) : (this.recentErrors.size > j && this.pruneOldErrors(), !1));
|
|
4510
4473
|
}
|
|
4511
4474
|
pruneOldErrors() {
|
|
4512
4475
|
const e = Date.now();
|
|
4513
4476
|
for (const [n, i] of this.recentErrors.entries())
|
|
4514
|
-
e - i >
|
|
4477
|
+
e - i > Pe && this.recentErrors.delete(n);
|
|
4515
4478
|
if (this.recentErrors.size <= j)
|
|
4516
4479
|
return;
|
|
4517
4480
|
const t = Array.from(this.recentErrors.entries()).sort((n, i) => n[1] - i[1]), r = this.recentErrors.size - j;
|
|
@@ -4883,7 +4846,7 @@ const Tr = (s) => {
|
|
|
4883
4846
|
throw new Error("[TraceLog] Cannot update metadata while TraceLog is being destroyed");
|
|
4884
4847
|
h.updateGlobalMetadata(s);
|
|
4885
4848
|
}
|
|
4886
|
-
},
|
|
4849
|
+
}, Lr = (s) => {
|
|
4887
4850
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
4888
4851
|
if (!h)
|
|
4889
4852
|
throw new Error("[TraceLog] TraceLog not initialized. Please call init() first.");
|
|
@@ -4891,7 +4854,7 @@ const Tr = (s) => {
|
|
|
4891
4854
|
throw new Error("[TraceLog] Cannot update metadata while TraceLog is being destroyed");
|
|
4892
4855
|
h.mergeGlobalMetadata(s);
|
|
4893
4856
|
}
|
|
4894
|
-
},
|
|
4857
|
+
}, Jr = {
|
|
4895
4858
|
init: mr,
|
|
4896
4859
|
event: gr,
|
|
4897
4860
|
on: Er,
|
|
@@ -4904,20 +4867,20 @@ const Tr = (s) => {
|
|
|
4904
4867
|
destroy: wr,
|
|
4905
4868
|
setQaMode: yr,
|
|
4906
4869
|
updateGlobalMetadata: br,
|
|
4907
|
-
mergeGlobalMetadata:
|
|
4870
|
+
mergeGlobalMetadata: Lr
|
|
4908
4871
|
};
|
|
4909
|
-
var
|
|
4872
|
+
var me, et = -1, D = function(s) {
|
|
4910
4873
|
addEventListener("pageshow", (function(e) {
|
|
4911
4874
|
e.persisted && (et = e.timeStamp, s(e));
|
|
4912
4875
|
}), !0);
|
|
4913
|
-
},
|
|
4876
|
+
}, ve = function() {
|
|
4914
4877
|
var s = self.performance && performance.getEntriesByType && performance.getEntriesByType("navigation")[0];
|
|
4915
4878
|
if (s && s.responseStart > 0 && s.responseStart < performance.now()) return s;
|
|
4916
4879
|
}, J = function() {
|
|
4917
|
-
var s =
|
|
4880
|
+
var s = ve();
|
|
4918
4881
|
return s && s.activationStart || 0;
|
|
4919
4882
|
}, b = function(s, e) {
|
|
4920
|
-
var t =
|
|
4883
|
+
var t = ve(), r = "navigate";
|
|
4921
4884
|
return et >= 0 ? r = "back-forward-cache" : t && (document.prerendering || J() > 0 ? r = "prerender" : document.wasDiscarded ? r = "restore" : t.type && (r = t.type.replace(/_/g, "-"))), { name: s, value: e === void 0 ? -1 : e, rating: "good", delta: 0, entries: [], id: "v4-".concat(Date.now(), "-").concat(Math.floor(8999999999999 * Math.random()) + 1e12), navigationType: r };
|
|
4922
4885
|
}, $ = function(s, e, t) {
|
|
4923
4886
|
try {
|
|
@@ -4931,14 +4894,14 @@ var fe, et = -1, D = function(s) {
|
|
|
4931
4894
|
}
|
|
4932
4895
|
} catch {
|
|
4933
4896
|
}
|
|
4934
|
-
},
|
|
4897
|
+
}, L = function(s, e, t, r) {
|
|
4935
4898
|
var n, i;
|
|
4936
4899
|
return function(o) {
|
|
4937
4900
|
e.value >= 0 && (o || r) && ((i = e.value - (n || 0)) || n === void 0) && (n = e.value, e.delta = i, e.rating = (function(l, c) {
|
|
4938
4901
|
return l > c[1] ? "poor" : l > c[0] ? "needs-improvement" : "good";
|
|
4939
4902
|
})(e.value, t), s(e));
|
|
4940
4903
|
};
|
|
4941
|
-
},
|
|
4904
|
+
}, _e = function(s) {
|
|
4942
4905
|
requestAnimationFrame((function() {
|
|
4943
4906
|
return requestAnimationFrame((function() {
|
|
4944
4907
|
return s();
|
|
@@ -4948,23 +4911,23 @@ var fe, et = -1, D = function(s) {
|
|
|
4948
4911
|
document.addEventListener("visibilitychange", (function() {
|
|
4949
4912
|
document.visibilityState === "hidden" && s();
|
|
4950
4913
|
}));
|
|
4951
|
-
},
|
|
4914
|
+
}, Ie = function(s) {
|
|
4952
4915
|
var e = !1;
|
|
4953
4916
|
return function() {
|
|
4954
4917
|
e || (s(), e = !0);
|
|
4955
4918
|
};
|
|
4956
|
-
}, P = -1,
|
|
4919
|
+
}, P = -1, $e = function() {
|
|
4957
4920
|
return document.visibilityState !== "hidden" || document.prerendering ? 1 / 0 : 0;
|
|
4958
4921
|
}, q = function(s) {
|
|
4959
|
-
document.visibilityState === "hidden" && P > -1 && (P = s.type === "visibilitychange" ? s.timeStamp : 0,
|
|
4960
|
-
},
|
|
4922
|
+
document.visibilityState === "hidden" && P > -1 && (P = s.type === "visibilitychange" ? s.timeStamp : 0, Ar());
|
|
4923
|
+
}, Be = function() {
|
|
4961
4924
|
addEventListener("visibilitychange", q, !0), addEventListener("prerenderingchange", q, !0);
|
|
4962
|
-
},
|
|
4925
|
+
}, Ar = function() {
|
|
4963
4926
|
removeEventListener("visibilitychange", q, !0), removeEventListener("prerenderingchange", q, !0);
|
|
4964
4927
|
}, tt = function() {
|
|
4965
|
-
return P < 0 && (P =
|
|
4928
|
+
return P < 0 && (P = $e(), Be(), D((function() {
|
|
4966
4929
|
setTimeout((function() {
|
|
4967
|
-
P =
|
|
4930
|
+
P = $e(), Be();
|
|
4968
4931
|
}), 0);
|
|
4969
4932
|
}))), { get firstHiddenTime() {
|
|
4970
4933
|
return P;
|
|
@@ -4973,21 +4936,21 @@ var fe, et = -1, D = function(s) {
|
|
|
4973
4936
|
document.prerendering ? addEventListener("prerenderingchange", (function() {
|
|
4974
4937
|
return s();
|
|
4975
4938
|
}), !0) : s();
|
|
4976
|
-
},
|
|
4939
|
+
}, ge = [1800, 3e3], rt = function(s, e) {
|
|
4977
4940
|
e = e || {}, ee((function() {
|
|
4978
4941
|
var t, r = tt(), n = b("FCP"), i = $("paint", (function(o) {
|
|
4979
4942
|
o.forEach((function(l) {
|
|
4980
4943
|
l.name === "first-contentful-paint" && (i.disconnect(), l.startTime < r.firstHiddenTime && (n.value = Math.max(l.startTime - J(), 0), n.entries.push(l), t(!0)));
|
|
4981
4944
|
}));
|
|
4982
4945
|
}));
|
|
4983
|
-
i && (t =
|
|
4984
|
-
n = b("FCP"), t =
|
|
4946
|
+
i && (t = L(s, n, ge, e.reportAllChanges), D((function(o) {
|
|
4947
|
+
n = b("FCP"), t = L(s, n, ge, e.reportAllChanges), _e((function() {
|
|
4985
4948
|
n.value = performance.now() - o.timeStamp, t(!0);
|
|
4986
4949
|
}));
|
|
4987
4950
|
})));
|
|
4988
4951
|
}));
|
|
4989
|
-
},
|
|
4990
|
-
e = e || {}, rt(
|
|
4952
|
+
}, Ee = [0.1, 0.25], Mr = function(s, e) {
|
|
4953
|
+
e = e || {}, rt(Ie((function() {
|
|
4991
4954
|
var t, r = b("CLS", 0), n = 0, i = [], o = function(c) {
|
|
4992
4955
|
c.forEach((function(u) {
|
|
4993
4956
|
if (!u.hadRecentInput) {
|
|
@@ -4996,10 +4959,10 @@ var fe, et = -1, D = function(s) {
|
|
|
4996
4959
|
}
|
|
4997
4960
|
})), n > r.value && (r.value = n, r.entries = i, t());
|
|
4998
4961
|
}, l = $("layout-shift", o);
|
|
4999
|
-
l && (t =
|
|
4962
|
+
l && (t = L(s, r, Ee, e.reportAllChanges), Z((function() {
|
|
5000
4963
|
o(l.takeRecords()), t(!0);
|
|
5001
4964
|
})), D((function() {
|
|
5002
|
-
n = 0, r = b("CLS", 0), t =
|
|
4965
|
+
n = 0, r = b("CLS", 0), t = L(s, r, Ee, e.reportAllChanges), _e((function() {
|
|
5003
4966
|
return t();
|
|
5004
4967
|
}));
|
|
5005
4968
|
})), setTimeout(t, 0));
|
|
@@ -5009,9 +4972,9 @@ var fe, et = -1, D = function(s) {
|
|
|
5009
4972
|
e.interactionId && (ie = Math.min(ie, e.interactionId), X = Math.max(X, e.interactionId), st = X ? (X - ie) / 7 + 1 : 0);
|
|
5010
4973
|
}));
|
|
5011
4974
|
}, nt = function() {
|
|
5012
|
-
return
|
|
4975
|
+
return me ? st : performance.interactionCount || 0;
|
|
5013
4976
|
}, Rr = function() {
|
|
5014
|
-
"interactionCount" in performance ||
|
|
4977
|
+
"interactionCount" in performance || me || (me = $("event", Cr, { type: "event", buffered: !0, durationThreshold: 0 }));
|
|
5015
4978
|
}, y = [], z = /* @__PURE__ */ new Map(), it = 0, Nr = function() {
|
|
5016
4979
|
var s = Math.min(y.length - 1, Math.floor((nt() - it) / 50));
|
|
5017
4980
|
return y[s];
|
|
@@ -5035,8 +4998,8 @@ var fe, et = -1, D = function(s) {
|
|
|
5035
4998
|
}
|
|
5036
4999
|
}, ot = function(s) {
|
|
5037
5000
|
var e = self.requestIdleCallback || self.setTimeout, t = -1;
|
|
5038
|
-
return s =
|
|
5039
|
-
},
|
|
5001
|
+
return s = Ie(s), document.visibilityState === "hidden" ? s() : (t = e(s), Z(s)), t;
|
|
5002
|
+
}, Se = [200, 500], Dr = function(s, e) {
|
|
5040
5003
|
"PerformanceEventTiming" in self && "interactionId" in PerformanceEventTiming.prototype && (e = e || {}, ee((function() {
|
|
5041
5004
|
var t;
|
|
5042
5005
|
Rr();
|
|
@@ -5047,13 +5010,13 @@ var fe, et = -1, D = function(s) {
|
|
|
5047
5010
|
c && c.latency !== n.value && (n.value = c.latency, n.entries = c.entries, r());
|
|
5048
5011
|
}));
|
|
5049
5012
|
}, o = $("event", i, { durationThreshold: (t = e.durationThreshold) !== null && t !== void 0 ? t : 40 });
|
|
5050
|
-
r =
|
|
5013
|
+
r = L(s, n, Se, e.reportAllChanges), o && (o.observe({ type: "first-input", buffered: !0 }), Z((function() {
|
|
5051
5014
|
i(o.takeRecords()), r(!0);
|
|
5052
5015
|
})), D((function() {
|
|
5053
|
-
it = nt(), y.length = 0, z.clear(), n = b("INP"), r =
|
|
5016
|
+
it = nt(), y.length = 0, z.clear(), n = b("INP"), r = L(s, n, Se, e.reportAllChanges);
|
|
5054
5017
|
})));
|
|
5055
5018
|
})));
|
|
5056
|
-
},
|
|
5019
|
+
}, pe = [2500, 4e3], oe = {}, kr = function(s, e) {
|
|
5057
5020
|
e = e || {}, ee((function() {
|
|
5058
5021
|
var t, r = tt(), n = b("LCP"), i = function(c) {
|
|
5059
5022
|
e.reportAllChanges || (c = c.slice(-1)), c.forEach((function(u) {
|
|
@@ -5061,8 +5024,8 @@ var fe, et = -1, D = function(s) {
|
|
|
5061
5024
|
}));
|
|
5062
5025
|
}, o = $("largest-contentful-paint", i);
|
|
5063
5026
|
if (o) {
|
|
5064
|
-
t =
|
|
5065
|
-
var l =
|
|
5027
|
+
t = L(s, n, pe, e.reportAllChanges);
|
|
5028
|
+
var l = Ie((function() {
|
|
5066
5029
|
oe[n.id] || (i(o.takeRecords()), o.disconnect(), oe[n.id] = !0, t(!0));
|
|
5067
5030
|
}));
|
|
5068
5031
|
["keydown", "click"].forEach((function(c) {
|
|
@@ -5070,13 +5033,13 @@ var fe, et = -1, D = function(s) {
|
|
|
5070
5033
|
return ot(l);
|
|
5071
5034
|
}), { once: !0, capture: !0 });
|
|
5072
5035
|
})), Z(l), D((function(c) {
|
|
5073
|
-
n = b("LCP"), t =
|
|
5036
|
+
n = b("LCP"), t = L(s, n, pe, e.reportAllChanges), _e((function() {
|
|
5074
5037
|
n.value = performance.now() - c.timeStamp, oe[n.id] = !0, t(!0);
|
|
5075
5038
|
}));
|
|
5076
5039
|
}));
|
|
5077
5040
|
}
|
|
5078
5041
|
}));
|
|
5079
|
-
},
|
|
5042
|
+
}, Te = [800, 1800], Vr = function s(e) {
|
|
5080
5043
|
document.prerendering ? ee((function() {
|
|
5081
5044
|
return s(e);
|
|
5082
5045
|
})) : document.readyState !== "complete" ? addEventListener("load", (function() {
|
|
@@ -5084,21 +5047,21 @@ var fe, et = -1, D = function(s) {
|
|
|
5084
5047
|
}), !0) : setTimeout(e, 0);
|
|
5085
5048
|
}, Ur = function(s, e) {
|
|
5086
5049
|
e = e || {};
|
|
5087
|
-
var t = b("TTFB"), r =
|
|
5050
|
+
var t = b("TTFB"), r = L(s, t, Te, e.reportAllChanges);
|
|
5088
5051
|
Vr((function() {
|
|
5089
|
-
var n =
|
|
5052
|
+
var n = ve();
|
|
5090
5053
|
n && (t.value = Math.max(n.responseStart - J(), 0), t.entries = [n], r(!0), D((function() {
|
|
5091
|
-
t = b("TTFB", 0), (r =
|
|
5054
|
+
t = b("TTFB", 0), (r = L(s, t, Te, e.reportAllChanges))(!0);
|
|
5092
5055
|
})));
|
|
5093
5056
|
}));
|
|
5094
5057
|
};
|
|
5095
|
-
const
|
|
5058
|
+
const xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5096
5059
|
__proto__: null,
|
|
5097
|
-
CLSThresholds:
|
|
5098
|
-
FCPThresholds:
|
|
5099
|
-
INPThresholds:
|
|
5100
|
-
LCPThresholds:
|
|
5101
|
-
TTFBThresholds:
|
|
5060
|
+
CLSThresholds: Ee,
|
|
5061
|
+
FCPThresholds: ge,
|
|
5062
|
+
INPThresholds: Se,
|
|
5063
|
+
LCPThresholds: pe,
|
|
5064
|
+
TTFBThresholds: Te,
|
|
5102
5065
|
onCLS: Mr,
|
|
5103
5066
|
onFCP: rt,
|
|
5104
5067
|
onINP: Dr,
|
|
@@ -5107,36 +5070,35 @@ const Hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5107
5070
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
5108
5071
|
export {
|
|
5109
5072
|
f as AppConfigValidationError,
|
|
5110
|
-
|
|
5073
|
+
Hr as DEFAULT_SESSION_TIMEOUT,
|
|
5111
5074
|
ue as DEFAULT_WEB_VITALS_MODE,
|
|
5112
|
-
|
|
5075
|
+
A as DeviceType,
|
|
5113
5076
|
ae as EmitterEvent,
|
|
5114
|
-
|
|
5077
|
+
x as ErrorType,
|
|
5115
5078
|
d as EventType,
|
|
5116
|
-
|
|
5079
|
+
Yr as InitializationTimeoutError,
|
|
5117
5080
|
V as IntegrationValidationError,
|
|
5118
|
-
|
|
5081
|
+
jr as MAX_ARRAY_LENGTH,
|
|
5119
5082
|
Wr as MAX_CUSTOM_EVENT_ARRAY_SIZE,
|
|
5120
5083
|
Br as MAX_CUSTOM_EVENT_KEYS,
|
|
5121
5084
|
Fr as MAX_CUSTOM_EVENT_NAME_LENGTH,
|
|
5122
5085
|
$r as MAX_CUSTOM_EVENT_STRING_SIZE,
|
|
5123
|
-
Xr as MAX_METADATA_NESTING_DEPTH,
|
|
5124
5086
|
Gr as MAX_NESTED_OBJECT_KEYS,
|
|
5125
|
-
|
|
5126
|
-
|
|
5087
|
+
Xr as MAX_STRING_LENGTH,
|
|
5088
|
+
Qr as MAX_STRING_LENGTH_IN_ARRAY,
|
|
5127
5089
|
K as Mode,
|
|
5128
|
-
|
|
5090
|
+
je as PII_PATTERNS,
|
|
5129
5091
|
O as PermanentError,
|
|
5130
|
-
|
|
5092
|
+
Ne as SamplingRateValidationError,
|
|
5131
5093
|
Q as ScrollDirection,
|
|
5132
5094
|
mt as SessionTimeoutValidationError,
|
|
5133
5095
|
U as SpecialApiUrl,
|
|
5134
5096
|
F as TraceLogValidationError,
|
|
5135
|
-
|
|
5136
|
-
|
|
5097
|
+
qr as WEB_VITALS_GOOD_THRESHOLDS,
|
|
5098
|
+
ke as WEB_VITALS_NEEDS_IMPROVEMENT_THRESHOLDS,
|
|
5137
5099
|
Rt as WEB_VITALS_POOR_THRESHOLDS,
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5100
|
+
Ve as getWebVitalsThresholds,
|
|
5101
|
+
zr as isPrimaryScrollEvent,
|
|
5102
|
+
Kr as isSecondaryScrollEvent,
|
|
5103
|
+
Jr as tracelog
|
|
5142
5104
|
};
|