@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,28 +1,28 @@
1
- import { jsxs as t, jsx as e, Fragment as de } from "react/jsx-runtime";
2
- import { useQuery as K } from "@tanstack/react-query";
3
- import { RotateCw as ie, Eye as oe, X as P, Search as ce, ChevronLeft as me, ChevronRight as he, Paperclip as O, AlertTriangle as pe } from "lucide-react";
4
- import { useState as b, useMemo as xe } from "react";
5
- import { useNivaroClient as z, useApiFetchConfig as be } from "../../context.js";
1
+ import { jsxs as t, jsx as e, Fragment as ie } from "react/jsx-runtime";
2
+ import { useQuery as B } from "@tanstack/react-query";
3
+ import { RotateCw as oe, Eye as ce, X as K, Search as me, ChevronLeft as he, ChevronRight as pe, Paperclip as U, AlertTriangle as xe } from "lucide-react";
4
+ import { useState as b, useMemo as be } from "react";
5
+ import { useNivaroClient as P, useApiFetchConfig as ue } from "../../context.js";
6
6
  import { get as A } from "../../lib/commands.js";
7
- import { cn as v, formatDateTime as N, formatRelative as V } from "../../lib/utils.js";
8
- import { TipLayer as ue } from "../TipLayer.js";
9
- import { ChannelsAdminTab as ge } from "./ChannelArchive.js";
7
+ import { cn as v, formatDateTime as N, formatRelative as V, formatFileSize as X } from "../../lib/utils.js";
8
+ import { TipLayer as ge } from "../TipLayer.js";
9
+ import { ChannelsAdminTab as fe } from "./ChannelArchive.js";
10
10
  import { useUserSearch as ke } from "./chat-core.js";
11
- import { HuddleAnalyticsTab as fe } from "./HuddleAnalyticsTab.js";
12
- const U = {
11
+ import { HuddleAnalyticsTab as Ne } from "./HuddleAnalyticsTab.js";
12
+ const z = {
13
13
  dm: "Direct message",
14
14
  group: "Group conversation",
15
15
  channel: "Channel",
16
16
  general: "General",
17
17
  record: "Record room"
18
- }, Ne = {
18
+ }, ve = {
19
19
  dm: "DM",
20
20
  group: "Group",
21
21
  channel: "Channel",
22
22
  general: "General",
23
23
  record: "Record"
24
24
  };
25
- function X(s) {
25
+ function J(s) {
26
26
  if (s == null) return "—";
27
27
  if (s < 1) return "under a minute";
28
28
  if (s < 60) return `${Math.round(s)} min`;
@@ -36,7 +36,7 @@ function C({ label: s, value: i, sub: o }) {
36
36
  o && /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11.5px] text-slate-500 dark:text-slate-400", children: o })
37
37
  ] });
38
38
  }
39
- function J({
39
+ function Y({
40
40
  values: s,
41
41
  labels: i,
42
42
  tips: o,
@@ -97,7 +97,7 @@ function S({
97
97
  i
98
98
  ] });
99
99
  }
100
- function Y({
100
+ function Z({
101
101
  rows: s,
102
102
  empty: i,
103
103
  onOpen: o
@@ -136,18 +136,18 @@ function Y({
136
136
  ] }, r.room)) })
137
137
  ] });
138
138
  }
