@nivaro/react 0.3.116 → 0.3.118

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.
Files changed (142) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +140 -14
  4. package/dist/index.js +488 -485
  5. package/dist/shared/components/ActivityEntry.js +130 -125
  6. package/dist/shared/components/AgentPresenceChip.js +36 -26
  7. package/dist/shared/components/CellCopyLayer.js +50 -45
  8. package/dist/shared/components/CollectionBrowserView.js +3855 -3785
  9. package/dist/shared/components/FilePreviewLightbox.js +96 -58
  10. package/dist/shared/components/InStep.js +18 -17
  11. package/dist/shared/components/ItemEditForm.js +4220 -4175
  12. package/dist/shared/components/JobsTray.js +8 -8
  13. package/dist/shared/components/LiveNewMatchesPill.js +21 -14
  14. package/dist/shared/components/LiveOffNote.js +3 -2
  15. package/dist/shared/components/LiveRowMark.js +53 -23
  16. package/dist/shared/components/LiveTraceView.js +162 -123
  17. package/dist/shared/components/MyWorkView.js +320 -299
  18. package/dist/shared/components/NotificationBell.js +14 -14
  19. package/dist/shared/components/OverflowRail.js +1 -1
  20. package/dist/shared/components/PageRenderer.js +120 -116
  21. package/dist/shared/components/ProfileView.js +203 -202
  22. package/dist/shared/components/RealtimeStatusBanner.js +31 -29
  23. package/dist/shared/components/RecordDrilldownSheet.js +7 -7
  24. package/dist/shared/components/RecordHoverCard.js +102 -84
  25. package/dist/shared/components/RecordReadView.js +146 -146
  26. package/dist/shared/components/ReportView.js +1086 -1091
  27. package/dist/shared/components/ScreenRefreshButton.js +34 -32
  28. package/dist/shared/components/TipLayer.js +65 -58
  29. package/dist/shared/components/WidgetImageMenu.js +83 -43
  30. package/dist/shared/components/activity/RecordActivityStream.js +175 -173
  31. package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
  32. package/dist/shared/components/cbv/column-totals.js +62 -57
  33. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
  34. package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
  35. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
  36. package/dist/shared/components/charts/category-axis.js +93 -0
  37. package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
  38. package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
  39. package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
  40. package/dist/shared/components/collections-directory/page-model.js +72 -67
  41. package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
  42. package/dist/shared/components/integrations/SendStatus.js +65 -59
  43. package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
  44. package/dist/shared/components/integrations/console/SignalCard.js +237 -230
  45. package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
  46. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
  47. package/dist/shared/components/item-edit/CloneDialog.js +191 -161
  48. package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
  49. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
  50. package/dist/shared/components/item-edit/FieldComments.js +54 -53
  51. package/dist/shared/components/item-edit/FieldPointer.js +82 -67
  52. package/dist/shared/components/item-edit/FieldRow.js +106 -100
  53. package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
  54. package/dist/shared/components/item-edit/FilePickerField.js +452 -387
  55. package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
  56. package/dist/shared/components/item-edit/HeaderTools.js +94 -85
  57. package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
  58. package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
  59. package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
  60. package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
  61. package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
  62. package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
  63. package/dist/shared/components/item-edit/RecalcValue.js +57 -32
  64. package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
  65. package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
  66. package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
  67. package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
  68. package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
  69. package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
  70. package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
  71. package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
  72. package/dist/shared/components/item-edit/SectionPresence.js +18 -10
  73. package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
  74. package/dist/shared/components/item-edit/UserChip.js +1 -1
  75. package/dist/shared/components/item-edit/file-live.js +69 -54
  76. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  77. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  78. package/dist/shared/components/item-edit/removed-line.js +31 -25
  79. package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
  80. package/dist/shared/components/list/ListViewers.js +46 -35
  81. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  82. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  83. package/dist/shared/components/panels/AlertBanners.js +82 -72
  84. package/dist/shared/components/panels/BranchLanes.js +22 -22
  85. package/dist/shared/components/panels/CommentImages.js +123 -102
  86. package/dist/shared/components/panels/CommentPanel.js +186 -185
  87. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  88. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  89. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  90. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  91. package/dist/shared/components/pipeline/BindingStartStateSettings.js +163 -0
  92. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  93. package/dist/shared/components/pipeline/PipelineEditorView.js +320 -299
  94. package/dist/shared/components/profile/AgentNameField.js +107 -81
  95. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  96. package/dist/shared/components/profile/PersonAccess.js +599 -495
  97. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  98. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  99. package/dist/shared/components/profile/primitives.js +1 -1
  100. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  101. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  102. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  103. package/dist/shared/components/support/AssignRules.js +1733 -0
  104. package/dist/shared/components/support/PersonPick.js +88 -0
  105. package/dist/shared/components/support/RequestList.js +790 -0
  106. package/dist/shared/components/support/ScreenShare.js +158 -152
  107. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  108. package/dist/shared/components/support/SupportView.js +140 -246
  109. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  110. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  111. package/dist/shared/components/support/assign-rules-text.js +171 -0
  112. package/dist/shared/components/support/support-list.js +125 -0
  113. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  114. package/dist/shared/components/ui/checkbox.js +6 -6
  115. package/dist/shared/components/ui/select.js +43 -39
  116. package/dist/shared/components/ui/sheet.js +9 -9
  117. package/dist/shared/components/ui/switch.js +12 -11
  118. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  119. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  120. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  121. package/dist/shared/lib/activity-sentence.js +103 -91
  122. package/dist/shared/lib/agent-presence.js +27 -21
  123. package/dist/shared/lib/approval-progress.js +2 -2
  124. package/dist/shared/lib/copy-rules.js +31 -24
  125. package/dist/shared/lib/derived-causes.js +113 -78
  126. package/dist/shared/lib/grid-cursors.js +26 -26
  127. package/dist/shared/lib/label-flash.js +27 -0
  128. package/dist/shared/lib/list-return.js +137 -125
  129. package/dist/shared/lib/live-deltas.js +40 -34
  130. package/dist/shared/lib/live-groups.js +56 -52
  131. package/dist/shared/lib/live-preference.js +64 -59
  132. package/dist/shared/lib/live-screen.js +223 -192
  133. package/dist/shared/lib/partner-failure.js +11 -11
  134. package/dist/shared/lib/rollup-recalc.js +68 -64
  135. package/dist/shared/lib/screen-refresh.js +74 -68
  136. package/dist/shared/lib/screen-share.js +108 -104
  137. package/dist/shared/lib/send-status.js +77 -61
  138. package/dist/shared/lib/text-diff-window.js +29 -0
  139. package/dist/shared/lib/use-query-entry.js +17 -0
  140. package/dist/shared/lib/watch-list.js +210 -209
  141. package/dist/shared/lib/widget-image-render.js +72 -49
  142. package/package.json +1 -1
