@nivaro/react 0.3.117 → 0.3.119

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 (138) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +136 -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 +3757 -3695
  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 +4451 -4385
  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/ScreenRefreshButton.js +34 -32
  27. package/dist/shared/components/TipLayer.js +65 -58
  28. package/dist/shared/components/WidgetImageMenu.js +83 -43
  29. package/dist/shared/components/activity/RecordActivityStream.js +175 -173
  30. package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
  31. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
  32. package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
  33. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
  34. package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
  35. package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
  36. package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
  37. package/dist/shared/components/collections-directory/page-model.js +72 -67
  38. package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
  39. package/dist/shared/components/integrations/SendStatus.js +65 -59
  40. package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
  41. package/dist/shared/components/integrations/console/SignalCard.js +237 -230
  42. package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
  43. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +135 -94
  44. package/dist/shared/components/item-edit/CloneDialog.js +191 -161
  45. package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
  46. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
  47. package/dist/shared/components/item-edit/FieldComments.js +88 -85
  48. package/dist/shared/components/item-edit/FieldPointer.js +82 -67
  49. package/dist/shared/components/item-edit/FieldRow.js +106 -100
  50. package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
  51. package/dist/shared/components/item-edit/FilePickerField.js +452 -387
  52. package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
  53. package/dist/shared/components/item-edit/HeaderTools.js +245 -141
  54. package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
  55. package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
  56. package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
  57. package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
  58. package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
  59. package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
  60. package/dist/shared/components/item-edit/RecalcValue.js +57 -32
  61. package/dist/shared/components/item-edit/RecordHelpChip.js +15 -16
  62. package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
  63. package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
  64. package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
  65. package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
  66. package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
  67. package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
  68. package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
  69. package/dist/shared/components/item-edit/SectionPresence.js +18 -10
  70. package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
  71. package/dist/shared/components/item-edit/UserChip.js +1 -1
  72. package/dist/shared/components/item-edit/addendum-view.js +6 -0
  73. package/dist/shared/components/item-edit/file-live.js +69 -54
  74. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  75. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  76. package/dist/shared/components/item-edit/removed-line.js +31 -25
  77. package/dist/shared/components/layout-editor/pickers/field-picker.js +151 -130
  78. package/dist/shared/components/list/ListViewers.js +46 -35
  79. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  80. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  81. package/dist/shared/components/panels/AlertBanners.js +82 -72
  82. package/dist/shared/components/panels/BranchLanes.js +22 -22
  83. package/dist/shared/components/panels/CommentImages.js +123 -102
  84. package/dist/shared/components/panels/CommentPanel.js +186 -185
  85. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  86. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  87. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  88. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  89. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  90. package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
  91. package/dist/shared/components/profile/AgentNameField.js +107 -81
  92. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  93. package/dist/shared/components/profile/PersonAccess.js +599 -495
  94. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  95. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  96. package/dist/shared/components/profile/primitives.js +1 -1
  97. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  98. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  99. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  100. package/dist/shared/components/support/AssignRules.js +1733 -0
  101. package/dist/shared/components/support/PersonPick.js +88 -0
  102. package/dist/shared/components/support/RequestList.js +790 -0
  103. package/dist/shared/components/support/ScreenShare.js +158 -152
  104. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  105. package/dist/shared/components/support/SupportView.js +140 -246
  106. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  107. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  108. package/dist/shared/components/support/assign-rules-text.js +171 -0
  109. package/dist/shared/components/support/support-list.js +125 -0
  110. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  111. package/dist/shared/components/ui/checkbox.js +6 -6
  112. package/dist/shared/components/ui/select.js +43 -39
  113. package/dist/shared/components/ui/sheet.js +9 -9
  114. package/dist/shared/components/ui/switch.js +12 -11
  115. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  116. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  117. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  118. package/dist/shared/lib/activity-sentence.js +103 -91
  119. package/dist/shared/lib/agent-presence.js +27 -21
  120. package/dist/shared/lib/approval-progress.js +2 -2
  121. package/dist/shared/lib/copy-rules.js +31 -24
  122. package/dist/shared/lib/derived-causes.js +113 -78
  123. package/dist/shared/lib/grid-cursors.js +26 -26
  124. package/dist/shared/lib/label-flash.js +27 -0
  125. package/dist/shared/lib/list-return.js +137 -125
  126. package/dist/shared/lib/live-deltas.js +40 -34
  127. package/dist/shared/lib/live-groups.js +56 -52
  128. package/dist/shared/lib/live-preference.js +64 -59
  129. package/dist/shared/lib/live-screen.js +223 -192
  130. package/dist/shared/lib/partner-failure.js +11 -11
  131. package/dist/shared/lib/rollup-recalc.js +68 -64
  132. package/dist/shared/lib/screen-refresh.js +74 -68
  133. package/dist/shared/lib/screen-share.js +108 -104
  134. package/dist/shared/lib/send-status.js +77 -61
  135. package/dist/shared/lib/text-diff-window.js +29 -0
  136. package/dist/shared/lib/watch-list.js +210 -209
  137. package/dist/shared/lib/widget-image-render.js +72 -49
  138. package/package.json +1 -1
@@ -5,7 +5,7 @@ function M(e) {
5
5
  const o = (e.changes ?? []).filter((s) => s && i(s.label)).map((s) => `${i(s.label)} ${i(s.from) || "—"} → ${i(s.to) || "—"}`);
6
6
  return o.length ? `changed ${r}: ${o.join(", ")}` : `changed ${r}`;
7
7
  }
