@nivaro/react 0.3.98 → 0.3.100
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 +38 -13
- package/dist/index.js +182 -180
- package/dist/lib/commands.js +15 -11
- package/dist/shared/components/CollectionBrowserView.js +516 -503
- package/dist/shared/components/ItemEditForm.js +3021 -3019
- package/dist/shared/components/JobsTray.js +20 -16
- package/dist/shared/components/MyWorkView.js +133 -126
- package/dist/shared/components/NotificationBell.js +314 -288
- package/dist/shared/components/RecordCompare.js +38 -40
- package/dist/shared/components/RecordReadView.js +119 -119
- package/dist/shared/components/cbv/FoundElsewhere.js +61 -0
- 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/RelationCombobox.js +454 -378
- package/dist/shared/components/item-edit/SummaryPanel.js +56 -48
- package/dist/shared/components/item-edit/related-missing.js +75 -19
- 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 +175 -0
- package/dist/shared/components/panels/MoveAdvisory.js +204 -0
- package/dist/shared/components/panels/PipelinePanel.js +1450 -1219
- package/dist/shared/components/panels/RecordIntegrityBanner.js +113 -112
- 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/move-failure.js +9 -0
- package/dist/shared/lib/obligation-banner.js +15 -14
- package/dist/shared/lib/partner-failure.js +71 -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 Se } from "@nivaro/sdk";
|
|
3
|
+
import { useQueryClient as qe, useQuery as re, useMutation as F } from "@tanstack/react-query";
|
|
4
|
+
import { Bell as Me, 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 S, 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 q, runNotificationTarget as L } from "../lib/notification-target.js";
|
|
11
|
+
import { useTabAttention as Be } from "../lib/tab-attention.js";
|
|
12
|
+
import { formatRelative as de, cn as je } from "../lib/utils.js";
|
|
13
|
+
import { AsItWasSheet as ze } from "./notifications/AsItWasSheet.js";
|
|
14
|
+
import { bundleLocally as Oe, 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 m, g;
|
|
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 = ((m = n.record_collection_label) == null ? void 0 : m.trim()) || (() => {
|
|
25
|
+
const h = String(n.collection).replace(/_/g, " ").trim();
|
|
26
|
+
return h ? h.charAt(0).toUpperCase() + h.slice(1) : null;
|
|
27
|
+
})(), u = (g = n.record_label) == null ? void 0 : g.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 g, h, M;
|
|
36
|
+
if ((((g = n.target) == null ? void 0 : g.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, m = ((M = n.target) == null ? void 0 : M.id) ?? n.item;
|
|
38
|
+
return !!u && m != null && m !== "" && !/^(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:
|
|
53
|
-
rulesPath:
|
|
54
|
-
onActionError:
|
|
55
|
-
panelPlacement:
|
|
43
|
+
app: u,
|
|
44
|
+
subscribe: m,
|
|
45
|
+
buttonClassName: g,
|
|
46
|
+
panelClassName: h,
|
|
47
|
+
beforeList: M,
|
|
48
|
+
extraBadge: Q = 0,
|
|
49
|
+
mailLogUrl: ue,
|
|
50
|
+
renderTrigger: H,
|
|
51
|
+
allPath: G,
|
|
52
|
+
subscriptionsPath: me,
|
|
53
|
+
rulesPath: pe,
|
|
54
|
+
onActionError: fe,
|
|
55
|
+
panelPlacement: $ = "below",
|
|
56
56
|
tabBadge: xe = !0
|
|
57
57
|
}) {
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
},
|
|
58
|
+
const y = Ie(), [k, p] = S(!1), [w, U] = S("attention"), I = le(null), Y = le(null), [D, he] = S(null), V = qe(), _ = () => {
|
|
59
|
+
V.invalidateQueries({ queryKey: ["notification-count"] }), V.invalidateQueries({ queryKey: ["notifications"] });
|
|
60
|
+
}, be = Ke(6e4, { enabled: !!m, 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
|
+
Be(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 } : { ...Oe(i), pinned: a };
|
|
79
79
|
}),
|
|
80
|
-
enabled:
|
|
81
|
-
}),
|
|
82
|
-
|
|
83
|
-
if (!
|
|
84
|
-
const e = (
|
|
85
|
-
var
|
|
86
|
-
const
|
|
87
|
-
(
|
|
80
|
+
enabled: k
|
|
81
|
+
}), W = (x == null ? void 0 : x.rows) ?? [], B = (x == null ? void 0 : x.pinned) ?? [], J = (x == null ? void 0 : x.bundles) ?? [], [ge, X] = S(() => /* @__PURE__ */ new Set()), [C, j] = S(null);
|
|
82
|
+
P(() => m == null ? void 0 : m(_), [m]), P(() => {
|
|
83
|
+
if (!k) 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) || p(!1);
|
|
88
88
|
};
|
|
89
89
|
return window.addEventListener("mousedown", e), () => window.removeEventListener("mousedown", e);
|
|
90
|
-
}, [
|
|
91
|
-
if (!
|
|
90
|
+
}, [k]), P(() => {
|
|
91
|
+
if (!k || $ !== "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
|
-
}),
|
|
114
|
-
mutationFn: () =>
|
|
115
|
-
onSuccess:
|
|
116
|
-
}),
|
|
103
|
+
}, [k, $]);
|
|
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
|
+
}), z = F({
|
|
111
|
+
mutationFn: (e) => y.request(_e(e)),
|
|
112
|
+
onSuccess: _
|
|
113
|
+
}), ke = F({
|
|
114
|
+
mutationFn: () => y.request(Se()),
|
|
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
|
-
},
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
var
|
|
135
|
-
|
|
136
|
-
/* @__PURE__ */
|
|
128
|
+
}, [ee]), we = (e) => {
|
|
129
|
+
const a = q(e, n);
|
|
130
|
+
a && (p(!1), L(a, d));
|
|
131
|
+
}, ae = (e) => {
|
|
132
|
+
p(!1), d(e);
|
|
133
|
+
}, O = (e, a, o = !1) => {
|
|
134
|
+
var v;
|
|
135
|
+
const i = q(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(), p(!1), j(e);
|
|
174
|
+
},
|
|
175
|
+
onKeyDown: (c) => {
|
|
176
|
+
(c.key === "Enter" || c.key === " ") && (c.preventDefault(), c.stopPropagation(), p(!1), j(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: je(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:
|
|
249
|
-
rulesPath:
|
|
250
|
-
onNavigate:
|
|
251
|
-
className: `pb-3 pr-3 ${
|
|
273
|
+
recordChanges: Je(e),
|
|
274
|
+
subscriptionsPath: me,
|
|
275
|
+
rulesPath: pe,
|
|
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 = ge.has(a), i = Pe(e.lane), s = e.deleted ? null : q(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 ? (p(!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,7 +350,7 @@ 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",
|
|
@@ -332,17 +358,17 @@ function mt({
|
|
|
332
358
|
children: "deleted"
|
|
333
359
|
}
|
|
334
360
|
),
|
|
335
|
-
e.categories.map((
|
|
361
|
+
e.categories.map((l) => /* @__PURE__ */ t(
|
|
336
362
|
"span",
|
|
337
363
|
{
|
|
338
364
|
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:
|
|
365
|
+
"data-notification-bundle-category": l,
|
|
366
|
+
children: Ge(l)
|
|
341
367
|
},
|
|
342
|
-
|
|
368
|
+
l
|
|
343
369
|
)),
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
-
e.unread > 0 && e.unread < e.count && /* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ t("span", { children: e.newest ? de(e.newest) : "" }),
|
|
371
|
+
e.unread > 0 && e.unread < e.count && /* @__PURE__ */ r("span", { children: [
|
|
346
372
|
"· ",
|
|
347
373
|
e.unread,
|
|
348
374
|
" unread"
|
|
@@ -351,94 +377,94 @@ function mt({
|
|
|
351
377
|
]
|
|
352
378
|
}
|
|
353
379
|
),
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
-
|
|
380
|
+
/* @__PURE__ */ r("span", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
381
|
+
s && /* @__PURE__ */ t(
|
|
356
382
|
"button",
|
|
357
383
|
{
|
|
358
384
|
type: "button",
|
|
359
385
|
title: "Open record",
|
|
360
386
|
onClick: () => {
|
|
361
|
-
|
|
387
|
+
p(!1), L(s, d);
|
|
362
388
|
},
|
|
363
389
|
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__ */
|
|
390
|
+
children: /* @__PURE__ */ t(oe, { className: "h-3 w-3" })
|
|
365
391
|
}
|
|
366
392
|
),
|
|
367
|
-
|
|
393
|
+
b.length > 0 && /* @__PURE__ */ t(
|
|
368
394
|
"button",
|
|
369
395
|
{
|
|
370
396
|
type: "button",
|
|
371
397
|
title: "Mark all read",
|
|
372
|
-
"data-notification-bundle-read":
|
|
373
|
-
onClick: () =>
|
|
398
|
+
"data-notification-bundle-read": a,
|
|
399
|
+
onClick: () => z.mutate(b),
|
|
374
400
|
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__ */
|
|
401
|
+
children: /* @__PURE__ */ t(A, { className: "h-3 w-3" })
|
|
376
402
|
}
|
|
377
403
|
)
|
|
378
404
|
] })
|
|
379
405
|
] }),
|
|
380
|
-
|
|
406
|
+
o && /* @__PURE__ */ t(
|
|
381
407
|
"div",
|
|
382
408
|
{
|
|
383
409
|
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((
|
|
410
|
+
"data-notification-bundle-rows": a,
|
|
411
|
+
children: e.rows.map((l) => O(l, !0, !0))
|
|
386
412
|
}
|
|
387
413
|
)
|
|
388
414
|
]
|
|
389
415
|
},
|
|
390
|
-
`bundle:${
|
|
416
|
+
`bundle:${a}`
|
|
391
417
|
);
|
|
392
|
-
},
|
|
393
|
-
{ key: "attention", label: "Needs you", count:
|
|
394
|
-
{ key: "fyi", label: "FYI", count:
|
|
418
|
+
}, ye = [
|
|
419
|
+
{ key: "attention", label: "Needs you", count: K },
|
|
420
|
+
{ key: "fyi", label: "FYI", count: R.fyi },
|
|
395
421
|
{ key: "all", label: "All", count: null }
|
|
396
|
-
],
|
|
397
|
-
return /* @__PURE__ */
|
|
398
|
-
|
|
422
|
+
], ne = () => p((e) => (!e && w === "attention" && K === 0 && R.fyi > 0 && U("fyi"), !e));
|
|
423
|
+
return /* @__PURE__ */ r("div", { ref: I, className: "relative", "data-nvr-notification-bell": !0, children: [
|
|
424
|
+
H ? H({ open: k, badge: N, toggle: ne }) : /* @__PURE__ */ r(
|
|
399
425
|
"button",
|
|
400
426
|
{
|
|
401
427
|
type: "button",
|
|
402
|
-
onClick:
|
|
403
|
-
className:
|
|
404
|
-
"aria-label":
|
|
428
|
+
onClick: ne,
|
|
429
|
+
className: g ?? "relative rounded-md p-1.5 text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-muted",
|
|
430
|
+
"aria-label": N ? `Notifications (${N} unread)` : "Notifications",
|
|
405
431
|
children: [
|
|
406
|
-
/* @__PURE__ */
|
|
407
|
-
|
|
432
|
+
/* @__PURE__ */ t(Me, { className: "h-4 w-4", strokeWidth: 1.8 }),
|
|
433
|
+
N > 0 && /* @__PURE__ */ t(
|
|
408
434
|
"span",
|
|
409
435
|
{
|
|
410
436
|
"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:
|
|
437
|
+
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"}`,
|
|
438
|
+
children: N > 99 ? "99+" : N
|
|
413
439
|
}
|
|
414
440
|
)
|
|
415
441
|
]
|
|
416
442
|
}
|
|
417
443
|
),
|
|
418
|
-
|
|
419
|
-
/* @__PURE__ */
|
|
444
|
+
k && ($ === "right" ? Le : (e) => e)(
|
|
445
|
+
/* @__PURE__ */ r(
|
|
420
446
|
"div",
|
|
421
447
|
{
|
|
422
|
-
ref:
|
|
423
|
-
className: `${
|
|
424
|
-
style:
|
|
448
|
+
ref: Y,
|
|
449
|
+
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 ?? ""}`,
|
|
450
|
+
style: $ === "right" && D ? { left: D.left, bottom: D.bottom } : void 0,
|
|
425
451
|
"data-nvr-notification-panel": !0,
|
|
426
452
|
children: [
|
|
427
|
-
|
|
428
|
-
/* @__PURE__ */
|
|
429
|
-
/* @__PURE__ */
|
|
453
|
+
M,
|
|
454
|
+
/* @__PURE__ */ r("div", { className: "flex items-center justify-between border-b border-slate-100 px-3 py-2 dark:border-border/60", children: [
|
|
455
|
+
/* @__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
456
|
"button",
|
|
431
457
|
{
|
|
432
458
|
type: "button",
|
|
433
|
-
onClick: () =>
|
|
459
|
+
onClick: () => U(e.key),
|
|
434
460
|
"data-nvr-lane-tab": e.key,
|
|
435
|
-
className:
|
|
461
|
+
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
462
|
children: [
|
|
437
463
|
e.label,
|
|
438
|
-
e.count != null && e.count > 0 && /* @__PURE__ */
|
|
464
|
+
e.count != null && e.count > 0 && /* @__PURE__ */ t(
|
|
439
465
|
"span",
|
|
440
466
|
{
|
|
441
|
-
className: `ml-1 rounded-full px-1 text-[9.5px] font-bold ${e.key === "attention" &&
|
|
467
|
+
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
468
|
children: e.count
|
|
443
469
|
}
|
|
444
470
|
)
|
|
@@ -446,64 +472,64 @@ function mt({
|
|
|
446
472
|
},
|
|
447
473
|
e.key
|
|
448
474
|
)) }),
|
|
449
|
-
|
|
475
|
+
T > 0 && /* @__PURE__ */ r(
|
|
450
476
|
"button",
|
|
451
477
|
{
|
|
452
478
|
type: "button",
|
|
453
|
-
onClick: () =>
|
|
479
|
+
onClick: () => ke.mutate(),
|
|
454
480
|
className: "inline-flex items-center gap-1 text-[11px] font-medium text-slate-400 transition-colors hover:text-nvr-cyan",
|
|
455
481
|
children: [
|
|
456
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ t(Re, { className: "h-3.5 w-3.5", strokeWidth: 2 }),
|
|
457
483
|
"Mark all read"
|
|
458
484
|
]
|
|
459
485
|
}
|
|
460
486
|
)
|
|
461
487
|
] }),
|
|
462
|
-
/* @__PURE__ */
|
|
463
|
-
|
|
464
|
-
/* @__PURE__ */
|
|
465
|
-
|
|
488
|
+
/* @__PURE__ */ r("div", { className: "max-h-96 overflow-y-auto", children: [
|
|
489
|
+
B.length > 0 && /* @__PURE__ */ r("div", { "data-notification-pinned": !0, children: [
|
|
490
|
+
/* @__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" }),
|
|
491
|
+
B.map((e) => /* @__PURE__ */ t(se, { children: O(e, !!q(e, n)) }, e.id))
|
|
466
492
|
] }),
|
|
467
|
-
|
|
468
|
-
...
|
|
469
|
-
...
|
|
470
|
-
const
|
|
471
|
-
return /* @__PURE__ */
|
|
493
|
+
te.length === 0 && J.length === 0 && B.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" }) : [
|
|
494
|
+
...J.map(ve),
|
|
495
|
+
...te.map((e) => {
|
|
496
|
+
const a = e.rows.filter((l) => !l.read).map((l) => l.id), o = q(e.rows[0], n), i = !!o, s = e.rows.find((l) => l.record_label) ?? e.rows[0], b = We(s);
|
|
497
|
+
return /* @__PURE__ */ r(
|
|
472
498
|
"div",
|
|
473
499
|
{
|
|
474
500
|
className: "border-b border-slate-50 last:border-b-0 dark:border-border/50",
|
|
475
501
|
children: [
|
|
476
|
-
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
|
|
502
|
+
i && b && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 px-3 pt-2", children: [
|
|
503
|
+
/* @__PURE__ */ r("span", { className: "truncate text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: [
|
|
504
|
+
b,
|
|
479
505
|
e.rows.length > 1 ? ` · ${e.rows.length}` : ""
|
|
480
506
|
] }),
|
|
481
|
-
/* @__PURE__ */
|
|
482
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ r("span", { className: "ml-auto flex items-center gap-0.5", children: [
|
|
508
|
+
/* @__PURE__ */ t(
|
|
483
509
|
"button",
|
|
484
510
|
{
|
|
485
511
|
type: "button",
|
|
486
512
|
title: "Open record",
|
|
487
513
|
onClick: () => {
|
|
488
|
-
|
|
514
|
+
a.length && z.mutate(a), p(!1), L(o, d);
|
|
489
515
|
},
|
|
490
516
|
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__ */
|
|
517
|
+
children: /* @__PURE__ */ t(oe, { className: "h-3 w-3" })
|
|
492
518
|
}
|
|
493
519
|
),
|
|
494
|
-
|
|
520
|
+
a.length > 0 && /* @__PURE__ */ t(
|
|
495
521
|
"button",
|
|
496
522
|
{
|
|
497
523
|
type: "button",
|
|
498
524
|
title: "Mark read",
|
|
499
|
-
onClick: () =>
|
|
525
|
+
onClick: () => z.mutate(a),
|
|
500
526
|
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__ */
|
|
527
|
+
children: /* @__PURE__ */ t(A, { className: "h-3 w-3" })
|
|
502
528
|
}
|
|
503
529
|
)
|
|
504
530
|
] })
|
|
505
531
|
] }),
|
|
506
|
-
e.rows.map((
|
|
532
|
+
e.rows.map((l) => O(l, i))
|
|
507
533
|
]
|
|
508
534
|
},
|
|
509
535
|
e.key
|
|
@@ -511,12 +537,12 @@ function mt({
|
|
|
511
537
|
})
|
|
512
538
|
]
|
|
513
539
|
] }),
|
|
514
|
-
|
|
540
|
+
G && /* @__PURE__ */ t(
|
|
515
541
|
"button",
|
|
516
542
|
{
|
|
517
543
|
type: "button",
|
|
518
544
|
onClick: () => {
|
|
519
|
-
|
|
545
|
+
p(!1), d(G);
|
|
520
546
|
},
|
|
521
547
|
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
548
|
children: "See all notifications"
|
|
@@ -527,19 +553,19 @@ function mt({
|
|
|
527
553
|
),
|
|
528
554
|
document.body
|
|
529
555
|
),
|
|
530
|
-
/* @__PURE__ */
|
|
531
|
-
|
|
556
|
+
/* @__PURE__ */ t(
|
|
557
|
+
ze,
|
|
532
558
|
{
|
|
533
|
-
notificationId: (
|
|
534
|
-
title: (
|
|
535
|
-
onClose: () =>
|
|
559
|
+
notificationId: (C == null ? void 0 : C.id) ?? null,
|
|
560
|
+
title: (C == null ? void 0 : C.title) ?? null,
|
|
561
|
+
onClose: () => j(null)
|
|
536
562
|
}
|
|
537
563
|
)
|
|
538
564
|
] });
|
|
539
565
|
}
|
|
540
566
|
export {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
567
|
+
xt as NotificationBell,
|
|
568
|
+
We as bellGroupLabel,
|
|
569
|
+
ce as hasSnapshotView,
|
|
570
|
+
Je as offersChanges
|
|
545
571
|
};
|