@nivaro/react 0.3.116 → 0.3.118

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +140 -14
  4. package/dist/index.js +488 -485
  5. package/dist/shared/components/ActivityEntry.js +130 -125
  6. package/dist/shared/components/AgentPresenceChip.js +36 -26
  7. package/dist/shared/components/CellCopyLayer.js +50 -45
  8. package/dist/shared/components/CollectionBrowserView.js +3855 -3785
  9. package/dist/shared/components/FilePreviewLightbox.js +96 -58
  10. package/dist/shared/components/InStep.js +18 -17
  11. package/dist/shared/components/ItemEditForm.js +4220 -4175
  12. package/dist/shared/components/JobsTray.js +8 -8
  13. package/dist/shared/components/LiveNewMatchesPill.js +21 -14
  14. package/dist/shared/components/LiveOffNote.js +3 -2
  15. package/dist/shared/components/LiveRowMark.js +53 -23
  16. package/dist/shared/components/LiveTraceView.js +162 -123
  17. package/dist/shared/components/MyWorkView.js +320 -299
  18. package/dist/shared/components/NotificationBell.js +14 -14
  19. package/dist/shared/components/OverflowRail.js +1 -1
  20. package/dist/shared/components/PageRenderer.js +120 -116
  21. package/dist/shared/components/ProfileView.js +203 -202
  22. package/dist/shared/components/RealtimeStatusBanner.js +31 -29
  23. package/dist/shared/components/RecordDrilldownSheet.js +7 -7
  24. package/dist/shared/components/RecordHoverCard.js +102 -84
  25. package/dist/shared/components/RecordReadView.js +146 -146
  26. package/dist/shared/components/ReportView.js +1086 -1091
  27. package/dist/shared/components/ScreenRefreshButton.js +34 -32
  28. package/dist/shared/components/TipLayer.js +65 -58
  29. package/dist/shared/components/WidgetImageMenu.js +83 -43
  30. package/dist/shared/components/activity/RecordActivityStream.js +175 -173
  31. package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
  32. package/dist/shared/components/cbv/column-totals.js +62 -57
  33. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
  34. package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
  35. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
  36. package/dist/shared/components/charts/category-axis.js +93 -0
  37. package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
  38. package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
  39. package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
  40. package/dist/shared/components/collections-directory/page-model.js +72 -67
  41. package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
  42. package/dist/shared/components/integrations/SendStatus.js +65 -59
  43. package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
  44. package/dist/shared/components/integrations/console/SignalCard.js +237 -230
  45. package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
  46. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
  47. package/dist/shared/components/item-edit/CloneDialog.js +191 -161
  48. package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
  49. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
  50. package/dist/shared/components/item-edit/FieldComments.js +54 -53
  51. package/dist/shared/components/item-edit/FieldPointer.js +82 -67
  52. package/dist/shared/components/item-edit/FieldRow.js +106 -100
  53. package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
  54. package/dist/shared/components/item-edit/FilePickerField.js +452 -387
  55. package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
  56. package/dist/shared/components/item-edit/HeaderTools.js +94 -85
  57. package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
  58. package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
  59. package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
  60. package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
  61. package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
  62. package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
  63. package/dist/shared/components/item-edit/RecalcValue.js +57 -32
  64. package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
  65. package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
  66. package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
  67. package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
  68. package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
  69. package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
  70. package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
  71. package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
  72. package/dist/shared/components/item-edit/SectionPresence.js +18 -10
  73. package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
  74. package/dist/shared/components/item-edit/UserChip.js +1 -1
  75. package/dist/shared/components/item-edit/file-live.js +69 -54
  76. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  77. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  78. package/dist/shared/components/item-edit/removed-line.js +31 -25
  79. package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
  80. package/dist/shared/components/list/ListViewers.js +46 -35
  81. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  82. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  83. package/dist/shared/components/panels/AlertBanners.js +82 -72
  84. package/dist/shared/components/panels/BranchLanes.js +22 -22
  85. package/dist/shared/components/panels/CommentImages.js +123 -102
  86. package/dist/shared/components/panels/CommentPanel.js +186 -185
  87. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  88. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  89. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  90. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  91. package/dist/shared/components/pipeline/BindingStartStateSettings.js +163 -0
  92. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  93. package/dist/shared/components/pipeline/PipelineEditorView.js +320 -299
  94. package/dist/shared/components/profile/AgentNameField.js +107 -81
  95. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  96. package/dist/shared/components/profile/PersonAccess.js +599 -495
  97. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  98. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  99. package/dist/shared/components/profile/primitives.js +1 -1
  100. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  101. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  102. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  103. package/dist/shared/components/support/AssignRules.js +1733 -0
  104. package/dist/shared/components/support/PersonPick.js +88 -0
  105. package/dist/shared/components/support/RequestList.js +790 -0
  106. package/dist/shared/components/support/ScreenShare.js +158 -152
  107. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  108. package/dist/shared/components/support/SupportView.js +140 -246
  109. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  110. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  111. package/dist/shared/components/support/assign-rules-text.js +171 -0
  112. package/dist/shared/components/support/support-list.js +125 -0
  113. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  114. package/dist/shared/components/ui/checkbox.js +6 -6
  115. package/dist/shared/components/ui/select.js +43 -39
  116. package/dist/shared/components/ui/sheet.js +9 -9
  117. package/dist/shared/components/ui/switch.js +12 -11
  118. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  119. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  120. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  121. package/dist/shared/lib/activity-sentence.js +103 -91
  122. package/dist/shared/lib/agent-presence.js +27 -21
  123. package/dist/shared/lib/approval-progress.js +2 -2
  124. package/dist/shared/lib/copy-rules.js +31 -24
  125. package/dist/shared/lib/derived-causes.js +113 -78
  126. package/dist/shared/lib/grid-cursors.js +26 -26
  127. package/dist/shared/lib/label-flash.js +27 -0
  128. package/dist/shared/lib/list-return.js +137 -125
  129. package/dist/shared/lib/live-deltas.js +40 -34
  130. package/dist/shared/lib/live-groups.js +56 -52
  131. package/dist/shared/lib/live-preference.js +64 -59
  132. package/dist/shared/lib/live-screen.js +223 -192
  133. package/dist/shared/lib/partner-failure.js +11 -11
  134. package/dist/shared/lib/rollup-recalc.js +68 -64
  135. package/dist/shared/lib/screen-refresh.js +74 -68
  136. package/dist/shared/lib/screen-share.js +108 -104
  137. package/dist/shared/lib/send-status.js +77 -61
  138. package/dist/shared/lib/text-diff-window.js +29 -0
  139. package/dist/shared/lib/use-query-entry.js +17 -0
  140. package/dist/shared/lib/watch-list.js +210 -209
  141. package/dist/shared/lib/widget-image-render.js +72 -49
  142. package/package.json +1 -1
@@ -1,249 +1,257 @@
1
- import { jsx as e, jsxs as u, Fragment as P } from "react/jsx-runtime";
2
- import { useQueryClient as fe, useQuery as O } from "@tanstack/react-query";
3
- import { CheckCheck as ne, Minus as Ne, X as Se, Users as ee, Binoculars as Ce, AtSign as ge, ArrowDownUp as $e, Check as De, Pin as Te, Hourglass as _e, ChevronRight as Re, CircleCheck as Le, Undo2 as Me, MoreHorizontal as We, UserCheck as qe, Pencil as Ke, LogOut as Ee, Trash2 as Ae } from "lucide-react";
4
- import { useEffect as N, useMemo as D, useRef as y, useState as q } from "react";
1
+ import { jsx as e, jsxs as u, Fragment as U } from "react/jsx-runtime";
2
+ import { useQueryClient as fe, useQuery as I } from "@tanstack/react-query";
3
+ import { CheckCheck as ae, Minus as Se, X as Ce, Users as te, Plus as $e, ChevronLeft as De, ChevronRight as be, Binoculars as Te, AtSign as ge, ArrowDownUp as Le, Check as Me, Pin as Re, Hourglass as _e, CircleCheck as We, Undo2 as qe, MoreHorizontal as Ke, UserCheck as Ae, Pencil as Ee, LogOut as Oe, Trash2 as Pe } from "lucide-react";
4
+ import { useEffect as S, useMemo as T, useRef as y, useState as R } from "react";
5
5
  import { useOptionalNivaroClient as V } from "../../context.js";
6
- import { get as W, post as oe } from "../../lib/commands.js";
7
- import { describeError as Oe } from "../../lib/error-message.js";
8
- import { useLiveCollection as Z, useLiveEvent as le } from "../../lib/live.js";
9
- import { usePeekOrOpen as be } from "../../lib/record-peek.js";
10
- import { desktopPermission as Pe, pageOutOfSight as Ue, keysToNotify as Ie, claimBurst as ze, showDesktop as je, desktopText as Fe } from "../../lib/watch-desktop.js";
11
- import { useWatchUi as xe, useWatchActions as Qe, useWatchPrefs as He, watchUi as $, withLocalSeen as we, changedKeys as Be, pinsSignature as ce, watchKeys as C, typingTarget as Ye, WATCH_WIDTH_MAX as de, WATCH_WIDTH_MIN as he, sortWatchRows as Ve, withCompleted as ke } from "../../lib/watch-list.js";
12
- import { ConfirmButton as ue } from "../profile/primitives.js";
13
- import { Popover as Xe, PopoverTrigger as Ge, PopoverContent as Je } from "../ui/popover.js";
14
- import { Sheet as Ze, SheetContent as et, SheetTitle as tt, SheetDescription as nt } from "../ui/sheet.js";
6
+ import { get as K, post as oe } from "../../lib/commands.js";
7
+ import { describeError as Ie } from "../../lib/error-message.js";
8
+ import { useLiveCollection as ee, useLiveEvent as le } from "../../lib/live.js";
9
+ import { usePeekOrOpen as xe } from "../../lib/record-peek.js";
10
+ import { desktopPermission as Ue, pageOutOfSight as je, keysToNotify as ze, claimBurst as Fe, showDesktop as Qe, desktopText as Be } from "../../lib/watch-desktop.js";
11
+ import { useWatchUi as we, useWatchActions as He, useWatchPrefs as Ye, watchUi as D, withLocalSeen as ke, changedKeys as Ve, pinsSignature as ce, watchKeys as $, typingTarget as Xe, WATCH_WIDTH_MAX as de, WATCH_WIDTH_MIN as ue, sortWatchRows as Ge, withCompleted as ye } from "../../lib/watch-list.js";
12
+ import { ConfirmButton as he } from "../profile/primitives.js";
13
+ import { Popover as Je, PopoverTrigger as Ze, PopoverContent as et } from "../ui/popover.js";
14
+ import { Sheet as tt, SheetContent as nt, SheetTitle as at, SheetDescription as rt } from "../ui/sheet.js";
15
15
  import { Skeleton as me } from "../ui/skeleton.js";
