@nivaro/react 0.3.41 → 0.3.42

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 (96) hide show
  1. package/dist/components/LayoutForm.js +100 -98
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +644 -15
  5. package/dist/index.js +814 -775
  6. package/dist/shared/components/ActivityEntry.js +154 -0
  7. package/dist/shared/components/AudienceConfirmPanel.js +98 -0
  8. package/dist/shared/components/BackgroundRunOffer.js +43 -31
  9. package/dist/shared/components/BroadcastView.js +225 -204
  10. package/dist/shared/components/CollectionBrowserView.js +3924 -3584
  11. package/dist/shared/components/ConfigHistory.js +153 -0
  12. package/dist/shared/components/ConfigReadBack.js +65 -0
  13. package/dist/shared/components/DataTable.js +379 -346
  14. package/dist/shared/components/ForceReloadBanner.js +47 -40
  15. package/dist/shared/components/IdleReloadWatcher.js +69 -0
  16. package/dist/shared/components/ItemEditForm.js +4041 -3853
  17. package/dist/shared/components/MyWorkView.js +278 -213
  18. package/dist/shared/components/NotificationBell.js +130 -121
  19. package/dist/shared/components/ProfileView.js +776 -1003
  20. package/dist/shared/components/RecentRecordsRail.js +34 -16
  21. package/dist/shared/components/RecordReadView.js +500 -477
  22. package/dist/shared/components/Skeletons.js +199 -0
  23. package/dist/shared/components/SlowNotice.js +63 -0
  24. package/dist/shared/components/Term.js +23 -0
  25. package/dist/shared/components/WidgetSlot.js +350 -353
  26. package/dist/shared/components/access/PermissionSummary.js +106 -0
  27. package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
  28. package/dist/shared/components/chat/ChatPanel.js +902 -886
  29. package/dist/shared/components/chat/MemberPaging.js +70 -0
  30. package/dist/shared/components/chat/RoomParts.js +147 -117
  31. package/dist/shared/components/chat/ScreenClip.js +73 -69
  32. package/dist/shared/components/chat/chat-core.js +449 -396
  33. package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
  34. package/dist/shared/components/help-videos/api.js +2 -5
  35. package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
  36. package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
  37. package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
  38. package/dist/shared/components/imports/RunDetailSheet.js +222 -227
  39. package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
  40. package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
  41. package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
  42. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
  43. package/dist/shared/components/item-edit/FieldComments.js +212 -0
  44. package/dist/shared/components/item-edit/FieldRow.js +340 -336
  45. package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
  46. package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
  47. package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
  48. package/dist/shared/components/item-edit/field-comments-context.js +6 -0
  49. package/dist/shared/components/item-edit/field-sources.js +33 -0
  50. package/dist/shared/components/item-edit/rule-hidden.js +30 -0
  51. package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
  52. package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
  53. package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
  54. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
  55. package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
  56. package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
  57. package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
  58. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  59. package/dist/shared/components/list/CopyListLinkButton.js +41 -0
  60. package/dist/shared/components/list/InlineEdit.js +363 -0
  61. package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
  62. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
  63. package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
  64. package/dist/shared/components/notifications/TestMyRules.js +137 -0
  65. package/dist/shared/components/notifications/changes-lines.js +24 -0
  66. package/dist/shared/components/notifications/why-lines.js +64 -0
  67. package/dist/shared/components/panels/CommentPanel.js +316 -281
  68. package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
  69. package/dist/shared/components/panels/PipelinePanel.js +201 -196
  70. package/dist/shared/components/panels/RevisionsPanel.js +496 -479
  71. package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
  72. package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
  73. package/dist/shared/components/profile/PersonDidPanel.js +188 -0
  74. package/dist/shared/components/profile/PersonProfile.js +57 -52
  75. package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
  76. package/dist/shared/hooks/useSlowReason.js +39 -0
  77. package/dist/shared/lib/activity-sentence.js +670 -0
  78. package/dist/shared/lib/config-sentences.js +418 -0
  79. package/dist/shared/lib/core-glossary.js +229 -0
  80. package/dist/shared/lib/error-hints.js +159 -0
  81. package/dist/shared/lib/error-message.js +105 -0
  82. package/dist/shared/lib/error-toast.js +22 -0
  83. package/dist/shared/lib/field-comments.js +25 -0
  84. package/dist/shared/lib/filter-sentence.js +261 -0
  85. package/dist/shared/lib/glossary.js +55 -48
  86. package/dist/shared/lib/idle-reload.js +138 -0
  87. package/dist/shared/lib/layout-resolve.js +42 -29
  88. package/dist/shared/lib/list-inline-edit.js +190 -0
  89. package/dist/shared/lib/list-link.js +147 -0
  90. package/dist/shared/lib/prefetch.js +259 -106
  91. package/dist/shared/lib/record-ref.js +72 -0
  92. package/dist/shared/lib/reload-holds.js +25 -0
  93. package/dist/shared/lib/safe-error.js +52 -24
  94. package/dist/shared/lib/skeleton-shapes.js +72 -0
  95. package/dist/shared/lib/slow-reason.js +63 -0
  96. package/package.json +1 -1
@@ -1,148 +1,90 @@
1
- import { jsxs as t, jsx as e, Fragment as oe } from "react/jsx-runtime";
2
- import { readUser as Se, readUserCard as _e, updateUser as be, readMyScopes as qe, saveMyScopeDefaults as Ce, readItems as ne } from "@nivaro/sdk";
3
- import { useQueryClient as K, useQuery as w, useMutation as _ } from "@tanstack/react-query";
4
- import { Loader2 as xe, Camera as Pe, Building2 as Ae, Mail as Te, Phone as Oe, Clock as Fe, Undo2 as Le, Check as De, UserRound as Me, Filter as Ee, LogOut as Ke, ShieldCheck as Ie } from "lucide-react";
5
- import { useState as q, useMemo as $e, useRef as je } from "react";
6
- import { useNivaroClient as L, useItemEditAuth as ve } from "../context.js";
7
- import { get as D, patch as G, post as ae, put as Qe, del as Re } from "../lib/commands.js";
8
- import { playNotificationSound as ge } from "../lib/notification-sound.js";
9
- import { BRAND_ACCENT as se, parseThemeAccents as Ue, DEFAULT_THEME_ACCENTS as ye } from "../lib/theme-accents.js";
10
- import { announceLocalPrefs as le } from "../lib/user-sync.js";
11
- import { cn as R, setDisplayTimezone as ze } from "../lib/utils.js";
12
- import { CustomStatusEditor as Be, activeCustomStatus as He } from "./CustomStatusEditor.js";
13
- import { AgentsPanel as Ye } from "./profile/AgentsPanel.js";
14
- import { AiMemoryCard as We, AiHistoryCard as Ge } from "./profile/AiMemoryCard.js";
15
- import { BrowserPushCard as Je } from "./profile/BrowserPushCard.js";
16
- import { DelegationCard as Ve } from "./profile/DelegationCard.js";
17
- import { MailSuppressedPill as Ze } from "./profile/MailSuppressedPill.js";
18
- import { TeamLoadCard as Xe } from "./profile/PersonExtras.js";
19
- import { TeamsConnect as et } from "./profile/TeamsConnect.js";
20
- import { NotificationSourcesCard as tt } from "./NotificationSourcesCard.js";
21
- import { MyDefaultsCard as at } from "./profile/MyDefaultsCard.js";
22
- import { UserScopesCard as rt } from "./profile/PersonAccess.js";
23
- import { PersonProfile as nt } from "./profile/PersonProfile.js";
24
- import { Toggle as st, SectionCard as ie, Field as Y, ConfirmButton as fe } from "./profile/primitives.js";
25
- import { SimpleSelectXs as E } from "./ui/SimpleSelect.js";
26
- const lt = (i) => [i.first_name, i.last_name].filter(Boolean).join(" ") || (i.email ?? "Unknown"), ot = (i) => {
27
- var m, r;
28
- return (`${((m = i.first_name) == null ? void 0 : m[0]) ?? ""}${((r = i.last_name) == null ? void 0 : r[0]) ?? ""}` || (i.email ?? "?").slice(0, 2)).toUpperCase();
29
- }, te = [
30
- {
31
- key: "mentions",
32
- label: "Mentions",
33
- help: "Someone @-mentions you in a comment, note, or chat room."
34
- },
35
- {
36
- key: "workflow",
37
- label: "Workflow & approvals",
38
- help: "A record you own or follow moves state, needs your approval, is sent back, or an approval chain reaches your step. Also support requests you work on the desk (new, assigned, replied)."
39
- },
40
- {
41
- key: "sla",
42
- label: "SLA & escalations",
43
- help: "A record you own is nearing or past its SLA, and escalation-ladder notices as they climb. SLA escalations always email immediately."
44
- },
45
- {
46
- key: "watch",
47
- label: "Watches",
48
- help: "Something you explicitly watch fired: field watches, per-record subscriptions, and watched stock parts (Stock Planning)."
49
- },
50
- {
51
- key: "alerts",
52
- label: "Alerts",
53
- help: "Threshold alerts you subscribe to: metric alert rules, per-record alert definitions, report alerts, and the alert digest."
54
- },
55
- {
56
- key: "anomaly",
57
- label: "Anomaly detections",
58
- help: "Anomaly rules you created flag an outlier, spike, or duplicate pattern."
59
- },
60
- {
61
- key: "reports",
62
- label: "Reports",
63
- help: "Scheduled report emails, Report Studio subscription digests, and saved-view change digests."
64
- },
65
- {
66
- key: "integrations",
67
- label: "Integrations",
68
- help: "A partner system was not told something about your record, a send is still unanswered, or an integration alert you turned on in the Integrations console fired."
69
- },
70
- {
71
- key: "huddle",
72
- label: "Huddles & calls",
73
- help: "Someone calls you in a huddle or adds you to one, and reminders for huddles you were invited to. Push is what rings a closed tab."
74
- },
75
- {
76
- key: "chaos",
77
- label: "Chaos drills",
78
- help: "Chaos Monkey drills starting and ending, and pushes about drills you started or take part in (with a Stop button). Only administrators and chaos operators get these."
79
- },
80
- {
81
- key: "system",
82
- label: "System & digests",
83
- help: "Maintenance windows, failing monitors, import results, updates on support requests you raised, and the daily action summary itself. Maintenance and monitor failures always email immediately."
84
- },
85
- {
86
- key: "other",
87
- label: "Everything else",
88
- help: "Any notification that does not fit a category above — direct messages from other users, access requests, task assignments."
89
- }
90
- ];
91
- function it() {
92
- const i = L(), m = K(), { data: r = [] } = w({
1
+ import { jsxs as a, jsx as e, Fragment as X } from "react/jsx-runtime";
2
+ import { readUser as he, readUserCard as be, updateUser as oe, readMyScopes as xe, saveMyScopeDefaults as ge, readItems as te } from "@nivaro/sdk";
3
+ import { useQueryClient as K, useQuery as v, useMutation as w } from "@tanstack/react-query";
4
+ import { Loader2 as ie, Camera as fe, Building2 as ye, Mail as ve, Phone as ke, Clock as Ne, Undo2 as we, Check as Se, UserRound as _e, Filter as Ce, LogOut as qe, ShieldCheck as Pe } from "lucide-react";
5
+ import { useRef as ue, useEffect as Te, useState as C, useMemo as Ae } from "react";
6
+ import { useNivaroClient as A, useItemEditAuth as pe } from "../context.js";
7
+ import { get as T, patch as G, post as ee, put as Fe, del as Oe } from "../lib/commands.js";
8
+ import { playNotificationSound as de } from "../lib/notification-sound.js";
9
+ import { BRAND_ACCENT as ae, parseThemeAccents as De, DEFAULT_THEME_ACCENTS as ce } from "../lib/theme-accents.js";
10
+ import { announceLocalPrefs as re } from "../lib/user-sync.js";
11
+ import { cn as Q, setDisplayTimezone as Ke } from "../lib/utils.js";
12
+ import { CustomStatusEditor as Le, activeCustomStatus as Me } from "./CustomStatusEditor.js";
13
+ import { mergeNotifyRulesClient as Re, NOTIFY_RULE_CATS as je, NotificationRulesEditor as Ee } from "./notifications/NotificationRulesEditor.js";
14
+ import { TestMyRules as Ie } from "./notifications/TestMyRules.js";
15
+ import { AgentsPanel as Qe } from "./profile/AgentsPanel.js";
16
+ import { AiMemoryCard as Ue, AiHistoryCard as $e } from "./profile/AiMemoryCard.js";
17
+ import { BrowserPushCard as ze } from "./profile/BrowserPushCard.js";
18
+ import { DelegationCard as Be } from "./profile/DelegationCard.js";
19
+ import { MailSuppressedPill as He } from "./profile/MailSuppressedPill.js";
20
+ import { PersonDidPanel as Ye } from "./profile/PersonDidPanel.js";
21
+ import { TeamLoadCard as We } from "./profile/PersonExtras.js";
22
+ import { TeamsConnect as Ge } from "./profile/TeamsConnect.js";
23
+ import { NotificationSourcesCard as Je } from "./NotificationSourcesCard.js";
24
+ import { MyDefaultsCard as Ve } from "./profile/MyDefaultsCard.js";
25
+ import { UserScopesCard as Ze } from "./profile/PersonAccess.js";
26
+ import { PersonProfile as Xe } from "./profile/PersonProfile.js";
27
+ import { Toggle as et, SectionCard as ne, Field as H, ConfirmButton as me } from "./profile/primitives.js";
28
+ import { SimpleSelectXs as U } from "./ui/SimpleSelect.js";
29
+ const tt = (s) => [s.first_name, s.last_name].filter(Boolean).join(" ") || (s.email ?? "Unknown"), at = (s) => {
30
+ var u, t;
31
+ return (`${((u = s.first_name) == null ? void 0 : u[0]) ?? ""}${((t = s.last_name) == null ? void 0 : t[0]) ?? ""}` || (s.email ?? "?").slice(0, 2)).toUpperCase();
32
+ }, rt = je;
33
+ function nt() {
34
+ const s = A(), u = K(), { data: t = [] } = v({
93
35
  queryKey: ["nvr-profile-fields"],
94
- queryFn: () => i.request(D("/profile-fields/mine")).then((n) => n.data ?? []).catch(() => [])
95
- }), [d, o] = q(null), l = _({
96
- mutationFn: (n) => i.request(Qe("/profile-fields/mine", { values: n })),
36
+ queryFn: () => s.request(T("/profile-fields/mine")).then((r) => r.data ?? []).catch(() => [])
37
+ }), [i, o] = C(null), l = w({
38
+ mutationFn: (r) => s.request(Fe("/profile-fields/mine", { values: r })),
97
39
  onSuccess: () => {
98
- o(null), m.invalidateQueries({ queryKey: ["nvr-profile-fields"] });
40
+ o(null), u.invalidateQueries({ queryKey: ["nvr-profile-fields"] });
99
41
  }
100
42
  });
101
- if (r.length === 0) return null;
102
- const s = d ?? Object.fromEntries(r.map((n) => [n.key, n.value ?? ""])), u = (n) => Array.isArray(n) ? n.map(String) : Array.isArray(n == null ? void 0 : n.choices) ? n.choices.map(
103
- (b) => typeof b == "object" && b != null ? String(b.value ?? "") : String(b)
43
+ if (t.length === 0) return null;
44
+ const c = i ?? Object.fromEntries(t.map((r) => [r.key, r.value ?? ""])), m = (r) => Array.isArray(r) ? r.map(String) : Array.isArray(r == null ? void 0 : r.choices) ? r.choices.map(
45
+ (h) => typeof h == "object" && h != null ? String(h.value ?? "") : String(h)
104
46
  ) : [];
105
- return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
106
- /* @__PURE__ */ t("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
47
+ return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
48
+ /* @__PURE__ */ a("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
107
49
  /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Profile fields" }),
108
50
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Extra details your organization tracks about people." })
109
51
  ] }),
110
- /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-3 p-4 sm:grid-cols-2", children: r.map((n) => /* @__PURE__ */ t("div", { children: [
111
- /* @__PURE__ */ t("p", { className: "mb-1 text-[11px] font-medium text-slate-500", children: [
112
- n.label,
113
- n.required && /* @__PURE__ */ e("span", { className: "ml-0.5 text-red-500", children: "*" })
52
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-3 p-4 sm:grid-cols-2", children: t.map((r) => /* @__PURE__ */ a("div", { children: [
53
+ /* @__PURE__ */ a("p", { className: "mb-1 text-[11px] font-medium text-slate-500", children: [
54
+ r.label,
55
+ r.required && /* @__PURE__ */ e("span", { className: "ml-0.5 text-red-500", children: "*" })
114
56
  ] }),
115
- n.type === "boolean" ? /* @__PURE__ */ e(
116
- E,
57
+ r.type === "boolean" ? /* @__PURE__ */ e(
58
+ U,
117
59
  {
118
- value: s[n.key] || "false",
60
+ value: c[r.key] || "false",
119
61
  options: [
120
62
  { value: "true", label: "Yes" },
121
63
  { value: "false", label: "No" }
122
64
  ],
123
- onChange: (b) => o({ ...s, [n.key]: b })
65
+ onChange: (h) => o({ ...c, [r.key]: h })
124
66
  }
125
- ) : n.type === "select" ? /* @__PURE__ */ e(
126
- E,
67
+ ) : r.type === "select" ? /* @__PURE__ */ e(
68
+ U,
127
69
  {
128
- value: s[n.key] || "",
70
+ value: c[r.key] || "",
129
71
  options: [
130
72
  { value: "", label: "—" },
131
- ...u(n.options).map((b) => ({ value: b, label: b }))
73
+ ...m(r.options).map((h) => ({ value: h, label: h }))
132
74
  ],
133
- onChange: (b) => o({ ...s, [n.key]: b })
75
+ onChange: (h) => o({ ...c, [r.key]: h })
134
76
  }
135
77
  ) : /* @__PURE__ */ e(
136
78
  "input",
137
79
  {
138
- type: n.type === "number" ? "number" : n.type === "date" ? "date" : "text",
139
- value: s[n.key] ?? "",
140
- onChange: (b) => o({ ...s, [n.key]: b.target.value }),
80
+ type: r.type === "number" ? "number" : r.type === "date" ? "date" : "text",
81
+ value: c[r.key] ?? "",
82
+ onChange: (h) => o({ ...c, [r.key]: h.target.value }),
141
83
  className: "h-8 w-full rounded-md border border-slate-200 bg-background px-2 text-[12.5px] dark:border-border"
142
84
  }
143
85
  )
144
- ] }, n.key)) }),
145
- d && /* @__PURE__ */ t("div", { className: "flex justify-end gap-2 border-t border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
86
+ ] }, r.key)) }),
87
+ i && /* @__PURE__ */ a("div", { className: "flex justify-end gap-2 border-t border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
146
88
  /* @__PURE__ */ e(
147
89
  "button",
148
90
  {
@@ -157,7 +99,7 @@ function it() {
157
99
  {
158
100
  type: "button",
159
101
  disabled: l.isPending,
160
- onClick: () => l.mutate(s),
102
+ onClick: () => l.mutate(c),
161
103
  className: "h-7 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white disabled:opacity-50",
162
104
  children: l.isPending ? "Saving…" : "Save"
163
105
  }
@@ -165,279 +107,211 @@ function it() {
165
107
  ] })
166
108
  ] });
167
109
  }
