@nivaro/react 0.3.139 → 0.3.140

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 (87) hide show
  1. package/dist/components/InlineGridField.js +95 -92
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +36 -2
  4. package/dist/shared/components/AudienceConfirmPanel.js +19 -19
  5. package/dist/shared/components/BroadcastView.js +213 -211
  6. package/dist/shared/components/CollectionBrowserView.js +2677 -2658
  7. package/dist/shared/components/ConfigHistory.js +45 -45
  8. package/dist/shared/components/ConformanceView.js +110 -110
  9. package/dist/shared/components/DataTable.js +51 -51
  10. package/dist/shared/components/FilePreviewLightbox.js +26 -25
  11. package/dist/shared/components/ItemEditForm.js +3038 -3027
  12. package/dist/shared/components/LiveCount.js +27 -23
  13. package/dist/shared/components/LiveTraceView.js +62 -61
  14. package/dist/shared/components/PageRenderer.js +422 -410
  15. package/dist/shared/components/ProfileView.js +199 -199
  16. package/dist/shared/components/QualityRulesView.js +70 -70
  17. package/dist/shared/components/QueryTable.js +131 -130
  18. package/dist/shared/components/RecordGraph.js +98 -98
  19. package/dist/shared/components/RecordReadView.js +287 -288
  20. package/dist/shared/components/ReportView.js +1279 -1259
  21. package/dist/shared/components/SlaRulesView.js +73 -74
  22. package/dist/shared/components/WidgetSlot.js +73 -73
  23. package/dist/shared/components/ai/AiChart.js +36 -32
  24. package/dist/shared/components/ai/AiMarkdown.js +136 -129
  25. package/dist/shared/components/ai/TaskDo.js +87 -87
  26. package/dist/shared/components/ai/answer-formats.js +37 -30
  27. package/dist/shared/components/ai/call-log/format.js +17 -16
  28. package/dist/shared/components/bulk/BulkActionButtons.js +66 -66
  29. package/dist/shared/components/bulk/BulkFieldUpdate.js +59 -59
  30. package/dist/shared/components/bulk/BulkSelectionNotices.js +34 -34
  31. package/dist/shared/components/bulk/MessageStakeholders.js +31 -29
  32. package/dist/shared/components/bulk/PushBulkButtons.js +83 -82
  33. package/dist/shared/components/bulk/bulk-field-options.js +10 -10
  34. package/dist/shared/components/cbv/column-totals.js +53 -51
  35. package/dist/shared/components/chat/ChatAnalyticsView.js +87 -87
  36. package/dist/shared/components/collections-directory/CollectionsToolbar.js +18 -18
  37. package/dist/shared/components/command-center/announce.js +7 -6
  38. package/dist/shared/components/command-center/panels/AttentionPanel.js +32 -31
  39. package/dist/shared/components/command-center/panels/FlowPanel.js +29 -28
  40. package/dist/shared/components/command-center/panels/PeoplePanel.js +39 -39
  41. package/dist/shared/components/delegation/DelegationConsoleView.js +27 -27
  42. package/dist/shared/components/imports/RunDetailSheet.js +1 -1
  43. package/dist/shared/components/integrations/IntegrationObligationsView.js +119 -119
  44. package/dist/shared/components/integrations/console/EventsView.js +35 -35
  45. package/dist/shared/components/integrations/console/FirefightView.js +15 -14
  46. package/dist/shared/components/integrations/console/PartnerDetail.js +78 -78
  47. package/dist/shared/components/integrations/console/ReadyToSendView.js +103 -103
  48. package/dist/shared/components/integrations/console/SignalCard.js +67 -67
  49. package/dist/shared/components/item-edit/CatalogPickerField.js +536 -527
  50. package/dist/shared/components/item-edit/ChangesTray.js +88 -74
  51. package/dist/shared/components/item-edit/FilePickerField.js +123 -123
  52. package/dist/shared/components/item-edit/GroupSection.js +301 -292
  53. package/dist/shared/components/item-edit/HeaderSummaryChip.js +54 -54
  54. package/dist/shared/components/item-edit/InlineGridField.js +45 -36
  55. package/dist/shared/components/item-edit/InlineTableField.js +1167 -1153
  56. package/dist/shared/components/item-edit/NestedRelationEditor.js +106 -99
  57. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +11 -11
  58. package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +43 -44
  59. package/dist/shared/components/monitoring/ApiRequestLog.js +35 -35
  60. package/dist/shared/components/notifications/NotificationCenterView.js +268 -268
  61. package/dist/shared/components/ops-report/format.js +37 -36
  62. package/dist/shared/components/panels/ReferencedByPanel.js +21 -20
  63. package/dist/shared/components/panels/RevisionsPanel.js +306 -305
  64. package/dist/shared/components/pipeline/OwnerMatrixVersionsCard.js +12 -12
  65. package/dist/shared/components/pipeline/PipelineEditorView.js +483 -482
  66. package/dist/shared/components/pipeline/PipelineHealthCards.js +33 -32
  67. package/dist/shared/components/pipeline/TeamsView.js +189 -130
  68. package/dist/shared/components/profile/AgentsPanel.js +6 -6
  69. package/dist/shared/components/profile/DelegationCard.js +13 -12
  70. package/dist/shared/components/profile/PersonActivity.js +48 -48
  71. package/dist/shared/components/profile/PersonExtras.js +107 -107
  72. package/dist/shared/components/profile/PersonWeek.js +9 -9
  73. package/dist/shared/components/queue/QueueBulkBar.js +19 -18
  74. package/dist/shared/components/queue/QueueBulkMove.js +21 -20
  75. package/dist/shared/components/queue/QueueItemSheet.js +136 -131
  76. package/dist/shared/components/queue/QueueWorklist.js +671 -670
  77. package/dist/shared/components/queue/worklist-helpers.js +36 -21
  78. package/dist/shared/components/support/RequestList.js +121 -121
  79. package/dist/shared/components/support/SupportAnalytics.js +29 -29
  80. package/dist/shared/lib/activity-sentence.js +251 -229
  81. package/dist/shared/lib/format-value.js +5 -4
  82. package/dist/shared/lib/number-format.js +87 -0
  83. package/dist/shared/lib/number-kind.js +133 -0
  84. package/dist/shared/lib/utils.js +24 -20
  85. package/dist/shared/lib/watch-list.js +1 -1
  86. package/dist/shared/lib/widget-value-format.js +26 -12
  87. package/package.json +1 -1
@@ -1,16 +1,16 @@
1
1
  function M(e) {
2
- const n = i(e.collection_label) || "related rows", t = i(e.row_label), r = t ? `${n} · ${t}` : n;
2
+ const n = s(e.collection_label) || "related rows", t = s(e.row_label), r = t ? `${n} · ${t}` : n;
3
3
  if (e.verb === "added") return `added ${r}`;
4
4
  if (e.verb === "removed") return `removed ${r}`;
5
- const o = (e.changes ?? []).filter((s) => s && i(s.label)).map((s) => `${i(s.label)} ${i(s.from) || "—"} → ${i(s.to) || "—"}`);
5
+ const o = (e.changes ?? []).filter((i) => i && s(i.label)).map((i) => `${s(i.label)} ${s(i.from) || "—"} → ${s(i.to) || "—"}`);
6
6
  return o.length ? `changed ${r}: ${o.join(", ")}` : `changed ${r}`;
7
7
  }