16
- import { WatchSettingsMenu as at, TeamEditor as rt, AlertButton as st } from "./WatchExtras.js";
17
- import { WatchRowList as ye, StepChip as it, agoText as ae } from "./WatchRows.js";
18
- const A = {
16
+ import { WatchSettingsMenu as st, TeamEditor as it, AutoPinMark as ot, AlertMark as lt, AlertButton as ct } from "./WatchExtras.js";
17
+ import { WatchRowList as ve, StepChip as dt, agoText as re } from "./WatchRows.js";
18
+ const P = {
19
19
  mine: "My order",
20
20
  changed: "Last change",
21
21
  due: "Due soonest"
22
- }, ot = /* @__PURE__ */ new Set(["$lock", "$sla"]);
23
- function lt(t, n, o) {
22
+ }, ut = /* @__PURE__ */ new Set(["$lock", "$sla"]);
23
+ function ht(t, n, i) {
24
24
  var g;
25
- const i = V(), a = ce(t.pins), r = t.pins.length > 0, l = O({
26
- queryKey: C.rows(a),
27
- queryFn: () => i.request(W("/watch-list")).then((f) => f.data),
28
- enabled: !!i && r && n,
25
+ const o = V(), a = ce(t.pins), s = t.pins.length > 0, c = I({
26
+ queryKey: $.rows(a),
27
+ queryFn: () => o.request(K("/watch-list")).then((b) => b.data),
28
+ enabled: !!o && s && n,
29
29
  staleTime: 6e4,
30
- placeholderData: (f) => f
31
- }), s = (g = l.data) != null && g.pins ? ce(l.data.pins) : null, p = y("");
32
- N(() => {
33
- if (!s || s === a || l.isFetching || l.isPlaceholderData) return;
34
- const f = `${a}#${l.dataUpdatedAt}`;
35
- p.current !== f && (p.current = f, l.refetch());
36
- }, [s, a, l.isFetching, l.isPlaceholderData, l.dataUpdatedAt, l.refetch]);
37
- const m = O({
38
- queryKey: C.summary(a),
39
- queryFn: () => i.request(W("/watch-list", { summary: "1" })).then((f) => f.data),
40
- enabled: !!i && r && !n,
30
+ placeholderData: (b) => b
31
+ }), r = (g = c.data) != null && g.pins ? ce(c.data.pins) : null, m = y("");
32
+ S(() => {
33
+ if (!r || r === a || c.isFetching || c.isPlaceholderData) return;
34
+ const b = `${a}#${c.dataUpdatedAt}`;
35
+ m.current !== b && (m.current = b, c.refetch());
36
+ }, [r, a, c.isFetching, c.isPlaceholderData, c.dataUpdatedAt, c.refetch]);
37
+ const p = I({
38
+ queryKey: $.summary(a),
39
+ queryFn: () => o.request(K("/watch-list", { summary: "1" })).then((b) => b.data),
40
+ enabled: !!o && s && !n,
41
41
  staleTime: Number.POSITIVE_INFINITY
42
- }), b = O({
43
- queryKey: C.waiting,
44
- queryFn: () => i.request(W("/watch-list/waiting")).then((f) => f.data.rows),
45
- enabled: !!i && n,
42
+ }), f = I({
43
+ queryKey: $.waiting,
44
+ queryFn: () => o.request(K("/watch-list/waiting")).then((b) => b.data.rows),
45
+ enabled: !!o && n,
46
46
  staleTime: 3e4
47
- }), h = O({
48
- queryKey: C.mentions,
49
- queryFn: () => i.request(
50
- W("/watch-list/mentions")
51
- ).then((f) => f.data),
52
- enabled: !!i,
47
+ }), h = I({
48
+ queryKey: $.mentions,
49
+ queryFn: () => o.request(
50
+ K("/watch-list/mentions")
51
+ ).then((b) => b.data),
52
+ enabled: !!o,
53
53
  staleTime: 6e4
54
54
  });
55
- return { rows: l, summary: m, waiting: b, mentions: h, tab: o };
55
+ return { rows: c, summary: p, waiting: f, mentions: h, tab: i };
56
56
  }
57
- const ve = "nvr-watch-dock-state";
58
- function ct() {
57
+ const Ne = "nvr-watch-dock-state";
58
+ function mt() {
59
59
  try {
60
- const t = localStorage.getItem(ve);
60
+ const t = localStorage.getItem(Ne);
61
61
  return t === "open" || t === "minimized" ? t : "closed";
62
62
  } catch {
63
63
  return "closed";
64
64
  }
65
65
  }
66
- function dt(t) {
66
+ function pt(t) {
67
67
  try {
68
- localStorage.setItem(ve, t);
68
+ localStorage.setItem(Ne, t);
69
69
  } catch {
70
70
  }
71
71
  }
72
- function Ot() {
72
+ function jt() {
73
73
  var se, ie;
74
- const t = xe(), n = fe(), o = V(), i = Qe(), { prefs: a } = i, { ready: r } = He(), l = a.dock;
75
- N(() => {
76
- r && dt(l.state);
77
- }, [r, l.state]);
78
- const s = r ? l.state : ct(), p = t.wide ? s : t.sheet ? "sheet" : "hidden", m = p === "open" || p === "sheet", b = lt(a, m, l.tab);
79
- N(() => ($.setMounted(!0), () => $.setMounted(!1)), []);
80
- const h = D(() => new Set(a.pins.map((c) => c.key)), [a.pins]), g = D(() => [...new Set(a.pins.map((c) => c.collection))], [a.pins]), f = y(m);
81
- f.current = m;
74
+ const t = we(), n = fe(), i = V(), o = He(), { prefs: a } = o, { ready: s } = Ye(), c = a.dock;
75
+ S(() => {
76
+ s && pt(c.state);
77
+ }, [s, c.state]);
78
+ const r = s ? c.state : mt(), m = t.wide ? r : t.sheet ? "sheet" : "hidden", p = m === "open" || m === "sheet", f = ht(a, p, c.tab);
79
+ S(() => (D.setMounted(!0), () => D.setMounted(!1)), []);
80
+ const h = T(() => new Set(a.pins.map((l) => l.key)), [a.pins]), g = T(() => [...new Set(a.pins.map((l) => l.collection))], [a.pins]), b = y(p);
81
+ b.current = p;
82
82
  const _ = y(/* @__PURE__ */ new Map()), z = y(a.settings.desktop);
83
83
  z.current = a.settings.desktop;
84
- const R = (c) => {
85
- !o || !z.current || c.length === 0 || Pe() !== "granted" || !Ue() || o.request(W("/watch-list", { summary: "1" })).then((x) => {
86
- var T;
87
- const w = Ie(c, x.data.others ?? {}, _.current, Date.now());
88
- if (w.length === 0 || !ze(w)) return;
89
- for (const v of w) _.current.set(v, ((T = x.data.others) == null ? void 0 : T[v]) ?? "");
90
- const S = {};
91
- for (const [, v] of n.getQueriesData({ queryKey: ["watch-list", "rows"] }))
92
- for (const J of (v == null ? void 0 : v.rows) ?? []) J.title && (S[J.key] = J.title);
93
- je(Fe(w, S), () => {
94
- $.openSheet(), i.setDock({ state: "open", tab: "watching" });
84
+ const F = (l) => {
85
+ !i || !z.current || l.length === 0 || Ue() !== "granted" || !je() || i.request(K("/watch-list", { summary: "1" })).then((x) => {
86
+ var L;
87
+ const w = ze(l, x.data.others ?? {}, _.current, Date.now());
88
+ if (w.length === 0 || !Fe(w)) return;
89
+ for (const N of w) _.current.set(N, ((L = x.data.others) == null ? void 0 : L[N]) ?? "");
90
+ const C = {};
91
+ for (const [, N] of n.getQueriesData({ queryKey: ["watch-list", "rows"] }))
92
+ for (const Z of (N == null ? void 0 : N.rows) ?? []) Z.title && (C[Z.key] = Z.title);
93
+ Qe(Be(w, C), () => {
94
+ D.openSheet(), o.setDock({ state: "open", tab: "watching" });
95
95
  });
96
96
  }).catch(() => {
97
97
  });
98
- }, j = y(R);
99
- j.current = R, Z(
98
+ }, Q = y(F);
99
+ Q.current = F, ee(
100
100
  g,
101
- (c) => {
101
+ (l) => {
102
102
  const x = /* @__PURE__ */ new Set();
103
- for (const w of c.events) {
103
+ for (const w of l.events) {
104
104
  if (w.item === "*") {
105
- for (const v of a.pins) v.collection === w.collection && x.add(v.key);
105
+ for (const N of a.pins) N.collection === w.collection && x.add(N.key);
106
106
  continue;
107
107
  }
108
- const S = `${w.collection}:${w.item}`;
109
- if (!h.has(S)) continue;
110
- const T = w.changed_fields;
111
- if (T && T.length > 0 && T.every((v) => ot.has(v))) {
112
- f.current && x.add(`~${S}`);
108
+ const C = `${w.collection}:${w.item}`;
109
+ if (!h.has(C)) continue;
110
+ const L = w.changed_fields;
111
+ if (L && L.length > 0 && L.every((N) => ut.has(N))) {
112
+ b.current && x.add(`~${C}`);
113
113
  continue;
114
114
  }
115
- x.add(S);
115
+ x.add(C);
116
116
  }
117
- x.size !== 0 && (j.current([...x].filter((w) => !w.startsWith("~"))), f.current ? (n.invalidateQueries({ queryKey: ["watch-list", "rows"] }), n.invalidateQueries({ queryKey: C.waiting })) : $.markLocal([...x].filter((w) => !w.startsWith("~"))));
117
+ x.size !== 0 && (Q.current([...x].filter((w) => !w.startsWith("~"))), b.current ? (n.invalidateQueries({ queryKey: ["watch-list", "rows"] }), n.invalidateQueries({ queryKey: $.waiting })) : D.markLocal([...x].filter((w) => !w.startsWith("~"))));
118
118
  },
119
119
  {
120
120
  debounceMs: 1e3,
121
- match: (c) => c.item === "*" || h.has(`${c.collection}:${c.item}`)
121
+ match: (l) => l.item === "*" || h.has(`${l.collection}:${l.item}`)
122
122
  }
123
123
  );
124
- const G = D(
125
- () => [...new Set((b.waiting.data ?? []).map((c) => c.collection))],
126
- [b.waiting.data]
127
- ), F = D(
128
- () => new Set((b.waiting.data ?? []).map((c) => c.key)),
129
- [b.waiting.data]
124
+ const W = T(
125
+ () => [...new Set((f.waiting.data ?? []).map((l) => l.collection))],
126
+ [f.waiting.data]
127
+ ), B = T(
128
+ () => new Set((f.waiting.data ?? []).map((l) => l.key)),
129
+ [f.waiting.data]
130
130
  );
131
- Z(
132
- m ? G : null,
133
- () => void n.invalidateQueries({ queryKey: C.waiting }),
131
+ ee(
132
+ p ? W : null,
133
+ () => void n.invalidateQueries({ queryKey: $.waiting }),
134
134
  {
135
135
  debounceMs: 1500,
136
- match: (c) => F.has(`${c.collection}:${c.item}`)
136
+ match: (l) => B.has(`${l.collection}:${l.item}`)
137
137
  }
138
138
  );
139
- const Q = D(
140
- () => new Set(a.teams.flatMap((c) => c.pins.map((x) => x.key))),
139
+ const G = T(
140
+ () => new Set(a.teams.flatMap((l) => l.pins.map((x) => x.key))),
141
141
  [a.teams]
142
- ), H = D(
143
- () => [...new Set(a.teams.flatMap((c) => c.pins.map((x) => x.collection)))],
142
+ ), J = T(
143
+ () => [...new Set(a.teams.flatMap((l) => l.pins.map((x) => x.collection)))],
144
144
  [a.teams]
145
145
  );
146
- Z(
147
- m ? H : null,
146
+ ee(
147
+ p ? J : null,
148
148
  () => void n.invalidateQueries({ queryKey: ["watch-list", "team"] }),
149
149
  {
150
150
  debounceMs: 1e3,
151
- match: (c) => c.item === "*" || Q.has(`${c.collection}:${c.item}`)
151
+ match: (l) => l.item === "*" || G.has(`${l.collection}:${l.item}`)
152
152
  }
153
153
  ), le(
154
154
  ["notification:new", "read:changed"],
155
- () => void n.invalidateQueries({ queryKey: C.mentions }),
155
+ () => void n.invalidateQueries({ queryKey: $.mentions }),
156
156
  { debounceMs: 1500, includeOwn: !0 }
157
157
  ), le(
158
158
  "prefs:changed",
159
- (c) => {
160
- const x = Array.isArray(c == null ? void 0 : c.keys) ? c.keys : null;
161
- (!x || x.includes("watch_list")) && n.invalidateQueries({ queryKey: C.prefs });
159
+ (l) => {
160
+ const x = Array.isArray(l == null ? void 0 : l.keys) ? l.keys : null;
161
+ (!x || x.includes("watch_list")) && n.invalidateQueries({ queryKey: $.prefs });
162
162
  },
163
163
  { includeOwn: !0, debounceMs: 300 }
164
164
  );
165
- const L = y(/* @__PURE__ */ new Set());
166
- N(() => {
167
- if (m)
168
- for (const c of a.pins) c.done_at && L.current.add(c.key);
169
- }, [m, a.pins]);
170
- const d = y(m), k = y(i.markSeen);
171
- k.current = i.markSeen, N(() => {
172
- const c = () => {
173
- const w = [...L.current].filter((S) => a.pins.some((T) => T.key === S));
174
- L.current.clear(), w.length > 0 && k.current(w);
165
+ const q = y(/* @__PURE__ */ new Set());
166
+ S(() => {
167
+ if (p)
168
+ for (const l of a.pins) l.done_at && q.current.add(l.key);
169
+ }, [p, a.pins]);
170
+ const E = y(p), O = y(o.markSeen);
171
+ O.current = o.markSeen, S(() => {
172
+ const l = () => {
173
+ const w = [...q.current].filter((C) => a.pins.some((L) => L.key === C));
174
+ q.current.clear(), w.length > 0 && O.current(w);
175
175
  };
176
- d.current && !m && c(), d.current = m;
177
- const x = () => document.visibilityState === "hidden" && c();
176
+ E.current && !p && l(), E.current = p;
177
+ const x = () => document.visibilityState === "hidden" && l();
178
178
  return document.addEventListener("visibilitychange", x), () => document.removeEventListener("visibilitychange", x);
179
- }, [m, a.pins]);
180
- const B = D(
179
+ }, [p, a.pins]);
180
+ const H = T(
181
181
  () => {
182
- var c;
183
- return we(((c = b.rows.data) == null ? void 0 : c.rows) ?? [], t.seenLocal);
182
+ var l;
183
+ return ke(((l = f.rows.data) == null ? void 0 : l.rows) ?? [], t.seenLocal);
184
184
  },
185
- [b.rows.data, t.seenLocal]
186
- ), M = m ? b.rows.data ? B.filter((c) => {
185
+ [f.rows.data, t.seenLocal]
186
+ ), d = p ? f.rows.data ? H.filter((l) => {
187
187
  var x;
188
- return (x = c.change) == null ? void 0 : x.changed;
189
- }).map((c) => c.key) : void 0 : (se = b.summary.data) == null ? void 0 : se.changed.filter((c) => !t.seenLocal.has(c));
190
- N(() => {
191
- m && b.rows.isSuccess && !b.rows.isFetching && $.clearLocal();
192
- }, [m, b.rows.isSuccess, b.rows.isFetching]);
193
- const K = Be(M, m ? /* @__PURE__ */ new Set() : t.localChanged, h), E = ((ie = b.mentions.data) == null ? void 0 : ie.unread) ?? 0;
194
- N(() => {
195
- $.publish({ changed: K.length, unreadMentions: E });
196
- }, [K.length, E]);
197
- const re = y({ mode: p, setDock: i.setDock });
198
- return re.current = { mode: p, setDock: i.setDock }, N(() => {
199
- const c = (x) => {
200
- if (!x.shiftKey || x.metaKey || x.ctrlKey || x.altKey || x.key.toLowerCase() !== "w" || Ye(x.target)) return;
188
+ return (x = l.change) == null ? void 0 : x.changed;
189
+ }).map((l) => l.key) : void 0 : (se = f.summary.data) == null ? void 0 : se.changed.filter((l) => !t.seenLocal.has(l));
190
+ S(() => {
191
+ p && f.rows.isSuccess && !f.rows.isFetching && D.clearLocal();
192
+ }, [p, f.rows.isSuccess, f.rows.isFetching]);
193
+ const k = Ve(d, p ? /* @__PURE__ */ new Set() : t.localChanged, h), v = ((ie = f.mentions.data) == null ? void 0 : ie.unread) ?? 0;
194
+ S(() => {
195
+ D.publish({ changed: k.length, unreadMentions: v });
196
+ }, [k.length, v]);
197
+ const M = y({ mode: m, setDock: o.setDock });
198
+ return M.current = { mode: m, setDock: o.setDock }, S(() => {
199
+ const l = (x) => {
200
+ if (!x.shiftKey || x.metaKey || x.ctrlKey || x.altKey || x.key.toLowerCase() !== "w" || Xe(x.target)) return;
201
201
  x.preventDefault();
202
- const { mode: w, setDock: S } = re.current;
203
- w === "sheet" ? $.closeSheet() : w === "hidden" ? $.openSheet() : S({ state: w === "open" ? "closed" : "open" });
202
+ const { mode: w, setDock: C } = M.current;
203
+ w === "sheet" ? D.closeSheet() : w === "hidden" ? D.openSheet() : C({ state: w === "open" ? "closed" : "open" });
204
204
  };
205
- return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
206
- }, []), o ? p === "sheet" || p === "hidden" ? /* @__PURE__ */ e(Ze, { open: p === "sheet", onOpenChange: (c) => !c && $.closeSheet(), children: /* @__PURE__ */ u(
207
- et,
205
+ return window.addEventListener("keydown", l), () => window.removeEventListener("keydown", l);
206
+ }, []), i ? m === "sheet" || m === "hidden" ? /* @__PURE__ */ e(tt, { open: m === "sheet", onOpenChange: (l) => !l && D.closeSheet(), children: /* @__PURE__ */ u(
207
+ nt,
208
208
  {
209
209
  side: "right",
210
- className: "flex w-full flex-col gap-0 p-0 sm:max-w-[400px]",
210
+ className: "flex w-full flex-col gap-0 p-0 sm:max-w-[400px] [&>button:last-of-type]:right-2 [&>button:last-of-type]:top-2 [&>button:last-of-type]:flex [&>button:last-of-type]:h-7 [&>button:last-of-type]:w-7 [&>button:last-of-type]:items-center [&>button:last-of-type]:justify-center [&>button:last-of-type]:rounded-md [&>button:last-of-type]:text-slate-500 [&>button:last-of-type]:bg-transparent [&>button:last-of-type]:opacity-100 [&>button:last-of-type]:hover:bg-slate-100 dark:[&>button:last-of-type]:text-slate-400 dark:[&>button:last-of-type]:hover:bg-white/[0.06]",
211
211
  "data-watch-dock": "sheet",
212
+ onOpenAutoFocus: (l) => {
213
+ var w;
214
+ l.preventDefault();
215
+ const x = (w = l.currentTarget) == null ? void 0 : w.querySelector(
216
+ "[data-watch-title]"
217
+ );
218
+ x == null || x.focus({ preventScroll: !0 });
219
+ },
212
220
  children: [
213
- /* @__PURE__ */ e(tt, { className: "sr-only", children: "Watch list" }),
214
- /* @__PURE__ */ e(nt, { className: "sr-only", children: "Records you pinned, records waiting on others, and mentions of you." }),
221
+ /* @__PURE__ */ e(at, { className: "sr-only", children: "Watch list" }),
222
+ /* @__PURE__ */ e(rt, { className: "sr-only", children: "Records you pinned, records waiting on others, and mentions of you." }),
215
223
  /* @__PURE__ */ e(
216
224
  pe,
217
225
  {
218
- actions: i,
219
- data: b,
220
- changed: K,
221
- unreadMentions: E,
226
+ actions: o,
227
+ data: f,
228
+ changed: k,
229
+ unreadMentions: v,
222
230
  inSheet: !0
223
231
  }
224
232
  )
225
233
  ]
226
234
  }
227
- ) }) : p === "closed" ? null : p === "minimized" ? /* @__PURE__ */ e(
228
- ht,
235
+ ) }) : m === "closed" ? null : m === "minimized" ? /* @__PURE__ */ e(
236
+ ft,
229
237
  {
230
238
  count: a.pins.length,
231
- changed: K.length,
232
- mentions: E,
233
- onOpen: () => i.setDock({ state: "open" })
239
+ changed: k.length,
240
+ mentions: v,
241
+ onOpen: () => o.setDock({ state: "open" })
234
242
  }
235
- ) : /* @__PURE__ */ e(ut, { width: l.width, onWidth: (c) => i.setDock({ width: c }), children: /* @__PURE__ */ e(pe, { actions: i, data: b, changed: K, unreadMentions: E }) }) : null;
243
+ ) : /* @__PURE__ */ e(bt, { width: c.width, onWidth: (l) => o.setDock({ width: l }), children: /* @__PURE__ */ e(pe, { actions: o, data: f, changed: k, unreadMentions: v }) }) : null;
236
244
  }
237
- function ht({
245
+ function ft({
238
246
  count: t,
239
247
  changed: n,
240
- mentions: o,
241
- onOpen: i
248
+ mentions: i,
249
+ onOpen: o
242
250
  }) {
243
251
  const a = [
244
252
  `${t} pinned`,
245
253
  n > 0 ? `${n} changed` : "",
246
- o > 0 ? `${o} new mention${o === 1 ? "" : "s"}` : ""
254
+ i > 0 ? `${i} new mention${i === 1 ? "" : "s"}` : ""
247
255
  ].filter(Boolean).join(", ");
248
256
  return /* @__PURE__ */ e(
249
257
  "aside",
@@ -255,12 +263,12 @@ function ht({
255
263
  "button",
256
264
  {
257
265
  type: "button",
258
- onClick: i,
266
+ onClick: o,
259
267
  "aria-label": `Show watch list: ${a}`,
260
268
  "data-tip": `Watch list · ${a}`,
261
269
  className: "group flex flex-1 flex-col items-center gap-2 pt-3 text-slate-500 transition-colors hover:bg-slate-50 hover:text-slate-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan/60 dark:text-slate-400 dark:hover:bg-white/[0.03] dark:hover:text-slate-100",
262
270
  children: [
263
- /* @__PURE__ */ e(Ce, { className: "h-4 w-4" }),
271
+ /* @__PURE__ */ e(Te, { className: "h-4 w-4" }),
264
272
  /* @__PURE__ */ u(
265
273
  "span",
266
274
  {
@@ -288,14 +296,14 @@ function ht({
288
296
  ]
289
297
  }
290
298
  ),
291
- o > 0 && /* @__PURE__ */ u(
299
+ i > 0 && /* @__PURE__ */ u(
292
300
  "span",
293
301
  {
294
302
  className: "flex items-center gap-0.5 text-[10.5px] font-semibold tabular-nums text-slate-600 dark:text-slate-300",
295
- "data-tip": `${o} new mention${o === 1 ? "" : "s"}`,
303
+ "data-tip": `${i} new mention${i === 1 ? "" : "s"}`,
296
304
  children: [
297
305
  /* @__PURE__ */ e(ge, { "aria-hidden": !0, className: "h-3 w-3" }),
298
- o
306
+ i
299
307
  ]
300
308
  }
301
309
  ),
@@ -313,23 +321,23 @@ function ht({
313
321
  }
314
322
  );
315
323
  }
316
- function ut({
324
+ function bt({
317
325
  width: t,
318
326
  onWidth: n,
319
- children: o
327
+ children: i
320
328
  }) {
321
- const [i, a] = q(null), r = y(null), l = i ?? t, s = (g) => Math.round(Math.min(de, Math.max(he, g))), p = (g) => {
322
- r.current = { x: g.clientX, w: l }, g.currentTarget.setPointerCapture(g.pointerId);
323
- }, m = (g) => {
324
- r.current && a(s(r.current.w + (r.current.x - g.clientX)));
325
- }, b = () => {
326
- r.current && (r.current = null, i != null && i !== t && n(i), a(null));
329
+ const [o, a] = R(null), s = y(null), c = o ?? t, r = (g) => Math.round(Math.min(de, Math.max(ue, g))), m = (g) => {
330
+ s.current = { x: g.clientX, w: c }, g.currentTarget.setPointerCapture(g.pointerId);
331
+ }, p = (g) => {
332
+ s.current && a(r(s.current.w + (s.current.x - g.clientX)));
333
+ }, f = () => {
334
+ s.current && (s.current = null, o != null && o !== t && n(o), a(null));
327
335
  };
328
336
  return /* @__PURE__ */ u(
329
337
  "aside",
330
338
  {
331
339
  className: "relative flex shrink-0 flex-col border-l border-border bg-card",
332
- style: { width: l },
340
+ style: { width: c },
333
341
  "data-watch-dock": "open",
334
342
  "aria-label": "Watch list",
335
343
  children: [
@@ -339,21 +347,21 @@ function ut({
339
347
  role: "separator",
340
348
  "aria-orientation": "vertical",
341
349
  "aria-label": "Resize watch list",
342
- "aria-valuemin": he,
350
+ "aria-valuemin": ue,
343
351
  "aria-valuemax": de,
344
- "aria-valuenow": l,
352
+ "aria-valuenow": c,
345
353
  tabIndex: 0,
346
- onPointerDown: p,
347
- onPointerMove: m,
348
- onPointerUp: b,
349
- onPointerCancel: b,
354
+ onPointerDown: m,
355
+ onPointerMove: p,
356
+ onPointerUp: f,
357
+ onPointerCancel: f,
350
358
  onKeyDown: (g) => {
351
- g.key !== "ArrowLeft" && g.key !== "ArrowRight" || (g.preventDefault(), n(s(t + (g.key === "ArrowLeft" ? 16 : -16))));
359
+ g.key !== "ArrowLeft" && g.key !== "ArrowRight" || (g.preventDefault(), n(r(t + (g.key === "ArrowLeft" ? 16 : -16))));
352
360
  },
353
361
  className: "absolute inset-y-0 -left-1 z-10 w-2 cursor-col-resize touch-none outline-none after:absolute after:inset-y-0 after:left-[3px] after:w-px after:bg-transparent after:transition-colors hover:after:bg-nvr-cyan/50 focus-visible:after:bg-nvr-cyan"
354
362
  }
355
363
  ),
356
- o
364
+ i
357
365
  ]
358
366
  }
359
367
  );
@@ -361,71 +369,71 @@ function ut({
361
369
  function Y({
362
370
  label: t,
363
371
  onClick: n,
364
- children: o,
365
- pressed: i
372
+ children: i,
373
+ pressed: o
366
374
  }) {
367
375
  return /* @__PURE__ */ e(
368
376
  "button",
369
377
  {
370
378
  type: "button",
371
379
  "aria-label": t,
372
- "aria-pressed": i,
380
+ "aria-pressed": o,
373
381
  "data-tip": t,
374
382
  onClick: n,
375
383
  className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 dark:text-slate-500 dark:hover:bg-white/[0.06] dark:hover:text-slate-200",
376
- children: o
384
+ children: i
377
385
  }
378
386
  );
379
387
  }
380
- function mt({ sort: t, onSort: n }) {
381
- const [o, i] = q(!1), a = y(null);
382
- return N(() => {
383
- if (!o) return;
384
- const r = (s) => {
385
- var p;
386
- (p = a.current) != null && p.contains(s.target) || i(!1);
387
- }, l = (s) => s.key === "Escape" && i(!1);
388
- return document.addEventListener("pointerdown", r), document.addEventListener("keydown", l), () => {
389
- document.removeEventListener("pointerdown", r), document.removeEventListener("keydown", l);
388
+ function gt({ sort: t, onSort: n }) {
389
+ const [i, o] = R(!1), a = y(null);
390
+ return S(() => {
391
+ if (!i) return;
392
+ const s = (r) => {
393
+ var m;
394
+ (m = a.current) != null && m.contains(r.target) || o(!1);
395
+ }, c = (r) => r.key === "Escape" && o(!1);
396
+ return document.addEventListener("pointerdown", s), document.addEventListener("keydown", c), () => {
397
+ document.removeEventListener("pointerdown", s), document.removeEventListener("keydown", c);
390
398
  };
391
- }, [o]), /* @__PURE__ */ u("div", { ref: a, className: "relative", children: [
399
+ }, [i]), /* @__PURE__ */ u("div", { ref: a, className: "relative", children: [
392
400
  /* @__PURE__ */ u(
393
401
  "button",
394
402
  {
395
403
  type: "button",
396
404
  "aria-haspopup": "menu",
397
- "aria-expanded": o,
398
- "aria-label": `Sort: ${A[t]}`,
399
- "data-tip": `Sort: ${A[t]}`,
400
- onClick: () => i((r) => !r),
405
+ "aria-expanded": i,
406
+ "aria-label": `Sort: ${P[t]}`,
407
+ "data-tip": `Sort: ${P[t]}`,
408
+ onClick: () => o((s) => !s),
401
409
  className: "flex h-7 items-center gap-1 rounded-md px-1.5 text-[11px] font-medium text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 dark:text-slate-400 dark:hover:bg-white/[0.06] dark:hover:text-slate-200",
402
410
  children: [
403
- /* @__PURE__ */ e($e, { className: "h-3.5 w-3.5" }),
404
- /* @__PURE__ */ e("span", { className: "hidden min-[340px]:inline", children: A[t] })
411
+ /* @__PURE__ */ e(Le, { className: "h-3.5 w-3.5" }),
412
+ /* @__PURE__ */ e("span", { className: "hidden min-[340px]:inline", children: P[t] })
405
413
  ]
406
414
  }
407
415
  ),
408
- o && /* @__PURE__ */ e(
416
+ i && /* @__PURE__ */ e(
409
417
  "div",
410
418
  {
411
419
  role: "menu",
412
420
  className: "absolute right-0 top-8 z-20 w-40 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md",
413
- children: Object.keys(A).map((r) => /* @__PURE__ */ u(
421
+ children: Object.keys(P).map((s) => /* @__PURE__ */ u(
414
422
  "button",
415
423
  {
416
424
  type: "button",
417
425
  role: "menuitemradio",
418
- "aria-checked": r === t,
426
+ "aria-checked": s === t,
419
427
  onClick: () => {
420
- n(r), i(!1);
428
+ n(s), o(!1);
421
429
  },
422
430
  className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[12px] text-slate-700 hover:bg-muted dark:text-slate-200",
423
431
  children: [
424
- /* @__PURE__ */ e(De, { className: `h-3 w-3 ${r === t ? "opacity-100" : "opacity-0"}` }),
425
- A[r]
432
+ /* @__PURE__ */ e(Me, { className: `h-3 w-3 ${s === t ? "opacity-100" : "opacity-0"}` }),
433
+ P[s]
426
434
  ]
427
435
  },
428
- r
436
+ s
429
437
  ))
430
438
  }
431
439
  )
@@ -434,61 +442,82 @@ function mt({ sort: t, onSort: n }) {
434
442
  function pe({
435
443
  actions: t,
436
444
  data: n,
437
- changed: o,
438
- unreadMentions: i,
445
+ changed: i,
446
+ unreadMentions: o,
439
447
  inSheet: a = !1
440
448
  }) {
441
- var F, Q, H, L;
442
- const { prefs: r } = t, l = r.dock.tab.startsWith("team:") ? r.teams.find((d) => `team:${d.id}` === r.dock.tab) ?? null : null, s = r.dock.tab.startsWith("team:") && !l ? "watching" : r.dock.tab, p = r.dock.sort, m = (F = n.waiting.data) == null ? void 0 : F.length, [b, h] = q(null), g = [
443
- { key: "watching", label: "Watching", count: r.pins.length, dot: o.length > 0 },
444
- ...r.teams.map((d) => ({
449
+ var q, E, O, H;
450
+ const { prefs: s } = t, c = s.dock.tab.startsWith("team:") ? s.teams.find((d) => `team:${d.id}` === s.dock.tab) ?? null : null, r = s.dock.tab.startsWith("team:") && !c ? "watching" : s.dock.tab, m = s.dock.sort, p = (q = n.waiting.data) == null ? void 0 : q.length, [f, h] = R(null), g = [
451
+ { key: "watching", label: "Watching", count: s.pins.length, dot: i.length > 0 },
452
+ ...s.teams.map((d) => ({
445
453
  key: `team:${d.id}`,
446
454
  label: d.name,
447
- count: d.pins.length || null,
455
+ count: d.pins.length,
448
456
  dot: !1,
449
457
  team: !0
450
458
  })),
451
- { key: "waiting", label: "Waiting", count: m ?? null, dot: !1 },
452
- { key: "mentions", label: "Mentions", count: i || null, dot: i > 0 }
453
- ], f = y(null), [_, z] = q(!1), R = () => {
454
- const d = f.current;
455
- d && z(d.scrollWidth - d.scrollLeft - d.clientWidth > 2);
456
- }, j = g.map((d) => `${d.key}:${d.count ?? ""}`).join("|");
457
- N(() => {
458
- R();
459
- const d = f.current;
459
+ { key: "waiting", label: "Waiting", count: p ?? null, dot: !1 },
460
+ {
461
+ key: "mentions",
462
+ label: "Mentions",
463
+ // Unread mentions; a count once known, 0 included, like every other tab (rt6 review).
464
+ count: n.mentions.data ? o : null,
465
+ dot: o > 0
466
+ }
467
+ ], b = y(null), [_, z] = R(!1), [F, Q] = R(!1), W = () => {
468
+ const d = b.current;
469
+ d && (z(d.scrollWidth - d.scrollLeft - d.clientWidth > 2), Q(d.scrollLeft > 2));
470
+ }, B = (d) => {
471
+ var k;
472
+ return (k = b.current) == null ? void 0 : k.scrollBy({ left: d * 140, behavior: "smooth" });
473
+ }, G = `${g.map((d) => `${d.key}:${d.count ?? ""}`).join("|")}${f === "new" ? "|new" : ""}`;
474
+ S(() => {
475
+ W();
476
+ const d = b.current;
460
477
  if (!d || typeof ResizeObserver > "u") return;
461
- const k = new ResizeObserver(R);
478
+ const k = new ResizeObserver(W);
462
479
  return k.observe(d), () => k.disconnect();
463
- }, [j]), N(() => {
464
- var k;
465
- const d = (k = f.current) == null ? void 0 : k.querySelector(`[data-tab="${CSS.escape(s)}"]`);
480
+ }, [G]), S(() => {
481
+ var v;
482
+ const d = (v = b.current) == null ? void 0 : v.querySelector(
483
+ f === "new" ? "[data-tab-new]" : `[data-tab="${CSS.escape(r)}"]`
484
+ );
466
485
  d && typeof d.scrollIntoView == "function" && d.scrollIntoView({ block: "nearest", inline: "nearest" });
467
- }, [s]);
468
- const G = (d) => {
486
+ const k = b.current;
487
+ f === "new" && k && (k.scrollLeft = k.scrollWidth), W();
488
+ }, [r, f]);
489
+ const J = (d) => {
469
490
  if (d.key !== "ArrowRight" && d.key !== "ArrowLeft") return;
470
- const k = g.findIndex((M) => M.key === s), B = g[(k + (d.key === "ArrowRight" ? 1 : g.length - 1)) % g.length];
471
- t.setDock({ tab: B.key }), requestAnimationFrame(
491
+ const k = g.findIndex((M) => M.key === r), v = g[(k + (d.key === "ArrowRight" ? 1 : g.length - 1)) % g.length];
492
+ t.setDock({ tab: v.key }), requestAnimationFrame(
472
493
  () => {
473
494
  var M;
474
- return (M = d.currentTarget.querySelector(`[data-tab="${B.key}"]`)) == null ? void 0 : M.focus();
495
+ return (M = d.currentTarget.querySelector(`[data-tab="${v.key}"]`)) == null ? void 0 : M.focus();
475
496
  }
476
497
  );
477
498
  };
478
499
  return /* @__PURE__ */ u("div", { className: "flex min-h-0 flex-1 flex-col", children: [
479
500
  /* @__PURE__ */ u("div", { className: `flex h-11 shrink-0 items-center gap-1 pl-4 ${a ? "pr-11" : "pr-2"}`, children: [
480
- /* @__PURE__ */ e("h2", { className: "flex-1 truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Watch list" }),
481
- s === "watching" && r.pins.length > 1 && /* @__PURE__ */ e(mt, { sort: p, onSort: (d) => t.setDock({ sort: d }) }),
482
- s === "watching" && r.pins.length > 0 && /* @__PURE__ */ e(
501
+ /* @__PURE__ */ e(
502
+ "h2",
503
+ {
504
+ tabIndex: -1,
505
+ "data-watch-title": !0,
506
+ className: "flex-1 truncate text-[13px] font-semibold text-slate-800 outline-none dark:text-slate-100",
507
+ children: "Watch list"
508
+ }
509
+ ),
510
+ r === "watching" && s.pins.length > 1 && /* @__PURE__ */ e(gt, { sort: m, onSort: (d) => t.setDock({ sort: d }) }),
511
+ r === "watching" && s.pins.length > 0 && /* @__PURE__ */ e(
483
512
  "span",
484
513
  {
485
- className: o.length > 0 ? "contents" : "invisible",
486
- "aria-hidden": o.length === 0 || void 0,
487
- children: /* @__PURE__ */ e(Y, { label: "Mark all as seen", onClick: () => t.markSeen(), children: /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5" }) })
514
+ className: i.length > 0 ? "contents" : "invisible",
515
+ "aria-hidden": i.length === 0 || void 0,
516
+ children: /* @__PURE__ */ e(Y, { label: "Mark all as seen", onClick: () => t.markSeen(), children: /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5" }) })
488
517
  }
489
518
  ),
490
519
  /* @__PURE__ */ e(
491
- at,
520
+ st,
492
521
  {
493
522
  actions: t,
494
523
  onOpenTeam: (d) => {
@@ -497,126 +526,165 @@ function pe({
497
526
  onNewTeam: () => h("new")
498
527
  }
499
528
  ),
500
- !a && /* @__PURE__ */ u(P, { children: [
501
- /* @__PURE__ */ e(Y, { label: "Minimize", onClick: () => t.setDock({ state: "minimized" }), children: /* @__PURE__ */ e(Ne, { className: "h-3.5 w-3.5" }) }),
529
+ !a && /* @__PURE__ */ u(U, { children: [
530
+ /* @__PURE__ */ e(Y, { label: "Minimize", onClick: () => t.setDock({ state: "minimized" }), children: /* @__PURE__ */ e(Se, { className: "h-3.5 w-3.5" }) }),
502
531
  /* @__PURE__ */ e(
503
532
  Y,
504
533
  {
505
534
  label: "Close (the icon reopens it)",
506
535
  onClick: () => t.setDock({ state: "closed" }),
507
- children: /* @__PURE__ */ e(Se, { className: "h-3.5 w-3.5" })
536
+ children: /* @__PURE__ */ e(Ce, { className: "h-3.5 w-3.5" })
508
537
  }
509
538
  )
510
539
  ] })
511
540
  ] }),
512
- /* @__PURE__ */ e(
513
- "div",
514
- {
515
- role: "tablist",
516
- "aria-label": "Watch list views",
517
- onKeyDown: G,
518
- ref: f,
519
- onScroll: R,
520
- className: `flex shrink-0 overflow-x-auto border-b border-border px-4 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden ${r.teams.length > 0 ? "gap-3" : "gap-4"} ${_ ? "[mask-image:linear-gradient(to_right,#000_calc(100%_-_28px),transparent)]" : ""}`,
521
- children: g.map((d) => {
522
- const k = d.key === s;
523
- return /* @__PURE__ */ u(
524
- "button",
525
- {
526
- type: "button",
527
- role: "tab",
528
- "data-tab": d.key,
529
- "aria-selected": k,
530
- tabIndex: k ? 0 : -1,
531
- onClick: () => {
532
- h(null), t.setDock({ tab: d.key });
533
- },
534
- "data-tip": d.team ? `Shared list · ${d.label}` : void 0,
535
- className: `relative -mb-px flex shrink-0 items-center gap-1.5 border-b-2 pb-2 pt-0.5 text-[12px] font-medium transition-colors rounded-t-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 ${k ? "border-nvr-cyan text-slate-900 dark:text-slate-50" : "border-transparent text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-200"}`,
536
- children: [
537
- d.team && /* @__PURE__ */ e(ee, { "aria-hidden": !0, className: "h-3 w-3 shrink-0 opacity-70" }),
538
- /* @__PURE__ */ e("span", { className: d.team ? "max-w-[96px] truncate" : void 0, children: d.label }),
539
- d.count != null && d.count > 0 && /* @__PURE__ */ e(
540
- "span",
541
- {
542
- className: `rounded-full px-1.5 text-[10.5px] font-semibold tabular-nums ${d.dot ? "bg-sky-100 text-sky-800 dark:bg-nvr-cyan/15 dark:text-nvr-cyan" : "bg-slate-100 text-slate-500 dark:bg-white/[0.07] dark:text-slate-400"}`,
543
- children: d.count
544
- }
545
- ),
546
- d.dot && d.key === "watching" && /* @__PURE__ */ u("span", { className: "sr-only", children: [
547
- ", ",
548
- o.length,
549
- " changed"
550
- ] })
551
- ]
552
- },
553
- d.key
554
- );
555
- })
556
- }
557
- ),
541
+ /* @__PURE__ */ u("div", { className: "relative shrink-0 border-b border-border", children: [
542
+ /* @__PURE__ */ u(
543
+ "div",
544
+ {
545
+ role: "tablist",
546
+ "aria-label": "Watch list views",
547
+ onKeyDown: J,
548
+ ref: b,
549
+ onScroll: W,
550
+ className: `-mb-px flex scroll-px-10 overflow-x-auto px-4 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden ${s.teams.length > 0 || f === "new" ? "gap-3" : "gap-4"}`,
551
+ children: [
552
+ g.map((d) => {
553
+ const k = d.key === r && f !== "new";
554
+ return /* @__PURE__ */ u(
555
+ "button",
556
+ {
557
+ type: "button",
558
+ role: "tab",
559
+ "data-tab": d.key,
560
+ "aria-selected": k,
561
+ tabIndex: k ? 0 : -1,
562
+ onClick: () => {
563
+ h(null), t.setDock({ tab: d.key });
564
+ },
565
+ "data-tip": d.team ? `Shared list · ${d.label}` : void 0,
566
+ className: `relative flex shrink-0 items-center gap-1.5 border-b-2 pb-2 pt-0.5 text-[12px] font-medium transition-colors rounded-t-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 ${k ? "border-nvr-cyan text-slate-900 dark:text-slate-50" : "border-transparent text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-200"}`,
567
+ children: [
568
+ d.team && /* @__PURE__ */ e(te, { "aria-hidden": !0, className: "h-3 w-3 shrink-0 opacity-70" }),
569
+ /* @__PURE__ */ e("span", { className: d.team ? "max-w-[96px] truncate" : void 0, children: d.label }),
570
+ d.count != null && /* @__PURE__ */ e(
571
+ "span",
572
+ {
573
+ className: `rounded-full px-1.5 text-[10.5px] font-semibold tabular-nums ${d.dot ? "bg-sky-100 text-sky-800 dark:bg-nvr-cyan/15 dark:text-nvr-cyan" : d.count === 0 ? "bg-slate-100/70 text-slate-400 dark:bg-white/[0.04] dark:text-slate-500" : "bg-slate-100 text-slate-500 dark:bg-white/[0.07] dark:text-slate-400"}`,
574
+ children: d.count
575
+ }
576
+ ),
577
+ d.dot && d.key === "watching" && /* @__PURE__ */ u("span", { className: "sr-only", children: [
578
+ ", ",
579
+ i.length,
580
+ " changed"
581
+ ] })
582
+ ]
583
+ },
584
+ d.key
585
+ );
586
+ }),
587
+ f === "new" && /* @__PURE__ */ u(
588
+ "span",
589
+ {
590
+ "aria-current": "page",
591
+ className: "relative flex shrink-0 items-center gap-1.5 border-b-2 border-nvr-cyan pb-2 pt-0.5 text-[12px] font-medium text-slate-900 dark:text-slate-50",
592
+ "data-tab-new": !0,
593
+ children: [
594
+ /* @__PURE__ */ e($e, { "aria-hidden": !0, className: "h-3 w-3 shrink-0 opacity-70" }),
595
+ "New list"
596
+ ]
597
+ }
598
+ )
599
+ ]
600
+ }
601
+ ),
602
+ F && /* @__PURE__ */ e(
603
+ "button",
604
+ {
605
+ type: "button",
606
+ tabIndex: -1,
607
+ "aria-hidden": !0,
608
+ onClick: () => B(-1),
609
+ className: "absolute inset-y-0 left-0 flex w-8 items-start justify-start bg-[linear-gradient(to_right,hsl(var(--card))_70%,transparent)] pl-1 pt-0.5 text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-100",
610
+ children: /* @__PURE__ */ e(De, { className: "h-4 w-4" })
611
+ }
612
+ ),
613
+ _ && /* @__PURE__ */ e(
614
+ "button",
615
+ {
616
+ type: "button",
617
+ tabIndex: -1,
618
+ "aria-hidden": !0,
619
+ onClick: () => B(1),
620
+ "data-tab-more": !0,
621
+ className: "absolute inset-y-0 right-0 flex w-9 items-start justify-end bg-[linear-gradient(to_left,hsl(var(--card))_70%,transparent)] pr-1 pt-0.5 text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-100",
622
+ children: /* @__PURE__ */ e(be, { className: "h-4 w-4" })
623
+ }
624
+ )
625
+ ] }),
558
626
  /* @__PURE__ */ e(
559
627
  "div",
560
628
  {
561
629
  className: "min-h-0 flex-1 overflow-y-auto",
562
630
  role: "tabpanel",
563
- "aria-label": l ? l.name : s,
564
- children: b ? /* @__PURE__ */ e(
565
- rt,
631
+ "aria-label": c ? c.name : r,
632
+ children: f ? /* @__PURE__ */ e(
633
+ it,
566
634
  {
567
635
  actions: t,
568
- team: b === "new" ? null : b,
569
- meId: ((Q = r.me) == null ? void 0 : Q.id) ?? null,
570
- meName: ((H = r.me) == null ? void 0 : H.name) ?? "",
636
+ team: f === "new" ? null : f,
637
+ meId: ((E = s.me) == null ? void 0 : E.id) ?? null,
638
+ meName: ((O = s.me) == null ? void 0 : O.name) ?? "",
571
639
  onClose: () => h(null),
572
640
  onCreated: (d) => {
573
641
  h(null), t.setDock({ tab: `team:${d}` });
574
642
  }
575
643
  },
576
- b === "new" ? "new" : b.id
577
- ) : /* @__PURE__ */ u(P, { children: [
578
- s === "watching" && /* @__PURE__ */ e(ft, { actions: t, data: n }),
579
- l && /* @__PURE__ */ e(
580
- xt,
644
+ f === "new" ? "new" : f.id
645
+ ) : /* @__PURE__ */ u(U, { children: [
646
+ r === "watching" && /* @__PURE__ */ e(wt, { actions: t, data: n }),
647
+ c && /* @__PURE__ */ e(
648
+ vt,
581
649
  {
582
650
  actions: t,
583
- team: l,
584
- meId: ((L = r.me) == null ? void 0 : L.id) ?? null,
585
- onEdit: () => h(l)
651
+ team: c,
652
+ meId: ((H = s.me) == null ? void 0 : H.id) ?? null,
653
+ onEdit: () => h(c)
586
654
  }
587
655
  ),
588
- s === "waiting" && /* @__PURE__ */ e(wt, { data: n }),
589
- s === "mentions" && /* @__PURE__ */ e(kt, { data: n })
656
+ r === "waiting" && /* @__PURE__ */ e(Nt, { data: n }),
657
+ r === "mentions" && /* @__PURE__ */ e(St, { data: n })
590
658
  ] })
591
659
  }
592
660
  )
593
661
  ] });
594
662
  }
595
- function U({ n: t = 4 }) {
596
- return /* @__PURE__ */ e("div", { className: "space-y-4 px-4 py-3", "aria-busy": !0, children: Array.from({ length: t }, (n, o) => (
663
+ function A({ n: t = 4 }) {
664
+ return /* @__PURE__ */ e("div", { className: "space-y-4 px-4 py-3", "aria-busy": !0, children: Array.from({ length: t }, (n, i) => (
597
665
  // biome-ignore lint/suspicious/noArrayIndexKey: placeholders
598
666
  /* @__PURE__ */ u("div", { className: "space-y-1.5", children: [
599
667
  /* @__PURE__ */ e(me, { className: "h-3.5 w-3/4" }),
600
668
  /* @__PURE__ */ e(me, { className: "h-3 w-1/2" })
601
- ] }, o)
669
+ ] }, i)
602
670
  )) });
603
671
  }
604
- function I({
672
+ function j({
605
673
  icon: t,
606
674
  title: n,
607
- children: o
675
+ children: i
608
676
  }) {
609
677
  return /* @__PURE__ */ u("div", { className: "flex flex-col items-start gap-2 px-4 py-6", "data-watch-empty": !0, children: [
610
678
  /* @__PURE__ */ e("span", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-slate-100 text-slate-500 dark:bg-white/[0.06] dark:text-slate-400", children: t }),
611
679
  /* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-slate-200", children: n }),
612
- o && /* @__PURE__ */ e("div", { className: "text-[12px] leading-relaxed text-slate-500 dark:text-slate-400", children: o })
680
+ i && /* @__PURE__ */ e("div", { className: "text-[12px] leading-relaxed text-slate-500 dark:text-slate-400", children: i })
613
681
  ] });
614
682
  }
615
683
  function X({ error: t, onRetry: n }) {
616
- const o = Oe(t, "The list could not load");
684
+ const i = Ie(t, "The list could not load");
617
685
  return /* @__PURE__ */ u("div", { className: "px-4 py-5", children: [
618
- /* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-slate-200", children: o.title }),
619
- o.hint && /* @__PURE__ */ e("p", { className: "mt-1 text-[12px] text-slate-500 dark:text-slate-400", children: o.hint }),
686
+ /* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-slate-200", children: i.title }),
687
+ i.hint && /* @__PURE__ */ e("p", { className: "mt-1 text-[12px] text-slate-500 dark:text-slate-400", children: i.hint }),
620
688
  /* @__PURE__ */ e(
621
689
  "button",
622
690
  {
@@ -628,83 +696,88 @@ function X({ error: t, onRetry: n }) {
628
696
  )
629
697
  ] });
630
698
  }
631
- function pt({ children: t }) {
699
+ function xt({ children: t }) {
632
700
  return /* @__PURE__ */ e("kbd", { className: "rounded border border-slate-200 bg-slate-50 px-1 font-sans text-[10.5px] font-medium text-slate-600 dark:border-white/10 dark:bg-white/[0.06] dark:text-slate-300", children: t });
633
701
  }
634
- function ft({
702
+ function wt({
635
703
  actions: t,
636
704
  data: n
637
705
  }) {
638
- const { prefs: o } = t, i = n.rows.data, { seenLocal: a } = xe(), r = D(() => {
639
- const s = new Map(we((i == null ? void 0 : i.rows) ?? [], a).map((m) => [m.key, m])), p = o.pins.map((m) => s.get(m.key)).filter((m) => !!m);
640
- return Ve(ke(p, o.pins), o.dock.sort);
641
- }, [i, o.pins, o.dock.sort, a]);
642
- if (o.pins.length === 0)
643
- return /* @__PURE__ */ u(P, { children: [
644
- /* @__PURE__ */ e(I, { icon: /* @__PURE__ */ e(Te, { className: "h-4 w-4" }), title: "Nothing on your watch list yet", children: /* @__PURE__ */ u("p", { children: [
706
+ const { prefs: i } = t, o = n.rows.data, { seenLocal: a } = we(), s = T(() => {
707
+ const r = new Map(ke((o == null ? void 0 : o.rows) ?? [], a).map((p) => [p.key, p])), m = i.pins.map((p) => r.get(p.key)).filter((p) => !!p);
708
+ return Ge(ye(m, i.pins), i.dock.sort);
709
+ }, [o, i.pins, i.dock.sort, a]);
710
+ if (!t.prefsReady) return /* @__PURE__ */ e(A, { n: 3 });
711
+ if (i.pins.length === 0)
712
+ return /* @__PURE__ */ u(U, { children: [
713
+ /* @__PURE__ */ e(j, { icon: /* @__PURE__ */ e(Re, { className: "h-4 w-4" }), title: "Nothing on your watch list yet", children: /* @__PURE__ */ u("p", { children: [
645
714
  "Pin a record to follow it here, live, on every page: use the pin beside a record’s title, ",
646
715
  /* @__PURE__ */ e("span", { className: "whitespace-nowrap", children: "a list row’s menu," }),
647
716
  " or press",
648
717
  " ",
649
- /* @__PURE__ */ e(pt, { children: "W" }),
718
+ /* @__PURE__ */ e(xt, { children: "W" }),
650
719
  " on a record."
651
720
  ] }) }),
652
721
  /* @__PURE__ */ e(
653
- te,
722
+ ne,
654
723
  {
655
- removed: o.removed,
656
- onUndo: (s) => void t.restoreRemoved(s.collection, s.id).catch(() => {
724
+ removed: i.removed,
725
+ onUndo: (r) => void t.restoreRemoved(r.collection, r.id).catch(() => {
657
726
  })
658
727
  }
659
728
  )
660
729
  ] });
661
- if (n.rows.isError && !i)
730
+ if (n.rows.isError && !o)
662
731
  return /* @__PURE__ */ e(X, { error: n.rows.error, onRetry: () => void n.rows.refetch() });
663
- if (!i) return /* @__PURE__ */ e(U, { n: Math.min(5, o.pins.length) });
664
- const l = o.pins.length - r.length;
665
- return /* @__PURE__ */ u(P, { children: [
732
+ if (!o) return /* @__PURE__ */ e(A, { n: Math.min(5, i.pins.length) });
733
+ const c = i.pins.length - s.length;
734
+ return /* @__PURE__ */ u(U, { children: [
666
735
  /* @__PURE__ */ e(
667
- ye,
736
+ ve,
668
737
  {
669
- rows: r,
670
- sortable: o.dock.sort === "mine" && r.length > 1,
738
+ rows: s,
739
+ sortable: i.dock.sort === "mine" && s.length > 1,
671
740
  onReorder: t.reorder,
672
- onUnpin: (s) => void t.unpin(s.collection, s.id).catch(() => {
741
+ onUnpin: (r) => void t.unpin(r.collection, r.id).catch(() => {
673
742
  }),
674
- onSeen: (s) => {
675
- var m;
676
- const p = r.find((b) => b.key === s);
677
- ((m = p == null ? void 0 : p.change) != null && m.changed || p != null && p.completed_at) && t.markSeen([s]);
743
+ onSeen: (r) => {
744
+ var p;
745
+ const m = s.find((f) => f.key === r);
746
+ ((p = m == null ? void 0 : m.change) != null && p.changed || m != null && m.completed_at) && t.markSeen([r]);
678
747
  },
679
- rowActions: (s) => /* @__PURE__ */ e(st, { row: s, actions: t })
748
+ rowActions: (r) => /* @__PURE__ */ e(ct, { row: r, actions: t }),
749
+ rowMark: (r) => i.pins.some((m) => m.key === r.key && m.auto) || i.alerts.some((m) => m.key === r.key) ? /* @__PURE__ */ u("span", { className: "flex items-center gap-1.5", children: [
750
+ /* @__PURE__ */ e(ot, { row: r, actions: t }),
751
+ /* @__PURE__ */ e("span", { className: "flex group-focus-within/row:hidden group-hover/row:hidden group-has-[[data-state=open]]/row:hidden", children: /* @__PURE__ */ e(lt, { row: r, actions: t }) })
752
+ ] }) : null
680
753
  }
681
754
  ),
682
- l > 0 && /* @__PURE__ */ e(U, { n: Math.min(3, l) }),
755
+ c > 0 && /* @__PURE__ */ e(A, { n: Math.min(3, c) }),
683
756
  /* @__PURE__ */ u("p", { className: "px-4 py-3 text-[11px] text-slate-500 dark:text-slate-400", children: [
684
- o.pins.length,
757
+ i.pins.length,
685
758
  " of ",
686
- o.max,
759
+ i.max,
687
760
  " pinned"
688
761
  ] }),
689
762
  /* @__PURE__ */ e(
690
- te,
763
+ ne,
691
764
  {
692
- removed: o.removed,
693
- onUndo: (s) => void t.restoreRemoved(s.collection, s.id).catch(() => {
765
+ removed: i.removed,
766
+ onUndo: (r) => void t.restoreRemoved(r.collection, r.id).catch(() => {
694
767
  })
695
768
  }
696
769
  )
697
770
  ] });
698
771
  }
699
- function gt({
772
+ function kt({
700
773
  actions: t,
701
774
  team: n,
702
- isOwner: o,
703
- onEdit: i
775
+ isOwner: i,
776
+ onEdit: o
704
777
  }) {
705
- const [a, r] = q(!1), l = "flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 dark:text-slate-200", s = n.can_manage || !!n.can_take_over, p = n.is_member && !o;
706
- return !n.can_manage && !n.can_take_over && !s && !p ? null : /* @__PURE__ */ u(Xe, { open: a, onOpenChange: r, children: [
707
- /* @__PURE__ */ e(Ge, { asChild: !0, children: /* @__PURE__ */ e(
778
+ const [a, s] = R(!1), c = "flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 dark:text-slate-200", r = n.can_manage || !!n.can_take_over, m = n.is_member && !i;
779
+ return !n.can_manage && !n.can_take_over && !r && !m ? null : /* @__PURE__ */ u(Je, { open: a, onOpenChange: s, children: [
780
+ /* @__PURE__ */ e(Ze, { asChild: !0, children: /* @__PURE__ */ e(
708
781
  "button",
709
782
  {
710
783
  type: "button",
@@ -712,21 +785,21 @@ function gt({
712
785
  "data-tip": "More",
713
786
  "data-watch-team-menu": !0,
714
787
  className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 dark:text-slate-400 dark:hover:bg-white/[0.06] dark:hover:text-slate-200",
715
- children: /* @__PURE__ */ e(We, { className: "h-4 w-4" })
788
+ children: /* @__PURE__ */ e(Ke, { className: "h-4 w-4" })
716
789
  }
717
790
  ) }),
718
- /* @__PURE__ */ u(Je, { align: "end", className: "w-52 p-1", children: [
791
+ /* @__PURE__ */ u(et, { align: "end", className: "w-52 p-1", children: [
719
792
  n.can_take_over && /* @__PURE__ */ u(
720
793
  "button",
721
794
  {
722
795
  type: "button",
723
- className: l,
796
+ className: c,
724
797
  onClick: () => {
725
- r(!1), t.takeOverTeam(n.id).then((m) => m && t.setDock({ tab: `team:${m}` })).catch(() => {
798
+ s(!1), t.takeOverTeam(n.id).then((p) => p && t.setDock({ tab: `team:${p}` })).catch(() => {
726
799
  });
727
800
  },
728
801
  children: [
729
- /* @__PURE__ */ e(qe, { "aria-hidden": !0, className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
802
+ /* @__PURE__ */ e(Ae, { "aria-hidden": !0, className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
730
803
  "Take ownership"
731
804
  ]
732
805
  }
@@ -735,46 +808,46 @@ function gt({
735
808
  "button",
736
809
  {
737
810
  type: "button",
738
- className: l,
811
+ className: c,
739
812
  onClick: () => {
740
- r(!1), i();
813
+ s(!1), o();
741
814
  },
742
815
  children: [
743
- /* @__PURE__ */ e(Ke, { "aria-hidden": !0, className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
816
+ /* @__PURE__ */ e(Ee, { "aria-hidden": !0, className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
744
817
  "Rename or change people"
745
818
  ]
746
819
  }
747
820
  ),
748
- p && /* @__PURE__ */ u(
749
- ue,
821
+ m && /* @__PURE__ */ u(
822
+ he,
750
823
  {
751
824
  onConfirm: () => {
752
- r(!1), t.setDock({ tab: "watching" }), t.leaveTeam(n.id).catch(() => {
825
+ s(!1), t.setDock({ tab: "watching" }), t.leaveTeam(n.id).catch(() => {
753
826
  });
754
827
  },
755
828
  title: "Leave this shared list",
756
829
  confirmLabel: "Leave the list?",
757
- className: l,
758
- armedClassName: `${l} bg-amber-50 font-semibold text-amber-800 dark:bg-amber-500/15 dark:text-amber-200`,
830
+ className: c,
831
+ armedClassName: `${c} bg-amber-50 font-semibold text-amber-800 dark:bg-amber-500/15 dark:text-amber-200`,
759
832
  children: [
760
- /* @__PURE__ */ e(Ee, { "aria-hidden": !0, className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
833
+ /* @__PURE__ */ e(Oe, { "aria-hidden": !0, className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
761
834
  "Leave"
762
835
  ]
763
836
  }
764
837
  ),
765
- s && /* @__PURE__ */ u(
766
- ue,
838
+ r && /* @__PURE__ */ u(
839
+ he,
767
840
  {
768
841
  onConfirm: () => {
769
- r(!1), t.setDock({ tab: "watching" }), t.deleteTeam(n.id).catch(() => {
842
+ s(!1), t.setDock({ tab: "watching" }), t.deleteTeam(n.id).catch(() => {
770
843
  });
771
844
  },
772
845
  title: "Delete this shared list",
773
846
  confirmLabel: "Delete it for everyone?",
774
- className: l,
775
- armedClassName: `${l} bg-red-50 font-semibold text-red-700 dark:bg-red-500/15 dark:text-red-300`,
847
+ className: c,
848
+ armedClassName: `${c} bg-red-50 font-semibold text-red-700 dark:bg-red-500/15 dark:text-red-300`,
776
849
  children: [
777
- /* @__PURE__ */ e(Ae, { "aria-hidden": !0, className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
850
+ /* @__PURE__ */ e(Pe, { "aria-hidden": !0, className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
778
851
  "Delete"
779
852
  ]
780
853
  }
@@ -782,42 +855,42 @@ function gt({
782
855
  ] })
783
856
  ] });
784
857
  }
785
- function bt(t, n) {
786
- const o = n == null ? void 0 : n.toLowerCase(), i = t.members.map((a) => a.id.toLowerCase() === o ? "you" : a.name);
787
- return i.sort((a, r) => a === "you" ? -1 : r === "you" ? 1 : 0), i.length === 0 ? "Nobody else is on it yet" : i.length === 1 ? i[0] === "you" ? "Only you" : `${i[0]}` : i.length <= 3 ? `${i.slice(0, -1).join(", ")} and ${i[i.length - 1]}`.replace(/^you/, "You") : `${i.slice(0, 2).join(", ")} and ${i.length - 2} others`.replace(/^you/, "You");
858
+ function yt(t, n) {
859
+ const i = n == null ? void 0 : n.toLowerCase(), o = t.members.map((a) => a.id.toLowerCase() === i ? "you" : a.name);
860
+ return o.sort((a, s) => a === "you" ? -1 : s === "you" ? 1 : 0), o.length === 0 ? "Nobody else is on it yet" : o.length === 1 ? o[0] === "you" ? "Only you" : `${o[0]}` : o.length <= 3 ? `${o.slice(0, -1).join(", ")} and ${o[o.length - 1]}`.replace(/^you/, "You") : `${o.slice(0, 2).join(", ")} and ${o.length - 2} others`.replace(/^you/, "You");
788
861
  }
789
- function xt({
862
+ function vt({
790
863
  actions: t,
791
864
  team: n,
792
- meId: o,
793
- onEdit: i
865
+ meId: i,
866
+ onEdit: o
794
867
  }) {
795
- const a = V(), r = n.pins.map((h) => h.key).join("|"), l = O({
796
- queryKey: C.team(n.id, r),
797
- queryFn: () => a.request(W(`/watch-list/teams/${encodeURIComponent(n.id)}/rows`)).then((h) => h.data),
868
+ const a = V(), s = n.pins.map((h) => h.key).join("|"), c = I({
869
+ queryKey: $.team(n.id, s),
870
+ queryFn: () => a.request(K(`/watch-list/teams/${encodeURIComponent(n.id)}/rows`)).then((h) => h.data),
798
871
  enabled: !!a && n.pins.length > 0,
799
872
  staleTime: 6e4,
800
873
  placeholderData: (h) => h
801
- }), s = !!o && n.owner.id.toLowerCase() === o.toLowerCase(), p = n.is_member || n.can_manage, m = D(() => {
874
+ }), r = !!i && n.owner.id.toLowerCase() === i.toLowerCase(), m = n.is_member || n.can_manage, p = T(() => {
802
875
  var g;
803
- const h = new Map((((g = l.data) == null ? void 0 : g.rows) ?? []).map((f) => [f.key, f]));
804
- return ke(
805
- n.pins.map((f) => h.get(f.key)).filter((f) => !!f),
876
+ const h = new Map((((g = c.data) == null ? void 0 : g.rows) ?? []).map((b) => [b.key, b]));
877
+ return ye(
878
+ n.pins.map((b) => h.get(b.key)).filter((b) => !!b),
806
879
  n.pins
807
880
  );
808
- }, [l.data, n.pins]), b = m.filter((h) => {
881
+ }, [c.data, n.pins]), f = p.filter((h) => {
809
882
  var g;
810
883
  return (g = h.change) == null ? void 0 : g.changed;
811
884
  }).map((h) => h.key);
812
885
  return /* @__PURE__ */ u("div", { "data-watch-team": n.id, children: [
813
886
  /* @__PURE__ */ u("div", { className: "flex items-start gap-2 border-b border-slate-100 px-4 py-2.5 dark:border-white/[0.05]", children: [
814
887
  /* @__PURE__ */ u("div", { className: "min-w-0 flex-1", children: [
815
- /* @__PURE__ */ e("p", { className: "truncate text-[11.5px] text-slate-600 dark:text-slate-300", children: bt(n, o) }),
816
- /* @__PURE__ */ e("p", { className: "truncate text-[11px] text-slate-500 dark:text-slate-400", children: s && !n.owner_gone ? "Your shared list" : `Made by ${n.owner.name}` })
888
+ /* @__PURE__ */ e("p", { className: "truncate text-[11.5px] text-slate-600 dark:text-slate-300", children: yt(n, i) }),
889
+ /* @__PURE__ */ e("p", { className: "truncate text-[11px] text-slate-500 dark:text-slate-400", children: r && !n.owner_gone ? "Your shared list" : `Made by ${n.owner.name}` })
817
890
  ] }),
818
891
  /* @__PURE__ */ u("div", { className: "flex shrink-0 items-center gap-0.5", children: [
819
- b.length > 0 && /* @__PURE__ */ e(Y, { label: "Mark all as seen", onClick: () => t.teamSeen(n.id), children: /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5" }) }),
820
- /* @__PURE__ */ e(gt, { actions: t, team: n, isOwner: s, onEdit: i })
892
+ f.length > 0 && /* @__PURE__ */ e(Y, { label: "Mark all as seen", onClick: () => t.teamSeen(n.id), children: /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5" }) }),
893
+ /* @__PURE__ */ e(kt, { actions: t, team: n, isOwner: r, onEdit: o })
821
894
  ] })
822
895
  ] }),
823
896
  n.owner_gone && /* @__PURE__ */ u(
@@ -833,55 +906,55 @@ function xt({
833
906
  ]
834
907
  }
835
908
  ),
836
- n.pins.length === 0 ? /* @__PURE__ */ e(I, { icon: /* @__PURE__ */ e(ee, { className: "h-4 w-4" }), title: "No records on this list yet", children: /* @__PURE__ */ e("p", { children: n.owner_gone ? "Records can be added again once the list has a new owner." : "Add a record from its page: the people icon beside the pin puts it on a shared list. Everyone here sees it, each as far as they can open it." }) }) : l.isError && !l.data ? /* @__PURE__ */ e(X, { error: l.error, onRetry: () => void l.refetch() }) : l.data ? m.length === 0 ? /* @__PURE__ */ e(I, { icon: /* @__PURE__ */ e(ee, { className: "h-4 w-4" }), title: "Nothing here you can open", children: /* @__PURE__ */ e("p", { children: "The records on this list are outside what you can see." }) }) : /* @__PURE__ */ e(
837
- ye,
909
+ n.pins.length === 0 ? /* @__PURE__ */ e(j, { icon: /* @__PURE__ */ e(te, { className: "h-4 w-4" }), title: "No records on this list yet", children: /* @__PURE__ */ e("p", { children: n.owner_gone ? "Records can be added again once the list has a new owner." : "Add a record from its page: the people icon beside the pin puts it on a shared list. Everyone here sees it, each as far as they can open it." }) }) : c.isError && !c.data ? /* @__PURE__ */ e(X, { error: c.error, onRetry: () => void c.refetch() }) : c.data ? p.length === 0 ? /* @__PURE__ */ e(j, { icon: /* @__PURE__ */ e(te, { className: "h-4 w-4" }), title: "Nothing here you can open", children: /* @__PURE__ */ e("p", { children: "The records on this list are outside what you can see." }) }) : /* @__PURE__ */ e(
910
+ ve,
838
911
  {
839
- rows: m,
912
+ rows: p,
840
913
  sortable: !1,
841
914
  label: `Records on ${n.name}`,
842
915
  onReorder: () => {
843
916
  },
844
917
  unpinLabel: "Take off this list",
845
- canRemove: p && !n.owner_gone,
846
- onUnpin: (h) => p && void t.teamUnpin(n.id, h.collection, h.id).catch(() => {
918
+ canRemove: m && !n.owner_gone,
919
+ onUnpin: (h) => m && void t.teamUnpin(n.id, h.collection, h.id).catch(() => {
847
920
  }),
848
921
  onSeen: (h) => {
849
- var g, f;
850
- (f = (g = m.find((_) => _.key === h)) == null ? void 0 : g.change) != null && f.changed && t.teamSeen(n.id, [h]);
922
+ var g, b;
923
+ (b = (g = p.find((_) => _.key === h)) == null ? void 0 : g.change) != null && b.changed && t.teamSeen(n.id, [h]);
851
924
  }
852
925
  }
853
- ) : /* @__PURE__ */ e(U, { n: Math.min(5, n.pins.length) }),
926
+ ) : /* @__PURE__ */ e(A, { n: Math.min(5, n.pins.length) }),
854
927
  /* @__PURE__ */ e(
855
- te,
928
+ ne,
856
929
  {
857
930
  removed: n.removed ?? [],
858
- canUndo: p && !n.owner_gone,
931
+ canUndo: m && !n.owner_gone,
859
932
  onUndo: (h) => void t.restoreRemoved(h.collection, h.id, n.id).catch(() => {
860
933
  })
861
934
  }
862
935
  )
863
936
  ] });
864
937
  }
865
- function te({
938
+ function ne({
866
939
  removed: t,
867
940
  onUndo: n,
868
- canUndo: o = !0
941
+ canUndo: i = !0
869
942
  }) {
870
- const [i, a] = q(!1);
943
+ const [o, a] = R(!1);
871
944
  return t.length === 0 ? null : /* @__PURE__ */ u("section", { className: "border-t border-slate-100 dark:border-white/[0.05]", "data-watch-removed": !0, children: [
872
945
  /* @__PURE__ */ u(
873
946
  "button",
874
947
  {
875
948
  type: "button",
876
- "aria-expanded": i,
877
- onClick: () => a((r) => !r),
949
+ "aria-expanded": o,
950
+ onClick: () => a((s) => !s),
878
951
  className: "flex w-full items-center gap-1.5 px-4 py-2.5 text-left text-[11.5px] font-medium text-slate-600 transition-colors hover:bg-slate-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan/60 dark:text-slate-300 dark:hover:bg-white/[0.03]",
879
952
  children: [
880
953
  /* @__PURE__ */ e(
881
- Re,
954
+ be,
882
955
  {
883
956
  "aria-hidden": !0,
884
- className: `h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform motion-reduce:transition-none ${i ? "rotate-90" : ""}`
957
+ className: `h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform motion-reduce:transition-none ${o ? "rotate-90" : ""}`
885
958
  }
886
959
  ),
887
960
  "Recently removed",
@@ -890,78 +963,78 @@ function te({
890
963
  ]
891
964
  }
892
965
  ),
893
- i && /* @__PURE__ */ e("ul", { className: "pb-2", "aria-label": "Recently removed", children: t.map((r) => /* @__PURE__ */ u(
966
+ o && /* @__PURE__ */ e("ul", { className: "pb-2", "aria-label": "Recently removed", children: t.map((s) => /* @__PURE__ */ u(
894
967
  "li",
895
968
  {
896
969
  className: "flex items-center gap-2 py-1.5 pl-9 pr-3",
897
970
  "data-watch-removed-row": !0,
898
971
  children: [
899
972
  /* @__PURE__ */ u("div", { className: "min-w-0 flex-1", children: [
900
- /* @__PURE__ */ e("p", { className: "truncate text-[12px] text-slate-700 dark:text-slate-200", children: r.title ?? `${r.collection} ${r.id}` }),
973
+ /* @__PURE__ */ e("p", { className: "truncate text-[12px] text-slate-700 dark:text-slate-200", children: s.title ?? `${s.collection} ${s.id}` }),
901
974
  /* @__PURE__ */ u("p", { className: "flex items-center gap-1 text-[11px] text-slate-500 dark:text-slate-400", children: [
902
975
  /* @__PURE__ */ e(
903
- Le,
976
+ We,
904
977
  {
905
978
  "aria-hidden": !0,
906
979
  className: "h-3 w-3 shrink-0 text-emerald-600 dark:text-emerald-400"
907
980
  }
908
981
  ),
909
982
  "Completed · removed ",
910
- ae(r.removed_at)
983
+ re(s.removed_at)
911
984
  ] })
912
985
  ] }),
913
- o && /* @__PURE__ */ u(
986
+ i && /* @__PURE__ */ u(
914
987
  "button",
915
988
  {
916
989
  type: "button",
917
- onClick: () => n(r),
918
- "aria-label": `Put ${r.title ?? "this record"} back on the list`,
990
+ onClick: () => n(s),
991
+ "aria-label": `Put ${s.title ?? "this record"} back on the list`,
919
992
  className: "inline-flex shrink-0 items-center gap-1 rounded-md border border-slate-200 px-2 py-1 text-[11.5px] font-medium text-slate-700 transition-colors hover:bg-slate-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 dark:border-white/[0.12] dark:text-slate-200 dark:hover:bg-white/[0.05]",
920
993
  children: [
921
- /* @__PURE__ */ e(Me, { "aria-hidden": !0, className: "h-3 w-3" }),
994
+ /* @__PURE__ */ e(qe, { "aria-hidden": !0, className: "h-3 w-3" }),
922
995
  "Undo"
923
996
  ]
924
997
  }
925
998
  )
926
999
  ]
927
1000
  },
928
- r.key
1001
+ s.key
929
1002
  )) })
930
1003
  ] });
931
1004
  }
932
- function wt({ data: t }) {
933
- const n = be();
1005
+ function Nt({ data: t }) {
1006
+ const n = xe();
934
1007
  if (t.waiting.isError && !t.waiting.data)
935
1008
  return /* @__PURE__ */ e(X, { error: t.waiting.error, onRetry: () => void t.waiting.refetch() });
936
- if (!t.waiting.data) return /* @__PURE__ */ e(U, {});
937
- const o = t.waiting.data;
938
- if (o.length === 0)
939
- return /* @__PURE__ */ e(I, { icon: /* @__PURE__ */ e(_e, { className: "h-4 w-4" }), title: "Nothing is waiting on others", children: /* @__PURE__ */ e("p", { children: "Records you raised show here while they sit on someone else’s step." }) });
940
- const i = o.map((a) => ({ collection: a.collection, itemId: a.id, title: a.title }));
1009
+ if (!t.waiting.data) return /* @__PURE__ */ e(A, {});
1010
+ const i = t.waiting.data;
1011
+ if (i.length === 0)
1012
+ return /* @__PURE__ */ e(j, { icon: /* @__PURE__ */ e(_e, { className: "h-4 w-4" }), title: "Nothing is waiting on others", children: /* @__PURE__ */ e("p", { children: "Records you raised show here while they sit on someone else’s step." }) });
1013
+ const o = i.map((a) => ({ collection: a.collection, itemId: a.id, title: a.title }));
941
1014
  return /* @__PURE__ */ e(
942
1015
  "ul",
943
1016
  {
944
1017
  className: "divide-y divide-slate-100 dark:divide-white/[0.05]",
945
1018
  "aria-label": "Waiting on others",
946
- children: o.map((a) => {
947
- const r = a.waiting_on.length === 0 ? null : a.waiting_on.length <= 2 ? a.waiting_on.map((l) => l.name).join(" and ") : `${a.waiting_on[0].name} and ${a.waiting_on.length - 1} others`;
1019
+ children: i.map((a) => {
1020
+ const s = a.waiting_on.length === 0 ? null : a.waiting_on.length <= 2 ? a.waiting_on.map((c) => c.name).join(" and ") : `${a.waiting_on[0].name} and ${a.waiting_on.length - 1} others`;
948
1021
  return /* @__PURE__ */ e("li", { "data-waiting-row": !0, children: /* @__PURE__ */ u(
949
1022
  "button",
950
1023
  {
951
1024
  type: "button",
952
- onClick: (l) => n({ collection: a.collection, itemId: a.id, title: a.title }, l, { list: i }),
1025
+ onClick: (c) => n({ collection: a.collection, itemId: a.id, title: a.title }, c, { list: o }),
953
1026
  className: "block w-full px-4 py-2.5 text-left transition-colors hover:bg-slate-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan/60 dark:hover:bg-white/[0.03]",
954
1027
  children: [
955
1028
  /* @__PURE__ */ e("span", { className: "block truncate text-[12.5px] font-medium text-slate-800 dark:text-slate-100", children: a.title }),
956
1029
  /* @__PURE__ */ u("span", { className: "mt-1 flex min-w-0 items-center gap-2", children: [
957
- /* @__PURE__ */ e(it, { state: a.state }),
958
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[11px] text-slate-500 dark:text-slate-400", children: r ? `With ${r}` : "" }),
1030
+ /* @__PURE__ */ e(dt, { state: a.state }),
1031
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[11px] text-slate-500 dark:text-slate-400", children: s ? `With ${s}` : "" }),
959
1032
  a.since && /* @__PURE__ */ e(
960
1033
  "span",
961
1034
  {
962
1035
  className: "shrink-0 text-[10.5px] tabular-nums text-slate-500 dark:text-slate-400",
963
1036
  "data-tip": `Waiting since ${new Date(a.since).toLocaleString()}`,
964
- children: ae(a.since)
1037
+ children: re(a.since)
965
1038
  }
966
1039
  )
967
1040
  ] })
@@ -972,33 +1045,33 @@ function wt({ data: t }) {
972
1045
  }
973
1046
  );
974
1047
  }
975
- function kt({ data: t }) {
976
- const n = V(), o = fe(), i = be(), a = t.mentions.data;
1048
+ function St({ data: t }) {
1049
+ const n = V(), i = fe(), o = xe(), a = t.mentions.data;
977
1050
  if (t.mentions.isError && !a)
978
1051
  return /* @__PURE__ */ e(X, { error: t.mentions.error, onRetry: () => void t.mentions.refetch() });
979
- if (!a) return /* @__PURE__ */ e(U, {});
1052
+ if (!a) return /* @__PURE__ */ e(A, {});
980
1053
  if (a.items.length === 0)
981
- return /* @__PURE__ */ e(I, { icon: /* @__PURE__ */ e(ge, { className: "h-4 w-4" }), title: "No mentions or replies", children: /* @__PURE__ */ e("p", { children: "When someone mentions you, or answers a comment of yours, it shows here for 30 days." }) });
982
- const r = (s) => {
1054
+ return /* @__PURE__ */ e(j, { icon: /* @__PURE__ */ e(ge, { className: "h-4 w-4" }), title: "No mentions or replies", children: /* @__PURE__ */ e("p", { children: "When someone mentions you, or answers a comment of yours, it shows here for 30 days." }) });
1055
+ const s = (r) => {
983
1056
  if (!n) return;
984
- const p = s.filter((h) => h.kind === "mention" && h.unread).map((h) => h.notification_id), m = s.some((h) => h.kind === "reply" && h.unread), b = new Set(s.map((h) => h.key));
985
- o.setQueryData(C.mentions, (h) => {
1057
+ const m = r.filter((h) => h.kind === "mention" && h.unread).map((h) => h.notification_id), p = r.some((h) => h.kind === "reply" && h.unread), f = new Set(r.map((h) => h.key));
1058
+ i.setQueryData($.mentions, (h) => {
986
1059
  if (!h) return h;
987
- const g = h.items.map((f) => b.has(f.key) ? { ...f, unread: !1 } : f);
988
- return { items: g, unread: g.filter((f) => f.unread).length };
989
- }), p.length > 0 && n.request(oe("/notifications/mark-read", { ids: p })).catch(() => {
990
- }), m && n.request(oe("/watch-list/replies-seen", {})).catch(() => {
1060
+ const g = h.items.map((b) => f.has(b.key) ? { ...b, unread: !1 } : b);
1061
+ return { items: g, unread: g.filter((b) => b.unread).length };
1062
+ }), m.length > 0 && n.request(oe("/notifications/mark-read", { ids: m })).catch(() => {
1063
+ }), p && n.request(oe("/watch-list/replies-seen", {})).catch(() => {
991
1064
  });
992
- }, l = a.items.filter((s) => s.unread);
993
- return /* @__PURE__ */ u(P, { children: [
994
- l.length > 0 && /* @__PURE__ */ e("div", { className: "flex justify-end px-3 pt-2", children: /* @__PURE__ */ u(
1065
+ }, c = a.items.filter((r) => r.unread);
1066
+ return /* @__PURE__ */ u(U, { children: [
1067
+ c.length > 0 && /* @__PURE__ */ e("div", { className: "flex justify-end px-3 pt-2", children: /* @__PURE__ */ u(
995
1068
  "button",
996
1069
  {
997
1070
  type: "button",
998
- onClick: () => r(l),
999
- className: "inline-flex items-center gap-1 rounded-md border border-slate-200 px-2 py-1 text-[11.5px] font-medium text-slate-600 transition-colors hover:bg-slate-50 hover:text-slate-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 dark:border-white/[0.12] dark:text-slate-300 dark:hover:bg-white/[0.05] dark:hover:text-slate-100",
1071
+ onClick: () => s(c),
1072
+ className: "inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11.5px] font-medium text-slate-600 transition-colors hover:bg-slate-100 hover:text-slate-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 dark:text-slate-300 dark:hover:bg-white/[0.06] dark:hover:text-slate-100",
1000
1073
  children: [
1001
- /* @__PURE__ */ e(ne, { "aria-hidden": !0, className: "h-3 w-3" }),
1074
+ /* @__PURE__ */ e(ae, { "aria-hidden": !0, className: "h-3 w-3" }),
1002
1075
  "Mark all read"
1003
1076
  ]
1004
1077
  }
@@ -1008,37 +1081,37 @@ function kt({ data: t }) {
1008
1081
  {
1009
1082
  className: "divide-y divide-slate-100 dark:divide-white/[0.05]",
1010
1083
  "aria-label": "Mentions and replies",
1011
- children: a.items.map((s) => {
1012
- var p;
1013
- return /* @__PURE__ */ e("li", { "data-mention-row": s.unread ? "unread" : "read", children: /* @__PURE__ */ u(
1084
+ children: a.items.map((r) => {
1085
+ var m;
1086
+ return /* @__PURE__ */ e("li", { "data-mention-row": r.unread ? "unread" : "read", children: /* @__PURE__ */ u(
1014
1087
  "button",
1015
1088
  {
1016
1089
  type: "button",
1017
- onClick: (m) => {
1018
- r([s]), s.collection && s.item && i({ collection: s.collection, itemId: s.item, title: s.title }, m);
1090
+ onClick: (p) => {
1091
+ s([r]), r.collection && r.item && o({ collection: r.collection, itemId: r.item, title: r.title }, p);
1019
1092
  },
1020
- className: `block w-full px-4 py-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan/60 ${s.unread ? "bg-sky-50 hover:bg-sky-100/70 dark:bg-nvr-cyan/[0.07] dark:hover:bg-nvr-cyan/[0.1]" : "hover:bg-slate-50 dark:hover:bg-white/[0.03]"}`,
1093
+ className: `block w-full px-4 py-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan/60 ${r.unread ? "bg-sky-50 hover:bg-sky-100/70 dark:bg-nvr-cyan/[0.07] dark:hover:bg-nvr-cyan/[0.1]" : "hover:bg-slate-50 dark:hover:bg-white/[0.03]"}`,
1021
1094
  children: [
1022
1095
  /* @__PURE__ */ u("span", { className: "flex items-center gap-1.5 text-[11.5px]", children: [
1023
- s.unread && /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "h-1.5 w-1.5 shrink-0 rounded-full bg-nvr-cyan" }),
1096
+ r.unread && /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "h-1.5 w-1.5 shrink-0 rounded-full bg-nvr-cyan" }),
1024
1097
  /* @__PURE__ */ u("span", { className: "min-w-0 flex-1 truncate text-slate-600 dark:text-slate-300", children: [
1025
- /* @__PURE__ */ e("span", { className: "font-medium text-slate-800 dark:text-slate-100", children: ((p = s.by) == null ? void 0 : p.name) ?? "Someone" }),
1098
+ /* @__PURE__ */ e("span", { className: "font-medium text-slate-800 dark:text-slate-100", children: ((m = r.by) == null ? void 0 : m.name) ?? "Someone" }),
1026
1099
  " ",
1027
- s.kind === "mention" ? "mentioned you" : "replied",
1028
- s.unread && /* @__PURE__ */ e("span", { className: "sr-only", children: " (new)" })
1100
+ r.kind === "mention" ? "mentioned you" : "replied",
1101
+ r.unread && /* @__PURE__ */ e("span", { className: "sr-only", children: " (new)" })
1029
1102
  ] }),
1030
- /* @__PURE__ */ e("span", { className: "shrink-0 tabular-nums text-slate-400 dark:text-slate-500", children: ae(s.at) })
1103
+ /* @__PURE__ */ e("span", { className: "shrink-0 tabular-nums text-slate-400 dark:text-slate-500", children: re(r.at) })
1031
1104
  ] }),
1032
- s.title && /* @__PURE__ */ e("span", { className: "mt-0.5 block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: s.title }),
1033
- s.text && /* @__PURE__ */ e("span", { className: "mt-0.5 line-clamp-2 text-[12px] leading-snug text-slate-500 dark:text-slate-400", children: s.text })
1105
+ r.title && /* @__PURE__ */ e("span", { className: "mt-0.5 block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: r.title }),
1106
+ r.text && /* @__PURE__ */ e("span", { className: "mt-0.5 line-clamp-2 text-[12px] leading-snug text-slate-500 dark:text-slate-400", children: r.text })
1034
1107
  ]
1035
1108
  }
1036
- ) }, s.key);
1109
+ ) }, r.key);
1037
1110
  })
1038
1111
  }
1039
1112
  )
1040
1113
  ] });
1041
1114
  }
1042
1115
  export {
1043
- Ot as WatchDock
1116
+ jt as WatchDock
1044
1117
  };