168
- function dt() {
169
- var me, pe;
170
- const i = L(), m = K(), { data: r } = w({
110
+ function st() {
111
+ var Y, W, se;
112
+ const s = A(), u = K(), { data: t } = v({
171
113
  queryKey: ["nvr-profile-prefs"],
172
- queryFn: () => i.request(D("/users/me")).then((a) => {
173
- var p;
174
- return ((p = a.data) == null ? void 0 : p.preferences) ?? {};
114
+ queryFn: () => s.request(T("/users/me")).then((n) => {
115
+ var b;
116
+ return ((b = n.data) == null ? void 0 : b.preferences) ?? {};
175
117
  })
176
- }), { data: d } = w({
118
+ }), { data: i } = v({
177
119
  queryKey: ["nvr-profile-teams"],
178
- queryFn: () => i.request(D("/users/me")).then((a) => {
179
- var p, x;
120
+ queryFn: () => s.request(T("/users/me")).then((n) => {
121
+ var b, N;
180
122
  return {
181
- available: ((p = a.data) == null ? void 0 : p.teams_available) === !0,
182
- link: ((x = a.data) == null ? void 0 : x.teams_link) ?? null
123
+ available: ((b = n.data) == null ? void 0 : b.teams_available) === !0,
124
+ link: ((N = n.data) == null ? void 0 : N.teams_link) ?? null
183
125
  };
184
126
  })
185
- }), o = (d == null ? void 0 : d.available) === !0, l = ((me = d == null ? void 0 : d.link) == null ? void 0 : me.status) === "active", s = (r == null ? void 0 : r.notification_prefs) ?? {}, u = (r == null ? void 0 : r.email_digest) === "daily" ? "daily" : "instant", n = (a) => {
186
- var p, x;
187
- return ((x = (p = s.matrix) == null ? void 0 : p[a]) == null ? void 0 : x.email) ?? u;
188
- }, [b, h] = q(null), [C, N] = q(null), T = b ?? s.quiet_start ?? "", v = C ?? s.quiet_end ?? "", O = _({
189
- mutationFn: (a) => i.request(G("/users/me/preferences", { notification_prefs: a })),
127
+ }), o = (i == null ? void 0 : i.available) === !0, l = ((Y = i == null ? void 0 : i.link) == null ? void 0 : Y.status) === "active", c = ue(null), m = t != null;
128
+ Te(() => {
129
+ var n;
130
+ !m || typeof window > "u" || window.location.hash === "#notification-rules" && ((n = c.current) == null || n.scrollIntoView({ block: "start", behavior: "smooth" }));
131
+ }, [m]);
132
+ const r = (t == null ? void 0 : t.notification_prefs) ?? {}, { data: h } = v({
133
+ queryKey: ["nvr-my-rule-defaults"],
134
+ queryFn: () => s.request(T("/notifications/my-rule-defaults")).then((n) => n.data).catch(() => null),
135
+ staleTime: 6e4
136
+ }), p = (t == null ? void 0 : t.email_digest) === "daily" ? "daily" : "instant", S = Re(r, h != null && h.role ? h.rules : null), k = (n) => {
137
+ var b, N, B, le;
138
+ return ((N = (b = r.matrix) == null ? void 0 : b[n]) == null ? void 0 : N.email) ?? (p === "daily" ? "daily" : ((le = (B = S.matrix) == null ? void 0 : B[n]) == null ? void 0 : le.email) ?? p);
139
+ }, F = w({
140
+ mutationFn: (n) => s.request(G("/users/me/preferences", { notification_prefs: n })),
190
141
  onSuccess: () => {
191
- m.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), le(["notification_prefs"]);
142
+ u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), re(["notification_prefs"]);
192
143
  }
193
- }), A = _({
194
- mutationFn: (a) => i.request(G("/users/me/preferences", a)),
195
- onSuccess: (a, p) => {
196
- m.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), le(Object.keys(p));
144
+ }), f = w({
145
+ mutationFn: (n) => s.request(G("/users/me/preferences", n)),
146
+ onSuccess: (n, b) => {
147
+ u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), re(Object.keys(b));
197
148
  }
198
- }), [S, f] = q(null), z = _({
199
- mutationFn: (a) => i.request(ae("/notifications/rules-preview", { notification_prefs: a })),
200
- onSuccess: (a) => f({
201
- total: a.data.total_notifications,
202
- current: a.data.current,
203
- proposed: a.data.proposed
149
+ }), [_, O] = C(null), q = w({
150
+ mutationFn: (n) => s.request(ee("/notifications/rules-preview", { notification_prefs: n })),
151
+ onSuccess: (n) => O({
152
+ total: n.data.total_notifications,
153
+ current: n.data.current,
154
+ proposed: n.data.proposed
204
155
  })
205
- }), P = (a) => {
206
- const p = {
207
- quiet_start: a.quiet_start ?? (T || void 0),
208
- quiet_end: a.quiet_end ?? (v || void 0),
209
- matrix: a.matrix ?? s.matrix ?? {},
210
- escalation: a.escalation ?? s.escalation ?? {},
156
+ }), g = (n) => {
157
+ const b = {
158
+ ...n,
211
159
  // Kept as-is: "mute 1h" said to the bot lives here, and a save must not wipe it.
212
- ...s.teams_muted_until ? { teams_muted_until: s.teams_muted_until } : {}
160
+ ...r.teams_muted_until ? { teams_muted_until: r.teams_muted_until } : {}
213
161
  };
214
- z.mutate(p), O.mutate(p);
215
- }, y = (r == null ? void 0 : r.notification_sounds) ?? {}, $ = (a, p) => {
216
- const x = { ...y };
217
- p === "default" ? delete x[a] : x[a] = p, p !== "default" && ge(p, { preview: !0 }), A.mutate({ notification_sounds: Object.keys(x).length ? x : null });
218
- }, { data: U } = w({
162
+ q.mutate(b), F.mutate(b);
163
+ }, $ = (n) => g({ ...r, ...n }), L = (t == null ? void 0 : t.notification_sounds) ?? {}, x = (n, b) => {
164
+ const N = { ...L };
165
+ b === "default" ? delete N[n] : N[n] = b, b !== "default" && de(b, { preview: !0 }), f.mutate({ notification_sounds: Object.keys(N).length ? N : null });
166
+ }, { data: R } = v({
219
167
  queryKey: ["nvr-noise-suggestions"],
220
- queryFn: () => i.request(D("/notifications/noise-suggestions")).then((a) => a.data ?? []),
168
+ queryFn: () => s.request(T("/notifications/noise-suggestions")).then((n) => n.data ?? []),
221
169
  staleTime: 6e5
222
- }), [j, c] = q({}), [k, F] = q(() => {
170
+ }), [j, E] = C({}), [d, y] = C(() => {
223
171
  try {
224
- const a = JSON.parse(localStorage.getItem("nvr-noise-dismissed") ?? "null");
225
- return a && Date.now() - a.at < 30 * 864e5 ? a.cats : [];
172
+ const n = JSON.parse(localStorage.getItem("nvr-noise-dismissed") ?? "null");
173
+ return n && Date.now() - n.at < 30 * 864e5 ? n.cats : [];
226
174
  } catch {
227
175
  return [];
228
176
  }
229
- }), J = (a) => {
230
- const p = [...k, a];
231
- F(p);
177
+ }), P = (n) => {
178
+ const b = [...d, n];
179
+ y(b);
232
180
  try {
233
- localStorage.setItem("nvr-noise-dismissed", JSON.stringify({ at: Date.now(), cats: p }));
181
+ localStorage.setItem("nvr-noise-dismissed", JSON.stringify({ at: Date.now(), cats: b }));
234
182
  } catch {
235
183
  }
236
- }, M = (a, p, x) => {
237
- var he;
238
- const g = { ...((he = s.escalation) == null ? void 0 : he[a]) ?? {} };
239
- x ? g[p] = x : delete g[p];
240
- const H = { ...s.escalation ?? {} };
241
- Object.keys(g).length ? H[a] = g : delete H[a], P({ escalation: H });
242
- }, W = [
243
- { value: "", label: "never" },
244
- { value: "15", label: "15 min" },
245
- { value: "60", label: "1 hour" },
246
- { value: "240", label: "4 hours" },
247
- { value: "480", label: "8 hours" },
248
- { value: "1440", label: "1 day" }
249
- ], Q = (a, p) => {
250
- var g;
251
- const x = ((g = s.matrix) == null ? void 0 : g[a]) ?? { inapp: !0, push: !0 };
252
- P({
253
- matrix: { ...s.matrix ?? {}, [a]: { ...x, [p]: x[p] === !1 } }
254
- });
255
- }, B = (a) => {
256
- var x;
257
- const p = ((x = s.matrix) == null ? void 0 : x[a]) ?? { inapp: !0, push: !0 };
258
- P({ matrix: { ...s.matrix ?? {}, [a]: { ...p, teams: p.teams !== !0 } } });
259
- }, V = (a, p) => {
260
- var g;
261
- const x = ((g = s.matrix) == null ? void 0 : g[a]) ?? { inapp: !0, push: !0 };
262
- P({ matrix: { ...s.matrix ?? {}, [a]: { ...x, email: p } } });
263
- }, Z = (a) => {
264
- var g;
265
- const p = ((g = s.matrix) == null ? void 0 : g[a]) ?? { inapp: !0, push: !0 }, x = { ...p };
266
- p.quiet_override ? delete x.quiet_override : x.quiet_override = !0, P({ matrix: { ...s.matrix ?? {}, [a]: x } });
267
- }, X = !!(T && v), ee = (a) => {
268
- var x;
269
- const p = {};
270
- for (const g of te)
271
- p[g.key] = { ...((x = s.matrix) == null ? void 0 : x[g.key]) ?? { inapp: !0, push: !0 }, email: a };
272
- P({ matrix: p }), a !== "off" && A.mutate({ email_digest: a });
273
- }, ke = Number.isInteger(Number(r == null ? void 0 : r.digest_hour)) ? Number(r == null ? void 0 : r.digest_hour) : 7, Ne = (a) => `${a % 12 === 0 ? 12 : a % 12}:45 ${a < 12 ? "AM" : "PM"}`, [de, ce] = q(null), re = _({
274
- mutationFn: () => i.request(ae("/users/me/digest-test", {})),
275
- onSuccess: (a) => ce(a.data.note),
276
- onError: () => ce("Test send failed — try again.")
277
- }), we = te.some((a) => n(a.key) === "daily"), ue = [
278
- { value: "instant", label: "Individual email" },
279
- { value: "daily", label: "Daily summary" },
280
- { value: "off", label: "No email" }
281
- ], I = ({ text: a }) => /* @__PURE__ */ e(
184
+ }, J = Number.isInteger(Number(t == null ? void 0 : t.digest_hour)) ? Number(t == null ? void 0 : t.digest_hour) : 7, D = (n) => `${n % 12 === 0 ? 12 : n % 12}:45 ${n < 12 ? "AM" : "PM"}`, [z, M] = C(null), I = w({
185
+ mutationFn: () => s.request(ee("/users/me/digest-test", {})),
186
+ onSuccess: (n) => M(n.data.note),
187
+ onError: () => M("Test send failed — try again.")
188
+ }), V = rt.some((n) => k(n.key) === "daily"), Z = ({ text: n }) => /* @__PURE__ */ e(
282
189
  "span",
283
190
  {
284
191
  className: "ml-1 inline-flex h-3.5 w-3.5 cursor-help items-center justify-center rounded-full border border-slate-300 text-[9px] font-semibold normal-case tracking-normal text-slate-400 dark:border-border",
285
192
  role: "img",
286
- title: a,
287
- "data-tip": a,
288
- "aria-label": a,
193
+ title: n,
194
+ "data-tip": n,
195
+ "aria-label": n,
289
196
  children: "?"
290
197
  }
291
198
  );
292
- return /* @__PURE__ */ t(
199
+ return /* @__PURE__ */ a(
293
200
  "div",
294
201
  {
202
+ id: "notification-rules",
203
+ ref: c,
295
204
  "data-profile-card": "notifications",
296
205
  className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
297
206
  children: [
298
- /* @__PURE__ */ t("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
207
+ /* @__PURE__ */ a("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
299
208
  /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Notification rules" }),
300
209
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Per category: whether it lands in your in-app inbox, whether your browser pushes it, and how it reaches your email — each one as it happens, folded into the daily action summary, or not at all. Quiet hours pause pushes and hold emails until morning unless a category is let through them; critical alerts (SLA escalations, maintenance, monitor failures) always get through." })
301
210
  ] }),
302
- /* @__PURE__ */ t("div", { className: "space-y-3 p-4", children: [
303
- (U ?? []).filter((a) => !k.includes(a.category)).map((a) => /* @__PURE__ */ t(
211
+ /* @__PURE__ */ a("div", { className: "space-y-3 p-4", children: [
212
+ (R ?? []).filter((n) => !d.includes(n.category)).map((n) => /* @__PURE__ */ a(
304
213
  "div",
305
214
  {
306
- "data-noise-suggestion": a.category,
215
+ "data-noise-suggestion": n.category,
307
216
  className: "flex flex-wrap items-center gap-2 rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-[12px] text-amber-900 dark:border-amber-900/50 dark:bg-amber-950/30 dark:text-amber-200",
308
217
  children: [
309
- /* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: [
310
- a.message,
218
+ /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
219
+ n.message,
311
220
  " Mute them?"
312
221
  ] }),
313
- a.category in j ? /* @__PURE__ */ e(
222
+ n.category in j ? /* @__PURE__ */ e(
314
223
  "button",
315
224
  {
316
225
  type: "button",
317
226
  className: "underline",
318
227
  onClick: () => {
319
- P({
228
+ $({
320
229
  matrix: {
321
- ...s.matrix ?? {},
322
- [a.category]: j[a.category]
230
+ ...r.matrix ?? {},
231
+ [n.category]: j[n.category]
323
232
  }
324
- }), c(({ [a.category]: p, ...x }) => x);
233
+ }), E(({ [n.category]: b, ...N }) => N);
325
234
  },
326
235
  children: "Muted — undo"
327
236
  }
328
- ) : /* @__PURE__ */ t(oe, { children: [
237
+ ) : /* @__PURE__ */ a(X, { children: [
329
238
  /* @__PURE__ */ e(
330
239
  "button",
331
240
  {
332
241
  type: "button",
333
242
  className: "rounded border border-amber-300 px-2 py-0.5 font-medium dark:border-amber-800",
334
243
  onClick: () => {
335
- var x;
336
- const p = ((x = s.matrix) == null ? void 0 : x[a.category]) ?? { inapp: !0, push: !0 };
337
- c((g) => ({ ...g, [a.category]: p })), P({
244
+ var N;
245
+ const b = ((N = r.matrix) == null ? void 0 : N[n.category]) ?? { inapp: !0, push: !0 };
246
+ E((B) => ({ ...B, [n.category]: b })), $({
338
247
  matrix: {
339
- ...s.matrix ?? {},
340
- [a.category]: { ...p, inapp: !1, push: !1 }
248
+ ...r.matrix ?? {},
249
+ [n.category]: { ...b, inapp: !1, push: !1 }
341
250
  }
342
251
  });
343
252
  },
344
253
  children: "Mute"
345
254
  }
346
255
  ),
347
- /* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () => J(a.category), children: "Not now" })
256
+ /* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () => P(n.category), children: "Not now" })
348
257
  ] })
349
258
  ]
350
259
  },
351
- a.category
260
+ n.category
352
261
  )),
353
- S && S.total > 0 && /* @__PURE__ */ t(
262
+ _ && _.total > 0 && /* @__PURE__ */ a(
354
263
  "div",
355
264
  {
356
265
  "data-rules-preview": !0,
357
266
  className: "flex flex-wrap items-center gap-2 rounded-md border border-slate-200 bg-slate-50 px-3 py-2 text-[12px] text-slate-600 dark:border-border dark:bg-background/40 dark:text-muted-foreground",
358
267
  children: [
359
- /* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: [
268
+ /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
360
269
  "Last week with this change: ",
361
- S.proposed.inapp,
270
+ _.proposed.inapp,
362
271
  " in-app instead of",
363
272
  " ",
364
- S.current.inapp,
273
+ _.current.inapp,
365
274
  ", ",
366
- S.proposed.email_sent,
275
+ _.proposed.email_sent,
367
276
  " emails instead of",
368
277
  " ",
369
- S.current.email_sent,
278
+ _.current.email_sent,
370
279
  ", ",
371
- S.proposed.push,
280
+ _.proposed.push,
372
281
  " pushes instead of",
373
282
  " ",
374
- S.current.push,
283
+ _.current.push,
375
284
  "."
376
285
  ] }),
377
- /* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () => f(null), children: "Dismiss" })
286
+ /* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () => O(null), children: "Dismiss" })
378
287
  ]
379
288
  }
380
289
  ),
381
- /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
382
- "Quiet hours (ET):",
383
- /* @__PURE__ */ e(
384
- "input",
385
- {
386
- type: "time",
387
- value: T,
388
- onChange: (a) => h(a.target.value),
389
- onBlur: () => P({ quiet_start: T || void 0 }),
390
- className: "h-7 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
391
- }
392
- ),
393
- /* @__PURE__ */ e("span", { children: "to" }),
394
- /* @__PURE__ */ e(
395
- "input",
396
- {
397
- type: "time",
398
- value: v,
399
- onChange: (a) => N(a.target.value),
400
- onBlur: () => P({ quiet_end: v || void 0 }),
401
- className: "h-7 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
402
- }
403
- ),
404
- (T || v) && /* @__PURE__ */ e(
405
- "button",
406
- {
407
- type: "button",
408
- onClick: () => {
409
- h(""), N(""), O.mutate({ matrix: s.matrix ?? {} });
410
- },
411
- className: "text-[11.5px] text-slate-400 underline decoration-dotted underline-offset-2",
412
- children: "Clear"
413
- }
414
- )
415
- ] }),
416
- /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
290
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
417
291
  "Sound:",
418
292
  /* @__PURE__ */ e(
419
- E,
293
+ U,
420
294
  {
421
- value: String((r == null ? void 0 : r.notification_sound) ?? "off"),
295
+ value: String((t == null ? void 0 : t.notification_sound) ?? "off"),
422
296
  options: [
423
297
  { value: "off", label: "Off" },
424
298
  { value: "subtle", label: "Subtle blip" },
425
299
  { value: "chime", label: "Chime" }
426
300
  ],
427
- onChange: (a) => {
428
- ge(a, { preview: !0 }), A.mutate({ notification_sound: a });
301
+ onChange: (n) => {
302
+ de(n, { preview: !0 }), f.mutate({ notification_sound: n });
429
303
  }
430
304
  }
431
305
  ),
432
306
  /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "plays when a notification or a direct message arrives" })
433
307
  ] }),
434
- /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
308
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
435
309
  /* @__PURE__ */ e(
436
- st,
310
+ et,
437
311
  {
438
- on: (r == null ? void 0 : r.huddle_hold_notifications) !== !1,
439
- onChange: () => A.mutate({
440
- huddle_hold_notifications: (r == null ? void 0 : r.huddle_hold_notifications) === !1
312
+ on: (t == null ? void 0 : t.huddle_hold_notifications) !== !1,
313
+ onChange: () => f.mutate({
314
+ huddle_hold_notifications: (t == null ? void 0 : t.huddle_hold_notifications) === !1
441
315
  }),
442
316
  label: "Hold notifications during huddles"
443
317
  }
@@ -445,188 +319,82 @@ function dt() {
445
319
  "Hold notifications during huddles",
446
320
  /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "toasts and sounds wait while you talk; you get one summary when you leave" })
447
321
  ] }),
448
- /* @__PURE__ */ t("table", { className: "w-full text-[12px]", children: [
449
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { className: "text-left text-[10.5px] uppercase tracking-wide text-slate-400", children: [
450
- /* @__PURE__ */ e("th", { className: "py-1 font-semibold", children: "Category" }),
451
- /* @__PURE__ */ t("th", { className: "py-1 text-center font-semibold", children: [
452
- "In-app",
453
- /* @__PURE__ */ e(I, { text: "The notification itself: the bell badge and your Notifications inbox in the app. Off = no row is written for this category, so nothing shows anywhere in the app." })
454
- ] }),
455
- /* @__PURE__ */ t("th", { className: "py-1 text-center font-semibold", children: [
456
- "Push",
457
- /* @__PURE__ */ e(I, { text: "A browser / device alert (the popup you get even with the tab closed) on devices where you allowed notifications. Off keeps the in-app row but stops the device alert. Quiet hours pause pushes too." })
458
- ] }),
459
- /* @__PURE__ */ t("th", { className: "py-1 text-center font-semibold", children: [
460
- "Email",
461
- /* @__PURE__ */ e(I, { text: "Individual email = one message as each event happens. Daily summary = held and delivered once a day in your action summary (deliver-at time below). No email = never emailed for this category (in-app and push are unaffected)." })
462
- ] }),
463
- o && /* @__PURE__ */ t("th", { className: "py-1 text-center font-semibold", "data-teams-column": "", children: [
464
- "Teams",
465
- /* @__PURE__ */ e(I, { text: 'A message from the Nivaro bot in Microsoft Teams. Off by default: connect Teams, then turn on the categories you want there. Say "mute 1h" to the bot to pause them for a while.' }),
466
- /* @__PURE__ */ e("div", { className: "mt-0.5", children: /* @__PURE__ */ e(et, { linked: l, linkedAt: (pe = d == null ? void 0 : d.link) == null ? void 0 : pe.linked_at }) })
467
- ] }),
468
- /* @__PURE__ */ t("th", { className: "py-1 text-center font-semibold", children: [
469
- "Sound",
470
- /* @__PURE__ */ e(I, { text: "A different sound for this category, or none. Default follows the Sound setting above." })
471
- ] }),
472
- /* @__PURE__ */ t("th", { className: "py-1 text-center font-semibold", children: [
473
- "Quiet hours",
474
- /* @__PURE__ */ e(I, { text: "Ticked = this category still pushes and emails during your quiet hours (the in-app row always lands either way). Leave it off to have quiet hours hold this category until morning. Critical alerts always get through." })
475
- ] })
476
- ] }) }),
477
- /* @__PURE__ */ e("tbody", { children: te.map((a) => {
478
- var x;
479
- const p = ((x = s.matrix) == null ? void 0 : x[a.key]) ?? {};
480
- return /* @__PURE__ */ t("tr", { className: "border-t border-slate-100 dark:border-border", children: [
481
- /* @__PURE__ */ t("td", { className: "py-1.5 text-slate-700 dark:text-foreground", children: [
482
- a.label,
483
- /* @__PURE__ */ e(I, { text: a.help })
484
- ] }),
485
- ["inapp", "push"].map((g) => /* @__PURE__ */ e("td", { className: "py-1.5 text-center", children: /* @__PURE__ */ e(
486
- "input",
487
- {
488
- type: "checkbox",
489
- checked: p[g] !== !1,
490
- onChange: () => Q(a.key, g),
491
- disabled: O.isPending,
492
- "aria-label": `${g === "inapp" ? "In-app" : "Push"} for ${a.label}`,
493
- "data-notify-channel": `${a.key}:${g}`,
494
- className: "h-3.5 w-3.5"
495
- }
496
- ) }, g)),
497
- /* @__PURE__ */ e("td", { className: "py-1 text-center", children: /* @__PURE__ */ e("div", { className: "inline-block", children: /* @__PURE__ */ e(
498
- E,
499
- {
500
- ariaLabel: `Email for ${a.label}`,
501
- value: n(a.key),
502
- options: ue,
503
- onChange: (g) => V(a.key, g)
504
- }
505
- ) }) }),
506
- o && /* @__PURE__ */ e("td", { className: "py-1.5 text-center", children: /* @__PURE__ */ e(
507
- "input",
508
- {
509
- type: "checkbox",
510
- checked: p.teams === !0,
511
- onChange: () => B(a.key),
512
- disabled: O.isPending || !l,
513
- "aria-label": `Teams for ${a.label}`,
514
- title: l ? void 0 : "Connect Teams first",
515
- "data-notify-channel": `${a.key}:teams`,
516
- className: "h-3.5 w-3.5"
517
- }
518
- ) }),
519
- /* @__PURE__ */ e("td", { className: "py-1 text-center", children: /* @__PURE__ */ e("div", { className: "inline-block", children: /* @__PURE__ */ e(
520
- E,
521
- {
522
- ariaLabel: `Sound for ${a.label}`,
523
- value: y[a.key] ?? "default",
524
- options: [
525
- { value: "default", label: "Default" },
526
- { value: "off", label: "None" },
527
- { value: "subtle", label: "Subtle blip" },
528
- { value: "chime", label: "Chime" }
529
- ],
530
- onChange: (g) => $(a.key, g)
531
- }
532
- ) }) }),
533
- /* @__PURE__ */ e("td", { className: "py-1.5 text-center", children: /* @__PURE__ */ e(
534
- "input",
535
- {
536
- type: "checkbox",
537
- checked: p.quiet_override === !0,
538
- onChange: () => Z(a.key),
539
- disabled: O.isPending,
540
- "aria-label": `Let ${a.label} through quiet hours`,
541
- title: X ? void 0 : "Set quiet hours above for this to matter — it is remembered either way",
542
- "data-quiet-override": a.key,
543
- className: "h-3.5 w-3.5"
544
- }
545
- ) })
546
- ] }, a.key);
547
- }) })
548
- ] }),
549
- /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
550
- /* @__PURE__ */ e("span", { children: "All email:" }),
551
- ue.map((a) => /* @__PURE__ */ e(
552
- "button",
553
- {
554
- type: "button",
555
- disabled: O.isPending,
556
- onClick: () => ee(a.value),
557
- className: "rounded border border-slate-200 px-2 py-0.5 hover:border-slate-400 hover:text-slate-800 dark:border-border dark:hover:text-foreground",
558
- children: a.label
559
- },
560
- a.value
561
- ))
562
- ] }),
563
- /* @__PURE__ */ t("div", { className: "space-y-2 rounded-md border border-slate-100 bg-slate-50/60 px-3 py-2 dark:border-border/60 dark:bg-background/40", children: [
564
- /* @__PURE__ */ t("p", { className: "text-[12px] font-medium text-slate-700 dark:text-foreground", children: [
565
- "If it stays unread",
566
- /* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] font-normal text-slate-400", children: "one notification climbs channels on your schedule — push, then email — and stops the moment you read it. A channel that already delivered it is not repeated." })
567
- ] }),
568
- /* @__PURE__ */ t("table", { className: "w-full text-[12px]", children: [
569
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { className: "text-left text-[10.5px] uppercase tracking-wide text-slate-400", children: [
570
- /* @__PURE__ */ e("th", { className: "py-1 font-semibold", children: "Category" }),
571
- /* @__PURE__ */ t("th", { className: "py-1 font-semibold", children: [
572
- "Push after",
573
- /* @__PURE__ */ e(I, { text: "Still unread after this long → a browser / device push (needs a registered device; quiet hours do not apply to escalations you asked for)." })
322
+ /* @__PURE__ */ e(
323
+ Ee,
324
+ {
325
+ subject: "person",
326
+ value: r,
327
+ inherited: h != null && h.role ? h.rules : null,
328
+ inheritedName: ((W = h == null ? void 0 : h.role) == null ? void 0 : W.name) ?? null,
329
+ legacyEmail: p,
330
+ saving: F.isPending,
331
+ onCommit: (n) => g(n),
332
+ onLegacyEmail: (n) => f.mutate({ email_digest: n }),
333
+ teams: o ? {
334
+ available: !0,
335
+ linked: l,
336
+ header: /* @__PURE__ */ e("div", { className: "mt-0.5", children: /* @__PURE__ */ e(Ge, { linked: l, linkedAt: (se = i == null ? void 0 : i.link) == null ? void 0 : se.linked_at }) })
337
+ } : null,
338
+ extraColumn: {
339
+ header: /* @__PURE__ */ a(X, { children: [
340
+ "Sound",
341
+ /* @__PURE__ */ e(Z, { text: "A different sound for this category, or none. Default follows the Sound setting above." })
574
342
  ] }),
575
- /* @__PURE__ */ t("th", { className: "py-1 font-semibold", children: [
576
- "Email after",
577
- /* @__PURE__ */ e(I, { text: "Still unread after this long → one email with the notification, regardless of the Email column above (No email still means no email at delivery time; this is the fallback)." })
578
- ] })
579
- ] }) }),
580
- /* @__PURE__ */ e("tbody", { children: te.map((a) => {
581
- var x;
582
- const p = ((x = s.escalation) == null ? void 0 : x[a.key]) ?? {};
583
- return /* @__PURE__ */ t("tr", { className: "border-t border-slate-100 dark:border-border", children: [
584
- /* @__PURE__ */ e("td", { className: "py-1 text-slate-700 dark:text-foreground", children: a.label }),
585
- ["push_after_min", "email_after_min"].map((g) => /* @__PURE__ */ e("td", { className: "py-1", children: /* @__PURE__ */ e(
586
- E,
343
+ cell: (n, b) => /* @__PURE__ */ a("div", { className: "inline-block", children: [
344
+ /* @__PURE__ */ e(
345
+ U,
587
346
  {
588
- ariaLabel: `${g === "push_after_min" ? "Push" : "Email"} after for ${a.label}`,
589
- value: p[g] ? String(p[g]) : "",
590
- options: W,
591
- onChange: (H) => M(a.key, g, H ? Number(H) : null)
347
+ ariaLabel: `Sound for ${b}`,
348
+ value: L[n] ?? "default",
349
+ options: [
350
+ { value: "default", label: "Default" },
351
+ { value: "off", label: "None" },
352
+ { value: "subtle", label: "Subtle blip" },
353
+ { value: "chime", label: "Chime" }
354
+ ],
355
+ onChange: (N) => x(n, N)
592
356
  }
593
- ) }, g))
594
- ] }, a.key);
595
- }) })
596
- ] })
597
- ] }),
598
- /* @__PURE__ */ t("div", { className: "space-y-2 rounded-md border border-slate-100 bg-slate-50/60 px-3 py-2 dark:border-border/60 dark:bg-background/40", children: [
599
- /* @__PURE__ */ t("p", { className: "text-[12px] font-medium text-slate-700 dark:text-foreground", children: [
357
+ ),
358
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
359
+ /* @__PURE__ */ e(Ie, {}),
360
+ /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "see what would happen to a notification for you right now, and which rule decides it" })
361
+ ] })
362
+ ] })
363
+ }
364
+ }
365
+ ),
366
+ /* @__PURE__ */ a("div", { className: "space-y-2 rounded-md border border-slate-100 bg-slate-50/60 px-3 py-2 dark:border-border/60 dark:bg-background/40", children: [
367
+ /* @__PURE__ */ a("p", { className: "text-[12px] font-medium text-slate-700 dark:text-foreground", children: [
600
368
  "Daily action summary",
601
- /* @__PURE__ */ t("span", { className: "ml-1.5 text-[11px] font-normal text-slate-400", children: [
369
+ /* @__PURE__ */ a("span", { className: "ml-1.5 text-[11px] font-normal text-slate-400", children: [
602
370
  "one morning email — every category set to Daily summary, plus items assigned to you and invoices awaiting your review",
603
- !we && " · nothing is set to Daily summary yet"
371
+ !V && " · nothing is set to Daily summary yet"
604
372
  ] })
605
373
  ] }),
606
- /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-2 text-[12px] text-slate-600 dark:text-muted-foreground", children: [
607
- /* @__PURE__ */ t("span", { className: "flex items-center gap-1.5", children: [
374
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-2 text-[12px] text-slate-600 dark:text-muted-foreground", children: [
375
+ /* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
608
376
  "Deliver at",
609
377
  /* @__PURE__ */ e(
610
- E,
378
+ U,
611
379
  {
612
380
  ariaLabel: "Digest delivery hour",
613
- value: String(ke),
614
- onChange: (a) => A.mutate({ digest_hour: Number(a) }),
615
- options: Array.from({ length: 24 }, (a, p) => ({
616
- value: String(p),
617
- label: Ne(p)
381
+ value: String(J),
382
+ onChange: (n) => f.mutate({ digest_hour: Number(n) }),
383
+ options: Array.from({ length: 24 }, (n, b) => ({
384
+ value: String(b),
385
+ label: D(b)
618
386
  }))
619
387
  }
620
388
  ),
621
389
  /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Eastern time" })
622
390
  ] }),
623
- /* @__PURE__ */ t("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
391
+ /* @__PURE__ */ a("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
624
392
  /* @__PURE__ */ e(
625
393
  "input",
626
394
  {
627
395
  type: "checkbox",
628
- checked: (r == null ? void 0 : r.digest_layout) === "compact",
629
- onChange: (a) => A.mutate({ digest_layout: a.target.checked ? "compact" : "detailed" }),
396
+ checked: (t == null ? void 0 : t.digest_layout) === "compact",
397
+ onChange: (n) => f.mutate({ digest_layout: n.target.checked ? "compact" : "detailed" }),
630
398
  className: "rounded"
631
399
  }
632
400
  ),
@@ -636,40 +404,40 @@ function dt() {
636
404
  "button",
637
405
  {
638
406
  type: "button",
639
- disabled: re.isPending,
640
- onClick: () => re.mutate(),
407
+ disabled: I.isPending,
408
+ onClick: () => I.mutate(),
641
409
  className: "text-[12px] text-slate-500 underline decoration-dotted underline-offset-2 hover:text-slate-700 disabled:opacity-50 dark:text-slate-400 dark:hover:text-slate-200",
642
- children: re.isPending ? "Building…" : "Send me a test summary now"
410
+ children: I.isPending ? "Building…" : "Send me a test summary now"
643
411
  }
644
412
  ),
645
- de && /* @__PURE__ */ e("span", { className: "text-[11.5px] text-slate-400", children: de })
413
+ z && /* @__PURE__ */ e("span", { className: "text-[11.5px] text-slate-400", children: z })
646
414
  ] })
647
415
  ] }),
648
- /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-4 border-t border-slate-100 pt-3 text-[12.5px] text-slate-600 dark:border-border/60 dark:text-muted-foreground", children: [
416
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-4 border-t border-slate-100 pt-3 text-[12.5px] text-slate-600 dark:border-border/60 dark:text-muted-foreground", children: [
649
417
  /* @__PURE__ */ e("span", { className: "text-[11.5px] text-slate-400", children: "Auto-watch records I…" }),
650
418
  [
651
419
  ["created", "create"],
652
420
  ["commented", "comment on"],
653
421
  ["transitioned", "move through a workflow"]
654
- ].map(([a, p]) => {
655
- var x;
656
- return /* @__PURE__ */ t("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
422
+ ].map(([n, b]) => {
423
+ var N;
424
+ return /* @__PURE__ */ a("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
657
425
  /* @__PURE__ */ e(
658
426
  "input",
659
427
  {
660
428
  type: "checkbox",
661
- checked: ((x = r == null ? void 0 : r.auto_watch) == null ? void 0 : x[a]) === !0,
662
- onChange: (g) => A.mutate({
429
+ checked: ((N = t == null ? void 0 : t.auto_watch) == null ? void 0 : N[n]) === !0,
430
+ onChange: (B) => f.mutate({
663
431
  auto_watch: {
664
- ...(r == null ? void 0 : r.auto_watch) ?? {},
665
- [a]: g.target.checked
432
+ ...(t == null ? void 0 : t.auto_watch) ?? {},
433
+ [n]: B.target.checked
666
434
  }
667
435
  }),
668
436
  className: "rounded"
669
437
  }
670
438
  ),
671
- p
672
- ] }, a);
439
+ b
440
+ ] }, n);
673
441
  })
674
442
  ] })
675
443
  ] })
@@ -677,18 +445,18 @@ function dt() {
677
445
  }
678
446
  );
679
447
  }
680
- function ct() {
681
- const i = L(), m = K(), { data: r } = w({
448
+ function lt() {
449
+ const s = A(), u = K(), { data: t } = v({
682
450
  queryKey: ["nvr-profile-prefs"],
683
- queryFn: () => i.request(D("/users/me")).then((s) => {
684
- var u;
685
- return ((u = s.data) == null ? void 0 : u.preferences) ?? {};
451
+ queryFn: () => s.request(T("/users/me")).then((c) => {
452
+ var m;
453
+ return ((m = c.data) == null ? void 0 : m.preferences) ?? {};
686
454
  })
687
- }), d = (r == null ? void 0 : r.link_app) === "portal" || (r == null ? void 0 : r.link_app) === "admin" ? r.link_app : "auto", o = _({
688
- mutationFn: (s) => i.request(G("/users/me/preferences", { link_app: s })),
689
- onSuccess: () => void m.invalidateQueries({ queryKey: ["nvr-profile-prefs"] })
455
+ }), i = (t == null ? void 0 : t.link_app) === "portal" || (t == null ? void 0 : t.link_app) === "admin" ? t.link_app : "auto", o = w({
456
+ mutationFn: (c) => s.request(G("/users/me/preferences", { link_app: c })),
457
+ onSuccess: () => void u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] })
690
458
  });
691
- return /* @__PURE__ */ t(
459
+ return /* @__PURE__ */ a(
692
460
  "div",
693
461
  {
694
462
  className: "rounded-xl border border-slate-200 bg-white p-5 dark:border-border dark:bg-card",
@@ -700,356 +468,356 @@ function ct() {
700
468
  { v: "auto", label: "Automatic", hint: "Admins open the admin, everyone else the portal" },
701
469
  { v: "portal", label: "Portal", hint: "Always the front-end app" },
702
470
  { v: "admin", label: "Admin", hint: "Always the admin console" }
703
- ].map((s) => /* @__PURE__ */ e(
471
+ ].map((c) => /* @__PURE__ */ e(
704
472
  "button",
705
473
  {
706
474
  type: "button",
707
- title: s.hint,
708
- onClick: () => o.mutate(s.v),
709
- className: d === s.v ? "rounded bg-nvr-cyan px-3 py-1 text-[12.5px] font-medium text-white" : "rounded px-3 py-1 text-[12.5px] font-medium text-slate-600 hover:bg-slate-100 dark:text-muted-foreground dark:hover:bg-muted",
710
- children: s.label
475
+ title: c.hint,
476
+ onClick: () => o.mutate(c.v),
477
+ className: i === c.v ? "rounded bg-nvr-cyan px-3 py-1 text-[12.5px] font-medium text-white" : "rounded px-3 py-1 text-[12.5px] font-medium text-slate-600 hover:bg-slate-100 dark:text-muted-foreground dark:hover:bg-muted",
478
+ children: c.label
711
479
  },
712
- s.v
480
+ c.v
713
481
  )) })
714
482
  ]
715
483
  }
716
484
  );
717
485
  }
718
- function ut() {
719
- const i = L(), m = K(), [r, d] = q(""), o = (() => {
486
+ function ot() {
487
+ const s = A(), u = K(), [t, i] = C(""), o = (() => {
720
488
  try {
721
489
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
722
490
  } catch {
723
491
  return "UTC";
724
492
  }
725
493
  })(), l = (() => {
726
- var h;
494
+ var p;
727
495
  try {
728
- return ((h = Intl.supportedValuesOf) == null ? void 0 : h.call(
496
+ return ((p = Intl.supportedValuesOf) == null ? void 0 : p.call(
729
497
  Intl,
730
498
  "timeZone"
731
499
  )) ?? [];
732
500
  } catch {
733
501
  return [];
734
502
  }
735
- })(), { data: s } = w({
503
+ })(), { data: c } = v({
736
504
  queryKey: ["nvr-profile-prefs"],
737
- queryFn: () => i.request(D("/users/me")).then((h) => {
738
- var C;
739
- return ((C = h.data) == null ? void 0 : C.preferences) ?? {};
505
+ queryFn: () => s.request(T("/users/me")).then((p) => {
506
+ var S;
507
+ return ((S = p.data) == null ? void 0 : S.preferences) ?? {};
740
508
  })
741
- }), u = typeof (s == null ? void 0 : s.timezone) == "string" ? s.timezone : null, n = _({
742
- mutationFn: (h) => i.request(G("/users/me/preferences", { timezone: h })),
743
- onSuccess: (h, C) => {
744
- ze(C), d(""), m.invalidateQueries({ queryKey: ["nvr-profile-prefs"] });
509
+ }), m = typeof (c == null ? void 0 : c.timezone) == "string" ? c.timezone : null, r = w({
510
+ mutationFn: (p) => s.request(G("/users/me/preferences", { timezone: p })),
511
+ onSuccess: (p, S) => {
512
+ Ke(S), i(""), u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] });
745
513
  }
746
- }), b = r.length > 1 ? l.filter((h) => h.toLowerCase().includes(r.toLowerCase())).slice(0, 8) : [];
747
- return /* @__PURE__ */ t(
514
+ }), h = t.length > 1 ? l.filter((p) => p.toLowerCase().includes(t.toLowerCase())).slice(0, 8) : [];
515
+ return /* @__PURE__ */ a(
748
516
  "div",
749
517
  {
750
518
  "data-profile-card": "timezone",
751
519
  className: "rounded-xl border border-slate-200 bg-white p-5 dark:border-border dark:bg-card",
752
520
  children: [
753
521
  /* @__PURE__ */ e("p", { className: "text-[13.5px] font-semibold text-slate-800 dark:text-slate-100", children: "Timezone" }),
754
- /* @__PURE__ */ t("p", { className: "mt-0.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
522
+ /* @__PURE__ */ a("p", { className: "mt-0.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
755
523
  "Dates and times render in this zone. Your browser reports",
756
524
  " ",
757
525
  /* @__PURE__ */ e("span", { className: "font-medium", children: o }),
758
526
  "."
759
527
  ] }),
760
- /* @__PURE__ */ t("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [
761
- /* @__PURE__ */ e("span", { className: "inline-flex items-center gap-1.5 rounded-full bg-nvr-cyan/10 px-2.5 py-1 text-[12px] font-medium text-nvr-navy dark:text-nvr-cyan", children: u ?? `${o} (browser default)` }),
762
- u && /* @__PURE__ */ e(
528
+ /* @__PURE__ */ a("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [
529
+ /* @__PURE__ */ e("span", { className: "inline-flex items-center gap-1.5 rounded-full bg-nvr-cyan/10 px-2.5 py-1 text-[12px] font-medium text-nvr-navy dark:text-nvr-cyan", children: m ?? `${o} (browser default)` }),
530
+ m && /* @__PURE__ */ e(
763
531
  "button",
764
532
  {
765
533
  type: "button",
766
- onClick: () => n.mutate(null),
534
+ onClick: () => r.mutate(null),
767
535
  className: "text-[12px] text-slate-400 hover:text-slate-600 dark:hover:text-slate-300",
768
536
  children: "Use browser default"
769
537
  }
770
538
  )
771
539
  ] }),
772
- /* @__PURE__ */ t("div", { className: "relative mt-2", children: [
540
+ /* @__PURE__ */ a("div", { className: "relative mt-2", children: [
773
541
  /* @__PURE__ */ e(
774
542
  "input",
775
543
  {
776
- value: r,
777
- onChange: (h) => d(h.target.value),
544
+ value: t,
545
+ onChange: (p) => i(p.target.value),
778
546
  placeholder: "Change zone… (e.g. America/Denver)",
779
547
  className: "h-8 w-[280px] rounded-md border border-slate-200 bg-background px-2.5 text-[12.5px] dark:border-border"
780
548
  }
781
549
  ),
782
- b.length > 0 && /* @__PURE__ */ e("div", { className: "absolute z-10 mt-1 w-[280px] rounded-md border border-slate-200 bg-white shadow-lg dark:border-border dark:bg-card", children: b.map((h) => /* @__PURE__ */ e(
550
+ h.length > 0 && /* @__PURE__ */ e("div", { className: "absolute z-10 mt-1 w-[280px] rounded-md border border-slate-200 bg-white shadow-lg dark:border-border dark:bg-card", children: h.map((p) => /* @__PURE__ */ e(
783
551
  "button",
784
552
  {
785
553
  type: "button",
786
- onClick: () => n.mutate(h),
554
+ onClick: () => r.mutate(p),
787
555
  className: "block w-full px-2.5 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-foreground",
788
- children: h
556
+ children: p
789
557
  },
790
- h
558
+ p
791
559
  )) })
792
560
  ] })
793
561
  ]
794
562
  }
795
563
  );
796
564
  }
797
- function mt() {
798
- const i = L(), m = K(), { data: r } = w({
565
+ function it() {
566
+ const s = A(), u = K(), { data: t } = v({
799
567
  queryKey: ["nvr-profile-scopes"],
800
- queryFn: () => i.request(qe()).then((o) => o.data)
801
- }), d = _({
802
- mutationFn: ({ dimension: o, values: l }) => i.request(Ce(o, l)),
803
- onSuccess: () => void m.invalidateQueries({ queryKey: ["nvr-profile-scopes"] })
568
+ queryFn: () => s.request(xe()).then((o) => o.data)
569
+ }), i = w({
570
+ mutationFn: ({ dimension: o, values: l }) => s.request(ge(o, l)),
571
+ onSuccess: () => void u.invalidateQueries({ queryKey: ["nvr-profile-scopes"] })
804
572
  });
805
- return !r || r.dimensions.length === 0 ? null : /* @__PURE__ */ e(
806
- ie,
573
+ return !t || t.dimensions.length === 0 ? null : /* @__PURE__ */ e(
574
+ ne,
807
575
  {
808
576
  testId: "scopes",
809
- icon: /* @__PURE__ */ e(Ee, { className: "h-4 w-4" }),
577
+ icon: /* @__PURE__ */ e(Ce, { className: "h-4 w-4" }),
810
578
  title: "Default filters",
811
579
  hint: "Pre-selected in browsers and reports — clear anytime",
812
- children: /* @__PURE__ */ e("div", { className: "space-y-3", children: r.dimensions.map((o) => /* @__PURE__ */ e(
813
- pt,
580
+ children: /* @__PURE__ */ e("div", { className: "space-y-3", children: t.dimensions.map((o) => /* @__PURE__ */ e(
581
+ dt,
814
582
  {
815
583
  dimension: o,
816
- selected: r.defaults[o.name] ?? [],
817
- restricted: r.restricted[o.name],
818
- onSave: (l) => d.mutate({ dimension: o.name, values: l })
584
+ selected: t.defaults[o.name] ?? [],
585
+ restricted: t.restricted[o.name],
586
+ onSave: (l) => i.mutate({ dimension: o.name, values: l })
819
587
  },
820
588
  o.name
821
589
  )) })
822
590
  }
823
591
  );
824
592
  }
825
- function pt({
826
- dimension: i,
827
- selected: m,
828
- restricted: r,
829
- onSave: d
593
+ function dt({
594
+ dimension: s,
595
+ selected: u,
596
+ restricted: t,
597
+ onSave: i
830
598
  }) {
831
- const o = L(), l = i.display_field ?? "name", [s, u] = q(""), [n, b] = q(!1), { data: h = [] } = w({
832
- queryKey: ["nvr-scope-options", i.name],
599
+ const o = A(), l = s.display_field ?? "name", [c, m] = C(""), [r, h] = C(!1), { data: p = [] } = v({
600
+ queryKey: ["nvr-scope-options", s.name],
833
601
  queryFn: async () => ((await o.request(
834
- ne(i.target_collection, {
602
+ te(s.target_collection, {
835
603
  fields: ["id", l],
836
- sort: i.options_sort ? [i.options_sort] : void 0,
604
+ sort: s.options_sort ? [s.options_sort] : void 0,
837
605
  limit: 200
838
606
  })
839
- )).data ?? []).map((k) => ({
840
- id: k.id,
841
- label: String(k[l] ?? k.id)
607
+ )).data ?? []).map((y) => ({
608
+ id: y.id,
609
+ label: String(y[l] ?? y.id)
842
610
  }))
843
- }), C = r != null && r.length ? new Set(r.map(String)) : null, N = C ? h.filter((c) => C.has(String(c.id))) : h, T = new Set(m.map(String)), v = N.length > 24 || h.length >= 200 && !C, { data: O = [], isFetching: A } = w({
844
- queryKey: ["nvr-scope-search", i.name, s],
611
+ }), S = t != null && t.length ? new Set(t.map(String)) : null, k = S ? p.filter((d) => S.has(String(d.id))) : p, F = new Set(u.map(String)), f = k.length > 24 || p.length >= 200 && !S, { data: _ = [], isFetching: O } = v({
612
+ queryKey: ["nvr-scope-search", s.name, c],
845
613
  queryFn: async () => {
846
- const k = ((await o.request(
847
- ne(i.target_collection, {
614
+ const y = ((await o.request(
615
+ te(s.target_collection, {
848
616
  fields: ["id", l],
849
- filter: { [l]: { _contains: s } },
850
- sort: i.options_sort ? [i.options_sort] : void 0,
617
+ filter: { [l]: { _contains: c } },
618
+ sort: s.options_sort ? [s.options_sort] : void 0,
851
619
  limit: 30
852
620
  })
853
- )).data ?? []).map((F) => ({
854
- id: F.id,
855
- label: String(F[l] ?? F.id)
621
+ )).data ?? []).map((P) => ({
622
+ id: P.id,
623
+ label: String(P[l] ?? P.id)
856
624
  }));
857
- return C ? k.filter((F) => C.has(String(F.id))) : k;
625
+ return S ? y.filter((P) => S.has(String(P.id))) : y;
858
626
  },
859
- enabled: v && s.trim().length > 0,
860
- placeholderData: (c) => c
861
- }), S = new Map(h.map((c) => [String(c.id), c.label]));
862
- for (const c of O) S.set(String(c.id), c.label);
863
- const f = m.filter((c) => !S.has(String(c))), { data: z = [] } = w({
864
- queryKey: ["nvr-scope-selected-labels", i.name, f.map(String).sort().join(",")],
627
+ enabled: f && c.trim().length > 0,
628
+ placeholderData: (d) => d
629
+ }), q = new Map(p.map((d) => [String(d.id), d.label]));
630
+ for (const d of _) q.set(String(d.id), d.label);
631
+ const g = u.filter((d) => !q.has(String(d))), { data: $ = [] } = v({
632
+ queryKey: ["nvr-scope-selected-labels", s.name, g.map(String).sort().join(",")],
865
633
  queryFn: async () => ((await o.request(
866
- ne(i.target_collection, {
634
+ te(s.target_collection, {
867
635
  fields: ["id", l],
868
- filter: { id: { _in: f } },
636
+ filter: { id: { _in: g } },
869
637
  limit: 100
870
638
  })
871
- )).data ?? []).map((k) => ({
872
- id: k.id,
873
- label: String(k[l] ?? k.id)
639
+ )).data ?? []).map((y) => ({
640
+ id: y.id,
641
+ label: String(y[l] ?? y.id)
874
642
  })),
875
- enabled: f.length > 0
643
+ enabled: g.length > 0
876
644
  });
877
- for (const c of z) S.set(String(c.id), c.label);
878
- const P = (c) => {
879
- const k = T.has(String(c));
880
- d(k ? m.filter((F) => String(F) !== String(c)) : [...m, c]);
881
- }, y = s.trim().toLowerCase(), $ = y ? N.filter((c) => c.label.toLowerCase().includes(y)) : N, U = y.length === 0 ? N.slice(0, 30) : A && O.length === 0 ? $.slice(0, 30) : O, j = v && (n || y.length > 0);
882
- return /* @__PURE__ */ t("div", { children: [
883
- /* @__PURE__ */ t("p", { className: "mb-1 text-[11px] font-medium uppercase tracking-wide text-slate-400", children: [
884
- i.label,
885
- r != null && r.length ? /* @__PURE__ */ e("span", { className: "ml-1.5 normal-case tracking-normal text-amber-500", children: "(limited by your access)" }) : null,
886
- m.length > 0 && /* @__PURE__ */ t(
645
+ for (const d of $) q.set(String(d.id), d.label);
646
+ const L = (d) => {
647
+ const y = F.has(String(d));
648
+ i(y ? u.filter((P) => String(P) !== String(d)) : [...u, d]);
649
+ }, x = c.trim().toLowerCase(), R = x ? k.filter((d) => d.label.toLowerCase().includes(x)) : k, j = x.length === 0 ? k.slice(0, 30) : O && _.length === 0 ? R.slice(0, 30) : _, E = f && (r || x.length > 0);
650
+ return /* @__PURE__ */ a("div", { children: [
651
+ /* @__PURE__ */ a("p", { className: "mb-1 text-[11px] font-medium uppercase tracking-wide text-slate-400", children: [
652
+ s.label,
653
+ t != null && t.length ? /* @__PURE__ */ e("span", { className: "ml-1.5 normal-case tracking-normal text-amber-500", children: "(limited by your access)" }) : null,
654
+ u.length > 0 && /* @__PURE__ */ a(
887
655
  "button",
888
656
  {
889
657
  type: "button",
890
- onClick: () => d([]),
658
+ onClick: () => i([]),
891
659
  className: "ml-2 normal-case tracking-normal text-slate-400 underline-offset-2 hover:text-slate-600 hover:underline",
892
660
  children: [
893
661
  "clear ",
894
- m.length
662
+ u.length
895
663
  ]
896
664
  }
897
665
  )
898
666
  ] }),
899
- v ? /* @__PURE__ */ t("div", { className: "max-w-xl", children: [
900
- m.length > 0 && /* @__PURE__ */ e("div", { className: "mb-1.5 flex flex-wrap gap-1", children: m.map((c) => /* @__PURE__ */ t(
667
+ f ? /* @__PURE__ */ a("div", { className: "max-w-xl", children: [
668
+ u.length > 0 && /* @__PURE__ */ e("div", { className: "mb-1.5 flex flex-wrap gap-1", children: u.map((d) => /* @__PURE__ */ a(
901
669
  "span",
902
670
  {
903
671
  className: "inline-flex items-center gap-1 rounded-full border border-nvr-cyan bg-nvr-cyan/10 py-0.5 pl-2.5 pr-1 text-[11.5px] font-medium text-nvr-navy dark:text-nvr-cyan",
904
672
  children: [
905
- S.get(String(c)) ?? String(c),
673
+ q.get(String(d)) ?? String(d),
906
674
  /* @__PURE__ */ e(
907
675
  "button",
908
676
  {
909
677
  type: "button",
910
- onClick: () => P(c),
911
- "aria-label": `Remove ${S.get(String(c)) ?? c}`,
678
+ onClick: () => L(d),
679
+ "aria-label": `Remove ${q.get(String(d)) ?? d}`,
912
680
  className: "rounded-full px-1 text-slate-400 hover:text-slate-600 dark:hover:text-slate-200",
913
681
  children: "×"
914
682
  }
915
683
  )
916
684
  ]
917
685
  },
918
- String(c)
686
+ String(d)
919
687
  )) }),
920
688
  /* @__PURE__ */ e(
921
689
  "input",
922
690
  {
923
- value: s,
924
- onChange: (c) => u(c.target.value),
925
- onFocus: () => b(!0),
926
- onBlur: () => b(!1),
927
- placeholder: `Search ${i.label.toLowerCase()} to add…`,
691
+ value: c,
692
+ onChange: (d) => m(d.target.value),
693
+ onFocus: () => h(!0),
694
+ onBlur: () => h(!1),
695
+ placeholder: `Search ${s.label.toLowerCase()} to add…`,
928
696
  className: "h-8 w-full rounded-md border border-slate-200 bg-white px-2.5 text-[12px] outline-none focus:border-nvr-cyan dark:border-border dark:bg-card"
929
697
  }
930
698
  ),
931
- j && /* @__PURE__ */ t(
699
+ E && /* @__PURE__ */ a(
932
700
  "div",
933
701
  {
934
- onMouseDown: (c) => c.preventDefault(),
702
+ onMouseDown: (d) => d.preventDefault(),
935
703
  className: "mt-1 max-h-44 overflow-y-auto rounded-md border border-slate-200 dark:border-border",
936
704
  children: [
937
- U.map((c) => {
938
- const k = T.has(String(c.id));
939
- return /* @__PURE__ */ t(
705
+ j.map((d) => {
706
+ const y = F.has(String(d.id));
707
+ return /* @__PURE__ */ a(
940
708
  "button",
941
709
  {
942
710
  type: "button",
943
- onClick: () => P(c.id),
944
- className: R(
711
+ onClick: () => L(d.id),
712
+ className: Q(
945
713
  "flex w-full items-center justify-between px-2.5 py-1.5 text-left text-[12px] hover:bg-slate-50 dark:hover:bg-muted",
946
- k ? "font-medium text-nvr-navy dark:text-nvr-cyan" : "text-slate-600 dark:text-slate-300"
714
+ y ? "font-medium text-nvr-navy dark:text-nvr-cyan" : "text-slate-600 dark:text-slate-300"
947
715
  ),
948
716
  children: [
949
- /* @__PURE__ */ e("span", { className: "truncate", children: c.label }),
950
- /* @__PURE__ */ e("span", { className: "pl-2 text-[11px] text-slate-400", children: k ? "Remove" : "Add" })
717
+ /* @__PURE__ */ e("span", { className: "truncate", children: d.label }),
718
+ /* @__PURE__ */ e("span", { className: "pl-2 text-[11px] text-slate-400", children: y ? "Remove" : "Add" })
951
719
  ]
952
720
  },
953
- String(c.id)
721
+ String(d.id)
954
722
  );
955
723
  }),
956
- U.length === 0 && /* @__PURE__ */ e("p", { className: "px-2.5 py-2 text-[11.5px] text-slate-400", children: A ? "Searching…" : y ? "No matches." : "No options." }),
957
- y.length === 0 && N.length > 30 && /* @__PURE__ */ e("p", { className: "border-t border-slate-100 px-2.5 py-1.5 text-[11px] text-slate-400 dark:border-border", children: "Showing first 30 — type to narrow." })
724
+ j.length === 0 && /* @__PURE__ */ e("p", { className: "px-2.5 py-2 text-[11.5px] text-slate-400", children: O ? "Searching…" : x ? "No matches." : "No options." }),
725
+ x.length === 0 && k.length > 30 && /* @__PURE__ */ e("p", { className: "border-t border-slate-100 px-2.5 py-1.5 text-[11px] text-slate-400 dark:border-border", children: "Showing first 30 — type to narrow." })
958
726
  ]
959
727
  }
960
728
  ),
961
- !j && m.length === 0 && /* @__PURE__ */ e("p", { className: "mt-1 text-[11px] text-slate-400", children: "No defaults set — click to browse or type to search." })
962
- ] }) : /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: [
963
- N.map((c) => {
964
- const k = T.has(String(c.id));
729
+ !E && u.length === 0 && /* @__PURE__ */ e("p", { className: "mt-1 text-[11px] text-slate-400", children: "No defaults set — click to browse or type to search." })
730
+ ] }) : /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children: [
731
+ k.map((d) => {
732
+ const y = F.has(String(d.id));
965
733
  return /* @__PURE__ */ e(
966
734
  "button",
967
735
  {
968
736
  type: "button",
969
- onClick: () => P(c.id),
970
- className: R(
737
+ onClick: () => L(d.id),
738
+ className: Q(
971
739
  "rounded-full border px-2.5 py-0.5 text-[11.5px] transition-colors",
972
- k ? "border-nvr-cyan bg-nvr-cyan/10 font-medium text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:border-slate-300 dark:border-border"
740
+ y ? "border-nvr-cyan bg-nvr-cyan/10 font-medium text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:border-slate-300 dark:border-border"
973
741
  ),
974
- children: c.label
742
+ children: d.label
975
743
  },
976
- String(c.id)
744
+ String(d.id)
977
745
  );
978
746
  }),
979
- N.length === 0 && /* @__PURE__ */ e("span", { className: "text-[11.5px] text-slate-400", children: "No options." })
747
+ k.length === 0 && /* @__PURE__ */ e("span", { className: "text-[11.5px] text-slate-400", children: "No options." })
980
748
  ] })
981
749
  ] });
982
750
  }
983
- function ht() {
984
- const { data: i } = w({
751
+ function ct() {
752
+ const { data: s } = v({
985
753
  queryKey: ["nvr-settings-2fa"],
986
- queryFn: () => r.request({ _method: "GET", _path: "/settings/" }).then((f) => (f == null ? void 0 : f.data) ?? null).catch(() => null),
754
+ queryFn: () => t.request({ _method: "GET", _path: "/settings/" }).then((g) => (g == null ? void 0 : g.data) ?? null).catch(() => null),
987
755
  staleTime: 6e5
988
- }), m = (i == null ? void 0 : i.two_factor_enabled) !== !1, r = L(), d = K(), [o, l] = q(null), [s, u] = q(""), [n, b] = q(null), { data: h } = w({
756
+ }), u = (s == null ? void 0 : s.two_factor_enabled) !== !1, t = A(), i = K(), [o, l] = C(null), [c, m] = C(""), [r, h] = C(null), { data: p } = v({
989
757
  queryKey: ["nvr-profile-totp"],
990
- queryFn: () => r.request({ _method: "GET", _path: "/two-factor/status" }).then((f) => f.data)
991
- }), C = () => void d.invalidateQueries({ queryKey: ["nvr-profile-totp"] }), N = _({
992
- mutationFn: () => r.request({ _method: "POST", _path: "/two-factor/setup" }).then((f) => f.data),
993
- onSuccess: (f) => l(f)
994
- }), T = _({
995
- mutationFn: (f) => r.request({
758
+ queryFn: () => t.request({ _method: "GET", _path: "/two-factor/status" }).then((g) => g.data)
759
+ }), S = () => void i.invalidateQueries({ queryKey: ["nvr-profile-totp"] }), k = w({
760
+ mutationFn: () => t.request({ _method: "POST", _path: "/two-factor/setup" }).then((g) => g.data),
761
+ onSuccess: (g) => l(g)
762
+ }), F = w({
763
+ mutationFn: (g) => t.request({
996
764
  _method: "POST",
997
765
  _path: "/two-factor/verify",
998
- _body: { token: f }
766
+ _body: { token: g }
999
767
  }),
1000
768
  onSuccess: () => {
1001
- l(null), u(""), C();
769
+ l(null), m(""), S();
1002
770
  }
1003
- }), v = _({
1004
- mutationFn: (f) => r.request({
771
+ }), f = w({
772
+ mutationFn: (g) => t.request({
1005
773
  _method: "POST",
1006
774
  _path: "/two-factor/disable",
1007
- _body: { token: f }
775
+ _body: { token: g }
1008
776
  }),
1009
777
  onSuccess: () => {
1010
- u(""), C();
778
+ m(""), S();
1011
779
  }
1012
- }), O = _({
1013
- mutationFn: () => r.request({ _method: "POST", _path: "/users/me/token" }).then((f) => f.data),
1014
- onSuccess: (f) => b(f.token)
1015
- }), A = _({
1016
- mutationFn: () => r.request({ _method: "DELETE", _path: "/users/me/token" }),
1017
- onSuccess: () => b(null)
1018
- }), S = _({
1019
- mutationFn: () => r.request({ _method: "POST", _path: "/auth/logout-all" }),
780
+ }), _ = w({
781
+ mutationFn: () => t.request({ _method: "POST", _path: "/users/me/token" }).then((g) => g.data),
782
+ onSuccess: (g) => h(g.token)
783
+ }), O = w({
784
+ mutationFn: () => t.request({ _method: "DELETE", _path: "/users/me/token" }),
785
+ onSuccess: () => h(null)
786
+ }), q = w({
787
+ mutationFn: () => t.request({ _method: "POST", _path: "/auth/logout-all" }),
1020
788
  onSuccess: () => window.location.assign("/login")
1021
789
  });
1022
790
  return /* @__PURE__ */ e(
1023
- ie,
791
+ ne,
1024
792
  {
1025
- icon: /* @__PURE__ */ e(Ie, { className: "h-4 w-4" }),
793
+ icon: /* @__PURE__ */ e(Pe, { className: "h-4 w-4" }),
1026
794
  title: "Security",
1027
- hint: m ? "Two-factor sign-in and API access" : "API access",
1028
- children: /* @__PURE__ */ t("div", { className: "space-y-4", children: [
1029
- m && /* @__PURE__ */ t("div", { children: [
1030
- /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
795
+ hint: u ? "Two-factor sign-in and API access" : "API access",
796
+ children: /* @__PURE__ */ a("div", { className: "space-y-4", children: [
797
+ u && /* @__PURE__ */ a("div", { children: [
798
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
1031
799
  /* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-slate-200", children: "Two-factor authentication" }),
1032
800
  /* @__PURE__ */ e(
1033
801
  "span",
1034
802
  {
1035
- className: R(
803
+ className: Q(
1036
804
  "rounded-full px-1.5 py-px text-[10px] font-semibold",
1037
- h != null && h.enabled ? "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400" : "bg-slate-100 text-slate-500 dark:bg-muted dark:text-slate-400"
805
+ p != null && p.enabled ? "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400" : "bg-slate-100 text-slate-500 dark:bg-muted dark:text-slate-400"
1038
806
  ),
1039
- children: h != null && h.enabled ? "Enabled" : "Off"
807
+ children: p != null && p.enabled ? "Enabled" : "Off"
1040
808
  }
1041
809
  )
1042
810
  ] }),
1043
- !(h != null && h.enabled) && !o && /* @__PURE__ */ e(
811
+ !(p != null && p.enabled) && !o && /* @__PURE__ */ e(
1044
812
  "button",
1045
813
  {
1046
814
  type: "button",
1047
- onClick: () => N.mutate(),
815
+ onClick: () => k.mutate(),
1048
816
  className: "mt-2 h-8 rounded-md border border-slate-200 px-3 text-[12px] font-medium text-slate-600 hover:border-nvr-cyan hover:text-nvr-navy dark:border-border dark:text-slate-300 dark:hover:text-nvr-cyan",
1049
- children: N.isPending ? "Preparing…" : "Set up 2FA"
817
+ children: k.isPending ? "Preparing…" : "Set up 2FA"
1050
818
  }
1051
819
  ),
1052
- o && /* @__PURE__ */ t("div", { className: "mt-3 flex flex-wrap items-start gap-4", children: [
820
+ o && /* @__PURE__ */ a("div", { className: "mt-3 flex flex-wrap items-start gap-4", children: [
1053
821
  /* @__PURE__ */ e(
1054
822
  "img",
1055
823
  {
@@ -1058,14 +826,14 @@ function ht() {
1058
826
  className: "h-32 w-32 rounded-md border border-slate-200 dark:border-border"
1059
827
  }
1060
828
  ),
1061
- /* @__PURE__ */ t("div", { className: "min-w-[200px] flex-1 space-y-2", children: [
829
+ /* @__PURE__ */ a("div", { className: "min-w-[200px] flex-1 space-y-2", children: [
1062
830
  /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500", children: "Scan with your authenticator app, then enter the 6-digit code to confirm." }),
1063
- /* @__PURE__ */ t("div", { className: "flex gap-1.5", children: [
831
+ /* @__PURE__ */ a("div", { className: "flex gap-1.5", children: [
1064
832
  /* @__PURE__ */ e(
1065
833
  "input",
1066
834
  {
1067
- value: s,
1068
- onChange: (f) => u(f.target.value),
835
+ value: c,
836
+ onChange: (g) => m(g.target.value),
1069
837
  placeholder: "123456",
1070
838
  inputMode: "numeric",
1071
839
  className: "h-8 w-[110px] rounded-md border border-slate-200 px-2.5 text-center text-[13px] tabular-nums tracking-widest dark:border-border dark:bg-background"
@@ -1075,8 +843,8 @@ function ht() {
1075
843
  "button",
1076
844
  {
1077
845
  type: "button",
1078
- disabled: s.trim().length < 6 || T.isPending,
1079
- onClick: () => T.mutate(s.trim()),
846
+ disabled: c.trim().length < 6 || F.isPending,
847
+ onClick: () => F.mutate(c.trim()),
1080
848
  className: "h-8 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white disabled:opacity-50",
1081
849
  children: "Confirm"
1082
850
  }
@@ -1084,12 +852,12 @@ function ht() {
1084
852
  ] })
1085
853
  ] })
1086
854
  ] }),
1087
- (h == null ? void 0 : h.enabled) && /* @__PURE__ */ t("div", { className: "mt-2 flex gap-1.5", children: [
855
+ (p == null ? void 0 : p.enabled) && /* @__PURE__ */ a("div", { className: "mt-2 flex gap-1.5", children: [
1088
856
  /* @__PURE__ */ e(
1089
857
  "input",
1090
858
  {
1091
- value: s,
1092
- onChange: (f) => u(f.target.value),
859
+ value: c,
860
+ onChange: (g) => m(g.target.value),
1093
861
  placeholder: "Code to disable",
1094
862
  inputMode: "numeric",
1095
863
  className: "h-8 w-[130px] rounded-md border border-slate-200 px-2.5 text-[12px] dark:border-border dark:bg-background"
@@ -1099,37 +867,37 @@ function ht() {
1099
867
  "button",
1100
868
  {
1101
869
  type: "button",
1102
- disabled: s.trim().length < 6 || v.isPending,
1103
- onClick: () => v.mutate(s.trim()),
870
+ disabled: c.trim().length < 6 || f.isPending,
871
+ onClick: () => f.mutate(c.trim()),
1104
872
  className: "h-8 rounded-md border border-red-200 px-3 text-[12px] font-medium text-red-500 transition-colors hover:bg-red-50 disabled:opacity-50 dark:border-red-500/30 dark:hover:bg-red-500/10",
1105
- children: v.isPending ? "Disabling…" : "Disable"
873
+ children: f.isPending ? "Disabling…" : "Disable"
1106
874
  }
1107
875
  )
1108
876
  ] })
1109
877
  ] }),
1110
- /* @__PURE__ */ t(
878
+ /* @__PURE__ */ a(
1111
879
  "div",
1112
880
  {
1113
- className: m ? "border-t border-slate-100 pt-3 dark:border-border/60" : void 0,
881
+ className: u ? "border-t border-slate-100 pt-3 dark:border-border/60" : void 0,
1114
882
  children: [
1115
883
  /* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-slate-200", children: "API token" }),
1116
884
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11.5px] text-slate-400", children: "Personal Bearer token for scripts and integrations. Shown once — creating a new one replaces the old." }),
1117
- n && /* @__PURE__ */ e("code", { className: "mt-2 block select-all break-all rounded-md bg-slate-50 px-2.5 py-2 font-mono text-[11.5px] text-nvr-navy dark:bg-muted dark:text-nvr-cyan", children: n }),
1118
- /* @__PURE__ */ t("div", { className: "mt-2 flex gap-1.5", children: [
885
+ r && /* @__PURE__ */ e("code", { className: "mt-2 block select-all break-all rounded-md bg-slate-50 px-2.5 py-2 font-mono text-[11.5px] text-nvr-navy dark:bg-muted dark:text-nvr-cyan", children: r }),
886
+ /* @__PURE__ */ a("div", { className: "mt-2 flex gap-1.5", children: [
1119
887
  /* @__PURE__ */ e(
1120
888
  "button",
1121
889
  {
1122
890
  type: "button",
1123
- onClick: () => O.mutate(),
891
+ onClick: () => _.mutate(),
1124
892
  className: "h-8 rounded-md border border-slate-200 px-3 text-[12px] font-medium text-slate-600 hover:border-nvr-cyan hover:text-nvr-navy dark:border-border dark:text-slate-300 dark:hover:text-nvr-cyan",
1125
- children: O.isPending ? "Generating…" : "Generate token"
893
+ children: _.isPending ? "Generating…" : "Generate token"
1126
894
  }
1127
895
  ),
1128
896
  /* @__PURE__ */ e(
1129
- fe,
897
+ me,
1130
898
  {
1131
899
  title: "Revoke API token",
1132
- onConfirm: () => A.mutate(),
900
+ onConfirm: () => O.mutate(),
1133
901
  confirmLabel: "Revoke token?",
1134
902
  className: "h-8 rounded-md px-3 text-[12px] font-medium text-slate-400 transition-colors hover:text-red-500",
1135
903
  armedClassName: "font-semibold text-red-500",
@@ -1140,20 +908,20 @@ function ht() {
1140
908
  ]
1141
909
  }
1142
910
  ),
1143
- /* @__PURE__ */ t("div", { className: "border-t border-slate-100 pt-3 dark:border-border/60", children: [
911
+ /* @__PURE__ */ a("div", { className: "border-t border-slate-100 pt-3 dark:border-border/60", children: [
1144
912
  /* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-slate-200", children: "Sessions" }),
1145
913
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11.5px] text-slate-400", children: "Signs you out on every device and browser, including this one." }),
1146
- /* @__PURE__ */ t(
1147
- fe,
914
+ /* @__PURE__ */ a(
915
+ me,
1148
916
  {
1149
917
  title: "Sign out everywhere",
1150
- onConfirm: () => S.mutate(),
918
+ onConfirm: () => q.mutate(),
1151
919
  confirmLabel: "Sign out everywhere?",
1152
920
  className: "mt-2 inline-flex h-8 items-center gap-1.5 rounded-md border border-slate-200 px-3 text-[12px] font-medium text-slate-600 transition-colors hover:border-red-300 hover:text-red-500 dark:border-border dark:text-slate-300 dark:hover:border-red-500/40 dark:hover:text-red-400",
1153
921
  armedClassName: "border-red-300 font-semibold text-red-500 dark:border-red-500/40 dark:text-red-400",
1154
922
  children: [
1155
- /* @__PURE__ */ e(Ke, { className: "h-3.5 w-3.5" }),
1156
- S.isPending ? "Signing out…" : "Sign out everywhere"
923
+ /* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" }),
924
+ q.isPending ? "Signing out…" : "Sign out everywhere"
1157
925
  ]
1158
926
  }
1159
927
  )
@@ -1162,104 +930,104 @@ function ht() {
1162
930
  }
1163
931
  );
1164
932
  }
1165
- function Gt({
1166
- userId: i,
1167
- className: m,
1168
- initialTab: r,
1169
- extra: d,
933
+ function Wt({
934
+ userId: s,
935
+ className: u,
936
+ initialTab: t,
937
+ extra: i,
1170
938
  pushServiceWorker: o = "/sw.js"
1171
939
  }) {
1172
- const l = ve();
1173
- return !i || (l == null ? void 0 : l.userId) != null && String(l.userId) === String(i) ? /* @__PURE__ */ e(bt, { className: m, extra: d, pushServiceWorker: o }) : /* @__PURE__ */ e(nt, { userId: i, className: m, initialTab: r });
940
+ const l = pe();
941
+ return !s || (l == null ? void 0 : l.userId) != null && String(l.userId) === String(s) ? /* @__PURE__ */ e(mt, { className: u, extra: i, pushServiceWorker: o }) : /* @__PURE__ */ e(Xe, { userId: s, className: u, initialTab: t });
1174
942
  }
1175
- function bt({
1176
- className: i,
1177
- extra: m,
1178
- pushServiceWorker: r
943
+ function mt({
944
+ className: s,
945
+ extra: u,
946
+ pushServiceWorker: t
1179
947
  }) {
1180
- var j;
1181
- const d = L(), o = K(), l = ve(), s = !0, u = "me", { data: n } = w({
1182
- queryKey: ["nvr-profile-user", u],
1183
- queryFn: () => d.request(Se(u)).then((c) => c.data),
1184
- enabled: s
1185
- }), b = (n == null ? void 0 : n.id) ?? null, { data: h } = w({
1186
- queryKey: ["nvr-profile-card", b],
1187
- queryFn: () => d.request(_e(b)).then((c) => c.data),
1188
- enabled: !!b
1189
- }), [C, N] = q(null), T = $e(
948
+ var E;
949
+ const i = A(), o = K(), l = pe(), c = !0, m = "me", { data: r } = v({
950
+ queryKey: ["nvr-profile-user", m],
951
+ queryFn: () => i.request(he(m)).then((d) => d.data),
952
+ enabled: c
953
+ }), h = (r == null ? void 0 : r.id) ?? null, { data: p } = v({
954
+ queryKey: ["nvr-profile-card", h],
955
+ queryFn: () => i.request(be(h)).then((d) => d.data),
956
+ enabled: !!h
957
+ }), [S, k] = C(null), F = Ae(
1190
958
  () => ({
1191
- first_name: (n == null ? void 0 : n.first_name) ?? "",
1192
- last_name: (n == null ? void 0 : n.last_name) ?? "",
1193
- title: (n == null ? void 0 : n.title) ?? "",
1194
- department: (n == null ? void 0 : n.department) ?? "",
1195
- phone: (n == null ? void 0 : n.phone) ?? ""
959
+ first_name: (r == null ? void 0 : r.first_name) ?? "",
960
+ last_name: (r == null ? void 0 : r.last_name) ?? "",
961
+ title: (r == null ? void 0 : r.title) ?? "",
962
+ department: (r == null ? void 0 : r.department) ?? "",
963
+ phone: (r == null ? void 0 : r.phone) ?? ""
1196
964
  }),
1197
- [n]
1198
- ), v = C ?? T, O = JSON.stringify(v) !== JSON.stringify(T), A = _({
1199
- mutationFn: () => d.request(be(n.id, v)),
965
+ [r]
966
+ ), f = S ?? F, _ = JSON.stringify(f) !== JSON.stringify(F), O = w({
967
+ mutationFn: () => i.request(oe(r.id, f)),
1200
968
  onSuccess: () => {
1201
- N(null), o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] });
969
+ k(null), o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] });
1202
970
  }
1203
- }), [S, f] = q(xt), z = je(null), P = _({
1204
- mutationFn: async (c) => {
1205
- const k = await new Promise((F, J) => {
1206
- const M = new Image(), W = URL.createObjectURL(c);
1207
- M.onload = () => {
1208
- URL.revokeObjectURL(W);
1209
- const Q = 96, B = document.createElement("canvas");
1210
- B.width = Q, B.height = Q;
1211
- const V = B.getContext("2d");
971
+ }), [q, g] = C(ut), $ = ue(null), L = w({
972
+ mutationFn: async (d) => {
973
+ const y = await new Promise((P, J) => {
974
+ const D = new Image(), z = URL.createObjectURL(d);
975
+ D.onload = () => {
976
+ URL.revokeObjectURL(z);
977
+ const M = 96, I = document.createElement("canvas");
978
+ I.width = M, I.height = M;
979
+ const V = I.getContext("2d");
1212
980
  if (!V) return J(new Error("canvas unavailable"));
1213
- const Z = Math.max(Q / M.width, Q / M.height), X = M.width * Z, ee = M.height * Z;
1214
- V.drawImage(M, (Q - X) / 2, (Q - ee) / 2, X, ee), F(B.toDataURL("image/jpeg", 0.85));
1215
- }, M.onerror = () => {
1216
- URL.revokeObjectURL(W), J(new Error("not an image"));
1217
- }, M.src = W;
981
+ const Z = Math.max(M / D.width, M / D.height), Y = D.width * Z, W = D.height * Z;
982
+ V.drawImage(D, (M - Y) / 2, (M - W) / 2, Y, W), P(I.toDataURL("image/jpeg", 0.85));
983
+ }, D.onerror = () => {
984
+ URL.revokeObjectURL(z), J(new Error("not an image"));
985
+ }, D.src = z;
1218
986
  });
1219
- await d.request(be(n.id, { avatar: k }));
987
+ await i.request(oe(r.id, { avatar: y }));
1220
988
  },
1221
989
  onSuccess: () => {
1222
990
  o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] }), o.invalidateQueries({ queryKey: ["user-card"] }), o.invalidateQueries({ queryKey: ["user-avatar"] });
1223
991
  }
1224
- }), y = h ?? (n ? { ...n, role_name: null } : null);
1225
- if (!y)
1226
- return /* @__PURE__ */ t("div", { className: R("flex animate-pulse flex-col gap-4", i), "aria-busy": "true", children: [
1227
- /* @__PURE__ */ t("div", { className: "flex items-center gap-5 rounded-lg border border-slate-200 bg-white p-5 dark:border-border dark:bg-card", children: [
992
+ }), x = p ?? (r ? { ...r, role_name: null } : null);
993
+ if (!x)
994
+ return /* @__PURE__ */ a("div", { className: Q("flex animate-pulse flex-col gap-4", s), "aria-busy": "true", children: [
995
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-5 rounded-lg border border-slate-200 bg-white p-5 dark:border-border dark:bg-card", children: [
1228
996
  /* @__PURE__ */ e("div", { className: "h-[76px] w-[76px] rounded-full bg-slate-100 dark:bg-muted" }),
1229
- /* @__PURE__ */ t("div", { className: "flex-1 space-y-2.5", children: [
997
+ /* @__PURE__ */ a("div", { className: "flex-1 space-y-2.5", children: [
1230
998
  /* @__PURE__ */ e("div", { className: "h-5 w-48 rounded bg-slate-100 dark:bg-muted" }),
1231
999
  /* @__PURE__ */ e("div", { className: "h-3.5 w-72 max-w-full rounded bg-slate-100 dark:bg-muted" }),
1232
1000
  /* @__PURE__ */ e("div", { className: "h-3.5 w-56 max-w-full rounded bg-slate-100 dark:bg-muted" })
1233
1001
  ] })
1234
1002
  ] }),
1235
- /* @__PURE__ */ t("div", { className: "grid gap-4 lg:grid-cols-2", children: [
1003
+ /* @__PURE__ */ a("div", { className: "grid gap-4 lg:grid-cols-2", children: [
1236
1004
  /* @__PURE__ */ e("div", { className: "h-64 rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card" }),
1237
1005
  /* @__PURE__ */ e("div", { className: "h-64 rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card" })
1238
1006
  ] })
1239
1007
  ] });
1240
- const $ = (n == null ? void 0 : n.avatar) ?? null, U = y.status === "active";
1241
- return /* @__PURE__ */ t("div", { className: R("flex flex-col gap-4", i), "data-nvr-profile": !0, children: [
1242
- /* @__PURE__ */ e("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-x-5 gap-y-4 p-5", children: [
1243
- /* @__PURE__ */ t("div", { className: "relative", children: [
1244
- $ ? /* @__PURE__ */ e(
1008
+ const R = (r == null ? void 0 : r.avatar) ?? null, j = x.status === "active";
1009
+ return /* @__PURE__ */ a("div", { className: Q("flex flex-col gap-4", s), "data-nvr-profile": !0, children: [
1010
+ /* @__PURE__ */ e("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-x-5 gap-y-4 p-5", children: [
1011
+ /* @__PURE__ */ a("div", { className: "relative", children: [
1012
+ R ? /* @__PURE__ */ e(
1245
1013
  "img",
1246
1014
  {
1247
- src: $.startsWith("data:") ? $ : `/api/files/${$}`,
1015
+ src: R.startsWith("data:") ? R : `/api/files/${R}`,
1248
1016
  alt: "",
1249
1017
  className: "h-[76px] w-[76px] rounded-full border border-slate-200 object-cover dark:border-border"
1250
1018
  }
1251
- ) : /* @__PURE__ */ e("span", { className: "flex h-[76px] w-[76px] items-center justify-center rounded-full bg-[#c7f0fb] text-[24px] font-semibold text-[#04516b] dark:bg-nvr-cyan/15 dark:text-nvr-cyan", children: ot(y) }),
1019
+ ) : /* @__PURE__ */ e("span", { className: "flex h-[76px] w-[76px] items-center justify-center rounded-full bg-[#c7f0fb] text-[24px] font-semibold text-[#04516b] dark:bg-nvr-cyan/15 dark:text-nvr-cyan", children: at(x) }),
1252
1020
  /* @__PURE__ */ e(
1253
1021
  "span",
1254
1022
  {
1255
- className: R(
1023
+ className: Q(
1256
1024
  "absolute bottom-0.5 right-0.5 h-3 w-3 rounded-full border-2 border-white dark:border-card",
1257
- U ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
1025
+ j ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
1258
1026
  ),
1259
- title: U ? "Active" : y.status
1027
+ title: j ? "Active" : x.status
1260
1028
  }
1261
1029
  ),
1262
- /* @__PURE__ */ t(oe, { children: [
1030
+ /* @__PURE__ */ a(X, { children: [
1263
1031
  /* @__PURE__ */ e(
1264
1032
  "button",
1265
1033
  {
@@ -1267,82 +1035,82 @@ function bt({
1267
1035
  title: "Change photo",
1268
1036
  "aria-label": "Change photo",
1269
1037
  onClick: () => {
1270
- var c;
1271
- return (c = z.current) == null ? void 0 : c.click();
1038
+ var d;
1039
+ return (d = $.current) == null ? void 0 : d.click();
1272
1040
  },
1273
1041
  className: "absolute -right-1 -top-1 flex h-7 w-7 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-500 shadow-sm transition-colors hover:border-nvr-cyan hover:text-nvr-navy dark:border-border dark:bg-background dark:text-slate-300 dark:hover:text-nvr-cyan",
1274
- children: P.isPending ? /* @__PURE__ */ e(xe, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Pe, { className: "h-3.5 w-3.5" })
1042
+ children: L.isPending ? /* @__PURE__ */ e(ie, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(fe, { className: "h-3.5 w-3.5" })
1275
1043
  }
1276
1044
  ),
1277
1045
  /* @__PURE__ */ e(
1278
1046
  "input",
1279
1047
  {
1280
- ref: z,
1048
+ ref: $,
1281
1049
  type: "file",
1282
1050
  accept: "image/*",
1283
1051
  className: "hidden",
1284
- onChange: (c) => {
1285
- var F;
1286
- const k = (F = c.target.files) == null ? void 0 : F[0];
1287
- k && P.mutate(k), c.target.value = "";
1052
+ onChange: (d) => {
1053
+ var P;
1054
+ const y = (P = d.target.files) == null ? void 0 : P[0];
1055
+ y && L.mutate(y), d.target.value = "";
1288
1056
  }
1289
1057
  }
1290
1058
  )
1291
1059
  ] })
1292
1060
  ] }),
1293
- /* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: [
1294
- /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2", children: [
1295
- /* @__PURE__ */ e("h1", { className: "text-[21px] font-semibold tracking-[-0.015em] text-slate-900 dark:text-white", children: lt(y) }),
1296
- y.role_name && /* @__PURE__ */ e("span", { className: "rounded-full bg-nvr-cyan/10 px-2 py-px text-[10.5px] font-semibold text-nvr-navy dark:text-nvr-cyan", children: y.role_name }),
1297
- y.is_out_of_office && /* @__PURE__ */ e("span", { className: "rounded-full bg-amber-50 px-2 py-px text-[10.5px] font-semibold text-amber-600 dark:bg-amber-500/10 dark:text-amber-400", children: "Out of office" }),
1298
- /* @__PURE__ */ e(Ze, { email: y.email, canClear: l.isAdmin })
1061
+ /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
1062
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
1063
+ /* @__PURE__ */ e("h1", { className: "text-[21px] font-semibold tracking-[-0.015em] text-slate-900 dark:text-white", children: tt(x) }),
1064
+ x.role_name && /* @__PURE__ */ e("span", { className: "rounded-full bg-nvr-cyan/10 px-2 py-px text-[10.5px] font-semibold text-nvr-navy dark:text-nvr-cyan", children: x.role_name }),
1065
+ x.is_out_of_office && /* @__PURE__ */ e("span", { className: "rounded-full bg-amber-50 px-2 py-px text-[10.5px] font-semibold text-amber-600 dark:bg-amber-500/10 dark:text-amber-400", children: "Out of office" }),
1066
+ /* @__PURE__ */ e(He, { email: x.email, canClear: l.isAdmin })
1299
1067
  ] }),
1300
- n && // The same status the chat panel's Online tab sets — one editor,
1068
+ r && // The same status the chat panel's Online tab sets — one editor,
1301
1069
  // one preference, so the profile always agrees with the top bar.
1302
1070
  /* @__PURE__ */ e(
1303
- Be,
1071
+ Le,
1304
1072
  {
1305
- status: He(
1306
- (j = n.preferences) == null ? void 0 : j.custom_status
1073
+ status: Me(
1074
+ (E = r.preferences) == null ? void 0 : E.custom_status
1307
1075
  ),
1308
1076
  showExpiry: !0,
1309
1077
  className: "mt-1.5"
1310
1078
  }
1311
1079
  ),
1312
- (y.title || y.department) && /* @__PURE__ */ e("p", { className: "mt-0.5 truncate text-[13px] text-slate-500 dark:text-slate-400", children: [y.title, y.department].filter(Boolean).join(" · ") }),
1313
- /* @__PURE__ */ t("div", { className: "mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 text-[12.5px] text-slate-500 dark:text-slate-400", children: [
1314
- y.company && /* @__PURE__ */ t("span", { className: "inline-flex items-center gap-1.5", children: [
1315
- /* @__PURE__ */ e(Ae, { className: "h-3.5 w-3.5" }),
1080
+ (x.title || x.department) && /* @__PURE__ */ e("p", { className: "mt-0.5 truncate text-[13px] text-slate-500 dark:text-slate-400", children: [x.title, x.department].filter(Boolean).join(" · ") }),
1081
+ /* @__PURE__ */ a("div", { className: "mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 text-[12.5px] text-slate-500 dark:text-slate-400", children: [
1082
+ x.company && /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", children: [
1083
+ /* @__PURE__ */ e(ye, { className: "h-3.5 w-3.5" }),
1316
1084
  " ",
1317
- y.company
1085
+ x.company
1318
1086
  ] }),
1319
- /* @__PURE__ */ t(
1087
+ /* @__PURE__ */ a(
1320
1088
  "a",
1321
1089
  {
1322
- href: `mailto:${y.email}`,
1090
+ href: `mailto:${x.email}`,
1323
1091
  className: "inline-flex items-center gap-1.5 transition-colors hover:text-nvr-navy dark:hover:text-nvr-cyan",
1324
1092
  children: [
1325
- /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5" }),
1093
+ /* @__PURE__ */ e(ve, { className: "h-3.5 w-3.5" }),
1326
1094
  " ",
1327
- y.email
1095
+ x.email
1328
1096
  ]
1329
1097
  }
1330
1098
  ),
1331
- y.phone && /* @__PURE__ */ t(
1099
+ x.phone && /* @__PURE__ */ a(
1332
1100
  "a",
1333
1101
  {
1334
- href: `tel:${y.phone}`,
1102
+ href: `tel:${x.phone}`,
1335
1103
  className: "inline-flex items-center gap-1.5 transition-colors hover:text-nvr-navy dark:hover:text-nvr-cyan",
1336
1104
  children: [
1337
- /* @__PURE__ */ e(Oe, { className: "h-3.5 w-3.5" }),
1105
+ /* @__PURE__ */ e(ke, { className: "h-3.5 w-3.5" }),
1338
1106
  " ",
1339
- y.phone
1107
+ x.phone
1340
1108
  ]
1341
1109
  }
1342
1110
  ),
1343
- y.last_access && /* @__PURE__ */ t("span", { className: "inline-flex items-center gap-1.5", title: "Last active", children: [
1344
- /* @__PURE__ */ e(Fe, { className: "h-3.5 w-3.5" }),
1345
- new Date(y.last_access).toLocaleDateString(void 0, {
1111
+ x.last_access && /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", title: "Last active", children: [
1112
+ /* @__PURE__ */ e(Ne, { className: "h-3.5 w-3.5" }),
1113
+ new Date(x.last_access).toLocaleDateString(void 0, {
1346
1114
  month: "short",
1347
1115
  day: "numeric"
1348
1116
  })
@@ -1350,151 +1118,155 @@ function bt({
1350
1118
  ] })
1351
1119
  ] })
1352
1120
  ] }) }),
1353
- /* @__PURE__ */ e(gt, { tab: S, onChange: f }),
1354
- S === "agents" ? /* @__PURE__ */ e(Ye, {}) : n ? (
1121
+ /* @__PURE__ */ e(pt, { tab: q, onChange: g }),
1122
+ q === "agents" ? /* @__PURE__ */ e(Qe, {}) : q === "did" && r ? (
1123
+ // #13 — your own audit trail, by day and collection.
1124
+ /* @__PURE__ */ e(Ye, { userId: String(r.id), name: null })
1125
+ ) : r ? (
1355
1126
  // One list in reading order — you, then notifications, then access
1356
1127
  // and security — flowing into two balanced columns. Two fixed stacks
1357
1128
  // left thirteen cards on one side and four on the other, and the page
1358
1129
  // ran as long as the heavy side. Cards never split across columns.
1359
- /* @__PURE__ */ t(
1130
+ /* @__PURE__ */ a(
1360
1131
  "div",
1361
1132
  {
1362
1133
  className: "gap-4 lg:columns-2 [&>*]:mb-4 [&>*]:break-inside-avoid",
1363
1134
  "data-profile-columns": !0,
1364
1135
  children: [
1365
1136
  /* @__PURE__ */ e(
1366
- ie,
1137
+ ne,
1367
1138
  {
1368
- icon: /* @__PURE__ */ e(Me, { className: "h-4 w-4" }),
1139
+ icon: /* @__PURE__ */ e(_e, { className: "h-4 w-4" }),
1369
1140
  title: "About you",
1370
1141
  hint: "Shown on your contact card across the app",
1371
- actions: O && /* @__PURE__ */ t("span", { className: "flex items-center gap-1.5", children: [
1372
- /* @__PURE__ */ t(
1142
+ actions: _ && /* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
1143
+ /* @__PURE__ */ a(
1373
1144
  "button",
1374
1145
  {
1375
1146
  type: "button",
1376
1147
  title: "Discard changes",
1377
- onClick: () => N(null),
1148
+ onClick: () => k(null),
1378
1149
  className: "inline-flex h-7 items-center gap-1 rounded-md px-2 text-[11.5px] font-medium text-slate-400 transition-colors hover:text-slate-600 dark:hover:text-slate-200",
1379
1150
  children: [
1380
- /* @__PURE__ */ e(Le, { className: "h-3 w-3" }),
1151
+ /* @__PURE__ */ e(we, { className: "h-3 w-3" }),
1381
1152
  " Reset"
1382
1153
  ]
1383
1154
  }
1384
1155
  ),
1385
- /* @__PURE__ */ t(
1156
+ /* @__PURE__ */ a(
1386
1157
  "button",
1387
1158
  {
1388
1159
  type: "button",
1389
- disabled: A.isPending,
1390
- onClick: () => A.mutate(),
1160
+ disabled: O.isPending,
1161
+ onClick: () => O.mutate(),
1391
1162
  className: "inline-flex h-7 items-center gap-1 rounded-md bg-nvr-cyan px-2.5 text-[11.5px] font-semibold text-white transition-opacity disabled:opacity-50",
1392
1163
  children: [
1393
- A.isPending ? /* @__PURE__ */ e(xe, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(De, { className: "h-3 w-3" }),
1164
+ O.isPending ? /* @__PURE__ */ e(ie, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(Se, { className: "h-3 w-3" }),
1394
1165
  " ",
1395
1166
  "Save"
1396
1167
  ]
1397
1168
  }
1398
1169
  )
1399
1170
  ] }),
1400
- children: /* @__PURE__ */ t("div", { className: "grid gap-3 sm:grid-cols-2", children: [
1171
+ children: /* @__PURE__ */ a("div", { className: "grid gap-3 sm:grid-cols-2", children: [
1401
1172
  /* @__PURE__ */ e(
1402
- Y,
1173
+ H,
1403
1174
  {
1404
1175
  label: "First name",
1405
- value: v.first_name,
1406
- onChange: (c) => N({ ...v, first_name: c })
1176
+ value: f.first_name,
1177
+ onChange: (d) => k({ ...f, first_name: d })
1407
1178
  }
1408
1179
  ),
1409
1180
  /* @__PURE__ */ e(
1410
- Y,
1181
+ H,
1411
1182
  {
1412
1183
  label: "Last name",
1413
- value: v.last_name,
1414
- onChange: (c) => N({ ...v, last_name: c })
1184
+ value: f.last_name,
1185
+ onChange: (d) => k({ ...f, last_name: d })
1415
1186
  }
1416
1187
  ),
1417
1188
  /* @__PURE__ */ e(
1418
- Y,
1189
+ H,
1419
1190
  {
1420
1191
  label: "Title",
1421
- value: v.title,
1422
- onChange: (c) => N({ ...v, title: c }),
1192
+ value: f.title,
1193
+ onChange: (d) => k({ ...f, title: d }),
1423
1194
  placeholder: "e.g. Construction Manager"
1424
1195
  }
1425
1196
  ),
1426
1197
  /* @__PURE__ */ e(
1427
- Y,
1198
+ H,
1428
1199
  {
1429
1200
  label: "Department",
1430
- value: v.department,
1431
- onChange: (c) => N({ ...v, department: c })
1201
+ value: f.department,
1202
+ onChange: (d) => k({ ...f, department: d })
1432
1203
  }
1433
1204
  ),
1434
1205
  /* @__PURE__ */ e(
1435
- Y,
1206
+ H,
1436
1207
  {
1437
1208
  label: "Phone",
1438
- value: v.phone,
1439
- onChange: (c) => N({ ...v, phone: c }),
1209
+ value: f.phone,
1210
+ onChange: (d) => k({ ...f, phone: d }),
1440
1211
  placeholder: "+1 …",
1441
1212
  type: "tel"
1442
1213
  }
1443
1214
  ),
1444
- /* @__PURE__ */ e(Y, { label: "Email", value: n.email ?? "", disabled: !0, hint: "managed by admin" })
1215
+ /* @__PURE__ */ e(H, { label: "Email", value: r.email ?? "", disabled: !0, hint: "managed by admin" })
1445
1216
  ] })
1446
1217
  }
1447
1218
  ),
1448
1219
  /* @__PURE__ */ e(
1449
- Ve,
1220
+ Be,
1450
1221
  {
1451
- user: n,
1222
+ user: r,
1452
1223
  onSaved: () => {
1453
1224
  o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] });
1454
1225
  }
1455
1226
  }
1456
1227
  ),
1457
- /* @__PURE__ */ e(it, {}),
1458
- /* @__PURE__ */ e(ut, {}),
1459
- /* @__PURE__ */ e(wt, {}),
1460
- /* @__PURE__ */ e(at, {}),
1228
+ /* @__PURE__ */ e(nt, {}),
1229
+ /* @__PURE__ */ e(ot, {}),
1230
+ /* @__PURE__ */ e(yt, {}),
1231
+ /* @__PURE__ */ e(Ve, {}),
1232
+ /* @__PURE__ */ e(lt, {}),
1233
+ /* @__PURE__ */ e(Ue, {}),
1234
+ /* @__PURE__ */ e($e, {}),
1235
+ l.isAdmin && (r != null && r.id) ? /* @__PURE__ */ e(Ze, { userId: String(r.id) }) : /* @__PURE__ */ e(it, {}),
1236
+ /* @__PURE__ */ e(bt, {}),
1237
+ /* @__PURE__ */ e(We, { userId: "me" }),
1238
+ /* @__PURE__ */ e(xt, {}),
1239
+ /* @__PURE__ */ e(st, {}),
1240
+ /* @__PURE__ */ e(Je, {}),
1241
+ t !== !1 && /* @__PURE__ */ e(ze, { serviceWorkerPath: t }),
1242
+ /* @__PURE__ */ e(gt, {}),
1461
1243
  /* @__PURE__ */ e(ct, {}),
1462
- /* @__PURE__ */ e(We, {}),
1463
- /* @__PURE__ */ e(Ge, {}),
1464
- l.isAdmin && (n != null && n.id) ? /* @__PURE__ */ e(rt, { userId: String(n.id) }) : /* @__PURE__ */ e(mt, {}),
1465
1244
  /* @__PURE__ */ e(ft, {}),
1466
- /* @__PURE__ */ e(Xe, { userId: "me" }),
1467
- /* @__PURE__ */ e(vt, {}),
1468
- /* @__PURE__ */ e(dt, {}),
1469
- /* @__PURE__ */ e(tt, {}),
1470
- r !== !1 && /* @__PURE__ */ e(Je, { serviceWorkerPath: r }),
1471
- /* @__PURE__ */ e(kt, {}),
1472
1245
  /* @__PURE__ */ e(ht, {}),
1473
- /* @__PURE__ */ e(Nt, {}),
1474
- /* @__PURE__ */ e(yt, {}),
1475
- m
1246
+ u
1476
1247
  ]
1477
1248
  }
1478
1249
  )
1479
1250
  ) : null
1480
1251
  ] });
1481
1252
  }
1482
- function xt() {
1253
+ function ut() {
1483
1254
  try {
1484
- return new URLSearchParams(window.location.search).get("tab") === "agents" ? "agents" : "profile";
1255
+ const s = new URLSearchParams(window.location.search).get("tab");
1256
+ return s === "agents" || s === "did" ? s : "profile";
1485
1257
  } catch {
1486
1258
  return "profile";
1487
1259
  }
1488
1260
  }
1489
- function gt({
1490
- tab: i,
1491
- onChange: m
1261
+ function pt({
1262
+ tab: s,
1263
+ onChange: u
1492
1264
  }) {
1493
- const r = (o) => {
1494
- m(o);
1265
+ const t = (o) => {
1266
+ u(o);
1495
1267
  try {
1496
1268
  const l = new URL(window.location.href);
1497
- o === "agents" ? l.searchParams.set("tab", "agents") : l.searchParams.delete("tab"), window.history.replaceState(window.history.state, "", l);
1269
+ o !== "profile" ? l.searchParams.set("tab", o) : l.searchParams.delete("tab"), window.history.replaceState(window.history.state, "", l);
1498
1270
  } catch {
1499
1271
  }
1500
1272
  };
@@ -1506,17 +1278,18 @@ function gt({
1506
1278
  className: "flex gap-1 border-b border-slate-200 dark:border-border",
1507
1279
  children: [
1508
1280
  ["profile", "Profile"],
1509
- ["agents", "What my agents did"]
1281
+ ["agents", "What my agents did"],
1282
+ ["did", "What I did"]
1510
1283
  ].map(([o, l]) => /* @__PURE__ */ e(
1511
1284
  "button",
1512
1285
  {
1513
1286
  type: "button",
1514
1287
  role: "tab",
1515
- "aria-selected": i === o,
1516
- onClick: () => r(o),
1517
- className: R(
1288
+ "aria-selected": s === o,
1289
+ onClick: () => t(o),
1290
+ className: Q(
1518
1291
  "-mb-px border-b-2 px-3 py-2 text-[13px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40",
1519
- i === o ? "border-nvr-cyan text-slate-900 dark:text-white" : "border-transparent text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-200"
1292
+ s === o ? "border-nvr-cyan text-slate-900 dark:text-white" : "border-transparent text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-200"
1520
1293
  ),
1521
1294
  children: l
1522
1295
  },
@@ -1525,119 +1298,119 @@ function gt({
1525
1298
  }
1526
1299
  );
1527
1300
  }
1528
- function yt() {
1529
- const i = L(), [m, r] = q(!1), { data: d = [], isLoading: o } = w({
1301
+ function ht() {
1302
+ const s = A(), [u, t] = C(!1), { data: i = [], isLoading: o } = v({
1530
1303
  queryKey: ["my-matrix-seats"],
1531
- queryFn: () => i.request(D("/pipelines/my-seats")).then((s) => s.data ?? []).catch(() => []),
1532
- enabled: m,
1304
+ queryFn: () => s.request(T("/pipelines/my-seats")).then((c) => c.data ?? []).catch(() => []),
1305
+ enabled: u,
1533
1306
  staleTime: 6e4
1534
1307
  }), l = /* @__PURE__ */ new Map();
1535
- for (const s of d) {
1536
- const u = l.get(s.template_name) ?? [];
1537
- u.push(s), l.set(s.template_name, u);
1308
+ for (const c of i) {
1309
+ const m = l.get(c.template_name) ?? [];
1310
+ m.push(c), l.set(c.template_name, m);
1538
1311
  }
1539
- return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white p-4 dark:border-border dark:bg-card", children: [
1540
- /* @__PURE__ */ t(
1312
+ return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white p-4 dark:border-border dark:bg-card", children: [
1313
+ /* @__PURE__ */ a(
1541
1314
  "button",
1542
1315
  {
1543
1316
  type: "button",
1544
- onClick: () => r((s) => !s),
1317
+ onClick: () => t((c) => !c),
1545
1318
  className: "flex w-full items-center justify-between text-left",
1546
1319
  children: [
1547
- /* @__PURE__ */ t("div", { children: [
1320
+ /* @__PURE__ */ a("div", { children: [
1548
1321
  /* @__PURE__ */ e("h3", { className: "text-[14px] font-semibold", children: "My approval seats" }),
1549
1322
  /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: "Every owner-matrix cell you sit in — why records land in your queue." })
1550
1323
  ] }),
1551
- /* @__PURE__ */ e("span", { className: "text-slate-400", children: m ? "▾" : "▸" })
1324
+ /* @__PURE__ */ e("span", { className: "text-slate-400", children: u ? "▾" : "▸" })
1552
1325
  ]
1553
1326
  }
1554
1327
  ),
1555
- m && (o ? /* @__PURE__ */ e("p", { className: "mt-3 text-[12.5px] text-slate-400", children: "Loading…" }) : d.length === 0 ? /* @__PURE__ */ e("p", { className: "mt-3 text-[12.5px] text-slate-400", children: "You're not in any owner groups — approvals never route to you automatically." }) : /* @__PURE__ */ e("div", { className: "mt-3 space-y-3", children: [...l.entries()].map(([s, u]) => /* @__PURE__ */ t("div", { children: [
1556
- /* @__PURE__ */ e("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: s }),
1557
- /* @__PURE__ */ t("ul", { className: "mt-1 space-y-1.5", children: [
1558
- u.slice(0, 40).map((n) => /* @__PURE__ */ t("li", { className: "text-[12.5px]", children: [
1559
- /* @__PURE__ */ e("span", { className: "font-medium", children: n.state_label || n.state_key }),
1560
- n.group_name && /* @__PURE__ */ t("span", { className: "text-slate-500 dark:text-muted-foreground", children: [
1328
+ u && (o ? /* @__PURE__ */ e("p", { className: "mt-3 text-[12.5px] text-slate-400", children: "Loading…" }) : i.length === 0 ? /* @__PURE__ */ e("p", { className: "mt-3 text-[12.5px] text-slate-400", children: "You're not in any owner groups — approvals never route to you automatically." }) : /* @__PURE__ */ e("div", { className: "mt-3 space-y-3", children: [...l.entries()].map(([c, m]) => /* @__PURE__ */ a("div", { children: [
1329
+ /* @__PURE__ */ e("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: c }),
1330
+ /* @__PURE__ */ a("ul", { className: "mt-1 space-y-1.5", children: [
1331
+ m.slice(0, 40).map((r) => /* @__PURE__ */ a("li", { className: "text-[12.5px]", children: [
1332
+ /* @__PURE__ */ e("span", { className: "font-medium", children: r.state_label || r.state_key }),
1333
+ r.group_name && /* @__PURE__ */ a("span", { className: "text-slate-500 dark:text-muted-foreground", children: [
1561
1334
  " ",
1562
1335
  "— ",
1563
- n.group_name
1336
+ r.group_name
1564
1337
  ] }),
1565
- (n.is_default === !0 || n.is_default === 1) && /* @__PURE__ */ e("span", { className: "ml-1.5 rounded bg-slate-100 px-1 py-px text-[9.5px] text-slate-500 dark:bg-muted", children: "default" }),
1566
- Array.isArray(n.filters) && n.filters.length > 0 && // "Region: KEY Zone: Zone 1" — what the matrix cell matches on.
1338
+ (r.is_default === !0 || r.is_default === 1) && /* @__PURE__ */ e("span", { className: "ml-1.5 rounded bg-slate-100 px-1 py-px text-[9.5px] text-slate-500 dark:bg-muted", children: "default" }),
1339
+ Array.isArray(r.filters) && r.filters.length > 0 && // "Region: KEY Zone: Zone 1" — what the matrix cell matches on.
1567
1340
  /* @__PURE__ */ e(
1568
1341
  "span",
1569
1342
  {
1570
1343
  "data-seat-filters": !0,
1571
1344
  className: "mt-0.5 flex flex-wrap gap-x-2.5 gap-y-0.5 text-[11.5px]",
1572
- children: n.filters.map((b) => /* @__PURE__ */ t("span", { className: "whitespace-nowrap", children: [
1573
- /* @__PURE__ */ t("span", { className: "text-slate-500 dark:text-slate-400", children: [
1574
- b.label ?? b.field,
1345
+ children: r.filters.map((h) => /* @__PURE__ */ a("span", { className: "whitespace-nowrap", children: [
1346
+ /* @__PURE__ */ a("span", { className: "text-slate-500 dark:text-slate-400", children: [
1347
+ h.label ?? h.field,
1575
1348
  ":"
1576
1349
  ] }),
1577
1350
  " ",
1578
- /* @__PURE__ */ e("span", { className: "text-slate-600 dark:text-slate-300", children: String(b.value ?? "—") })
1579
- ] }, b.field))
1351
+ /* @__PURE__ */ e("span", { className: "text-slate-600 dark:text-slate-300", children: String(h.value ?? "—") })
1352
+ ] }, h.field))
1580
1353
  }
1581
1354
  )
1582
- ] }, n.group_id)),
1583
- u.length > 40 && /* @__PURE__ */ t("li", { className: "text-[11.5px] text-slate-400", children: [
1355
+ ] }, r.group_id)),
1356
+ m.length > 40 && /* @__PURE__ */ a("li", { className: "text-[11.5px] text-slate-400", children: [
1584
1357
  "…and ",
1585
- u.length - 40,
1358
+ m.length - 40,
1586
1359
  " more"
1587
1360
  ] })
1588
1361
  ] })
1589
- ] }, s)) }))
1362
+ ] }, c)) }))
1590
1363
  ] });
1591
1364
  }
1592
- function ft() {
1593
- const i = L(), m = K(), { data: r = [] } = w({
1365
+ function bt() {
1366
+ const s = A(), u = K(), { data: t = [] } = v({
1594
1367
  queryKey: ["my-reminders"],
1595
- queryFn: () => i.request(D("/reminders")).then((h) => h.data).catch(() => []),
1368
+ queryFn: () => s.request(T("/reminders")).then((p) => p.data).catch(() => []),
1596
1369
  staleTime: 3e4
1597
- }), [d, o] = q(""), [l, s] = q(""), u = () => void m.invalidateQueries({ queryKey: ["my-reminders"] }), n = _({
1598
- mutationFn: () => i.request(ae("/reminders", { note: d, remind_at: new Date(l).toISOString() })),
1370
+ }), [i, o] = C(""), [l, c] = C(""), m = () => void u.invalidateQueries({ queryKey: ["my-reminders"] }), r = w({
1371
+ mutationFn: () => s.request(ee("/reminders", { note: i, remind_at: new Date(l).toISOString() })),
1599
1372
  onSuccess: () => {
1600
- o(""), s(""), u();
1373
+ o(""), c(""), m();
1601
1374
  }
1602
- }), b = _({
1603
- mutationFn: (h) => i.request(Re(`/reminders/${h}`)),
1604
- onSuccess: u
1375
+ }), h = w({
1376
+ mutationFn: (p) => s.request(Oe(`/reminders/${p}`)),
1377
+ onSuccess: m
1605
1378
  });
1606
- return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
1607
- /* @__PURE__ */ t("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
1379
+ return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
1380
+ /* @__PURE__ */ a("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
1608
1381
  /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Reminders" }),
1609
1382
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: `Personal nudges delivered as notifications at the time you pick. The chat bot's "remind me…" requests land here too.` })
1610
1383
  ] }),
1611
- /* @__PURE__ */ t("div", { className: "space-y-2 px-4 py-3", children: [
1612
- r.length === 0 && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "No upcoming reminders." }),
1613
- r.map((h) => /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
1614
- /* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: [
1615
- /* @__PURE__ */ e("p", { className: "truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: h.note }),
1616
- /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400", children: new Date(h.remind_at).toLocaleString() })
1384
+ /* @__PURE__ */ a("div", { className: "space-y-2 px-4 py-3", children: [
1385
+ t.length === 0 && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "No upcoming reminders." }),
1386
+ t.map((p) => /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
1387
+ /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
1388
+ /* @__PURE__ */ e("p", { className: "truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: p.note }),
1389
+ /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400", children: new Date(p.remind_at).toLocaleString() })
1617
1390
  ] }),
1618
1391
  /* @__PURE__ */ e(
1619
1392
  "button",
1620
1393
  {
1621
1394
  type: "button",
1622
- onClick: () => b.mutate(h.id),
1395
+ onClick: () => h.mutate(p.id),
1623
1396
  className: "shrink-0 rounded px-1.5 py-0.5 text-[11px] text-slate-400 hover:bg-red-50 hover:text-red-600 dark:hover:bg-red-500/10",
1624
1397
  children: "Cancel"
1625
1398
  }
1626
1399
  )
1627
- ] }, h.id)),
1628
- /* @__PURE__ */ t(
1400
+ ] }, p.id)),
1401
+ /* @__PURE__ */ a(
1629
1402
  "form",
1630
1403
  {
1631
1404
  className: "flex flex-wrap items-center gap-2 pt-1",
1632
- onSubmit: (h) => {
1633
- h.preventDefault(), d.trim() && l && n.mutate();
1405
+ onSubmit: (p) => {
1406
+ p.preventDefault(), i.trim() && l && r.mutate();
1634
1407
  },
1635
1408
  children: [
1636
1409
  /* @__PURE__ */ e(
1637
1410
  "input",
1638
1411
  {
1639
- value: d,
1640
- onChange: (h) => o(h.target.value),
1412
+ value: i,
1413
+ onChange: (p) => o(p.target.value),
1641
1414
  placeholder: "Remind me to…",
1642
1415
  className: "h-7 min-w-[160px] flex-1 rounded border border-slate-200 px-2 text-[12px] outline-none focus:border-nvr-cyan dark:border-border dark:bg-background"
1643
1416
  }
@@ -1647,7 +1420,7 @@ function ft() {
1647
1420
  {
1648
1421
  type: "datetime-local",
1649
1422
  value: l,
1650
- onChange: (h) => s(h.target.value),
1423
+ onChange: (p) => c(p.target.value),
1651
1424
  className: "h-7 rounded border border-slate-200 px-2 text-[12px] outline-none focus:border-nvr-cyan dark:border-border dark:bg-background"
1652
1425
  }
1653
1426
  ),
@@ -1655,9 +1428,9 @@ function ft() {
1655
1428
  "button",
1656
1429
  {
1657
1430
  type: "submit",
1658
- disabled: !d.trim() || !l || n.isPending,
1431
+ disabled: !i.trim() || !l || r.isPending,
1659
1432
  className: "h-7 rounded bg-nvr-cyan px-2.5 text-[11.5px] font-medium text-white hover:bg-nvr-cyan-dark disabled:opacity-50",
1660
- children: n.isPending ? "Adding…" : "Add"
1433
+ children: r.isPending ? "Adding…" : "Add"
1661
1434
  }
1662
1435
  )
1663
1436
  ]
@@ -1666,55 +1439,55 @@ function ft() {
1666
1439
  ] })
1667
1440
  ] });
1668
1441
  }
1669
- function vt() {
1670
- const i = L(), { data: m } = w({
1442
+ function xt() {
1443
+ const s = A(), { data: u } = v({
1671
1444
  queryKey: ["my-stats"],
1672
- queryFn: () => i.request(D("/users/me/stats")).then((d) => d.data).catch(() => null),
1445
+ queryFn: () => s.request(T("/users/me/stats")).then((i) => i.data).catch(() => null),
1673
1446
  staleTime: 5 * 6e4
1674
1447
  });
1675
- if (!m) return null;
1676
- const r = Math.max(1, ...m.weeks.map((d) => d.transitions + d.tasks_done + d.created));
1677
- return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
1678
- /* @__PURE__ */ t("header", { className: "flex items-center justify-between border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
1679
- /* @__PURE__ */ t("div", { children: [
1448
+ if (!u) return null;
1449
+ const t = Math.max(1, ...u.weeks.map((i) => i.transitions + i.tasks_done + i.created));
1450
+ return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
1451
+ /* @__PURE__ */ a("header", { className: "flex items-center justify-between border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
1452
+ /* @__PURE__ */ a("div", { children: [
1680
1453
  /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "My activity" }),
1681
1454
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Last 8 weeks — just yours." })
1682
1455
  ] }),
1683
- m.streak_days > 1 && /* @__PURE__ */ t("span", { className: "rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[11px] font-medium text-nvr-navy dark:text-nvr-cyan", children: [
1684
- m.streak_days,
1456
+ u.streak_days > 1 && /* @__PURE__ */ a("span", { className: "rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[11px] font-medium text-nvr-navy dark:text-nvr-cyan", children: [
1457
+ u.streak_days,
1685
1458
  "-day streak"
1686
1459
  ] })
1687
1460
  ] }),
1688
- /* @__PURE__ */ t("div", { className: "px-4 py-3", children: [
1689
- /* @__PURE__ */ e("div", { className: "flex items-end gap-1.5", style: { height: 56 }, children: m.weeks.map((d, o) => {
1690
- const l = d.transitions + d.tasks_done + d.created;
1461
+ /* @__PURE__ */ a("div", { className: "px-4 py-3", children: [
1462
+ /* @__PURE__ */ e("div", { className: "flex items-end gap-1.5", style: { height: 56 }, children: u.weeks.map((i, o) => {
1463
+ const l = i.transitions + i.tasks_done + i.created;
1691
1464
  return /* @__PURE__ */ e(
1692
1465
  "div",
1693
1466
  {
1694
1467
  className: "flex-1 rounded-t bg-nvr-cyan/60 transition-all dark:bg-nvr-cyan/40",
1695
- style: { height: `${Math.max(4, l / r * 100)}%` },
1696
- "data-tip": `${l} action${l === 1 ? "" : "s"}: ${d.transitions} transitions, ${d.tasks_done} tasks done, ${d.created} created`
1468
+ style: { height: `${Math.max(4, l / t * 100)}%` },
1469
+ "data-tip": `${l} action${l === 1 ? "" : "s"}: ${i.transitions} transitions, ${i.tasks_done} tasks done, ${i.created} created`
1697
1470
  },
1698
1471
  o
1699
1472
  );
1700
1473
  }) }),
1701
- /* @__PURE__ */ t("div", { className: "mt-2 flex items-center justify-between text-[11px] text-slate-400", children: [
1474
+ /* @__PURE__ */ a("div", { className: "mt-2 flex items-center justify-between text-[11px] text-slate-400", children: [
1702
1475
  /* @__PURE__ */ e("span", { children: "8 weeks ago" }),
1703
1476
  /* @__PURE__ */ e("span", { children: "this week" })
1704
1477
  ] }),
1705
- /* @__PURE__ */ t("div", { className: "mt-2 flex flex-wrap gap-x-4 gap-y-1 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
1706
- /* @__PURE__ */ t("span", { children: [
1707
- /* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: m.totals.transitions }),
1478
+ /* @__PURE__ */ a("div", { className: "mt-2 flex flex-wrap gap-x-4 gap-y-1 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
1479
+ /* @__PURE__ */ a("span", { children: [
1480
+ /* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: u.totals.transitions }),
1708
1481
  " ",
1709
1482
  "transitions"
1710
1483
  ] }),
1711
- /* @__PURE__ */ t("span", { children: [
1712
- /* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: m.totals.tasks_done }),
1484
+ /* @__PURE__ */ a("span", { children: [
1485
+ /* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: u.totals.tasks_done }),
1713
1486
  " ",
1714
1487
  "tasks done"
1715
1488
  ] }),
1716
- /* @__PURE__ */ t("span", { children: [
1717
- /* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: m.totals.created }),
1489
+ /* @__PURE__ */ a("span", { children: [
1490
+ /* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: u.totals.created }),
1718
1491
  " ",
1719
1492
  "records created"
1720
1493
  ] })
@@ -1722,62 +1495,62 @@ function vt() {
1722
1495
  ] })
1723
1496
  ] });
1724
1497
  }
1725
- function kt() {
1726
- const i = L(), m = K(), { data: r } = w({
1498
+ function gt() {
1499
+ const s = A(), u = K(), { data: t } = v({
1727
1500
  queryKey: ["my-security"],
1728
- queryFn: () => i.request(D("/security/my/sessions")).then((l) => l.data).catch(() => ({ sessions: [], logins: [] })),
1501
+ queryFn: () => s.request(T("/security/my/sessions")).then((l) => l.data).catch(() => ({ sessions: [], logins: [] })),
1729
1502
  staleTime: 3e4
1730
- }), d = _({
1731
- mutationFn: () => i.request(ae("/security/my/sessions/sign-out-others", {})).then((l) => l.data),
1503
+ }), i = w({
1504
+ mutationFn: () => s.request(ee("/security/my/sessions/sign-out-others", {})).then((l) => l.data),
1732
1505
  onSuccess: (l) => {
1733
- m.invalidateQueries({ queryKey: ["my-security"] }), o(`Signed out ${(l == null ? void 0 : l.revoked) ?? 0} other session(s)`);
1506
+ u.invalidateQueries({ queryKey: ["my-security"] }), o(`Signed out ${(l == null ? void 0 : l.revoked) ?? 0} other session(s)`);
1734
1507
  },
1735
1508
  onError: (l) => {
1736
- var u, n;
1737
- const s = ((n = (u = l == null ? void 0 : l.response) == null ? void 0 : u.data) == null ? void 0 : n.error) ?? "Could not sign out your other sessions — try again.";
1738
- import("sonner").then(({ toast: b }) => b.error(s)).catch(() => {
1509
+ var m, r;
1510
+ const c = ((r = (m = l == null ? void 0 : l.response) == null ? void 0 : m.data) == null ? void 0 : r.error) ?? "Could not sign out your other sessions — try again.";
1511
+ import("sonner").then(({ toast: h }) => h.error(c)).catch(() => {
1739
1512
  });
1740
1513
  }
1741
1514
  }), o = (l) => {
1742
1515
  try {
1743
- import("sonner").then(({ toast: s }) => s.success(l));
1516
+ import("sonner").then(({ toast: c }) => c.success(l));
1744
1517
  } catch {
1745
1518
  }
1746
1519
  };
1747
- return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
1748
- /* @__PURE__ */ t("header", { className: "flex items-center justify-between border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
1749
- /* @__PURE__ */ t("div", { children: [
1520
+ return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
1521
+ /* @__PURE__ */ a("header", { className: "flex items-center justify-between border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
1522
+ /* @__PURE__ */ a("div", { children: [
1750
1523
  /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Security" }),
1751
1524
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Your active sessions and recent sign-ins." })
1752
1525
  ] }),
1753
- ((r == null ? void 0 : r.sessions.length) ?? 0) > 1 && /* @__PURE__ */ e(
1526
+ ((t == null ? void 0 : t.sessions.length) ?? 0) > 1 && /* @__PURE__ */ e(
1754
1527
  "button",
1755
1528
  {
1756
1529
  type: "button",
1757
- disabled: d.isPending,
1758
- onClick: () => d.mutate(),
1530
+ disabled: i.isPending,
1531
+ onClick: () => i.mutate(),
1759
1532
  className: "rounded-md border border-red-200 px-2 py-1 text-[11.5px] text-red-600 hover:bg-red-50 disabled:opacity-50 dark:border-red-500/30",
1760
1533
  children: "Sign out everywhere else"
1761
1534
  }
1762
1535
  )
1763
1536
  ] }),
1764
- /* @__PURE__ */ t("div", { className: "space-y-2 p-4", children: [
1765
- /* @__PURE__ */ t("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: [
1537
+ /* @__PURE__ */ a("div", { className: "space-y-2 p-4", children: [
1538
+ /* @__PURE__ */ a("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: [
1766
1539
  "Active sessions (",
1767
- (r == null ? void 0 : r.sessions.length) ?? 0,
1540
+ (t == null ? void 0 : t.sessions.length) ?? 0,
1768
1541
  ")"
1769
1542
  ] }),
1770
- ((r == null ? void 0 : r.sessions) ?? []).map((l) => /* @__PURE__ */ t(
1543
+ ((t == null ? void 0 : t.sessions) ?? []).map((l) => /* @__PURE__ */ a(
1771
1544
  "p",
1772
1545
  {
1773
1546
  className: "flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300",
1774
1547
  children: [
1775
- /* @__PURE__ */ t("span", { className: "font-mono text-slate-400", children: [
1548
+ /* @__PURE__ */ a("span", { className: "font-mono text-slate-400", children: [
1776
1549
  l.sid_prefix,
1777
1550
  "…"
1778
1551
  ] }),
1779
1552
  l.current && /* @__PURE__ */ e("span", { className: "rounded bg-nvr-cyan/[0.08] px-1.5 py-px text-[10px] font-medium text-[#007a99] dark:text-nvr-cyan", children: "this session" }),
1780
- /* @__PURE__ */ t("span", { className: "ml-auto text-[11px] text-slate-400", children: [
1553
+ /* @__PURE__ */ a("span", { className: "ml-auto text-[11px] text-slate-400", children: [
1781
1554
  "expires in ",
1782
1555
  Math.round(l.ttl_seconds / 3600),
1783
1556
  "h"
@@ -1786,62 +1559,62 @@ function kt() {
1786
1559
  },
1787
1560
  l.sid_prefix
1788
1561
  )),
1789
- ((r == null ? void 0 : r.logins) ?? []).length > 0 && /* @__PURE__ */ t(oe, { children: [
1562
+ ((t == null ? void 0 : t.logins) ?? []).length > 0 && /* @__PURE__ */ a(X, { children: [
1790
1563
  /* @__PURE__ */ e("p", { className: "pt-1 text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: "Recent sign-ins" }),
1791
- ((r == null ? void 0 : r.logins) ?? []).slice(0, 8).map((l, s) => (
1564
+ ((t == null ? void 0 : t.logins) ?? []).slice(0, 8).map((l, c) => (
1792
1565
  // biome-ignore lint/suspicious/noArrayIndexKey: log rows
1793
- /* @__PURE__ */ t("p", { className: "flex items-center gap-2 text-[11.5px] text-slate-500", children: [
1566
+ /* @__PURE__ */ a("p", { className: "flex items-center gap-2 text-[11.5px] text-slate-500", children: [
1794
1567
  /* @__PURE__ */ e("span", { className: "font-mono", children: l.ip ?? "—" }),
1795
1568
  l.new_ip && /* @__PURE__ */ e("span", { className: "rounded bg-amber-100 px-1 text-[9.5px] font-semibold text-amber-700 dark:bg-amber-400/15 dark:text-amber-400", children: "new IP" }),
1796
1569
  /* @__PURE__ */ e("span", { className: "ml-auto text-slate-400", children: new Date(l.created_at).toLocaleString() })
1797
- ] }, s)
1570
+ ] }, c)
1798
1571
  ))
1799
1572
  ] })
1800
1573
  ] })
1801
1574
  ] });
1802
1575
  }
1803
- function Nt() {
1804
- const i = L(), [m, r] = q(!1), { data: d } = w({
1576
+ function ft() {
1577
+ const s = A(), [u, t] = C(!1), { data: i } = v({
1805
1578
  queryKey: ["my-permissions"],
1806
- queryFn: () => i.request(D("/security/my/permissions")).then((o) => o.data),
1807
- enabled: m,
1579
+ queryFn: () => s.request(T("/security/my/permissions")).then((o) => o.data),
1580
+ enabled: u,
1808
1581
  staleTime: 5 * 6e4
1809
1582
  });
1810
- return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
1811
- /* @__PURE__ */ t(
1583
+ return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
1584
+ /* @__PURE__ */ a(
1812
1585
  "button",
1813
1586
  {
1814
1587
  type: "button",
1815
- onClick: () => r((o) => !o),
1588
+ onClick: () => t((o) => !o),
1816
1589
  className: "flex w-full items-center justify-between px-4 py-2.5 text-left",
1817
1590
  children: [
1818
- /* @__PURE__ */ t("div", { children: [
1591
+ /* @__PURE__ */ a("div", { children: [
1819
1592
  /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "What can I access?" }),
1820
1593
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Your role, collections, and data limits in plain language." })
1821
1594
  ] }),
1822
- /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: m ? "Hide" : "Show" })
1595
+ /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: u ? "Hide" : "Show" })
1823
1596
  ]
1824
1597
  }
1825
1598
  ),
1826
- m && d && /* @__PURE__ */ t("div", { className: "space-y-2 border-t border-slate-100 px-4 py-3 text-[12.5px] text-slate-600 dark:border-border/60 dark:text-slate-300", children: [
1827
- /* @__PURE__ */ t("p", { children: [
1599
+ u && i && /* @__PURE__ */ a("div", { className: "space-y-2 border-t border-slate-100 px-4 py-3 text-[12.5px] text-slate-600 dark:border-border/60 dark:text-slate-300", children: [
1600
+ /* @__PURE__ */ a("p", { children: [
1828
1601
  "Your role is ",
1829
- /* @__PURE__ */ e("b", { children: d.role ?? "unassigned" }),
1830
- d.is_admin && " — an administrator role with access to everything",
1602
+ /* @__PURE__ */ e("b", { children: i.role ?? "unassigned" }),
1603
+ i.is_admin && " — an administrator role with access to everything",
1831
1604
  "."
1832
1605
  ] }),
1833
- d.scopes.length > 0 && /* @__PURE__ */ t("p", { children: [
1606
+ i.scopes.length > 0 && /* @__PURE__ */ a("p", { children: [
1834
1607
  "Your data is limited to:",
1835
1608
  " ",
1836
- d.scopes.map((o) => `${o.dimension}: ${o.values.join(", ")}`).join(" · ")
1609
+ i.scopes.map((o) => `${o.dimension}: ${o.values.join(", ")}`).join(" · ")
1837
1610
  ] }),
1838
- !d.is_admin && /* @__PURE__ */ t("div", { children: [
1839
- /* @__PURE__ */ t("p", { className: "mb-1 text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: [
1611
+ !i.is_admin && /* @__PURE__ */ a("div", { children: [
1612
+ /* @__PURE__ */ a("p", { className: "mb-1 text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: [
1840
1613
  "Collections (",
1841
- d.collections.length,
1614
+ i.collections.length,
1842
1615
  ")"
1843
1616
  ] }),
1844
- /* @__PURE__ */ e("div", { className: "max-h-48 overflow-y-auto", children: d.collections.map((o) => /* @__PURE__ */ t(
1617
+ /* @__PURE__ */ e("div", { className: "max-h-48 overflow-y-auto", children: i.collections.map((o) => /* @__PURE__ */ a(
1845
1618
  "p",
1846
1619
  {
1847
1620
  className: "flex items-center gap-2 border-b border-slate-50 py-0.5 text-[12px] last:border-b-0 dark:border-border/40",
@@ -1856,51 +1629,51 @@ function Nt() {
1856
1629
  ] })
1857
1630
  ] });
1858
1631
  }
1859
- function wt() {
1860
- const i = L(), m = K(), { data: r } = w({
1632
+ function yt() {
1633
+ const s = A(), u = K(), { data: t } = v({
1861
1634
  queryKey: ["nvr-profile-prefs"],
1862
- queryFn: () => i.request(D("/users/me")).then((u) => {
1863
- var n;
1864
- return ((n = u.data) == null ? void 0 : n.preferences) ?? {};
1635
+ queryFn: () => s.request(T("/users/me")).then((m) => {
1636
+ var r;
1637
+ return ((r = m.data) == null ? void 0 : r.preferences) ?? {};
1865
1638
  })
1866
- }), d = _({
1867
- mutationFn: (u) => i.request(G("/users/me/preferences", u)),
1868
- onSuccess: (u, n) => {
1869
- m.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), le(Object.keys(n)), import("sonner").then(
1870
- ({ toast: b }) => b.success("Saved — applied on all your open tabs and devices")
1639
+ }), i = w({
1640
+ mutationFn: (m) => s.request(G("/users/me/preferences", m)),
1641
+ onSuccess: (m, r) => {
1642
+ u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), re(Object.keys(r)), import("sonner").then(
1643
+ ({ toast: h }) => h.success("Saved — applied on all your open tabs and devices")
1871
1644
  );
1872
1645
  }
1873
- }), o = (r == null ? void 0 : r.number_format) ?? {}, { data: l = [se, ...ye] } = w({
1646
+ }), o = (t == null ? void 0 : t.number_format) ?? {}, { data: l = [ae, ...ce] } = v({
1874
1647
  queryKey: ["nvr-theme-accents"],
1875
- queryFn: () => i.request(
1876
- D("/settings")
1877
- ).then((u) => {
1878
- var n, b;
1648
+ queryFn: () => s.request(
1649
+ T("/settings")
1650
+ ).then((m) => {
1651
+ var r, h;
1879
1652
  return [
1880
- { ...se, color: ((n = u.data) == null ? void 0 : n.project_color) ?? null },
1881
- ...Ue((b = u.data) == null ? void 0 : b.theme_accents)
1653
+ { ...ae, color: ((r = m.data) == null ? void 0 : r.project_color) ?? null },
1654
+ ...De((h = m.data) == null ? void 0 : h.theme_accents)
1882
1655
  ];
1883
- }).catch(() => [se, ...ye]),
1656
+ }).catch(() => [ae, ...ce]),
1884
1657
  staleTime: 5 * 6e4
1885
- }), s = typeof (r == null ? void 0 : r.theme_accent) == "string" ? r.theme_accent : "brand";
1886
- return /* @__PURE__ */ t(
1658
+ }), c = typeof (t == null ? void 0 : t.theme_accent) == "string" ? t.theme_accent : "brand";
1659
+ return /* @__PURE__ */ a(
1887
1660
  "div",
1888
1661
  {
1889
1662
  "data-profile-card": "display",
1890
1663
  className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
1891
1664
  children: [
1892
- /* @__PURE__ */ t("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
1665
+ /* @__PURE__ */ a("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
1893
1666
  /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Display" }),
1894
1667
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "How times, numbers and text render for you." })
1895
1668
  ] }),
1896
- /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-x-5 gap-y-2.5 p-4 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
1897
- /* @__PURE__ */ t("label", { className: "flex items-center gap-1.5", children: [
1669
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-x-5 gap-y-2.5 p-4 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
1670
+ /* @__PURE__ */ a("label", { className: "flex items-center gap-1.5", children: [
1898
1671
  "Timestamps",
1899
1672
  /* @__PURE__ */ e(
1900
- E,
1673
+ U,
1901
1674
  {
1902
- value: String((r == null ? void 0 : r.time_display) ?? "relative"),
1903
- onChange: (u) => d.mutate({ time_display: u }),
1675
+ value: String((t == null ? void 0 : t.time_display) ?? "relative"),
1676
+ onChange: (m) => i.mutate({ time_display: m }),
1904
1677
  options: [
1905
1678
  { value: "relative", label: "Relative (3h ago)" },
1906
1679
  { value: "exact", label: "Exact (Aug 24, 3:12 PM)" }
@@ -1908,37 +1681,37 @@ function wt() {
1908
1681
  }
1909
1682
  )
1910
1683
  ] }),
1911
- /* @__PURE__ */ t("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
1684
+ /* @__PURE__ */ a("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
1912
1685
  /* @__PURE__ */ e(
1913
1686
  "input",
1914
1687
  {
1915
1688
  type: "checkbox",
1916
1689
  checked: o.compact === !0,
1917
- onChange: (u) => d.mutate({ number_format: { ...o, compact: u.target.checked } }),
1690
+ onChange: (m) => i.mutate({ number_format: { ...o, compact: m.target.checked } }),
1918
1691
  className: "rounded"
1919
1692
  }
1920
1693
  ),
1921
1694
  "Compact numbers (1.2M)"
1922
1695
  ] }),
1923
- /* @__PURE__ */ t("label", { className: "flex items-center gap-1.5", children: [
1696
+ /* @__PURE__ */ a("label", { className: "flex items-center gap-1.5", children: [
1924
1697
  "Number locale",
1925
1698
  /* @__PURE__ */ e(
1926
1699
  "input",
1927
1700
  {
1928
1701
  defaultValue: o.locale ?? "",
1929
- onBlur: (u) => d.mutate({ number_format: { ...o, locale: u.target.value.trim() || void 0 } }),
1702
+ onBlur: (m) => i.mutate({ number_format: { ...o, locale: m.target.value.trim() || void 0 } }),
1930
1703
  placeholder: "en-US",
1931
1704
  className: "h-7 w-20 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
1932
1705
  }
1933
1706
  )
1934
1707
  ] }),
1935
- /* @__PURE__ */ t("label", { className: "flex items-center gap-1.5", children: [
1708
+ /* @__PURE__ */ a("label", { className: "flex items-center gap-1.5", children: [
1936
1709
  "Week starts",
1937
1710
  /* @__PURE__ */ e(
1938
- E,
1711
+ U,
1939
1712
  {
1940
- value: String((r == null ? void 0 : r.week_start) ?? "sun"),
1941
- onChange: (u) => d.mutate({ week_start: u }),
1713
+ value: String((t == null ? void 0 : t.week_start) ?? "sun"),
1714
+ onChange: (m) => i.mutate({ week_start: m }),
1942
1715
  options: [
1943
1716
  { value: "sun", label: "Sunday" },
1944
1717
  { value: "mon", label: "Monday" }
@@ -1946,36 +1719,36 @@ function wt() {
1946
1719
  }
1947
1720
  )
1948
1721
  ] }),
1949
- /* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", "data-theme-accent-picker": !0, children: [
1722
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", "data-theme-accent-picker": !0, children: [
1950
1723
  "Accent",
1951
- /* @__PURE__ */ e("span", { className: "flex items-center gap-1", children: l.map((u) => {
1952
- const n = u.key === "brand" && s === "brand" || u.key === s;
1724
+ /* @__PURE__ */ e("span", { className: "flex items-center gap-1", children: l.map((m) => {
1725
+ const r = m.key === "brand" && c === "brand" || m.key === c;
1953
1726
  return /* @__PURE__ */ e(
1954
1727
  "button",
1955
1728
  {
1956
1729
  type: "button",
1957
- title: u.label,
1958
- "aria-label": `Accent ${u.label}`,
1959
- "aria-pressed": n,
1960
- "data-theme-accent": u.key,
1961
- onClick: () => d.mutate({ theme_accent: u.key === "brand" ? null : u.key }),
1962
- className: R(
1730
+ title: m.label,
1731
+ "aria-label": `Accent ${m.label}`,
1732
+ "aria-pressed": r,
1733
+ "data-theme-accent": m.key,
1734
+ onClick: () => i.mutate({ theme_accent: m.key === "brand" ? null : m.key }),
1735
+ className: Q(
1963
1736
  "h-5 w-5 rounded-full border-2 transition-transform",
1964
- n ? "scale-110 border-slate-800 dark:border-slate-100" : "border-transparent hover:scale-105"
1737
+ r ? "scale-110 border-slate-800 dark:border-slate-100" : "border-transparent hover:scale-105"
1965
1738
  ),
1966
- style: { background: u.color ?? "var(--nvr-cyan)" }
1739
+ style: { background: m.color ?? "var(--nvr-cyan)" }
1967
1740
  },
1968
- u.key
1741
+ m.key
1969
1742
  );
1970
1743
  }) })
1971
1744
  ] }),
1972
- /* @__PURE__ */ t("label", { className: "flex items-center gap-1.5", children: [
1745
+ /* @__PURE__ */ a("label", { className: "flex items-center gap-1.5", children: [
1973
1746
  "Text size",
1974
1747
  /* @__PURE__ */ e(
1975
- E,
1748
+ U,
1976
1749
  {
1977
- value: String((r == null ? void 0 : r.font_size) ?? "default"),
1978
- onChange: (u) => d.mutate({ font_size: u }),
1750
+ value: String((t == null ? void 0 : t.font_size) ?? "default"),
1751
+ onChange: (m) => i.mutate({ font_size: m }),
1979
1752
  options: [
1980
1753
  { value: "small", label: "Small" },
1981
1754
  { value: "default", label: "Default" },
@@ -1990,11 +1763,11 @@ function wt() {
1990
1763
  );
1991
1764
  }
1992
1765
  export {
1993
- Ve as DelegationCard,
1994
- wt as DisplayPrefsCard,
1995
- ct as LinkAppCard,
1996
- dt as NotificationRulesCard,
1997
- it as ProfileFieldsCard,
1998
- Gt as ProfileView,
1999
- ut as TimezoneCard
1766
+ Be as DelegationCard,
1767
+ yt as DisplayPrefsCard,
1768
+ lt as LinkAppCard,
1769
+ st as NotificationRulesCard,
1770
+ nt as ProfileFieldsCard,
1771
+ Wt as ProfileView,
1772
+ ot as TimezoneCard
2000
1773
  };