@@ -1,127 +1,127 @@
1
- import { useRef as v, useState as k, useLayoutEffect as Y, useEffect as R, useCallback as U } from "react";
2
- import { useLiveBusy as H, liveMotionAllowed as j } from "./live-preference.js";
3
- const D = (t, n) => t ? typeof t == "function" ? t(n) : t.has(n) : !1;
4
- function q(t, n, e, s) {
5
- const c = /* @__PURE__ */ new Map();
6
- for (const o of n) c.set(e(o), o);
7
- const r = (o) => !D(s.released, o) && (D(s.held, o) || !D(s.mayLeave, o));
8
- if (s.frozen) {
9
- const o = [], d = /* @__PURE__ */ new Set();
1
+ import { useRef as v, useState as g, useLayoutEffect as H, useEffect as x, useCallback as O } from "react";
2
+ import { useLiveBusy as j, liveMotionAllowed as V } from "./live-preference.js";
3
+ const _ = (t, n) => t ? typeof t == "function" ? t(n) : t.has(n) : !1;
4
+ function X(t, n, e, c) {
5
+ const o = /* @__PURE__ */ new Map();
6
+ for (const s of n) o.set(e(s), s);
7
+ const r = (s) => !_(c.released, s) && (_(c.held, s) || !_(c.mayLeave, s));
8
+ if (c.frozen) {
9
+ const s = [], f = /* @__PURE__ */ new Set();
10
10
  for (const u of t) {
11
- d.add(u.key);
12
- const l = c.get(u.key);
13
- l !== void 0 ? o.push({ key: u.key, row: l, state: "live" }) : D(s.released, u.key) || o.push({ key: u.key, row: u.row, state: "departed" });
11
+ f.add(u.key);
12
+ const p = o.get(u.key);
13
+ p !== void 0 ? s.push({ key: u.key, row: p, state: "live" }) : _(c.released, u.key) || s.push({ key: u.key, row: u.row, state: "departed" });
14
14
  }
15
15
  for (const u of n) {
16
- const l = e(u);
17
- d.has(l) || o.push({ key: l, row: u, state: "live" });
16
+ const p = e(u);
17
+ f.has(p) || s.push({ key: p, row: u, state: "live" });
18
18
  }
19
- return o;
19
+ return s;
20
20
  }
21
- const i = n.map((o) => ({ key: e(o), row: o, state: "live" })), a = [];
22
- let y = null;
23
- for (const o of t)
24
- !c.has(o.key) && r(o.key) && a.push({ row: { key: o.key, row: o.row, state: "departed" }, after: y }), y = o.key;
25
- for (const o of a) {
26
- const d = o.after == null ? -1 : i.findIndex((u) => u.key === o.after);
27
- if (d < 0 && o.after != null) {
21
+ const i = n.map((s) => ({ key: e(s), row: s, state: "live" })), a = [];
22
+ let l = null;
23
+ for (const s of t)
24
+ !o.has(s.key) && r(s.key) && a.push({ row: { key: s.key, row: s.row, state: "departed" }, after: l }), l = s.key;
25
+ for (const s of a) {
26
+ const f = s.after == null ? -1 : i.findIndex((u) => u.key === s.after);
27
+ if (f < 0 && s.after != null) {
28
28
  const u = t.slice(
29
29
  0,
30
- t.findIndex((f) => f.key === o.row.key)
30
+ t.findIndex((d) => d.key === s.row.key)
31
31
  );
32
- let l = -1;
33
- for (let f = u.length - 1; f >= 0 && l < 0; f--)
34
- l = i.findIndex((g) => g.key === u[f].key);
35
- i.splice(l + 1, 0, o.row);
36
- } else i.splice(d + 1, 0, o.row);
32
+ let p = -1;
33
+ for (let d = u.length - 1; d >= 0 && p < 0; d--)
34
+ p = i.findIndex((k) => k.key === u[d].key);
35
+ i.splice(p + 1, 0, s.row);
36
+ } else i.splice(f + 1, 0, s.row);
37
37
  }
38
38
  return i;
39
39
  }
40
- function ue(t, n, e = {}) {
41
- const s = e.enabled !== !1, c = v(n);
42
- c.current = n;
43
- const [r, i] = k(null), [a, y] = k(!1), [o, d] = k(!1), [u, l] = k(0), f = v(/* @__PURE__ */ new Map()), g = v(0), I = v(/* @__PURE__ */ new Set()), [A, S] = k(0), C = e.held ? [...e.held].sort().join("") : "", [x, p] = k(
44
- () => (t ?? []).map((m) => ({ key: n(m), row: m, state: "live" }))
45
- ), E = v(e.resetKey);
46
- R(() => {
40
+ function fe(t, n, e = {}) {
41
+ const c = e.enabled !== !1, o = v(n);
42
+ o.current = n;
43
+ const [r, i] = g(null), [a, l] = g(!1), [s, f] = g(!1), [u, p] = g(0), d = v(/* @__PURE__ */ new Map()), k = v(0), L = v(/* @__PURE__ */ new Set()), [A, S] = g(0), D = e.held ? [...e.held].sort().join("") : "", [K, w] = g(
44
+ () => (t ?? []).map((y) => ({ key: n(y), row: y, state: "live" }))
45
+ ), b = v(e.resetKey);
46
+ x(() => {
47
47
  if (!r) return;
48
- const m = () => y(!0), w = () => y(!1), b = () => d(!0), T = (_) => {
49
- const M = _.relatedTarget;
50
- (!M || !r.contains(M)) && d(!1);
48
+ const y = () => l(!0), m = () => l(!1), E = () => f(!0), I = (z) => {
49
+ const M = z.relatedTarget;
50
+ (!M || !r.contains(M)) && f(!1);
51
51
  };
52
- return r.addEventListener("pointerenter", m), r.addEventListener("pointerleave", w), r.addEventListener("focusin", b), r.addEventListener("focusout", T), () => {
53
- r.removeEventListener("pointerenter", m), r.removeEventListener("pointerleave", w), r.removeEventListener("focusin", b), r.removeEventListener("focusout", T);
52
+ return r.addEventListener("pointerenter", y), r.addEventListener("pointerleave", m), r.addEventListener("focusin", E), r.addEventListener("focusout", I), () => {
53
+ r.removeEventListener("pointerenter", y), r.removeEventListener("pointerleave", m), r.removeEventListener("focusin", E), r.removeEventListener("focusout", I);
54
54
  };
55
- }, [r]), R(() => {
56
- if (!s || typeof document > "u") return;
57
- const m = () => {
58
- g.current += 1, f.current.size > 0 && l((w) => w + 1);
55
+ }, [r]), x(() => {
56
+ if (!c || typeof document > "u") return;
57
+ const y = () => {
58
+ k.current += 1, d.current.size > 0 && p((m) => m + 1);
59
59
  };
60
- return document.addEventListener("pointerdown", m, !0), document.addEventListener("keydown", m, !0), () => {
61
- document.removeEventListener("pointerdown", m, !0), document.removeEventListener("keydown", m, !0);
60
+ return document.addEventListener("pointerdown", y, !0), document.addEventListener("keydown", y, !0), () => {
61
+ document.removeEventListener("pointerdown", y, !0), document.removeEventListener("keydown", y, !0);
62
62
  };
63
- }, [s]);
64
- const L = H(s), K = s && (a || o || L);
65
- Y(() => {
63
+ }, [c]);
64
+ const C = j(c), R = c && (a || s || C);
65
+ H(() => {
66
66
  if (t === void 0) return;
67
- const m = E.current !== e.resetKey;
68
- if (E.current = e.resetKey, !s || m) {
69
- f.current.clear();
70
- const w = t.map((b) => ({ key: c.current(b), row: b, state: "live" }));
71
- p((b) => O(b, w) ? b : w);
67
+ const y = b.current !== e.resetKey;
68
+ if (b.current = e.resetKey, !c || y) {
69
+ d.current.clear();
70
+ const m = t.map((E) => ({ key: o.current(E), row: E, state: "live" }));
71
+ w((E) => U(E, m) ? E : m);
72
72
  return;
73
73
  }
74
- p((w) => {
75
- const b = new Set(e.held ?? []), T = q(w, t, c.current, {
76
- frozen: K,
77
- held: b,
78
- released: I.current,
79
- mayLeave: (h) => (f.current.get(h) ?? Number.POSITIVE_INFINITY) < g.current
80
- }), _ = g.current, M = /* @__PURE__ */ new Set();
81
- for (const h of T)
82
- h.state === "departed" && (M.add(h.key), f.current.has(h.key) || f.current.set(h.key, _));
83
- for (const h of [...f.current.keys()])
84
- M.has(h) || f.current.delete(h);
85
- const B = new Set(t.map((h) => c.current(h)));
86
- for (const h of [...I.current]) B.has(h) && I.current.delete(h);
87
- return O(w, T) ? w : T;
74
+ w((m) => {
75
+ const E = new Set(e.held ?? []), I = X(m, t, o.current, {
76
+ frozen: R,
77
+ held: E,
78
+ released: L.current,
79
+ mayLeave: (h) => (d.current.get(h) ?? Number.POSITIVE_INFINITY) < k.current
80
+ }), z = k.current, M = /* @__PURE__ */ new Set();
81
+ for (const h of I)
82
+ h.state === "departed" && (M.add(h.key), d.current.has(h.key) || d.current.set(h.key, z));
83
+ for (const h of [...d.current.keys()])
84
+ M.has(h) || d.current.delete(h);
85
+ const q = new Set(t.map((h) => o.current(h)));
86
+ for (const h of [...L.current]) q.has(h) && L.current.delete(h);
87
+ return U(m, I) ? m : I;
88
88
  });
89
- }, [t, s, K, u, A, C, e.resetKey]);
90
- const W = U((m) => {
91
- for (const w of m) I.current.add(String(w));
92
- S((w) => w + 1);
89
+ }, [t, c, R, u, A, D, e.resetKey]);
90
+ const T = O((y) => {
91
+ for (const m of y) L.current.add(String(m));
92
+ S((m) => m + 1);
93
93
  }, []);
94
- return { rows: x, containerRef: i, release: W, frozen: K };
94
+ return { rows: K, containerRef: i, release: T, frozen: R };
95
95
  }
96
- function O(t, n) {
96
+ function U(t, n) {
97
97
  if (t.length !== n.length) return !1;
98
98
  for (let e = 0; e < t.length; e++)
99
99
  if (t[e].key !== n[e].key || t[e].row !== n[e].row || t[e].state !== n[e].state) return !1;
100
100
  return !0;
101
101
  }
102
- function V(t, n, e, s) {
103
- if (t === null || s) return { rows: [...n], held: 0 };
104
- const c = new Set(t), r = /* @__PURE__ */ new Map();
105
- for (const d of n) r.set(e(d), d);
102
+ function G(t, n, e, c) {
103
+ if (t === null || c) return { rows: [...n], held: 0 };
104
+ const o = new Set(t), r = /* @__PURE__ */ new Map();
105
+ for (const f of n) r.set(e(f), f);
106
106
  let i = 0, a = !0;
107
- const y = [];
108
- for (const d of n) {
109
- const u = e(d);
110
- if (c.has(u)) {
107
+ const l = [];
108
+ for (const f of n) {
109
+ const u = e(f);
110
+ if (o.has(u)) {
111
111
  a = !1;
112
112
  continue;
113
113
  }
114
- a ? i++ : y.push(d);
114
+ a ? i++ : l.push(f);
115
115
  }
116
116
  if (a) return { rows: [...n], held: 0 };
117
- const o = [];
118
- for (const d of t) {
119
- const u = r.get(d);
120
- u !== void 0 && o.push(u);
117
+ const s = [];
118
+ for (const f of t) {
119
+ const u = r.get(f);
120
+ u !== void 0 && s.push(u);
121
121
  }
122
- return { rows: [...o, ...y], held: i };
122
+ return { rows: [...s, ...l], held: i };
123
123
  }
124
- function X(t) {
124
+ function J(t) {
125
125
  if (typeof window > "u") return null;
126
126
  let n = (t == null ? void 0 : t.parentElement) ?? null;
127
127
  for (; n; ) {
@@ -131,92 +131,122 @@ function X(t) {
131
131
  }
132
132
  return document.scrollingElement ?? null;
133
133
  }
134
- const G = 24;
135
- function ae(t, n, e = {}) {
136
- const s = e.enabled !== !1, c = v(n);
137
- c.current = n;
138
- const [r, i] = k(null), [a, y] = k(!0), o = v(null), d = v(e.resetKey), [u, l] = k(0), f = v(/* @__PURE__ */ new Set()), g = v(null);
139
- R(() => {
134
+ const $ = 24;
135
+ function B(t) {
136
+ if (typeof document > "u") return 0;
137
+ let n = 0;
138
+ for (const e of document.body.querySelectorAll("*")) {
139
+ if (t != null && t.contains(e)) continue;
140
+ const c = getComputedStyle(e).position;
141
+ if (c !== "sticky" && c !== "fixed") continue;
142
+ const o = e.getBoundingClientRect();
143
+ o.top > 200 || o.bottom <= 0 || o.width < window.innerWidth * 0.5 || o.height > window.innerHeight * 0.5 || (n = Math.max(n, o.bottom));
144
+ }
145
+ return n;
146
+ }
147
+ function de(t, n, e = {}) {
148
+ const c = e.enabled !== !1, o = v(n);
149
+ o.current = n;
150
+ const [r, i] = g(null), [a, l] = g(!0), s = v(null), f = v(e.resetKey), [u, p] = g(0), d = v(/* @__PURE__ */ new Set()), k = v(null);
151
+ x(() => {
140
152
  if (!r) return;
141
- const p = X(r);
142
- if (g.current = p, !p) return;
143
- const E = p === document.scrollingElement || p === document.documentElement ? window : p, L = () => y(p.scrollTop <= G);
144
- return L(), E.addEventListener("scroll", L, { passive: !0 }), () => E.removeEventListener("scroll", L);
153
+ const w = J(r);
154
+ if (k.current = w, !w) return;
155
+ const b = w === document.scrollingElement || w === document.documentElement, C = b ? window : w;
156
+ let R = b ? B(r) : 0;
157
+ const T = () => {
158
+ if (w.scrollTop <= $) return l(!0);
159
+ const m = b ? R : w.getBoundingClientRect().top;
160
+ l(r.getBoundingClientRect().top >= m - $);
161
+ }, y = () => {
162
+ b && (R = B(r)), T();
163
+ };
164
+ return T(), C.addEventListener("scroll", T, { passive: !0 }), window.addEventListener("resize", y), () => {
165
+ C.removeEventListener("scroll", T), window.removeEventListener("resize", y);
166
+ };
145
167
  }, [r]);
146
- const I = U(() => l((p) => p + 1), []), A = J(g, y, I);
147
- d.current !== e.resetKey && (d.current = e.resetKey, o.current = null);
168
+ const L = O(() => p((w) => w + 1), []), A = Q(k, l, L);
169
+ f.current !== e.resetKey && (f.current = e.resetKey, s.current = null);
148
170
  let S;
149
171
  if (t === void 0) S = { rows: [], held: 0 };
150
- else if (s)
151
- S = V(o.current, t, c.current, a);
152
- else return o.current = null, f.current = F, { rows: [...t], held: 0, reveal: A, rootRef: i, arrived: F };
153
- const C = S.rows.map((p) => c.current(p)), x = o.current;
172
+ else if (c)
173
+ S = G(s.current, t, o.current, a);
174
+ else return s.current = null, d.current = F, { rows: [...t], held: 0, reveal: A, rootRef: i, arrived: F };
175
+ const D = S.rows.map((w) => o.current(w)), K = s.current;
154
176
  if (t !== void 0) {
155
- if (x) {
156
- const p = new Set(x), E = C.filter((L) => !p.has(L));
157
- E.length > 0 && (f.current = new Set(E));
158
- } else f.current = F;
159
- o.current = C;
177
+ if (K) {
178
+ const w = new Set(K), b = D.filter((C) => !w.has(C));
179
+ b.length > 0 && (d.current = new Set(b));
180
+ } else d.current = F;
181
+ s.current = D;
160
182
  }
161
183
  return {
162
184
  rows: S.rows,
163
185
  held: S.held,
164
186
  reveal: A,
165
187
  rootRef: i,
166
- arrived: f.current
188
+ arrived: d.current
167
189
  };
168
190
  }
169
191
  const F = /* @__PURE__ */ new Set();
170
- function J(t, n, e) {
171
- return U(() => {
192
+ function Q(t, n, e) {
193
+ return O(() => {
172
194
  var r;
173
- const s = t.current;
174
- let c = !0;
195
+ const c = t.current;
196
+ let o = !0;
175
197
  try {
176
- c = !((r = window.matchMedia) != null && r.call(window, "(prefers-reduced-motion: reduce)").matches);
198
+ o = !((r = window.matchMedia) != null && r.call(window, "(prefers-reduced-motion: reduce)").matches);
177
199
  } catch {
178
200
  }
179
- s == null || s.scrollTo({ top: 0, behavior: c ? "smooth" : "auto" }), n(!0), e();
201
+ c == null || c.scrollTo({ top: 0, behavior: o ? "smooth" : "auto" }), n(!0), e();
180
202
  }, [t, n, e]);
181
203
  }
182
- const z = 2e3, Q = 1500;
183
- function Z() {
204
+ const P = 2e3, Z = 1500;
205
+ function ee() {
184
206
  return typeof document < "u" && (document.documentElement.classList.contains("dark") || document.documentElement.getAttribute("data-theme") === "dark") ? { fill: "rgba(245, 158, 11, 0.10)", dot: "#f59e0b" } : { fill: "rgba(0, 206, 255, 0.08)", dot: "#00b8e6" };
185
207
  }
186
- function ee() {
208
+ function te() {
187
209
  var t;
188
210
  return typeof document > "u" ? !1 : document.visibilityState === "hidden" || ((t = document.hasFocus) == null ? void 0 : t.call(document)) === !1;
189
211
  }
190
- function te(t, n) {
212
+ function ne(t) {
213
+ if (typeof getComputedStyle != "function") return "#fff";
214
+ for (let n = t; n; n = n.parentElement) {
215
+ const e = getComputedStyle(n).backgroundColor;
216
+ if (e && e !== "transparent" && !/rgba\([^)]*,\s*0\)$/.test(e)) return e;
217
+ }
218
+ return "#fff";
219
+ }
220
+ function re(t, n) {
191
221
  if (t.querySelector("[data-live-new-dot]")) return;
192
222
  typeof getComputedStyle == "function" && getComputedStyle(t).position === "static" && (t.style.position = "relative");
193
223
  const e = document.createElement("span");
194
- e.setAttribute("data-live-new-dot", ""), e.setAttribute("aria-hidden", "true"), e.style.cssText = `position:absolute;left:3px;top:6px;width:6px;height:6px;border-radius:9999px;background:${n};pointer-events:none;z-index:1`, t.appendChild(e);
195
- const s = () => {
196
- e.remove(), c == null || c.disconnect(), document.removeEventListener("visibilitychange", r);
224
+ e.setAttribute("data-live-new-dot", ""), e.setAttribute("aria-hidden", "true"), e.style.cssText = `position:absolute;left:3px;top:6px;width:6px;height:6px;border-radius:9999px;background:${n};box-shadow:0 0 0 2px ${ne(t)};pointer-events:none;z-index:1`, t.appendChild(e);
225
+ const c = () => {
226
+ e.remove(), o == null || o.disconnect(), document.removeEventListener("visibilitychange", r);
197
227
  };
198
- let c = null;
228
+ let o = null;
199
229
  const r = () => {
200
230
  if (document.visibilityState === "visible") {
201
- if (typeof IntersectionObserver > "u") return s();
202
- c == null || c.disconnect(), c = new IntersectionObserver(
231
+ if (typeof IntersectionObserver > "u") return c();
232
+ o == null || o.disconnect(), o = new IntersectionObserver(
203
233
  (i) => {
204
- i.some((a) => a.isIntersecting && a.intersectionRatio >= 0.5) && s();
234
+ i.some((a) => a.isIntersecting && a.intersectionRatio >= 0.5) && c();
205
235
  },
206
236
  { threshold: [0.5] }
207
- ), c.observe(t);
237
+ ), o.observe(t);
208
238
  }
209
239
  };
210
240
  document.addEventListener("visibilitychange", r), r();
211
241
  }
212
- function de(t, n) {
242
+ function le(t, n) {
213
243
  if (!t || typeof window > "u") return;
214
- const e = Z(), s = ee();
215
- for (const c of n) {
216
- const r = typeof CSS < "u" && CSS.escape ? CSS.escape(c) : c.replace(/"/g, '\\"'), i = t.querySelector(`[data-live-key="${r}"]`);
244
+ const e = ee(), c = te();
245
+ for (const o of n) {
246
+ const r = typeof CSS < "u" && CSS.escape ? CSS.escape(o) : o.replace(/"/g, '\\"'), i = t.querySelector(`[data-live-key="${r}"]`);
217
247
  if (!i) continue;
218
- if (s) {
219
- te(i, e.dot);
248
+ if (c) {
249
+ re(i, e.dot);
220
250
  continue;
221
251
  }
222
252
  if (typeof i.animate != "function") continue;
@@ -227,11 +257,11 @@ function de(t, n) {
227
257
  ],
228
258
  { duration: 160, easing: "cubic-bezier(0.16, 1, 0.3, 1)" }
229
259
  );
230
- const a = z + Q;
260
+ const a = P + Z;
231
261
  i.animate(
232
262
  [
233
263
  { backgroundColor: e.fill },
234
- { backgroundColor: e.fill, offset: z / a },
264
+ { backgroundColor: e.fill, offset: P / a },
235
265
  { backgroundColor: "rgba(0, 0, 0, 0)" }
236
266
  ],
237
267
  { duration: a, easing: "linear" }
@@ -239,95 +269,96 @@ function de(t, n) {
239
269
  }
240
270
  }
241
271
  function N() {
242
- return !j();
272
+ return !V();
243
273
  }
244
- const ne = 'input, textarea, select, [contenteditable="true"], [contenteditable=""], [data-live-nofade]', re = 60;
245
- function oe(t, n, e = typeof document > "u" ? null : document.activeElement) {
246
- const s = /* @__PURE__ */ new Set(), c = (r) => {
247
- if (!(!r || r === t || !t.contains(r) || s.size >= re) && !r.closest(ne) && !(e && e !== document.body && (r.contains(e) || e.contains(r)))) {
248
- for (const i of s) if (i.contains(r)) return;
249
- for (const i of [...s]) r.contains(i) && s.delete(i);
250
- s.add(r);
274
+ const oe = 'input, textarea, select, [contenteditable="true"], [contenteditable=""], [data-live-nofade]', se = 60;
275
+ function ce(t, n, e = typeof document > "u" ? null : document.activeElement) {
276
+ const c = /* @__PURE__ */ new Set(), o = (r) => {
277
+ if (!(!r || r === t || !t.contains(r) || c.size >= se) && !r.closest(oe) && !(e && e !== document.body && (r.contains(e) || e.contains(r)))) {
278
+ for (const i of c) if (i.contains(r)) return;
279
+ for (const i of [...c]) r.contains(i) && c.delete(i);
280
+ c.add(r);
251
281
  }
252
282
  };
253
283
  for (const r of n)
254
- if (r.type === "characterData") c(r.target.parentElement);
284
+ if (r.type === "characterData") o(r.target.parentElement);
255
285
  else if (r.type === "childList") {
256
286
  const i = r.target;
257
287
  let a = !1;
258
- for (const y of Array.from(r.addedNodes))
259
- y.nodeType === 1 ? c(y) : y.nodeType === 3 && (y.textContent ?? "").trim() && (a = !0);
260
- a && c(i.nodeType === 1 ? i : i.parentElement);
288
+ for (const l of Array.from(r.addedNodes))
289
+ l.nodeType === 1 ? o(l) : l.nodeType === 3 && (l.textContent ?? "").trim() && (a = !0);
290
+ a && o(i.nodeType === 1 ? i : i.parentElement);
261
291
  }
262
- return [...s];
292
+ return [...c];
263
293
  }
264
- const $ = 600;
265
- function P(t) {
294
+ const W = 600;
295
+ function Y(t) {
266
296
  for (const n of t) {
267
297
  const e = n;
268
298
  !e.isConnected || typeof e.animate != "function" || e.animate([{ opacity: 0.25 }, { opacity: 1 }], { duration: 700, easing: "ease-out" });
269
299
  }
270
300
  }
271
- function fe(t, n = {}) {
272
- const e = n.enabled !== !1, s = n.windowMs ?? 1200, c = v(0), r = v(!0), i = v([]), [a, y] = k(null);
273
- return Y(() => {
301
+ function pe(t, n = {}) {
302
+ const e = n.enabled !== !1, c = n.windowMs ?? 1200, o = v(0), r = v(!0), i = v([]), [a, l] = g(null);
303
+ return H(() => {
274
304
  if (r.current) {
275
305
  r.current = !1;
276
306
  return;
277
307
  }
278
308
  if (t == null || t === 0 || t === !1) return;
279
- const o = Date.now();
280
- if (c.current = o + s, N()) {
309
+ const s = Date.now();
310
+ if (o.current = s + c, N()) {
281
311
  i.current = [];
282
312
  return;
283
313
  }
284
- const d = /* @__PURE__ */ new Set();
314
+ const f = /* @__PURE__ */ new Set();
285
315
  for (const u of i.current)
286
- if (!(o - u.at > $))
287
- for (const l of u.targets) d.add(l);
288
- i.current = [], P([...d]);
289
- }, [t, s]), R(() => {
316
+ if (!(s - u.at > W))
317
+ for (const p of u.targets) f.add(p);
318
+ i.current = [], Y([...f]);
319
+ }, [t, c]), x(() => {
290
320
  if (!e || !a || typeof MutationObserver > "u") return;
291
- const o = new MutationObserver((d) => {
292
- const u = Date.now(), l = oe(a, d);
293
- if (l.length === 0) return;
294
- if (u <= c.current) {
295
- N() || P(l);
321
+ const s = new MutationObserver((f) => {
322
+ const u = Date.now(), p = ce(a, f);
323
+ if (p.length === 0) return;
324
+ if (u <= o.current) {
325
+ N() || Y(p);
296
326
  return;
297
327
  }
298
- const f = i.current.filter((g) => u - g.at <= $);
299
- f.push({ at: u, targets: l }), i.current = f.slice(-20);
328
+ const d = i.current.filter((k) => u - k.at <= W);
329
+ d.push({ at: u, targets: p }), i.current = d.slice(-20);
300
330
  });
301
- return o.observe(a, { subtree: !0, childList: !0, characterData: !0 }), () => {
302
- o.disconnect(), i.current = [];
331
+ return s.observe(a, { subtree: !0, childList: !0, characterData: !0 }), () => {
332
+ s.disconnect(), i.current = [];
303
333
  };
304
- }, [a, e]), y;
334
+ }, [a, e]), l;
305
335
  }
306
- function se(t, n = Date.now()) {
336
+ function ie(t, n = Date.now()) {
307
337
  if (!t) return null;
308
338
  const e = Math.max(0, Math.round((n - t) / 1e3));
309
339
  return e < 5 ? "Updated just now" : e < 60 ? `Updated ${e} s ago` : e < 3600 ? `Updated ${Math.round(e / 60)} min ago` : e < 86400 ? `Updated ${Math.round(e / 3600)} h ago` : `Updated ${Math.round(e / 86400)} d ago`;
310
340
  }
311
- function le(t, n) {
312
- const [e, s] = k(() => Date.now());
313
- return R(() => {
341
+ function ye(t, n) {
342
+ const [e, c] = g(() => Date.now());
343
+ return x(() => {
314
344
  if (!n) return;
315
- s(Date.now());
316
- const c = setInterval(() => s(Date.now()), 5e3);
317
- return () => clearInterval(c);
318
- }, [n]), se(t, e);
345
+ c(Date.now());
346
+ const o = setInterval(() => c(Date.now()), 5e3);
347
+ return () => clearInterval(o);
348
+ }, [n]), ie(t, e);
319
349
  }
320
350
  export {
321
- Q as NEW_ROW_FADE_MS,
322
- z as NEW_ROW_HOLD_MS,
323
- oe as fadeTargets,
324
- V as holdTopInserts,
325
- X as scrollParentOf,
326
- q as settleRows,
327
- de as slideIn,
328
- se as updatedAgoLabel,
329
- fe as useLiveFade,
330
- ue as useSettledRows,
331
- ae as useTopInserts,
332
- le as useUpdatedAgo
351
+ Z as NEW_ROW_FADE_MS,
352
+ P as NEW_ROW_HOLD_MS,
353
+ ce as fadeTargets,
354
+ G as holdTopInserts,
355
+ J as scrollParentOf,
356
+ X as settleRows,
357
+ le as slideIn,
358
+ B as stickyTopOffset,
359
+ ie as updatedAgoLabel,
360
+ pe as useLiveFade,
361
+ fe as useSettledRows,
362
+ de as useTopInserts,
363
+ ye as useUpdatedAgo
333
364
  };
@@ -1,9 +1,9 @@
1
1
  import { isRawErrorText as u } from "./safe-error.js";
2
- function $(t, e) {
2
+ function x(t, e) {
3
3
  const r = (t ?? "").trim(), n = (e ?? "").trim(), s = n && r.toLowerCase().startsWith(`${n.toLowerCase()}:`) ? r.slice(n.length + 1).trim() : r;
4
4
  return s ? s.charAt(0).toUpperCase() + s.slice(1) : "";
5
5
  }
6
- const d = /\bHTTP \d{3}: /, h = [
6
+ const d = /\bHTTP \d{3}: /, f = [
7
7
  "message",
8
8
  "error_description",
9
9
  "detail",
@@ -12,7 +12,7 @@ const d = /\bHTTP \d{3}: /, h = [
12
12
  "reason",
13
13
  "description",
14
14
  "msg"
15
- ], m = new RegExp(`"(?:${h.join("|")})"\\s*:\\s*"((?:[^"\\\\]|\\\\.)*)`);
15
+ ], m = new RegExp(`"(?:${f.join("|")})"\\s*:\\s*"((?:[^"\\\\]|\\\\.)*)`);
16
16
  function a(t) {
17
17
  try {
18
18
  return JSON.parse(`"${t.replace(/\\$/, "")}"`);
@@ -20,12 +20,12 @@ function a(t) {
20
20
  return t;
21
21
  }
22
22
  }
23
- function f(t, e = 0) {
23
+ function h(t, e = 0) {
24
24
  if (typeof t == "string") return t;
25
25
  if (!t || typeof t != "object" || Array.isArray(t) || e > 1) return null;
26
26
  const r = t;
27
- for (const n of h) {
28
- const s = f(r[n], e + 1);
27
+ for (const n of f) {
28
+ const s = h(r[n], e + 1);
29
29
  if (s != null && s.trim()) return s;
30
30
  }
31
31
  return null;
@@ -36,10 +36,10 @@ function p(t) {
36
36
  const r = t.slice(e.index + e[0].length).trim();
37
37
  let n = null, s = !1;
38
38
  try {
39
- n = f(JSON.parse(r));
39
+ n = h(JSON.parse(r));
40
40
  } catch {
41
41
  const i = m.exec(r);
42
- i ? (n = a(i[1]), s = r[i.index + i[0].length] !== '"') : r.startsWith('"') && (n = a(r.slice(1).replace(/"$/, "")), s = r.length < 2 || !r.endsWith('"'));
42
+ i ? (n = a(i[1]), s = r[i.index + i[0].length] !== '"') : r.startsWith('"') ? (n = a(r.slice(1).replace(/"$/, "")), s = r.length < 2 || !r.endsWith('"')) : /^[A-Za-z][^{}[\]<>]*$/.test(r) && (n = r);
43
43
  }
44
44
  const o = (n ?? "").replace(/\s+/g, " ").trim(), c = s || o.length > 300 ? `${o.slice(0, 299).trimEnd()}…` : o;
45
45
  if (o.length < 3 || /<[a-z!/]/i.test(o) || u(o)) return null;
@@ -66,9 +66,9 @@ function N(t) {
66
66
  const s = n.length > 300 ? `${n.slice(0, 299).trimEnd()}…` : n, o = r[1];
67
67
  return `${o.charAt(0).toUpperCase()}${o.slice(1).toLowerCase()}: ${s}`;
68
68
  }
69
- const b = /(?:^|: )submission failed\s+[—–-]\s/i;
69
+ const $ = /(?:^|: )submission failed\s+[—–-]\s/i;
70
70
  function S(t) {
71
- const e = b.exec(t);
71
+ const e = $.exec(t);
72
72
  if (!e) return null;
73
73
  const r = t.slice(e.index + (e[0].startsWith(": ") ? 2 : 0));
74
74
  return N(r.charAt(0).toUpperCase() + r.slice(1));
@@ -79,5 +79,5 @@ export {
79
79
  A as partnerOutcome,
80
80
  N as partnerSaid,
81
81
  p as partnerWords,
82
- $ as withoutMoveLabel
82
+ x as withoutMoveLabel
83
83
  };