@nivaro/react 0.3.99 → 0.3.100
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/full.css +1 -1
- package/dist/hooks/useFormSchema.js +82 -85
- package/dist/hooks/useSessionRecorder.js +206 -175
- package/dist/index.d.ts +38 -13
- package/dist/index.js +182 -180
- package/dist/lib/commands.js +15 -11
- package/dist/shared/components/CollectionBrowserView.js +516 -503
- package/dist/shared/components/ItemEditForm.js +3021 -3019
- package/dist/shared/components/JobsTray.js +20 -16
- package/dist/shared/components/MyWorkView.js +133 -126
- package/dist/shared/components/NotificationBell.js +314 -288
- package/dist/shared/components/RecordCompare.js +38 -40
- package/dist/shared/components/RecordReadView.js +119 -119
- package/dist/shared/components/cbv/FoundElsewhere.js +61 -0
- package/dist/shared/components/item-edit/InlineGridField.js +45 -45
- package/dist/shared/components/item-edit/InlineTableField.js +750 -749
- package/dist/shared/components/item-edit/QuickPickerDialog.js +44 -44
- package/dist/shared/components/item-edit/RawEditSheet.js +122 -114
- package/dist/shared/components/item-edit/RelationCombobox.js +454 -378
- package/dist/shared/components/item-edit/SummaryPanel.js +56 -48
- package/dist/shared/components/item-edit/related-missing.js +75 -19
- package/dist/shared/components/notifications/NotificationCenterView.js +249 -226
- package/dist/shared/components/panels/AccessDeniedPanel.js +31 -28
- package/dist/shared/components/panels/BackgroundMove.js +175 -0
- package/dist/shared/components/panels/MoveAdvisory.js +204 -0
- package/dist/shared/components/panels/PipelinePanel.js +1450 -1219
- package/dist/shared/components/panels/RecordIntegrityBanner.js +113 -112
- package/dist/shared/lib/commands.js +18 -14
- package/dist/shared/lib/error-hints.js +1 -1
- package/dist/shared/lib/job-failure-text.js +12 -0
- package/dist/shared/lib/move-failure.js +9 -0
- package/dist/shared/lib/obligation-banner.js +15 -14
- package/dist/shared/lib/partner-failure.js +71 -0
- package/dist/shared/lib/prefetch.js +73 -73
- package/dist/shared/lib/replay-checkout.js +18 -13
- package/dist/shared/lib/replay-context.js +90 -77
- package/dist/shared/lib/replay-idle.js +21 -0
- package/dist/shared/lib/replay-socket.js +21 -17
- package/dist/shared/lib/rum.js +56 -51
- package/dist/shared/lib/safe-error.js +17 -13
- package/dist/shared/lib/stale-chunk.js +69 -26
- package/dist/shared/lib/system-collections.js +20 -0
- package/package.json +1 -1
|
@@ -1,144 +1,157 @@
|
|
|
1
|
-
import { pagePattern as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
return String(
|
|
1
|
+
import { pagePattern as _ } from "./page-context.js";
|
|
2
|
+
const L = ["warn", "error"], T = 200, O = 500, U = 1e3, u = "[redacted]", N = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
3
|
+
function v(e) {
|
|
4
|
+
return String(e).replace(
|
|
5
5
|
/([\w.-]*(?:token|secret|password|passwd|api[_-]?key|authorization|cookie)[\w.-]*)(["']?\s*[:=]\s*["']?)((?:(?:bearer|basic)\s+)?[^\s"'&,;}\])]+)/gi,
|
|
6
|
-
(
|
|
6
|
+
(t, o, n, c) => c === u ? t : `${o}${n}${u}`
|
|
7
7
|
).replace(/\b(bearer)\s+(?!\[redacted\])[\w.~+/=-]+/gi, `$1 ${u}`).replace(
|
|
8
8
|
/\bBasic\s+([A-Za-z0-9+/]{8,}={0,2})/g,
|
|
9
|
-
(
|
|
10
|
-
).replace(/\beyJ[\w-]{6,}(?:\.[\w-]*){1,2}/g, u).replace(/[A-Za-z0-9+/_=-]{32,}/g, (
|
|
9
|
+
(t, o) => /[0-9+/=]/.test(o) || /[A-Z]/.test(o.slice(1)) ? `Basic ${u}` : t
|
|
10
|
+
).replace(/\beyJ[\w-]{6,}(?:\.[\w-]*){1,2}/g, u).replace(/[A-Za-z0-9+/_=-]{32,}/g, (t) => N.test(t) ? t : /^[0-9a-f]{32,}$/i.test(t) ? u : t.includes("/") && /[a-z]{3,}\//i.test(t) ? t : /\d/.test(t) && /[a-z]/i.test(t) ? u : t);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
if (typeof
|
|
14
|
-
if (
|
|
12
|
+
function C(e) {
|
|
13
|
+
if (typeof e == "string") return e;
|
|
14
|
+
if (e instanceof Error) return `${e.name}: ${e.message}`;
|
|
15
15
|
try {
|
|
16
|
-
return JSON.stringify(
|
|
16
|
+
return JSON.stringify(e) ?? String(e);
|
|
17
17
|
} catch {
|
|
18
|
-
return String(
|
|
18
|
+
return String(e);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
return
|
|
21
|
+
function M(e, t = T) {
|
|
22
|
+
const o = e.map(C).join(" ").slice(0, t * 8);
|
|
23
|
+
return v(o).slice(0, t);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function H(e, t = O) {
|
|
26
26
|
if (typeof console > "u") return () => {
|
|
27
27
|
};
|
|
28
|
-
let
|
|
29
|
-
const
|
|
30
|
-
for (const s of
|
|
28
|
+
let o = 0, n = !1;
|
|
29
|
+
const c = {}, f = {};
|
|
30
|
+
for (const s of L) {
|
|
31
31
|
const l = console[s];
|
|
32
|
-
|
|
32
|
+
c[s] = l;
|
|
33
33
|
const d = (...r) => {
|
|
34
|
-
if (l.apply(console, r), !(
|
|
35
|
-
|
|
34
|
+
if (l.apply(console, r), !(n || o >= t)) {
|
|
35
|
+
n = !0;
|
|
36
36
|
try {
|
|
37
|
-
|
|
37
|
+
o++, e("console", { level: s, msg: M(r) });
|
|
38
38
|
} catch {
|
|
39
39
|
} finally {
|
|
40
|
-
|
|
40
|
+
n = !1;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
f[s] = d, console[s] = d;
|
|
45
45
|
}
|
|
46
46
|
return () => {
|
|
47
|
-
for (const s of
|
|
48
|
-
console[s] === f[s] && (console[s] =
|
|
47
|
+
for (const s of L)
|
|
48
|
+
console[s] === f[s] && (console[s] = c[s]);
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function k(e, t) {
|
|
52
52
|
try {
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
const
|
|
56
|
-
return
|
|
53
|
+
const o = t ?? (typeof window < "u" && window.location ? window.location.href : "http://localhost/"), n = new URL(e, o);
|
|
54
|
+
if (n.protocol !== "http:" && n.protocol !== "https:") return null;
|
|
55
|
+
const c = _(n.pathname);
|
|
56
|
+
return n.origin === new URL(o).origin ? c : `${n.host}${c}`;
|
|
57
57
|
} catch {
|
|
58
58
|
return null;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
const z = [
|
|
62
|
+
/\/api\/presence\/(ping|online|disconnect)\/?$/,
|
|
63
|
+
/\/api\/job-runs\/busy\/?$/,
|
|
64
|
+
/\/api\/announcements\/active\/?$/,
|
|
65
|
+
/\/api\/realtime\/build-status\/?$/,
|
|
66
|
+
/\/api\/notifications\/unread-count\/?$/,
|
|
67
|
+
/\/api\/auth\/ws-token\/?$/,
|
|
68
|
+
/\/api\/analytics\/pageview(\/[^/]*)?\/?$/,
|
|
69
|
+
/\/api\/layout-usage\/beacon\/?$/,
|
|
70
|
+
/\/api\/(health|ready|version)\/?$/,
|
|
71
|
+
/\/version\.json$/,
|
|
72
|
+
/\/api\/items\/[^/]*_presence(\/[^/]*)?\/?$/
|
|
73
|
+
];
|
|
74
|
+
function q(e, t) {
|
|
62
75
|
try {
|
|
63
|
-
const
|
|
64
|
-
return /\/session-recordings(\/|$)/.test(
|
|
76
|
+
const o = t ?? (typeof window < "u" && window.location ? window.location.href : "http://localhost/"), n = new URL(e, o).pathname;
|
|
77
|
+
return /\/session-recordings(\/|$)/.test(n) || /\/rum\/?$/.test(n) ? !0 : z.some((c) => c.test(n));
|
|
65
78
|
} catch {
|
|
66
79
|
return !1;
|
|
67
80
|
}
|
|
68
81
|
}
|
|
69
|
-
const
|
|
70
|
-
function
|
|
71
|
-
if (typeof
|
|
72
|
-
if (typeof URL < "u" &&
|
|
73
|
-
const
|
|
74
|
-
return typeof
|
|
82
|
+
const S = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now();
|
|
83
|
+
function A(e) {
|
|
84
|
+
if (typeof e == "string") return e;
|
|
85
|
+
if (typeof URL < "u" && e instanceof URL) return e.href;
|
|
86
|
+
const t = e == null ? void 0 : e.url;
|
|
87
|
+
return typeof t == "string" ? t : String(e ?? "");
|
|
75
88
|
}
|
|
76
|
-
function
|
|
77
|
-
let
|
|
78
|
-
const
|
|
79
|
-
if (!(
|
|
89
|
+
function j(e, t = U) {
|
|
90
|
+
let o = 0, n = !1;
|
|
91
|
+
const c = (a, i, h, m) => {
|
|
92
|
+
if (!(n || o >= t))
|
|
80
93
|
try {
|
|
81
|
-
if (q(
|
|
82
|
-
const p =
|
|
94
|
+
if (q(i)) return;
|
|
95
|
+
const p = k(i);
|
|
83
96
|
if (!p) return;
|
|
84
|
-
|
|
85
|
-
const
|
|
97
|
+
o++;
|
|
98
|
+
const E = {
|
|
86
99
|
method: String(a || "GET").toUpperCase().slice(0, 10),
|
|
87
100
|
route: p,
|
|
88
101
|
status: Number(h) || 0,
|
|
89
|
-
duration_ms: Math.max(0, Math.round(
|
|
102
|
+
duration_ms: Math.max(0, Math.round(S() - m))
|
|
90
103
|
};
|
|
91
|
-
|
|
104
|
+
e("request", E);
|
|
92
105
|
} catch {
|
|
93
106
|
}
|
|
94
107
|
}, f = globalThis, s = typeof f.fetch == "function" ? f.fetch : null;
|
|
95
108
|
let l = null;
|
|
96
|
-
s && (l = function(a,
|
|
97
|
-
const h =
|
|
109
|
+
s && (l = function(a, i) {
|
|
110
|
+
const h = S(), m = s.call(this ?? globalThis, a, i);
|
|
98
111
|
try {
|
|
99
|
-
const p = (
|
|
100
|
-
|
|
101
|
-
(
|
|
102
|
-
() =>
|
|
112
|
+
const p = (i == null ? void 0 : i.method) ?? (a == null ? void 0 : a.method) ?? "GET", E = A(a);
|
|
113
|
+
m.then(
|
|
114
|
+
(R) => c(p, E, R.status, h),
|
|
115
|
+
() => c(p, E, 0, h)
|
|
103
116
|
);
|
|
104
117
|
} catch {
|
|
105
118
|
}
|
|
106
|
-
return
|
|
119
|
+
return m;
|
|
107
120
|
}, f.fetch = l);
|
|
108
|
-
const d = f.XMLHttpRequest, r = d == null ? void 0 : d.prototype, g = r == null ? void 0 : r.open, w = r == null ? void 0 : r.send,
|
|
109
|
-
let y = null,
|
|
110
|
-
return r && g && w && (y = function(a,
|
|
121
|
+
const d = f.XMLHttpRequest, r = d == null ? void 0 : d.prototype, g = r == null ? void 0 : r.open, w = r == null ? void 0 : r.send, b = /* @__PURE__ */ new WeakMap();
|
|
122
|
+
let y = null, $ = null;
|
|
123
|
+
return r && g && w && (y = function(a, i) {
|
|
111
124
|
try {
|
|
112
|
-
|
|
125
|
+
b.set(this, { method: a, url: A(i) });
|
|
113
126
|
} catch {
|
|
114
127
|
}
|
|
115
128
|
return g.apply(this, arguments);
|
|
116
|
-
},
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
119
|
-
const h =
|
|
129
|
+
}, $ = function(a) {
|
|
130
|
+
const i = b.get(this);
|
|
131
|
+
if (i) {
|
|
132
|
+
const h = S();
|
|
120
133
|
try {
|
|
121
|
-
this.addEventListener("loadend", () => i
|
|
134
|
+
this.addEventListener("loadend", () => c(i.method, i.url, this.status, h), {
|
|
122
135
|
once: !0
|
|
123
136
|
});
|
|
124
137
|
} catch {
|
|
125
138
|
}
|
|
126
139
|
}
|
|
127
140
|
return w.call(this, a);
|
|
128
|
-
}, r.open = y, r.send =
|
|
129
|
-
|
|
141
|
+
}, r.open = y, r.send = $), () => {
|
|
142
|
+
n = !0, l && f.fetch === l && s && (f.fetch = s), r && (y && r.open === y && g && (r.open = g), $ && r.send === $ && w && (r.send = w));
|
|
130
143
|
};
|
|
131
144
|
}
|
|
132
145
|
export {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
146
|
+
L as CONSOLE_LEVELS,
|
|
147
|
+
T as CONSOLE_MAX_CHARS,
|
|
148
|
+
O as CONSOLE_MAX_EVENTS,
|
|
136
149
|
u as REDACTED,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
150
|
+
U as REQUEST_MAX_EVENTS,
|
|
151
|
+
M as consoleLine,
|
|
152
|
+
H as instrumentConsole,
|
|
153
|
+
j as instrumentRequests,
|
|
141
154
|
q as isRecorderNoise,
|
|
142
|
-
|
|
143
|
-
|
|
155
|
+
v as redactSecrets,
|
|
156
|
+
k as requestRoute
|
|
144
157
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { isReplayInputEvent as p } from "./replay-checkout.js";
|
|
2
|
+
const u = 5 * 6e4, l = 30 * 6e4, A = 15e3, a = 2, c = 4;
|
|
3
|
+
function I(i = Date.now()) {
|
|
4
|
+
return { lastInputAt: i, pausedAt: 0, awaitingSince: 0, idleMs: 0 };
|
|
5
|
+
}
|
|
6
|
+
function f(i, e, n = Date.now()) {
|
|
7
|
+
const t = p(e);
|
|
8
|
+
if (i.awaitingSince) {
|
|
9
|
+
t && (i.lastInputAt = n);
|
|
10
|
+
const r = e == null ? void 0 : e.type;
|
|
11
|
+
return r === a ? (i.awaitingSince = 0, "keep") : r === c ? "keep" : n - i.awaitingSince < A ? "drop" : (i.awaitingSince = 0, "keep");
|
|
12
|
+
}
|
|
13
|
+
return i.pausedAt ? t ? (i.idleMs = n - i.lastInputAt, i.pausedAt = 0, i.lastInputAt = n, i.awaitingSince = n, "resume") : "drop" : t ? (i.lastInputAt = n, "keep") : n - i.lastInputAt >= u ? (i.pausedAt = n, "drop") : "keep";
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
u as REPLAY_IDLE_PAUSE_MS,
|
|
17
|
+
l as REPLAY_IDLE_RESTART_MS,
|
|
18
|
+
A as REPLAY_IDLE_RESUME_WAIT_MS,
|
|
19
|
+
I as createReplayIdleState,
|
|
20
|
+
f as noteReplayIdle
|
|
21
|
+
};
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { redactSecrets as
|
|
2
|
-
const
|
|
1
|
+
import { redactSecrets as g } from "./replay-context.js";
|
|
2
|
+
const S = 800, h = 10, m = 20, A = /* @__PURE__ */ new Set([
|
|
3
3
|
"nvr:ping",
|
|
4
4
|
"nvr:pong",
|
|
5
5
|
"time:sync",
|
|
6
6
|
"chat:typing",
|
|
7
7
|
"presence:update",
|
|
8
|
+
// Sent to every tab whenever anyone comes or goes: 77% of logged frames (production 2026-11-12).
|
|
9
|
+
"presence:changed",
|
|
10
|
+
// One frame per log line of a running job; job:update still says what changed.
|
|
11
|
+
"job:log",
|
|
8
12
|
"catchup:cursor"
|
|
9
|
-
]), f = /* @__PURE__ */ new Set(), p = (n, e) =>
|
|
13
|
+
]), f = /* @__PURE__ */ new Set(), p = (n, e) => g(String(n)).replace(/\s+/g, " ").slice(0, e);
|
|
10
14
|
function _(n) {
|
|
11
15
|
const e = Array.isArray(n) ? n : n == null ? [] : [n], t = [];
|
|
12
16
|
for (const r of e)
|
|
@@ -39,7 +43,7 @@ function C(n, e) {
|
|
|
39
43
|
} catch {
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
|
-
function
|
|
46
|
+
function u(n, e) {
|
|
43
47
|
if (f.size !== 0)
|
|
44
48
|
try {
|
|
45
49
|
const t = { kind: "connection", name: n };
|
|
@@ -48,23 +52,23 @@ function d(n, e) {
|
|
|
48
52
|
} catch {
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
|
-
function
|
|
55
|
+
function I(n) {
|
|
52
56
|
var i;
|
|
53
57
|
let e = 0;
|
|
54
58
|
const t = (o, ...l) => {
|
|
55
|
-
var a,
|
|
56
|
-
if (o === "catchup:full")
|
|
59
|
+
var a, d;
|
|
60
|
+
if (o === "catchup:full") u("full-resync");
|
|
57
61
|
else if (o === "catchup:events") {
|
|
58
|
-
const y = ((
|
|
59
|
-
|
|
62
|
+
const y = ((d = (a = l[0]) == null ? void 0 : a.events) == null ? void 0 : d.length) ?? 0;
|
|
63
|
+
u("catch-up", `${y} missed event${y === 1 ? "" : "s"} replayed`);
|
|
60
64
|
} else C(o, l[0]);
|
|
61
|
-
}, r = () =>
|
|
65
|
+
}, r = () => u(e++ > 0 ? "reconnected" : "connected"), c = (o) => u("disconnected", o), s = (o) => u("error", o == null ? void 0 : o.message);
|
|
62
66
|
return (i = n.onAny) == null || i.call(n, t), n.on("connect", r), n.on("disconnect", c), n.on("connect_error", s), () => {
|
|
63
|
-
var o, l, a,
|
|
64
|
-
(o = n.offAny) == null || o.call(n, t), (l = n.off) == null || l.call(n, "connect", r), (a = n.off) == null || a.call(n, "disconnect", c), (
|
|
67
|
+
var o, l, a, d;
|
|
68
|
+
(o = n.offAny) == null || o.call(n, t), (l = n.off) == null || l.call(n, "connect", r), (a = n.off) == null || a.call(n, "disconnect", c), (d = n.off) == null || d.call(n, "connect_error", s);
|
|
65
69
|
};
|
|
66
70
|
}
|
|
67
|
-
function
|
|
71
|
+
function O(n, e = S) {
|
|
68
72
|
let t = 0, r = !1;
|
|
69
73
|
const c = (s) => {
|
|
70
74
|
if (!(r || t > e))
|
|
@@ -82,12 +86,12 @@ function T(n, e = g) {
|
|
|
82
86
|
};
|
|
83
87
|
}
|
|
84
88
|
export {
|
|
85
|
-
|
|
89
|
+
S as SOCKET_MAX_EVENTS,
|
|
86
90
|
m as SOCKET_MAX_FIELDS,
|
|
87
91
|
h as SOCKET_MAX_IDS,
|
|
88
92
|
E as describeSocketPayload,
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
O as instrumentSocket,
|
|
94
|
+
u as reportSocketConnection,
|
|
91
95
|
C as reportSocketEvent,
|
|
92
|
-
|
|
96
|
+
I as tapReplaySocket
|
|
93
97
|
};
|
package/dist/shared/lib/rum.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import { isSignedOut as E, isSignedOutError as T, noteUnauthorized as k } from "./signed-out.js";
|
|
2
|
-
let m = !1,
|
|
2
|
+
let m = !1, p, c = (e) => e;
|
|
3
3
|
const o = [];
|
|
4
|
-
let h = null,
|
|
4
|
+
let h = null, v = "/api", f, w = null, d = 0, g = null;
|
|
5
5
|
function y(e) {
|
|
6
|
-
const
|
|
7
|
-
return `${
|
|
6
|
+
const n = e.tagName.toLowerCase(), t = (e.textContent ?? "").trim().slice(0, 40), i = e.getAttribute("aria-label"), r = e.getAttribute("data-testid");
|
|
7
|
+
return `${n}${r ? `[${r}]` : ""}${i ? ` '${i}'` : t ? ` '${t}'` : ""}`;
|
|
8
8
|
}
|
|
9
9
|
function _(e) {
|
|
10
10
|
typeof window > "u" || window.addEventListener(
|
|
11
11
|
"click",
|
|
12
|
-
(
|
|
13
|
-
const
|
|
14
|
-
|
|
12
|
+
(n) => {
|
|
13
|
+
const t = n.target instanceof Element ? n.target.closest('button, a, [role="button"], input, [data-testid]') : null;
|
|
14
|
+
t && (t === w ? (d++, d === 3 && (s({
|
|
15
15
|
kind: "rage",
|
|
16
|
-
route: `${e()} :: ${y(
|
|
17
|
-
duration_ms:
|
|
18
|
-
}), u())) : (w =
|
|
19
|
-
w = null,
|
|
16
|
+
route: `${e()} :: ${y(t)}`.slice(0, 300),
|
|
17
|
+
duration_ms: d
|
|
18
|
+
}), u())) : (w = t, d = 1), g && clearTimeout(g), g = setTimeout(() => {
|
|
19
|
+
w = null, d = 0;
|
|
20
20
|
}, 600));
|
|
21
21
|
},
|
|
22
22
|
{ capture: !0, passive: !0 }
|
|
23
23
|
);
|
|
24
24
|
}
|
|
25
25
|
const $ = 1e3, M = 1e4, b = 3;
|
|
26
|
-
function D(e = b,
|
|
27
|
-
let
|
|
28
|
-
return (
|
|
26
|
+
function D(e = b, n = M) {
|
|
27
|
+
let t = [];
|
|
28
|
+
return (i) => (t = t.filter((r) => i - r < n), t.push(i), t.length >= e ? (t = [], !0) : !1);
|
|
29
29
|
}
|
|
30
30
|
function A(e) {
|
|
31
31
|
if (typeof window > "u" || typeof MutationObserver > "u") return;
|
|
32
|
-
const
|
|
32
|
+
const n = D();
|
|
33
33
|
window.addEventListener(
|
|
34
34
|
"click",
|
|
35
|
-
(
|
|
36
|
-
const
|
|
37
|
-
if (!
|
|
38
|
-
const
|
|
35
|
+
(t) => {
|
|
36
|
+
const i = t.target instanceof Element ? t.target.closest('button, a[href], [role="button"]') : null;
|
|
37
|
+
if (!i || i.disabled || i.closest(".nvr-no-record")) return;
|
|
38
|
+
const r = window.location.href;
|
|
39
39
|
let l = !1;
|
|
40
40
|
const a = new MutationObserver(() => {
|
|
41
41
|
l = !0;
|
|
@@ -51,9 +51,9 @@ function A(e) {
|
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
setTimeout(() => {
|
|
54
|
-
a.disconnect(), !(l || window.location.href !==
|
|
54
|
+
a.disconnect(), !(l || window.location.href !== r) && n(Date.now()) && (s({
|
|
55
55
|
kind: "dead",
|
|
56
|
-
route: `${e()} :: ${y(
|
|
56
|
+
route: `${e()} :: ${y(i)}`.slice(0, 300),
|
|
57
57
|
duration_ms: b
|
|
58
58
|
}), u());
|
|
59
59
|
}, $);
|
|
@@ -69,20 +69,20 @@ function u() {
|
|
|
69
69
|
}
|
|
70
70
|
const e = JSON.stringify({ events: o.splice(0, o.length) });
|
|
71
71
|
try {
|
|
72
|
-
const
|
|
73
|
-
!
|
|
72
|
+
const n = f == null ? void 0 : f();
|
|
73
|
+
!n && typeof navigator.sendBeacon == "function" && navigator.sendBeacon(`${v}/rum`, new Blob([e], { type: "application/json" })) || fetch(`${v}/rum`, {
|
|
74
74
|
method: "POST",
|
|
75
75
|
credentials: "include",
|
|
76
76
|
headers: {
|
|
77
77
|
"Content-Type": "application/json",
|
|
78
|
-
...
|
|
78
|
+
...n ? { Authorization: `Bearer ${n}` } : {}
|
|
79
79
|
},
|
|
80
80
|
body: e,
|
|
81
81
|
keepalive: !0
|
|
82
|
-
}).then(async (
|
|
83
|
-
if (
|
|
84
|
-
const
|
|
85
|
-
T({ status: 401, response:
|
|
82
|
+
}).then(async (i) => {
|
|
83
|
+
if (i.status !== 401) return;
|
|
84
|
+
const r = await i.json().catch(() => null);
|
|
85
|
+
T({ status: 401, response: r }) && k(!1);
|
|
86
86
|
}).catch(() => {
|
|
87
87
|
});
|
|
88
88
|
} catch {
|
|
@@ -91,54 +91,59 @@ function u() {
|
|
|
91
91
|
function s(e) {
|
|
92
92
|
o.push({
|
|
93
93
|
...e,
|
|
94
|
-
app:
|
|
94
|
+
app: p,
|
|
95
95
|
vw: typeof window > "u" ? void 0 : window.innerWidth
|
|
96
96
|
}), o.length >= 10 ? u() : (h && clearTimeout(h), h = setTimeout(u, 1e4));
|
|
97
97
|
}
|
|
98
|
-
const C = /^[A-Za-z0-9._:-]{1,80}$/,
|
|
99
|
-
function
|
|
98
|
+
const C = /^[A-Za-z0-9._:-]{1,80}$/, L = /^[0-9A-Fa-f-]{36}$/;
|
|
99
|
+
function B(e) {
|
|
100
100
|
if (!m || !C.test(e.key)) return;
|
|
101
|
-
const
|
|
101
|
+
const n = e.roleId && L.test(e.roleId) ? e.roleId.toUpperCase() : void 0;
|
|
102
102
|
s({
|
|
103
103
|
kind: "widget",
|
|
104
104
|
route: `widget:${e.key}`,
|
|
105
105
|
widget: e.key,
|
|
106
|
-
role:
|
|
106
|
+
role: n,
|
|
107
107
|
fetch_ms: Math.max(0, Math.round(e.fetchMs)),
|
|
108
108
|
paint_ms: Math.max(0, Math.round(e.paintMs))
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
if (!m || typeof window > "u") return;
|
|
113
|
-
const
|
|
114
|
-
|
|
111
|
+
function O(e) {
|
|
112
|
+
if (!m || typeof window > "u" || document.visibilityState === "hidden") return;
|
|
113
|
+
const n = performance.now();
|
|
114
|
+
let t = !1;
|
|
115
|
+
const i = () => {
|
|
116
|
+
document.visibilityState === "hidden" && (t = !0);
|
|
117
|
+
};
|
|
118
|
+
document.addEventListener("visibilitychange", i), requestAnimationFrame(() => {
|
|
115
119
|
requestAnimationFrame(() => {
|
|
116
|
-
|
|
117
|
-
|
|
120
|
+
if (document.removeEventListener("visibilitychange", i), t) return;
|
|
121
|
+
const r = Math.round(performance.now() - n);
|
|
122
|
+
s({ route: c(e), kind: "route", duration_ms: r });
|
|
118
123
|
});
|
|
119
124
|
});
|
|
120
125
|
}
|
|
121
126
|
function I(e) {
|
|
122
127
|
if (m || typeof window > "u" || typeof performance > "u") return;
|
|
123
|
-
m = !0,
|
|
124
|
-
const
|
|
125
|
-
let
|
|
128
|
+
m = !0, p = e == null ? void 0 : e.app, e != null && e.routePattern && (c = e.routePattern), e != null && e.apiBase && (v = e.apiBase), f = e == null ? void 0 : e.getToken, _(() => c(window.location.pathname)), A(() => c(window.location.pathname));
|
|
129
|
+
const n = performance.getEntriesByType("navigation")[0];
|
|
130
|
+
let t = null;
|
|
126
131
|
try {
|
|
127
132
|
new PerformanceObserver((l) => {
|
|
128
133
|
const a = l.getEntries().at(-1);
|
|
129
|
-
(a == null ? void 0 : a.startTime) != null && (
|
|
134
|
+
(a == null ? void 0 : a.startTime) != null && (t = Math.round(a.startTime));
|
|
130
135
|
}).observe({ type: "largest-contentful-paint", buffered: !0 });
|
|
131
136
|
} catch {
|
|
132
137
|
}
|
|
133
138
|
setTimeout(() => {
|
|
134
|
-
const
|
|
139
|
+
const r = performance.getEntriesByName("first-contentful-paint")[0];
|
|
135
140
|
s({
|
|
136
|
-
route:
|
|
141
|
+
route: c(window.location.pathname),
|
|
137
142
|
kind: "load",
|
|
138
|
-
ttfb_ms:
|
|
139
|
-
fcp_ms:
|
|
140
|
-
lcp_ms:
|
|
141
|
-
duration_ms:
|
|
143
|
+
ttfb_ms: n ? Math.round(n.responseStart) : void 0,
|
|
144
|
+
fcp_ms: r ? Math.round(r.startTime) : void 0,
|
|
145
|
+
lcp_ms: t ?? void 0,
|
|
146
|
+
duration_ms: n ? Math.round(n.loadEventEnd || n.domContentLoadedEventEnd) : void 0
|
|
142
147
|
});
|
|
143
148
|
}, 6e3), window.addEventListener("pagehide", u), document.addEventListener("visibilitychange", () => {
|
|
144
149
|
document.visibilityState === "hidden" && u();
|
|
@@ -149,7 +154,7 @@ export {
|
|
|
149
154
|
$ as DEAD_WAIT_MS,
|
|
150
155
|
M as DEAD_WINDOW_MS,
|
|
151
156
|
D as createDeadClickCounter,
|
|
152
|
-
|
|
153
|
-
|
|
157
|
+
O as rumRouteChange,
|
|
158
|
+
B as rumWidget,
|
|
154
159
|
I as startRum
|
|
155
160
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reportClientCrash as
|
|
1
|
+
import { reportClientCrash as y } from "./client-crash.js";
|
|
2
2
|
const d = "Something went wrong — it’s been reported", m = /failed to fetch|load failed|networkerror|network request failed|network error/i;
|
|
3
3
|
function h(e) {
|
|
4
4
|
var r;
|
|
@@ -9,7 +9,7 @@ function w(e) {
|
|
|
9
9
|
return !(e instanceof Error) || h(e) != null || e.response != null || m.test(e.message) ? !1 : e instanceof TypeError || e instanceof ReferenceError || e instanceof RangeError;
|
|
10
10
|
}
|
|
11
11
|
const g = /^(bad request|unauthorized|forbidden|not found|conflict|unprocessable entity|too many requests|internal server error|bad gateway|service unavailable|gateway timeout)$/i;
|
|
12
|
-
function
|
|
12
|
+
function T(e) {
|
|
13
13
|
var r;
|
|
14
14
|
const t = e, o = [(r = t == null ? void 0 : t.response) == null ? void 0 : r.data, t == null ? void 0 : t.response];
|
|
15
15
|
for (const n of o) {
|
|
@@ -22,14 +22,17 @@ function y(e) {
|
|
|
22
22
|
}
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
|
-
function A(e
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
function A(e) {
|
|
26
|
+
return T(e);
|
|
27
|
+
}
|
|
28
|
+
function O(e, t = "Failed") {
|
|
29
|
+
const o = h(e), r = T(e);
|
|
30
|
+
if (r && !c(r) && !v(e, o)) return r;
|
|
28
31
|
if (w(e)) return d;
|
|
29
32
|
const n = e instanceof Error ? e.message : typeof e == "string" ? e : "";
|
|
30
33
|
return !o && m.test(n) ? "Cannot reach the server" : n.trim() && !c(n) ? n.trim() : n.trim() ? C(n, t || d, o) : r ? f(o) ?? (t || d) : t;
|
|
31
34
|
}
|
|
32
|
-
function
|
|
35
|
+
function v(e, t) {
|
|
33
36
|
if (t !== 500) return !1;
|
|
34
37
|
const o = e, r = o == null ? void 0 : o.response, n = r && typeof r.data == "object" && r.data ? r.data : r;
|
|
35
38
|
return !!n && typeof n.statusCode == "number" && typeof n.code != "string";
|
|
@@ -53,7 +56,7 @@ const E = {
|
|
|
53
56
|
function f(e) {
|
|
54
57
|
return e == null ? null : E[e] ?? (e >= 500 ? E[500] : e >= 400 ? E[400] : null);
|
|
55
58
|
}
|
|
56
|
-
function
|
|
59
|
+
function S(e) {
|
|
57
60
|
if (typeof e != "string") return !1;
|
|
58
61
|
const t = e.trim();
|
|
59
62
|
return /^request failed with status( code)? \d{3}$/i.test(t) || // apiFetch-style "Request failed (500)", the SDK's "HTTP 500", "Error 404", "500 Internal Server Error"
|
|
@@ -120,7 +123,7 @@ const R = [
|
|
|
120
123
|
function c(e) {
|
|
121
124
|
if (typeof e != "string") return e != null;
|
|
122
125
|
const t = e.trim();
|
|
123
|
-
return t ?
|
|
126
|
+
return t ? S(t) ? !0 : R.some((o) => o.test(t)) : !1;
|
|
124
127
|
}
|
|
125
128
|
const N = /\s+[—–-]\s+|:\s+|\.\s+/;
|
|
126
129
|
function C(e, t = d, o) {
|
|
@@ -146,20 +149,21 @@ function C(e, t = d, o) {
|
|
|
146
149
|
return f(o ?? b(r)) ?? t;
|
|
147
150
|
}
|
|
148
151
|
const p = /* @__PURE__ */ new WeakSet();
|
|
149
|
-
function
|
|
150
|
-
!e || !w(t) || p.has(t) || (p.add(t),
|
|
152
|
+
function k(e, t) {
|
|
153
|
+
!e || !w(t) || p.has(t) || (p.add(t), y(e, t, null).catch(() => {
|
|
151
154
|
}));
|
|
152
155
|
}
|
|
153
156
|
export {
|
|
154
157
|
d as SOMETHING_WENT_WRONG,
|
|
155
158
|
E as STATUS_TITLES,
|
|
156
159
|
h as errorStatusOf,
|
|
157
|
-
|
|
160
|
+
S as isBareStatusText,
|
|
158
161
|
w as isCodeError,
|
|
159
162
|
c as isRawErrorText,
|
|
160
163
|
C as plainErrorText,
|
|
161
|
-
|
|
164
|
+
k as reportCodeError,
|
|
165
|
+
A as serverErrorText,
|
|
162
166
|
b as statusInText,
|
|
163
167
|
f as statusTitle,
|
|
164
|
-
|
|
168
|
+
O as userErrorMessage
|
|
165
169
|
};
|