@tracelog/lib 2.7.0-rc.95.6 → 2.7.1-rc.96.3
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 +305 -288
- package/dist/browser/tracelog.esm.js.map +1 -1
- package/dist/browser/tracelog.js +2 -1
- package/dist/browser/tracelog.js.map +1 -1
- package/dist/public-api.cjs +2 -2
- package/dist/public-api.cjs.map +1 -1
- package/dist/public-api.d.mts +4 -0
- package/dist/public-api.d.ts +4 -0
- package/dist/public-api.js +2 -2
- package/dist/public-api.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const b = "data-tlog",
|
|
1
|
+
const as = 9e5;
|
|
2
|
+
const ls = 120, cs = 49152, us = 100, ds = 500, hs = 200;
|
|
3
|
+
const fs = 1e3, ms = 500, gs = 1e3;
|
|
4
|
+
const b = "data-tlog", yt = [
|
|
5
5
|
"button",
|
|
6
6
|
"a",
|
|
7
7
|
'input[type="button"]',
|
|
@@ -33,7 +33,7 @@ const b = "data-tlog", _t = [
|
|
|
33
33
|
".menu-item",
|
|
34
34
|
"[data-testid]",
|
|
35
35
|
'[tabindex="0"]'
|
|
36
|
-
],
|
|
36
|
+
], wt = ["utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"], bt = [
|
|
37
37
|
"token",
|
|
38
38
|
"auth",
|
|
39
39
|
"key",
|
|
@@ -72,14 +72,14 @@ const m = {
|
|
|
72
72
|
INVALID_VIEWPORT_COOLDOWN_PERIOD: "Viewport cooldownPeriod must be a non-negative number",
|
|
73
73
|
INVALID_VIEWPORT_MAX_TRACKED_ELEMENTS: "Viewport maxTrackedElements must be a positive number",
|
|
74
74
|
INVALID_SEND_INTERVAL: "Send interval must be between 1000ms (1 second) and 60000ms (60 seconds)"
|
|
75
|
-
},
|
|
75
|
+
}, At = [
|
|
76
76
|
/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
|
|
77
77
|
/javascript:/gi,
|
|
78
78
|
/on\w+\s*=/gi,
|
|
79
79
|
/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi,
|
|
80
80
|
/<embed\b[^>]*>/gi,
|
|
81
81
|
/<object\b[^<]*(?:(?!<\/object>)<[^<]*)*<\/object>/gi
|
|
82
|
-
], I = "tlog", X = `${I}:qa_mode`, Ee = `${I}:uid`,
|
|
82
|
+
], I = "tlog", X = `${I}:qa_mode`, Ee = `${I}:uid`, tt = "tlog_mode", ke = "qa", Ve = "qa_off", Lt = (s) => s ? `${I}:${s}:queue` : `${I}:queue`, Mt = (s) => s ? `${I}:${s}:session` : `${I}:session`, Ct = (s) => s ? `${I}:${s}:broadcast` : `${I}:broadcast`, Ue = (s, e) => `${I}:${s}:session_counts:${e}`, He = 10080 * 60 * 1e3, xe = `${I}:session_counts_last_cleanup`, Fe = 3600 * 1e3, ue = (s) => s ? `${I}:${s}:identity` : `${I}:identity`, H = `${I}:pending_identity`;
|
|
83
83
|
var B = /* @__PURE__ */ ((s) => (s.Localhost = "localhost:8080", s.Fail = "localhost:9999", s))(B || {}), L = /* @__PURE__ */ ((s) => (s.Mobile = "mobile", s.Tablet = "tablet", s.Desktop = "desktop", s.Unknown = "unknown", s))(L || {}), Se = /* @__PURE__ */ ((s) => (s.EVENT = "event", s.QUEUE = "queue", s))(Se || {});
|
|
84
84
|
class N extends Error {
|
|
85
85
|
constructor(e, t) {
|
|
@@ -92,38 +92,38 @@ class O extends Error {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
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 || {}), ee = /* @__PURE__ */ ((s) => (s.UP = "up", s.DOWN = "down", s))(ee || {}), W = /* @__PURE__ */ ((s) => (s.JS_ERROR = "js_error", s.PROMISE_REJECTION = "promise_rejection", s))(W || {}), se = /* @__PURE__ */ ((s) => (s.QA = "qa", s))(se || {});
|
|
95
|
-
const
|
|
96
|
-
class
|
|
95
|
+
const Es = (s) => s.type === d.SCROLL && "scroll_data" in s && s.scroll_data.is_primary === !0, Ss = (s) => s.type === d.SCROLL && "scroll_data" in s && s.scroll_data.is_primary === !1;
|
|
96
|
+
class z extends Error {
|
|
97
97
|
constructor(e, t, r) {
|
|
98
98
|
super(e), this.errorCode = t, this.layer = r, this.name = this.constructor.name, Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
class f extends
|
|
101
|
+
class f extends z {
|
|
102
102
|
constructor(e, t = "config") {
|
|
103
103
|
super(e, "APP_CONFIG_INVALID", t);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
class
|
|
106
|
+
class Rt extends z {
|
|
107
107
|
constructor(e, t = "config") {
|
|
108
108
|
super(e, "SESSION_TIMEOUT_INVALID", t);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
class $e extends
|
|
111
|
+
class $e extends z {
|
|
112
112
|
constructor(e, t = "config") {
|
|
113
113
|
super(e, "SAMPLING_RATE_INVALID", t);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
class U extends
|
|
116
|
+
class U extends z {
|
|
117
117
|
constructor(e, t = "config") {
|
|
118
118
|
super(e, "INTEGRATION_INVALID", t);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
class
|
|
121
|
+
class ps extends z {
|
|
122
122
|
constructor(e, t, r = "runtime") {
|
|
123
123
|
super(e, "INITIALIZATION_TIMEOUT", r), this.timeoutMs = t;
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
const
|
|
126
|
+
const rt = "background: #ff9800; color: white; font-weight: bold; padding: 2px 8px; border-radius: 3px;", st = "background: #9e9e9e; color: white; font-weight: bold; padding: 2px 8px; border-radius: 3px;", Nt = "background: #d32f2f; color: white; font-weight: bold; padding: 2px 8px; border-radius: 3px;", Ot = (s, e) => {
|
|
127
127
|
if (e) {
|
|
128
128
|
if (e instanceof Error) {
|
|
129
129
|
const t = e.message.replace(/\s+at\s+.*$/gm, "").replace(/\s*\([^()]+:\d+:\d+\)/g, "");
|
|
@@ -142,7 +142,7 @@ const tt = "background: #ff9800; color: white; font-weight: bold; padding: 2px 8
|
|
|
142
142
|
return `[TraceLog] ${s}: ${String(e)}`;
|
|
143
143
|
}
|
|
144
144
|
return `[TraceLog] ${s}`;
|
|
145
|
-
},
|
|
145
|
+
}, Pt = () => {
|
|
146
146
|
if (typeof window > "u" || typeof sessionStorage > "u")
|
|
147
147
|
return !1;
|
|
148
148
|
try {
|
|
@@ -151,12 +151,12 @@ const tt = "background: #ff9800; color: white; font-weight: bold; padding: 2px 8
|
|
|
151
151
|
return !1;
|
|
152
152
|
}
|
|
153
153
|
}, a = (s, e, t) => {
|
|
154
|
-
const { error: r, data: n, showToClient: i = !1, style: o, visibility: l } = t ?? {}, c = r ?
|
|
155
|
-
if (!
|
|
154
|
+
const { error: r, data: n, showToClient: i = !1, style: o, visibility: l } = t ?? {}, c = r ? Ot(e, r) : `[TraceLog] ${e}`, u = s === "error" ? "error" : s === "warn" ? "warn" : "log";
|
|
155
|
+
if (!Dt(l, i))
|
|
156
156
|
return;
|
|
157
|
-
const E =
|
|
157
|
+
const E = kt(l, o), T = n !== void 0 ? pe(n) : void 0;
|
|
158
158
|
Vt(u, c, E, T);
|
|
159
|
-
},
|
|
159
|
+
}, Dt = (s, e) => s === "critical" ? !0 : s === "qa" || e ? Pt() : !1, kt = (s, e) => e !== void 0 && e !== "" ? e : s === "critical" ? Nt : "", Vt = (s, e, t, r) => {
|
|
160
160
|
const n = t !== void 0 && t !== "", i = n ? `%c${e}` : e;
|
|
161
161
|
r !== void 0 ? n ? console[s](i, t, r) : console[s](i, r) : n ? console[s](i, t) : console[s](i);
|
|
162
162
|
}, pe = (s) => {
|
|
@@ -173,10 +173,10 @@ const tt = "background: #ff9800; color: white; font-weight: bold; padding: 2px 8
|
|
|
173
173
|
}
|
|
174
174
|
return e;
|
|
175
175
|
};
|
|
176
|
-
let Te,
|
|
177
|
-
const
|
|
178
|
-
typeof window < "u" && !Te && (Te = window.matchMedia("(pointer: coarse)"),
|
|
179
|
-
}, ne = "Unknown",
|
|
176
|
+
let Te, nt;
|
|
177
|
+
const Ut = () => {
|
|
178
|
+
typeof window < "u" && !Te && (Te = window.matchMedia("(pointer: coarse)"), nt = window.matchMedia("(hover: none)"));
|
|
179
|
+
}, ne = "Unknown", Ht = (s) => {
|
|
180
180
|
const e = s.userAgentData?.platform;
|
|
181
181
|
if (e != null && e !== "") {
|
|
182
182
|
if (/windows/i.test(e)) return "Windows";
|
|
@@ -188,7 +188,7 @@ const kt = () => {
|
|
|
188
188
|
}
|
|
189
189
|
const t = navigator.userAgent;
|
|
190
190
|
return /Windows/i.test(t) ? "Windows" : /iPhone|iPad|iPod/i.test(t) ? "iOS" : /Mac OS X|Macintosh/i.test(t) ? "macOS" : /Android/i.test(t) ? "Android" : /CrOS/i.test(t) ? "ChromeOS" : /Linux/i.test(t) ? "Linux" : ne;
|
|
191
|
-
},
|
|
191
|
+
}, xt = (s) => {
|
|
192
192
|
const e = s.userAgentData?.brands;
|
|
193
193
|
if (e != null && e.length > 0) {
|
|
194
194
|
const n = e.filter((i) => !/not.?a.?brand|chromium/i.test(i.brand))[0];
|
|
@@ -199,26 +199,26 @@ const kt = () => {
|
|
|
199
199
|
}
|
|
200
200
|
const t = navigator.userAgent;
|
|
201
201
|
return /Edg\//i.test(t) ? "Edge" : /OPR\//i.test(t) ? "Opera" : /Chrome/i.test(t) ? "Chrome" : /Firefox/i.test(t) ? "Firefox" : /Safari/i.test(t) && !/Chrome/i.test(t) ? "Safari" : ne;
|
|
202
|
-
},
|
|
202
|
+
}, Ft = () => {
|
|
203
203
|
try {
|
|
204
204
|
const s = navigator;
|
|
205
205
|
if (s.userAgentData != null && typeof s.userAgentData.mobile == "boolean") {
|
|
206
206
|
const c = s.userAgentData.platform;
|
|
207
207
|
return c != null && c !== "" && /ipad|tablet/i.test(c) ? L.Tablet : s.userAgentData.mobile ? L.Mobile : L.Desktop;
|
|
208
208
|
}
|
|
209
|
-
|
|
210
|
-
const e = window.innerWidth, t = Te?.matches ?? !1, r =
|
|
209
|
+
Ut();
|
|
210
|
+
const e = window.innerWidth, t = Te?.matches ?? !1, r = nt?.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);
|
|
211
211
|
return e <= 767 || o && n ? L.Mobile : e >= 768 && e <= 1024 || l || t && r && n ? L.Tablet : L.Desktop;
|
|
212
212
|
} catch (s) {
|
|
213
213
|
return a("debug", "Device detection failed, defaulting to desktop", { error: s }), L.Desktop;
|
|
214
214
|
}
|
|
215
|
-
},
|
|
215
|
+
}, $t = () => {
|
|
216
216
|
try {
|
|
217
217
|
const s = navigator;
|
|
218
218
|
return {
|
|
219
|
-
type:
|
|
220
|
-
os:
|
|
221
|
-
browser:
|
|
219
|
+
type: Ft(),
|
|
220
|
+
os: Ht(s),
|
|
221
|
+
browser: xt(s)
|
|
222
222
|
};
|
|
223
223
|
} catch (s) {
|
|
224
224
|
return a("debug", "Device info detection failed, using defaults", { error: s }), {
|
|
@@ -227,7 +227,7 @@ const kt = () => {
|
|
|
227
227
|
browser: ne
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
|
-
},
|
|
230
|
+
}, it = [
|
|
231
231
|
// Email addresses
|
|
232
232
|
/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/gi,
|
|
233
233
|
// US Phone numbers (various formats)
|
|
@@ -242,7 +242,7 @@ const kt = () => {
|
|
|
242
242
|
/Bearer\s+[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?(?:\.[A-Za-z0-9_-]+)?/gi,
|
|
243
243
|
// Passwords in connection strings (protocol://user:password@host)
|
|
244
244
|
/:\/\/[^:/]+:([^@]+)@/gi
|
|
245
|
-
], Be = 500, We = 5e3, te = 50,
|
|
245
|
+
], Be = 500, We = 2e3, Ge = 5e3, te = 50, Bt = te * 2, ot = 1, Wt = 1e3, Gt = 10, Xe = 5e3, Xt = 6e4, Ts = {
|
|
246
246
|
LCP: 2500,
|
|
247
247
|
// Good: ≤ 2.5s
|
|
248
248
|
FCP: 1800,
|
|
@@ -254,7 +254,7 @@ const kt = () => {
|
|
|
254
254
|
TTFB: 800,
|
|
255
255
|
// Good: ≤ 800ms
|
|
256
256
|
LONG_TASK: 50
|
|
257
|
-
},
|
|
257
|
+
}, je = {
|
|
258
258
|
LCP: 2500,
|
|
259
259
|
// Needs improvement: > 2.5s (same as good boundary)
|
|
260
260
|
FCP: 1800,
|
|
@@ -266,7 +266,7 @@ const kt = () => {
|
|
|
266
266
|
TTFB: 800,
|
|
267
267
|
// Needs improvement: > 800ms
|
|
268
268
|
LONG_TASK: 50
|
|
269
|
-
},
|
|
269
|
+
}, jt = {
|
|
270
270
|
LCP: 4e3,
|
|
271
271
|
// Poor: > 4s
|
|
272
272
|
FCP: 3e3,
|
|
@@ -278,53 +278,53 @@ const kt = () => {
|
|
|
278
278
|
TTFB: 1800,
|
|
279
279
|
// Poor: > 1800ms
|
|
280
280
|
LONG_TASK: 50
|
|
281
|
-
}, Ie = "needs-improvement",
|
|
281
|
+
}, Ie = "needs-improvement", ze = (s = Ie) => {
|
|
282
282
|
switch (s) {
|
|
283
283
|
case "all":
|
|
284
284
|
return { LCP: 0, FCP: 0, CLS: 0, INP: 0, TTFB: 0, LONG_TASK: 0 };
|
|
285
285
|
// Track everything
|
|
286
286
|
case "needs-improvement":
|
|
287
|
-
return
|
|
287
|
+
return je;
|
|
288
288
|
case "poor":
|
|
289
|
-
return
|
|
289
|
+
return jt;
|
|
290
290
|
default:
|
|
291
|
-
return
|
|
291
|
+
return je;
|
|
292
292
|
}
|
|
293
|
-
},
|
|
293
|
+
}, zt = 1e3, Qt = 50, Kt = "2.7.1", Yt = Kt, at = () => typeof window < "u" && typeof sessionStorage < "u", qt = () => {
|
|
294
294
|
try {
|
|
295
295
|
const s = new URLSearchParams(window.location.search);
|
|
296
|
-
s.delete(
|
|
296
|
+
s.delete(tt);
|
|
297
297
|
const e = s.toString(), t = window.location.pathname + (e ? "?" + e : "") + window.location.hash;
|
|
298
298
|
window.history.replaceState({}, "", t);
|
|
299
299
|
} catch {
|
|
300
300
|
}
|
|
301
|
-
},
|
|
302
|
-
if (!
|
|
301
|
+
}, Jt = () => {
|
|
302
|
+
if (!at())
|
|
303
303
|
return !1;
|
|
304
304
|
try {
|
|
305
|
-
const e = new URLSearchParams(window.location.search).get(
|
|
305
|
+
const e = new URLSearchParams(window.location.search).get(tt), t = sessionStorage.getItem(X);
|
|
306
306
|
let r = null;
|
|
307
|
-
return e ===
|
|
308
|
-
visibility: "qa",
|
|
309
|
-
style: tt
|
|
310
|
-
})) : e === ke && (r = !1, sessionStorage.setItem(X, "false"), a("info", "QA Mode DISABLED", {
|
|
307
|
+
return e === ke ? (r = !0, sessionStorage.setItem(X, "true"), a("info", "QA Mode ACTIVE", {
|
|
311
308
|
visibility: "qa",
|
|
312
309
|
style: rt
|
|
313
|
-
}))
|
|
310
|
+
})) : e === Ve && (r = !1, sessionStorage.setItem(X, "false"), a("info", "QA Mode DISABLED", {
|
|
311
|
+
visibility: "qa",
|
|
312
|
+
style: st
|
|
313
|
+
})), (e === ke || e === Ve) && qt(), r ?? t === "true";
|
|
314
314
|
} catch {
|
|
315
315
|
return !1;
|
|
316
316
|
}
|
|
317
|
-
},
|
|
318
|
-
if (
|
|
317
|
+
}, Zt = (s) => {
|
|
318
|
+
if (at())
|
|
319
319
|
try {
|
|
320
320
|
sessionStorage.setItem(X, s ? "true" : "false"), a("info", s ? "QA Mode ACTIVE" : "QA Mode DISABLED", {
|
|
321
321
|
visibility: "qa",
|
|
322
|
-
style: s ?
|
|
322
|
+
style: s ? rt : st
|
|
323
323
|
});
|
|
324
324
|
} catch {
|
|
325
325
|
a("debug", "Cannot set QA mode: sessionStorage unavailable");
|
|
326
326
|
}
|
|
327
|
-
},
|
|
327
|
+
}, er = [
|
|
328
328
|
"co.uk",
|
|
329
329
|
"org.uk",
|
|
330
330
|
"com.au",
|
|
@@ -341,32 +341,32 @@ const kt = () => {
|
|
|
341
341
|
if (e.length <= 2)
|
|
342
342
|
return s.toLowerCase();
|
|
343
343
|
const t = e.slice(-2).join(".");
|
|
344
|
-
return
|
|
345
|
-
},
|
|
344
|
+
return er.includes(t) ? e.slice(-3).join(".") : e.slice(-2).join(".");
|
|
345
|
+
}, tr = (s, e) => s === e ? !0 : Qe(s) === Qe(e), de = () => {
|
|
346
346
|
const s = document.referrer;
|
|
347
347
|
if (!s)
|
|
348
348
|
return "Direct";
|
|
349
349
|
try {
|
|
350
350
|
const e = new URL(s).hostname.toLowerCase(), t = window.location.hostname.toLowerCase();
|
|
351
|
-
return
|
|
351
|
+
return tr(e, t) ? "Direct" : s;
|
|
352
352
|
} catch (e) {
|
|
353
353
|
return a("debug", "Failed to parse referrer URL, using raw value", { error: e, data: { referrer: s } }), s;
|
|
354
354
|
}
|
|
355
355
|
}, he = () => {
|
|
356
356
|
const s = new URLSearchParams(window.location.search), e = {};
|
|
357
|
-
return
|
|
357
|
+
return wt.forEach((r) => {
|
|
358
358
|
const n = s.get(r);
|
|
359
359
|
if (n) {
|
|
360
360
|
const i = r.split("utm_")[1];
|
|
361
361
|
e[i] = n;
|
|
362
362
|
}
|
|
363
363
|
}), Object.keys(e).length ? e : void 0;
|
|
364
|
-
},
|
|
364
|
+
}, lt = () => typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (s) => {
|
|
365
365
|
const e = Math.random() * 16 | 0;
|
|
366
366
|
return (s === "x" ? e : e & 3 | 8).toString(16);
|
|
367
367
|
});
|
|
368
368
|
let q = 0, J = 0;
|
|
369
|
-
const
|
|
369
|
+
const rr = () => {
|
|
370
370
|
let s = Date.now();
|
|
371
371
|
s < J && (s = J), s === J ? q = (q + 1) % 1e3 : q = 0, J = s;
|
|
372
372
|
const e = q.toString().padStart(3, "0");
|
|
@@ -379,14 +379,14 @@ const tr = () => {
|
|
|
379
379
|
} catch {
|
|
380
380
|
}
|
|
381
381
|
return t || (t = Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")), `${s}-${e}-${t}`;
|
|
382
|
-
},
|
|
382
|
+
}, ct = (s, e = !1) => {
|
|
383
383
|
try {
|
|
384
384
|
const t = new URL(s), r = t.protocol === "https:", n = t.protocol === "http:";
|
|
385
385
|
return r || e && n;
|
|
386
386
|
} catch {
|
|
387
387
|
return !1;
|
|
388
388
|
}
|
|
389
|
-
},
|
|
389
|
+
}, sr = (s) => {
|
|
390
390
|
try {
|
|
391
391
|
const t = new URL(window.location.href).hostname;
|
|
392
392
|
if (!t || typeof t != "string")
|
|
@@ -404,19 +404,19 @@ const tr = () => {
|
|
|
404
404
|
if (r.length === 2 ? n = r.join(".") : n = r.slice(-2).join("."), !n || n.split(".").length < 2)
|
|
405
405
|
throw new Error("Invalid domain structure for SaaS");
|
|
406
406
|
const i = `https://${s}.${n}/collect`;
|
|
407
|
-
if (!
|
|
407
|
+
if (!ct(i))
|
|
408
408
|
throw new Error("Generated URL failed validation");
|
|
409
409
|
return i;
|
|
410
410
|
} catch (e) {
|
|
411
411
|
throw new Error(`Invalid SaaS URL configuration: ${e instanceof Error ? e.message : String(e)}`);
|
|
412
412
|
}
|
|
413
|
-
},
|
|
413
|
+
}, nr = (s) => {
|
|
414
414
|
const e = {};
|
|
415
|
-
s.integrations?.tracelog?.projectId && (e.saas =
|
|
415
|
+
s.integrations?.tracelog?.projectId && (e.saas = sr(s.integrations.tracelog.projectId));
|
|
416
416
|
const t = s.integrations?.custom?.collectApiUrl;
|
|
417
417
|
if (t) {
|
|
418
418
|
const r = s.integrations?.custom?.allowHttp ?? !1;
|
|
419
|
-
if (!
|
|
419
|
+
if (!ct(t, r))
|
|
420
420
|
throw new Error("Invalid custom API URL");
|
|
421
421
|
e.custom = t;
|
|
422
422
|
}
|
|
@@ -425,7 +425,7 @@ const tr = () => {
|
|
|
425
425
|
if (!s || typeof s != "string")
|
|
426
426
|
return a("warn", "Invalid URL provided to normalizeUrl", { data: { type: typeof s } }), s || "";
|
|
427
427
|
try {
|
|
428
|
-
const t = new URL(s), r = t.searchParams, n = [.../* @__PURE__ */ new Set([...
|
|
428
|
+
const t = new URL(s), r = t.searchParams, n = [.../* @__PURE__ */ new Set([...bt, ...e])];
|
|
429
429
|
let i = !1;
|
|
430
430
|
const o = [];
|
|
431
431
|
return n.forEach((c) => {
|
|
@@ -434,13 +434,13 @@ const tr = () => {
|
|
|
434
434
|
} catch (t) {
|
|
435
435
|
return a("warn", "URL normalization failed, returning original", { error: t, data: { urlLength: s?.length } }), s;
|
|
436
436
|
}
|
|
437
|
-
},
|
|
437
|
+
}, Ke = (s) => {
|
|
438
438
|
if (!s || typeof s != "string" || s.trim().length === 0)
|
|
439
439
|
return "";
|
|
440
440
|
let e = s;
|
|
441
441
|
s.length > 1e3 && (e = s.slice(0, Math.max(0, 1e3)));
|
|
442
442
|
let t = 0;
|
|
443
|
-
for (const n of
|
|
443
|
+
for (const n of At) {
|
|
444
444
|
const i = e;
|
|
445
445
|
e = e.replace(n, ""), i !== e && t++;
|
|
446
446
|
}
|
|
@@ -454,7 +454,7 @@ const tr = () => {
|
|
|
454
454
|
if (s == null)
|
|
455
455
|
return null;
|
|
456
456
|
if (typeof s == "string")
|
|
457
|
-
return
|
|
457
|
+
return Ke(s);
|
|
458
458
|
if (typeof s == "number")
|
|
459
459
|
return !Number.isFinite(s) || s < -Number.MAX_SAFE_INTEGER || s > Number.MAX_SAFE_INTEGER ? 0 : s;
|
|
460
460
|
if (typeof s == "boolean")
|
|
@@ -466,7 +466,7 @@ const tr = () => {
|
|
|
466
466
|
if (typeof s == "object") {
|
|
467
467
|
const t = {}, n = Object.entries(s).slice(0, 200);
|
|
468
468
|
for (const [i, o] of n) {
|
|
469
|
-
const l =
|
|
469
|
+
const l = Ke(i);
|
|
470
470
|
if (l) {
|
|
471
471
|
const c = _e(o, e + 1);
|
|
472
472
|
c !== null && (t[l] = c);
|
|
@@ -475,7 +475,7 @@ const tr = () => {
|
|
|
475
475
|
return t;
|
|
476
476
|
}
|
|
477
477
|
return null;
|
|
478
|
-
},
|
|
478
|
+
}, ir = (s) => {
|
|
479
479
|
if (typeof s != "object" || s === null)
|
|
480
480
|
return {};
|
|
481
481
|
try {
|
|
@@ -485,15 +485,15 @@ const tr = () => {
|
|
|
485
485
|
const t = e instanceof Error ? e.message : String(e);
|
|
486
486
|
throw new Error(`[TraceLog] Metadata sanitization failed: ${t}`);
|
|
487
487
|
}
|
|
488
|
-
},
|
|
488
|
+
}, or = (s) => {
|
|
489
489
|
if (s !== void 0 && (s === null || typeof s != "object"))
|
|
490
490
|
throw new f("Configuration must be an object", "config");
|
|
491
491
|
if (s) {
|
|
492
492
|
if (s.sessionTimeout !== void 0 && (typeof s.sessionTimeout != "number" || s.sessionTimeout < 3e4 || s.sessionTimeout > 864e5))
|
|
493
|
-
throw new
|
|
493
|
+
throw new Rt(m.INVALID_SESSION_TIMEOUT, "config");
|
|
494
494
|
if (s.globalMetadata !== void 0 && (typeof s.globalMetadata != "object" || s.globalMetadata === null))
|
|
495
495
|
throw new f(m.INVALID_GLOBAL_METADATA, "config");
|
|
496
|
-
if (s.integrations &&
|
|
496
|
+
if (s.integrations && lr(s.integrations), s.sensitiveQueryParams !== void 0) {
|
|
497
497
|
if (!Array.isArray(s.sensitiveQueryParams))
|
|
498
498
|
throw new f(m.INVALID_SENSITIVE_QUERY_PARAMS, "config");
|
|
499
499
|
for (const e of s.sensitiveQueryParams)
|
|
@@ -525,7 +525,7 @@ const tr = () => {
|
|
|
525
525
|
throw new f(m.INVALID_MAX_SAME_EVENT_PER_MINUTE, "config");
|
|
526
526
|
if (s.sendIntervalMs !== void 0 && (!Number.isFinite(s.sendIntervalMs) || s.sendIntervalMs < 1e3 || s.sendIntervalMs > 6e4))
|
|
527
527
|
throw new f(m.INVALID_SEND_INTERVAL, "config");
|
|
528
|
-
if (s.viewport !== void 0 &&
|
|
528
|
+
if (s.viewport !== void 0 && ar(s.viewport), s.webVitalsMode !== void 0) {
|
|
529
529
|
if (typeof s.webVitalsMode != "string")
|
|
530
530
|
throw new f(
|
|
531
531
|
`Invalid webVitalsMode type: ${typeof s.webVitalsMode}. Must be a string`,
|
|
@@ -556,7 +556,7 @@ const tr = () => {
|
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
-
},
|
|
559
|
+
}, ar = (s) => {
|
|
560
560
|
if (typeof s != "object" || s === null)
|
|
561
561
|
throw new f(m.INVALID_VIEWPORT_CONFIG, "config");
|
|
562
562
|
if (!s.elements || !Array.isArray(s.elements))
|
|
@@ -586,7 +586,7 @@ const tr = () => {
|
|
|
586
586
|
throw new f(m.INVALID_VIEWPORT_COOLDOWN_PERIOD, "config");
|
|
587
587
|
if (s.maxTrackedElements !== void 0 && (typeof s.maxTrackedElements != "number" || s.maxTrackedElements <= 0))
|
|
588
588
|
throw new f(m.INVALID_VIEWPORT_MAX_TRACKED_ELEMENTS, "config");
|
|
589
|
-
},
|
|
589
|
+
}, lr = (s) => {
|
|
590
590
|
if (s) {
|
|
591
591
|
if (s.tracelog && (!s.tracelog.projectId || typeof s.tracelog.projectId != "string" || s.tracelog.projectId.trim() === ""))
|
|
592
592
|
throw new U(m.INVALID_TRACELOG_PROJECT_ID, "config");
|
|
@@ -607,14 +607,14 @@ const tr = () => {
|
|
|
607
607
|
throw new U('fetchCredentials must be "include", "same-origin", or "omit"', "config");
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
|
-
},
|
|
611
|
-
|
|
610
|
+
}, cr = (s) => {
|
|
611
|
+
or(s);
|
|
612
612
|
const e = {
|
|
613
613
|
...s ?? {},
|
|
614
614
|
sessionTimeout: s?.sessionTimeout ?? 9e5,
|
|
615
615
|
globalMetadata: s?.globalMetadata ?? {},
|
|
616
616
|
sensitiveQueryParams: s?.sensitiveQueryParams ?? [],
|
|
617
|
-
errorSampling: s?.errorSampling ??
|
|
617
|
+
errorSampling: s?.errorSampling ?? ot,
|
|
618
618
|
samplingRate: s?.samplingRate ?? 1,
|
|
619
619
|
pageViewThrottleMs: s?.pageViewThrottleMs ?? 1e3,
|
|
620
620
|
clickThrottleMs: s?.clickThrottleMs ?? 300,
|
|
@@ -636,13 +636,13 @@ const tr = () => {
|
|
|
636
636
|
return !0;
|
|
637
637
|
const t = typeof s;
|
|
638
638
|
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) => ye(r, e)) : t === "object" ? Object.values(s).every((r) => ye(r, e)) : !1);
|
|
639
|
-
},
|
|
639
|
+
}, ur = (s) => typeof s != "object" || s === null ? !1 : ye(s), ut = (s) => {
|
|
640
640
|
if (typeof s != "object" || s === null || Array.isArray(s)) return;
|
|
641
641
|
const e = {};
|
|
642
642
|
for (const [t, r] of Object.entries(s))
|
|
643
643
|
typeof r == "string" && (e[t] = r);
|
|
644
644
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
645
|
-
},
|
|
645
|
+
}, dr = (s) => typeof s != "string" ? {
|
|
646
646
|
valid: !1,
|
|
647
647
|
error: "Event name must be a string"
|
|
648
648
|
} : s.length === 0 ? {
|
|
@@ -657,9 +657,9 @@ const tr = () => {
|
|
|
657
657
|
} : ["constructor", "prototype", "__proto__", "eval", "function", "var", "let", "const"].includes(s.toLowerCase()) ? {
|
|
658
658
|
valid: !1,
|
|
659
659
|
error: "Event name cannot be a reserved word"
|
|
660
|
-
} : { valid: !0 },
|
|
661
|
-
const r =
|
|
662
|
-
if (!
|
|
660
|
+
} : { valid: !0 }, Ye = (s, e, t) => {
|
|
661
|
+
const r = ir(e), n = t && t === "customEvent" ? `${t} "${s}" metadata error` : `${s} metadata error`;
|
|
662
|
+
if (!ur(r))
|
|
663
663
|
return {
|
|
664
664
|
valid: !1,
|
|
665
665
|
error: `${n}: object has invalid types. Valid types are string, number, boolean or string arrays.`
|
|
@@ -707,7 +707,7 @@ const tr = () => {
|
|
|
707
707
|
valid: !0,
|
|
708
708
|
sanitizedMetadata: r
|
|
709
709
|
};
|
|
710
|
-
},
|
|
710
|
+
}, dt = (s, e, t) => {
|
|
711
711
|
if (Array.isArray(e)) {
|
|
712
712
|
const r = [], n = t && t === "customEvent" ? `${t} "${s}" metadata error` : `${s} metadata error`;
|
|
713
713
|
for (let i = 0; i < e.length; i++) {
|
|
@@ -717,7 +717,7 @@ const tr = () => {
|
|
|
717
717
|
valid: !1,
|
|
718
718
|
error: `${n}: array item at index ${i} must be an object.`
|
|
719
719
|
};
|
|
720
|
-
const l =
|
|
720
|
+
const l = Ye(s, o, t);
|
|
721
721
|
if (!l.valid)
|
|
722
722
|
return {
|
|
723
723
|
valid: !1,
|
|
@@ -730,16 +730,16 @@ const tr = () => {
|
|
|
730
730
|
sanitizedMetadata: r
|
|
731
731
|
};
|
|
732
732
|
}
|
|
733
|
-
return
|
|
734
|
-
},
|
|
735
|
-
const t =
|
|
733
|
+
return Ye(s, e, t);
|
|
734
|
+
}, hr = (s, e) => {
|
|
735
|
+
const t = dr(s);
|
|
736
736
|
if (!t.valid)
|
|
737
737
|
return a("error", "Event name validation failed", {
|
|
738
738
|
data: { eventName: s, error: t.error }
|
|
739
739
|
}), t;
|
|
740
740
|
if (!e)
|
|
741
741
|
return { valid: !0 };
|
|
742
|
-
const r =
|
|
742
|
+
const r = dt(s, e, "customEvent");
|
|
743
743
|
return r.valid || a("error", "Event metadata validation failed", {
|
|
744
744
|
data: {
|
|
745
745
|
eventName: s,
|
|
@@ -747,7 +747,7 @@ const tr = () => {
|
|
|
747
747
|
}
|
|
748
748
|
}), r;
|
|
749
749
|
};
|
|
750
|
-
class
|
|
750
|
+
class fr {
|
|
751
751
|
listeners = /* @__PURE__ */ new Map();
|
|
752
752
|
/**
|
|
753
753
|
* Subscribes to an event channel
|
|
@@ -864,7 +864,7 @@ class hr {
|
|
|
864
864
|
this.listeners.clear();
|
|
865
865
|
}
|
|
866
866
|
}
|
|
867
|
-
function
|
|
867
|
+
function ht(s, e, t) {
|
|
868
868
|
try {
|
|
869
869
|
const r = e(s);
|
|
870
870
|
return r === null ? null : typeof r == "object" && r !== null && "type" in r ? r : (a("warn", `beforeSend transformer returned invalid data, using original [${t}]`), s);
|
|
@@ -875,10 +875,10 @@ function dt(s, e, t) {
|
|
|
875
875
|
}), s;
|
|
876
876
|
}
|
|
877
877
|
}
|
|
878
|
-
function
|
|
879
|
-
return s.map((r) =>
|
|
878
|
+
function mr(s, e, t) {
|
|
879
|
+
return s.map((r) => ht(r, e, t)).filter((r) => r !== null);
|
|
880
880
|
}
|
|
881
|
-
function
|
|
881
|
+
function ft(s, e, t) {
|
|
882
882
|
try {
|
|
883
883
|
const r = e(s);
|
|
884
884
|
return r === null ? (a("debug", `Batch filtered by beforeBatch transformer [${t}]`, {
|
|
@@ -953,7 +953,7 @@ class w {
|
|
|
953
953
|
return { ...fe };
|
|
954
954
|
}
|
|
955
955
|
}
|
|
956
|
-
class
|
|
956
|
+
class qe extends w {
|
|
957
957
|
storeManager;
|
|
958
958
|
integrationId;
|
|
959
959
|
apiUrl;
|
|
@@ -1038,7 +1038,7 @@ class Ye extends w {
|
|
|
1038
1038
|
return { ...this.staticHeaders, ...e };
|
|
1039
1039
|
}
|
|
1040
1040
|
getQueueStorageKey() {
|
|
1041
|
-
const e = this.get("userId") || "anonymous", t =
|
|
1041
|
+
const e = this.get("userId") || "anonymous", t = Lt(e);
|
|
1042
1042
|
return this.integrationId ? `${t}:${this.integrationId}` : t;
|
|
1043
1043
|
}
|
|
1044
1044
|
/**
|
|
@@ -1268,7 +1268,7 @@ class Ye extends w {
|
|
|
1268
1268
|
const t = this.transformers.beforeSend;
|
|
1269
1269
|
if (!t)
|
|
1270
1270
|
return e;
|
|
1271
|
-
const r =
|
|
1271
|
+
const r = mr(
|
|
1272
1272
|
e.events,
|
|
1273
1273
|
t,
|
|
1274
1274
|
this.integrationId || "SenderManager"
|
|
@@ -1313,7 +1313,7 @@ class Ye extends w {
|
|
|
1313
1313
|
if (this.integrationId === "saas")
|
|
1314
1314
|
return e;
|
|
1315
1315
|
const t = this.transformers.beforeBatch;
|
|
1316
|
-
return t ?
|
|
1316
|
+
return t ? ft(e, t, this.integrationId || "SenderManager") : e;
|
|
1317
1317
|
}
|
|
1318
1318
|
/**
|
|
1319
1319
|
* Calculates exponential backoff delay with jitter for retry attempts.
|
|
@@ -1569,7 +1569,7 @@ class Ye extends w {
|
|
|
1569
1569
|
_metadata: {
|
|
1570
1570
|
referer: typeof window < "u" ? window.location.href : void 0,
|
|
1571
1571
|
timestamp: t,
|
|
1572
|
-
client_version:
|
|
1572
|
+
client_version: Yt
|
|
1573
1573
|
}
|
|
1574
1574
|
};
|
|
1575
1575
|
return {
|
|
@@ -1708,12 +1708,12 @@ class Ye extends w {
|
|
|
1708
1708
|
}
|
|
1709
1709
|
logPermanentError(e, t) {
|
|
1710
1710
|
const r = Date.now();
|
|
1711
|
-
(!this.lastPermanentErrorLog || this.lastPermanentErrorLog.statusCode !== t.statusCode || r - this.lastPermanentErrorLog.timestamp >=
|
|
1711
|
+
(!this.lastPermanentErrorLog || this.lastPermanentErrorLog.statusCode !== t.statusCode || r - this.lastPermanentErrorLog.timestamp >= Xt) && (a("error", `${e}${this.integrationId ? ` [${this.integrationId}]` : ""}`, {
|
|
1712
1712
|
data: { status: t.statusCode, message: t.message }
|
|
1713
1713
|
}), this.lastPermanentErrorLog = { statusCode: t.statusCode, timestamp: r });
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
1716
|
-
class
|
|
1716
|
+
class gr extends w {
|
|
1717
1717
|
bootTime;
|
|
1718
1718
|
bootTimestamp;
|
|
1719
1719
|
hasPerformanceNow;
|
|
@@ -1862,8 +1862,8 @@ class mr extends w {
|
|
|
1862
1862
|
};
|
|
1863
1863
|
}
|
|
1864
1864
|
}
|
|
1865
|
-
const
|
|
1866
|
-
class
|
|
1865
|
+
const Er = new Set(Object.values(d));
|
|
1866
|
+
class Sr extends w {
|
|
1867
1867
|
dataSenders;
|
|
1868
1868
|
emitter;
|
|
1869
1869
|
transformers;
|
|
@@ -1902,10 +1902,10 @@ class Er extends w {
|
|
|
1902
1902
|
* @param fetchCredentials - Fetch credentials mode for custom backend. @default 'include'
|
|
1903
1903
|
*/
|
|
1904
1904
|
constructor(e, t = null, r = {}, n = {}, i, o = "include") {
|
|
1905
|
-
super(), this.emitter = t, this.transformers = r, this.timeManager = new
|
|
1905
|
+
super(), this.emitter = t, this.transformers = r, this.timeManager = new gr(), this.dataSenders = [];
|
|
1906
1906
|
const l = this.get("collectApiUrls");
|
|
1907
|
-
l?.saas && this.dataSenders.push(new
|
|
1908
|
-
new
|
|
1907
|
+
l?.saas && this.dataSenders.push(new qe(e, "saas", l.saas, r)), l?.custom && this.dataSenders.push(
|
|
1908
|
+
new qe(
|
|
1909
1909
|
e,
|
|
1910
1910
|
"custom",
|
|
1911
1911
|
l.custom,
|
|
@@ -2033,7 +2033,7 @@ class Er extends w {
|
|
|
2033
2033
|
a("error", "Event type is required - event will be ignored");
|
|
2034
2034
|
return;
|
|
2035
2035
|
}
|
|
2036
|
-
if (!
|
|
2036
|
+
if (!Er.has(e)) {
|
|
2037
2037
|
a("error", "Invalid event type - event will be ignored", {
|
|
2038
2038
|
data: { type: e }
|
|
2039
2039
|
});
|
|
@@ -2491,7 +2491,7 @@ class Er extends w {
|
|
|
2491
2491
|
};
|
|
2492
2492
|
const i = this.get("collectApiUrls"), o = !!(i?.custom || i?.saas), l = this.transformers.beforeBatch;
|
|
2493
2493
|
if (!o && l) {
|
|
2494
|
-
const c =
|
|
2494
|
+
const c = ft(n, l, "EventManager");
|
|
2495
2495
|
c !== null && (n = c);
|
|
2496
2496
|
}
|
|
2497
2497
|
return n;
|
|
@@ -2503,7 +2503,7 @@ class Er extends w {
|
|
|
2503
2503
|
});
|
|
2504
2504
|
const i = this.get("sessionReferrer"), o = this.get("sessionUtm");
|
|
2505
2505
|
let l = {
|
|
2506
|
-
id:
|
|
2506
|
+
id: rr(),
|
|
2507
2507
|
type: e.type,
|
|
2508
2508
|
page_url: t,
|
|
2509
2509
|
timestamp: r,
|
|
@@ -2520,7 +2520,7 @@ class Er extends w {
|
|
|
2520
2520
|
};
|
|
2521
2521
|
const c = this.get("collectApiUrls"), u = !!c?.custom, g = !!c?.saas, E = u || g, T = u && g, S = this.transformers.beforeSend;
|
|
2522
2522
|
if (S && (!E || u && !T)) {
|
|
2523
|
-
const Y =
|
|
2523
|
+
const Y = ht(l, S, "EventManager");
|
|
2524
2524
|
if (Y === null)
|
|
2525
2525
|
return null;
|
|
2526
2526
|
l = Y;
|
|
@@ -2823,7 +2823,7 @@ class Er extends w {
|
|
|
2823
2823
|
}
|
|
2824
2824
|
}
|
|
2825
2825
|
}
|
|
2826
|
-
class
|
|
2826
|
+
class pr {
|
|
2827
2827
|
/**
|
|
2828
2828
|
* Gets or creates a unique user ID.
|
|
2829
2829
|
*
|
|
@@ -2844,12 +2844,12 @@ class Sr {
|
|
|
2844
2844
|
const t = e.getItem(Ee);
|
|
2845
2845
|
if (t)
|
|
2846
2846
|
return t;
|
|
2847
|
-
const r =
|
|
2847
|
+
const r = lt();
|
|
2848
2848
|
return e.setItem(Ee, r), r;
|
|
2849
2849
|
}
|
|
2850
2850
|
}
|
|
2851
|
-
const
|
|
2852
|
-
class
|
|
2851
|
+
const Tr = /^\d{13}-[a-z0-9]{9}$/;
|
|
2852
|
+
class Ir extends w {
|
|
2853
2853
|
storageManager;
|
|
2854
2854
|
eventManager;
|
|
2855
2855
|
projectId;
|
|
@@ -2875,7 +2875,7 @@ class Tr extends w {
|
|
|
2875
2875
|
return;
|
|
2876
2876
|
}
|
|
2877
2877
|
const e = this.getProjectId();
|
|
2878
|
-
this.broadcastChannel = new BroadcastChannel(
|
|
2878
|
+
this.broadcastChannel = new BroadcastChannel(Ct(e)), this.broadcastChannel.onmessage = (t) => {
|
|
2879
2879
|
const { action: r, sessionId: n, timestamp: i, projectId: o } = t.data ?? {};
|
|
2880
2880
|
o === e && (r === "session_start" && n && typeof i == "number" && i > Date.now() - 5e3 ? (this.set("sessionId", n), this.persistSession(n, i), this.isTracking && this.setupSessionTimeout()) : r && r !== "session_start" && a("debug", "Ignored BroadcastChannel message with unknown action", { data: { action: r } }));
|
|
2881
2881
|
};
|
|
@@ -2895,7 +2895,7 @@ class Tr extends w {
|
|
|
2895
2895
|
const e = this.loadStoredSession();
|
|
2896
2896
|
if (!e)
|
|
2897
2897
|
return null;
|
|
2898
|
-
if (!
|
|
2898
|
+
if (!Tr.test(e.id))
|
|
2899
2899
|
return a("warn", "Invalid session ID format recovered from storage, clearing", {
|
|
2900
2900
|
data: { sessionId: e.id }
|
|
2901
2901
|
}), this.clearStoredSession(), null;
|
|
@@ -2940,7 +2940,7 @@ class Tr extends w {
|
|
|
2940
2940
|
this.storageManager.setItem(t, r), this.storageManager.setSessionItem(t, r);
|
|
2941
2941
|
}
|
|
2942
2942
|
getSessionStorageKey() {
|
|
2943
|
-
return
|
|
2943
|
+
return Mt(this.getProjectId());
|
|
2944
2944
|
}
|
|
2945
2945
|
getProjectId() {
|
|
2946
2946
|
return this.projectId;
|
|
@@ -3180,7 +3180,7 @@ class Tr extends w {
|
|
|
3180
3180
|
this.clearSessionTimeout(), this.cleanupActivityListeners(), this.cleanupCrossTabSync(), this.cleanupLifecycleListeners(), this.isTracking = !1, this.needsRenewal = !1, this.set("hasStartSession", !1);
|
|
3181
3181
|
}
|
|
3182
3182
|
}
|
|
3183
|
-
class
|
|
3183
|
+
class vr extends w {
|
|
3184
3184
|
eventManager;
|
|
3185
3185
|
storageManager;
|
|
3186
3186
|
sessionManager = null;
|
|
@@ -3215,7 +3215,7 @@ class Ir extends w {
|
|
|
3215
3215
|
}
|
|
3216
3216
|
const t = this.get("config")?.integrations?.tracelog?.projectId ?? "custom";
|
|
3217
3217
|
try {
|
|
3218
|
-
this.sessionManager = new
|
|
3218
|
+
this.sessionManager = new Ir(this.storageManager, this.eventManager, t), this.sessionManager.startTracking(), this.eventManager.flushPendingEvents();
|
|
3219
3219
|
} catch (r) {
|
|
3220
3220
|
if (this.sessionManager) {
|
|
3221
3221
|
try {
|
|
@@ -3268,7 +3268,7 @@ class Ir extends w {
|
|
|
3268
3268
|
this.destroyed || (this.sessionManager && (this.sessionManager.destroy(), this.sessionManager = null), this.destroyed = !0);
|
|
3269
3269
|
}
|
|
3270
3270
|
}
|
|
3271
|
-
class
|
|
3271
|
+
class _r extends w {
|
|
3272
3272
|
eventManager;
|
|
3273
3273
|
onTrack;
|
|
3274
3274
|
originalPushState;
|
|
@@ -3344,7 +3344,7 @@ class vr extends w {
|
|
|
3344
3344
|
};
|
|
3345
3345
|
}
|
|
3346
3346
|
}
|
|
3347
|
-
class
|
|
3347
|
+
class yr extends w {
|
|
3348
3348
|
eventManager;
|
|
3349
3349
|
lastClickTimes = /* @__PURE__ */ new Map();
|
|
3350
3350
|
clickHandler;
|
|
@@ -3482,7 +3482,7 @@ class _r extends w {
|
|
|
3482
3482
|
return e.hasAttribute(`${b}-name`) ? e : e.closest(`[${b}-name]`);
|
|
3483
3483
|
}
|
|
3484
3484
|
getRelevantClickElement(e) {
|
|
3485
|
-
for (const t of
|
|
3485
|
+
for (const t of yt)
|
|
3486
3486
|
try {
|
|
3487
3487
|
if (e.matches(t))
|
|
3488
3488
|
return e;
|
|
@@ -3562,7 +3562,7 @@ class _r extends w {
|
|
|
3562
3562
|
*/
|
|
3563
3563
|
sanitizeText(e) {
|
|
3564
3564
|
let t = e;
|
|
3565
|
-
for (const r of
|
|
3565
|
+
for (const r of it) {
|
|
3566
3566
|
const n = new RegExp(r.source, r.flags);
|
|
3567
3567
|
t = t.replace(n, "[REDACTED]");
|
|
3568
3568
|
}
|
|
@@ -3601,7 +3601,7 @@ class _r extends w {
|
|
|
3601
3601
|
};
|
|
3602
3602
|
}
|
|
3603
3603
|
}
|
|
3604
|
-
class
|
|
3604
|
+
class wr extends w {
|
|
3605
3605
|
eventManager;
|
|
3606
3606
|
containers = [];
|
|
3607
3607
|
limitWarningLogged = !1;
|
|
@@ -3829,7 +3829,7 @@ class yr extends w {
|
|
|
3829
3829
|
e.isPrimary = t;
|
|
3830
3830
|
}
|
|
3831
3831
|
}
|
|
3832
|
-
class
|
|
3832
|
+
class br extends w {
|
|
3833
3833
|
eventManager;
|
|
3834
3834
|
trackedElements = /* @__PURE__ */ new Map();
|
|
3835
3835
|
observer = null;
|
|
@@ -3990,7 +3990,7 @@ class wr extends w {
|
|
|
3990
3990
|
});
|
|
3991
3991
|
}
|
|
3992
3992
|
}
|
|
3993
|
-
class
|
|
3993
|
+
class Ar {
|
|
3994
3994
|
storage;
|
|
3995
3995
|
sessionStorageRef;
|
|
3996
3996
|
fallbackStorage = /* @__PURE__ */ new Map();
|
|
@@ -4273,7 +4273,7 @@ class br {
|
|
|
4273
4273
|
this.fallbackSessionStorage.delete(e);
|
|
4274
4274
|
}
|
|
4275
4275
|
}
|
|
4276
|
-
class
|
|
4276
|
+
class Lr extends w {
|
|
4277
4277
|
eventManager;
|
|
4278
4278
|
reportedByNav = /* @__PURE__ */ new Map();
|
|
4279
4279
|
navigationHistory = [];
|
|
@@ -4284,7 +4284,7 @@ class Ar extends w {
|
|
|
4284
4284
|
navigationCounter = 0;
|
|
4285
4285
|
// Counter for handling simultaneous navigations edge case
|
|
4286
4286
|
constructor(e) {
|
|
4287
|
-
super(), this.eventManager = e, this.vitalThresholds =
|
|
4287
|
+
super(), this.eventManager = e, this.vitalThresholds = ze(Ie);
|
|
4288
4288
|
}
|
|
4289
4289
|
/**
|
|
4290
4290
|
* Starts tracking Web Vitals and performance metrics.
|
|
@@ -4302,7 +4302,7 @@ class Ar extends w {
|
|
|
4302
4302
|
*/
|
|
4303
4303
|
async startTracking() {
|
|
4304
4304
|
const e = this.get("config"), t = e?.webVitalsMode ?? Ie;
|
|
4305
|
-
this.vitalThresholds =
|
|
4305
|
+
this.vitalThresholds = ze(t), e?.webVitalsThresholds && (this.vitalThresholds = { ...this.vitalThresholds, ...e.webVitalsThresholds }), await this.initWebVitals(), this.observeLongTasks();
|
|
4306
4306
|
}
|
|
4307
4307
|
/**
|
|
4308
4308
|
* Stops tracking Web Vitals and cleans up resources.
|
|
@@ -4372,7 +4372,7 @@ class Ar extends w {
|
|
|
4372
4372
|
}
|
|
4373
4373
|
async initWebVitals() {
|
|
4374
4374
|
try {
|
|
4375
|
-
const { onLCP: e, onCLS: t, onFCP: r, onTTFB: n, onINP: i } = await Promise.resolve().then(() =>
|
|
4375
|
+
const { onLCP: e, onCLS: t, onFCP: r, onTTFB: n, onINP: i } = await Promise.resolve().then(() => os), o = (l) => (c) => {
|
|
4376
4376
|
const u = Number(c.value.toFixed(2));
|
|
4377
4377
|
this.sendVital({ type: l, value: u });
|
|
4378
4378
|
};
|
|
@@ -4399,7 +4399,7 @@ class Ar extends w {
|
|
|
4399
4399
|
const t = e.getEntries();
|
|
4400
4400
|
for (const r of t) {
|
|
4401
4401
|
const n = Number(r.duration.toFixed(2)), i = Date.now();
|
|
4402
|
-
i - this.lastLongTaskSentAt >=
|
|
4402
|
+
i - this.lastLongTaskSentAt >= zt && (this.shouldSendVital("LONG_TASK", n) && this.trackWebVital("LONG_TASK", n), this.lastLongTaskSentAt = i);
|
|
4403
4403
|
}
|
|
4404
4404
|
},
|
|
4405
4405
|
{ type: "longtask", buffered: !0 }
|
|
@@ -4506,7 +4506,7 @@ class Ar extends w {
|
|
|
4506
4506
|
return !(typeof r == "number" && t <= r);
|
|
4507
4507
|
}
|
|
4508
4508
|
}
|
|
4509
|
-
class
|
|
4509
|
+
class Mr extends w {
|
|
4510
4510
|
eventManager;
|
|
4511
4511
|
recentErrors = /* @__PURE__ */ new Map();
|
|
4512
4512
|
errorBurstCounter = 0;
|
|
@@ -4542,28 +4542,32 @@ class Lr extends w {
|
|
|
4542
4542
|
const e = Date.now();
|
|
4543
4543
|
if (e < this.burstBackoffUntil)
|
|
4544
4544
|
return !1;
|
|
4545
|
-
if (e - this.burstWindowStart >
|
|
4546
|
-
return this.burstBackoffUntil = e +
|
|
4545
|
+
if (e - this.burstWindowStart > Wt && (this.errorBurstCounter = 0, this.burstWindowStart = e), this.errorBurstCounter++, this.errorBurstCounter > Gt)
|
|
4546
|
+
return this.burstBackoffUntil = e + Xe, a("debug", "Error burst detected - entering cooldown", {
|
|
4547
4547
|
data: {
|
|
4548
4548
|
errorsInWindow: this.errorBurstCounter,
|
|
4549
|
-
cooldownMs:
|
|
4549
|
+
cooldownMs: Xe
|
|
4550
4550
|
}
|
|
4551
4551
|
}), !1;
|
|
4552
|
-
const r = this.get("config")?.errorSampling ??
|
|
4552
|
+
const r = this.get("config")?.errorSampling ?? ot;
|
|
4553
4553
|
return Math.random() < r;
|
|
4554
4554
|
}
|
|
4555
4555
|
handleError = (e) => {
|
|
4556
4556
|
if (!this.shouldSample())
|
|
4557
4557
|
return;
|
|
4558
4558
|
const t = this.sanitize(e.message || "Unknown error");
|
|
4559
|
-
this.shouldSuppressError(W.JS_ERROR, t)
|
|
4559
|
+
if (this.shouldSuppressError(W.JS_ERROR, t))
|
|
4560
|
+
return;
|
|
4561
|
+
const r = typeof e.error?.stack == "string" ? this.truncateStack(e.error.stack) : void 0;
|
|
4562
|
+
this.eventManager.track({
|
|
4560
4563
|
type: d.ERROR,
|
|
4561
4564
|
error_data: {
|
|
4562
4565
|
type: W.JS_ERROR,
|
|
4563
4566
|
message: t,
|
|
4564
|
-
...e.filename && { filename: e.filename },
|
|
4565
|
-
...e.lineno && { line: e.lineno },
|
|
4566
|
-
...e.colno && { column: e.colno }
|
|
4567
|
+
...e.filename !== "" && { filename: e.filename },
|
|
4568
|
+
...e.lineno !== 0 && { line: e.lineno },
|
|
4569
|
+
...e.colno !== 0 && { column: e.colno },
|
|
4570
|
+
...r !== void 0 && { stack: r }
|
|
4567
4571
|
}
|
|
4568
4572
|
});
|
|
4569
4573
|
};
|
|
@@ -4571,30 +4575,38 @@ class Lr extends w {
|
|
|
4571
4575
|
if (!this.shouldSample())
|
|
4572
4576
|
return;
|
|
4573
4577
|
const t = this.extractRejectionMessage(e.reason), r = this.sanitize(t);
|
|
4574
|
-
this.shouldSuppressError(W.PROMISE_REJECTION, r)
|
|
4578
|
+
if (this.shouldSuppressError(W.PROMISE_REJECTION, r))
|
|
4579
|
+
return;
|
|
4580
|
+
const n = e.reason instanceof Error && e.reason.stack !== void 0 ? this.truncateStack(e.reason.stack) : void 0;
|
|
4581
|
+
this.eventManager.track({
|
|
4575
4582
|
type: d.ERROR,
|
|
4576
4583
|
error_data: {
|
|
4577
4584
|
type: W.PROMISE_REJECTION,
|
|
4578
|
-
message: r
|
|
4585
|
+
message: r,
|
|
4586
|
+
...n !== void 0 && { stack: n }
|
|
4579
4587
|
}
|
|
4580
4588
|
});
|
|
4581
4589
|
};
|
|
4582
4590
|
extractRejectionMessage(e) {
|
|
4583
|
-
if (
|
|
4591
|
+
if (e == null) return "Unknown rejection";
|
|
4584
4592
|
if (typeof e == "string") return e;
|
|
4585
4593
|
if (e instanceof Error)
|
|
4586
|
-
return e.stack ?? e.message
|
|
4594
|
+
return e.stack ?? e.message;
|
|
4587
4595
|
if (typeof e == "object" && "message" in e)
|
|
4588
4596
|
return String(e.message);
|
|
4589
4597
|
try {
|
|
4590
4598
|
return JSON.stringify(e);
|
|
4591
4599
|
} catch {
|
|
4592
|
-
return
|
|
4600
|
+
return "Unserializable rejection";
|
|
4593
4601
|
}
|
|
4594
4602
|
}
|
|
4595
4603
|
sanitize(e) {
|
|
4596
|
-
|
|
4597
|
-
|
|
4604
|
+
const t = e.length > Be ? e.slice(0, Be) + "..." : e;
|
|
4605
|
+
return this.sanitizePii(t);
|
|
4606
|
+
}
|
|
4607
|
+
sanitizePii(e) {
|
|
4608
|
+
let t = e;
|
|
4609
|
+
for (const r of it) {
|
|
4598
4610
|
const n = new RegExp(r.source, r.flags);
|
|
4599
4611
|
t = t.replace(n, "[REDACTED]");
|
|
4600
4612
|
}
|
|
@@ -4602,12 +4614,17 @@ class Lr extends w {
|
|
|
4602
4614
|
}
|
|
4603
4615
|
shouldSuppressError(e, t) {
|
|
4604
4616
|
const r = Date.now(), n = `${e}:${t}`, i = this.recentErrors.get(n);
|
|
4605
|
-
return i && r - i <
|
|
4617
|
+
return i !== void 0 && r - i < Ge ? (this.recentErrors.set(n, r), !0) : (this.recentErrors.set(n, r), this.recentErrors.size > Bt ? (this.recentErrors.clear(), this.recentErrors.set(n, r), !1) : (this.recentErrors.size > te && this.pruneOldErrors(), !1));
|
|
4618
|
+
}
|
|
4619
|
+
truncateStack(e) {
|
|
4620
|
+
const t = e.length <= We ? e : e.slice(0, We) + `
|
|
4621
|
+
...truncated`;
|
|
4622
|
+
return this.sanitizePii(t);
|
|
4606
4623
|
}
|
|
4607
4624
|
pruneOldErrors() {
|
|
4608
4625
|
const e = Date.now();
|
|
4609
4626
|
for (const [n, i] of this.recentErrors.entries())
|
|
4610
|
-
e - i >
|
|
4627
|
+
e - i > Ge && this.recentErrors.delete(n);
|
|
4611
4628
|
if (this.recentErrors.size <= te)
|
|
4612
4629
|
return;
|
|
4613
4630
|
const t = Array.from(this.recentErrors.entries()).sort((n, i) => n[1] - i[1]), r = this.recentErrors.size - te;
|
|
@@ -4617,11 +4634,11 @@ class Lr extends w {
|
|
|
4617
4634
|
}
|
|
4618
4635
|
}
|
|
4619
4636
|
}
|
|
4620
|
-
class
|
|
4637
|
+
class Cr extends w {
|
|
4621
4638
|
isInitialized = !1;
|
|
4622
4639
|
suppressNextScrollTimer = null;
|
|
4623
4640
|
pageUnloadHandler = null;
|
|
4624
|
-
emitter = new
|
|
4641
|
+
emitter = new fr();
|
|
4625
4642
|
transformers = {};
|
|
4626
4643
|
customHeadersProvider;
|
|
4627
4644
|
managers = {};
|
|
@@ -4639,11 +4656,11 @@ class Mr extends w {
|
|
|
4639
4656
|
async init(e = {}) {
|
|
4640
4657
|
if (this.isInitialized)
|
|
4641
4658
|
return { sessionId: this.get("sessionId") ?? "" };
|
|
4642
|
-
this.managers.storage = new
|
|
4659
|
+
this.managers.storage = new Ar();
|
|
4643
4660
|
try {
|
|
4644
4661
|
this.setupState(e);
|
|
4645
4662
|
const t = e.integrations?.custom?.headers ?? {}, r = e.integrations?.custom?.fetchCredentials ?? "include";
|
|
4646
|
-
return this.managers.event = new
|
|
4663
|
+
return this.managers.event = new Sr(
|
|
4647
4664
|
this.managers.storage,
|
|
4648
4665
|
this.emitter,
|
|
4649
4666
|
this.transformers,
|
|
@@ -4673,7 +4690,7 @@ class Mr extends w {
|
|
|
4673
4690
|
}
|
|
4674
4691
|
let r = t;
|
|
4675
4692
|
t && typeof t == "object" && !Array.isArray(t) && Object.getPrototypeOf(t) !== Object.prototype && (r = Object.assign({}, t));
|
|
4676
|
-
const { valid: n, error: i, sanitizedMetadata: o } =
|
|
4693
|
+
const { valid: n, error: i, sanitizedMetadata: o } = hr(e, r);
|
|
4677
4694
|
if (!n) {
|
|
4678
4695
|
if (this.get("mode") === se.QA)
|
|
4679
4696
|
throw new Error(`[TraceLog] Custom event "${e}" validation failed: ${i}`);
|
|
@@ -4743,14 +4760,14 @@ class Mr extends w {
|
|
|
4743
4760
|
}
|
|
4744
4761
|
setupState(e = {}) {
|
|
4745
4762
|
this.set("config", e);
|
|
4746
|
-
const t =
|
|
4763
|
+
const t = pr.getId(this.managers.storage);
|
|
4747
4764
|
this.set("userId", t);
|
|
4748
|
-
const r =
|
|
4765
|
+
const r = nr(e);
|
|
4749
4766
|
this.set("collectApiUrls", r);
|
|
4750
|
-
const n =
|
|
4767
|
+
const n = $t();
|
|
4751
4768
|
this.set("device", n);
|
|
4752
4769
|
const i = ve(window.location.href, e.sensitiveQueryParams);
|
|
4753
|
-
this.set("pageUrl", i),
|
|
4770
|
+
this.set("pageUrl", i), Jt() && this.set("mode", se.QA);
|
|
4754
4771
|
}
|
|
4755
4772
|
/**
|
|
4756
4773
|
* Returns the current configuration object.
|
|
@@ -4801,7 +4818,7 @@ class Mr extends w {
|
|
|
4801
4818
|
valid: !1,
|
|
4802
4819
|
error: "Global metadata must be a plain object"
|
|
4803
4820
|
};
|
|
4804
|
-
const t =
|
|
4821
|
+
const t = dt("Global", e, "globalMetadata");
|
|
4805
4822
|
return t.valid ? { valid: !0 } : {
|
|
4806
4823
|
valid: !1,
|
|
4807
4824
|
error: t.error
|
|
@@ -4868,7 +4885,7 @@ class Mr extends w {
|
|
|
4868
4885
|
a("warn", "identify() userId exceeds 256 characters", { data: { length: e.trim().length } });
|
|
4869
4886
|
return;
|
|
4870
4887
|
}
|
|
4871
|
-
const r = e.trim(), n =
|
|
4888
|
+
const r = e.trim(), n = ut(t), i = {
|
|
4872
4889
|
userId: r,
|
|
4873
4890
|
...n ? { traits: n } : {}
|
|
4874
4891
|
};
|
|
@@ -4887,7 +4904,7 @@ class Mr extends w {
|
|
|
4887
4904
|
*/
|
|
4888
4905
|
async resetIdentity() {
|
|
4889
4906
|
await this.managers.event?.flushImmediately(), this.set("identity", void 0), this.clearPersistedIdentity();
|
|
4890
|
-
const e =
|
|
4907
|
+
const e = lt();
|
|
4891
4908
|
this.managers.storage.setItem(Ee, e), this.set("userId", e), this.set("hasStartSession", !1), this.set("sessionId", null), this.handlers.session?.stopTracking(), this.handlers.session?.startTracking(), a("debug", "Identity reset, new UUID generated");
|
|
4892
4909
|
}
|
|
4893
4910
|
/**
|
|
@@ -4977,7 +4994,7 @@ class Mr extends w {
|
|
|
4977
4994
|
}
|
|
4978
4995
|
initializeHandlers() {
|
|
4979
4996
|
const e = this.get("config");
|
|
4980
|
-
this.handlers.session = new
|
|
4997
|
+
this.handlers.session = new vr(
|
|
4981
4998
|
this.managers.storage,
|
|
4982
4999
|
this.managers.event
|
|
4983
5000
|
), this.handlers.session.startTracking();
|
|
@@ -4986,20 +5003,20 @@ class Mr extends w {
|
|
|
4986
5003
|
this.set("suppressNextScroll", !1);
|
|
4987
5004
|
}, 500);
|
|
4988
5005
|
};
|
|
4989
|
-
this.handlers.pageView = new
|
|
5006
|
+
this.handlers.pageView = new _r(this.managers.event, t), this.handlers.pageView.startTracking(), this.handlers.click = new yr(this.managers.event), this.handlers.click.startTracking(), this.handlers.scroll = new wr(this.managers.event), this.handlers.scroll.startTracking(), this.handlers.performance = new Lr(this.managers.event), this.handlers.performance.startTracking().catch((r) => {
|
|
4990
5007
|
a("warn", "Failed to start performance tracking", { error: r });
|
|
4991
|
-
}), this.handlers.error = new
|
|
5008
|
+
}), this.handlers.error = new Mr(this.managers.event), this.handlers.error.startTracking(), e.viewport && (this.handlers.viewport = new br(this.managers.event), this.handlers.viewport.startTracking());
|
|
4992
5009
|
}
|
|
4993
5010
|
}
|
|
4994
|
-
const
|
|
5011
|
+
const k = [], M = [];
|
|
4995
5012
|
let D = null, h = null, R = !1, p = !1, P = null;
|
|
4996
|
-
const
|
|
5013
|
+
const Rr = async (s) => typeof window > "u" || typeof document > "u" ? { sessionId: "" } : (p = !1, window.__traceLogDisabled === !0 ? { sessionId: "" } : h ? { sessionId: h.getSessionId() ?? "" } : (R && P || (R = !0, P = (async () => {
|
|
4997
5014
|
try {
|
|
4998
|
-
const e =
|
|
5015
|
+
const e = cr(s ?? {}), t = new Cr();
|
|
4999
5016
|
try {
|
|
5000
|
-
|
|
5017
|
+
k.forEach(({ event: o, callback: l }) => {
|
|
5001
5018
|
t.on(o, l);
|
|
5002
|
-
}),
|
|
5019
|
+
}), k.length = 0, M.forEach(({ hook: o, fn: l }) => {
|
|
5003
5020
|
o === "beforeSend" ? t.setTransformer("beforeSend", l) : t.setTransformer("beforeBatch", l);
|
|
5004
5021
|
}), M.length = 0, D && (t.setCustomHeaders(D), D = null);
|
|
5005
5022
|
const r = t.init(e), n = new Promise((o, l) => {
|
|
@@ -5021,7 +5038,7 @@ const Cr = async (s) => typeof window > "u" || typeof document > "u" ? { session
|
|
|
5021
5038
|
} finally {
|
|
5022
5039
|
R = !1, P = null;
|
|
5023
5040
|
}
|
|
5024
|
-
})()), P)),
|
|
5041
|
+
})()), P)), Nr = (s, e) => {
|
|
5025
5042
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5026
5043
|
if (!h)
|
|
5027
5044
|
throw new Error("[TraceLog] TraceLog not initialized. Please call init() first.");
|
|
@@ -5029,25 +5046,25 @@ const Cr = async (s) => typeof window > "u" || typeof document > "u" ? { session
|
|
|
5029
5046
|
throw new Error("[TraceLog] Cannot send events while TraceLog is being destroyed");
|
|
5030
5047
|
h.sendCustomEvent(s, e);
|
|
5031
5048
|
}
|
|
5032
|
-
},
|
|
5049
|
+
}, Or = (s, e) => {
|
|
5033
5050
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5034
5051
|
if (!h || R) {
|
|
5035
|
-
|
|
5052
|
+
k.push({ event: s, callback: e });
|
|
5036
5053
|
return;
|
|
5037
5054
|
}
|
|
5038
5055
|
h.on(s, e);
|
|
5039
5056
|
}
|
|
5040
|
-
},
|
|
5057
|
+
}, Pr = (s, e) => {
|
|
5041
5058
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5042
5059
|
if (!h) {
|
|
5043
|
-
const t =
|
|
5044
|
-
t !== -1 &&
|
|
5060
|
+
const t = k.findIndex((r) => r.event === s && r.callback === e);
|
|
5061
|
+
t !== -1 && k.splice(t, 1);
|
|
5045
5062
|
return;
|
|
5046
5063
|
}
|
|
5047
5064
|
h.off(s, e);
|
|
5048
5065
|
}
|
|
5049
5066
|
};
|
|
5050
|
-
function
|
|
5067
|
+
function Dr(s, e) {
|
|
5051
5068
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5052
5069
|
if (typeof e != "function")
|
|
5053
5070
|
throw new Error(`[TraceLog] Transformer must be a function, received: ${typeof e}`);
|
|
@@ -5061,7 +5078,7 @@ function Pr(s, e) {
|
|
|
5061
5078
|
s === "beforeSend" ? h.setTransformer("beforeSend", e) : h.setTransformer("beforeBatch", e);
|
|
5062
5079
|
}
|
|
5063
5080
|
}
|
|
5064
|
-
const
|
|
5081
|
+
const kr = (s) => {
|
|
5065
5082
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5066
5083
|
if (!h) {
|
|
5067
5084
|
const e = M.findIndex((t) => t.hook === s);
|
|
@@ -5084,7 +5101,7 @@ const Dr = (s) => {
|
|
|
5084
5101
|
throw new Error("[TraceLog] Cannot set custom headers while TraceLog is being destroyed");
|
|
5085
5102
|
h.setCustomHeaders(s);
|
|
5086
5103
|
}
|
|
5087
|
-
},
|
|
5104
|
+
}, Ur = () => {
|
|
5088
5105
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5089
5106
|
if (!h) {
|
|
5090
5107
|
D = null;
|
|
@@ -5094,7 +5111,7 @@ const Dr = (s) => {
|
|
|
5094
5111
|
throw new Error("[TraceLog] Cannot remove custom headers while TraceLog is being destroyed");
|
|
5095
5112
|
h.removeCustomHeaders();
|
|
5096
5113
|
}
|
|
5097
|
-
},
|
|
5114
|
+
}, Hr = () => typeof window > "u" || typeof document > "u" ? !1 : h !== null, xr = () => typeof window > "u" || typeof document > "u" || !h ? null : h.getSessionId(), Fr = () => {
|
|
5098
5115
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5099
5116
|
if (p)
|
|
5100
5117
|
throw new Error("[TraceLog] Destroy operation already in progress");
|
|
@@ -5104,14 +5121,14 @@ const Dr = (s) => {
|
|
|
5104
5121
|
}
|
|
5105
5122
|
p = !0;
|
|
5106
5123
|
try {
|
|
5107
|
-
h.destroy(), h = null, R = !1, P = null,
|
|
5124
|
+
h.destroy(), h = null, R = !1, P = null, k.length = 0, M.length = 0, D = null, p = !1;
|
|
5108
5125
|
} catch (s) {
|
|
5109
|
-
h = null, R = !1, P = null,
|
|
5126
|
+
h = null, R = !1, P = null, k.length = 0, M.length = 0, D = null, p = !1, a("warn", "Error during destroy, forced cleanup completed", { error: s });
|
|
5110
5127
|
}
|
|
5111
5128
|
}
|
|
5112
|
-
}, Fr = (s) => {
|
|
5113
|
-
typeof window > "u" || typeof document > "u" || Jt(s);
|
|
5114
5129
|
}, $r = (s) => {
|
|
5130
|
+
typeof window > "u" || typeof document > "u" || Zt(s);
|
|
5131
|
+
}, Br = (s) => {
|
|
5115
5132
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5116
5133
|
if (!h)
|
|
5117
5134
|
throw new Error("[TraceLog] TraceLog not initialized. Please call init() first.");
|
|
@@ -5119,7 +5136,7 @@ const Dr = (s) => {
|
|
|
5119
5136
|
throw new Error("[TraceLog] Cannot update metadata while TraceLog is being destroyed");
|
|
5120
5137
|
h.updateGlobalMetadata(s);
|
|
5121
5138
|
}
|
|
5122
|
-
},
|
|
5139
|
+
}, Wr = (s) => {
|
|
5123
5140
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5124
5141
|
if (!h)
|
|
5125
5142
|
throw new Error("[TraceLog] TraceLog not initialized. Please call init() first.");
|
|
@@ -5127,7 +5144,7 @@ const Dr = (s) => {
|
|
|
5127
5144
|
throw new Error("[TraceLog] Cannot update metadata while TraceLog is being destroyed");
|
|
5128
5145
|
h.mergeGlobalMetadata(s);
|
|
5129
5146
|
}
|
|
5130
|
-
},
|
|
5147
|
+
}, Gr = (s, e) => {
|
|
5131
5148
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5132
5149
|
if (!s || typeof s != "string" || s.trim().length === 0) {
|
|
5133
5150
|
a("warn", "identify() called with invalid userId");
|
|
@@ -5146,7 +5163,7 @@ const Dr = (s) => {
|
|
|
5146
5163
|
return;
|
|
5147
5164
|
}
|
|
5148
5165
|
try {
|
|
5149
|
-
const t =
|
|
5166
|
+
const t = ut(e), r = {
|
|
5150
5167
|
userId: s.trim(),
|
|
5151
5168
|
...t ? { traits: t } : {}
|
|
5152
5169
|
};
|
|
@@ -5155,7 +5172,7 @@ const Dr = (s) => {
|
|
|
5155
5172
|
a("debug", "Failed to persist pre-init identity");
|
|
5156
5173
|
}
|
|
5157
5174
|
}
|
|
5158
|
-
},
|
|
5175
|
+
}, Xr = async () => {
|
|
5159
5176
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5160
5177
|
if (!h) {
|
|
5161
5178
|
try {
|
|
@@ -5168,27 +5185,27 @@ const Dr = (s) => {
|
|
|
5168
5185
|
throw new Error("[TraceLog] Cannot reset identity while TraceLog is being destroyed");
|
|
5169
5186
|
await h.resetIdentity();
|
|
5170
5187
|
}
|
|
5171
|
-
},
|
|
5172
|
-
init:
|
|
5173
|
-
event:
|
|
5174
|
-
on:
|
|
5175
|
-
off:
|
|
5176
|
-
setTransformer:
|
|
5177
|
-
removeTransformer:
|
|
5188
|
+
}, Is = {
|
|
5189
|
+
init: Rr,
|
|
5190
|
+
event: Nr,
|
|
5191
|
+
on: Or,
|
|
5192
|
+
off: Pr,
|
|
5193
|
+
setTransformer: Dr,
|
|
5194
|
+
removeTransformer: kr,
|
|
5178
5195
|
setCustomHeaders: Vr,
|
|
5179
|
-
removeCustomHeaders:
|
|
5180
|
-
isInitialized:
|
|
5181
|
-
getSessionId:
|
|
5182
|
-
destroy:
|
|
5183
|
-
setQaMode:
|
|
5184
|
-
updateGlobalMetadata:
|
|
5185
|
-
mergeGlobalMetadata:
|
|
5186
|
-
identify:
|
|
5187
|
-
resetIdentity:
|
|
5196
|
+
removeCustomHeaders: Ur,
|
|
5197
|
+
isInitialized: Hr,
|
|
5198
|
+
getSessionId: xr,
|
|
5199
|
+
destroy: Fr,
|
|
5200
|
+
setQaMode: $r,
|
|
5201
|
+
updateGlobalMetadata: Br,
|
|
5202
|
+
mergeGlobalMetadata: Wr,
|
|
5203
|
+
identify: Gr,
|
|
5204
|
+
resetIdentity: Xr
|
|
5188
5205
|
};
|
|
5189
|
-
var we, C, j,
|
|
5206
|
+
var we, C, j, mt, ie, gt = -1, V = function(s) {
|
|
5190
5207
|
addEventListener("pageshow", (function(e) {
|
|
5191
|
-
e.persisted && (
|
|
5208
|
+
e.persisted && (gt = e.timeStamp, s(e));
|
|
5192
5209
|
}), !0);
|
|
5193
5210
|
}, Ne = function() {
|
|
5194
5211
|
var s = self.performance && performance.getEntriesByType && performance.getEntriesByType("navigation")[0];
|
|
@@ -5198,7 +5215,7 @@ var we, C, j, ft, ie, mt = -1, k = function(s) {
|
|
|
5198
5215
|
return s && s.activationStart || 0;
|
|
5199
5216
|
}, _ = function(s, e) {
|
|
5200
5217
|
var t = Ne(), r = "navigate";
|
|
5201
|
-
return
|
|
5218
|
+
return gt >= 0 ? r = "back-forward-cache" : t && (document.prerendering || ae() > 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 };
|
|
5202
5219
|
}, F = function(s, e, t) {
|
|
5203
5220
|
try {
|
|
5204
5221
|
if (PerformanceObserver.supportedEntryTypes.includes(s)) {
|
|
@@ -5224,7 +5241,7 @@ var we, C, j, ft, ie, mt = -1, k = function(s) {
|
|
|
5224
5241
|
return s();
|
|
5225
5242
|
}));
|
|
5226
5243
|
}));
|
|
5227
|
-
},
|
|
5244
|
+
}, Q = function(s) {
|
|
5228
5245
|
document.addEventListener("visibilitychange", (function() {
|
|
5229
5246
|
document.visibilityState === "hidden" && s();
|
|
5230
5247
|
}));
|
|
@@ -5233,18 +5250,18 @@ var we, C, j, ft, ie, mt = -1, k = function(s) {
|
|
|
5233
5250
|
return function() {
|
|
5234
5251
|
e || (s(), e = !0);
|
|
5235
5252
|
};
|
|
5236
|
-
}, x = -1,
|
|
5253
|
+
}, x = -1, Je = function() {
|
|
5237
5254
|
return document.visibilityState !== "hidden" || document.prerendering ? 1 / 0 : 0;
|
|
5238
5255
|
}, oe = function(s) {
|
|
5239
|
-
document.visibilityState === "hidden" && x > -1 && (x = s.type === "visibilitychange" ? s.timeStamp : 0,
|
|
5240
|
-
},
|
|
5256
|
+
document.visibilityState === "hidden" && x > -1 && (x = s.type === "visibilitychange" ? s.timeStamp : 0, jr());
|
|
5257
|
+
}, Ze = function() {
|
|
5241
5258
|
addEventListener("visibilitychange", oe, !0), addEventListener("prerenderingchange", oe, !0);
|
|
5242
|
-
},
|
|
5259
|
+
}, jr = function() {
|
|
5243
5260
|
removeEventListener("visibilitychange", oe, !0), removeEventListener("prerenderingchange", oe, !0);
|
|
5244
5261
|
}, Pe = function() {
|
|
5245
|
-
return x < 0 && (x =
|
|
5262
|
+
return x < 0 && (x = Je(), Ze(), V((function() {
|
|
5246
5263
|
setTimeout((function() {
|
|
5247
|
-
x =
|
|
5264
|
+
x = Je(), Ze();
|
|
5248
5265
|
}), 0);
|
|
5249
5266
|
}))), { get firstHiddenTime() {
|
|
5250
5267
|
return x;
|
|
@@ -5253,21 +5270,21 @@ var we, C, j, ft, ie, mt = -1, k = function(s) {
|
|
|
5253
5270
|
document.prerendering ? addEventListener("prerenderingchange", (function() {
|
|
5254
5271
|
return s();
|
|
5255
5272
|
}), !0) : s();
|
|
5256
|
-
}, be = [1800, 3e3],
|
|
5273
|
+
}, be = [1800, 3e3], Et = function(s, e) {
|
|
5257
5274
|
e = e || {}, K((function() {
|
|
5258
5275
|
var t, r = Pe(), n = _("FCP"), i = F("paint", (function(o) {
|
|
5259
5276
|
o.forEach((function(l) {
|
|
5260
5277
|
l.name === "first-contentful-paint" && (i.disconnect(), l.startTime < r.firstHiddenTime && (n.value = Math.max(l.startTime - ae(), 0), n.entries.push(l), t(!0)));
|
|
5261
5278
|
}));
|
|
5262
5279
|
}));
|
|
5263
|
-
i && (t = y(s, n, be, e.reportAllChanges),
|
|
5280
|
+
i && (t = y(s, n, be, e.reportAllChanges), V((function(o) {
|
|
5264
5281
|
n = _("FCP"), t = y(s, n, be, e.reportAllChanges), Oe((function() {
|
|
5265
5282
|
n.value = performance.now() - o.timeStamp, t(!0);
|
|
5266
5283
|
}));
|
|
5267
5284
|
})));
|
|
5268
5285
|
}));
|
|
5269
|
-
}, Ae = [0.1, 0.25],
|
|
5270
|
-
e = e || {},
|
|
5286
|
+
}, Ae = [0.1, 0.25], zr = function(s, e) {
|
|
5287
|
+
e = e || {}, Et(le((function() {
|
|
5271
5288
|
var t, r = _("CLS", 0), n = 0, i = [], o = function(c) {
|
|
5272
5289
|
c.forEach((function(u) {
|
|
5273
5290
|
if (!u.hadRecentInput) {
|
|
@@ -5276,27 +5293,27 @@ var we, C, j, ft, ie, mt = -1, k = function(s) {
|
|
|
5276
5293
|
}
|
|
5277
5294
|
})), n > r.value && (r.value = n, r.entries = i, t());
|
|
5278
5295
|
}, l = F("layout-shift", o);
|
|
5279
|
-
l && (t = y(s, r, Ae, e.reportAllChanges),
|
|
5296
|
+
l && (t = y(s, r, Ae, e.reportAllChanges), Q((function() {
|
|
5280
5297
|
o(l.takeRecords()), t(!0);
|
|
5281
|
-
})),
|
|
5298
|
+
})), V((function() {
|
|
5282
5299
|
n = 0, r = _("CLS", 0), t = y(s, r, Ae, e.reportAllChanges), Oe((function() {
|
|
5283
5300
|
return t();
|
|
5284
5301
|
}));
|
|
5285
5302
|
})), setTimeout(t, 0));
|
|
5286
5303
|
})));
|
|
5287
|
-
},
|
|
5304
|
+
}, St = 0, me = 1 / 0, Z = 0, Qr = function(s) {
|
|
5288
5305
|
s.forEach((function(e) {
|
|
5289
|
-
e.interactionId && (me = Math.min(me, e.interactionId), Z = Math.max(Z, e.interactionId),
|
|
5306
|
+
e.interactionId && (me = Math.min(me, e.interactionId), Z = Math.max(Z, e.interactionId), St = Z ? (Z - me) / 7 + 1 : 0);
|
|
5290
5307
|
}));
|
|
5291
|
-
},
|
|
5292
|
-
return we ?
|
|
5293
|
-
},
|
|
5308
|
+
}, pt = function() {
|
|
5309
|
+
return we ? St : performance.interactionCount || 0;
|
|
5310
|
+
}, Kr = function() {
|
|
5294
5311
|
"interactionCount" in performance || we || (we = F("event", Qr, { type: "event", buffered: !0, durationThreshold: 0 }));
|
|
5295
|
-
}, A = [], re = /* @__PURE__ */ new Map(),
|
|
5296
|
-
var s = Math.min(A.length - 1, Math.floor((
|
|
5312
|
+
}, A = [], re = /* @__PURE__ */ new Map(), Tt = 0, Yr = function() {
|
|
5313
|
+
var s = Math.min(A.length - 1, Math.floor((pt() - Tt) / 50));
|
|
5297
5314
|
return A[s];
|
|
5298
|
-
},
|
|
5299
|
-
if (
|
|
5315
|
+
}, qr = [], Jr = function(s) {
|
|
5316
|
+
if (qr.forEach((function(n) {
|
|
5300
5317
|
return n(s);
|
|
5301
5318
|
})), s.interactionId || s.entryType === "first-input") {
|
|
5302
5319
|
var e = A[A.length - 1], t = re.get(s.interactionId);
|
|
@@ -5313,27 +5330,27 @@ var we, C, j, ft, ie, mt = -1, k = function(s) {
|
|
|
5313
5330
|
}));
|
|
5314
5331
|
}
|
|
5315
5332
|
}
|
|
5316
|
-
},
|
|
5333
|
+
}, It = function(s) {
|
|
5317
5334
|
var e = self.requestIdleCallback || self.setTimeout, t = -1;
|
|
5318
|
-
return s = le(s), document.visibilityState === "hidden" ? s() : (t = e(s),
|
|
5319
|
-
}, Le = [200, 500],
|
|
5335
|
+
return s = le(s), document.visibilityState === "hidden" ? s() : (t = e(s), Q(s)), t;
|
|
5336
|
+
}, Le = [200, 500], Zr = function(s, e) {
|
|
5320
5337
|
"PerformanceEventTiming" in self && "interactionId" in PerformanceEventTiming.prototype && (e = e || {}, K((function() {
|
|
5321
5338
|
var t;
|
|
5322
|
-
|
|
5339
|
+
Kr();
|
|
5323
5340
|
var r, n = _("INP"), i = function(l) {
|
|
5324
|
-
|
|
5325
|
-
l.forEach(
|
|
5326
|
-
var c =
|
|
5341
|
+
It((function() {
|
|
5342
|
+
l.forEach(Jr);
|
|
5343
|
+
var c = Yr();
|
|
5327
5344
|
c && c.latency !== n.value && (n.value = c.latency, n.entries = c.entries, r());
|
|
5328
5345
|
}));
|
|
5329
5346
|
}, o = F("event", i, { durationThreshold: (t = e.durationThreshold) !== null && t !== void 0 ? t : 40 });
|
|
5330
|
-
r = y(s, n, Le, e.reportAllChanges), o && (o.observe({ type: "first-input", buffered: !0 }),
|
|
5347
|
+
r = y(s, n, Le, e.reportAllChanges), o && (o.observe({ type: "first-input", buffered: !0 }), Q((function() {
|
|
5331
5348
|
i(o.takeRecords()), r(!0);
|
|
5332
|
-
})),
|
|
5333
|
-
|
|
5349
|
+
})), V((function() {
|
|
5350
|
+
Tt = pt(), A.length = 0, re.clear(), n = _("INP"), r = y(s, n, Le, e.reportAllChanges);
|
|
5334
5351
|
})));
|
|
5335
5352
|
})));
|
|
5336
|
-
}, Me = [2500, 4e3], ge = {},
|
|
5353
|
+
}, Me = [2500, 4e3], ge = {}, es = function(s, e) {
|
|
5337
5354
|
e = e || {}, K((function() {
|
|
5338
5355
|
var t, r = Pe(), n = _("LCP"), i = function(c) {
|
|
5339
5356
|
e.reportAllChanges || (c = c.slice(-1)), c.forEach((function(u) {
|
|
@@ -5347,73 +5364,73 @@ var we, C, j, ft, ie, mt = -1, k = function(s) {
|
|
|
5347
5364
|
}));
|
|
5348
5365
|
["keydown", "click"].forEach((function(c) {
|
|
5349
5366
|
addEventListener(c, (function() {
|
|
5350
|
-
return
|
|
5367
|
+
return It(l);
|
|
5351
5368
|
}), { once: !0, capture: !0 });
|
|
5352
|
-
})),
|
|
5369
|
+
})), Q(l), V((function(c) {
|
|
5353
5370
|
n = _("LCP"), t = y(s, n, Me, e.reportAllChanges), Oe((function() {
|
|
5354
5371
|
n.value = performance.now() - c.timeStamp, ge[n.id] = !0, t(!0);
|
|
5355
5372
|
}));
|
|
5356
5373
|
}));
|
|
5357
5374
|
}
|
|
5358
5375
|
}));
|
|
5359
|
-
}, Ce = [800, 1800],
|
|
5376
|
+
}, Ce = [800, 1800], ts = function s(e) {
|
|
5360
5377
|
document.prerendering ? K((function() {
|
|
5361
5378
|
return s(e);
|
|
5362
5379
|
})) : document.readyState !== "complete" ? addEventListener("load", (function() {
|
|
5363
5380
|
return s(e);
|
|
5364
5381
|
}), !0) : setTimeout(e, 0);
|
|
5365
|
-
},
|
|
5382
|
+
}, rs = function(s, e) {
|
|
5366
5383
|
e = e || {};
|
|
5367
5384
|
var t = _("TTFB"), r = y(s, t, Ce, e.reportAllChanges);
|
|
5368
|
-
|
|
5385
|
+
ts((function() {
|
|
5369
5386
|
var n = Ne();
|
|
5370
|
-
n && (t.value = Math.max(n.responseStart - ae(), 0), t.entries = [n], r(!0),
|
|
5387
|
+
n && (t.value = Math.max(n.responseStart - ae(), 0), t.entries = [n], r(!0), V((function() {
|
|
5371
5388
|
t = _("TTFB", 0), (r = y(s, t, Ce, e.reportAllChanges))(!0);
|
|
5372
5389
|
})));
|
|
5373
5390
|
}));
|
|
5374
|
-
}, G = { passive: !0, capture: !0 },
|
|
5375
|
-
C || (C = e, j = s,
|
|
5376
|
-
},
|
|
5377
|
-
if (j >= 0 && j <
|
|
5391
|
+
}, G = { passive: !0, capture: !0 }, ss = /* @__PURE__ */ new Date(), et = function(s, e) {
|
|
5392
|
+
C || (C = e, j = s, mt = /* @__PURE__ */ new Date(), _t(removeEventListener), vt());
|
|
5393
|
+
}, vt = function() {
|
|
5394
|
+
if (j >= 0 && j < mt - ss) {
|
|
5378
5395
|
var s = { entryType: "first-input", name: C.type, target: C.target, cancelable: C.cancelable, startTime: C.timeStamp, processingStart: C.timeStamp + j };
|
|
5379
5396
|
ie.forEach((function(e) {
|
|
5380
5397
|
e(s);
|
|
5381
5398
|
})), ie = [];
|
|
5382
5399
|
}
|
|
5383
|
-
},
|
|
5400
|
+
}, ns = function(s) {
|
|
5384
5401
|
if (s.cancelable) {
|
|
5385
5402
|
var e = (s.timeStamp > 1e12 ? /* @__PURE__ */ new Date() : performance.now()) - s.timeStamp;
|
|
5386
5403
|
s.type == "pointerdown" ? (function(t, r) {
|
|
5387
5404
|
var n = function() {
|
|
5388
|
-
|
|
5405
|
+
et(t, r), o();
|
|
5389
5406
|
}, i = function() {
|
|
5390
5407
|
o();
|
|
5391
5408
|
}, o = function() {
|
|
5392
5409
|
removeEventListener("pointerup", n, G), removeEventListener("pointercancel", i, G);
|
|
5393
5410
|
};
|
|
5394
5411
|
addEventListener("pointerup", n, G), addEventListener("pointercancel", i, G);
|
|
5395
|
-
})(e, s) :
|
|
5412
|
+
})(e, s) : et(e, s);
|
|
5396
5413
|
}
|
|
5397
|
-
},
|
|
5414
|
+
}, _t = function(s) {
|
|
5398
5415
|
["mousedown", "keydown", "touchstart", "pointerdown"].forEach((function(e) {
|
|
5399
|
-
return s(e,
|
|
5416
|
+
return s(e, ns, G);
|
|
5400
5417
|
}));
|
|
5401
|
-
}, Re = [100, 300],
|
|
5418
|
+
}, Re = [100, 300], is = function(s, e) {
|
|
5402
5419
|
e = e || {}, K((function() {
|
|
5403
5420
|
var t, r = Pe(), n = _("FID"), i = function(c) {
|
|
5404
5421
|
c.startTime < r.firstHiddenTime && (n.value = c.processingStart - c.startTime, n.entries.push(c), t(!0));
|
|
5405
5422
|
}, o = function(c) {
|
|
5406
5423
|
c.forEach(i);
|
|
5407
5424
|
}, l = F("first-input", o);
|
|
5408
|
-
t = y(s, n, Re, e.reportAllChanges), l && (
|
|
5425
|
+
t = y(s, n, Re, e.reportAllChanges), l && (Q(le((function() {
|
|
5409
5426
|
o(l.takeRecords()), l.disconnect();
|
|
5410
|
-
}))),
|
|
5427
|
+
}))), V((function() {
|
|
5411
5428
|
var c;
|
|
5412
|
-
n = _("FID"), t = y(s, n, Re, e.reportAllChanges), ie = [], j = -1, C = null,
|
|
5429
|
+
n = _("FID"), t = y(s, n, Re, e.reportAllChanges), ie = [], j = -1, C = null, _t(addEventListener), c = i, ie.push(c), vt();
|
|
5413
5430
|
})));
|
|
5414
5431
|
}));
|
|
5415
5432
|
};
|
|
5416
|
-
const
|
|
5433
|
+
const os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5417
5434
|
__proto__: null,
|
|
5418
5435
|
CLSThresholds: Ae,
|
|
5419
5436
|
FCPThresholds: be,
|
|
@@ -5421,45 +5438,45 @@ const is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5421
5438
|
INPThresholds: Le,
|
|
5422
5439
|
LCPThresholds: Me,
|
|
5423
5440
|
TTFBThresholds: Ce,
|
|
5424
|
-
onCLS:
|
|
5425
|
-
onFCP:
|
|
5426
|
-
onFID:
|
|
5427
|
-
onINP:
|
|
5428
|
-
onLCP:
|
|
5429
|
-
onTTFB:
|
|
5441
|
+
onCLS: zr,
|
|
5442
|
+
onFCP: Et,
|
|
5443
|
+
onFID: is,
|
|
5444
|
+
onINP: Zr,
|
|
5445
|
+
onLCP: es,
|
|
5446
|
+
onTTFB: rs
|
|
5430
5447
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
5431
5448
|
export {
|
|
5432
5449
|
f as AppConfigValidationError,
|
|
5433
|
-
|
|
5450
|
+
as as DEFAULT_SESSION_TIMEOUT,
|
|
5434
5451
|
Ie as DEFAULT_WEB_VITALS_MODE,
|
|
5435
5452
|
L as DeviceType,
|
|
5436
5453
|
Se as EmitterEvent,
|
|
5437
5454
|
W as ErrorType,
|
|
5438
5455
|
d as EventType,
|
|
5439
|
-
|
|
5456
|
+
ps as InitializationTimeoutError,
|
|
5440
5457
|
U as IntegrationValidationError,
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5458
|
+
gs as MAX_ARRAY_LENGTH,
|
|
5459
|
+
ds as MAX_CUSTOM_EVENT_ARRAY_SIZE,
|
|
5460
|
+
us as MAX_CUSTOM_EVENT_KEYS,
|
|
5461
|
+
ls as MAX_CUSTOM_EVENT_NAME_LENGTH,
|
|
5462
|
+
cs as MAX_CUSTOM_EVENT_STRING_SIZE,
|
|
5463
|
+
hs as MAX_NESTED_OBJECT_KEYS,
|
|
5464
|
+
fs as MAX_STRING_LENGTH,
|
|
5465
|
+
ms as MAX_STRING_LENGTH_IN_ARRAY,
|
|
5449
5466
|
se as Mode,
|
|
5450
|
-
|
|
5467
|
+
it as PII_PATTERNS,
|
|
5451
5468
|
N as PermanentError,
|
|
5452
5469
|
$e as SamplingRateValidationError,
|
|
5453
5470
|
ee as ScrollDirection,
|
|
5454
|
-
|
|
5471
|
+
Rt as SessionTimeoutValidationError,
|
|
5455
5472
|
B as SpecialApiUrl,
|
|
5456
5473
|
O as TimeoutError,
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5474
|
+
z as TraceLogValidationError,
|
|
5475
|
+
Ts as WEB_VITALS_GOOD_THRESHOLDS,
|
|
5476
|
+
je as WEB_VITALS_NEEDS_IMPROVEMENT_THRESHOLDS,
|
|
5477
|
+
jt as WEB_VITALS_POOR_THRESHOLDS,
|
|
5478
|
+
ze as getWebVitalsThresholds,
|
|
5479
|
+
Es as isPrimaryScrollEvent,
|
|
5480
|
+
Ss as isSecondaryScrollEvent,
|
|
5481
|
+
Is as tracelog
|
|
5465
5482
|
};
|