8
- const k = "a record you can't see", U = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, W = {
8
+ const k = "a record you can't see", z = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, W = {
9
9
  ai: "AI",
10
10
  api: "API",
11
11
  csv: "CSV",
@@ -35,21 +35,21 @@ function ie(e) {
35
35
  function F(e) {
36
36
  return e.split(/[\s_.:-]+/).map((n) => n.trim()).filter(Boolean);
37
37
  }
38
- function z(e) {
38
+ function U(e) {
39
39
  const n = e.toLowerCase();
40
40
  return W[n] ?? n;
41
41
  }
42
- function V(e) {
43
- const n = F(e).map(z).join(" ");
42
+ function G(e) {
43
+ const n = F(e).map(U).join(" ");
44
44
  return n ? n.charAt(0).toUpperCase() + n.slice(1) : "";
45
45
  }
46
- function O(e) {
46
+ function q(e) {
47
47
  return F(e).map((n) => W[n.toLowerCase()] ?? n.charAt(0).toUpperCase() + n.slice(1).toLowerCase()).join(" ");
48
48
  }
49
49
  function Q(e) {
50
50
  return /ies$/i.test(e) ? e.replace(/ies$/i, (n) => n === "IES" ? "Y" : "y") : /(ss|us|is)$/i.test(e) ? e : /(x|ch|sh|ss|us)es$/i.test(e) ? e.replace(/es$/i, "") : /s$/i.test(e) && e.length > 1 ? e.slice(0, -1) : e;
51
51
  }
52
- function D(e) {
52
+ function E(e) {
53
53
  return /[^aeiou]y$/i.test(e) ? e.replace(/y$/i, (n) => n === "Y" ? "IES" : "ies") : /(s|x|z|ch|sh)$/i.test(e) && !/^[A-Z0-9]+$/.test(e) ? `${e}es` : `${e}s`;
54
54
  }
55
55
  function g(e) {
@@ -132,15 +132,15 @@ function C(e, n) {
132
132
  if (!t) return { singular: "Record", plural: "Records" };
133
133
  const r = (l = n == null ? void 0 : n.collections) == null ? void 0 : l[t], o = typeof r == "string" ? { plural: r } : r ?? {}, s = i(o.plural), a = i(o.singular);
134
134
  if (a || s) {
135
- const f = a || y(s, Q), $ = s && s !== f ? s : y(f, D);
135
+ const f = a || A(s, Q), $ = s && s !== f ? s : A(f, E);
136
136
  return { singular: f, plural: $ };
137
137
  }
138
138
  const c = se[t];
139
- if (c) return { singular: c, plural: c === "Settings" ? c : y(c, D) };
140
- const u = O(t.replace(/^(nivaro|directus)_/, "")) || "Record", d = y(u, Q);
141
- return { singular: d, plural: y(d, D) };
139
+ if (c) return { singular: c, plural: c === "Settings" ? c : A(c, E) };
140
+ const u = q(t.replace(/^(nivaro|directus)_/, "")) || "Record", d = A(u, Q);
141
+ return { singular: d, plural: A(d, E) };
142
142
  }
143
- function y(e, n) {
143
+ function A(e, n) {
144
144
  const t = e.split(" ");
145
145
  return t[t.length - 1] = n(t[t.length - 1] ?? ""), t.join(" ");
146
146
  }
@@ -219,7 +219,7 @@ function Y(e) {
219
219
  name: i(e.origin) === "integration" ? "An integration" : null
220
220
  };
221
221
  }
222
- function G(e, n) {
222
+ function H(e, n) {
223
223
  const t = Y(e), r = ce(e, n), o = P(t.on_behalf_of, n) ?? r;
224
224
  switch (t.kind) {
225
225
  case "person":
@@ -250,47 +250,59 @@ function I(e, n, t) {
250
250
  const u = s[o];
251
251
  if (u == null) return c ? N(a) : k;
252
252
  const d = i(u);
253
- return d ? c && (d === r || U.test(d)) ? N(a) : d.toLowerCase().startsWith(a.toLowerCase()) ? d : `${a} ${d}` : c ? N(a) : a;
253
+ return d ? c && (d === r || z.test(d)) ? N(a) : d.toLowerCase().startsWith(a.toLowerCase()) ? d : `${a} ${d}` : c ? N(a) : a;
254
254
  }
255
- return c || U.test(r) ? N(a) : `${a} ${r}`;
255
+ return c || z.test(r) ? N(a) : `${a} ${r}`;
256
256
  }
257
257
  function Z(e, n, t) {
258
258
  var o;
259
259
  const r = (o = t == null ? void 0 : t.fields) == null ? void 0 : o[`${e ?? ""}.${n}`];
260
- return i(r) || O(n);
260
+ return i(r) || q(n);
261
261
  }
262
- function q(e, n, t) {
262
+ function T(e, n, t) {
263
263
  const r = [...new Set(n)].map((o) => Z(e, o, t));
264
264
  return r.length === 0 ? "" : r.length === 1 ? r[0] : r.length <= 3 ? `${r.slice(0, -1).join(", ")} and ${r[r.length - 1]}` : `${r.slice(0, 2).join(", ")} and ${r.length - 2} other fields`;
265
265
  }
266
266
  function le(e) {
267
267
  const n = String(e ?? "");
268
- return n.startsWith("$t:") ? O(n.slice(3).replace(/-/g, "_")) : n;
268
+ return n.startsWith("$t:") ? q(n.slice(3).replace(/-/g, "_")) : n;
269
+ }
270
+ const pe = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/, fe = /^\d{4}-\d{2}-\d{2}$/, me = /<\/?[a-z][a-z0-9]*(\s[^>]*)?\/?>/i, $e = {
271
+ "&nbsp;": " ",
272
+ "&amp;": "&",
273
+ "&lt;": "<",
274
+ "&gt;": ">",
275
+ "&quot;": '"',
276
+ "&#39;": "'"
277
+ };
278
+ function _e(e) {
279
+ return e.replace(/<(script|style|template)\b[\s\S]*?<\/\1>/gi, " ").replace(/<[^>]+>/g, " ").replace(/&(nbsp|amp|lt|gt|quot|#39);/g, (n) => $e[n] ?? n).replace(/\s+/g, " ").trim();
269
280
  }
270
- const pe = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/, fe = /^\d{4}-\d{2}-\d{2}$/;
271
- function H(e, n, t, r) {
272
- var a, c;
281
+ function V(e, n, t, r) {
282
+ var c, u;
273
283
  if (t == null || t === "") return "empty";
274
284
  if (typeof t == "boolean") return t ? "Yes" : "No";
275
285
  if (typeof t == "object")
276
286
  return Array.isArray(t) ? `${t.length} items` : "a new value";
277
- const o = String(t), s = (c = (a = r == null ? void 0 : r.choices) == null ? void 0 : a[`${e ?? ""}.${n}`]) == null ? void 0 : c[o];
278
- if (s) return le(s);
279
- if (fe.test(o)) return o;
280
- if (pe.test(o)) {
281
- const u = new Date(o);
282
- if (!Number.isNaN(u.getTime()))
287
+ const o = String(t), s = me.test(o) ? _e(o) : o;
288
+ if (!s) return "empty";
289
+ const a = (u = (c = r == null ? void 0 : r.choices) == null ? void 0 : c[`${e ?? ""}.${n}`]) == null ? void 0 : u[s];
290
+ if (a) return le(a);
291
+ if (fe.test(s)) return s;
292
+ if (pe.test(s)) {
293
+ const d = new Date(s);
294
+ if (!Number.isNaN(d.getTime()))
283
295
  try {
284
- return u.toLocaleString(void 0, {
296
+ return d.toLocaleString(void 0, {
285
297
  dateStyle: "medium",
286
298
  timeStyle: "short",
287
299
  ...r != null && r.timeZone ? { timeZone: r.timeZone } : {}
288
300
  });
289
301
  } catch {
290
- return u.toLocaleString();
302
+ return d.toLocaleString();
291
303
  }
292
304
  }
293
- return o.length > 60 ? `${o.slice(0, 57)}…` : o;
305
+ return s.length > 60 ? `${s.slice(0, 57)}…` : s;
294
306
  }
295
307
  function X(e, n, t, r) {
296
308
  var s;
@@ -441,7 +453,7 @@ const b = {
441
453
  updated: "updated",
442
454
  upload: "uploaded",
443
455
  view: "viewed"
444
- }, me = /* @__PURE__ */ new Set([
456
+ }, ve = /* @__PURE__ */ new Set([
445
457
  "add",
446
458
  "build",
447
459
  "create",
@@ -464,14 +476,14 @@ function ee(e) {
464
476
  if (b[t]) r = n.length - 1;
465
477
  else if (b[n[0]]) r = 0;
466
478
  else for (let a = n.length - 1; a >= 0; a--) b[n[a]] && (r = a);
467
- if (r < 0) return { verb: null, past: null, noun: n.map(z).join(" ") };
479
+ if (r < 0) return { verb: null, past: null, noun: n.map(U).join(" ") };
468
480
  const o = n[r], s = [...n.slice(0, r), ...n.slice(r + 1)];
469
- return { verb: o, past: b[o], noun: s.map(z).join(" ") };
481
+ return { verb: o, past: b[o], noun: s.map(U).join(" ") };
470
482
  }
471
- function $e(e, n) {
472
- return n ? /s$/.test(n) && !/ss$/.test(n) ? n : e && me.has(e) ? `${/^[aeiou]/i.test(n) ? "an" : "a"} ${n}` : `the ${n}` : "";
483
+ function he(e, n) {
484
+ return n ? /s$/.test(n) && !/ss$/.test(n) ? n : e && ve.has(e) ? `${/^[aeiou]/i.test(n) ? "an" : "a"} ${n}` : `the ${n}` : "";
473
485
  }
474
- function _e(e) {
486
+ function ge(e) {
475
487
  const n = /(\d[\d,]*)\s+rows?/i.exec(e), t = /^\s*(csv|xlsx|json|pdf|xml)\b/i.exec(e);
476
488
  return {
477
489
  rows: n ? Number(n[1].replace(/,/g, "")) : null,
@@ -492,15 +504,15 @@ function te(e, n) {
492
504
  const o = I(e.parent_collection, e.parent_id, n);
493
505
  return !o || o === k ? r : o;
494
506
  }
495
- function E(e) {
507
+ function D(e) {
496
508
  const n = i(e.value);
497
509
  return n ? `${e.noun} ${n}` : ne(e.noun);
498
510
  }
499
511
  function re(e, n, t) {
500
512
  const r = te(n, t);
501
- return e === "create" ? `added ${E(n)} to ${r}` : e === "delete" ? `removed ${E(n)} from ${r}` : `updated ${E(n)} on ${r}`;
513
+ return e === "create" ? `added ${D(n)} to ${r}` : e === "delete" ? `removed ${D(n)} from ${r}` : `updated ${D(n)} on ${r}`;
502
514
  }
503
- function ve(e, n) {
515
+ function ke(e, n) {
504
516
  var l;
505
517
  const t = e.map((f) => ({ e: f, j: S(f, n) }));
506
518
  if (t.length === 0 || t.some((f) => !f.j)) return null;
@@ -523,11 +535,11 @@ function ve(e, n) {
523
535
  }
524
536
  return { parent: te(s, n), pairs: u, rest: d };
525
537
  }
526
- function he(e) {
538
+ function we(e) {
527
539
  return e.from && e.to ? `${e.noun} ${e.from} → ${e.to}` : e.to ? `${e.noun} set to ${e.to}` : `changed ${e.noun}`;
528
540
  }
529
- function ge(e, n) {
530
- const t = ve(e, n);
541
+ function Se(e, n) {
542
+ const t = ke(e, n);
531
543
  if (!t) return null;
532
544
  const { parent: r, pairs: o, rest: s } = t;
533
545
  if (s.length === 0 && o.length === 1) {
@@ -538,15 +550,15 @@ function ge(e, n) {
538
550
  const a = e[0];
539
551
  return re(i(a.action), S(a, n), n);
540
552
  }
541
- return `changed ${r}: ${[...o.map(he), ...s].join("; ")}`;
553
+ return `changed ${r}: ${[...o.map(we), ...s].join("; ")}`;
542
554
  }
543
555
  const K = /* @__PURE__ */ new Set(["transition", "pipeline-transition"]);
544
- function be(e) {
556
+ function Ne(e) {
545
557
  const n = i(e).toLowerCase();
546
558
  return /approv/.test(n) ? "Approved" : /reject/.test(n) ? "Rejected" : /declin/.test(n) ? "Declined" : /send.?back|return/.test(n) ? "Sent back" : /submit/.test(n) ? "Submitted" : /cancel/.test(n) ? "Cancelled" : "Moved";
547
559
  }
548
- function ke(e, n) {
549
- var $, _, h, v, A;
560
+ function ye(e, n) {
561
+ var $, _, h, v, y;
550
562
  const t = i(e.action), r = e.collection ?? null, o = I(r, e.item, n), s = C(r, n), a = `${/^[aeiou]/i.test(s.singular) ? "an" : "a"} ${g(s.singular)}`, c = i(e.comment), u = o ? ` on ${o}` : "", d = S(e, n);
551
563
  if (d && (t === "create" || t === "delete" || t === "update"))
552
564
  return re(t, d, n);
@@ -572,14 +584,14 @@ function ke(e, n) {
572
584
  return e.o2m ? `${M(e.o2m)}${u}` : `changed related rows${u}`;
573
585
  const p = B(e);
574
586
  if (r === "nivaro_settings")
575
- return p.length ? `changed the ${q(r, p, n)} setting${p.length === 1 ? "" : "s"}` : "changed the settings";
587
+ return p.length ? `changed the ${T(r, p, n)} setting${p.length === 1 ? "" : "s"}` : "changed the settings";
576
588
  if (r === "nivaro_approval_instances" && ((v = e.why) != null && v.approval)) {
577
589
  const m = e.why.approval, w = I(m.collection, m.item, n);
578
590
  return `${(b[i(m.decision).toLowerCase()] ?? i(m.decision).toLowerCase()) || "decided on"} ${w ?? o ?? "an approval"}${m.chain ? ` (${m.chain})` : ""}`;
579
591
  }
580
592
  if (p.length) {
581
- const m = ((A = e.changes) == null ? void 0 : A.length) === 1 ? e.changes[0] : null;
582
- return m && "value" in m && X(r, m.field, m.value, n) ? `set ${Z(r, m.field, n)} to ${H(r, m.field, m.value, n)}${u}` : `changed ${q(r, p, n)}${u}`;
593
+ const m = ((y = e.changes) == null ? void 0 : y.length) === 1 ? e.changes[0] : null;
594
+ return m && "value" in m && X(r, m.field, m.value, n) ? `set ${Z(r, m.field, n)} to ${V(r, m.field, m.value, n)}${u}` : `changed ${T(r, p, n)}${u}`;
583
595
  }
584
596
  return `updated ${o ?? a}`;
585
597
  }
@@ -601,7 +613,7 @@ function ke(e, n) {
601
613
  case "sign-in-failed":
602
614
  return o && o !== k ? `had a sign-in as ${o} fail` : "had a sign-in fail";
603
615
  case "export": {
604
- const p = _e(c);
616
+ const p = ge(c);
605
617
  return `exported ${p.rows != null ? L(p.rows, r, n) : g(s.plural)}${p.format ? ` to ${p.format}` : ""}`;
606
618
  }
607
619
  case "masquerade-start":
@@ -639,8 +651,8 @@ function ke(e, n) {
639
651
  case "file-download": {
640
652
  let p = "", m = !1;
641
653
  try {
642
- const T = JSON.parse(c);
643
- p = typeof T.name == "string" ? T.name : "", m = T.kind === "open";
654
+ const O = JSON.parse(c);
655
+ p = typeof O.name == "string" ? O.name : "", m = O.kind === "open";
644
656
  } catch {
645
657
  }
646
658
  const w = p ? `“${p}”` : "a file";
@@ -671,26 +683,26 @@ function ke(e, n) {
671
683
  }
672
684
  if (!t) return `did something${u}`;
673
685
  const l = ee(t);
674
- return /settings$/.test(l.noun) && !l.verb ? `changed the ${l.noun}` : l.past ? o && l.noun && g(s.singular).toLowerCase().includes(l.noun.toLowerCase()) ? `${l.past} ${o}` : l.noun ? `${l.past} ${$e(l.verb, l.noun)}${u}` : `${l.past} ${o ?? "something"}` : `recorded “${V(t)}”${u}`;
686
+ return /settings$/.test(l.noun) && !l.verb ? `changed the ${l.noun}` : l.past ? o && l.noun && g(s.singular).toLowerCase().includes(l.noun.toLowerCase()) ? `${l.past} ${o}` : l.noun ? `${l.past} ${he(l.verb, l.noun)}${u}` : `${l.past} ${o ?? "something"}` : `recorded “${G(t)}”${u}`;
675
687
  }
676
688
  function x(e, n, t) {
677
689
  const r = i(e.item), o = P(r, n) ?? (t || null);
678
690
  if (o) return o;
679
691
  const s = e.collection === "nivaro_users" ? I(e.collection, e.item, n) : null;
680
- return s && !U.test(r) ? s : "someone";
692
+ return s && !z.test(r) ? s : "someone";
681
693
  }
682
- function we(e, n) {
683
- return `${G(e, n)} ${ke(e, n)}`;
694
+ function Ae(e, n) {
695
+ return `${H(e, n)} ${ye(e, n)}`;
684
696
  }
685
- function Ie(e) {
697
+ function Re(e) {
686
698
  var c, u, d, l;
687
699
  const n = i(e.action), t = i(e.comment);
688
700
  let r = i((c = e.why) == null ? void 0 : c.reason) || null, o = i((u = e.why) == null ? void 0 : u.note) || null;
689
701
  !o && K.has(n) && !e.event && (o = J(t).note), !o && ((d = e.event) == null ? void 0 : d.kind) === "transition" && t && (o = t), !r && (n === "create" || n === "update" || n === "delete") && t && !/^import:/i.test(t) && (r = t);
690
- const s = (l = e.why) == null ? void 0 : l.approval, a = s ? `${O(i(s.decision)) || "Decided"}${s.chain ? ` · ${s.chain}` : ""}${s.step != null && s.step !== "" ? ` · step ${s.step}` : ""}${i(s.comment) ? ` — “${i(s.comment)}”` : ""}` : null;
702
+ const s = (l = e.why) == null ? void 0 : l.approval, a = s ? `${q(i(s.decision)) || "Decided"}${s.chain ? ` · ${s.chain}` : ""}${s.step != null && s.step !== "" ? ` · step ${s.step}` : ""}${i(s.comment) ? ` — “${i(s.comment)}”` : ""}` : null;
691
703
  return { reason: r, note: o, approval: a };
692
704
  }
693
- const Se = 6e4, Ae = 5e3;
705
+ const xe = 6e4, be = 5e3;
694
706
  function R(e) {
695
707
  return e.timestamp ? new Date(e.timestamp).getTime() : Number.NaN;
696
708
  }
@@ -698,17 +710,17 @@ function j(e) {
698
710
  const n = Y(e);
699
711
  return `${n.kind}|${i(n.id)}|${i(e.user ?? e.user_id).toUpperCase()}`;
700
712
  }
701
- function ye(e) {
713
+ function Ie(e) {
702
714
  const n = i(e.action);
703
715
  return !i(e.item) && (n.startsWith("bulk-") || n === "import-complete");
704
716
  }
705
- function Ce(e, n = {}) {
706
- const t = n.windowMs ?? Se, r = [], o = (s, a) => s.parent_collection === a.parent_collection && (!i(s.parent_id) || !i(a.parent_id) || i(s.parent_id) === i(a.parent_id));
717
+ function je(e, n = {}) {
718
+ const t = n.windowMs ?? xe, r = [], o = (s, a) => s.parent_collection === a.parent_collection && (!i(s.parent_id) || !i(a.parent_id) || i(s.parent_id) === i(a.parent_id));
707
719
  for (const s of e) {
708
720
  const a = r[r.length - 1], c = a == null ? void 0 : a.entries[a.entries.length - 1], u = i(s.group_key);
709
721
  if (a && c && n.labels) {
710
722
  const d = S(s, n.labels), l = S(c, n.labels);
711
- if (d && l && a.entries.every((f) => S(f, n.labels)) && o(d, l) && j(s) === j(c) && Math.abs(R(c) - R(s)) <= Ae) {
723
+ if (d && l && a.entries.every((f) => S(f, n.labels)) && o(d, l) && j(s) === j(c) && Math.abs(R(c) - R(s)) <= be) {
712
724
  a.entries.push(s), a.by !== "group_key" && (a.by = "time");
713
725
  continue;
714
726
  }
@@ -728,11 +740,11 @@ function Ce(e, n = {}) {
728
740
  }
729
741
  return r;
730
742
  }
731
- function Ne(e, n) {
743
+ function Le(e, n) {
732
744
  if (e.length === 0) return "";
733
- const t = e.filter((v) => !ye(v)), r = t[0] ?? e[0];
734
- if (t.length <= 1) return we(r, n);
735
- const o = G(r, n), s = ge(t, n);
745
+ const t = e.filter((v) => !Ie(v)), r = t[0] ?? e[0];
746
+ if (t.length <= 1) return Ae(r, n);
747
+ const o = H(r, n), s = Se(t, n);
736
748
  if (s) return `${o} ${s}`;
737
749
  const c = new Set(t.map((v) => i(v.collection))).size === 1 ? r.collection ?? null : null, u = new Set(t.map((v) => i(v.item))), d = u.size > 1 ? u.size : t.length, l = c ? u.size === 1 && i(r.item) ? I(c, r.item, n) ?? L(d, c, n) : L(d, c, n) : `${d} records`, f = u.size === 1 && t.length > 1 ? ` ${t.length} times` : "", $ = new Set(
738
750
  t.map((v) => K.has(i(v.action)) ? "transition" : i(v.action))
@@ -745,11 +757,11 @@ function Ne(e, n) {
745
757
  var m;
746
758
  return i(((m = p.event) == null ? void 0 : m.to_label) ?? J(p.comment).to);
747
759
  })
748
- ), A = v.size === 1 ? [...v][0] : "";
749
- return `${o} moved ${l}${A ? ` to ${A}` : ""}${f}`;
760
+ ), y = v.size === 1 ? [...v][0] : "";
761
+ return `${o} moved ${l}${y ? ` to ${y}` : ""}${f}`;
750
762
  }
751
763
  if (_ === "update") {
752
- const v = xe(t, c, n);
764
+ const v = Ce(t, c, n);
753
765
  return `${o} updated ${l}${f}${v ? `: ${v}` : ""}`;
754
766
  }
755
767
  if (_ === "create") return `${o} created ${l}`;
@@ -757,24 +769,24 @@ function Ne(e, n) {
757
769
  if (_ === "picker-exclude") return `${o} hid ${l} from pickers${f}`;
758
770
  if (_ === "picker-include") return `${o} showed ${l} in pickers again${f}`;
759
771
  const h = ee(_);
760
- return h.past ? `${o} ${h.past} ${l}${h.noun && !g(C(c, n).plural).toLowerCase().includes(h.noun) ? ` (${h.noun})` : ""}${f}` : `${o} recorded “${V(_)}” on ${l}`;
772
+ return h.past ? `${o} ${h.past} ${l}${h.noun && !g(C(c, n).plural).toLowerCase().includes(h.noun) ? ` (${h.noun})` : ""}${f}` : `${o} recorded “${G(_)}” on ${l}`;
761
773
  }
762
- function xe(e, n, t) {
774
+ function Ce(e, n, t) {
763
775
  var c;
764
776
  const r = ((c = e[0]) == null ? void 0 : c.changes) ?? null;
765
777
  if (!(r != null && r.length)) {
766
778
  const u = e.map((d) => B(d).sort().join(","));
767
- return u[0] && u.every((d) => d === u[0]) ? q(n, u[0].split(","), t) : "";
779
+ return u[0] && u.every((d) => d === u[0]) ? T(n, u[0].split(","), t) : "";
768
780
  }
769
781
  const o = (u) => JSON.stringify((u.changes ?? []).map((d) => [d.field, d.value ?? null]).sort());
770
782
  if (e.every((u) => o(u) === o(e[0])) && r.length <= 2 && r.every((u) => X(n, u.field, u.value, t)))
771
783
  return r.map(
772
- (u) => `${Z(n, u.field, t)} → ${H(n, u.field, u.value, t)}`
784
+ (u) => `${Z(n, u.field, t)} → ${V(n, u.field, u.value, t)}`
773
785
  ).join(", ");
774
786
  const a = new Set(e.flatMap((u) => (u.changes ?? []).map((d) => d.field)));
775
- return q(n, [...a], t);
787
+ return T(n, [...a], t);
776
788
  }
777
- function Re(e) {
789
+ function Pe(e) {
778
790
  var a;
779
791
  const n = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), s = (c, u) => {
780
792
  const d = i(c), l = i(u);
@@ -798,33 +810,33 @@ function Re(e) {
798
810
  };
799
811
  }
800
812
  export {
801
- Se as BURST_WINDOW_MS,
813
+ xe as BURST_WINDOW_MS,
802
814
  k as HIDDEN_RECORD,
803
- Ae as LINK_WRITE_WINDOW_MS,
815
+ be as LINK_WRITE_WINDOW_MS,
804
816
  ee as actionParts,
805
- Re as activityLabelRefs,
806
- ke as activityPredicate,
807
- Ie as activityWhy,
808
- G as actorName,
817
+ Pe as activityLabelRefs,
818
+ ye as activityPredicate,
819
+ Re as activityWhy,
820
+ H as actorName,
809
821
  Y as actorOf,
810
822
  le as choiceText,
811
823
  C as collectionNouns,
812
824
  L as countNoun,
813
825
  Z as fieldLabel,
814
- q as fieldList,
815
- Ce as groupActivity,
826
+ T as fieldList,
827
+ je as groupActivity,
816
828
  S as junctionOf,
817
- ve as linkChanges,
818
- ge as linkGroupPredicate,
819
- he as linkPairText,
829
+ ke as linkChanges,
830
+ Se as linkGroupPredicate,
831
+ we as linkPairText,
820
832
  M as o2mSentence,
821
833
  de as parseActor,
822
834
  J as parseTransitionComment,
823
- V as readableTitle,
835
+ G as readableTitle,
824
836
  I as recordPhrase,
825
- Ne as renderActivityGroupSentence,
826
- we as renderActivitySentence,
827
- be as transitionVerb,
837
+ Le as renderActivityGroupSentence,
838
+ Ae as renderActivitySentence,
839
+ Ne as transitionVerb,
828
840
  X as valueShowable,
829
- H as valueText
841
+ V as valueText
830
842
  };
@@ -1,46 +1,52 @@
1
- import { useState as g, useEffect as f, useMemo as l } from "react";
2
- import { useLiveEvent as y } from "./live.js";
3
- import { useLivePreference as h } from "./live-preference.js";
4
- const c = (t, i) => typeof t == "string" ? t.slice(0, i) : "";
5
- function p(t, i) {
1
+ import { useState as g, useEffect as a, useMemo as l } from "react";
2
+ import { useLiveEvent as p } from "./live.js";
3
+ import { useLivePreference as y } from "./live-preference.js";
4
+ const c = (t, o) => typeof t == "string" ? t.slice(0, o) : "";
5
+ function h(t, o) {
6
6
  var m, s;
7
7
  if (!Array.isArray(t)) return [];
8
8
  const r = [];
9
9
  for (const e of t) {
10
- const o = c(e == null ? void 0 : e.key, 40), n = c(e == null ? void 0 : e.name, 60), u = Number(e == null ? void 0 : e.ttl_ms);
11
- !o || !n || !Number.isFinite(u) || u <= 0 || r.push({
12
- key: o,
10
+ const i = c(e == null ? void 0 : e.key, 40), n = c(e == null ? void 0 : e.name, 60), u = Number(e == null ? void 0 : e.ttl_ms);
11
+ !i || !n || !Number.isFinite(u) || u <= 0 || r.push({
12
+ key: i,
13
13
  name: n,
14
14
  for: { id: c((m = e == null ? void 0 : e.for) == null ? void 0 : m.id, 64), name: c((s = e == null ? void 0 : e.for) == null ? void 0 : s.name, 80) },
15
15
  mode: (e == null ? void 0 : e.mode) === "updating" ? "updating" : "reading",
16
- until: i + Math.min(u, 6e4)
16
+ until: o + Math.min(u, 6e4)
17
17
  });
18
18
  }
19
19
  return r.sort(
20
- (e, o) => (e.mode === o.mode ? 0 : e.mode === "updating" ? -1 : 1) || e.name.localeCompare(o.name) || e.key.localeCompare(o.key)
20
+ (e, i) => (e.mode === i.mode ? 0 : e.mode === "updating" ? -1 : 1) || e.name.localeCompare(i.name) || e.key.localeCompare(i.key)
21
21
  );
22
22
  }
23
- function A(t, i, r = !1) {
24
- const s = !!i && !!t.for.id && t.for.id.toUpperCase() === String(i).toUpperCase() ? "you" : t.for.name || "someone", e = t.mode === "updating" ? "is updating" : "is reading";
23
+ function k(t, o, r = !1) {
24
+ const s = !!o && !!t.for.id && t.for.id.toUpperCase() === String(o).toUpperCase() ? "you" : t.for.name || "someone", e = t.mode === "updating" ? "is updating" : "is reading";
25
25
  return r ? `${t.name} ${e}` : `${t.name} (for ${s}) ${e} this record`;
26
26
  }
27
- function C(t, i) {
28
- const r = i == null ? "" : String(i), { quiet: m } = h(), s = !!t && !!r && r !== "new" && !m, [e, o] = g([]);
29
- return f(() => o([]), [t, r, s]), y("record:agents", (n) => o(p(n == null ? void 0 : n.agents, Date.now())), {
27
+ function x(t, o) {
28
+ if (!!o && !!t.for.id && t.for.id.toUpperCase() === String(o).toUpperCase()) return "Your";
29
+ const m = (t.for.name ?? "").trim().split(/\s+/)[0];
30
+ return m ? `${m}’s` : null;
31
+ }
32
+ function A(t, o) {
33
+ const r = o == null ? "" : String(o), { quiet: m } = y(), s = !!t && !!r && r !== "new" && !m, [e, i] = g([]);
34
+ return a(() => i([]), [t, r, s]), p("record:agents", (n) => i(h(n == null ? void 0 : n.agents, Date.now())), {
30
35
  enabled: s,
31
36
  includeOwn: !0,
32
37
  match: (n) => (n == null ? void 0 : n.collection) === t && String(n == null ? void 0 : n.item) === r
33
- }), f(() => {
38
+ }), a(() => {
34
39
  if (e.length === 0) return;
35
- const n = Math.min(...e.map((a) => a.until)), u = setTimeout(
36
- () => o((a) => a.filter((d) => d.until > Date.now())),
40
+ const n = Math.min(...e.map((f) => f.until)), u = setTimeout(
41
+ () => i((f) => f.filter((d) => d.until > Date.now())),
37
42
  Math.max(250, n - Date.now() + 50)
38
43
  );
39
44
  return () => clearTimeout(u);
40
45
  }, [e]), l(() => s ? e : [], [e, s]);
41
46
  }
42
47
  export {
43
- A as agentSentence,
44
- p as agentsFromPayload,
45
- C as useRecordAgents
48
+ x as agentOwnerPrefix,
49
+ k as agentSentence,
50
+ h as agentsFromPayload,
51
+ A as useRecordAgents
46
52
  };
@@ -1,4 +1,4 @@
1
- import { atClock as c } from "./send-status.js";
1
+ import { atWhen as c } from "./send-status.js";
2
2
  function d(t) {
3
3
  const e = [...new Set(t.map((n) => n.trim()).filter(Boolean))];
4
4
  return e.length <= 3 ? e.join(", ") : `${e.slice(0, 3).join(", ")} and ${e.length - 3} more`;
@@ -40,7 +40,7 @@ function $(t) {
40
40
  const n = t.history.filter((r) => r.from_state === t.stateId).sort((r, s) => new Date(s.timestamp).getTime() - new Date(r.timestamp).getTime())[0];
41
41
  if (!n) return null;
42
42
  const i = f(n), o = c(n.timestamp, e), a = b(n.transition_label);
43
- return a ? { kind: "done", text: `${a}${i ? ` by ${i}` : ""}${o ? ` at ${o}` : ""}` } : { kind: "done", text: `${((l = n.transition_label) == null ? void 0 : l.trim()) || "Moved on"}${i ? ` — ${i}` : ""}${o ? ` at ${o}` : ""}` };
43
+ return a ? { kind: "done", text: `${a}${i ? ` by ${i}` : ""}${o ? ` ${o}` : ""}` } : { kind: "done", text: `${((l = n.transition_label) == null ? void 0 : l.trim()) || "Moved on"}${i ? ` — ${i}` : ""}${o ? ` ${o}` : ""}` };
44
44
  }
45
45
  export {
46
46
  $ as chainStepText,
@@ -1,5 +1,5 @@
1
- import { get as f } from "./commands.js";
2
- const u = [
1
+ import { get as y } from "./commands.js";
2
+ const p = [
3
3
  ["pipeline-state", "Workflow step"],
4
4
  ["never-copy", "On this collection’s list"],
5
5
  ["do-not-duplicate", "Marked “do not duplicate”"],
@@ -11,33 +11,39 @@ const u = [
11
11
  ["hidden", "Hidden"],
12
12
  ["audit", "Stamps"]
13
13
  ];
14
- function y(t) {
14
+ function d(t) {
15
15
  return t.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/_/g, " ").replace(/\s+/g, " ").trim().replace(/\b\w/g, (e) => e.toUpperCase());
16
16
  }
17
+ function b(t) {
18
+ return t.replace(/\b[a-z][a-z0-9]*(?:_[a-z0-9]+)+\b/g, (e) => d(e));
19
+ }
17
20
  function g(t, e) {
18
- var o, a, s;
19
- const l = new Map(e.map((n) => [n.field, n])), i = /* @__PURE__ */ new Map();
20
- for (const [n, r] of u)
21
- i.has(r) || i.set(r, { reason: n, label: r, fields: [] });
22
- for (const [n, r] of Object.entries(t ?? {})) {
23
- const c = l.get(n);
24
- if (!c || r === "list" || r === "audit") continue;
25
- const p = (o = u.find(([d]) => d === r)) == null ? void 0 : o[1];
26
- p && ((s = i.get(p)) == null || s.fields.push({ field: n, label: ((a = c.label) == null ? void 0 : a.trim()) || y(n) }));
21
+ var o, s, c;
22
+ const l = new Map(e.map((n) => [n.field, n])), r = /* @__PURE__ */ new Map();
23
+ for (const [n, i] of p)
24
+ r.has(i) || r.set(i, { reason: n, label: i, fields: [] });
25
+ for (const [n, i] of Object.entries(t ?? {})) {
26
+ const a = l.get(n);
27
+ if (!a || i === "list" || i === "audit") continue;
28
+ const u = (o = p.find(([f]) => f === i)) == null ? void 0 : o[1];
29
+ u && ((c = r.get(u)) == null || c.fields.push({
30
+ field: n,
31
+ label: (s = a.label) != null && s.trim() ? b(a.label.trim()) : d(n)
32
+ }));
27
33
  }
28
- return [...i.values()].filter((n) => n.fields.length > 0);
34
+ return [...r.values()].filter((n) => n.fields.length > 0);
29
35
  }
30
- function b(t) {
36
+ function w(t) {
31
37
  return new Set(
32
38
  Object.entries(t ?? {}).filter(([, e]) => e !== "hidden" && e !== "list").map(([e]) => e)
33
39
  );
34
40
  }
35
- function w(t) {
41
+ function S(t) {
36
42
  return new Set(
37
43
  Object.entries(t ?? {}).filter(([, e]) => e !== "rollup").map(([e]) => e)
38
44
  );
39
45
  }
40
- async function S(t, e, l) {
46
+ async function C(t, e, l) {
41
47
  try {
42
48
  return await e.fetchQuery(h(t, l));
43
49
  } catch {
@@ -47,19 +53,20 @@ async function S(t, e, l) {
47
53
  function h(t, e) {
48
54
  return {
49
55
  queryKey: ["copy-rules", e],
50
- queryFn: () => t.request(f(`/copy-rules/${e}`)).then((l) => {
51
- var i;
52
- return ((i = l == null ? void 0 : l.data) == null ? void 0 : i.skip) ?? {};
56
+ queryFn: () => t.request(y(`/copy-rules/${e}`)).then((l) => {
57
+ var r;
58
+ return ((r = l == null ? void 0 : l.data) == null ? void 0 : r.skip) ?? {};
53
59
  }),
54
60
  staleTime: 6e4
55
61
  };
56
62
  }
57
63
  export {
58
- u as COPY_REASON_WORDS,
59
- b as childCopySkip,
64
+ p as COPY_REASON_WORDS,
65
+ w as childCopySkip,
60
66
  h as copyRulesQuery,
61
- S as fetchCopySkip,
62
- y as fieldTitle,
67
+ C as fetchCopySkip,
68
+ d as fieldTitle,
63
69
  g as groupNeverCopied,
64
- w as headerCopySkip
70
+ S as headerCopySkip,
71
+ b as readableLabel
65
72
  };