@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,37 +1,37 @@
|
|
|
1
|
-
import { jsxs as a, jsx as t, Fragment as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { ChevronUp as
|
|
4
|
-
import { useState as u, useEffect as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import { useTopInserts as
|
|
8
|
-
import { resolveNotificationTargetFor as
|
|
9
|
-
import { openInTabsMessage as
|
|
10
|
-
import { useRecordPeek as
|
|
11
|
-
import { cn as x, formatRelative as
|
|
12
|
-
import { AgentBadge as
|
|
13
|
-
import { bellGroupLabel as
|
|
14
|
-
import { RelativeTime as
|
|
15
|
-
import { SimpleSelect as
|
|
16
|
-
import { AsItWasSheet as
|
|
17
|
-
import { bundleLocally as
|
|
18
|
-
import { DeliveryChips as
|
|
19
|
-
import { NotificationActions as
|
|
20
|
-
import { NotificationChangesList as
|
|
21
|
-
const
|
|
1
|
+
import { jsxs as a, jsx as t, Fragment as me } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as St, useQuery as H, keepPreviousData as _t, useMutation as D } from "@tanstack/react-query";
|
|
3
|
+
import { ChevronUp as At, Archive as Le, CheckCheck as Dt, Search as $t, Check as pe, AlarmClock as he, ExternalLink as Re, Bell as Pe, ShieldCheck as be, ChevronLeft as zt, ChevronRight as Ft, History as qt, Trash2 as Mt, ChevronDown as Tt } from "lucide-react";
|
|
4
|
+
import { useState as u, useEffect as xe, useRef as Lt, useCallback as Rt, Fragment as fe } from "react";
|
|
5
|
+
import { useNivaroClient as Pt } from "../../context.js";
|
|
6
|
+
import { get as Q, post as S, patch as Ot, del as It } from "../../lib/commands.js";
|
|
7
|
+
import { useTopInserts as Oe, slideIn as Bt } from "../../lib/live-screen.js";
|
|
8
|
+
import { resolveNotificationTargetFor as W, runNotificationTarget as ge } from "../../lib/notification-target.js";
|
|
9
|
+
import { openInTabsMessage as Kt, openInTabs as jt } from "../../lib/open-in-tabs.js";
|
|
10
|
+
import { useRecordPeek as Ut, isNewTabClick as Gt, notificationPeekTarget as Ie } from "../../lib/record-peek.js";
|
|
11
|
+
import { formatNumber as $, cn as x, formatRelative as Be } from "../../lib/utils.js";
|
|
12
|
+
import { AgentBadge as Ht } from "../AgentBadge.js";
|
|
13
|
+
import { bellGroupLabel as Qt, hasSnapshotView as Yt, offersChanges as Vt } from "../NotificationBell.js";
|
|
14
|
+
import { RelativeTime as Ke } from "../RelativeTime.js";
|
|
15
|
+
import { SimpleSelect as ke } from "../ui/SimpleSelect.js";
|
|
16
|
+
import { AsItWasSheet as Wt } from "./AsItWasSheet.js";
|
|
17
|
+
import { bundleLocally as Zt, laneTone as Jt, bundleAsNotification as Xt, bundleHeadline as je, categoryChipLabel as Et } from "./bundles.js";
|
|
18
|
+
import { DeliveryChips as ea } from "./DeliveryChips.js";
|
|
19
|
+
import { NotificationActions as ta } from "./NotificationActions.js";
|
|
20
|
+
import { NotificationChangesList as aa, ResolvedLine as na, NotificationDetailBits as la } from "./NotificationDetailBits.js";
|
|
21
|
+
const ve = 25, ra = [
|
|
22
22
|
{ key: "all", label: "All" },
|
|
23
23
|
{ key: "inbox", label: "Unread" },
|
|
24
24
|
{ key: "read", label: "Read" },
|
|
25
25
|
{ key: "snoozed", label: "Snoozed" },
|
|
26
26
|
{ key: "archived", label: "Archived" },
|
|
27
27
|
{ key: "sent", label: "Sent" }
|
|
28
|
-
],
|
|
28
|
+
], ia = [
|
|
29
29
|
{ key: "all", label: "Every lane" },
|
|
30
30
|
{ key: "critical", label: "Critical" },
|
|
31
31
|
{ key: "needs_you", label: "Needs you" },
|
|
32
32
|
{ key: "fyi", label: "FYI" }
|
|
33
33
|
];
|
|
34
|
-
function
|
|
34
|
+
function Ue() {
|
|
35
35
|
const o = /* @__PURE__ */ new Date(), p = new Date(o.getTime() + 3600 * 1e3), f = new Date(o);
|
|
36
36
|
f.setDate(f.getDate() + 1), f.setHours(8, 0, 0, 0);
|
|
37
37
|
const g = new Date(o);
|
|
@@ -41,113 +41,113 @@ function je() {
|
|
|
41
41
|
{ label: "Until next week", until: g }
|
|
42
42
|
];
|
|
43
43
|
}
|
|
44
|
-
const
|
|
45
|
-
function
|
|
44
|
+
const Ge = (o) => `b:${o.collection}:${o.item}`, He = (o) => `n:${o.id}`;
|
|
45
|
+
function Da({
|
|
46
46
|
routes: o,
|
|
47
47
|
onNavigate: p,
|
|
48
48
|
app: f,
|
|
49
49
|
mailLogUrl: g,
|
|
50
|
-
subscriptionsPath:
|
|
51
|
-
rulesPath:
|
|
52
|
-
changesId:
|
|
50
|
+
subscriptionsPath: Z,
|
|
51
|
+
rulesPath: Ye,
|
|
52
|
+
changesId: ye,
|
|
53
53
|
onNotice: r,
|
|
54
54
|
onError: i,
|
|
55
|
-
className:
|
|
55
|
+
className: Ve
|
|
56
56
|
}) {
|
|
57
|
-
const h =
|
|
58
|
-
if (
|
|
57
|
+
const h = Pt(), J = Ut(), X = St(), [E, We] = u(() => {
|
|
58
|
+
if (ye !== void 0) return ye;
|
|
59
59
|
if (typeof window > "u") return null;
|
|
60
60
|
const e = new URLSearchParams(window.location.search).get("changes"), n = Number(e);
|
|
61
61
|
return e && Number.isInteger(n) && n > 0 ? n : null;
|
|
62
|
-
}), [d,
|
|
63
|
-
queryKey: ["notifications", "sent",
|
|
62
|
+
}), [d, Ze] = u("all"), [N, Je] = u("all"), [Y, Xe] = u(!0), { data: we = [], isLoading: Ee } = H({
|
|
63
|
+
queryKey: ["notifications", "sent", Y],
|
|
64
64
|
queryFn: () => h.request(
|
|
65
|
-
|
|
65
|
+
Q("/notifications/sent", { lane: Y ? "critical" : "all" })
|
|
66
66
|
).then((e) => e.data ?? []),
|
|
67
67
|
enabled: d === "sent",
|
|
68
68
|
refetchInterval: d === "sent" ? 3e4 : !1
|
|
69
|
-
}), [_,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, [d, N, _,
|
|
69
|
+
}), [_, M] = u(1), [et, ee] = u(null), [Ne, Ce] = u(null), [te, tt] = u(""), [T, at] = u(""), [z, nt] = u(""), [K, lt] = u(!0), [rt, it] = u(() => /* @__PURE__ */ new Set()), [C, Se] = u(null), [L, V] = u(() => /* @__PURE__ */ new Set()), [ae, j] = u(!1), [dt, ne] = u(!1), [le, st] = u(!1), [_e, ot] = u("30");
|
|
70
|
+
xe(() => {
|
|
71
|
+
V(/* @__PURE__ */ new Set()), j(!1), ne(!1);
|
|
72
|
+
}, [d, N, _, T, z]), xe(() => {
|
|
73
73
|
const e = setTimeout(() => {
|
|
74
|
-
|
|
74
|
+
at(te.trim()), M(1);
|
|
75
75
|
}, 350);
|
|
76
76
|
return () => clearTimeout(e);
|
|
77
|
-
}, [
|
|
78
|
-
const { data: b } =
|
|
77
|
+
}, [te]);
|
|
78
|
+
const { data: b } = H({
|
|
79
79
|
queryKey: ["notification-count"],
|
|
80
|
-
queryFn: () => h.request(
|
|
81
|
-
}), { data: m, isLoading:
|
|
80
|
+
queryFn: () => h.request(Q("/notifications/unread-count"))
|
|
81
|
+
}), { data: m, isLoading: ct, isPlaceholderData: ut } = H({
|
|
82
82
|
queryKey: [
|
|
83
83
|
"notifications",
|
|
84
84
|
"center",
|
|
85
85
|
d,
|
|
86
86
|
N,
|
|
87
87
|
_,
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
T,
|
|
89
|
+
z,
|
|
90
90
|
f ?? null,
|
|
91
|
-
|
|
91
|
+
K
|
|
92
92
|
],
|
|
93
93
|
queryFn: () => h.request(
|
|
94
|
-
|
|
94
|
+
Q("/notifications", {
|
|
95
95
|
page: _,
|
|
96
|
-
limit:
|
|
96
|
+
limit: ve,
|
|
97
97
|
status: d === "snoozed" || d === "sent" ? "all" : d,
|
|
98
98
|
snoozed: d === "snoozed" ? "true" : void 0,
|
|
99
99
|
lane: N === "all" ? void 0 : N,
|
|
100
|
-
search:
|
|
101
|
-
collection:
|
|
100
|
+
search: T || void 0,
|
|
101
|
+
collection: z || void 0,
|
|
102
102
|
app: f,
|
|
103
|
-
bundle:
|
|
103
|
+
bundle: K ? "record" : void 0
|
|
104
104
|
})
|
|
105
105
|
).then((e) => {
|
|
106
|
-
if (!
|
|
107
|
-
const n =
|
|
106
|
+
if (!K || e.bundles) return e;
|
|
107
|
+
const n = Zt(e.data ?? []);
|
|
108
108
|
return { ...e, data: n.rows, bundles: n.bundles };
|
|
109
109
|
}),
|
|
110
|
-
placeholderData:
|
|
110
|
+
placeholderData: _t,
|
|
111
111
|
enabled: d !== "sent"
|
|
112
|
-
}), { data:
|
|
112
|
+
}), { data: mt = [] } = H({
|
|
113
113
|
queryKey: ["notifications", "center", "collections"],
|
|
114
114
|
queryFn: () => h.request(
|
|
115
|
-
|
|
115
|
+
Q("/collections")
|
|
116
116
|
).then((e) => {
|
|
117
117
|
const n = Array.isArray(e) ? e : e.data ?? [];
|
|
118
118
|
return [...new Set(n.map((l) => l.collection))].sort();
|
|
119
119
|
}),
|
|
120
120
|
staleTime: 3e5
|
|
121
|
-
}),
|
|
122
|
-
enabled:
|
|
123
|
-
resetKey:
|
|
124
|
-
}),
|
|
125
|
-
enabled:
|
|
126
|
-
resetKey:
|
|
127
|
-
}),
|
|
121
|
+
}), F = d === "archived" || _ > 1 ? [] : (m == null ? void 0 : m.pinned) ?? [], pt = new Set(F.map((e) => e.id)), R = ((m == null ? void 0 : m.data) ?? []).filter((e) => !pt.has(e.id)), U = (m == null ? void 0 : m.bundles) ?? [], q = (m == null ? void 0 : m.total) ?? 0, re = Math.max(1, Math.ceil(q / ve)), Ae = d !== "sent" && _ === 1 && !!m && !ut, De = [d, N, T, z, f ?? "", K].join("|"), P = Oe(m ? U : void 0, Ge, {
|
|
122
|
+
enabled: Ae,
|
|
123
|
+
resetKey: De
|
|
124
|
+
}), O = Oe(m ? R : void 0, He, {
|
|
125
|
+
enabled: Ae,
|
|
126
|
+
resetKey: De
|
|
127
|
+
}), ht = m ? P.rows : U, $e = m ? O.rows : R, ie = P.held + O.held, ze = Lt(null), Fe = P.rootRef, qe = O.rootRef, bt = Rt(
|
|
128
128
|
(e) => {
|
|
129
|
-
|
|
129
|
+
ze.current = e, Fe(e), qe(e);
|
|
130
130
|
},
|
|
131
|
-
[
|
|
131
|
+
[Fe, qe]
|
|
132
132
|
);
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}, [
|
|
136
|
-
const
|
|
137
|
-
|
|
133
|
+
xe(() => {
|
|
134
|
+
Bt(ze.current, [...P.arrived, ...O.arrived]);
|
|
135
|
+
}, [P.arrived, O.arrived]);
|
|
136
|
+
const xt = () => {
|
|
137
|
+
P.reveal(), O.reveal();
|
|
138
138
|
}, w = () => {
|
|
139
|
-
|
|
140
|
-
},
|
|
139
|
+
X.invalidateQueries({ queryKey: ["notifications"] }), X.invalidateQueries({ queryKey: ["notification-count"] });
|
|
140
|
+
}, ft = D({
|
|
141
141
|
mutationFn: (e) => h.request(S("/notifications/mark-read", { ids: e })),
|
|
142
142
|
onSuccess: w,
|
|
143
143
|
onError: () => i == null ? void 0 : i("Failed to mark the bundle read")
|
|
144
|
-
}),
|
|
144
|
+
}), de = D({
|
|
145
145
|
mutationFn: () => h.request(S("/notifications/mark-all-read")),
|
|
146
146
|
onSuccess: () => {
|
|
147
147
|
w(), r == null || r("All notifications marked as read");
|
|
148
148
|
},
|
|
149
149
|
onError: () => i == null ? void 0 : i("Failed to mark all read")
|
|
150
|
-
}),
|
|
150
|
+
}), G = D({
|
|
151
151
|
mutationFn: ({
|
|
152
152
|
id: e,
|
|
153
153
|
until: n,
|
|
@@ -159,87 +159,87 @@ function Aa({
|
|
|
159
159
|
)
|
|
160
160
|
),
|
|
161
161
|
onSuccess: (e, n) => {
|
|
162
|
-
w(),
|
|
162
|
+
w(), Ce(null), r == null || r(
|
|
163
163
|
n.untilChange ? "Snoozed — it comes back when someone changes the record" : n.until ? "Snoozed — it will return unread" : "Snooze cleared"
|
|
164
164
|
);
|
|
165
165
|
},
|
|
166
166
|
onError: () => i == null ? void 0 : i("Failed to snooze")
|
|
167
|
-
}),
|
|
167
|
+
}), Me = D({
|
|
168
168
|
mutationFn: (e) => h.request(S(`/notifications/${e}/acknowledge`)),
|
|
169
169
|
onSuccess: () => {
|
|
170
170
|
w(), r == null || r("Acknowledged");
|
|
171
171
|
},
|
|
172
172
|
onError: () => i == null ? void 0 : i("Failed to acknowledge")
|
|
173
|
-
}),
|
|
173
|
+
}), gt = () => ({
|
|
174
174
|
status: d === "snoozed" || d === "sent" ? "all" : d,
|
|
175
175
|
snoozed: d === "snoozed" ? "true" : void 0,
|
|
176
176
|
lane: N === "all" ? void 0 : N,
|
|
177
|
-
search:
|
|
178
|
-
collection:
|
|
179
|
-
}),
|
|
177
|
+
search: T || void 0,
|
|
178
|
+
collection: z || void 0
|
|
179
|
+
}), I = D({
|
|
180
180
|
mutationFn: (e) => h.request(
|
|
181
181
|
S("/notifications/bulk-action", {
|
|
182
182
|
action: e.action,
|
|
183
183
|
until: e.until ? e.until.toISOString() : void 0,
|
|
184
|
-
...
|
|
184
|
+
...ae ? { filter: gt() } : { ids: [...L] }
|
|
185
185
|
})
|
|
186
186
|
),
|
|
187
187
|
onSuccess: (e, n) => {
|
|
188
188
|
var s;
|
|
189
|
-
w(),
|
|
189
|
+
w(), V(/* @__PURE__ */ new Set()), j(!1), ne(!1);
|
|
190
190
|
const l = ((s = e.data) == null ? void 0 : s.updated) ?? 0;
|
|
191
191
|
r == null || r(
|
|
192
192
|
`${l} notification${l === 1 ? "" : "s"} ${n.action === "read" ? "marked read" : n.action === "archive" ? "archived" : "snoozed"}`
|
|
193
193
|
);
|
|
194
194
|
},
|
|
195
195
|
onError: () => i == null ? void 0 : i("That bulk action failed")
|
|
196
|
-
}),
|
|
196
|
+
}), se = D({
|
|
197
197
|
mutationFn: (e) => h.request(S("/notifications/archive-read", { days: e })),
|
|
198
198
|
onSuccess: (e) => {
|
|
199
199
|
var n;
|
|
200
200
|
w(), r == null || r(`${((n = e.data) == null ? void 0 : n.updated) ?? 0} archived — find them under Archived`);
|
|
201
201
|
},
|
|
202
202
|
onError: () => i == null ? void 0 : i("Clean-up failed")
|
|
203
|
-
}), { data:
|
|
203
|
+
}), { data: oe } = H({
|
|
204
204
|
queryKey: ["nvr-profile-prefs"],
|
|
205
|
-
queryFn: () => h.request(
|
|
205
|
+
queryFn: () => h.request(Q("/users/me")).then((e) => {
|
|
206
206
|
var n;
|
|
207
207
|
return ((n = e.data) == null ? void 0 : n.preferences) ?? {};
|
|
208
208
|
}),
|
|
209
|
-
enabled:
|
|
210
|
-
}),
|
|
211
|
-
mutationFn: (e) => h.request(
|
|
209
|
+
enabled: le
|
|
210
|
+
}), kt = D({
|
|
211
|
+
mutationFn: (e) => h.request(Ot("/users/me/preferences", { notification_cleanup_days: e })),
|
|
212
212
|
onSuccess: () => {
|
|
213
|
-
|
|
213
|
+
X.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), r == null || r("Automatic clean-up saved");
|
|
214
214
|
},
|
|
215
215
|
onError: () => i == null ? void 0 : i("Could not save the clean-up setting")
|
|
216
|
-
}),
|
|
217
|
-
mutationFn: (e) => h.request(
|
|
216
|
+
}), ce = D({
|
|
217
|
+
mutationFn: (e) => h.request(It(`/notifications/${e}`)),
|
|
218
218
|
onSuccess: () => {
|
|
219
|
-
w(),
|
|
219
|
+
w(), ee(null), r == null || r("Notification deleted");
|
|
220
220
|
},
|
|
221
221
|
onError: () => i == null ? void 0 : i("Failed to delete notification")
|
|
222
|
-
}),
|
|
222
|
+
}), vt = async (e) => {
|
|
223
223
|
await h.request(S(`/notifications/${e}/read`)).catch(() => {
|
|
224
224
|
}), w();
|
|
225
|
-
},
|
|
226
|
-
const l =
|
|
227
|
-
if (l &&
|
|
228
|
-
const s =
|
|
229
|
-
|
|
225
|
+
}, yt = async (e, n) => {
|
|
226
|
+
const l = J && !Gt(n) ? Ie(e) : null;
|
|
227
|
+
if (l && J) {
|
|
228
|
+
const s = R.map((k) => Ie(k)).filter((k) => !!k);
|
|
229
|
+
J.open(l, { list: s }), e.read || h.request(S(`/notifications/${e.id}/read`)).catch(() => {
|
|
230
230
|
}).then(() => w());
|
|
231
231
|
return;
|
|
232
232
|
}
|
|
233
233
|
e.read || (await h.request(S(`/notifications/${e.id}/read`)).catch(() => {
|
|
234
|
-
}), w()),
|
|
235
|
-
},
|
|
236
|
-
|
|
234
|
+
}), w()), ge(W(e, o), p);
|
|
235
|
+
}, wt = (e) => {
|
|
236
|
+
j(!1), V((n) => {
|
|
237
237
|
const l = new Set(n);
|
|
238
238
|
return l.has(e) ? l.delete(e) : l.add(e), l;
|
|
239
239
|
});
|
|
240
|
-
},
|
|
241
|
-
var
|
|
242
|
-
const l = !e.read, s =
|
|
240
|
+
}, ue = (e, n = !1) => {
|
|
241
|
+
var B, A, c, v;
|
|
242
|
+
const l = !e.read, s = W(e, o), k = /* @__PURE__ */ a(me, { children: [
|
|
243
243
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-baseline gap-x-2 sm:flex-nowrap", children: [
|
|
244
244
|
e.lane === "critical" && /* @__PURE__ */ t("span", { className: "shrink-0 rounded bg-red-500/10 px-1 text-[9.5px] font-bold uppercase tracking-wide text-red-600 dark:text-red-400", children: "Critical" }),
|
|
245
245
|
e.lane === "needs_you" && l && /* @__PURE__ */ t("span", { className: "shrink-0 rounded bg-nvr-cyan/10 px-1 text-[9.5px] font-bold uppercase tracking-wide text-nvr-navy dark:text-nvr-cyan", children: "Needs you" }),
|
|
@@ -255,12 +255,12 @@ function Aa({
|
|
|
255
255
|
}
|
|
256
256
|
),
|
|
257
257
|
/* @__PURE__ */ a("span", { className: "flex shrink-0 items-center gap-1.5 text-[10.5px] text-slate-400", children: [
|
|
258
|
-
/* @__PURE__ */ t(
|
|
259
|
-
/* @__PURE__ */ t(
|
|
258
|
+
/* @__PURE__ */ t(Ht, { label: (B = e.detail) == null ? void 0 : B.via_agent }),
|
|
259
|
+
/* @__PURE__ */ t(Ke, { value: e.created_at ?? /* @__PURE__ */ new Date() })
|
|
260
260
|
] })
|
|
261
261
|
] }),
|
|
262
|
-
e.message && /* @__PURE__ */ t(
|
|
263
|
-
/* @__PURE__ */ t(
|
|
262
|
+
e.message && /* @__PURE__ */ t(da, { text: e.message.replace(/<[^>]+>/g, "") }),
|
|
263
|
+
/* @__PURE__ */ t(na, { resolved: (A = e.detail) == null ? void 0 : A.resolved, className: "text-[11.5px]" })
|
|
264
264
|
] });
|
|
265
265
|
return /* @__PURE__ */ a(
|
|
266
266
|
"div",
|
|
@@ -278,8 +278,8 @@ function Aa({
|
|
|
278
278
|
"input",
|
|
279
279
|
{
|
|
280
280
|
type: "checkbox",
|
|
281
|
-
checked:
|
|
282
|
-
onChange: () =>
|
|
281
|
+
checked: L.has(e.id),
|
|
282
|
+
onChange: () => wt(e.id),
|
|
283
283
|
"aria-label": "Select notification",
|
|
284
284
|
"data-notification-select": e.id,
|
|
285
285
|
className: "mt-1.5 h-3.5 w-3.5 shrink-0"
|
|
@@ -299,7 +299,7 @@ function Aa({
|
|
|
299
299
|
"button",
|
|
300
300
|
{
|
|
301
301
|
type: "button",
|
|
302
|
-
onClick: (y) => void
|
|
302
|
+
onClick: (y) => void yt(e, y),
|
|
303
303
|
className: "block w-full text-left",
|
|
304
304
|
children: k
|
|
305
305
|
}
|
|
@@ -318,16 +318,16 @@ function Aa({
|
|
|
318
318
|
"button",
|
|
319
319
|
{
|
|
320
320
|
type: "button",
|
|
321
|
-
onClick: () =>
|
|
321
|
+
onClick: () => ge(s, p),
|
|
322
322
|
...e.collection && !e.item && s.type !== "chat" && s.type !== "external" ? {
|
|
323
|
-
"aria-label": `See what changed in ${
|
|
324
|
-
"data-tip": `See what changed in ${
|
|
323
|
+
"aria-label": `See what changed in ${Qe(e.collection)}`,
|
|
324
|
+
"data-tip": `See what changed in ${Qe(e.collection)}`
|
|
325
325
|
} : {},
|
|
326
326
|
className: "inline-flex items-center gap-1 rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[10px] font-medium text-nvr-navy hover:bg-nvr-cyan/20 dark:bg-nvr-cyan/15 dark:text-nvr-cyan",
|
|
327
327
|
children: s.type === "chat" ? "Open chat" : s.type === "external" ? "Open in app ↗" : e.target_label && e.kind !== "record" ? `${e.target_label}${e.item ? ` #${e.item}` : ""}` : e.collection === "__chat__" ? "Chat" : e.collection && !e.item ? "See changes" : e.collection ? (
|
|
328
328
|
// The record's friendly id ("Workflow TP26-80418"), as the title
|
|
329
329
|
// names it — never the table name and row id.
|
|
330
|
-
(e.record_label ?
|
|
330
|
+
(e.record_label ? Qt(e) : null) ?? `${e.collection} #${e.item}`
|
|
331
331
|
) : "Open"
|
|
332
332
|
}
|
|
333
333
|
),
|
|
@@ -336,64 +336,64 @@ function Aa({
|
|
|
336
336
|
{
|
|
337
337
|
type: "button",
|
|
338
338
|
"data-notification-mark-read": e.id,
|
|
339
|
-
onClick: () => void
|
|
339
|
+
onClick: () => void vt(e.id),
|
|
340
340
|
className: "inline-flex items-center gap-1 rounded-full border border-slate-200 px-2 py-0.5 text-[10px] font-medium text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:text-slate-400 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
341
341
|
children: [
|
|
342
|
-
/* @__PURE__ */ t(
|
|
342
|
+
/* @__PURE__ */ t(pe, { className: "h-3 w-3" }),
|
|
343
343
|
"Mark read"
|
|
344
344
|
]
|
|
345
345
|
}
|
|
346
346
|
),
|
|
347
|
-
/* @__PURE__ */ t(
|
|
348
|
-
|
|
347
|
+
/* @__PURE__ */ t(ea, { delivery: e.delivery, mailLogUrl: g, onNavigate: p }),
|
|
348
|
+
Yt(e) && /* @__PURE__ */ a(
|
|
349
349
|
"button",
|
|
350
350
|
{
|
|
351
351
|
type: "button",
|
|
352
352
|
"data-notification-as-it-was": e.id,
|
|
353
353
|
"data-tip": "The record as it was when you were told",
|
|
354
|
-
onClick: () =>
|
|
354
|
+
onClick: () => Se(e),
|
|
355
355
|
className: "inline-flex items-center gap-1 rounded-full border border-slate-200 px-2 py-0.5 text-[10px] font-medium text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:text-slate-400 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
356
356
|
children: [
|
|
357
|
-
/* @__PURE__ */ t(
|
|
357
|
+
/* @__PURE__ */ t(qt, { className: "h-3 w-3" }),
|
|
358
358
|
"Record when sent"
|
|
359
359
|
]
|
|
360
360
|
}
|
|
361
361
|
)
|
|
362
362
|
] }),
|
|
363
363
|
/* @__PURE__ */ t(
|
|
364
|
-
|
|
364
|
+
la,
|
|
365
365
|
{
|
|
366
366
|
detail: e.detail,
|
|
367
367
|
why: e.why,
|
|
368
368
|
delivery: e.delivery,
|
|
369
369
|
notificationId: e.id,
|
|
370
|
-
recordChanges:
|
|
371
|
-
subscriptionsPath:
|
|
372
|
-
rulesPath:
|
|
370
|
+
recordChanges: Vt(e),
|
|
371
|
+
subscriptionsPath: Z,
|
|
372
|
+
rulesPath: Ye,
|
|
373
373
|
onNavigate: p,
|
|
374
374
|
className: "mt-1"
|
|
375
375
|
}
|
|
376
376
|
),
|
|
377
377
|
((c = e.ack) == null ? void 0 : c.required) && /* @__PURE__ */ t("div", { className: "mt-1.5", "data-notification-ack": e.ack.at ? "acked" : "pending", children: e.ack.at ? /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1 rounded-full bg-emerald-50 px-2 py-0.5 text-[10.5px] font-medium text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400", children: [
|
|
378
|
-
/* @__PURE__ */ t(
|
|
378
|
+
/* @__PURE__ */ t(be, { className: "h-3 w-3" }),
|
|
379
379
|
"Acknowledged ",
|
|
380
|
-
|
|
380
|
+
Be(e.ack.at)
|
|
381
381
|
] }) : /* @__PURE__ */ a(
|
|
382
382
|
"button",
|
|
383
383
|
{
|
|
384
384
|
type: "button",
|
|
385
|
-
disabled:
|
|
386
|
-
onClick: () =>
|
|
385
|
+
disabled: Me.isPending,
|
|
386
|
+
onClick: () => Me.mutate(e.id),
|
|
387
387
|
"data-notification-acknowledge": e.id,
|
|
388
388
|
className: "inline-flex items-center gap-1 rounded-md bg-nvr-cyan px-2.5 py-1 text-[11.5px] font-medium text-white hover:opacity-90 disabled:opacity-50",
|
|
389
389
|
children: [
|
|
390
|
-
/* @__PURE__ */ t(
|
|
390
|
+
/* @__PURE__ */ t(be, { className: "h-3.5 w-3.5" }),
|
|
391
391
|
"Acknowledge"
|
|
392
392
|
]
|
|
393
393
|
}
|
|
394
394
|
) }),
|
|
395
395
|
e.actions && e.actions.length > 0 && !((v = e.detail) != null && v.resolved) && /* @__PURE__ */ t(
|
|
396
|
-
|
|
396
|
+
ta,
|
|
397
397
|
{
|
|
398
398
|
actions: l ? e.actions : e.actions.filter((y) => !!y.input),
|
|
399
399
|
notificationId: e.id,
|
|
@@ -409,11 +409,11 @@ function Aa({
|
|
|
409
409
|
"button",
|
|
410
410
|
{
|
|
411
411
|
type: "button",
|
|
412
|
-
onClick: () =>
|
|
412
|
+
onClick: () => G.mutate({ id: e.id, until: null }),
|
|
413
413
|
className: "inline-flex items-center gap-1 rounded-full bg-amber-50 px-2 py-0.5 text-[10.5px] font-medium text-amber-700 hover:bg-amber-100 dark:bg-amber-400/10 dark:text-amber-300",
|
|
414
414
|
"data-tip": "Click to wake now",
|
|
415
415
|
children: [
|
|
416
|
-
/* @__PURE__ */ t(
|
|
416
|
+
/* @__PURE__ */ t(he, { className: "h-3 w-3" }),
|
|
417
417
|
e.snooze_until_change ? "Until it changes" : `Until ${new Date(e.snoozed_until).toLocaleString([], {
|
|
418
418
|
month: "short",
|
|
419
419
|
day: "numeric",
|
|
@@ -426,19 +426,19 @@ function Aa({
|
|
|
426
426
|
"button",
|
|
427
427
|
{
|
|
428
428
|
type: "button",
|
|
429
|
-
onClick: () => Ne
|
|
429
|
+
onClick: () => Ce(Ne === e.id ? null : e.id),
|
|
430
430
|
className: "rounded p-1.5 text-slate-300 opacity-0 transition-all hover:bg-amber-50 hover:text-amber-500 focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100 dark:hover:bg-amber-400/10 [@media(hover:none)]:opacity-100",
|
|
431
431
|
"aria-label": "Snooze notification",
|
|
432
|
-
children: /* @__PURE__ */ t(
|
|
432
|
+
children: /* @__PURE__ */ t(he, { className: "h-3.5 w-3.5" })
|
|
433
433
|
}
|
|
434
434
|
),
|
|
435
|
-
|
|
436
|
-
|
|
435
|
+
Ne === e.id && /* @__PURE__ */ a("div", { className: "absolute right-0 top-8 z-20 w-[180px] rounded-md border border-slate-200 bg-white py-1 shadow-lg dark:border-border dark:bg-card", children: [
|
|
436
|
+
Ue().map((y) => /* @__PURE__ */ t(
|
|
437
437
|
"button",
|
|
438
438
|
{
|
|
439
439
|
type: "button",
|
|
440
|
-
disabled:
|
|
441
|
-
onClick: () =>
|
|
440
|
+
disabled: G.isPending,
|
|
441
|
+
onClick: () => G.mutate({ id: e.id, until: y.until }),
|
|
442
442
|
className: "block w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-muted dark:text-foreground",
|
|
443
443
|
children: y.label
|
|
444
444
|
},
|
|
@@ -448,8 +448,8 @@ function Aa({
|
|
|
448
448
|
"button",
|
|
449
449
|
{
|
|
450
450
|
type: "button",
|
|
451
|
-
disabled:
|
|
452
|
-
onClick: () =>
|
|
451
|
+
disabled: G.isPending,
|
|
452
|
+
onClick: () => G.mutate({ id: e.id, until: null, untilChange: !0 }),
|
|
453
453
|
className: "block w-full border-t border-slate-100 px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-muted dark:border-border dark:text-foreground",
|
|
454
454
|
"data-snooze-until-change": !0,
|
|
455
455
|
children: "Until the record changes"
|
|
@@ -457,12 +457,12 @@ function Aa({
|
|
|
457
457
|
)
|
|
458
458
|
] })
|
|
459
459
|
] }),
|
|
460
|
-
/* @__PURE__ */ t("div", { className: "shrink-0", children:
|
|
460
|
+
/* @__PURE__ */ t("div", { className: "shrink-0", children: et === e.id ? /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: [
|
|
461
461
|
/* @__PURE__ */ t(
|
|
462
462
|
"button",
|
|
463
463
|
{
|
|
464
464
|
type: "button",
|
|
465
|
-
onClick: () =>
|
|
465
|
+
onClick: () => ee(null),
|
|
466
466
|
className: "h-6 rounded-md border border-slate-200 px-2 text-[11px] dark:border-border",
|
|
467
467
|
children: "Cancel"
|
|
468
468
|
}
|
|
@@ -471,34 +471,34 @@ function Aa({
|
|
|
471
471
|
"button",
|
|
472
472
|
{
|
|
473
473
|
type: "button",
|
|
474
|
-
disabled:
|
|
475
|
-
onClick: () =>
|
|
474
|
+
disabled: ce.isPending,
|
|
475
|
+
onClick: () => ce.mutate(e.id),
|
|
476
476
|
className: "h-6 rounded-md bg-red-500 px-2 text-[11px] text-white hover:bg-red-600",
|
|
477
|
-
children:
|
|
477
|
+
children: ce.isPending ? "Deleting…" : "Delete"
|
|
478
478
|
}
|
|
479
479
|
)
|
|
480
480
|
] }) : /* @__PURE__ */ t(
|
|
481
481
|
"button",
|
|
482
482
|
{
|
|
483
483
|
type: "button",
|
|
484
|
-
onClick: () =>
|
|
484
|
+
onClick: () => ee(e.id),
|
|
485
485
|
className: "rounded p-1.5 text-slate-300 opacity-0 transition-all hover:bg-red-50 hover:text-red-400 focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100 [@media(hover:none)]:opacity-100",
|
|
486
486
|
"aria-label": "Delete notification",
|
|
487
|
-
children: /* @__PURE__ */ t(
|
|
487
|
+
children: /* @__PURE__ */ t(Mt, { className: "h-3.5 w-3.5" })
|
|
488
488
|
}
|
|
489
489
|
) })
|
|
490
490
|
]
|
|
491
491
|
}
|
|
492
492
|
);
|
|
493
|
-
},
|
|
494
|
-
const n = `${e.collection}:${e.item}`, l =
|
|
493
|
+
}, Nt = (e) => {
|
|
494
|
+
const n = `${e.collection}:${e.item}`, l = rt.has(n), s = Jt(e.lane), k = e.deleted ? null : W(Xt(e), o), B = e.rows.filter((c) => !c.read).map((c) => c.id), A = () => it((c) => {
|
|
495
495
|
const v = new Set(c);
|
|
496
496
|
return v.has(n) ? v.delete(n) : v.add(n), v;
|
|
497
497
|
});
|
|
498
498
|
return /* @__PURE__ */ a(
|
|
499
499
|
"div",
|
|
500
500
|
{
|
|
501
|
-
"data-live-key":
|
|
501
|
+
"data-live-key": Ge(e),
|
|
502
502
|
"data-notification-bundle": n,
|
|
503
503
|
"data-notification-bundle-count": e.count,
|
|
504
504
|
"data-notification-bundle-lane": e.lane,
|
|
@@ -515,7 +515,7 @@ function Aa({
|
|
|
515
515
|
onClick: A,
|
|
516
516
|
className: "mt-1 rounded p-0.5 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
517
517
|
children: /* @__PURE__ */ t(
|
|
518
|
-
|
|
518
|
+
Tt,
|
|
519
519
|
{
|
|
520
520
|
className: x("h-3.5 w-3.5 transition-transform", !l && "-rotate-90")
|
|
521
521
|
}
|
|
@@ -552,13 +552,13 @@ function Aa({
|
|
|
552
552
|
"min-w-0 line-clamp-2 break-words text-[13px] sm:line-clamp-none sm:truncate",
|
|
553
553
|
e.unread > 0 ? x("font-medium", s.text) : "font-normal text-slate-600 dark:text-slate-400"
|
|
554
554
|
),
|
|
555
|
-
children: e.label ? /* @__PURE__ */ a(
|
|
556
|
-
|
|
555
|
+
children: e.label ? /* @__PURE__ */ a(me, { children: [
|
|
556
|
+
je(e).slice(0, -e.label.length),
|
|
557
557
|
/* @__PURE__ */ t("span", { className: "whitespace-nowrap", children: e.label })
|
|
558
|
-
] }) :
|
|
558
|
+
] }) : je(e)
|
|
559
559
|
}
|
|
560
560
|
),
|
|
561
|
-
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: e.newest ?
|
|
561
|
+
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: e.newest ? Be(e.newest) : "" })
|
|
562
562
|
] }) }),
|
|
563
563
|
/* @__PURE__ */ a("div", { className: "mt-1 flex flex-wrap items-center gap-1.5", children: [
|
|
564
564
|
e.collection_label && /* @__PURE__ */ t(
|
|
@@ -582,7 +582,7 @@ function Aa({
|
|
|
582
582
|
{
|
|
583
583
|
className: "rounded bg-slate-100 px-1.5 py-px text-[10px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
|
|
584
584
|
"data-notification-bundle-category": c,
|
|
585
|
-
children:
|
|
585
|
+
children: Et(c)
|
|
586
586
|
},
|
|
587
587
|
c
|
|
588
588
|
)),
|
|
@@ -590,10 +590,10 @@ function Aa({
|
|
|
590
590
|
"button",
|
|
591
591
|
{
|
|
592
592
|
type: "button",
|
|
593
|
-
onClick: () =>
|
|
593
|
+
onClick: () => ge(k, p),
|
|
594
594
|
className: "inline-flex items-center gap-1 rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[10px] font-medium text-nvr-navy hover:bg-nvr-cyan/20 dark:bg-nvr-cyan/15 dark:text-nvr-cyan",
|
|
595
595
|
children: [
|
|
596
|
-
/* @__PURE__ */ t(
|
|
596
|
+
/* @__PURE__ */ t(Re, { className: "h-3 w-3" }),
|
|
597
597
|
"Open ",
|
|
598
598
|
e.label
|
|
599
599
|
]
|
|
@@ -605,17 +605,17 @@ function Aa({
|
|
|
605
605
|
] })
|
|
606
606
|
] })
|
|
607
607
|
] }),
|
|
608
|
-
|
|
608
|
+
B.length > 0 && /* @__PURE__ */ a(
|
|
609
609
|
"button",
|
|
610
610
|
{
|
|
611
611
|
type: "button",
|
|
612
612
|
"data-notification-bundle-read": n,
|
|
613
|
-
onClick: () =>
|
|
613
|
+
onClick: () => ft.mutate(B),
|
|
614
614
|
"aria-label": "Mark read",
|
|
615
615
|
"data-tip": "Mark read",
|
|
616
616
|
className: "inline-flex shrink-0 items-center gap-1 rounded-md border border-slate-200 p-1.5 text-[11px] font-medium text-slate-600 hover:bg-slate-50 sm:px-2 sm:py-1 dark:border-border dark:text-slate-300 dark:hover:bg-muted",
|
|
617
617
|
children: [
|
|
618
|
-
/* @__PURE__ */ t(
|
|
618
|
+
/* @__PURE__ */ t(pe, { className: "h-3.5 w-3.5 sm:h-3 sm:w-3" }),
|
|
619
619
|
/* @__PURE__ */ t("span", { className: "max-sm:hidden", children: "Mark read" })
|
|
620
620
|
]
|
|
621
621
|
}
|
|
@@ -626,43 +626,43 @@ function Aa({
|
|
|
626
626
|
{
|
|
627
627
|
className: "divide-y divide-slate-100 border-t border-slate-100 dark:divide-border dark:border-border",
|
|
628
628
|
"data-notification-bundle-rows": n,
|
|
629
|
-
children: e.rows.map((c) => /* @__PURE__ */ t(
|
|
629
|
+
children: e.rows.map((c) => /* @__PURE__ */ t(fe, { children: ue(c, !0) }, c.id))
|
|
630
630
|
}
|
|
631
631
|
)
|
|
632
632
|
]
|
|
633
633
|
},
|
|
634
634
|
`bundle:${n}`
|
|
635
635
|
);
|
|
636
|
-
},
|
|
636
|
+
}, Te = F.length + R.length + U.reduce((e, n) => e + n.rows.length, 0), Ct = (e) => {
|
|
637
637
|
var n;
|
|
638
638
|
return e === "all" ? null : ((n = b == null ? void 0 : b.lanes) == null ? void 0 : n[e]) ?? null;
|
|
639
639
|
};
|
|
640
|
-
return /* @__PURE__ */ a("div", { className: x("flex flex-1 min-h-0 flex-col",
|
|
640
|
+
return /* @__PURE__ */ a("div", { className: x("flex flex-1 min-h-0 flex-col", Ve), "data-nvr-notification-center": !0, children: [
|
|
641
641
|
/* @__PURE__ */ a("header", { className: "shrink-0 border-b border-slate-200 bg-white px-4 py-5 dark:border-border dark:bg-background sm:px-8", children: [
|
|
642
642
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center justify-between gap-x-3 gap-y-2", children: [
|
|
643
643
|
/* @__PURE__ */ a("div", { children: [
|
|
644
644
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1", children: [
|
|
645
645
|
/* @__PURE__ */ t("h1", { className: "text-xl font-bold text-slate-900 dark:text-slate-100", children: "Notifications" }),
|
|
646
|
-
|
|
646
|
+
ie > 0 && /* @__PURE__ */ a(
|
|
647
647
|
"button",
|
|
648
648
|
{
|
|
649
649
|
type: "button",
|
|
650
|
-
"data-notification-new-pill":
|
|
651
|
-
onClick:
|
|
650
|
+
"data-notification-new-pill": ie,
|
|
651
|
+
onClick: xt,
|
|
652
652
|
className: "inline-flex h-7 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.08] px-3 text-[12px] font-medium text-nvr-navy transition-colors hover:bg-nvr-cyan/15 focus-visible:outline focus-visible:outline-2 focus-visible:outline-nvr-cyan dark:border-nvr-cyan/40 dark:bg-nvr-cyan/15 dark:text-nvr-cyan dark:hover:bg-nvr-cyan/25",
|
|
653
653
|
children: [
|
|
654
|
-
/* @__PURE__ */ t(
|
|
655
|
-
|
|
654
|
+
/* @__PURE__ */ t(At, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
655
|
+
ie,
|
|
656
656
|
" new"
|
|
657
657
|
]
|
|
658
658
|
}
|
|
659
659
|
)
|
|
660
660
|
] }),
|
|
661
661
|
/* @__PURE__ */ a("p", { className: "mt-0.5 text-[13px] text-slate-500 dark:text-slate-400", children: [
|
|
662
|
-
|
|
662
|
+
$(q),
|
|
663
663
|
" notification",
|
|
664
|
-
|
|
665
|
-
N !== "all" || d !== "all" ||
|
|
664
|
+
q === 1 ? "" : "s",
|
|
665
|
+
N !== "all" || d !== "all" || T || z ? " in this view" : "",
|
|
666
666
|
(b == null ? void 0 : b.attention) != null && b.attention > 0 ? ` · ${b.attention} need${b.attention === 1 ? "s" : ""} you` : ""
|
|
667
667
|
] })
|
|
668
668
|
] }),
|
|
@@ -671,14 +671,14 @@ function Aa({
|
|
|
671
671
|
"button",
|
|
672
672
|
{
|
|
673
673
|
type: "button",
|
|
674
|
-
onClick: () =>
|
|
674
|
+
onClick: () => st((e) => !e),
|
|
675
675
|
"data-notification-cleanup-toggle": !0,
|
|
676
676
|
"aria-label": "Clean up",
|
|
677
|
-
"aria-expanded":
|
|
677
|
+
"aria-expanded": le,
|
|
678
678
|
"data-tip": "Clean up",
|
|
679
679
|
className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-md border border-slate-200 px-2 text-[12px] font-medium text-slate-700 hover:bg-slate-50 sm:px-3 dark:border-border dark:text-foreground dark:hover:bg-muted",
|
|
680
680
|
children: [
|
|
681
|
-
/* @__PURE__ */ t(
|
|
681
|
+
/* @__PURE__ */ t(Le, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
682
682
|
/* @__PURE__ */ t("span", { className: "hidden sm:inline", children: "Clean up" })
|
|
683
683
|
]
|
|
684
684
|
}
|
|
@@ -687,20 +687,20 @@ function Aa({
|
|
|
687
687
|
"button",
|
|
688
688
|
{
|
|
689
689
|
type: "button",
|
|
690
|
-
onClick: () =>
|
|
691
|
-
disabled:
|
|
690
|
+
onClick: () => de.mutate(),
|
|
691
|
+
disabled: de.isPending || b != null && b.unread === 0,
|
|
692
692
|
"aria-label": "Mark all read",
|
|
693
693
|
"data-tip": (b == null ? void 0 : b.unread) === 0 ? "Nothing unread" : "Mark all read",
|
|
694
694
|
className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-md border border-slate-200 px-2 text-[12px] font-medium text-slate-700 hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-50 sm:px-3 dark:border-border dark:text-foreground dark:hover:bg-muted",
|
|
695
695
|
children: [
|
|
696
|
-
/* @__PURE__ */ t(
|
|
697
|
-
/* @__PURE__ */ t("span", { className: "hidden sm:inline", children:
|
|
696
|
+
/* @__PURE__ */ t(Dt, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
697
|
+
/* @__PURE__ */ t("span", { className: "hidden sm:inline", children: de.isPending ? "Marking…" : "Mark all read" })
|
|
698
698
|
]
|
|
699
699
|
}
|
|
700
700
|
)
|
|
701
701
|
] })
|
|
702
702
|
] }),
|
|
703
|
-
|
|
703
|
+
le && /* @__PURE__ */ a(
|
|
704
704
|
"div",
|
|
705
705
|
{
|
|
706
706
|
className: "mt-3 space-y-2 rounded-md border border-slate-200 bg-slate-50 px-3 py-2.5 text-[12px] text-slate-600 dark:border-border dark:bg-muted/40 dark:text-muted-foreground",
|
|
@@ -709,10 +709,10 @@ function Aa({
|
|
|
709
709
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
710
710
|
"Archive everything read and older than",
|
|
711
711
|
/* @__PURE__ */ t(
|
|
712
|
-
|
|
712
|
+
ke,
|
|
713
713
|
{
|
|
714
|
-
value:
|
|
715
|
-
onChange:
|
|
714
|
+
value: _e,
|
|
715
|
+
onChange: ot,
|
|
716
716
|
ariaLabel: "Older than",
|
|
717
717
|
className: "h-7 w-auto rounded-md border-slate-200 bg-background px-2 text-[12px] dark:border-border",
|
|
718
718
|
options: [
|
|
@@ -727,21 +727,21 @@ function Aa({
|
|
|
727
727
|
"button",
|
|
728
728
|
{
|
|
729
729
|
type: "button",
|
|
730
|
-
disabled:
|
|
731
|
-
onClick: () =>
|
|
730
|
+
disabled: se.isPending,
|
|
731
|
+
onClick: () => se.mutate(Number(_e)),
|
|
732
732
|
"data-notification-archive-read": !0,
|
|
733
733
|
className: "h-7 rounded-md bg-[#0f172a] px-2.5 text-[11.5px] font-medium text-[#ffffff] hover:bg-[#334155] disabled:opacity-50 dark:bg-[#e2e8f0] dark:text-[#0f172a] dark:hover:bg-[#ffffff]",
|
|
734
|
-
children:
|
|
734
|
+
children: se.isPending ? "Archiving…" : "Archive now"
|
|
735
735
|
}
|
|
736
736
|
)
|
|
737
737
|
] }),
|
|
738
738
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
739
739
|
"Or do it automatically — archive read notifications after",
|
|
740
740
|
/* @__PURE__ */ t(
|
|
741
|
-
|
|
741
|
+
ke,
|
|
742
742
|
{
|
|
743
|
-
value: String((
|
|
744
|
-
onChange: (e) =>
|
|
743
|
+
value: String((oe == null ? void 0 : oe.notification_cleanup_days) ?? ""),
|
|
744
|
+
onChange: (e) => kt.mutate(e ? Number(e) : null),
|
|
745
745
|
ariaLabel: "Automatic clean-up",
|
|
746
746
|
className: "h-7 w-auto rounded-md border-slate-200 bg-background px-2 text-[12px] dark:border-border",
|
|
747
747
|
options: [
|
|
@@ -758,14 +758,14 @@ function Aa({
|
|
|
758
758
|
}
|
|
759
759
|
),
|
|
760
760
|
/* @__PURE__ */ a("div", { className: "mt-4 flex flex-wrap items-center gap-2", children: [
|
|
761
|
-
/* @__PURE__ */ t("div", { className: "-mx-1 flex max-w-full items-center gap-1 overflow-x-auto px-1 [scrollbar-width:none] sm:flex-wrap", children:
|
|
762
|
-
const n =
|
|
761
|
+
/* @__PURE__ */ t("div", { className: "-mx-1 flex max-w-full items-center gap-1 overflow-x-auto px-1 [scrollbar-width:none] sm:flex-wrap", children: ia.map((e) => {
|
|
762
|
+
const n = Ct(e.key);
|
|
763
763
|
return /* @__PURE__ */ a(
|
|
764
764
|
"button",
|
|
765
765
|
{
|
|
766
766
|
type: "button",
|
|
767
767
|
onClick: () => {
|
|
768
|
-
|
|
768
|
+
Je(e.key), M(1);
|
|
769
769
|
},
|
|
770
770
|
"data-nvr-lane": e.key,
|
|
771
771
|
className: x(
|
|
@@ -788,12 +788,12 @@ function Aa({
|
|
|
788
788
|
);
|
|
789
789
|
}) }),
|
|
790
790
|
/* @__PURE__ */ t("span", { className: "mx-1 hidden h-5 w-px bg-slate-200 dark:bg-border sm:block" }),
|
|
791
|
-
/* @__PURE__ */ t("div", { className: "-mx-1 flex max-w-full items-center gap-1 overflow-x-auto px-1 [scrollbar-width:none] sm:flex-wrap", children:
|
|
791
|
+
/* @__PURE__ */ t("div", { className: "-mx-1 flex max-w-full items-center gap-1 overflow-x-auto px-1 [scrollbar-width:none] sm:flex-wrap", children: ra.map((e) => /* @__PURE__ */ t(
|
|
792
792
|
"button",
|
|
793
793
|
{
|
|
794
794
|
type: "button",
|
|
795
795
|
onClick: () => {
|
|
796
|
-
|
|
796
|
+
Ze(e.key), M(1);
|
|
797
797
|
},
|
|
798
798
|
className: x(
|
|
799
799
|
"shrink-0 whitespace-nowrap rounded-md px-2.5 py-1.5 text-[12px] font-medium transition-colors",
|
|
@@ -804,29 +804,29 @@ function Aa({
|
|
|
804
804
|
e.key
|
|
805
805
|
)) }),
|
|
806
806
|
/* @__PURE__ */ a("div", { className: "relative w-full sm:ml-auto sm:w-auto", children: [
|
|
807
|
-
/* @__PURE__ */ t(
|
|
807
|
+
/* @__PURE__ */ t($t, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
808
808
|
/* @__PURE__ */ t(
|
|
809
809
|
"input",
|
|
810
810
|
{
|
|
811
|
-
value:
|
|
812
|
-
onChange: (e) =>
|
|
811
|
+
value: te,
|
|
812
|
+
onChange: (e) => tt(e.target.value),
|
|
813
813
|
placeholder: "Search notifications…",
|
|
814
814
|
className: "h-8 w-full rounded-md border border-slate-200 bg-background pl-8 sm:w-[240px] pr-2.5 text-[12.5px] dark:border-border"
|
|
815
815
|
}
|
|
816
816
|
)
|
|
817
817
|
] }),
|
|
818
818
|
/* @__PURE__ */ t(
|
|
819
|
-
|
|
819
|
+
ke,
|
|
820
820
|
{
|
|
821
|
-
value:
|
|
821
|
+
value: z,
|
|
822
822
|
onChange: (e) => {
|
|
823
|
-
|
|
823
|
+
nt(e), M(1);
|
|
824
824
|
},
|
|
825
825
|
ariaLabel: "Collection",
|
|
826
826
|
className: "h-8 w-auto rounded-md border-slate-200 bg-background px-2 text-[12.5px] dark:border-border",
|
|
827
827
|
options: [
|
|
828
828
|
{ value: "", label: "All collections" },
|
|
829
|
-
...
|
|
829
|
+
...mt.map((e) => ({ value: e, label: e }))
|
|
830
830
|
]
|
|
831
831
|
}
|
|
832
832
|
),
|
|
@@ -840,8 +840,8 @@ function Aa({
|
|
|
840
840
|
"input",
|
|
841
841
|
{
|
|
842
842
|
type: "checkbox",
|
|
843
|
-
checked:
|
|
844
|
-
onChange: (e) =>
|
|
843
|
+
checked: K,
|
|
844
|
+
onChange: (e) => lt(e.target.checked),
|
|
845
845
|
className: "h-3.5 w-3.5",
|
|
846
846
|
"data-notification-group-by-record": !0
|
|
847
847
|
}
|
|
@@ -852,11 +852,11 @@ function Aa({
|
|
|
852
852
|
)
|
|
853
853
|
] })
|
|
854
854
|
] }),
|
|
855
|
-
|
|
855
|
+
E != null && /* @__PURE__ */ a(
|
|
856
856
|
"div",
|
|
857
857
|
{
|
|
858
858
|
className: "shrink-0 border-b border-slate-200 bg-white px-8 py-3 dark:border-border dark:bg-background",
|
|
859
|
-
"data-notification-changes-landing":
|
|
859
|
+
"data-notification-changes-landing": E,
|
|
860
860
|
children: [
|
|
861
861
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-2", children: [
|
|
862
862
|
/* @__PURE__ */ t("p", { className: "text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "What changed" }),
|
|
@@ -864,33 +864,33 @@ function Aa({
|
|
|
864
864
|
"button",
|
|
865
865
|
{
|
|
866
866
|
type: "button",
|
|
867
|
-
onClick: () =>
|
|
867
|
+
onClick: () => We(null),
|
|
868
868
|
className: "text-[11.5px] text-slate-400 underline decoration-dotted underline-offset-2 hover:text-slate-600 dark:hover:text-slate-200",
|
|
869
869
|
children: "Dismiss"
|
|
870
870
|
}
|
|
871
871
|
)
|
|
872
872
|
] }),
|
|
873
|
-
/* @__PURE__ */ t(
|
|
873
|
+
/* @__PURE__ */ t(aa, { notificationId: E, className: "max-w-3xl" })
|
|
874
874
|
]
|
|
875
875
|
}
|
|
876
876
|
),
|
|
877
|
-
d !== "sent" &&
|
|
877
|
+
d !== "sent" && L.size > 0 && /* @__PURE__ */ a(
|
|
878
878
|
"div",
|
|
879
879
|
{
|
|
880
880
|
className: "flex shrink-0 flex-wrap items-center gap-2 border-b border-nvr-cyan/30 bg-nvr-cyan/5 px-8 py-2 text-[12px] text-slate-700 dark:text-slate-200",
|
|
881
881
|
"data-notification-bulkbar": !0,
|
|
882
882
|
children: [
|
|
883
|
-
/* @__PURE__ */ t("span", { className: "font-medium", children:
|
|
884
|
-
!
|
|
883
|
+
/* @__PURE__ */ t("span", { className: "font-medium", children: ae ? `All ${$(q)} matching` : `${$(L.size)} selected` }),
|
|
884
|
+
!ae && L.size >= Te && q > Te && /* @__PURE__ */ a(
|
|
885
885
|
"button",
|
|
886
886
|
{
|
|
887
887
|
type: "button",
|
|
888
|
-
onClick: () =>
|
|
888
|
+
onClick: () => j(!0),
|
|
889
889
|
"data-notification-select-matching": !0,
|
|
890
890
|
className: "text-nvr-navy underline decoration-dotted underline-offset-2 dark:text-nvr-cyan",
|
|
891
891
|
children: [
|
|
892
892
|
"Select all ",
|
|
893
|
-
|
|
893
|
+
$(q),
|
|
894
894
|
" matching"
|
|
895
895
|
]
|
|
896
896
|
}
|
|
@@ -900,12 +900,12 @@ function Aa({
|
|
|
900
900
|
"button",
|
|
901
901
|
{
|
|
902
902
|
type: "button",
|
|
903
|
-
disabled:
|
|
904
|
-
onClick: () =>
|
|
903
|
+
disabled: I.isPending,
|
|
904
|
+
onClick: () => I.mutate({ action: "read" }),
|
|
905
905
|
"data-notification-bulk": "read",
|
|
906
906
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
|
|
907
907
|
children: [
|
|
908
|
-
/* @__PURE__ */ t(
|
|
908
|
+
/* @__PURE__ */ t(pe, { className: "h-3 w-3" }),
|
|
909
909
|
" Mark read"
|
|
910
910
|
]
|
|
911
911
|
}
|
|
@@ -915,21 +915,21 @@ function Aa({
|
|
|
915
915
|
"button",
|
|
916
916
|
{
|
|
917
917
|
type: "button",
|
|
918
|
-
disabled:
|
|
919
|
-
onClick: () =>
|
|
918
|
+
disabled: I.isPending,
|
|
919
|
+
onClick: () => ne((e) => !e),
|
|
920
920
|
"data-notification-bulk": "snooze",
|
|
921
921
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
|
|
922
922
|
children: [
|
|
923
|
-
/* @__PURE__ */ t(
|
|
923
|
+
/* @__PURE__ */ t(he, { className: "h-3 w-3" }),
|
|
924
924
|
" Snooze"
|
|
925
925
|
]
|
|
926
926
|
}
|
|
927
927
|
),
|
|
928
|
-
|
|
928
|
+
dt && /* @__PURE__ */ t("div", { className: "absolute left-0 top-8 z-20 w-[180px] rounded-md border border-slate-200 bg-white py-1 shadow-lg dark:border-border dark:bg-card", children: Ue().map((e) => /* @__PURE__ */ t(
|
|
929
929
|
"button",
|
|
930
930
|
{
|
|
931
931
|
type: "button",
|
|
932
|
-
onClick: () =>
|
|
932
|
+
onClick: () => I.mutate({ action: "snooze", until: e.until }),
|
|
933
933
|
className: "block w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-muted dark:text-foreground",
|
|
934
934
|
children: e.label
|
|
935
935
|
},
|
|
@@ -940,12 +940,12 @@ function Aa({
|
|
|
940
940
|
"button",
|
|
941
941
|
{
|
|
942
942
|
type: "button",
|
|
943
|
-
disabled:
|
|
944
|
-
onClick: () =>
|
|
943
|
+
disabled: I.isPending,
|
|
944
|
+
onClick: () => I.mutate({ action: "archive" }),
|
|
945
945
|
"data-notification-bulk": "archive",
|
|
946
946
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
|
|
947
947
|
children: [
|
|
948
|
-
/* @__PURE__ */ t(
|
|
948
|
+
/* @__PURE__ */ t(Le, { className: "h-3 w-3" }),
|
|
949
949
|
" Archive"
|
|
950
950
|
]
|
|
951
951
|
}
|
|
@@ -956,17 +956,17 @@ function Aa({
|
|
|
956
956
|
type: "button",
|
|
957
957
|
onClick: () => {
|
|
958
958
|
const e = [];
|
|
959
|
-
for (const n of [...
|
|
960
|
-
if (!
|
|
961
|
-
const l =
|
|
959
|
+
for (const n of [...F, ...R, ...U.flatMap((l) => l.rows)]) {
|
|
960
|
+
if (!L.has(n.id)) continue;
|
|
961
|
+
const l = W(n, o);
|
|
962
962
|
l && (l.type === "external" ? e.push(l.url) : l.type === "path" && typeof window < "u" && e.push(`${window.location.origin}${l.path}`));
|
|
963
963
|
}
|
|
964
|
-
e.length === 0 ? r == null || r("None of the selected notifications opens a page") : r == null || r(
|
|
964
|
+
e.length === 0 ? r == null || r("None of the selected notifications opens a page") : r == null || r(Kt(jt(e)));
|
|
965
965
|
},
|
|
966
966
|
"data-notification-bulk": "tabs",
|
|
967
967
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
|
|
968
968
|
children: [
|
|
969
|
-
/* @__PURE__ */ t(
|
|
969
|
+
/* @__PURE__ */ t(Re, { className: "h-3 w-3" }),
|
|
970
970
|
" Open in tabs"
|
|
971
971
|
]
|
|
972
972
|
}
|
|
@@ -976,7 +976,7 @@ function Aa({
|
|
|
976
976
|
{
|
|
977
977
|
type: "button",
|
|
978
978
|
onClick: () => {
|
|
979
|
-
|
|
979
|
+
V(/* @__PURE__ */ new Set()), j(!1);
|
|
980
980
|
},
|
|
981
981
|
className: "ml-auto text-[11.5px] text-slate-500 underline decoration-dotted underline-offset-2",
|
|
982
982
|
children: "Clear selection"
|
|
@@ -994,8 +994,8 @@ function Aa({
|
|
|
994
994
|
"input",
|
|
995
995
|
{
|
|
996
996
|
type: "checkbox",
|
|
997
|
-
checked:
|
|
998
|
-
onChange: (e) =>
|
|
997
|
+
checked: Y,
|
|
998
|
+
onChange: (e) => Xe(e.target.checked),
|
|
999
999
|
className: "h-3.5 w-3.5",
|
|
1000
1000
|
"data-nvr-sent-critical": !0
|
|
1001
1001
|
}
|
|
@@ -1003,15 +1003,15 @@ function Aa({
|
|
|
1003
1003
|
"Critical only"
|
|
1004
1004
|
] })
|
|
1005
1005
|
] }),
|
|
1006
|
-
|
|
1007
|
-
/* @__PURE__ */ t(
|
|
1006
|
+
Ee ? /* @__PURE__ */ t("p", { className: "py-10 text-[13px] text-slate-400", children: "Loading…" }) : we.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-24 text-center", children: [
|
|
1007
|
+
/* @__PURE__ */ t(Pe, { className: "h-10 w-10 text-slate-200 dark:text-slate-700" }),
|
|
1008
1008
|
/* @__PURE__ */ t("p", { className: "mt-3 text-[14px] font-medium text-slate-500", children: "Nothing sent yet" }),
|
|
1009
|
-
/* @__PURE__ */ t("p", { className: "mt-1 text-[12px] text-slate-400", children:
|
|
1010
|
-
] }) : /* @__PURE__ */ t("div", { className: "divide-y divide-slate-100 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children:
|
|
1009
|
+
/* @__PURE__ */ t("p", { className: "mt-1 text-[12px] text-slate-400", children: Y ? 'No critical sends. Untick "Critical only" to see everything you sent.' : "Messages you send to stakeholders or colleagues appear here." })
|
|
1010
|
+
] }) : /* @__PURE__ */ t("div", { className: "divide-y divide-slate-100 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children: we.map((e) => /* @__PURE__ */ a("div", { className: "px-4 py-3", "data-nvr-sent-row": !0, children: [
|
|
1011
1011
|
/* @__PURE__ */ a("div", { className: "flex items-baseline gap-2", children: [
|
|
1012
1012
|
e.lane === "critical" && /* @__PURE__ */ t("span", { className: "shrink-0 rounded bg-red-500/10 px-1 text-[9.5px] font-bold uppercase tracking-wide text-red-600 dark:text-red-400", children: "Critical" }),
|
|
1013
1013
|
/* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-slate-900 dark:text-slate-100", children: e.subject.replace(/^critical:\s*/i, "") }),
|
|
1014
|
-
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: /* @__PURE__ */ t(
|
|
1014
|
+
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: /* @__PURE__ */ t(Ke, { value: e.created_at ?? /* @__PURE__ */ new Date() }) }),
|
|
1015
1015
|
/* @__PURE__ */ a(
|
|
1016
1016
|
"span",
|
|
1017
1017
|
{
|
|
@@ -1021,9 +1021,9 @@ function Aa({
|
|
|
1021
1021
|
),
|
|
1022
1022
|
"data-nvr-sent-read-count": !0,
|
|
1023
1023
|
children: [
|
|
1024
|
-
e.read_count,
|
|
1024
|
+
$(e.read_count),
|
|
1025
1025
|
" of ",
|
|
1026
|
-
e.total,
|
|
1026
|
+
$(e.total),
|
|
1027
1027
|
" read"
|
|
1028
1028
|
]
|
|
1029
1029
|
}
|
|
@@ -1034,9 +1034,9 @@ function Aa({
|
|
|
1034
1034
|
className: "shrink-0 rounded-full bg-sky-50 px-2 py-0.5 text-[10.5px] font-semibold tabular-nums text-sky-700 dark:bg-sky-400/10 dark:text-sky-300",
|
|
1035
1035
|
"data-nvr-sent-ack-count": !0,
|
|
1036
1036
|
children: [
|
|
1037
|
-
e.ack_count ?? 0,
|
|
1037
|
+
$(e.ack_count ?? 0),
|
|
1038
1038
|
" of ",
|
|
1039
|
-
e.total,
|
|
1039
|
+
$(e.total),
|
|
1040
1040
|
" acknowledged"
|
|
1041
1041
|
]
|
|
1042
1042
|
}
|
|
@@ -1064,50 +1064,50 @@ function Aa({
|
|
|
1064
1064
|
}
|
|
1065
1065
|
),
|
|
1066
1066
|
n.name,
|
|
1067
|
-
n.ack === "acked" && /* @__PURE__ */ t(
|
|
1067
|
+
n.ack === "acked" && /* @__PURE__ */ t(be, { className: "h-3 w-3" })
|
|
1068
1068
|
]
|
|
1069
1069
|
},
|
|
1070
1070
|
n.id
|
|
1071
1071
|
)) })
|
|
1072
1072
|
] }, e.key)) })
|
|
1073
|
-
] }) :
|
|
1074
|
-
/* @__PURE__ */ t(
|
|
1073
|
+
] }) : ct ? /* @__PURE__ */ t("p", { className: "px-8 py-10 text-[13px] text-slate-400", children: "Loading…" }) : R.length === 0 && U.length === 0 && F.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-24 text-center", children: [
|
|
1074
|
+
/* @__PURE__ */ t(Pe, { className: "h-10 w-10 text-slate-200 dark:text-slate-700" }),
|
|
1075
1075
|
/* @__PURE__ */ t("p", { className: "mt-3 text-[14px] font-medium text-slate-500", children: "You're all caught up" }),
|
|
1076
1076
|
/* @__PURE__ */ t("p", { className: "mt-1 text-[12px] text-slate-400", children: d === "inbox" ? "No unread notifications." : "No notifications here." })
|
|
1077
|
-
] }) : /* @__PURE__ */ t(
|
|
1077
|
+
] }) : /* @__PURE__ */ t(me, { children: /* @__PURE__ */ a(
|
|
1078
1078
|
"div",
|
|
1079
1079
|
{
|
|
1080
|
-
ref:
|
|
1080
|
+
ref: bt,
|
|
1081
1081
|
className: "mx-4 my-6 divide-y sm:mx-8 divide-slate-100 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card",
|
|
1082
1082
|
children: [
|
|
1083
|
-
|
|
1083
|
+
F.length > 0 && /* @__PURE__ */ a("div", { "data-notification-pinned": !0, children: [
|
|
1084
1084
|
/* @__PURE__ */ a("div", { className: "bg-amber-50 px-4 py-1 text-[10.5px] font-semibold uppercase tracking-wide text-amber-700 dark:bg-amber-400/10 dark:text-amber-300", children: [
|
|
1085
1085
|
"Needs your acknowledgement · ",
|
|
1086
|
-
|
|
1086
|
+
F.length
|
|
1087
1087
|
] }),
|
|
1088
|
-
|
|
1088
|
+
F.map((e) => /* @__PURE__ */ t(fe, { children: ue(e) }, `pin:${e.id}`))
|
|
1089
1089
|
] }),
|
|
1090
|
-
|
|
1091
|
-
|
|
1090
|
+
ht.map(Nt),
|
|
1091
|
+
$e.map((e, n) => {
|
|
1092
1092
|
const l = (A) => {
|
|
1093
1093
|
if (!A) return "Older";
|
|
1094
1094
|
const c = new Date(A), v = /* @__PURE__ */ new Date(), y = new Date(v.getFullYear(), v.getMonth(), v.getDate());
|
|
1095
1095
|
return c >= y ? "Today" : c >= new Date(y.getTime() - 864e5) ? "Yesterday" : c >= new Date(y.getTime() - 5184e5) ? "This week" : "Older";
|
|
1096
|
-
}, s = l(e.created_at), k = n > 0 ? l(
|
|
1097
|
-
return /* @__PURE__ */ a(
|
|
1096
|
+
}, s = l(e.created_at), k = n > 0 ? l($e[n - 1].created_at) : null;
|
|
1097
|
+
return /* @__PURE__ */ a(fe, { children: [
|
|
1098
1098
|
s !== k ? /* @__PURE__ */ t("div", { className: "bg-slate-50/80 px-4 py-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400 dark:bg-muted/40", children: s }) : null,
|
|
1099
|
-
/* @__PURE__ */ t("div", { "data-live-key":
|
|
1099
|
+
/* @__PURE__ */ t("div", { "data-live-key": He(e), children: ue(e) })
|
|
1100
1100
|
] }, e.id);
|
|
1101
1101
|
})
|
|
1102
1102
|
]
|
|
1103
1103
|
}
|
|
1104
1104
|
) }),
|
|
1105
|
-
d !== "sent" &&
|
|
1105
|
+
d !== "sent" && q > ve && /* @__PURE__ */ a("div", { className: "mx-8 mb-6 flex items-center justify-between", children: [
|
|
1106
1106
|
/* @__PURE__ */ a("p", { className: "text-[12px] text-slate-400", children: [
|
|
1107
1107
|
"Page ",
|
|
1108
1108
|
_,
|
|
1109
1109
|
" of ",
|
|
1110
|
-
|
|
1110
|
+
re
|
|
1111
1111
|
] }),
|
|
1112
1112
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
1113
1113
|
/* @__PURE__ */ a(
|
|
@@ -1115,10 +1115,10 @@ function Aa({
|
|
|
1115
1115
|
{
|
|
1116
1116
|
type: "button",
|
|
1117
1117
|
disabled: _ <= 1,
|
|
1118
|
-
onClick: () =>
|
|
1118
|
+
onClick: () => M((e) => Math.max(1, e - 1)),
|
|
1119
1119
|
className: "inline-flex h-7 items-center rounded-md border border-slate-200 px-2 text-[12px] disabled:opacity-40 dark:border-border",
|
|
1120
1120
|
children: [
|
|
1121
|
-
/* @__PURE__ */ t(
|
|
1121
|
+
/* @__PURE__ */ t(zt, { className: "mr-1 h-3.5 w-3.5" }),
|
|
1122
1122
|
"Previous"
|
|
1123
1123
|
]
|
|
1124
1124
|
}
|
|
@@ -1127,12 +1127,12 @@ function Aa({
|
|
|
1127
1127
|
"button",
|
|
1128
1128
|
{
|
|
1129
1129
|
type: "button",
|
|
1130
|
-
disabled: _ >=
|
|
1131
|
-
onClick: () =>
|
|
1130
|
+
disabled: _ >= re,
|
|
1131
|
+
onClick: () => M((e) => Math.min(re, e + 1)),
|
|
1132
1132
|
className: "inline-flex h-7 items-center rounded-md border border-slate-200 px-2 text-[12px] disabled:opacity-40 dark:border-border",
|
|
1133
1133
|
children: [
|
|
1134
1134
|
"Next",
|
|
1135
|
-
/* @__PURE__ */ t(
|
|
1135
|
+
/* @__PURE__ */ t(Ft, { className: "ml-1 h-3.5 w-3.5" })
|
|
1136
1136
|
]
|
|
1137
1137
|
}
|
|
1138
1138
|
)
|
|
@@ -1140,29 +1140,29 @@ function Aa({
|
|
|
1140
1140
|
] })
|
|
1141
1141
|
] }),
|
|
1142
1142
|
/* @__PURE__ */ t(
|
|
1143
|
-
|
|
1143
|
+
Wt,
|
|
1144
1144
|
{
|
|
1145
1145
|
notificationId: (C == null ? void 0 : C.id) ?? null,
|
|
1146
1146
|
title: (C == null ? void 0 : C.subject) ?? (C == null ? void 0 : C.title) ?? null,
|
|
1147
|
-
onClose: () =>
|
|
1147
|
+
onClose: () => Se(null)
|
|
1148
1148
|
}
|
|
1149
1149
|
)
|
|
1150
1150
|
] });
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1152
|
+
function Qe(o) {
|
|
1153
1153
|
const p = o.replace(/_/g, " ").trim();
|
|
1154
1154
|
return p ? p.charAt(0).toUpperCase() + p.slice(1) : o;
|
|
1155
1155
|
}
|
|
1156
|
-
function
|
|
1156
|
+
function da({ text: o }) {
|
|
1157
1157
|
const p = o.split(`
|
|
1158
1158
|
`).map((g) => g.trim()).filter(Boolean);
|
|
1159
1159
|
if (p.length <= 1)
|
|
1160
1160
|
return /* @__PURE__ */ t("p", { className: "mt-0.5 line-clamp-3 whitespace-pre-line text-[12px] text-slate-500", children: o });
|
|
1161
1161
|
const f = p.slice(0, 4);
|
|
1162
1162
|
return /* @__PURE__ */ a("div", { className: "mt-0.5 space-y-0.5 text-[12px] text-slate-500", children: [
|
|
1163
|
-
f.map((g,
|
|
1163
|
+
f.map((g, Z) => (
|
|
1164
1164
|
// biome-ignore lint/suspicious/noArrayIndexKey: static lines of one message
|
|
1165
|
-
/* @__PURE__ */ t("p", { className: "line-clamp-2", children: g },
|
|
1165
|
+
/* @__PURE__ */ t("p", { className: "line-clamp-2", children: g }, Z)
|
|
1166
1166
|
)),
|
|
1167
1167
|
p.length > f.length && /* @__PURE__ */ a("p", { className: "text-[11.5px] text-slate-400", children: [
|
|
1168
1168
|
"+",
|
|
@@ -1172,5 +1172,5 @@ function ia({ text: o }) {
|
|
|
1172
1172
|
] });
|
|
1173
1173
|
}
|
|
1174
1174
|
export {
|
|
1175
|
-
|
|
1175
|
+
Da as NotificationCenterView
|
|
1176
1176
|
};
|