8
- function Le(e) {
9
- return (e.totals ?? []).filter((n) => n && i(n.label) && Number.isFinite(n.delta) && n.delta !== 0).map(
10
- (n) => `${i(n.label)} ${n.delta > 0 ? "+" : "−"}${Math.abs(n.delta).toLocaleString("en-US", { maximumFractionDigits: 2 })}`
8
+ function Te(e) {
9
+ return (e.totals ?? []).filter((n) => n && s(n.label) && Number.isFinite(n.delta) && n.delta !== 0).map(
10
+ (n) => `${s(n.label)} ${n.delta > 0 ? "+" : "−"}${Math.abs(n.delta).toLocaleString("en-US", { maximumFractionDigits: 2 })}`
11
11
  ).join(", ");
12
12
  }
13
- 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 = {
13
+ 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, F = {
14
14
  ai: "AI",
15
15
  api: "API",
16
16
  csv: "CSV",
@@ -31,30 +31,30 @@ const k = "a record you can't see", z = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0
31
31
  url: "URL",
32
32
  xlsx: "Excel"
33
33
  };
34
- function i(e) {
34
+ function s(e) {
35
35
  return e == null ? "" : String(e).trim();
36
36
  }
37
37
  function se(e) {
38
- return i(e).toUpperCase();
38
+ return s(e).toUpperCase();
39
39
  }
40
- function F(e) {
40
+ function W(e) {
41
41
  return e.split(/[\s_.:-]+/).map((n) => n.trim()).filter(Boolean);
42
42
  }
43
- function U(e) {
43
+ function z(e) {
44
44
  const n = e.toLowerCase();
45
- return W[n] ?? n;
45
+ return F[n] ?? n;
46
46
  }
47
47
  function X(e) {
48
- const n = F(e).map(U).join(" ");
48
+ const n = W(e).map(z).join(" ");
49
49
  return n ? n.charAt(0).toUpperCase() + n.slice(1) : "";
50
50
  }
51
51
  function q(e) {
52
- return F(e).map((n) => W[n.toLowerCase()] ?? n.charAt(0).toUpperCase() + n.slice(1).toLowerCase()).join(" ");
52
+ return W(e).map((n) => F[n.toLowerCase()] ?? n.charAt(0).toUpperCase() + n.slice(1).toLowerCase()).join(" ");
53
53
  }
54
54
  function V(e) {
55
55
  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;
56
56
  }
57
- function D(e) {
57
+ function O(e) {
58
58
  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`;
59
59
  }
60
60
  function g(e) {
@@ -133,36 +133,36 @@ function N(e) {
133
133
  }
134
134
  function I(e, n) {
135
135
  var l;
136
- const t = i(e);
136
+ const t = s(e);
137
137
  if (!t) return { singular: "Record", plural: "Records" };
138
- 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);
139
- if (a || s) {
140
- const f = a || A(s, V), $ = s && s !== f ? s : A(f, D);
141
- return { singular: f, plural: $ };
138
+ const r = (l = n == null ? void 0 : n.collections) == null ? void 0 : l[t], o = typeof r == "string" ? { plural: r } : r ?? {}, i = s(o.plural), a = s(o.singular);
139
+ if (a || i) {
140
+ const p = a || x(i, V), $ = i && i !== p ? i : x(p, O);
141
+ return { singular: p, plural: $ };
142
142
  }
143
143
  const c = ae[t];
144
- if (c) return { singular: c, plural: c === "Settings" ? c : A(c, D) };
145
- const u = q(t.replace(/^(nivaro|directus)_/, "")) || "Record", d = A(u, V);
146
- return { singular: d, plural: A(d, D) };
144
+ if (c) return { singular: c, plural: c === "Settings" ? c : x(c, O) };
145
+ const u = q(t.replace(/^(nivaro|directus)_/, "")) || "Record", d = x(u, V);
146
+ return { singular: d, plural: x(d, O) };
147
147
  }
148
- function A(e, n) {
148
+ function x(e, n) {
149
149
  const t = e.split(" ");
150
150
  return t[t.length - 1] = n(t[t.length - 1] ?? ""), t.join(" ");
151
151
  }
152
- function P(e, n, t) {
152
+ function L(e, n, t) {
153
153
  const { singular: r, plural: o } = I(n, t);
154
154
  return `${e} ${g(e === 1 ? r : o)}`;
155
155
  }
156
156
  function ue(e, n) {
157
- const t = e.user ?? e.user_id ?? null, r = t ? L(t, n) : null;
157
+ const t = e.user ?? e.user_id ?? null, r = t ? P(t, n) : null;
158
158
  if (r) return r;
159
- const o = [i(e.first_name), i(e.last_name)].filter(Boolean).join(" ");
160
- return o || (i(e.user_email) ? i(e.user_email) : null);
159
+ const o = [s(e.first_name), s(e.last_name)].filter(Boolean).join(" ");
160
+ return o || (s(e.user_email) ? s(e.user_email) : null);
161
161
  }
162
- function L(e, n) {
162
+ function P(e, n) {
163
163
  if (!e || !(n != null && n.users)) return null;
164
164
  const t = n.users;
165
- return i(t[e] ?? t[se(e)] ?? t[i(e).toLowerCase()]) || null;
165
+ return s(t[e] ?? t[se(e)] ?? t[s(e).toLowerCase()]) || null;
166
166
  }
167
167
  const de = /* @__PURE__ */ new Set([
168
168
  "person",
@@ -184,7 +184,7 @@ function le(e) {
184
184
  return null;
185
185
  }
186
186
  if (!n || typeof n != "object") return null;
187
- const t = n, r = i(t.kind);
187
+ const t = n, r = s(t.kind);
188
188
  return de.has(r) ? {
189
189
  kind: r,
190
190
  id: t.id == null ? null : String(t.id),
@@ -192,95 +192,95 @@ function le(e) {
192
192
  on_behalf_of: t.on_behalf_of == null ? null : String(t.on_behalf_of)
193
193
  } : null;
194
194
  }
195
- function Y(e) {
195
+ function Z(e) {
196
196
  const n = le(e.actor);
197
197
  if (n) return n;
198
198
  const t = e.user ?? e.user_id ?? null;
199
- if (i(e.mcp_conn) || i(e.via_app) || i(e.via_agent))
199
+ if (s(e.mcp_conn) || s(e.via_app) || s(e.via_agent))
200
200
  return {
201
201
  kind: "mcp",
202
- id: i(e.mcp_conn) || null,
203
- name: i(e.via_app) || i(e.via_agent) || null,
202
+ id: s(e.mcp_conn) || null,
203
+ name: s(e.via_app) || s(e.via_agent) || null,
204
204
  on_behalf_of: t
205
205
  };
206
- const r = i(e.auth_method);
206
+ const r = s(e.auth_method);
207
207
  if (r === "masquerade") return { kind: "view_as", id: null, name: null, on_behalf_of: t };
208
208
  if ((r === "api_key" || r === "key_sim") && e.api_key_id != null)
209
209
  return {
210
210
  kind: "api_key",
211
211
  id: String(e.api_key_id),
212
- name: i(e.api_key_name) || null,
212
+ name: s(e.api_key_name) || null,
213
213
  on_behalf_of: t
214
214
  };
215
- const o = i(e.chain_parent), s = /^(cron|import_run|flow_run):(.+)$/.exec(o);
216
- if (s) {
217
- const c = s[1] === "cron" ? "cron" : s[1] === "import_run" ? "import" : "flow";
218
- return { kind: c, id: s[2], name: c === "cron" ? s[2] : null, on_behalf_of: t };
215
+ const o = s(e.chain_parent), i = /^(cron|import_run|flow_run):(.+)$/.exec(o);
216
+ if (i) {
217
+ const c = i[1] === "cron" ? "cron" : i[1] === "import_run" ? "import" : "flow";
218
+ return { kind: c, id: i[2], name: c === "cron" ? i[2] : null, on_behalf_of: t };
219
219
  }
220
- const a = /^import:([^:]+)/i.exec(i(e.comment));
221
- return a ? { kind: "import", id: a[1], name: a[1], on_behalf_of: t } : i(e.origin) === "import" ? { kind: "import", id: null, name: null, on_behalf_of: t } : t ? { kind: "person", id: t, name: null, on_behalf_of: null } : {
220
+ const a = /^import:([^:]+)/i.exec(s(e.comment));
221
+ return a ? { kind: "import", id: a[1], name: a[1], on_behalf_of: t } : s(e.origin) === "import" ? { kind: "import", id: null, name: null, on_behalf_of: t } : t ? { kind: "person", id: t, name: null, on_behalf_of: null } : {
222
222
  kind: "system",
223
223
  id: null,
224
- name: i(e.origin) === "integration" ? "An integration" : null
224
+ name: s(e.origin) === "integration" ? "An integration" : null
225
225
  };
226
226
  }
227
227
  function ee(e, n) {
228
- const t = Y(e), r = ue(e, n), o = L(t.on_behalf_of, n) ?? r;
228
+ const t = Z(e), r = ue(e, n), o = P(t.on_behalf_of, n) ?? r;
229
229
  switch (t.kind) {
230
230
  case "person":
231
231
  return r ?? "Someone";
232
232
  case "view_as":
233
- return `${(L(t.id, n) ?? i(t.name) ?? "") || "An administrator"} as ${o ?? "someone"}`;
233
+ return `${(P(t.id, n) ?? s(t.name) ?? "") || "An administrator"} as ${o ?? "someone"}`;
234
234
  case "api_key":
235
- return `API key “${i(t.name) || (t.id ? `#${t.id}` : "unnamed")}”`;
235
+ return `API key “${s(t.name) || (t.id ? `#${t.id}` : "unnamed")}”`;
236
236
  case "mcp": {
237
- const s = i(t.name).replace(/^via\s+/i, "") || "An assistant";
238
- return o ? `${s} for ${o}` : s;
237
+ const i = s(t.name).replace(/^via\s+/i, "") || "An assistant";
238
+ return o ? `${i} for ${o}` : i;
239
239
  }
240
240
  case "import":
241
- return i(t.name) ? `Import “${i(t.name)}”` : "An import";
241
+ return s(t.name) ? `Import “${s(t.name)}”` : "An import";
242
242
  case "flow":
243
- return i(t.name) ? `Flow “${i(t.name)}”` : "A flow";
243
+ return s(t.name) ? `Flow “${s(t.name)}”` : "A flow";
244
244
  case "cron":
245
- return i(t.name || t.id) ? `Scheduled job “${i(t.name || t.id)}”` : "A scheduled job";
245
+ return s(t.name || t.id) ? `Scheduled job “${s(t.name || t.id)}”` : "A scheduled job";
246
246
  default:
247
- return i(t.name) || "System";
247
+ return s(t.name) || "System";
248
248
  }
249
249
  }
250
- function j(e, n, t) {
251
- var s;
252
- const r = i(n);
253
- if (!r || !i(e)) return null;
254
- const o = (s = t == null ? void 0 : t.junctions) == null ? void 0 : s[`${e}:${r}`];
255
- return o ? fe(o, t) : Z(e, r, t);
250
+ function T(e, n, t) {
251
+ var i;
252
+ const r = s(n);
253
+ if (!r || !s(e)) return null;
254
+ const o = (i = t == null ? void 0 : t.junctions) == null ? void 0 : i[`${e}:${r}`];
255
+ return o ? fe(o, t) : Y(e, r, t);
256
256
  }
257
257
  function pe(e, n) {
258
- const t = i(e.parent_id);
258
+ const t = s(e.parent_id);
259
259
  if (!t) return !1;
260
- const r = Z(e.parent_collection, t, n);
260
+ const r = Y(e.parent_collection, t, n);
261
261
  return !!r && r !== k;
262
262
  }
263
263
  function fe(e, n) {
264
- const t = G(e, n), r = i(e.value);
264
+ const t = G(e, n), r = s(e.value);
265
265
  return r ? `${e.noun} ${r} on ${t}` : pe(e, n) ? `${t} · ${e.noun}` : `${Q(e.noun)} on ${t}`;
266
266
  }
267
- function Z(e, n, t) {
268
- if (!n || !i(e)) return null;
269
- const r = `${e}:${n}`, o = t == null ? void 0 : t.records, { singular: s } = I(e, t), a = ce.test(i(e));
267
+ function Y(e, n, t) {
268
+ if (!n || !s(e)) return null;
269
+ const r = `${e}:${n}`, o = t == null ? void 0 : t.records, { singular: i } = I(e, t), a = ce.test(s(e));
270
270
  if (o && r in o) {
271
271
  const c = o[r];
272
- if (c == null) return a ? N(s) : k;
273
- const u = i(c);
274
- return u ? a && (u === n || z.test(u)) ? N(s) : u.toLowerCase().startsWith(s.toLowerCase()) ? u : `${s} ${u}` : a ? N(s) : s;
272
+ if (c == null) return a ? N(i) : k;
273
+ const u = s(c);
274
+ return u ? a && (u === n || U.test(u)) ? N(i) : u.toLowerCase().startsWith(i.toLowerCase()) ? u : `${i} ${u}` : a ? N(i) : i;
275
275
  }
276
- return a || z.test(n) ? N(s) : `${s} ${n}`;
276
+ return a || U.test(n) ? N(i) : `${i} ${n}`;
277
277
  }
278
278
  function B(e, n, t) {
279
279
  var o;
280
280
  const r = (o = t == null ? void 0 : t.fields) == null ? void 0 : o[`${e ?? ""}.${n}`];
281
- return i(r) || q(n);
281
+ return s(r) || q(n);
282
282
  }
283
- function T(e, n, t) {
283
+ function j(e, n, t) {
284
284
  const r = [...new Set(n)].map((o) => B(e, o, t));
285
285
  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`;
286
286
  }
@@ -300,35 +300,57 @@ function ge(e) {
300
300
  return e.replace(/<(script|style|template)\b[\s\S]*?<\/\1>/gi, " ").replace(/<[^>]+>/g, " ").replace(/&(nbsp|amp|lt|gt|quot|#39);/g, (n) => he[n] ?? n).replace(/\s+/g, " ").trim();
301
301
  }
302
302
  function ne(e, n, t, r) {
303
- var c, u;
303
+ var u, d, l;
304
304
  if (t == null || t === "") return "empty";
305
305
  if (typeof t == "boolean") return t ? "Yes" : "No";
306
306
  if (typeof t == "object")
307
307
  return Array.isArray(t) ? `${t.length} items` : "a new value";
308
- const o = String(t), s = ve.test(o) ? ge(o) : o;
309
- if (!s) return "empty";
310
- const a = (u = (c = r == null ? void 0 : r.choices) == null ? void 0 : c[`${e ?? ""}.${n}`]) == null ? void 0 : u[s];
308
+ const o = String(t), i = ve.test(o) ? ge(o) : o;
309
+ if (!i) return "empty";
310
+ const a = (d = (u = r == null ? void 0 : r.choices) == null ? void 0 : u[`${e ?? ""}.${n}`]) == null ? void 0 : d[i];
311
311
  if (a) return me(a);
312
- if (_e.test(s)) return s;
313
- if ($e.test(s)) {
314
- const d = new Date(s);
315
- if (!Number.isNaN(d.getTime()))
312
+ const c = (l = r == null ? void 0 : r.numbers) == null ? void 0 : l[`${e ?? ""}.${n}`];
313
+ if (c && /^-?\d+(\.\d+)?$/.test(i.trim())) return ke(Number(i.trim()), c);
314
+ if (_e.test(i)) return i;
315
+ if ($e.test(i)) {
316
+ const p = new Date(i);
317
+ if (!Number.isNaN(p.getTime()))
316
318
  try {
317
- return d.toLocaleString(void 0, {
319
+ return p.toLocaleString(void 0, {
318
320
  dateStyle: "medium",
319
321
  timeStyle: "short",
320
322
  ...r != null && r.timeZone ? { timeZone: r.timeZone } : {}
321
323
  });
322
324
  } catch {
323
- return d.toLocaleString();
325
+ return p.toLocaleString();
324
326
  }
325
327
  }
326
- return s.length > 60 ? `${s.slice(0, 57)}…` : s;
328
+ return i.length > 60 ? `${i.slice(0, 57)}…` : i;
329
+ }
330
+ function ke(e, n) {
331
+ const t = Math.min(Math.max(Math.trunc(Number(n.decimals ?? 2)) || 0, 0), 10);
332
+ if (n.kind === "money") {
333
+ const o = /^[A-Z]{3}$/.test(String(n.currency ?? "")) ? String(n.currency) : "USD";
334
+ try {
335
+ return e.toLocaleString(void 0, {
336
+ style: "currency",
337
+ currency: o,
338
+ minimumFractionDigits: t,
339
+ maximumFractionDigits: t
340
+ });
341
+ } catch {
342
+ return e.toLocaleString(void 0, { style: "currency", currency: "USD" });
343
+ }
344
+ }
345
+ const r = e.toLocaleString(void 0, {
346
+ maximumFractionDigits: n.kind === "count" && Number.isInteger(e) ? 0 : t
347
+ });
348
+ return !n.unit || n.unit === "$" ? r : n.unit === "%" ? `${r}%` : `${r} ${n.unit}`;
327
349
  }
328
350
  function te(e, n, t, r) {
329
- var s;
351
+ var i;
330
352
  const o = `${e ?? ""}.${n}`;
331
- return !(!(r != null && r.fields) || !(o in r.fields) || (s = r.links) != null && s[o] || t != null && typeof t == "object");
353
+ return !(!(r != null && r.fields) || !(o in r.fields) || (i = r.links) != null && i[o] || t != null && typeof t == "object");
332
354
  }
333
355
  function K(e) {
334
356
  var n, t;
@@ -336,20 +358,20 @@ function K(e) {
336
358
  }
337
359
  function J(e) {
338
360
  const n = { from: null, to: null, via: null, note: null, auto: !1 };
339
- let t = i(e);
361
+ let t = s(e);
340
362
  if (!t) return n;
341
363
  const r = /^auto(?:-transition)?:?\s*"?([^"]*)"?$/i.exec(t);
342
364
  if (r)
343
- return n.auto = !0, n.via = i(r[1]) || null, n;
365
+ return n.auto = !0, n.via = s(r[1]) || null, n;
344
366
  const o = /\s+—\s+"([\s\S]*)"\s*$/.exec(t);
345
367
  o && (n.note = o[1], t = t.slice(0, o.index)), t = t.replace(/\s*\(bulk:[^)]*\)\s*$/i, "");
346
- const s = /^bulk:\s*(.+?)\s*→\s*(.+)$/i.exec(t);
347
- if (s)
348
- return n.via = s[1], n.to = s[2], n;
368
+ const i = /^bulk:\s*(.+?)\s*→\s*(.+)$/i.exec(t);
369
+ if (i)
370
+ return n.via = i[1], n.to = i[2], n;
349
371
  const a = /^(.*?)\s*→\s*(.+?)(?:\s+via\s+(.+))?$/.exec(t);
350
372
  if (a) {
351
- const c = i(a[1]);
352
- n.from = c && c !== "Start" ? c : null, n.to = i(a[2]) || null, n.via = i(a[3]) || null;
373
+ const c = s(a[1]);
374
+ n.from = c && c !== "Start" ? c : null, n.to = s(a[2]) || null, n.via = s(a[3]) || null;
353
375
  }
354
376
  return n;
355
377
  }
@@ -474,7 +496,7 @@ const b = {
474
496
  updated: "updated",
475
497
  upload: "uploaded",
476
498
  view: "viewed"
477
- }, ke = /* @__PURE__ */ new Set([
499
+ }, we = /* @__PURE__ */ new Set([
478
500
  "add",
479
501
  "build",
480
502
  "create",
@@ -490,30 +512,30 @@ const b = {
490
512
  "upload"
491
513
  ]);
492
514
  function re(e) {
493
- const n = F(e).map((a) => a.toLowerCase());
515
+ const n = W(e).map((a) => a.toLowerCase());
494
516
  if (n.length === 0) return { verb: null, past: null, noun: "" };
495
517
  const t = n[n.length - 1];
496
518
  let r = -1;
497
519
  if (b[t]) r = n.length - 1;
498
520
  else if (b[n[0]]) r = 0;
499
521
  else for (let a = n.length - 1; a >= 0; a--) b[n[a]] && (r = a);
500
- if (r < 0) return { verb: null, past: null, noun: n.map(U).join(" ") };
501
- const o = n[r], s = [...n.slice(0, r), ...n.slice(r + 1)];
502
- return { verb: o, past: b[o], noun: s.map(U).join(" ") };
522
+ if (r < 0) return { verb: null, past: null, noun: n.map(z).join(" ") };
523
+ const o = n[r], i = [...n.slice(0, r), ...n.slice(r + 1)];
524
+ return { verb: o, past: b[o], noun: i.map(z).join(" ") };
503
525
  }
504
- function we(e, n) {
505
- return n ? /s$/.test(n) && !/ss$/.test(n) ? n : e && ke.has(e) ? `${/^[aeiou]/i.test(n) ? "an" : "a"} ${n}` : `the ${n}` : "";
526
+ function Se(e, n) {
527
+ return n ? /s$/.test(n) && !/ss$/.test(n) ? n : e && we.has(e) ? `${/^[aeiou]/i.test(n) ? "an" : "a"} ${n}` : `the ${n}` : "";
506
528
  }
507
- function Se(e) {
529
+ function ye(e) {
508
530
  const n = /(\d[\d,]*)\s+rows?/i.exec(e), t = /^\s*(csv|xlsx|json|pdf|xml)\b/i.exec(e);
509
531
  return {
510
532
  rows: n ? Number(n[1].replace(/,/g, "")) : null,
511
- format: t ? W[t[1].toLowerCase()] ?? t[1].toUpperCase() : null
533
+ format: t ? F[t[1].toLowerCase()] ?? t[1].toUpperCase() : null
512
534
  };
513
535
  }
514
536
  function S(e, n) {
515
537
  var r;
516
- const t = `${i(e.collection)}:${i(e.item)}`;
538
+ const t = `${s(e.collection)}:${s(e.item)}`;
517
539
  return ((r = n == null ? void 0 : n.junctions) == null ? void 0 : r[t]) ?? null;
518
540
  }
519
541
  function Q(e) {
@@ -521,79 +543,79 @@ function Q(e) {
521
543
  }
522
544
  function G(e, n) {
523
545
  const t = g(I(e.parent_collection, n).singular), r = `${/^[aeiou]/i.test(t) ? "an" : "a"} ${t} record`;
524
- if (!i(e.parent_id)) return r;
525
- const o = Z(e.parent_collection, i(e.parent_id), n);
546
+ if (!s(e.parent_id)) return r;
547
+ const o = Y(e.parent_collection, s(e.parent_id), n);
526
548
  return !o || o === k ? r : o;
527
549
  }
528
550
  function E(e) {
529
- const n = i(e.value);
551
+ const n = s(e.value);
530
552
  return n ? `${e.noun} ${n}` : Q(e.noun);
531
553
  }
532
554
  function oe(e, n, t) {
533
555
  const r = G(n, t);
534
556
  return e === "create" ? `added ${E(n)} to ${r}` : e === "delete" ? `removed ${E(n)} from ${r}` : `updated ${E(n)} on ${r}`;
535
557
  }
536
- function ye(e, n) {
558
+ function xe(e, n) {
537
559
  var l;
538
- const t = e.map((f) => ({ e: f, j: S(f, n) }));
539
- if (t.length === 0 || t.some((f) => !f.j)) return null;
540
- const r = new Set(t.map((f) => i(f.j.parent_id)).filter(Boolean)), o = new Set(t.map((f) => f.j.parent_collection));
560
+ const t = e.map((p) => ({ e: p, j: S(p, n) }));
561
+ if (t.length === 0 || t.some((p) => !p.j)) return null;
562
+ const r = new Set(t.map((p) => s(p.j.parent_id)).filter(Boolean)), o = new Set(t.map((p) => p.j.parent_collection));
541
563
  if (r.size > 1 || o.size > 1) return null;
542
- const s = ((l = t.find((f) => i(f.j.parent_id))) == null ? void 0 : l.j) ?? t[0].j, a = /* @__PURE__ */ new Map();
543
- for (const { e: f, j: $ } of [...t].reverse()) {
544
- const _ = a.get($.noun) ?? { removed: [], added: [], updated: [] }, h = i($.value), v = i(f.action);
564
+ const i = ((l = t.find((p) => s(p.j.parent_id))) == null ? void 0 : l.j) ?? t[0].j, a = /* @__PURE__ */ new Map();
565
+ for (const { e: p, j: $ } of [...t].reverse()) {
566
+ const _ = a.get($.noun) ?? { removed: [], added: [], updated: [] }, h = s($.value), v = s(p.action);
545
567
  v === "delete" ? _.removed.push(h) : v === "create" ? _.added.push(h) : _.updated.push(h), a.set($.noun, _);
546
568
  }
547
- const c = (f, $) => $ ? `${f} ${$}` : Q(f), u = [], d = [];
548
- for (const [f, $] of a) {
569
+ const c = (p, $) => $ ? `${p} ${$}` : Q(p), u = [], d = [];
570
+ for (const [p, $] of a) {
549
571
  if ($.removed.length === 1 && $.added.length === 1 && $.updated.length === 0) {
550
- u.push({ noun: f, from: $.removed[0], to: $.added[0] });
572
+ u.push({ noun: p, from: $.removed[0], to: $.added[0] });
551
573
  continue;
552
574
  }
553
- for (const _ of $.removed) d.push(`removed ${c(f, _)}`);
554
- for (const _ of $.added) d.push(`added ${c(f, _)}`);
555
- for (const _ of $.updated) d.push(`updated ${c(f, _)}`);
575
+ for (const _ of $.removed) d.push(`removed ${c(p, _)}`);
576
+ for (const _ of $.added) d.push(`added ${c(p, _)}`);
577
+ for (const _ of $.updated) d.push(`updated ${c(p, _)}`);
556
578
  }
557
- return { parent: G(s, n), pairs: u, rest: d };
579
+ return { parent: G(i, n), pairs: u, rest: d };
558
580
  }
559
581
  function Ae(e) {
560
582
  return e.from && e.to ? `${e.noun} ${e.from} → ${e.to}` : e.to ? `${e.noun} set to ${e.to}` : `changed ${e.noun}`;
561
583
  }
562
- function xe(e, n) {
563
- const t = ye(e, n);
584
+ function be(e, n) {
585
+ const t = xe(e, n);
564
586
  if (!t) return null;
565
- const { parent: r, pairs: o, rest: s } = t;
566
- if (s.length === 0 && o.length === 1) {
587
+ const { parent: r, pairs: o, rest: i } = t;
588
+ if (i.length === 0 && o.length === 1) {
567
589
  const a = o[0];
568
590
  return a.from && a.to ? `changed ${a.noun} on ${r}: ${a.from} → ${a.to}` : a.to ? `changed ${a.noun} on ${r} to ${a.to}` : `changed ${a.noun} on ${r}`;
569
591
  }
570
- if (o.length === 0 && s.length === 1) {
592
+ if (o.length === 0 && i.length === 1) {
571
593
  const a = e[0];
572
- return oe(i(a.action), S(a, n), n);
594
+ return oe(s(a.action), S(a, n), n);
573
595
  }
574
- return `changed ${r}: ${[...o.map(Ae), ...s].join("; ")}`;
596
+ return `changed ${r}: ${[...o.map(Ae), ...i].join("; ")}`;
575
597
  }
576
598
  const H = /* @__PURE__ */ new Set(["transition", "pipeline-transition"]);
577
599
  function je(e) {
578
- const n = i(e).toLowerCase();
600
+ const n = s(e).toLowerCase();
579
601
  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";
580
602
  }
581
- function be(e, n) {
603
+ function Ie(e, n) {
582
604
  var $, _, h, v, y;
583
- const t = i(e.action), r = e.collection ?? null, o = j(r, e.item, n), s = I(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);
605
+ const t = s(e.action), r = e.collection ?? null, o = T(r, e.item, n), i = I(r, n), a = `${/^[aeiou]/i.test(i.singular) ? "an" : "a"} ${g(i.singular)}`, c = s(e.comment), u = o ? ` on ${o}` : "", d = S(e, n);
584
606
  if (d && (t === "create" || t === "delete" || t === "update"))
585
607
  return oe(t, d, n);
586
608
  if ((($ = e.event) == null ? void 0 : $.kind) === "start") {
587
- const p = i(e.event.to_label);
588
- return `started ${o ?? "the pipeline"}${p ? ` in ${p}` : ""}`;
609
+ const f = s(e.event.to_label);
610
+ return `started ${o ?? "the pipeline"}${f ? ` in ${f}` : ""}`;
589
611
  }
590
612
  if (((_ = e.event) == null ? void 0 : _.kind) === "transition" || H.has(t)) {
591
- const p = e.event ? {
592
- from: i(e.event.from_label) || null,
593
- to: i(e.event.to_label) || null,
594
- via: i(e.event.transition_label) || null
595
- } : J(c), m = (h = e.event) != null && h.addendum ? `Addendum “${i(e.event.addendum.title) || "Untitled"}”` : o ?? "a record";
596
- return p.from && p.to ? `moved ${m} from ${p.from} to ${p.to}` : p.to ? `moved ${m} to ${p.to}` : p.via ? `ran “${p.via}” on ${m}` : `moved ${m}`;
613
+ const f = e.event ? {
614
+ from: s(e.event.from_label) || null,
615
+ to: s(e.event.to_label) || null,
616
+ via: s(e.event.transition_label) || null
617
+ } : J(c), m = (h = e.event) != null && h.addendum ? `Addendum “${s(e.event.addendum.title) || "Untitled"}”` : o ?? "a record";
618
+ return f.from && f.to ? `moved ${m} from ${f.from} to ${f.to}` : f.to ? `moved ${m} to ${f.to}` : f.via ? `ran “${f.via}” on ${m}` : `moved ${m}`;
597
619
  }
598
620
  switch (t) {
599
621
  case "create":
@@ -603,16 +625,16 @@ function be(e, n) {
603
625
  case "o2m-update": {
604
626
  if (t === "o2m-update")
605
627
  return e.o2m ? `${M(e.o2m)}${u}` : `changed related rows${u}`;
606
- const p = K(e);
628
+ const f = K(e);
607
629
  if (r === "nivaro_settings")
608
- return p.length ? `changed the ${T(r, p, n)} setting${p.length === 1 ? "" : "s"}` : "changed the settings";
630
+ return f.length ? `changed the ${j(r, f, n)} setting${f.length === 1 ? "" : "s"}` : "changed the settings";
609
631
  if (r === "nivaro_approval_instances" && ((v = e.why) != null && v.approval)) {
610
- const m = e.why.approval, w = j(m.collection, m.item, n);
611
- return `${(b[i(m.decision).toLowerCase()] ?? i(m.decision).toLowerCase()) || "decided on"} ${w ?? o ?? "an approval"}${m.chain ? ` (${m.chain})` : ""}`;
632
+ const m = e.why.approval, w = T(m.collection, m.item, n);
633
+ return `${(b[s(m.decision).toLowerCase()] ?? s(m.decision).toLowerCase()) || "decided on"} ${w ?? o ?? "an approval"}${m.chain ? ` (${m.chain})` : ""}`;
612
634
  }
613
- if (p.length) {
635
+ if (f.length) {
614
636
  const m = ((y = e.changes) == null ? void 0 : y.length) === 1 ? e.changes[0] : null;
615
- return m && "value" in m && te(r, m.field, m.value, n) ? `set ${B(r, m.field, n)} to ${ne(r, m.field, m.value, n)}${u}` : `changed ${T(r, p, n)}${u}`;
637
+ return m && "value" in m && te(r, m.field, m.value, n) ? `set ${B(r, m.field, n)} to ${ne(r, m.field, m.value, n)}${u}` : `changed ${j(r, f, n)}${u}`;
616
638
  }
617
639
  return `updated ${o ?? a}`;
618
640
  }
@@ -622,8 +644,8 @@ function be(e, n) {
622
644
  case "restore":
623
645
  return `restored ${o ?? a}`;
624
646
  case "pipeline-start": {
625
- const p = /initial state:\s*(.+)$/i.exec(c);
626
- return `started ${o ?? "the pipeline"}${p ? ` in ${p[1]}` : ""}`;
647
+ const f = /initial state:\s*(.+)$/i.exec(c);
648
+ return `started ${o ?? "the pipeline"}${f ? ` in ${f[1]}` : ""}`;
627
649
  }
628
650
  case "login":
629
651
  return "signed in";
@@ -634,17 +656,17 @@ function be(e, n) {
634
656
  case "sign-in-failed":
635
657
  return o && o !== k ? `had a sign-in as ${o} fail` : "had a sign-in fail";
636
658
  case "export": {
637
- const p = Se(c);
638
- return `exported ${p.rows != null ? P(p.rows, r, n) : g(s.plural)}${p.format ? ` to ${p.format}` : ""}`;
659
+ const f = ye(c);
660
+ return `exported ${f.rows != null ? L(f.rows, r, n) : g(i.plural)}${f.format ? ` to ${f.format}` : ""}`;
639
661
  }
640
662
  case "masquerade-start":
641
- return `started viewing as ${x(e, n, c)}`;
663
+ return `started viewing as ${A(e, n, c)}`;
642
664
  case "masquerade-stop":
643
- return `stopped viewing as ${x(e, n, c)}`;
665
+ return `stopped viewing as ${A(e, n, c)}`;
644
666
  case "token.generate":
645
- return `generated a static token for ${x(e, n, "")}`;
667
+ return `generated a static token for ${A(e, n, "")}`;
646
668
  case "token.revoke":
647
- return `revoked the static token of ${x(e, n, "")}`;
669
+ return `revoked the static token of ${A(e, n, "")}`;
648
670
  case "api_key_created":
649
671
  return `created ${o && o !== k ? o : "an API key"}`;
650
672
  case "api_key_revoked":
@@ -654,39 +676,39 @@ function be(e, n) {
654
676
  case "api_key_simulate":
655
677
  return `tested requests as ${o && o !== k ? o : "an API key"}`;
656
678
  case "set_role":
657
- return `changed the role of ${x(e, n, "")}`;
679
+ return `changed the role of ${A(e, n, "")}`;
658
680
  case "bulk-write":
659
681
  case "bulk-action-execute": {
660
- const p = /(\d+)\s+(?:item|row)/i.exec(c), m = p ? P(Number(p[1]), r, n) : g(s.plural), w = t === "bulk-action-execute" ? /^(.+?)\s*\([^)]*\)\s+on\s/.exec(c) : null;
682
+ const f = /(\d+)\s+(?:item|row)/i.exec(c), m = f ? L(Number(f[1]), r, n) : g(i.plural), w = t === "bulk-action-execute" ? /^(.+?)\s*\([^)]*\)\s+on\s/.exec(c) : null;
661
683
  return w ? `ran “${w[1]}” on ${m}` : `changed ${m} in bulk`;
662
684
  }
663
685
  case "import-create":
664
686
  case "import-queue":
665
- return `started an import into ${g(s.plural)}`;
687
+ return `started an import into ${g(i.plural)}`;
666
688
  case "import-complete":
667
- return `finished an import into ${g(s.plural)}${c ? ` (${c})` : ""}`;
689
+ return `finished an import into ${g(i.plural)}${c ? ` (${c})` : ""}`;
668
690
  case "import-failed":
669
- return `had an import into ${g(s.plural)} fail`;
691
+ return `had an import into ${g(i.plural)} fail`;
670
692
  case "comment":
671
693
  return `commented${u}`;
672
694
  case "file-download": {
673
- let p = "", m = !1;
695
+ let f = "", m = !1;
674
696
  try {
675
- const O = JSON.parse(c);
676
- p = typeof O.name == "string" ? O.name : "", m = O.kind === "open";
697
+ const D = JSON.parse(c);
698
+ f = typeof D.name == "string" ? D.name : "", m = D.kind === "open";
677
699
  } catch {
678
700
  }
679
- const w = p ? `“${p}”` : "a file";
701
+ const w = f ? `“${f}”` : "a file";
680
702
  return `${m ? "opened" : "downloaded"} ${w}${r === "nivaro_files" ? "" : u}`;
681
703
  }
682
704
  case "split-out":
683
705
  case "split-in": {
684
- let p = 0;
706
+ let f = 0;
685
707
  try {
686
- p = Number(JSON.parse(c).lines) || 0;
708
+ f = Number(JSON.parse(c).lines) || 0;
687
709
  } catch {
688
710
  }
689
- const m = p > 0 ? `${p} ${p === 1 ? "line" : "lines"}` : "lines";
711
+ const m = f > 0 ? `${f} ${f === 1 ? "line" : "lines"}` : "lines";
690
712
  return t === "split-out" ? `moved ${m}${o ? ` of ${o}` : ""} to a new record` : `created ${o ?? a} from ${m} of another record`;
691
713
  }
692
714
  case "picker-exclude":
@@ -704,100 +726,100 @@ function be(e, n) {
704
726
  }
705
727
  if (!t) return `did something${u}`;
706
728
  const l = re(t);
707
- 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} ${we(l.verb, l.noun)}${u}` : `${l.past} ${o ?? "something"}` : `recorded “${X(t)}”${u}`;
729
+ return /settings$/.test(l.noun) && !l.verb ? `changed the ${l.noun}` : l.past ? o && l.noun && g(i.singular).toLowerCase().includes(l.noun.toLowerCase()) ? `${l.past} ${o}` : l.noun ? `${l.past} ${Se(l.verb, l.noun)}${u}` : `${l.past} ${o ?? "something"}` : `recorded “${X(t)}”${u}`;
708
730
  }
709
- function x(e, n, t) {
710
- const r = i(e.item), o = L(r, n) ?? (t || null);
731
+ function A(e, n, t) {
732
+ const r = s(e.item), o = P(r, n) ?? (t || null);
711
733
  if (o) return o;
712
- const s = e.collection === "nivaro_users" ? j(e.collection, e.item, n) : null;
713
- return s && !z.test(r) ? s : "someone";
734
+ const i = e.collection === "nivaro_users" ? T(e.collection, e.item, n) : null;
735
+ return i && !U.test(r) ? i : "someone";
714
736
  }
715
- function Ie(e, n) {
716
- return `${ee(e, n)} ${be(e, n)}`;
737
+ function Ne(e, n) {
738
+ return `${ee(e, n)} ${Ie(e, n)}`;
717
739
  }
718
- function Te(e) {
740
+ function qe(e) {
719
741
  var c, u, d, l;
720
- const n = i(e.action), t = i(e.comment);
721
- let r = i((c = e.why) == null ? void 0 : c.reason) || null, o = i((u = e.why) == null ? void 0 : u.note) || null;
742
+ const n = s(e.action), t = s(e.comment);
743
+ let r = s((c = e.why) == null ? void 0 : c.reason) || null, o = s((u = e.why) == null ? void 0 : u.note) || null;
722
744
  !o && H.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);
723
- 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;
745
+ const i = (l = e.why) == null ? void 0 : l.approval, a = i ? `${q(s(i.decision)) || "Decided"}${i.chain ? ` · ${i.chain}` : ""}${i.step != null && i.step !== "" ? ` · step ${i.step}` : ""}${s(i.comment) ? ` — “${s(i.comment)}”` : ""}` : null;
724
746
  return { reason: r, note: o, approval: a };
725
747
  }
726
- const Ne = 6e4, Ce = 5e3;
748
+ const Ce = 6e4, Re = 5e3;
727
749
  function C(e) {
728
750
  return e.timestamp ? new Date(e.timestamp).getTime() : Number.NaN;
729
751
  }
730
752
  function R(e) {
731
- const n = Y(e);
732
- return `${n.kind}|${i(n.id)}|${i(e.user ?? e.user_id).toUpperCase()}`;
753
+ const n = Z(e);
754
+ return `${n.kind}|${s(n.id)}|${s(e.user ?? e.user_id).toUpperCase()}`;
733
755
  }
734
- function Re(e) {
735
- const n = i(e.action);
736
- return !i(e.item) && (n.startsWith("bulk-") || n === "import-complete");
756
+ function Le(e) {
757
+ const n = s(e.action);
758
+ return !s(e.item) && (n.startsWith("bulk-") || n === "import-complete");
737
759
  }
738
- function qe(e, n = {}) {
739
- const t = n.windowMs ?? Ne, 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));
740
- for (const s of e) {
741
- const a = r[r.length - 1], c = a == null ? void 0 : a.entries[a.entries.length - 1], u = i(s.group_key);
760
+ function De(e, n = {}) {
761
+ const t = n.windowMs ?? Ce, r = [], o = (i, a) => i.parent_collection === a.parent_collection && (!s(i.parent_id) || !s(a.parent_id) || s(i.parent_id) === s(a.parent_id));
762
+ for (const i of e) {
763
+ const a = r[r.length - 1], c = a == null ? void 0 : a.entries[a.entries.length - 1], u = s(i.group_key);
742
764
  if (a && c && n.labels) {
743
- const d = S(s, n.labels), l = S(c, n.labels);
744
- if (d && l && a.entries.every((f) => S(f, n.labels)) && o(d, l) && R(s) === R(c) && Math.abs(C(c) - C(s)) <= Ce) {
745
- a.entries.push(s), a.by !== "group_key" && (a.by = "time");
765
+ const d = S(i, n.labels), l = S(c, n.labels);
766
+ if (d && l && a.entries.every((p) => S(p, n.labels)) && o(d, l) && R(i) === R(c) && Math.abs(C(c) - C(i)) <= Re) {
767
+ a.entries.push(i), a.by !== "group_key" && (a.by = "time");
746
768
  continue;
747
769
  }
748
770
  }
749
771
  if (a && c) {
750
- const d = i(c.group_key);
772
+ const d = s(c.group_key);
751
773
  if (u && u === d) {
752
- a.entries.push(s), a.by = "group_key";
774
+ a.entries.push(i), a.by = "group_key";
753
775
  continue;
754
776
  }
755
- if (!u && !d && a.by !== "group_key" && i(s.action) === i(c.action) && i(s.collection) === i(c.collection) && i(s.collection) !== "" && R(s) === R(c) && Math.abs(C(c) - C(s)) <= t) {
756
- a.entries.push(s), a.by = "time";
777
+ if (!u && !d && a.by !== "group_key" && s(i.action) === s(c.action) && s(i.collection) === s(c.collection) && s(i.collection) !== "" && R(i) === R(c) && Math.abs(C(c) - C(i)) <= t) {
778
+ a.entries.push(i), a.by = "time";
757
779
  continue;
758
780
  }
759
781
  }
760
- r.push({ key: `${u || "e"}:${s.id ?? r.length}`, entries: [s], by: null });
782
+ r.push({ key: `${u || "e"}:${i.id ?? r.length}`, entries: [i], by: null });
761
783
  }
762
784
  return r;
763
785
  }
764
- function Oe(e, n) {
786
+ function Me(e, n) {
765
787
  if (e.length === 0) return "";
766
- const t = e.filter((v) => !Re(v)), r = t[0] ?? e[0];
767
- if (t.length <= 1) return Ie(r, n);
768
- const o = ee(r, n), s = xe(t, n);
769
- if (s) return `${o} ${s}`;
770
- 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) ? j(c, r.item, n) ?? P(d, c, n) : P(d, c, n) : `${d} records`, f = u.size === 1 && t.length > 1 ? ` ${t.length} times` : "", $ = new Set(
771
- t.map((v) => H.has(i(v.action)) ? "transition" : i(v.action))
788
+ const t = e.filter((v) => !Le(v)), r = t[0] ?? e[0];
789
+ if (t.length <= 1) return Ne(r, n);
790
+ const o = ee(r, n), i = be(t, n);
791
+ if (i) return `${o} ${i}`;
792
+ const c = new Set(t.map((v) => s(v.collection))).size === 1 ? r.collection ?? null : null, u = new Set(t.map((v) => s(v.item))), d = u.size > 1 ? u.size : t.length, l = c ? u.size === 1 && s(r.item) ? T(c, r.item, n) ?? L(d, c, n) : L(d, c, n) : `${d} records`, p = u.size === 1 && t.length > 1 ? ` ${t.length} times` : "", $ = new Set(
793
+ t.map((v) => H.has(s(v.action)) ? "transition" : s(v.action))
772
794
  );
773
795
  if ($.size !== 1) return `${o} made ${t.length} changes to ${l}`;
774
796
  const _ = [...$][0];
775
797
  if (_ === "transition") {
776
798
  const v = new Set(
777
- t.map((p) => {
799
+ t.map((f) => {
778
800
  var m;
779
- return i(((m = p.event) == null ? void 0 : m.to_label) ?? J(p.comment).to);
801
+ return s(((m = f.event) == null ? void 0 : m.to_label) ?? J(f.comment).to);
780
802
  })
781
803
  ), y = v.size === 1 ? [...v][0] : "";
782
- return `${o} moved ${l}${y ? ` to ${y}` : ""}${f}`;
804
+ return `${o} moved ${l}${y ? ` to ${y}` : ""}${p}`;
783
805
  }
784
806
  if (_ === "update") {
785
807
  const v = Pe(t, c, n);
786
- return `${o} updated ${l}${f}${v ? `: ${v}` : ""}`;
808
+ return `${o} updated ${l}${p}${v ? `: ${v}` : ""}`;
787
809
  }
788
810
  if (_ === "create") return `${o} created ${l}`;
789
811
  if (_ === "delete") return `${o} deleted ${l}`;
790
- if (_ === "picker-exclude") return `${o} hid ${l} from pickers${f}`;
791
- if (_ === "picker-include") return `${o} showed ${l} in pickers again${f}`;
812
+ if (_ === "picker-exclude") return `${o} hid ${l} from pickers${p}`;
813
+ if (_ === "picker-include") return `${o} showed ${l} in pickers again${p}`;
792
814
  const h = re(_);
793
- return h.past ? `${o} ${h.past} ${l}${h.noun && !g(I(c, n).plural).toLowerCase().includes(h.noun) ? ` (${h.noun})` : ""}${f}` : `${o} recorded “${X(_)}” on ${l}`;
815
+ return h.past ? `${o} ${h.past} ${l}${h.noun && !g(I(c, n).plural).toLowerCase().includes(h.noun) ? ` (${h.noun})` : ""}${p}` : `${o} recorded “${X(_)}” on ${l}`;
794
816
  }
795
817
  function Pe(e, n, t) {
796
818
  var c;
797
819
  const r = ((c = e[0]) == null ? void 0 : c.changes) ?? null;
798
820
  if (!(r != null && r.length)) {
799
821
  const u = e.map((d) => K(d).sort().join(","));
800
- return u[0] && u.every((d) => d === u[0]) ? T(n, u[0].split(","), t) : "";
822
+ return u[0] && u.every((d) => d === u[0]) ? j(n, u[0].split(","), t) : "";
801
823
  }
802
824
  const o = (u) => JSON.stringify((u.changes ?? []).map((d) => [d.field, d.value ?? null]).sort());
803
825
  if (e.every((u) => o(u) === o(e[0])) && r.length <= 2 && r.every((u) => te(n, u.field, u.value, t)))
@@ -805,22 +827,22 @@ function Pe(e, n, t) {
805
827
  (u) => `${B(n, u.field, t)} → ${ne(n, u.field, u.value, t)}`
806
828
  ).join(", ");
807
829
  const a = new Set(e.flatMap((u) => (u.changes ?? []).map((d) => d.field)));
808
- return T(n, [...a], t);
830
+ return j(n, [...a], t);
809
831
  }
810
- function Me(e) {
832
+ function Oe(e) {
811
833
  var a;
812
- const n = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), s = (c, u) => {
813
- const d = i(c), l = i(u);
834
+ const n = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), i = (c, u) => {
835
+ const d = s(c), l = s(u);
814
836
  !d || !l || (o.add(d), d === "nivaro_users" && t.add(l), n.set(`${d}:${l}`, { collection: d, id: l }));
815
837
  };
816
838
  for (const c of e) {
817
- const u = i(c.user ?? c.user_id);
839
+ const u = s(c.user ?? c.user_id);
818
840
  u && t.add(u);
819
- const d = Y(c);
820
- d.kind === "view_as" && d.id && t.add(d.id), d.on_behalf_of && t.add(d.on_behalf_of), i(c.collection) && o.add(i(c.collection)), s(c.collection, c.item), (a = c.why) != null && a.approval && s(c.why.approval.collection, c.why.approval.item);
841
+ const d = Z(c);
842
+ d.kind === "view_as" && d.id && t.add(d.id), d.on_behalf_of && t.add(d.on_behalf_of), s(c.collection) && o.add(s(c.collection)), i(c.collection, c.item), (a = c.why) != null && a.approval && i(c.why.approval.collection, c.why.approval.item);
821
843
  for (const l of K(c)) {
822
- const f = i(c.collection);
823
- f && r.set(`${f}.${l}`, { collection: f, field: l });
844
+ const p = s(c.collection);
845
+ p && r.set(`${p}.${l}`, { collection: p, field: l });
824
846
  }
825
847
  }
826
848
  return {
@@ -831,33 +853,33 @@ function Me(e) {
831
853
  };
832
854
  }
833
855
  export {
834
- Ne as BURST_WINDOW_MS,
856
+ Ce as BURST_WINDOW_MS,
835
857
  k as HIDDEN_RECORD,
836
- Ce as LINK_WRITE_WINDOW_MS,
858
+ Re as LINK_WRITE_WINDOW_MS,
837
859
  re as actionParts,
838
- Me as activityLabelRefs,
839
- be as activityPredicate,
840
- Te as activityWhy,
860
+ Oe as activityLabelRefs,
861
+ Ie as activityPredicate,
862
+ qe as activityWhy,
841
863
  ee as actorName,
842
- Y as actorOf,
864
+ Z as actorOf,
843
865
  me as choiceText,
844
866
  I as collectionNouns,
845
- P as countNoun,
867
+ L as countNoun,
846
868
  B as fieldLabel,
847
- T as fieldList,
848
- qe as groupActivity,
869
+ j as fieldList,
870
+ De as groupActivity,
849
871
  S as junctionOf,
850
- ye as linkChanges,
851
- xe as linkGroupPredicate,
872
+ xe as linkChanges,
873
+ be as linkGroupPredicate,
852
874
  Ae as linkPairText,
853
875
  M as o2mSentence,
854
- Le as o2mTotalsText,
876
+ Te as o2mTotalsText,
855
877
  le as parseActor,
856
878
  J as parseTransitionComment,
857
879
  X as readableTitle,
858
- j as recordPhrase,
859
- Oe as renderActivityGroupSentence,
860
- Ie as renderActivitySentence,
880
+ T as recordPhrase,
881
+ Me as renderActivityGroupSentence,
882
+ Ne as renderActivitySentence,
861
883
  je as transitionVerb,
862
884
  te as valueShowable,
863
885
  ne as valueText