@nivaro/react 0.3.99 → 0.3.101
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/full.css +1 -1
- package/dist/hooks/useFormSchema.js +82 -85
- package/dist/hooks/useSessionRecorder.js +206 -175
- package/dist/index.d.ts +84 -16
- package/dist/index.js +627 -622
- package/dist/lib/commands.js +15 -11
- package/dist/shared/components/ActivityEntry.js +5 -5
- package/dist/shared/components/CollectionBrowserView.js +516 -503
- package/dist/shared/components/ItemEditForm.js +3471 -3465
- package/dist/shared/components/JobsTray.js +76 -61
- package/dist/shared/components/MyWorkView.js +133 -126
- package/dist/shared/components/NotificationBell.js +322 -289
- package/dist/shared/components/RecordCompare.js +38 -40
- package/dist/shared/components/RecordReadView.js +119 -119
- package/dist/shared/components/TipLayer.js +56 -41
- package/dist/shared/components/cbv/FoundElsewhere.js +61 -0
- package/dist/shared/components/integrations/console/SignalCard.js +40 -40
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +95 -73
- package/dist/shared/components/integrations/console/drill/status.js +23 -18
- package/dist/shared/components/item-edit/InlineGridField.js +45 -45
- package/dist/shared/components/item-edit/InlineTableField.js +750 -749
- package/dist/shared/components/item-edit/QuickPickerDialog.js +44 -44
- package/dist/shared/components/item-edit/RawEditSheet.js +122 -114
- package/dist/shared/components/item-edit/RecordInsights.js +86 -86
- package/dist/shared/components/item-edit/RelationCombobox.js +454 -378
- package/dist/shared/components/item-edit/SummaryPanel.js +56 -48
- package/dist/shared/components/item-edit/header-path-preview.js +46 -34
- package/dist/shared/components/item-edit/related-missing.js +75 -19
- package/dist/shared/components/notifications/DeliveryChips.js +1 -2
- package/dist/shared/components/notifications/NotificationCenterView.js +249 -226
- package/dist/shared/components/panels/AccessDeniedPanel.js +31 -28
- package/dist/shared/components/panels/BackgroundMove.js +242 -0
- package/dist/shared/components/panels/MoveAdvisory.js +204 -0
- package/dist/shared/components/panels/PipelinePanel.js +1459 -1220
- package/dist/shared/components/panels/RecordIntegrityBanner.js +113 -112
- package/dist/shared/components/profile/ActivityFeedCard.js +322 -0
- package/dist/shared/components/profile/DayTimeline.js +145 -140
- package/dist/shared/components/profile/PersonAccess.js +679 -383
- package/dist/shared/components/profile/PersonActivity.js +404 -427
- package/dist/shared/components/profile/PersonDidPanel.js +248 -134
- package/dist/shared/components/profile/PersonProfile.js +33 -32
- package/dist/shared/components/profile/journey-view.js +166 -0
- package/dist/shared/lib/activity-sentence.js +319 -236
- package/dist/shared/lib/commands.js +18 -14
- package/dist/shared/lib/error-hints.js +1 -1
- package/dist/shared/lib/job-failure-text.js +12 -0
- package/dist/shared/lib/jobs-tray.js +60 -41
- package/dist/shared/lib/move-failure.js +19 -0
- package/dist/shared/lib/obligation-banner.js +22 -21
- package/dist/shared/lib/partner-failure.js +83 -0
- package/dist/shared/lib/prefetch.js +73 -73
- package/dist/shared/lib/replay-checkout.js +18 -13
- package/dist/shared/lib/replay-context.js +90 -77
- package/dist/shared/lib/replay-idle.js +21 -0
- package/dist/shared/lib/replay-socket.js +21 -17
- package/dist/shared/lib/rum.js +56 -51
- package/dist/shared/lib/safe-error.js +17 -13
- package/dist/shared/lib/stale-chunk.js +69 -26
- package/dist/shared/lib/system-collections.js +20 -0
- package/package.json +1 -1
|
@@ -1,322 +1,348 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { readUnreadNotificationCount as
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { Bell as
|
|
5
|
-
import { useState as
|
|
6
|
-
import { createPortal as
|
|
7
|
-
import { useNivaroClient as
|
|
8
|
-
import { get as
|
|
9
|
-
import { useLiveRefetchInterval as
|
|
10
|
-
import { resolveNotificationTargetFor as
|
|
11
|
-
import { useTabAttention as
|
|
12
|
-
import { formatRelative as
|
|
13
|
-
import { AsItWasSheet as
|
|
14
|
-
import { bundleLocally as
|
|
15
|
-
import { DeliveryChips as
|
|
16
|
-
import { NotificationActions as
|
|
17
|
-
import { NotificationDetailBits as
|
|
18
|
-
function
|
|
19
|
-
var
|
|
1
|
+
import { jsxs as r, jsx as t, Fragment as Ne } from "react/jsx-runtime";
|
|
2
|
+
import { readUnreadNotificationCount as Ce, markNotificationRead as $e, markNotificationsRead as _e, markAllNotificationsRead as Me } from "@nivaro/sdk";
|
|
3
|
+
import { useQueryClient as Se, useQuery as re, useMutation as F } from "@tanstack/react-query";
|
|
4
|
+
import { Bell as qe, CheckCheck as Re, ExternalLink as oe, Check as A, History as Ee, ShieldCheck as Fe, ChevronDown as Ae } from "lucide-react";
|
|
5
|
+
import { useState as M, useRef as le, useEffect as P, useMemo as ie, Fragment as se } from "react";
|
|
6
|
+
import { createPortal as Le } from "react-dom";
|
|
7
|
+
import { useNivaroClient as Ie } from "../context.js";
|
|
8
|
+
import { get as De, post as Te } from "../lib/commands.js";
|
|
9
|
+
import { useLiveRefetchInterval as Ke } from "../lib/live-queries.js";
|
|
10
|
+
import { resolveNotificationTargetFor as S, runNotificationTarget as L } from "../lib/notification-target.js";
|
|
11
|
+
import { useTabAttention as Oe } from "../lib/tab-attention.js";
|
|
12
|
+
import { formatRelative as de, cn as Be } from "../lib/utils.js";
|
|
13
|
+
import { AsItWasSheet as je } from "./notifications/AsItWasSheet.js";
|
|
14
|
+
import { bundleLocally as ze, laneTone as Pe, bundleAsNotification as Qe, bundleHeadline as He, categoryChipLabel as Ge } from "./notifications/bundles.js";
|
|
15
|
+
import { DeliveryChips as Ue } from "./notifications/DeliveryChips.js";
|
|
16
|
+
import { NotificationActions as Ye } from "./notifications/NotificationActions.js";
|
|
17
|
+
import { NotificationDetailBits as Ve } from "./notifications/NotificationDetailBits.js";
|
|
18
|
+
function We(n) {
|
|
19
|
+
var p, k;
|
|
20
20
|
if (!n) return null;
|
|
21
21
|
if (n.target_label && n.kind !== "record") return n.target_label;
|
|
22
22
|
if (String(n.collection ?? "") === "__chat__") return "Chat";
|
|
23
23
|
if (!n.collection) return null;
|
|
24
|
-
const d = ((
|
|
25
|
-
const
|
|
26
|
-
return
|
|
27
|
-
})(),
|
|
28
|
-
return d &&
|
|
24
|
+
const d = ((p = n.record_collection_label) == null ? void 0 : p.trim()) || (() => {
|
|
25
|
+
const h = String(n.collection).replace(/_/g, " ").trim();
|
|
26
|
+
return h ? h.charAt(0).toUpperCase() + h.slice(1) : null;
|
|
27
|
+
})(), u = (k = n.record_label) == null ? void 0 : k.trim();
|
|
28
|
+
return d && u ? `${d} ${u}` : u || d || null;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
var d,
|
|
32
|
-
return
|
|
30
|
+
function Je(n) {
|
|
31
|
+
var d, u;
|
|
32
|
+
return ce(n) ? n.revision_id != null || (((u = (d = n.detail) == null ? void 0 : d.changes) == null ? void 0 : u.length) ?? 0) > 0 || n.category === "watch" || n.category === "workflow" : !1;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
var
|
|
36
|
-
if ((((
|
|
37
|
-
const
|
|
38
|
-
return !!
|
|
34
|
+
function ce(n) {
|
|
35
|
+
var k, h, q;
|
|
36
|
+
if ((((k = n.target) == null ? void 0 : k.kind) ?? n.kind ?? (n.collection && n.item ? "record" : null)) !== "record") return !1;
|
|
37
|
+
const u = ((h = n.target) == null ? void 0 : h.collection) ?? n.collection, p = ((q = n.target) == null ? void 0 : q.id) ?? n.item;
|
|
38
|
+
return !!u && p != null && p !== "" && !/^(nivaro|directus)_|^__/i.test(u);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function xt({
|
|
41
41
|
routes: n,
|
|
42
42
|
onNavigate: d,
|
|
43
|
-
app:
|
|
44
|
-
subscribe:
|
|
45
|
-
buttonClassName:
|
|
46
|
-
panelClassName:
|
|
47
|
-
beforeList:
|
|
48
|
-
extraBadge:
|
|
49
|
-
mailLogUrl:
|
|
50
|
-
renderTrigger:
|
|
51
|
-
allPath:
|
|
52
|
-
subscriptionsPath:
|
|
43
|
+
app: u,
|
|
44
|
+
subscribe: p,
|
|
45
|
+
buttonClassName: k,
|
|
46
|
+
panelClassName: h,
|
|
47
|
+
beforeList: q,
|
|
48
|
+
extraBadge: Q = 0,
|
|
49
|
+
mailLogUrl: ue,
|
|
50
|
+
renderTrigger: H,
|
|
51
|
+
allPath: G,
|
|
52
|
+
subscriptionsPath: pe,
|
|
53
53
|
rulesPath: me,
|
|
54
|
-
onActionError:
|
|
55
|
-
panelPlacement:
|
|
54
|
+
onActionError: fe,
|
|
55
|
+
panelPlacement: $ = "below",
|
|
56
56
|
tabBadge: xe = !0
|
|
57
57
|
}) {
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
},
|
|
58
|
+
const y = Ie(), [g, m] = M(!1), [w, U] = M("attention"), I = le(null), Y = le(null), [D, he] = M(null), V = Se(), _ = () => {
|
|
59
|
+
V.invalidateQueries({ queryKey: ["notification-count"] }), V.invalidateQueries({ queryKey: ["notifications"] });
|
|
60
|
+
}, be = Ke(6e4, { enabled: !!p, safetyMs: 12e4 }), { data: f } = re({
|
|
61
61
|
queryKey: ["notification-count"],
|
|
62
|
-
queryFn: () =>
|
|
63
|
-
refetchInterval:
|
|
64
|
-
}),
|
|
65
|
-
|
|
66
|
-
const { data: x } =
|
|
67
|
-
queryKey: ["notifications", "bell",
|
|
68
|
-
queryFn: () =>
|
|
69
|
-
|
|
62
|
+
queryFn: () => y.request(Ce()),
|
|
63
|
+
refetchInterval: be
|
|
64
|
+
}), T = (f == null ? void 0 : f.unread) ?? 0, K = (f == null ? void 0 : f.attention) ?? T, R = (f == null ? void 0 : f.lanes) ?? { critical: 0, fyi: 0 }, N = T + Q;
|
|
65
|
+
Oe(K + Q, { enabled: xe });
|
|
66
|
+
const { data: x } = re({
|
|
67
|
+
queryKey: ["notifications", "bell", u ?? null, w],
|
|
68
|
+
queryFn: () => y.request(
|
|
69
|
+
De("/notifications", {
|
|
70
70
|
limit: 60,
|
|
71
|
-
app:
|
|
71
|
+
app: u,
|
|
72
72
|
bundle: "record",
|
|
73
|
-
...
|
|
74
|
-
...
|
|
73
|
+
...w === "attention" ? { lane: "attention", status: "inbox" } : {},
|
|
74
|
+
...w === "fyi" ? { lane: "fyi", status: "inbox" } : {}
|
|
75
75
|
})
|
|
76
76
|
).then((e) => {
|
|
77
|
-
const
|
|
78
|
-
return e.bundles ? { rows:
|
|
77
|
+
const a = e.pinned ?? [], o = new Set(a.map((s) => s.id)), i = (e.data ?? []).filter((s) => !o.has(s.id));
|
|
78
|
+
return e.bundles ? { rows: i, bundles: e.bundles, pinned: a } : { ...ze(i), pinned: a };
|
|
79
79
|
}),
|
|
80
|
-
enabled:
|
|
81
|
-
}),
|
|
82
|
-
|
|
83
|
-
if (!
|
|
84
|
-
const e = (
|
|
85
|
-
var
|
|
86
|
-
const
|
|
87
|
-
(
|
|
80
|
+
enabled: g
|
|
81
|
+
}), W = (x == null ? void 0 : x.rows) ?? [], O = (x == null ? void 0 : x.pinned) ?? [], J = (x == null ? void 0 : x.bundles) ?? [], [ke, X] = M(() => /* @__PURE__ */ new Set()), [C, B] = M(null);
|
|
82
|
+
P(() => p == null ? void 0 : p(_), [p]), P(() => {
|
|
83
|
+
if (!g) return;
|
|
84
|
+
const e = (a) => {
|
|
85
|
+
var i, s;
|
|
86
|
+
const o = a.target;
|
|
87
|
+
(i = I.current) != null && i.contains(o) || (s = Y.current) != null && s.contains(o) || m(!1);
|
|
88
88
|
};
|
|
89
89
|
return window.addEventListener("mousedown", e), () => window.removeEventListener("mousedown", e);
|
|
90
|
-
}, [
|
|
91
|
-
if (!
|
|
90
|
+
}, [g]), P(() => {
|
|
91
|
+
if (!g || $ !== "right") return;
|
|
92
92
|
const e = () => {
|
|
93
|
-
var
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
left: Math.round(
|
|
97
|
-
bottom: Math.max(8, Math.round(window.innerHeight -
|
|
93
|
+
var o;
|
|
94
|
+
const a = (o = I.current) == null ? void 0 : o.getBoundingClientRect();
|
|
95
|
+
a && he({
|
|
96
|
+
left: Math.round(a.right + 12),
|
|
97
|
+
bottom: Math.max(8, Math.round(window.innerHeight - a.bottom))
|
|
98
98
|
});
|
|
99
99
|
};
|
|
100
100
|
return e(), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
101
101
|
window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
102
102
|
};
|
|
103
|
-
}, [
|
|
104
|
-
const
|
|
105
|
-
mutationFn: (e) =>
|
|
106
|
-
onSuccess:
|
|
107
|
-
}),
|
|
108
|
-
mutationFn: (e) =>
|
|
109
|
-
onSuccess:
|
|
110
|
-
}),
|
|
111
|
-
mutationFn: (e) =>
|
|
112
|
-
onSuccess:
|
|
113
|
-
}), ge =
|
|
114
|
-
mutationFn: () =>
|
|
115
|
-
onSuccess:
|
|
116
|
-
}),
|
|
103
|
+
}, [g, $]);
|
|
104
|
+
const Z = F({
|
|
105
|
+
mutationFn: (e) => y.request(Te(`/notifications/${e}/acknowledge`)),
|
|
106
|
+
onSuccess: _
|
|
107
|
+
}), E = F({
|
|
108
|
+
mutationFn: (e) => y.request($e(e)),
|
|
109
|
+
onSuccess: _
|
|
110
|
+
}), j = F({
|
|
111
|
+
mutationFn: (e) => y.request(_e(e)),
|
|
112
|
+
onSuccess: _
|
|
113
|
+
}), ge = F({
|
|
114
|
+
mutationFn: () => y.request(Me()),
|
|
115
|
+
onSuccess: _
|
|
116
|
+
}), ee = ie(() => W.slice(0, 40), [W]), te = ie(() => {
|
|
117
117
|
const e = /* @__PURE__ */ new Map();
|
|
118
|
-
for (const
|
|
119
|
-
const
|
|
120
|
-
key:
|
|
121
|
-
collection:
|
|
122
|
-
item:
|
|
118
|
+
for (const a of ee) {
|
|
119
|
+
const o = a.collection && a.item ? `${a.collection}:${a.item}` : `single:${a.id}`, i = e.get(o) ?? {
|
|
120
|
+
key: o,
|
|
121
|
+
collection: a.collection ?? null,
|
|
122
|
+
item: a.item ?? null,
|
|
123
123
|
rows: []
|
|
124
124
|
};
|
|
125
|
-
|
|
125
|
+
i.rows.push(a), e.set(o, i);
|
|
126
126
|
}
|
|
127
127
|
return [...e.values()];
|
|
128
|
-
}, [
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
},
|
|
128
|
+
}, [ee]), we = (e) => {
|
|
129
|
+
const a = S(e, n);
|
|
130
|
+
a && (m(!1), L(a, d));
|
|
131
|
+
}, ae = (e) => {
|
|
132
132
|
m(!1), d(e);
|
|
133
|
-
},
|
|
134
|
-
var
|
|
135
|
-
|
|
136
|
-
/* @__PURE__ */
|
|
133
|
+
}, z = (e, a, o = !1) => {
|
|
134
|
+
var v;
|
|
135
|
+
const i = S(e, n) != null, s = `py-2 pr-3 ${o ? "pl-7" : "pl-3"}`, b = /* @__PURE__ */ r(Ne, { children: [
|
|
136
|
+
/* @__PURE__ */ t(
|
|
137
|
+
"span",
|
|
138
|
+
{
|
|
139
|
+
className: `mt-1.5 h-2 w-2 shrink-0 rounded-full ${e.read ? "bg-transparent" : e.lane === "critical" ? "bg-red-500" : "bg-nvr-cyan"}`
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
/* @__PURE__ */ r("span", { className: "min-w-0 flex-1", children: [
|
|
143
|
+
/* @__PURE__ */ r(
|
|
144
|
+
"span",
|
|
145
|
+
{
|
|
146
|
+
className: `block truncate text-[12.5px] ${e.read ? "font-normal text-slate-600 dark:text-slate-400" : "font-medium text-slate-900 dark:text-slate-100"}`,
|
|
147
|
+
children: [
|
|
148
|
+
e.lane === "critical" && !e.read && /* @__PURE__ */ t("span", { className: "mr-1 rounded bg-red-500/10 px-1 text-[9.5px] font-bold uppercase tracking-wide text-red-600 dark:text-red-400", children: "Critical" }),
|
|
149
|
+
e.title
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
e.message && /* @__PURE__ */ t("span", { className: "mt-0.5 line-clamp-2 text-[11px] leading-snug text-slate-500", children: e.message.replace(/<[^>]+>/g, "") }),
|
|
154
|
+
/* @__PURE__ */ r("span", { className: "mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[10.5px] text-slate-400", children: [
|
|
155
|
+
de(e.created_at),
|
|
156
|
+
/* @__PURE__ */ t(
|
|
157
|
+
Ue,
|
|
158
|
+
{
|
|
159
|
+
delivery: e.delivery,
|
|
160
|
+
mailLogUrl: ue,
|
|
161
|
+
onNavigate: ae
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
ce(e) && // biome-ignore lint/a11y/useSemanticElements: nested inside the row's <button> — a real <button> is invalid there
|
|
165
|
+
/* @__PURE__ */ r(
|
|
166
|
+
"span",
|
|
167
|
+
{
|
|
168
|
+
role: "button",
|
|
169
|
+
tabIndex: -1,
|
|
170
|
+
"data-notification-as-it-was": e.id,
|
|
171
|
+
"data-tip": "The record as it was when you were told",
|
|
172
|
+
onClick: (c) => {
|
|
173
|
+
c.stopPropagation(), m(!1), B(e);
|
|
174
|
+
},
|
|
175
|
+
onKeyDown: (c) => {
|
|
176
|
+
(c.key === "Enter" || c.key === " ") && (c.preventDefault(), c.stopPropagation(), m(!1), B(e));
|
|
177
|
+
},
|
|
178
|
+
className: "inline-flex items-center gap-0.5 rounded px-1 text-[10.5px] text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
179
|
+
children: [
|
|
180
|
+
/* @__PURE__ */ t(Ee, { className: "h-3 w-3" }),
|
|
181
|
+
"as it was"
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
] })
|
|
186
|
+
] })
|
|
187
|
+
] }), l = "mt-0.5 rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200";
|
|
188
|
+
return /* @__PURE__ */ r(se, { children: [
|
|
189
|
+
i ? /* @__PURE__ */ r(
|
|
137
190
|
"button",
|
|
138
191
|
{
|
|
139
192
|
type: "button",
|
|
140
193
|
onClick: () => {
|
|
141
|
-
e.read ||
|
|
194
|
+
e.read || E.mutate(e.id), we(e);
|
|
142
195
|
},
|
|
143
|
-
className: `flex w-full items-start gap-2.5
|
|
196
|
+
className: `flex w-full items-start gap-2.5 text-left transition-colors hover:bg-slate-50 dark:hover:bg-muted ${s}`,
|
|
144
197
|
"data-notification-row": e.id,
|
|
145
198
|
children: [
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
className: `mt-1.5 h-2 w-2 shrink-0 rounded-full ${e.read ? "bg-transparent" : e.lane === "critical" ? "bg-red-500" : "bg-nvr-cyan"}`
|
|
150
|
-
}
|
|
151
|
-
),
|
|
152
|
-
/* @__PURE__ */ o("span", { className: "min-w-0 flex-1", children: [
|
|
153
|
-
/* @__PURE__ */ o(
|
|
154
|
-
"span",
|
|
155
|
-
{
|
|
156
|
-
className: `block truncate text-[12.5px] ${e.read ? "font-normal text-slate-600 dark:text-slate-400" : "font-medium text-slate-900 dark:text-slate-100"}`,
|
|
157
|
-
children: [
|
|
158
|
-
e.lane === "critical" && !e.read && /* @__PURE__ */ a("span", { className: "mr-1 rounded bg-red-500/10 px-1 text-[9.5px] font-bold uppercase tracking-wide text-red-600 dark:text-red-400", children: "Critical" }),
|
|
159
|
-
e.title
|
|
160
|
-
]
|
|
161
|
-
}
|
|
162
|
-
),
|
|
163
|
-
e.message && /* @__PURE__ */ a("span", { className: "mt-0.5 line-clamp-2 text-[11px] leading-snug text-slate-500", children: e.message.replace(/<[^>]+>/g, "") }),
|
|
164
|
-
/* @__PURE__ */ o("span", { className: "mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[10.5px] text-slate-400", children: [
|
|
165
|
-
se(e.created_at),
|
|
166
|
-
/* @__PURE__ */ a(
|
|
167
|
-
Qe,
|
|
168
|
-
{
|
|
169
|
-
delivery: e.delivery,
|
|
170
|
-
mailLogUrl: ce,
|
|
171
|
-
onNavigate: te
|
|
172
|
-
}
|
|
173
|
-
),
|
|
174
|
-
de(e) && // biome-ignore lint/a11y/useSemanticElements: nested inside the row's <button> — a real <button> is invalid there
|
|
175
|
-
/* @__PURE__ */ o(
|
|
176
|
-
"span",
|
|
177
|
-
{
|
|
178
|
-
role: "button",
|
|
179
|
-
tabIndex: -1,
|
|
180
|
-
"data-notification-as-it-was": e.id,
|
|
181
|
-
"data-tip": "The record as it was when you were told",
|
|
182
|
-
onClick: (r) => {
|
|
183
|
-
r.stopPropagation(), m(!1), T(e);
|
|
184
|
-
},
|
|
185
|
-
onKeyDown: (r) => {
|
|
186
|
-
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), r.stopPropagation(), m(!1), T(e));
|
|
187
|
-
},
|
|
188
|
-
className: "inline-flex items-center gap-0.5 rounded px-1 text-[10.5px] text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
189
|
-
children: [
|
|
190
|
-
/* @__PURE__ */ a(Ee, { className: "h-3 w-3" }),
|
|
191
|
-
"as it was"
|
|
192
|
-
]
|
|
193
|
-
}
|
|
194
|
-
)
|
|
195
|
-
] })
|
|
196
|
-
] }),
|
|
197
|
-
!t && !e.read && // biome-ignore lint/a11y/useSemanticElements: nested inside the row's <button> — a real <button> is invalid there
|
|
198
|
-
/* @__PURE__ */ a(
|
|
199
|
+
b,
|
|
200
|
+
!a && !e.read && // biome-ignore lint/a11y/useSemanticElements: nested inside the row's <button> — a real <button> is invalid there
|
|
201
|
+
/* @__PURE__ */ t(
|
|
199
202
|
"span",
|
|
200
203
|
{
|
|
201
204
|
role: "button",
|
|
202
205
|
tabIndex: -1,
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
+
"aria-label": "Mark read",
|
|
207
|
+
"data-tip": "Mark read",
|
|
208
|
+
onClick: (c) => {
|
|
209
|
+
c.stopPropagation(), E.mutate(e.id);
|
|
206
210
|
},
|
|
207
|
-
onKeyDown: (
|
|
208
|
-
(
|
|
211
|
+
onKeyDown: (c) => {
|
|
212
|
+
(c.key === "Enter" || c.key === " ") && (c.preventDefault(), c.stopPropagation(), E.mutate(e.id));
|
|
209
213
|
},
|
|
210
|
-
className:
|
|
211
|
-
children: /* @__PURE__ */
|
|
214
|
+
className: l,
|
|
215
|
+
children: /* @__PURE__ */ t(A, { className: "h-3 w-3" })
|
|
216
|
+
}
|
|
217
|
+
)
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
) : /* @__PURE__ */ r(
|
|
221
|
+
"div",
|
|
222
|
+
{
|
|
223
|
+
className: `flex w-full items-start gap-2.5 text-left ${s}`,
|
|
224
|
+
"data-notification-row": e.id,
|
|
225
|
+
"data-notification-plain": !0,
|
|
226
|
+
children: [
|
|
227
|
+
b,
|
|
228
|
+
/* @__PURE__ */ t(
|
|
229
|
+
"button",
|
|
230
|
+
{
|
|
231
|
+
type: "button",
|
|
232
|
+
"aria-label": "Mark read",
|
|
233
|
+
"data-tip": "Mark read",
|
|
234
|
+
tabIndex: e.read ? -1 : void 0,
|
|
235
|
+
onClick: () => E.mutate(e.id),
|
|
236
|
+
className: Be(l, "shrink-0", e.read && "invisible"),
|
|
237
|
+
children: /* @__PURE__ */ t(A, { className: "h-3 w-3" })
|
|
212
238
|
}
|
|
213
239
|
)
|
|
214
240
|
]
|
|
215
241
|
}
|
|
216
242
|
),
|
|
217
|
-
((
|
|
243
|
+
((v = e.ack) == null ? void 0 : v.required) && !e.ack.at && /* @__PURE__ */ t("div", { className: `pb-2 pr-3 ${o ? "pl-[46px]" : "pl-[30px]"}`, children: /* @__PURE__ */ r(
|
|
218
244
|
"button",
|
|
219
245
|
{
|
|
220
246
|
type: "button",
|
|
221
|
-
disabled:
|
|
222
|
-
onClick: () =>
|
|
247
|
+
disabled: Z.isPending,
|
|
248
|
+
onClick: () => Z.mutate(e.id),
|
|
223
249
|
"data-notification-acknowledge": e.id,
|
|
224
250
|
className: "inline-flex items-center gap-1 rounded-md bg-nvr-cyan px-2 py-1 text-[11px] font-medium text-white hover:opacity-90 disabled:opacity-50",
|
|
225
251
|
children: [
|
|
226
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ t(Fe, { className: "h-3 w-3" }),
|
|
227
253
|
"Acknowledge"
|
|
228
254
|
]
|
|
229
255
|
}
|
|
230
256
|
) }),
|
|
231
|
-
e.actions && e.actions.length > 0 && !e.read && /* @__PURE__ */
|
|
232
|
-
|
|
257
|
+
e.actions && e.actions.length > 0 && !e.read && /* @__PURE__ */ t(
|
|
258
|
+
Ye,
|
|
233
259
|
{
|
|
234
260
|
actions: e.actions,
|
|
235
261
|
notificationId: e.id,
|
|
236
|
-
onError:
|
|
237
|
-
className: `pb-2 pr-3 ${
|
|
262
|
+
onError: fe,
|
|
263
|
+
className: `pb-2 pr-3 ${o ? "pl-[46px]" : "pl-[30px]"}`
|
|
238
264
|
}
|
|
239
265
|
),
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
-
|
|
266
|
+
/* @__PURE__ */ t(
|
|
267
|
+
Ve,
|
|
242
268
|
{
|
|
243
269
|
detail: e.detail,
|
|
244
270
|
why: e.why,
|
|
245
271
|
delivery: e.delivery,
|
|
246
272
|
notificationId: e.id,
|
|
247
|
-
recordChanges:
|
|
248
|
-
subscriptionsPath:
|
|
273
|
+
recordChanges: Je(e),
|
|
274
|
+
subscriptionsPath: pe,
|
|
249
275
|
rulesPath: me,
|
|
250
|
-
onNavigate:
|
|
251
|
-
className: `pb-3 pr-3 ${
|
|
276
|
+
onNavigate: ae,
|
|
277
|
+
className: `pb-3 pr-3 ${o ? "pl-[46px]" : "pl-[30px]"}`
|
|
252
278
|
}
|
|
253
279
|
)
|
|
254
280
|
] }, e.id);
|
|
255
|
-
},
|
|
256
|
-
const
|
|
257
|
-
return /* @__PURE__ */
|
|
281
|
+
}, ve = (e) => {
|
|
282
|
+
const a = `${e.collection}:${e.item}`, o = ke.has(a), i = Pe(e.lane), s = e.deleted ? null : S(Qe(e), n), b = e.rows.filter((l) => !l.read).map((l) => l.id);
|
|
283
|
+
return /* @__PURE__ */ r(
|
|
258
284
|
"div",
|
|
259
285
|
{
|
|
260
286
|
className: "border-b border-slate-50 last:border-b-0 dark:border-border/50",
|
|
261
287
|
"data-notification-bundle-deleted": e.deleted ? "true" : void 0,
|
|
262
|
-
"data-notification-bundle":
|
|
288
|
+
"data-notification-bundle": a,
|
|
263
289
|
"data-notification-bundle-count": e.count,
|
|
264
290
|
"data-notification-bundle-lane": e.lane,
|
|
265
291
|
children: [
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ r("div", { className: "flex items-start gap-2 px-3 py-2", children: [
|
|
293
|
+
/* @__PURE__ */ t(
|
|
268
294
|
"button",
|
|
269
295
|
{
|
|
270
296
|
type: "button",
|
|
271
|
-
"aria-expanded":
|
|
272
|
-
"aria-label":
|
|
273
|
-
"data-notification-bundle-expand":
|
|
274
|
-
onClick: () =>
|
|
275
|
-
const
|
|
276
|
-
return
|
|
297
|
+
"aria-expanded": o,
|
|
298
|
+
"aria-label": o ? "Collapse" : "Expand",
|
|
299
|
+
"data-notification-bundle-expand": a,
|
|
300
|
+
onClick: () => X((l) => {
|
|
301
|
+
const v = new Set(l);
|
|
302
|
+
return v.has(a) ? v.delete(a) : v.add(a), v;
|
|
277
303
|
}),
|
|
278
304
|
className: "mt-0.5 rounded p-0.5 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
279
|
-
children: /* @__PURE__ */
|
|
280
|
-
|
|
305
|
+
children: /* @__PURE__ */ t(
|
|
306
|
+
Ae,
|
|
281
307
|
{
|
|
282
|
-
className: `h-3.5 w-3.5 transition-transform ${
|
|
308
|
+
className: `h-3.5 w-3.5 transition-transform ${o ? "" : "-rotate-90"}`
|
|
283
309
|
}
|
|
284
310
|
)
|
|
285
311
|
}
|
|
286
312
|
),
|
|
287
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ r(
|
|
288
314
|
"button",
|
|
289
315
|
{
|
|
290
316
|
type: "button",
|
|
291
317
|
onClick: () => {
|
|
292
|
-
|
|
318
|
+
s ? (m(!1), L(s, d)) : X((l) => new Set(l).add(a));
|
|
293
319
|
},
|
|
294
320
|
className: "min-w-0 flex-1 text-left",
|
|
295
321
|
children: [
|
|
296
|
-
/* @__PURE__ */
|
|
297
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ r("span", { className: "flex items-center gap-1.5", children: [
|
|
323
|
+
/* @__PURE__ */ t(
|
|
298
324
|
"span",
|
|
299
325
|
{
|
|
300
|
-
className: `h-2 w-2 shrink-0 rounded-full ${e.unread > 0 ?
|
|
326
|
+
className: `h-2 w-2 shrink-0 rounded-full ${e.unread > 0 ? i.dot : "bg-transparent"}`
|
|
301
327
|
}
|
|
302
328
|
),
|
|
303
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ t(
|
|
304
330
|
"span",
|
|
305
331
|
{
|
|
306
|
-
className: `truncate text-[12.5px] ${e.unread > 0 ? `font-medium ${
|
|
307
|
-
children:
|
|
332
|
+
className: `truncate text-[12.5px] ${e.unread > 0 ? `font-medium ${i.text}` : "font-normal text-slate-600 dark:text-slate-400"}`,
|
|
333
|
+
children: He(e)
|
|
308
334
|
}
|
|
309
335
|
)
|
|
310
336
|
] }),
|
|
311
|
-
/* @__PURE__ */
|
|
312
|
-
e.lane === "critical" && e.unread > 0 && /* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ r("span", { className: "mt-1 flex flex-wrap items-center gap-1 pl-3.5 text-[10.5px] text-slate-400", children: [
|
|
338
|
+
e.lane === "critical" && e.unread > 0 && /* @__PURE__ */ t(
|
|
313
339
|
"span",
|
|
314
340
|
{
|
|
315
|
-
className: `rounded px-1 text-[9.5px] font-bold uppercase tracking-wide ${
|
|
341
|
+
className: `rounded px-1 text-[9.5px] font-bold uppercase tracking-wide ${i.chip}`,
|
|
316
342
|
children: "Critical"
|
|
317
343
|
}
|
|
318
344
|
),
|
|
319
|
-
e.collection_label && /* @__PURE__ */
|
|
345
|
+
e.collection_label && /* @__PURE__ */ t(
|
|
320
346
|
"span",
|
|
321
347
|
{
|
|
322
348
|
className: "rounded border border-slate-200 px-1 py-px text-[9.5px] font-medium text-slate-500 dark:border-border dark:text-slate-400",
|
|
@@ -324,25 +350,26 @@ function mt({
|
|
|
324
350
|
children: e.collection_label
|
|
325
351
|
}
|
|
326
352
|
),
|
|
327
|
-
e.deleted && /* @__PURE__ */
|
|
353
|
+
e.deleted && /* @__PURE__ */ t(
|
|
328
354
|
"span",
|
|
329
355
|
{
|
|
330
356
|
className: "rounded bg-rose-50 px-1 py-px text-[9.5px] font-semibold text-rose-700 dark:bg-rose-900/30 dark:text-rose-300",
|
|
331
|
-
|
|
357
|
+
"data-notification-bundle-gone": !0,
|
|
358
|
+
"data-tip": "This record has since been deleted",
|
|
332
359
|
children: "deleted"
|
|
333
360
|
}
|
|
334
361
|
),
|
|
335
|
-
e.categories.map((
|
|
362
|
+
e.categories.map((l) => /* @__PURE__ */ t(
|
|
336
363
|
"span",
|
|
337
364
|
{
|
|
338
365
|
className: "rounded bg-slate-100 px-1 py-px text-[9.5px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
|
|
339
|
-
"data-notification-bundle-category":
|
|
340
|
-
children:
|
|
366
|
+
"data-notification-bundle-category": l,
|
|
367
|
+
children: Ge(l)
|
|
341
368
|
},
|
|
342
|
-
|
|
369
|
+
l
|
|
343
370
|
)),
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
-
e.unread > 0 && e.unread < e.count && /* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ t("span", { children: e.newest ? de(e.newest) : "" }),
|
|
372
|
+
e.unread > 0 && e.unread < e.count && /* @__PURE__ */ r("span", { children: [
|
|
346
373
|
"· ",
|
|
347
374
|
e.unread,
|
|
348
375
|
" unread"
|
|
@@ -351,94 +378,97 @@ function mt({
|
|
|
351
378
|
]
|
|
352
379
|
}
|
|
353
380
|
),
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
-
|
|
381
|
+
/* @__PURE__ */ r("span", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
382
|
+
s && /* @__PURE__ */ t(
|
|
356
383
|
"button",
|
|
357
384
|
{
|
|
358
385
|
type: "button",
|
|
359
|
-
|
|
386
|
+
"aria-label": "Open record",
|
|
387
|
+
"data-tip": "Open record",
|
|
388
|
+
"data-notification-open-record": !0,
|
|
360
389
|
onClick: () => {
|
|
361
|
-
m(!1), L(
|
|
390
|
+
m(!1), L(s, d);
|
|
362
391
|
},
|
|
363
392
|
className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
364
|
-
children: /* @__PURE__ */
|
|
393
|
+
children: /* @__PURE__ */ t(oe, { className: "h-3 w-3" })
|
|
365
394
|
}
|
|
366
395
|
),
|
|
367
|
-
|
|
396
|
+
b.length > 0 && /* @__PURE__ */ t(
|
|
368
397
|
"button",
|
|
369
398
|
{
|
|
370
399
|
type: "button",
|
|
371
|
-
|
|
372
|
-
"data-
|
|
373
|
-
|
|
400
|
+
"aria-label": "Mark read",
|
|
401
|
+
"data-tip": "Mark read",
|
|
402
|
+
"data-notification-bundle-read": a,
|
|
403
|
+
onClick: () => j.mutate(b),
|
|
374
404
|
className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
375
|
-
children: /* @__PURE__ */
|
|
405
|
+
children: /* @__PURE__ */ t(A, { className: "h-3 w-3" })
|
|
376
406
|
}
|
|
377
407
|
)
|
|
378
408
|
] })
|
|
379
409
|
] }),
|
|
380
|
-
|
|
410
|
+
o && /* @__PURE__ */ t(
|
|
381
411
|
"div",
|
|
382
412
|
{
|
|
383
413
|
className: "border-t border-slate-50 bg-slate-50/50 dark:border-border/50 dark:bg-muted/30",
|
|
384
|
-
"data-notification-bundle-rows":
|
|
385
|
-
children: e.rows.map((
|
|
414
|
+
"data-notification-bundle-rows": a,
|
|
415
|
+
children: e.rows.map((l) => z(l, !0, !0))
|
|
386
416
|
}
|
|
387
417
|
)
|
|
388
418
|
]
|
|
389
419
|
},
|
|
390
|
-
`bundle:${
|
|
420
|
+
`bundle:${a}`
|
|
391
421
|
);
|
|
392
|
-
},
|
|
393
|
-
{ key: "attention", label: "Needs you", count:
|
|
394
|
-
{ key: "fyi", label: "FYI", count:
|
|
422
|
+
}, ye = [
|
|
423
|
+
{ key: "attention", label: "Needs you", count: K },
|
|
424
|
+
{ key: "fyi", label: "FYI", count: R.fyi },
|
|
395
425
|
{ key: "all", label: "All", count: null }
|
|
396
|
-
],
|
|
397
|
-
return /* @__PURE__ */
|
|
398
|
-
|
|
426
|
+
], ne = () => m((e) => (!e && w === "attention" && K === 0 && R.fyi > 0 && U("fyi"), !e));
|
|
427
|
+
return /* @__PURE__ */ r("div", { ref: I, className: "relative", "data-nvr-notification-bell": !0, children: [
|
|
428
|
+
H ? H({ open: g, badge: N, toggle: ne }) : /* @__PURE__ */ r(
|
|
399
429
|
"button",
|
|
400
430
|
{
|
|
401
431
|
type: "button",
|
|
402
|
-
onClick:
|
|
403
|
-
className:
|
|
404
|
-
"aria-label":
|
|
432
|
+
onClick: ne,
|
|
433
|
+
className: k ?? "relative rounded-md p-1.5 text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-muted",
|
|
434
|
+
"aria-label": N ? `Notifications (${N} unread)` : "Notifications",
|
|
405
435
|
children: [
|
|
406
|
-
/* @__PURE__ */
|
|
407
|
-
|
|
436
|
+
/* @__PURE__ */ t(qe, { className: "h-4 w-4", strokeWidth: 1.8 }),
|
|
437
|
+
N > 0 && /* @__PURE__ */ t(
|
|
408
438
|
"span",
|
|
409
439
|
{
|
|
410
440
|
"data-nvr-recording-hide": !0,
|
|
411
|
-
className: `absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[9.5px] font-bold ${
|
|
412
|
-
children:
|
|
441
|
+
className: `absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[9.5px] font-bold ${R.critical > 0 ? "bg-red-500 text-white" : "bg-nvr-cyan text-nvr-navy"}`,
|
|
442
|
+
children: N > 99 ? "99+" : N
|
|
413
443
|
}
|
|
414
444
|
)
|
|
415
445
|
]
|
|
416
446
|
}
|
|
417
447
|
),
|
|
418
|
-
|
|
419
|
-
/* @__PURE__ */
|
|
448
|
+
g && ($ === "right" ? Le : (e) => e)(
|
|
449
|
+
/* @__PURE__ */ r(
|
|
420
450
|
"div",
|
|
421
451
|
{
|
|
422
|
-
ref:
|
|
423
|
-
className: `${
|
|
424
|
-
style:
|
|
452
|
+
ref: Y,
|
|
453
|
+
className: `${$ === "right" ? "fixed z-[110]" : "absolute right-0 top-10 z-40"} w-[360px] overflow-hidden rounded-xl border border-slate-200 bg-white shadow-xl dark:border-border dark:bg-card ${h ?? ""}`,
|
|
454
|
+
style: $ === "right" && D ? { left: D.left, bottom: D.bottom } : void 0,
|
|
425
455
|
"data-nvr-notification-panel": !0,
|
|
426
456
|
children: [
|
|
427
|
-
|
|
428
|
-
/* @__PURE__ */
|
|
429
|
-
/* @__PURE__ */
|
|
457
|
+
q,
|
|
458
|
+
/* @__PURE__ */ r("div", { className: "flex items-center justify-between border-b border-slate-100 px-3 py-2 dark:border-border/60", children: [
|
|
459
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-1 rounded-md bg-slate-100 p-0.5 dark:bg-muted", children: ye.map((e) => /* @__PURE__ */ r(
|
|
430
460
|
"button",
|
|
431
461
|
{
|
|
432
462
|
type: "button",
|
|
433
|
-
onClick: () =>
|
|
463
|
+
onClick: () => U(e.key),
|
|
434
464
|
"data-nvr-lane-tab": e.key,
|
|
435
|
-
className:
|
|
465
|
+
className: w === e.key ? "rounded bg-white px-2 py-0.5 text-[11px] font-medium text-slate-900 shadow-sm dark:bg-card dark:text-slate-100" : "rounded px-2 py-0.5 text-[11px] font-medium text-slate-500 hover:text-slate-700 dark:text-slate-400",
|
|
436
466
|
children: [
|
|
437
467
|
e.label,
|
|
438
|
-
e.count != null && e.count > 0 && /* @__PURE__ */
|
|
468
|
+
e.count != null && e.count > 0 && /* @__PURE__ */ t(
|
|
439
469
|
"span",
|
|
440
470
|
{
|
|
441
|
-
className: `ml-1 rounded-full px-1 text-[9.5px] font-bold ${e.key === "attention" &&
|
|
471
|
+
className: `ml-1 rounded-full px-1 text-[9.5px] font-bold ${e.key === "attention" && R.critical > 0 ? "bg-red-500/15 text-red-600 dark:text-red-400" : "bg-slate-200 text-slate-600 dark:bg-slate-700 dark:text-slate-300"}`,
|
|
442
472
|
children: e.count
|
|
443
473
|
}
|
|
444
474
|
)
|
|
@@ -446,64 +476,67 @@ function mt({
|
|
|
446
476
|
},
|
|
447
477
|
e.key
|
|
448
478
|
)) }),
|
|
449
|
-
|
|
479
|
+
T > 0 && /* @__PURE__ */ r(
|
|
450
480
|
"button",
|
|
451
481
|
{
|
|
452
482
|
type: "button",
|
|
453
483
|
onClick: () => ge.mutate(),
|
|
454
484
|
className: "inline-flex items-center gap-1 text-[11px] font-medium text-slate-400 transition-colors hover:text-nvr-cyan",
|
|
455
485
|
children: [
|
|
456
|
-
/* @__PURE__ */
|
|
486
|
+
/* @__PURE__ */ t(Re, { className: "h-3.5 w-3.5", strokeWidth: 2 }),
|
|
457
487
|
"Mark all read"
|
|
458
488
|
]
|
|
459
489
|
}
|
|
460
490
|
)
|
|
461
491
|
] }),
|
|
462
|
-
/* @__PURE__ */
|
|
463
|
-
|
|
464
|
-
/* @__PURE__ */
|
|
465
|
-
|
|
492
|
+
/* @__PURE__ */ r("div", { className: "max-h-96 overflow-y-auto", children: [
|
|
493
|
+
O.length > 0 && /* @__PURE__ */ r("div", { "data-notification-pinned": !0, children: [
|
|
494
|
+
/* @__PURE__ */ t("div", { className: "bg-amber-50 px-3 py-1 text-[10px] font-semibold uppercase tracking-wide text-amber-700 dark:bg-amber-400/10 dark:text-amber-300", children: "Needs your acknowledgement" }),
|
|
495
|
+
O.map((e) => /* @__PURE__ */ t(se, { children: z(e, !!S(e, n)) }, e.id))
|
|
466
496
|
] }),
|
|
467
|
-
|
|
468
|
-
...
|
|
469
|
-
...
|
|
470
|
-
const
|
|
471
|
-
return /* @__PURE__ */
|
|
497
|
+
te.length === 0 && J.length === 0 && O.length === 0 ? /* @__PURE__ */ t("p", { className: "px-3 py-6 text-center text-[12px] text-slate-400", children: w === "attention" ? "Nothing needs you right now." : w === "fyi" ? "No FYI notifications." : "No notifications" }) : [
|
|
498
|
+
...J.map(ve),
|
|
499
|
+
...te.map((e) => {
|
|
500
|
+
const a = e.rows.filter((l) => !l.read).map((l) => l.id), o = S(e.rows[0], n), i = !!o, s = e.rows.find((l) => l.record_label) ?? e.rows[0], b = We(s);
|
|
501
|
+
return /* @__PURE__ */ r(
|
|
472
502
|
"div",
|
|
473
503
|
{
|
|
474
504
|
className: "border-b border-slate-50 last:border-b-0 dark:border-border/50",
|
|
475
505
|
children: [
|
|
476
|
-
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
|
|
506
|
+
i && b && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 px-3 pt-2", children: [
|
|
507
|
+
/* @__PURE__ */ r("span", { className: "truncate text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: [
|
|
508
|
+
b,
|
|
479
509
|
e.rows.length > 1 ? ` · ${e.rows.length}` : ""
|
|
480
510
|
] }),
|
|
481
|
-
/* @__PURE__ */
|
|
482
|
-
/* @__PURE__ */
|
|
511
|
+
/* @__PURE__ */ r("span", { className: "ml-auto flex items-center gap-0.5", children: [
|
|
512
|
+
/* @__PURE__ */ t(
|
|
483
513
|
"button",
|
|
484
514
|
{
|
|
485
515
|
type: "button",
|
|
486
|
-
|
|
516
|
+
"aria-label": "Open record",
|
|
517
|
+
"data-tip": "Open record",
|
|
518
|
+
"data-notification-open-record": !0,
|
|
487
519
|
onClick: () => {
|
|
488
|
-
|
|
520
|
+
a.length && j.mutate(a), m(!1), L(o, d);
|
|
489
521
|
},
|
|
490
522
|
className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
491
|
-
children: /* @__PURE__ */
|
|
523
|
+
children: /* @__PURE__ */ t(oe, { className: "h-3 w-3" })
|
|
492
524
|
}
|
|
493
525
|
),
|
|
494
|
-
|
|
526
|
+
a.length > 0 && /* @__PURE__ */ t(
|
|
495
527
|
"button",
|
|
496
528
|
{
|
|
497
529
|
type: "button",
|
|
498
|
-
|
|
499
|
-
|
|
530
|
+
"aria-label": "Mark read",
|
|
531
|
+
"data-tip": "Mark read",
|
|
532
|
+
onClick: () => j.mutate(a),
|
|
500
533
|
className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
501
|
-
children: /* @__PURE__ */
|
|
534
|
+
children: /* @__PURE__ */ t(A, { className: "h-3 w-3" })
|
|
502
535
|
}
|
|
503
536
|
)
|
|
504
537
|
] })
|
|
505
538
|
] }),
|
|
506
|
-
e.rows.map((
|
|
539
|
+
e.rows.map((l) => z(l, i))
|
|
507
540
|
]
|
|
508
541
|
},
|
|
509
542
|
e.key
|
|
@@ -511,12 +544,12 @@ function mt({
|
|
|
511
544
|
})
|
|
512
545
|
]
|
|
513
546
|
] }),
|
|
514
|
-
|
|
547
|
+
G && /* @__PURE__ */ t(
|
|
515
548
|
"button",
|
|
516
549
|
{
|
|
517
550
|
type: "button",
|
|
518
551
|
onClick: () => {
|
|
519
|
-
m(!1), d(
|
|
552
|
+
m(!1), d(G);
|
|
520
553
|
},
|
|
521
554
|
className: "block w-full border-t border-slate-100 px-3 py-1.5 text-center text-[11px] font-medium text-slate-500 hover:text-nvr-cyan dark:border-border/60",
|
|
522
555
|
children: "See all notifications"
|
|
@@ -527,19 +560,19 @@ function mt({
|
|
|
527
560
|
),
|
|
528
561
|
document.body
|
|
529
562
|
),
|
|
530
|
-
/* @__PURE__ */
|
|
531
|
-
|
|
563
|
+
/* @__PURE__ */ t(
|
|
564
|
+
je,
|
|
532
565
|
{
|
|
533
|
-
notificationId: (
|
|
534
|
-
title: (
|
|
535
|
-
onClose: () =>
|
|
566
|
+
notificationId: (C == null ? void 0 : C.id) ?? null,
|
|
567
|
+
title: (C == null ? void 0 : C.title) ?? null,
|
|
568
|
+
onClose: () => B(null)
|
|
536
569
|
}
|
|
537
570
|
)
|
|
538
571
|
] });
|
|
539
572
|
}
|
|
540
573
|
export {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
574
|
+
xt as NotificationBell,
|
|
575
|
+
We as bellGroupLabel,
|
|
576
|
+
ce as hasSnapshotView,
|
|
577
|
+
Je as offersChanges
|
|
545
578
|
};
|