@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.
- package/dist/components/InlineGridField.js +95 -92
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +36 -2
- package/dist/shared/components/AudienceConfirmPanel.js +19 -19
- package/dist/shared/components/BroadcastView.js +213 -211
- package/dist/shared/components/CollectionBrowserView.js +2677 -2658
- package/dist/shared/components/ConfigHistory.js +45 -45
- package/dist/shared/components/ConformanceView.js +110 -110
- package/dist/shared/components/DataTable.js +51 -51
- package/dist/shared/components/FilePreviewLightbox.js +26 -25
- package/dist/shared/components/ItemEditForm.js +3038 -3027
- package/dist/shared/components/LiveCount.js +27 -23
- package/dist/shared/components/LiveTraceView.js +62 -61
- package/dist/shared/components/PageRenderer.js +422 -410
- package/dist/shared/components/ProfileView.js +199 -199
- package/dist/shared/components/QualityRulesView.js +70 -70
- package/dist/shared/components/QueryTable.js +131 -130
- package/dist/shared/components/RecordGraph.js +98 -98
- package/dist/shared/components/RecordReadView.js +287 -288
- package/dist/shared/components/ReportView.js +1279 -1259
- package/dist/shared/components/SlaRulesView.js +73 -74
- package/dist/shared/components/WidgetSlot.js +73 -73
- package/dist/shared/components/ai/AiChart.js +36 -32
- package/dist/shared/components/ai/AiMarkdown.js +136 -129
- package/dist/shared/components/ai/TaskDo.js +87 -87
- package/dist/shared/components/ai/answer-formats.js +37 -30
- package/dist/shared/components/ai/call-log/format.js +17 -16
- package/dist/shared/components/bulk/BulkActionButtons.js +66 -66
- package/dist/shared/components/bulk/BulkFieldUpdate.js +59 -59
- package/dist/shared/components/bulk/BulkSelectionNotices.js +34 -34
- package/dist/shared/components/bulk/MessageStakeholders.js +31 -29
- package/dist/shared/components/bulk/PushBulkButtons.js +83 -82
- package/dist/shared/components/bulk/bulk-field-options.js +10 -10
- package/dist/shared/components/cbv/column-totals.js +53 -51
- package/dist/shared/components/chat/ChatAnalyticsView.js +87 -87
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +18 -18
- package/dist/shared/components/command-center/announce.js +7 -6
- package/dist/shared/components/command-center/panels/AttentionPanel.js +32 -31
- package/dist/shared/components/command-center/panels/FlowPanel.js +29 -28
- package/dist/shared/components/command-center/panels/PeoplePanel.js +39 -39
- package/dist/shared/components/delegation/DelegationConsoleView.js +27 -27
- package/dist/shared/components/imports/RunDetailSheet.js +1 -1
- package/dist/shared/components/integrations/IntegrationObligationsView.js +119 -119
- package/dist/shared/components/integrations/console/EventsView.js +35 -35
- package/dist/shared/components/integrations/console/FirefightView.js +15 -14
- package/dist/shared/components/integrations/console/PartnerDetail.js +78 -78
- package/dist/shared/components/integrations/console/ReadyToSendView.js +103 -103
- package/dist/shared/components/integrations/console/SignalCard.js +67 -67
- package/dist/shared/components/item-edit/CatalogPickerField.js +536 -527
- package/dist/shared/components/item-edit/ChangesTray.js +88 -74
- package/dist/shared/components/item-edit/FilePickerField.js +123 -123
- package/dist/shared/components/item-edit/GroupSection.js +301 -292
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +54 -54
- package/dist/shared/components/item-edit/InlineGridField.js +45 -36
- package/dist/shared/components/item-edit/InlineTableField.js +1167 -1153
- package/dist/shared/components/item-edit/NestedRelationEditor.js +106 -99
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +11 -11
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +43 -44
- package/dist/shared/components/monitoring/ApiRequestLog.js +35 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +268 -268
- package/dist/shared/components/ops-report/format.js +37 -36
- package/dist/shared/components/panels/ReferencedByPanel.js +21 -20
- package/dist/shared/components/panels/RevisionsPanel.js +306 -305
- package/dist/shared/components/pipeline/OwnerMatrixVersionsCard.js +12 -12
- package/dist/shared/components/pipeline/PipelineEditorView.js +483 -482
- package/dist/shared/components/pipeline/PipelineHealthCards.js +33 -32
- package/dist/shared/components/pipeline/TeamsView.js +189 -130
- package/dist/shared/components/profile/AgentsPanel.js +6 -6
- package/dist/shared/components/profile/DelegationCard.js +13 -12
- package/dist/shared/components/profile/PersonActivity.js +48 -48
- package/dist/shared/components/profile/PersonExtras.js +107 -107
- package/dist/shared/components/profile/PersonWeek.js +9 -9
- package/dist/shared/components/queue/QueueBulkBar.js +19 -18
- package/dist/shared/components/queue/QueueBulkMove.js +21 -20
- package/dist/shared/components/queue/QueueItemSheet.js +136 -131
- package/dist/shared/components/queue/QueueWorklist.js +671 -670
- package/dist/shared/components/queue/worklist-helpers.js +36 -21
- package/dist/shared/components/support/RequestList.js +121 -121
- package/dist/shared/components/support/SupportAnalytics.js +29 -29
- package/dist/shared/lib/activity-sentence.js +251 -229
- package/dist/shared/lib/format-value.js +5 -4
- package/dist/shared/lib/number-format.js +87 -0
- package/dist/shared/lib/number-kind.js +133 -0
- package/dist/shared/lib/utils.js +24 -20
- package/dist/shared/lib/watch-list.js +1 -1
- package/dist/shared/lib/widget-value-format.js +26 -12
- package/package.json +1 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { jsxs as t, jsx as e, Fragment as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { RotateCw as
|
|
4
|
-
import { useState as b, useMemo as
|
|
5
|
-
import { useNivaroClient as
|
|
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
|
|
9
|
-
import { ChannelsAdminTab as
|
|
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
|
|
12
|
-
const
|
|
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
|
-
},
|
|
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
|
|
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
|
|
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
|
|
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
|
|
140
|
-
const i =
|
|
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 =
|
|
146
|
+
), x = be(() => {
|
|
147
147
|
const d = m.length;
|
|
148
148
|
if (!d) return [];
|
|
149
|
-
const
|
|
150
|
-
for (let _ = 0; _ < d; _ +=
|
|
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(
|
|
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(
|
|
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:
|
|
226
|
-
sub: r.dm_response.samples ? `median of ${r.dm_response.samples} replies · 90% within ${
|
|
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
|
-
|
|
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
|
-
|
|
257
|
+
Y,
|
|
258
258
|
{
|
|
259
259
|
values: r.by_hour,
|
|
260
|
-
labels: r.by_hour.map((d,
|
|
260
|
+
labels: r.by_hour.map((d, f) => `${y(f)} ${d}`),
|
|
261
261
|
tips: r.by_hour.map(
|
|
262
|
-
(d,
|
|
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
|
|
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:
|
|
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: `${
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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(
|
|
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
|
|
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
|
|
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:
|
|
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
|
|
385
|
+
function we({
|
|
386
386
|
room: s,
|
|
387
387
|
onRoomChange: i
|
|
388
388
|
}) {
|
|
389
|
-
const o =
|
|
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:
|
|
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)),
|
|
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(
|
|
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
|
-
|
|
420
|
+
ee,
|
|
421
421
|
{
|
|
422
422
|
label: "From",
|
|
423
423
|
value: h,
|
|
424
424
|
onChange: (l) => {
|
|
425
|
-
r(l),
|
|
425
|
+
r(l), k();
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
428
|
),
|
|
429
429
|
/* @__PURE__ */ e(
|
|
430
|
-
|
|
430
|
+
ee,
|
|
431
431
|
{
|
|
432
432
|
label: "With",
|
|
433
433
|
value: a,
|
|
434
434
|
onChange: (l) => {
|
|
435
|
-
p(l),
|
|
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),
|
|
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(
|
|
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),
|
|
460
|
+
l.preventDefault(), y(m), k();
|
|
461
461
|
},
|
|
462
462
|
children: [
|
|
463
|
-
/* @__PURE__ */ e(
|
|
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),
|
|
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
|
-
|
|
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),
|
|
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(
|
|
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((
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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(
|
|
597
|
+
children: /* @__PURE__ */ e(pe, { className: "h-3.5 w-3.5" })
|
|
598
598
|
}
|
|
599
599
|
)
|
|
600
600
|
] })
|
|
601
601
|
] }),
|
|
602
|
-
|
|
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(
|
|
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:
|
|
635
|
-
children:
|
|
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(
|
|
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
|
-
|
|
663
|
+
_e,
|
|
664
664
|
{
|
|
665
665
|
id: D,
|
|
666
666
|
onClose: () => R(null),
|
|
667
667
|
onRoom: (l) => {
|
|
668
|
-
i(l), R(null),
|
|
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
|
|
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
|
|
703
|
+
function _e({
|
|
704
704
|
id: s,
|
|
705
705
|
onClose: i,
|
|
706
706
|
onRoom: o
|
|
707
707
|
}) {
|
|
708
|
-
const h =
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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 ?
|
|
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(
|
|
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 ?
|
|
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(
|
|
886
|
+
a.context.before.map((n) => /* @__PURE__ */ e(O, { m: n }, n.id)),
|
|
887
887
|
/* @__PURE__ */ e(
|
|
888
|
-
|
|
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(
|
|
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
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
955
|
+
Oe as ChatAnalyticsView
|
|
956
956
|
};
|