139
- function ve({ onOpenRoom: s }) {
140
- const i = z(), [o, h] = b(30), { data: r, isLoading: a, isError: p, refetch: u, isFetching: c } = K({
139
+ function ye({ onOpenRoom: s }) {
140
+ const i = P(), [o, h] = b(30), { data: r, isLoading: a, isError: p, refetch: u, isFetching: c } = B({
141
141
  queryKey: ["nvr-chat-analytics", o],
142
142
  queryFn: () => i.request(A("/chat/admin/analytics", { days: o })).then((d) => d.data),
143
143
  staleTime: 6e4
144
144
  }), m = (r == null ? void 0 : r.per_day) ?? [], n = m.map(
145
145
  (d) => `${(/* @__PURE__ */ new Date(`${d.day}T12:00:00`)).toLocaleDateString("en-US", { month: "short", day: "numeric" })}: ${d.messages} message${d.messages === 1 ? "" : "s"} from ${d.senders} ${d.senders === 1 ? "person" : "people"}`
146
- ), x = xe(() => {
146
+ ), x = be(() => {
147
147
  const d = m.length;
148
148
  if (!d) return [];
149
- const k = Math.max(1, Math.ceil(d / 6)), w = [];
150
- for (let _ = 0; _ < d; _ += k)
149
+ const f = Math.max(1, Math.ceil(d / 6)), w = [];
150
+ for (let _ = 0; _ < d; _ += f)
151
151
  w.push({
152
152
  index: _,
153
153
  text: (/* @__PURE__ */ new Date(`${m[_].day}T12:00:00`)).toLocaleDateString("en-US", {
@@ -184,7 +184,7 @@ function ve({ onOpenRoom: s }) {
184
184
  onClick: () => void u(),
185
185
  className: "inline-flex items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 py-1 text-[12px] text-slate-600 hover:bg-slate-50 dark:border-border dark:bg-card dark:text-slate-300 dark:hover:bg-muted",
186
186
  children: [
187
- /* @__PURE__ */ e(ie, { className: v("h-3.5 w-3.5", c && "animate-spin") }),
187
+ /* @__PURE__ */ e(oe, { className: v("h-3.5 w-3.5", c && "animate-spin") }),
188
188
  " Refresh"
189
189
  ]
190
190
  }
@@ -207,7 +207,7 @@ function ve({ onOpenRoom: s }) {
207
207
  },
208
208
  d
209
209
  )) }),
210
- r && /* @__PURE__ */ t(de, { children: [
210
+ r && /* @__PURE__ */ t(ie, { children: [
211
211
  r.window.truncated && /* @__PURE__ */ e("p", { className: "text-[12px] text-amber-700 dark:text-amber-400", children: "Only the newest 50,000 messages in this window were counted." }),
212
212
  /* @__PURE__ */ t(
213
213
  "div",
@@ -222,8 +222,8 @@ function ve({ onOpenRoom: s }) {
222
222
  C,
223
223
  {
224
224
  label: "DM reply time",
225
- value: X(r.dm_response.median_minutes),
226
- sub: r.dm_response.samples ? `median of ${r.dm_response.samples} replies · 90% within ${X(r.dm_response.p90_minutes)}` : "no replies in this window"
225
+ value: J(r.dm_response.median_minutes),
226
+ sub: r.dm_response.samples ? `median of ${r.dm_response.samples} replies · 90% within ${J(r.dm_response.p90_minutes)}` : "no replies in this window"
227
227
  }
228
228
  ),
229
229
  /* @__PURE__ */ e(
@@ -244,7 +244,7 @@ function ve({ onOpenRoom: s }) {
244
244
  }
245
245
  ),
246
246
  /* @__PURE__ */ e(S, { title: "Messages per day", note: `Last ${r.window.days} days`, children: /* @__PURE__ */ e(
247
- J,
247
+ Y,
248
248
  {
249
249
  values: m.map((d) => d.messages),
250
250
  labels: m.map((d) => `${d.day} ${d.messages}`),
@@ -254,12 +254,12 @@ function ve({ onOpenRoom: s }) {
254
254
  ) }),
255
255
  /* @__PURE__ */ t("div", { className: "grid gap-4 lg:grid-cols-2", children: [
256
256
  /* @__PURE__ */ e(S, { title: "When people write", note: "Messages by hour of day", children: /* @__PURE__ */ e(
257
- J,
257
+ Y,
258
258
  {
259
259
  values: r.by_hour,
260
- labels: r.by_hour.map((d, k) => `${y(k)} ${d}`),
260
+ labels: r.by_hour.map((d, f) => `${y(f)} ${d}`),
261
261
  tips: r.by_hour.map(
262
- (d, k) => `${y(k)}m–${y((k + 1) % 24)}m: ${d} message${d === 1 ? "" : "s"}`
262
+ (d, f) => `${y(f)}m–${y((f + 1) % 24)}m: ${d} message${d === 1 ? "" : "s"}`
263
263
  ),
264
264
  height: 96,
265
265
  axis: [0, 6, 12, 18].map((d) => ({ index: d, text: y(d) }))
@@ -273,13 +273,13 @@ function ve({ onOpenRoom: s }) {
273
273
  /* @__PURE__ */ e("th", { className: "pb-1.5 pl-3 font-medium", children: "Share" })
274
274
  ] }) }),
275
275
  /* @__PURE__ */ e("tbody", { children: r.by_kind.map((d) => {
276
- const k = r.totals.messages ? d.messages / r.totals.messages * 100 : 0;
276
+ const f = r.totals.messages ? d.messages / r.totals.messages * 100 : 0;
277
277
  return /* @__PURE__ */ t(
278
278
  "tr",
279
279
  {
280
280
  className: "border-t border-slate-100 dark:border-border/60",
281
281
  children: [
282
- /* @__PURE__ */ e("td", { className: "py-1.5 text-slate-800 dark:text-slate-100", children: U[d.kind] }),
282
+ /* @__PURE__ */ e("td", { className: "py-1.5 text-slate-800 dark:text-slate-100", children: z[d.kind] }),
283
283
  /* @__PURE__ */ e("td", { className: "py-1.5 text-right text-slate-700 dark:text-slate-200", children: d.rooms }),
284
284
  /* @__PURE__ */ e("td", { className: "py-1.5 text-right text-slate-700 dark:text-slate-200", children: d.messages }),
285
285
  /* @__PURE__ */ e("td", { className: "py-1.5 pl-3", children: /* @__PURE__ */ t("span", { className: "flex items-center gap-2", children: [
@@ -287,11 +287,11 @@ function ve({ onOpenRoom: s }) {
287
287
  "span",
288
288
  {
289
289
  className: "block h-1.5 rounded-full bg-nvr-cyan",
290
- style: { width: `${k}%` }
290
+ style: { width: `${f}%` }
291
291
  }
292
292
  ) }),
293
293
  /* @__PURE__ */ t("span", { className: "w-9 text-right text-[11px] text-slate-500 dark:text-slate-400", children: [
294
- Math.round(k),
294
+ Math.round(f),
295
295
  "%"
296
296
  ] })
297
297
  ] }) })
@@ -304,7 +304,7 @@ function ve({ onOpenRoom: s }) {
304
304
  ] }),
305
305
  /* @__PURE__ */ t("div", { className: "grid gap-4 lg:grid-cols-2", children: [
306
306
  /* @__PURE__ */ e(S, { title: "Busiest channels", children: /* @__PURE__ */ e(
307
- Y,
307
+ Z,
308
308
  {
309
309
  rows: r.busiest_channels,
310
310
  empty: "No channel messages in this window.",
@@ -312,7 +312,7 @@ function ve({ onOpenRoom: s }) {
312
312
  }
313
313
  ) }),
314
314
  /* @__PURE__ */ e(S, { title: "Busiest record conversations", children: /* @__PURE__ */ e(
315
- Y,
315
+ Z,
316
316
  {
317
317
  rows: r.busiest_records,
318
318
  empty: "No record conversations in this window.",
@@ -323,7 +323,7 @@ function ve({ onOpenRoom: s }) {
323
323
  ] })
324
324
  ] });
325
325
  }
326
- function Z({
326
+ function ee({
327
327
  label: s,
328
328
  value: i,
329
329
  onChange: o
@@ -339,7 +339,7 @@ function Z({
339
339
  onClick: () => o(null),
340
340
  "aria-label": `Clear ${s}`,
341
341
  className: "rounded p-0.5 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-100",
342
- children: /* @__PURE__ */ e(P, { className: "h-3 w-3" })
342
+ children: /* @__PURE__ */ e(K, { className: "h-3 w-3" })
343
343
  }
344
344
  )
345
345
  ] }) : /* @__PURE__ */ t("div", { className: "relative", children: [
@@ -376,17 +376,17 @@ function Z({
376
376
  }) })
377
377
  ] });
378
378
  }
379
- function ee(s) {
379
+ function te(s) {
380
380
  return s.kind === "group" && s.participant_count ? `${s.room_label} · ${s.participant_count} people` : s.room_label;
381
381
  }
382
- function te({ kind: s }) {
383
- return /* @__PURE__ */ e("span", { className: "inline-flex shrink-0 rounded border border-slate-200 px-1.5 text-[10.5px] font-medium text-slate-600 dark:border-border dark:text-slate-300", children: Ne[s] });
382
+ function ae({ kind: s }) {
383
+ return /* @__PURE__ */ e("span", { className: "inline-flex shrink-0 rounded border border-slate-200 px-1.5 text-[10.5px] font-medium text-slate-600 dark:border-border dark:text-slate-300", children: ve[s] });
384
384
  }
385
- function ye({
385
+ function we({
386
386
  room: s,
387
387
  onRoomChange: i
388
388
  }) {
389
- const o = z(), [h, r] = b(null), [a, p] = b(null), [u, c] = b([]), [m, n] = b(""), [x, y] = b(""), [d, k] = b(""), [w, _] = b(""), [E, ae] = b(!1), [W, se] = b(!1), [M, F] = b(1), [D, R] = b(null), I = 50, H = {
389
+ const o = P(), [h, r] = b(null), [a, p] = b(null), [u, c] = b([]), [m, n] = b(""), [x, y] = b(""), [d, f] = b(""), [w, _] = b(""), [E, se] = b(!1), [W, re] = b(!1), [M, F] = b(1), [D, R] = b(null), I = 50, H = {
390
390
  ...h ? { sender: h.id } : {},
391
391
  ...a ? { participant: a.id } : {},
392
392
  ...s ? { room: s.room } : {},
@@ -398,11 +398,11 @@ function ye({
398
398
  ...W ? { include_deleted: "1" } : {},
399
399
  page: M,
400
400
  limit: I
401
- }, { data: $, isLoading: j, isError: re, isFetching: le } = K({
401
+ }, { data: $, isLoading: j, isError: le, isFetching: ne } = B({
402
402
  queryKey: ["nvr-chat-admin-messages", H],
403
403
  queryFn: () => o.request(A("/chat/admin/messages", H)),
404
404
  placeholderData: (l) => l
405
- }), G = ($ == null ? void 0 : $.data) ?? [], T = ($ == null ? void 0 : $.total) ?? 0, L = Math.max(1, Math.ceil(T / I)), f = () => F(1);
405
+ }), G = ($ == null ? void 0 : $.data) ?? [], T = ($ == null ? void 0 : $.total) ?? 0, L = Math.max(1, Math.ceil(T / I)), k = () => F(1);
406
406
  return /* @__PURE__ */ t("div", { className: "space-y-3", children: [
407
407
  /* @__PURE__ */ t(
408
408
  "p",
@@ -410,29 +410,29 @@ function ye({
410
410
  className: "flex items-start gap-2 rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-[12.5px] text-amber-900 dark:border-amber-900/60 dark:bg-amber-950/40 dark:text-amber-200",
411
411
  "data-chat-admin-notice": !0,
412
412
  children: [
413
- /* @__PURE__ */ e(oe, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
413
+ /* @__PURE__ */ e(ce, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
414
414
  /* @__PURE__ */ e("span", { children: "This tab shows private conversations, direct messages included. Every search you run and every message you open here is recorded in the activity log under your name." })
415
415
  ]
416
416
  }
417
417
  ),
418
418
  /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2", "data-chat-admin-filters": !0, children: [
419
419
  /* @__PURE__ */ e(
420
- Z,
420
+ ee,
421
421
  {
422
422
  label: "From",
423
423
  value: h,
424
424
  onChange: (l) => {
425
- r(l), f();
425
+ r(l), k();
426
426
  }
427
427
  }
428
428
  ),
429
429
  /* @__PURE__ */ e(
430
- Z,
430
+ ee,
431
431
  {
432
432
  label: "With",
433
433
  value: a,
434
434
  onChange: (l) => {
435
- p(l), f();
435
+ p(l), k();
436
436
  }
437
437
  }
438
438
  ),
@@ -444,11 +444,11 @@ function ye({
444
444
  {
445
445
  type: "button",
446
446
  onClick: () => {
447
- i(null), f();
447
+ i(null), k();
448
448
  },
449
449
  "aria-label": "Clear room",
450
450
  className: "rounded p-0.5 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-100",
451
- children: /* @__PURE__ */ e(P, { className: "h-3 w-3" })
451
+ children: /* @__PURE__ */ e(K, { className: "h-3 w-3" })
452
452
  }
453
453
  )
454
454
  ] }),
@@ -457,17 +457,17 @@ function ye({
457
457
  {
458
458
  className: "relative",
459
459
  onSubmit: (l) => {
460
- l.preventDefault(), y(m), f();
460
+ l.preventDefault(), y(m), k();
461
461
  },
462
462
  children: [
463
- /* @__PURE__ */ e(ce, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
463
+ /* @__PURE__ */ e(me, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
464
464
  /* @__PURE__ */ e(
465
465
  "input",
466
466
  {
467
467
  value: m,
468
468
  onChange: (l) => n(l.target.value),
469
469
  onBlur: () => {
470
- m !== x && (y(m), f());
470
+ m !== x && (y(m), k());
471
471
  },
472
472
  placeholder: "Words in the message",
473
473
  className: "h-8 w-52 rounded-md border border-slate-200 bg-white pl-7 pr-2 text-[12px] outline-none focus:border-slate-400 dark:border-border dark:bg-card",
@@ -485,7 +485,7 @@ function ye({
485
485
  type: "date",
486
486
  value: d,
487
487
  onChange: (l) => {
488
- k(l.target.value), f();
488
+ f(l.target.value), k();
489
489
  },
490
490
  className: "h-8 rounded-md border border-slate-200 bg-white px-1.5 text-[12px] dark:border-border dark:bg-card"
491
491
  }
@@ -499,7 +499,7 @@ function ye({
499
499
  type: "date",
500
500
  value: w,
501
501
  onChange: (l) => {
502
- _(l.target.value), f();
502
+ _(l.target.value), k();
503
503
  },
504
504
  className: "h-8 rounded-md border border-slate-200 bg-white px-1.5 text-[12px] dark:border-border dark:bg-card"
505
505
  }
@@ -507,7 +507,7 @@ function ye({
507
507
  ] })
508
508
  ] }),
509
509
  /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-1.5", children: [
510
- Object.keys(U).map((l) => {
510
+ Object.keys(z).map((l) => {
511
511
  const q = u.includes(l);
512
512
  return /* @__PURE__ */ e(
513
513
  "button",
@@ -515,14 +515,14 @@ function ye({
515
515
  type: "button",
516
516
  "aria-pressed": q,
517
517
  onClick: () => {
518
- c((Q) => q ? Q.filter((ne) => ne !== l) : [...Q, l]), f();
518
+ c((Q) => q ? Q.filter((de) => de !== l) : [...Q, l]), k();
519
519
  },
520
520
  className: v(
521
521
  "h-7 rounded-full border px-2.5 text-[12px]",
522
522
  q ? "border-[#1e293b] bg-[#0f172a] text-[#ffffff] dark:border-[#e2e8f0] dark:bg-[#e2e8f0] dark:text-[#0f172a]" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 dark:border-border dark:bg-card dark:text-slate-300"
523
523
  ),
524
524
  "data-chat-admin-kind": l,
525
- children: U[l]
525
+ children: z[l]
526
526
  },
527
527
  l
528
528
  );
@@ -535,7 +535,7 @@ function ye({
535
535
  type: "checkbox",
536
536
  checked: E,
537
537
  onChange: (l) => {
538
- ae(l.target.checked), f();
538
+ se(l.target.checked), k();
539
539
  }
540
540
  }
541
541
  ),
@@ -548,7 +548,7 @@ function ye({
548
548
  type: "checkbox",
549
549
  checked: W,
550
550
  onChange: (l) => {
551
- se(l.target.checked), f();
551
+ re(l.target.checked), k();
552
552
  }
553
553
  }
554
554
  ),
@@ -567,7 +567,7 @@ function ye({
567
567
  /* @__PURE__ */ t("div", { className: "flex items-center justify-between border-b border-slate-100 px-3 py-2 text-[12px] text-slate-500 dark:border-border/60 dark:text-slate-400", children: [
568
568
  /* @__PURE__ */ t("span", { "data-chat-admin-total": T, children: [
569
569
  j ? "Loading…" : `${T.toLocaleString()} message${T === 1 ? "" : "s"}`,
570
- le && !j && " · updating…"
570
+ ne && !j && " · updating…"
571
571
  ] }),
572
572
  L > 1 && /* @__PURE__ */ t("span", { className: "flex items-center gap-1", children: [
573
573
  /* @__PURE__ */ e(
@@ -578,7 +578,7 @@ function ye({
578
578
  onClick: () => F((l) => l - 1),
579
579
  className: "rounded p-1 hover:bg-slate-100 disabled:opacity-40 dark:hover:bg-muted",
580
580
  "aria-label": "Previous page",
581
- children: /* @__PURE__ */ e(me, { className: "h-3.5 w-3.5" })
581
+ children: /* @__PURE__ */ e(he, { className: "h-3.5 w-3.5" })
582
582
  }
583
583
  ),
584
584
  /* @__PURE__ */ t("span", { className: "tabular-nums", children: [
@@ -594,12 +594,12 @@ function ye({
594
594
  onClick: () => F((l) => l + 1),
595
595
  className: "rounded p-1 hover:bg-slate-100 disabled:opacity-40 dark:hover:bg-muted",
596
596
  "aria-label": "Next page",
597
- children: /* @__PURE__ */ e(he, { className: "h-3.5 w-3.5" })
597
+ children: /* @__PURE__ */ e(pe, { className: "h-3.5 w-3.5" })
598
598
  }
599
599
  )
600
600
  ] })
601
601
  ] }),
602
- re ? /* @__PURE__ */ e("p", { className: "px-3 py-6 text-center text-[12.5px] text-red-600 dark:text-red-400", children: "Couldn't load messages." }) : !j && G.length === 0 ? /* @__PURE__ */ e("p", { className: "px-3 py-8 text-center text-[12.5px] text-slate-500 dark:text-slate-400", children: "No messages match these filters." }) : /* @__PURE__ */ t("table", { className: "w-full table-fixed text-[12.5px]", children: [
602
+ le ? /* @__PURE__ */ e("p", { className: "px-3 py-6 text-center text-[12.5px] text-red-600 dark:text-red-400", children: "Couldn't load messages." }) : !j && G.length === 0 ? /* @__PURE__ */ e("p", { className: "px-3 py-8 text-center text-[12.5px] text-slate-500 dark:text-slate-400", children: "No messages match these filters." }) : /* @__PURE__ */ t("table", { className: "w-full table-fixed text-[12.5px]", children: [
603
603
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { className: "border-b border-slate-100 text-left text-[10.5px] uppercase tracking-[0.06em] text-slate-500 dark:border-border/60 dark:text-slate-400", children: [
604
604
  /* @__PURE__ */ e("th", { className: "w-[132px] px-3 py-1.5 font-medium", children: "When" }),
605
605
  /* @__PURE__ */ e("th", { className: "w-[150px] px-2 py-1.5 font-medium", children: "From" }),
@@ -626,13 +626,13 @@ function ye({
626
626
  ),
627
627
  /* @__PURE__ */ e("td", { className: "truncate px-2 py-2 font-medium text-slate-800 dark:text-slate-100", children: l.sender_name ?? "Unknown" }),
628
628
  /* @__PURE__ */ e("td", { className: "px-2 py-2", children: /* @__PURE__ */ t("span", { className: "flex min-w-0 items-center gap-1.5", children: [
629
- /* @__PURE__ */ e(te, { kind: l.kind }),
629
+ /* @__PURE__ */ e(ae, { kind: l.kind }),
630
630
  /* @__PURE__ */ e(
631
631
  "span",
632
632
  {
633
633
  className: "truncate text-slate-700 dark:text-slate-200",
634
- title: ee(l),
635
- children: ee(l)
634
+ title: te(l),
635
+ children: te(l)
636
636
  }
637
637
  )
638
638
  ] }) }),
@@ -640,7 +640,7 @@ function ye({
640
640
  /* @__PURE__ */ e("span", { className: "line-clamp-2 break-words text-slate-800 dark:text-slate-100", children: l.deleted_at ? /* @__PURE__ */ e("em", { className: "text-slate-500 dark:text-slate-400", children: "Deleted" }) : l.message || /* @__PURE__ */ e("em", { className: "text-slate-500 dark:text-slate-400", children: "(no text)" }) }),
641
641
  (l.attachment_count > 0 || l.reaction_count > 0 || l.edited_at || l.masquerade) && /* @__PURE__ */ t("span", { className: "mt-0.5 flex flex-wrap gap-2 text-[11px] text-slate-500 dark:text-slate-400", children: [
642
642
  l.attachment_count > 0 && /* @__PURE__ */ t("span", { className: "inline-flex items-center gap-0.5", children: [
643
- /* @__PURE__ */ e(O, { className: "h-3 w-3" }),
643
+ /* @__PURE__ */ e(U, { className: "h-3 w-3" }),
644
644
  " ",
645
645
  l.attachment_count
646
646
  ] }),
@@ -660,12 +660,12 @@ function ye({
660
660
  ] })
661
661
  ] }),
662
662
  D != null && /* @__PURE__ */ e(
663
- we,
663
+ _e,
664
664
  {
665
665
  id: D,
666
666
  onClose: () => R(null),
667
667
  onRoom: (l) => {
668
- i(l), R(null), f();
668
+ i(l), R(null), k();
669
669
  }
670
670
  }
671
671
  )
@@ -680,7 +680,7 @@ function g({ label: s, children: i }) {
680
680
  /* @__PURE__ */ e("dd", { className: "min-w-0 text-slate-800 dark:text-slate-100", children: i })
681
681
  ] });
682
682
  }
683
- function B({ m: s, target: i }) {
683
+ function O({ m: s, target: i }) {
684
684
  return /* @__PURE__ */ t(
685
685
  "div",
686
686
  {
@@ -700,12 +700,12 @@ function B({ m: s, target: i }) {
700
700
  }
701
701
  );
702
702
  }
703
- function we({
703
+ function _e({
704
704
  id: s,
705
705
  onClose: i,
706
706
  onRoom: o
707
707
  }) {
708
- const h = z(), { apiBase: r } = be(), { data: a, isLoading: p, isError: u } = K({
708
+ const h = P(), { apiBase: r } = ue(), { data: a, isLoading: p, isError: u } = B({
709
709
  queryKey: ["nvr-chat-admin-message", s],
710
710
  queryFn: () => h.request(A(`/chat/admin/messages/${s}`)).then((n) => n.data)
711
711
  }), c = (a == null ? void 0 : a.reads.filter(
@@ -731,7 +731,7 @@ function we({
731
731
  onClick: i,
732
732
  "aria-label": "Close",
733
733
  className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-100",
734
- children: /* @__PURE__ */ e(P, { className: "h-4 w-4" })
734
+ children: /* @__PURE__ */ e(K, { className: "h-4 w-4" })
735
735
  }
736
736
  )
737
737
  ] }),
@@ -750,7 +750,7 @@ function we({
750
750
  ". Only the final text is kept."
751
751
  ] }),
752
752
  a.message.masquerade_admin_name && /* @__PURE__ */ t("p", { className: "mt-1 flex items-center gap-1 text-[11.5px] text-violet-700 dark:text-violet-300", children: [
753
- /* @__PURE__ */ e(pe, { className: "h-3 w-3" }),
753
+ /* @__PURE__ */ e(xe, { className: "h-3 w-3" }),
754
754
  "Sent by ",
755
755
  a.message.masquerade_admin_name,
756
756
  " while signed in as",
@@ -771,7 +771,7 @@ function we({
771
771
  ] })
772
772
  ] }),
773
773
  /* @__PURE__ */ e(g, { label: "Where", children: /* @__PURE__ */ t("span", { className: "flex flex-wrap items-center gap-1.5", children: [
774
- /* @__PURE__ */ e(te, { kind: a.room.kind }),
774
+ /* @__PURE__ */ e(ae, { kind: a.room.kind }),
775
775
  /* @__PURE__ */ e(
776
776
  "button",
777
777
  {
@@ -794,13 +794,13 @@ function we({
794
794
  target: "_blank",
795
795
  rel: "noreferrer",
796
796
  children: [
797
- /* @__PURE__ */ e(O, { className: "h-3 w-3" }),
797
+ /* @__PURE__ */ e(U, { className: "h-3 w-3" }),
798
798
  " ",
799
799
  n.name
800
800
  ]
801
801
  }
802
802
  ),
803
- n.size != null && /* @__PURE__ */ e("span", { className: "ml-1 text-[11px] text-slate-500 dark:text-slate-400", children: n.size >= 1048576 ? `${(n.size / 1048576).toFixed(1)} MB` : `${Math.max(1, Math.round(n.size / 1024))} KB` })
803
+ n.size != null && /* @__PURE__ */ e("span", { className: "ml-1 text-[11px] text-slate-500 dark:text-slate-400", children: n.size >= 1048576 ? X(n.size) : `${Math.max(1, Math.round(n.size / 1024))} KB` })
804
804
  ] }, n.id)) }) }),
805
805
  a.reactions.length > 0 && /* @__PURE__ */ e(g, { label: "Reactions", children: a.reactions.map((n) => `${n.emoji} ${n.name ?? "Someone"}`).join(", ") }),
806
806
  (m.length > 0 || c.length > 0) && /* @__PURE__ */ t(g, { label: "Read", children: [
@@ -869,13 +869,13 @@ function we({
869
869
  target: "_blank",
870
870
  rel: "noreferrer",
871
871
  children: [
872
- /* @__PURE__ */ e(O, { className: "h-3 w-3" }),
872
+ /* @__PURE__ */ e(U, { className: "h-3 w-3" }),
873
873
  " ",
874
874
  x.name ?? `File ${x.id}`
875
875
  ]
876
876
  }
877
877
  ),
878
- x.size != null && /* @__PURE__ */ e("span", { className: "ml-1 text-[11px] text-slate-500 dark:text-slate-400", children: x.size >= 1048576 ? `${(x.size / 1048576).toFixed(1)} MB` : `${Math.max(1, Math.round(x.size / 1024))} KB` })
878
+ x.size != null && /* @__PURE__ */ e("span", { className: "ml-1 text-[11px] text-slate-500 dark:text-slate-400", children: x.size >= 1048576 ? X(x.size) : `${Math.max(1, Math.round(x.size / 1024))} KB` })
879
879
  ] }, x.id)) })
880
880
  ] }, n.version)) }) })
881
881
  ] }),
@@ -883,9 +883,9 @@ function we({
883
883
  /* @__PURE__ */ e("p", { className: "mb-1.5 text-[11px] font-medium uppercase tracking-[0.06em] text-slate-500 dark:text-slate-400", children: "Conversation around it" }),
884
884
  /* @__PURE__ */ t("div", { className: "space-y-1", children: [
885
885
  a.context.before.length === 0 && /* @__PURE__ */ e("p", { className: "px-2.5 text-[11.5px] text-slate-500 dark:text-slate-400", children: "Start of the conversation." }),
886
- a.context.before.map((n) => /* @__PURE__ */ e(B, { m: n }, n.id)),
886
+ a.context.before.map((n) => /* @__PURE__ */ e(O, { m: n }, n.id)),
887
887
  /* @__PURE__ */ e(
888
- B,
888
+ O,
889
889
  {
890
890
  target: !0,
891
891
  m: {
@@ -899,7 +899,7 @@ function we({
899
899
  }
900
900
  }
901
901
  ),
902
- a.context.after.map((n) => /* @__PURE__ */ e(B, { m: n }, n.id))
902
+ a.context.after.map((n) => /* @__PURE__ */ e(O, { m: n }, n.id))
903
903
  ] }),
904
904
  /* @__PURE__ */ e(
905
905
  "button",
@@ -916,10 +916,10 @@ function we({
916
916
  }
917
917
  );
918
918
  }
919
- function qe() {
919
+ function Oe() {
920
920
  const [s, i] = b("overview"), [o, h] = b(null);
921
921
  return /* @__PURE__ */ t("div", { className: "space-y-4", "data-chat-analytics": !0, children: [
922
- /* @__PURE__ */ e(ue, {}),
922
+ /* @__PURE__ */ e(ge, {}),
923
923
  /* @__PURE__ */ e("div", { className: "flex gap-1 border-b border-slate-200 dark:border-border", role: "tablist", children: [
924
924
  ["overview", "Overview"],
925
925
  ["messages", "Messages"],
@@ -942,15 +942,15 @@ function qe() {
942
942
  r
943
943
  )) }),
944
944
  s === "overview" ? /* @__PURE__ */ e(
945
- ve,
945
+ ye,
946
946
  {
947
947
  onOpenRoom: (r, a) => {
948
948
  h({ room: r, label: a }), i("messages");
949
949
  }
950
950
  }
951
- ) : s === "channels" ? /* @__PURE__ */ e(ge, {}) : s === "huddles" ? /* @__PURE__ */ e(fe, {}) : /* @__PURE__ */ e(ye, { room: o, onRoomChange: h })
951
+ ) : s === "channels" ? /* @__PURE__ */ e(fe, {}) : s === "huddles" ? /* @__PURE__ */ e(Ne, {}) : /* @__PURE__ */ e(we, { room: o, onRoomChange: h })
952
952
  ] });
953
953
  }
954
954
  export {
955
- qe as ChatAnalyticsView
955
+ Oe as ChatAnalyticsView
956
956
  };