@nivaro/react 0.2.54 → 0.2.55

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 (150) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +99 -98
  3. package/dist/index.d.ts +339 -2
  4. package/dist/index.js +644 -618
  5. package/dist/layout-editor.d.ts +4 -0
  6. package/dist/shared/components/BackgroundRunOffer.js +117 -0
  7. package/dist/shared/components/BroadcastView.js +214 -213
  8. package/dist/shared/components/CollectionBrowserView.js +2592 -2695
  9. package/dist/shared/components/ItemEditForm.js +4066 -3832
  10. package/dist/shared/components/JobsTray.js +100 -55
  11. package/dist/shared/components/MyWorkView.js +91 -89
  12. package/dist/shared/components/NotificationBell.js +80 -79
  13. package/dist/shared/components/ProfileView.js +568 -520
  14. package/dist/shared/components/RecordCompare.js +254 -0
  15. package/dist/shared/components/RecordReadView.js +599 -552
  16. package/dist/shared/components/ReportView.js +578 -543
  17. package/dist/shared/components/RowPresence.js +91 -0
  18. package/dist/shared/components/WidgetSlot.js +474 -458
  19. package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
  20. package/dist/shared/components/ai/AskPanel.js +139 -119
  21. package/dist/shared/components/ai/FirstWeekCard.js +126 -0
  22. package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
  23. package/dist/shared/components/bulk/bulk-field-options.js +45 -0
  24. package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
  25. package/dist/shared/components/chat/ChannelArchive.js +326 -0
  26. package/dist/shared/components/chat/ChannelExtras.js +141 -121
  27. package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
  28. package/dist/shared/components/chat/ChatPanel.js +1695 -1733
  29. package/dist/shared/components/chat/Composer.js +357 -303
  30. package/dist/shared/components/chat/MessageActions.js +92 -0
  31. package/dist/shared/components/chat/MessageFormat.js +290 -264
  32. package/dist/shared/components/chat/OutboxBubbles.js +146 -0
  33. package/dist/shared/components/chat/RequestIdCard.js +135 -0
  34. package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
  35. package/dist/shared/components/chat/RoomParts.js +213 -274
  36. package/dist/shared/components/chat/ScreenClip.js +184 -0
  37. package/dist/shared/components/chat/chat-core.js +402 -483
  38. package/dist/shared/components/chat/chat-drafts.js +59 -0
  39. package/dist/shared/components/chat/chat-emoji.js +348 -0
  40. package/dist/shared/components/chat/chat-local-time.js +41 -0
  41. package/dist/shared/components/chat/chat-outbox.js +303 -0
  42. package/dist/shared/components/chat/chat-window.js +163 -0
  43. package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
  44. package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
  45. package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
  46. package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
  47. package/dist/shared/components/help-videos/api.js +76 -73
  48. package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
  49. package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
  50. package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
  51. package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
  52. package/dist/shared/components/item-edit/FieldRow.js +292 -279
  53. package/dist/shared/components/item-edit/GroupSection.js +698 -574
  54. package/dist/shared/components/item-edit/InlineTableField.js +3 -1
  55. package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
  56. package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
  57. package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
  58. package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
  59. package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
  60. package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
  61. package/dist/shared/components/item-edit/lazy-sections.js +36 -0
  62. package/dist/shared/components/item-edit/lock-why.js +39 -32
  63. package/dist/shared/components/item-edit/picker-miss.js +26 -0
  64. package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
  65. package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
  66. package/dist/shared/components/layout-editor/AddPanel.js +134 -117
  67. package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
  68. package/dist/shared/components/layout-editor/CollabParts.js +80 -75
  69. package/dist/shared/components/layout-editor/DesignNode.js +126 -120
  70. package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
  71. package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
  72. package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
  73. package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
  74. package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
  75. package/dist/shared/components/layout-editor/StagedChip.js +22 -0
  76. package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
  77. package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
  78. package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
  79. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
  80. package/dist/shared/components/layout-editor/dnd/node.js +69 -57
  81. package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
  82. package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
  83. package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
  84. package/dist/shared/components/layout-editor/entry/presets.js +71 -0
  85. package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
  86. package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
  87. package/dist/shared/components/layout-editor/grid-guides.js +142 -0
  88. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
  89. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
  90. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
  91. package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
  92. package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
  93. package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
  94. package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
  95. package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
  96. package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
  97. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
  98. package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
  99. package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
  100. package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
  101. package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
  102. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  103. package/dist/shared/components/layout-editor/restore-piece.js +192 -0
  104. package/dist/shared/components/layout-editor/section-structure.js +241 -0
  105. package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
  106. package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
  107. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
  108. package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
  109. package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
  110. package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
  111. package/dist/shared/components/layout-editor/staged-api.js +64 -0
  112. package/dist/shared/components/layout-editor/structure-ops.js +81 -77
  113. package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
  114. package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
  115. package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
  116. package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
  117. package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
  118. package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
  119. package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
  120. package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
  121. package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
  122. package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
  123. package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
  124. package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
  125. package/dist/shared/components/profile/AgentsPanel.js +479 -0
  126. package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
  127. package/dist/shared/components/support/SupportAnalytics.js +171 -0
  128. package/dist/shared/components/support/SupportView.js +75 -73
  129. package/dist/shared/lib/background-runs.js +150 -0
  130. package/dist/shared/lib/delivery-ack.js +9 -0
  131. package/dist/shared/lib/entry-badge-style.js +13 -0
  132. package/dist/shared/lib/entry-config.js +71 -0
  133. package/dist/shared/lib/form-sections.js +64 -0
  134. package/dist/shared/lib/form-structure.js +99 -0
  135. package/dist/shared/lib/form-usage-beacon.js +101 -52
  136. package/dist/shared/lib/jobs-tray.js +25 -23
  137. package/dist/shared/lib/keyset-pager.js +37 -0
  138. package/dist/shared/lib/layout-ops.js +84 -82
  139. package/dist/shared/lib/layout-resolve.js +113 -0
  140. package/dist/shared/lib/placement-behaviour.js +144 -0
  141. package/dist/shared/lib/prefetch.js +149 -0
  142. package/dist/shared/lib/presence-hooks.js +199 -0
  143. package/dist/shared/lib/record-outbox.js +82 -81
  144. package/dist/shared/lib/replay-socket.js +93 -0
  145. package/dist/shared/lib/request-gate.js +51 -50
  146. package/dist/shared/lib/room-gaps.js +96 -0
  147. package/dist/shared/lib/search-log.js +27 -0
  148. package/dist/shared/lib/socket-realtime.js +101 -80
  149. package/dist/shared/lib/worker-socket.js +200 -0
  150. package/package.json +1 -1
@@ -1,29 +1,30 @@
1
- import { jsxs as t, jsx as e, Fragment as se } from "react/jsx-runtime";
2
- import { readUser as ye, readUserCard as fe, updateUser as me, readMyScopes as ve, saveMyScopeDefaults as ke, readItems as ae } from "@nivaro/sdk";
3
- import { useQueryClient as I, useQuery as C, useMutation as q } from "@tanstack/react-query";
4
- import { Loader2 as ue, Camera as Ne, Building2 as we, Mail as Se, Phone as _e, Clock as qe, Undo2 as Ce, Check as Ae, UserRound as Pe, Filter as Te, LogOut as Fe, ShieldCheck as Oe } from "lucide-react";
5
- import { useState as P, useMemo as De, useRef as Le } from "react";
6
- import { useNivaroClient as F, useItemEditAuth as xe } from "../context.js";
7
- import { get as D, patch as W, post as ee, put as Me, del as Ee } from "../lib/commands.js";
1
+ import { jsxs as t, jsx as e, Fragment as oe } from "react/jsx-runtime";
2
+ import { readUser as fe, readUserCard as ye, updateUser as me, readMyScopes as ve, saveMyScopeDefaults as ke, readItems as ne } from "@nivaro/sdk";
3
+ import { useQueryClient as E, useQuery as q, useMutation as _ } from "@tanstack/react-query";
4
+ import { Loader2 as ue, Camera as Ne, Building2 as we, Mail as Se, Phone as _e, Clock as qe, Undo2 as Ce, Check as Pe, UserRound as Ae, Filter as Te, LogOut as Fe, ShieldCheck as Oe } from "lucide-react";
5
+ import { useState as C, useMemo as Le, useRef as De } from "react";
6
+ import { useNivaroClient as T, useItemEditAuth as xe } from "../context.js";
7
+ import { get as F, patch as V, post as ae, put as Me, del as Ee } from "../lib/commands.js";
8
8
  import { playNotificationSound as pe } from "../lib/notification-sound.js";
9
- import { BRAND_ACCENT as re, parseThemeAccents as Ke, DEFAULT_THEME_ACCENTS as he } from "../lib/theme-accents.js";
10
- import { announceLocalPrefs as ne } from "../lib/user-sync.js";
11
- import { cn as U, setDisplayTimezone as Ie } from "../lib/utils.js";
9
+ import { BRAND_ACCENT as se, parseThemeAccents as Ke, DEFAULT_THEME_ACCENTS as he } from "../lib/theme-accents.js";
10
+ import { announceLocalPrefs as le } from "../lib/user-sync.js";
11
+ import { cn as $, setDisplayTimezone as Ie } from "../lib/utils.js";
12
12
  import { CustomStatusEditor as je, activeCustomStatus as Qe } from "./CustomStatusEditor.js";
13
- import { AiMemoryCard as $e, AiHistoryCard as Re } from "./profile/AiMemoryCard.js";
14
- import { BrowserPushCard as Ue } from "./profile/BrowserPushCard.js";
15
- import { DelegationCard as ze } from "./profile/DelegationCard.js";
16
- import { MailSuppressedPill as Be } from "./profile/MailSuppressedPill.js";
17
- import { TeamLoadCard as He } from "./profile/PersonExtras.js";
18
- import { NotificationSourcesCard as Ye } from "./NotificationSourcesCard.js";
19
- import { UserScopesCard as We } from "./profile/PersonAccess.js";
20
- import { PersonProfile as Ge } from "./profile/PersonProfile.js";
21
- import { SectionCard as le, Field as H, ConfirmButton as be } from "./profile/primitives.js";
22
- import { SimpleSelectXs as K } from "./ui/SimpleSelect.js";
23
- const Je = (l) => [l.first_name, l.last_name].filter(Boolean).join(" ") || (l.email ?? "Unknown"), Ve = (l) => {
13
+ import { AgentsPanel as Re } from "./profile/AgentsPanel.js";
14
+ import { AiMemoryCard as $e, AiHistoryCard as Ue } from "./profile/AiMemoryCard.js";
15
+ import { BrowserPushCard as ze } from "./profile/BrowserPushCard.js";
16
+ import { DelegationCard as Be } from "./profile/DelegationCard.js";
17
+ import { MailSuppressedPill as He } from "./profile/MailSuppressedPill.js";
18
+ import { TeamLoadCard as Ye } from "./profile/PersonExtras.js";
19
+ import { NotificationSourcesCard as We } from "./NotificationSourcesCard.js";
20
+ import { UserScopesCard as Ge } from "./profile/PersonAccess.js";
21
+ import { PersonProfile as Je } from "./profile/PersonProfile.js";
22
+ import { SectionCard as ie, Field as Y, ConfirmButton as be } from "./profile/primitives.js";
23
+ import { SimpleSelectXs as M } from "./ui/SimpleSelect.js";
24
+ const Ve = (i) => [i.first_name, i.last_name].filter(Boolean).join(" ") || (i.email ?? "Unknown"), Ze = (i) => {
24
25
  var u, a;
25
- return (`${((u = l.first_name) == null ? void 0 : u[0]) ?? ""}${((a = l.last_name) == null ? void 0 : a[0]) ?? ""}` || (l.email ?? "?").slice(0, 2)).toUpperCase();
26
- }, X = [
26
+ return (`${((u = i.first_name) == null ? void 0 : u[0]) ?? ""}${((a = i.last_name) == null ? void 0 : a[0]) ?? ""}` || (i.email ?? "?").slice(0, 2)).toUpperCase();
27
+ }, te = [
27
28
  {
28
29
  key: "mentions",
29
30
  label: "Mentions",
@@ -75,18 +76,18 @@ const Je = (l) => [l.first_name, l.last_name].filter(Boolean).join(" ") || (l.em
75
76
  help: "Any notification that does not fit a category above — direct messages from other users, access requests, task assignments."
76
77
  }
77
78
  ];
78
- function Ze() {
79
- const l = F(), u = I(), { data: a = [] } = C({
79
+ function Xe() {
80
+ const i = T(), u = E(), { data: a = [] } = q({
80
81
  queryKey: ["nvr-profile-fields"],
81
- queryFn: () => l.request(D("/profile-fields/mine")).then((n) => n.data ?? []).catch(() => [])
82
- }), [s, o] = P(null), i = q({
83
- mutationFn: (n) => l.request(Me("/profile-fields/mine", { values: n })),
82
+ queryFn: () => i.request(F("/profile-fields/mine")).then((n) => n.data ?? []).catch(() => [])
83
+ }), [s, l] = C(null), o = _({
84
+ mutationFn: (n) => i.request(Me("/profile-fields/mine", { values: n })),
84
85
  onSuccess: () => {
85
- o(null), u.invalidateQueries({ queryKey: ["nvr-profile-fields"] });
86
+ l(null), u.invalidateQueries({ queryKey: ["nvr-profile-fields"] });
86
87
  }
87
88
  });
88
89
  if (a.length === 0) return null;
89
- const d = s ?? Object.fromEntries(a.map((n) => [n.key, n.value ?? ""])), c = (n) => Array.isArray(n) ? n.map(String) : Array.isArray(n == null ? void 0 : n.choices) ? n.choices.map(
90
+ const c = s ?? Object.fromEntries(a.map((n) => [n.key, n.value ?? ""])), m = (n) => Array.isArray(n) ? n.map(String) : Array.isArray(n == null ? void 0 : n.choices) ? n.choices.map(
90
91
  (b) => typeof b == "object" && b != null ? String(b.value ?? "") : String(b)
91
92
  ) : [];
92
93
  return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
@@ -100,31 +101,31 @@ function Ze() {
100
101
  n.required && /* @__PURE__ */ e("span", { className: "ml-0.5 text-red-500", children: "*" })
101
102
  ] }),
102
103
  n.type === "boolean" ? /* @__PURE__ */ e(
103
- K,
104
+ M,
104
105
  {
105
- value: d[n.key] || "false",
106
+ value: c[n.key] || "false",
106
107
  options: [
107
108
  { value: "true", label: "Yes" },
108
109
  { value: "false", label: "No" }
109
110
  ],
110
- onChange: (b) => o({ ...d, [n.key]: b })
111
+ onChange: (b) => l({ ...c, [n.key]: b })
111
112
  }
112
113
  ) : n.type === "select" ? /* @__PURE__ */ e(
113
- K,
114
+ M,
114
115
  {
115
- value: d[n.key] || "",
116
+ value: c[n.key] || "",
116
117
  options: [
117
118
  { value: "", label: "—" },
118
- ...c(n.options).map((b) => ({ value: b, label: b }))
119
+ ...m(n.options).map((b) => ({ value: b, label: b }))
119
120
  ],
120
- onChange: (b) => o({ ...d, [n.key]: b })
121
+ onChange: (b) => l({ ...c, [n.key]: b })
121
122
  }
122
123
  ) : /* @__PURE__ */ e(
123
124
  "input",
124
125
  {
125
126
  type: n.type === "number" ? "number" : n.type === "date" ? "date" : "text",
126
- value: d[n.key] ?? "",
127
- onChange: (b) => o({ ...d, [n.key]: b.target.value }),
127
+ value: c[n.key] ?? "",
128
+ onChange: (b) => l({ ...c, [n.key]: b.target.value }),
128
129
  className: "h-8 w-full rounded-md border border-slate-200 bg-background px-2 text-[12.5px] dark:border-border"
129
130
  }
130
131
  )
@@ -134,7 +135,7 @@ function Ze() {
134
135
  "button",
135
136
  {
136
137
  type: "button",
137
- onClick: () => o(null),
138
+ onClick: () => l(null),
138
139
  className: "h-7 rounded-md px-2.5 text-[12px] text-slate-500",
139
140
  children: "Cancel"
140
141
  }
@@ -143,77 +144,77 @@ function Ze() {
143
144
  "button",
144
145
  {
145
146
  type: "button",
146
- disabled: i.isPending,
147
- onClick: () => i.mutate(d),
147
+ disabled: o.isPending,
148
+ onClick: () => o.mutate(c),
148
149
  className: "h-7 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white disabled:opacity-50",
149
- children: i.isPending ? "Saving…" : "Save"
150
+ children: o.isPending ? "Saving…" : "Save"
150
151
  }
151
152
  )
152
153
  ] })
153
154
  ] });
154
155
  }
155
- function Xe() {
156
- const l = F(), u = I(), { data: a } = C({
156
+ function et() {
157
+ const i = T(), u = E(), { data: a } = q({
157
158
  queryKey: ["nvr-profile-prefs"],
158
- queryFn: () => l.request(D("/users/me")).then((r) => {
159
+ queryFn: () => i.request(F("/users/me")).then((r) => {
159
160
  var h;
160
161
  return ((h = r.data) == null ? void 0 : h.preferences) ?? {};
161
162
  })
162
- }), s = (a == null ? void 0 : a.notification_prefs) ?? {}, o = (a == null ? void 0 : a.email_digest) === "daily" ? "daily" : "instant", i = (r) => {
163
+ }), s = (a == null ? void 0 : a.notification_prefs) ?? {}, l = (a == null ? void 0 : a.email_digest) === "daily" ? "daily" : "instant", o = (r) => {
163
164
  var h, x;
164
- return ((x = (h = s.matrix) == null ? void 0 : h[r]) == null ? void 0 : x.email) ?? o;
165
- }, [d, c] = P(null), [n, b] = P(null), m = d ?? s.quiet_start ?? "", S = n ?? s.quiet_end ?? "", N = q({
166
- mutationFn: (r) => l.request(W("/users/me/preferences", { notification_prefs: r })),
165
+ return ((x = (h = s.matrix) == null ? void 0 : h[r]) == null ? void 0 : x.email) ?? l;
166
+ }, [c, m] = C(null), [n, b] = C(null), p = c ?? s.quiet_start ?? "", w = n ?? s.quiet_end ?? "", k = _({
167
+ mutationFn: (r) => i.request(V("/users/me/preferences", { notification_prefs: r })),
167
168
  onSuccess: () => {
168
- u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), ne(["notification_prefs"]);
169
+ u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), le(["notification_prefs"]);
169
170
  }
170
- }), T = q({
171
- mutationFn: (r) => l.request(W("/users/me/preferences", r)),
171
+ }), P = _({
172
+ mutationFn: (r) => i.request(V("/users/me/preferences", r)),
172
173
  onSuccess: (r, h) => {
173
- u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), ne(Object.keys(h));
174
+ u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), le(Object.keys(h));
174
175
  }
175
- }), [f, L] = P(null), M = q({
176
- mutationFn: (r) => l.request(ee("/notifications/rules-preview", { notification_prefs: r })),
177
- onSuccess: (r) => L({
176
+ }), [v, O] = C(null), L = _({
177
+ mutationFn: (r) => i.request(ae("/notifications/rules-preview", { notification_prefs: r })),
178
+ onSuccess: (r) => O({
178
179
  total: r.data.total_notifications,
179
180
  current: r.data.current,
180
181
  proposed: r.data.proposed
181
182
  })
182
- }), _ = (r) => {
183
+ }), S = (r) => {
183
184
  const h = {
184
- quiet_start: r.quiet_start ?? (m || void 0),
185
- quiet_end: r.quiet_end ?? (S || void 0),
185
+ quiet_start: r.quiet_start ?? (p || void 0),
186
+ quiet_end: r.quiet_end ?? (w || void 0),
186
187
  matrix: r.matrix ?? s.matrix ?? {},
187
188
  escalation: r.escalation ?? s.escalation ?? {}
188
189
  };
189
- M.mutate(h), N.mutate(h);
190
- }, y = (a == null ? void 0 : a.notification_sounds) ?? {}, k = (r, h) => {
190
+ L.mutate(h), k.mutate(h);
191
+ }, y = (a == null ? void 0 : a.notification_sounds) ?? {}, z = (r, h) => {
191
192
  const x = { ...y };
192
- h === "default" ? delete x[r] : x[r] = h, h !== "default" && pe(h, { preview: !0 }), T.mutate({ notification_sounds: Object.keys(x).length ? x : null });
193
- }, { data: E } = C({
193
+ h === "default" ? delete x[r] : x[r] = h, h !== "default" && pe(h, { preview: !0 }), P.mutate({ notification_sounds: Object.keys(x).length ? x : null });
194
+ }, { data: I } = q({
194
195
  queryKey: ["nvr-noise-suggestions"],
195
- queryFn: () => l.request(D("/notifications/noise-suggestions")).then((r) => r.data ?? []),
196
+ queryFn: () => i.request(F("/notifications/noise-suggestions")).then((r) => r.data ?? []),
196
197
  staleTime: 6e5
197
- }), [O, R] = P({}), [v, j] = P(() => {
198
+ }), [f, K] = C({}), [j, U] = C(() => {
198
199
  try {
199
200
  const r = JSON.parse(localStorage.getItem("nvr-noise-dismissed") ?? "null");
200
201
  return r && Date.now() - r.at < 30 * 864e5 ? r.cats : [];
201
202
  } catch {
202
203
  return [];
203
204
  }
204
- }), p = (r) => {
205
- const h = [...v, r];
206
- j(h);
205
+ }), d = (r) => {
206
+ const h = [...j, r];
207
+ U(h);
207
208
  try {
208
209
  localStorage.setItem("nvr-noise-dismissed", JSON.stringify({ at: Date.now(), cats: h }));
209
210
  } catch {
210
211
  }
211
- }, w = (r, h, x) => {
212
+ }, N = (r, h, x) => {
212
213
  var ce;
213
214
  const g = { ...((ce = s.escalation) == null ? void 0 : ce[r]) ?? {} };
214
215
  x ? g[h] = x : delete g[h];
215
- const B = { ...s.escalation ?? {} };
216
- Object.keys(g).length ? B[r] = g : delete B[r], _({ escalation: B });
216
+ const H = { ...s.escalation ?? {} };
217
+ Object.keys(g).length ? H[r] = g : delete H[r], S({ escalation: H });
217
218
  }, A = [
218
219
  { value: "", label: "never" },
219
220
  { value: "15", label: "15 min" },
@@ -221,35 +222,35 @@ function Xe() {
221
222
  { value: "240", label: "4 hours" },
222
223
  { value: "480", label: "8 hours" },
223
224
  { value: "1440", label: "1 day" }
224
- ], Y = (r, h) => {
225
+ ], Z = (r, h) => {
225
226
  var g;
226
227
  const x = ((g = s.matrix) == null ? void 0 : g[r]) ?? { inapp: !0, push: !0 };
227
- _({
228
+ S({
228
229
  matrix: { ...s.matrix ?? {}, [r]: { ...x, [h]: x[h] === !1 } }
229
230
  });
230
- }, Q = (r, h) => {
231
+ }, D = (r, h) => {
231
232
  var g;
232
233
  const x = ((g = s.matrix) == null ? void 0 : g[r]) ?? { inapp: !0, push: !0 };
233
- _({ matrix: { ...s.matrix ?? {}, [r]: { ...x, email: h } } });
234
- }, z = (r) => {
234
+ S({ matrix: { ...s.matrix ?? {}, [r]: { ...x, email: h } } });
235
+ }, W = (r) => {
235
236
  var g;
236
237
  const h = ((g = s.matrix) == null ? void 0 : g[r]) ?? { inapp: !0, push: !0 }, x = { ...h };
237
- h.quiet_override ? delete x.quiet_override : x.quiet_override = !0, _({ matrix: { ...s.matrix ?? {}, [r]: x } });
238
- }, G = !!(m && S), J = (r) => {
238
+ h.quiet_override ? delete x.quiet_override : x.quiet_override = !0, S({ matrix: { ...s.matrix ?? {}, [r]: x } });
239
+ }, Q = !!(p && w), B = (r) => {
239
240
  var x;
240
241
  const h = {};
241
- for (const g of X)
242
+ for (const g of te)
242
243
  h[g.key] = { ...((x = s.matrix) == null ? void 0 : x[g.key]) ?? { inapp: !0, push: !0 }, email: r };
243
- _({ matrix: h }), r !== "off" && T.mutate({ email_digest: r });
244
- }, V = Number.isInteger(Number(a == null ? void 0 : a.digest_hour)) ? Number(a == null ? void 0 : a.digest_hour) : 7, Z = (r) => `${r % 12 === 0 ? 12 : r % 12}:45 ${r < 12 ? "AM" : "PM"}`, [oe, ie] = P(null), te = q({
245
- mutationFn: () => l.request(ee("/users/me/digest-test", {})),
246
- onSuccess: (r) => ie(r.data.note),
247
- onError: () => ie("Test send failed — try again.")
248
- }), ge = X.some((r) => i(r.key) === "daily"), de = [
244
+ S({ matrix: h }), r !== "off" && P.mutate({ email_digest: r });
245
+ }, X = Number.isInteger(Number(a == null ? void 0 : a.digest_hour)) ? Number(a == null ? void 0 : a.digest_hour) : 7, ee = (r) => `${r % 12 === 0 ? 12 : r % 12}:45 ${r < 12 ? "AM" : "PM"}`, [G, J] = C(null), re = _({
246
+ mutationFn: () => i.request(ae("/users/me/digest-test", {})),
247
+ onSuccess: (r) => J(r.data.note),
248
+ onError: () => J("Test send failed — try again.")
249
+ }), ge = te.some((r) => o(r.key) === "daily"), de = [
249
250
  { value: "instant", label: "Individual email" },
250
251
  { value: "daily", label: "Daily summary" },
251
252
  { value: "off", label: "No email" }
252
- ], $ = ({ text: r }) => /* @__PURE__ */ e(
253
+ ], R = ({ text: r }) => /* @__PURE__ */ e(
253
254
  "span",
254
255
  {
255
256
  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",
@@ -271,7 +272,7 @@ function Xe() {
271
272
  /* @__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." })
272
273
  ] }),
273
274
  /* @__PURE__ */ t("div", { className: "space-y-3 p-4", children: [
274
- (E ?? []).filter((r) => !v.includes(r.category)).map((r) => /* @__PURE__ */ t(
275
+ (I ?? []).filter((r) => !j.includes(r.category)).map((r) => /* @__PURE__ */ t(
275
276
  "div",
276
277
  {
277
278
  "data-noise-suggestion": r.category,
@@ -281,22 +282,22 @@ function Xe() {
281
282
  r.message,
282
283
  " Mute them?"
283
284
  ] }),
284
- r.category in O ? /* @__PURE__ */ e(
285
+ r.category in f ? /* @__PURE__ */ e(
285
286
  "button",
286
287
  {
287
288
  type: "button",
288
289
  className: "underline",
289
290
  onClick: () => {
290
- _({
291
+ S({
291
292
  matrix: {
292
293
  ...s.matrix ?? {},
293
- [r.category]: O[r.category]
294
+ [r.category]: f[r.category]
294
295
  }
295
- }), R(({ [r.category]: h, ...x }) => x);
296
+ }), K(({ [r.category]: h, ...x }) => x);
296
297
  },
297
298
  children: "Muted — undo"
298
299
  }
299
- ) : /* @__PURE__ */ t(se, { children: [
300
+ ) : /* @__PURE__ */ t(oe, { children: [
300
301
  /* @__PURE__ */ e(
301
302
  "button",
302
303
  {
@@ -305,7 +306,7 @@ function Xe() {
305
306
  onClick: () => {
306
307
  var x;
307
308
  const h = ((x = s.matrix) == null ? void 0 : x[r.category]) ?? { inapp: !0, push: !0 };
308
- R((g) => ({ ...g, [r.category]: h })), _({
309
+ K((g) => ({ ...g, [r.category]: h })), S({
309
310
  matrix: {
310
311
  ...s.matrix ?? {},
311
312
  [r.category]: { ...h, inapp: !1, push: !1 }
@@ -315,13 +316,13 @@ function Xe() {
315
316
  children: "Mute"
316
317
  }
317
318
  ),
318
- /* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () => p(r.category), children: "Not now" })
319
+ /* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () => d(r.category), children: "Not now" })
319
320
  ] })
320
321
  ]
321
322
  },
322
323
  r.category
323
324
  )),
324
- f && f.total > 0 && /* @__PURE__ */ t(
325
+ v && v.total > 0 && /* @__PURE__ */ t(
325
326
  "div",
326
327
  {
327
328
  "data-rules-preview": !0,
@@ -329,23 +330,23 @@ function Xe() {
329
330
  children: [
330
331
  /* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: [
331
332
  "Last week with this change: ",
332
- f.proposed.inapp,
333
+ v.proposed.inapp,
333
334
  " in-app instead of",
334
335
  " ",
335
- f.current.inapp,
336
+ v.current.inapp,
336
337
  ", ",
337
- f.proposed.email_sent,
338
+ v.proposed.email_sent,
338
339
  " emails instead of",
339
340
  " ",
340
- f.current.email_sent,
341
+ v.current.email_sent,
341
342
  ", ",
342
- f.proposed.push,
343
+ v.proposed.push,
343
344
  " pushes instead of",
344
345
  " ",
345
- f.current.push,
346
+ v.current.push,
346
347
  "."
347
348
  ] }),
348
- /* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () => L(null), children: "Dismiss" })
349
+ /* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () => O(null), children: "Dismiss" })
349
350
  ]
350
351
  }
351
352
  ),
@@ -355,9 +356,9 @@ function Xe() {
355
356
  "input",
356
357
  {
357
358
  type: "time",
358
- value: m,
359
- onChange: (r) => c(r.target.value),
360
- onBlur: () => _({ quiet_start: m || void 0 }),
359
+ value: p,
360
+ onChange: (r) => m(r.target.value),
361
+ onBlur: () => S({ quiet_start: p || void 0 }),
361
362
  className: "h-7 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
362
363
  }
363
364
  ),
@@ -366,18 +367,18 @@ function Xe() {
366
367
  "input",
367
368
  {
368
369
  type: "time",
369
- value: S,
370
+ value: w,
370
371
  onChange: (r) => b(r.target.value),
371
- onBlur: () => _({ quiet_end: S || void 0 }),
372
+ onBlur: () => S({ quiet_end: w || void 0 }),
372
373
  className: "h-7 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
373
374
  }
374
375
  ),
375
- (m || S) && /* @__PURE__ */ e(
376
+ (p || w) && /* @__PURE__ */ e(
376
377
  "button",
377
378
  {
378
379
  type: "button",
379
380
  onClick: () => {
380
- c(""), b(""), N.mutate({ matrix: s.matrix ?? {} });
381
+ m(""), b(""), k.mutate({ matrix: s.matrix ?? {} });
381
382
  },
382
383
  className: "text-[11.5px] text-slate-400 underline decoration-dotted underline-offset-2",
383
384
  children: "Clear"
@@ -387,7 +388,7 @@ function Xe() {
387
388
  /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
388
389
  "Sound:",
389
390
  /* @__PURE__ */ e(
390
- K,
391
+ M,
391
392
  {
392
393
  value: String((a == null ? void 0 : a.notification_sound) ?? "off"),
393
394
  options: [
@@ -396,7 +397,7 @@ function Xe() {
396
397
  { value: "chime", label: "Chime" }
397
398
  ],
398
399
  onChange: (r) => {
399
- pe(r, { preview: !0 }), T.mutate({ notification_sound: r });
400
+ pe(r, { preview: !0 }), P.mutate({ notification_sound: r });
400
401
  }
401
402
  }
402
403
  ),
@@ -407,54 +408,54 @@ function Xe() {
407
408
  /* @__PURE__ */ e("th", { className: "py-1 font-semibold", children: "Category" }),
408
409
  /* @__PURE__ */ t("th", { className: "py-1 text-center font-semibold", children: [
409
410
  "In-app",
410
- /* @__PURE__ */ e($, { 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." })
411
+ /* @__PURE__ */ e(R, { 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." })
411
412
  ] }),
412
413
  /* @__PURE__ */ t("th", { className: "py-1 text-center font-semibold", children: [
413
414
  "Push",
414
- /* @__PURE__ */ e($, { 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." })
415
+ /* @__PURE__ */ e(R, { 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." })
415
416
  ] }),
416
417
  /* @__PURE__ */ t("th", { className: "py-1 text-center font-semibold", children: [
417
418
  "Email",
418
- /* @__PURE__ */ e($, { 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)." })
419
+ /* @__PURE__ */ e(R, { 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)." })
419
420
  ] }),
420
421
  /* @__PURE__ */ t("th", { className: "py-1 text-center font-semibold", children: [
421
422
  "Sound",
422
- /* @__PURE__ */ e($, { text: "A different sound for this category, or none. Default follows the Sound setting above." })
423
+ /* @__PURE__ */ e(R, { text: "A different sound for this category, or none. Default follows the Sound setting above." })
423
424
  ] }),
424
425
  /* @__PURE__ */ t("th", { className: "py-1 text-center font-semibold", children: [
425
426
  "Quiet hours",
426
- /* @__PURE__ */ e($, { 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." })
427
+ /* @__PURE__ */ e(R, { 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." })
427
428
  ] })
428
429
  ] }) }),
429
- /* @__PURE__ */ e("tbody", { children: X.map((r) => {
430
+ /* @__PURE__ */ e("tbody", { children: te.map((r) => {
430
431
  var x;
431
432
  const h = ((x = s.matrix) == null ? void 0 : x[r.key]) ?? {};
432
433
  return /* @__PURE__ */ t("tr", { className: "border-t border-slate-100 dark:border-border", children: [
433
434
  /* @__PURE__ */ t("td", { className: "py-1.5 text-slate-700 dark:text-foreground", children: [
434
435
  r.label,
435
- /* @__PURE__ */ e($, { text: r.help })
436
+ /* @__PURE__ */ e(R, { text: r.help })
436
437
  ] }),
437
438
  ["inapp", "push"].map((g) => /* @__PURE__ */ e("td", { className: "py-1.5 text-center", children: /* @__PURE__ */ e(
438
439
  "input",
439
440
  {
440
441
  type: "checkbox",
441
442
  checked: h[g] !== !1,
442
- onChange: () => Y(r.key, g),
443
- disabled: N.isPending,
443
+ onChange: () => Z(r.key, g),
444
+ disabled: k.isPending,
444
445
  className: "h-3.5 w-3.5"
445
446
  }
446
447
  ) }, g)),
447
448
  /* @__PURE__ */ e("td", { className: "py-1 text-center", children: /* @__PURE__ */ e("div", { className: "inline-block", children: /* @__PURE__ */ e(
448
- K,
449
+ M,
449
450
  {
450
451
  ariaLabel: `Email for ${r.label}`,
451
- value: i(r.key),
452
+ value: o(r.key),
452
453
  options: de,
453
- onChange: (g) => Q(r.key, g)
454
+ onChange: (g) => D(r.key, g)
454
455
  }
455
456
  ) }) }),
456
457
  /* @__PURE__ */ e("td", { className: "py-1 text-center", children: /* @__PURE__ */ e("div", { className: "inline-block", children: /* @__PURE__ */ e(
457
- K,
458
+ M,
458
459
  {
459
460
  ariaLabel: `Sound for ${r.label}`,
460
461
  value: y[r.key] ?? "default",
@@ -464,7 +465,7 @@ function Xe() {
464
465
  { value: "subtle", label: "Subtle blip" },
465
466
  { value: "chime", label: "Chime" }
466
467
  ],
467
- onChange: (g) => k(r.key, g)
468
+ onChange: (g) => z(r.key, g)
468
469
  }
469
470
  ) }) }),
470
471
  /* @__PURE__ */ e("td", { className: "py-1.5 text-center", children: /* @__PURE__ */ e(
@@ -472,10 +473,10 @@ function Xe() {
472
473
  {
473
474
  type: "checkbox",
474
475
  checked: h.quiet_override === !0,
475
- onChange: () => z(r.key),
476
- disabled: N.isPending,
476
+ onChange: () => W(r.key),
477
+ disabled: k.isPending,
477
478
  "aria-label": `Let ${r.label} through quiet hours`,
478
- title: G ? void 0 : "Set quiet hours above for this to matter — it is remembered either way",
479
+ title: Q ? void 0 : "Set quiet hours above for this to matter — it is remembered either way",
479
480
  "data-quiet-override": r.key,
480
481
  className: "h-3.5 w-3.5"
481
482
  }
@@ -489,8 +490,8 @@ function Xe() {
489
490
  "button",
490
491
  {
491
492
  type: "button",
492
- disabled: N.isPending,
493
- onClick: () => J(r.value),
493
+ disabled: k.isPending,
494
+ onClick: () => B(r.value),
494
495
  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",
495
496
  children: r.label
496
497
  },
@@ -507,25 +508,25 @@ function Xe() {
507
508
  /* @__PURE__ */ e("th", { className: "py-1 font-semibold", children: "Category" }),
508
509
  /* @__PURE__ */ t("th", { className: "py-1 font-semibold", children: [
509
510
  "Push after",
510
- /* @__PURE__ */ e($, { text: "Still unread after this long → a browser / device push (needs a registered device; quiet hours do not apply to escalations you asked for)." })
511
+ /* @__PURE__ */ e(R, { text: "Still unread after this long → a browser / device push (needs a registered device; quiet hours do not apply to escalations you asked for)." })
511
512
  ] }),
512
513
  /* @__PURE__ */ t("th", { className: "py-1 font-semibold", children: [
513
514
  "Email after",
514
- /* @__PURE__ */ e($, { 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)." })
515
+ /* @__PURE__ */ e(R, { 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)." })
515
516
  ] })
516
517
  ] }) }),
517
- /* @__PURE__ */ e("tbody", { children: X.map((r) => {
518
+ /* @__PURE__ */ e("tbody", { children: te.map((r) => {
518
519
  var x;
519
520
  const h = ((x = s.escalation) == null ? void 0 : x[r.key]) ?? {};
520
521
  return /* @__PURE__ */ t("tr", { className: "border-t border-slate-100 dark:border-border", children: [
521
522
  /* @__PURE__ */ e("td", { className: "py-1 text-slate-700 dark:text-foreground", children: r.label }),
522
523
  ["push_after_min", "email_after_min"].map((g) => /* @__PURE__ */ e("td", { className: "py-1", children: /* @__PURE__ */ e(
523
- K,
524
+ M,
524
525
  {
525
526
  ariaLabel: `${g === "push_after_min" ? "Push" : "Email"} after for ${r.label}`,
526
527
  value: h[g] ? String(h[g]) : "",
527
528
  options: A,
528
- onChange: (B) => w(r.key, g, B ? Number(B) : null)
529
+ onChange: (H) => N(r.key, g, H ? Number(H) : null)
529
530
  }
530
531
  ) }, g))
531
532
  ] }, r.key);
@@ -544,14 +545,14 @@ function Xe() {
544
545
  /* @__PURE__ */ t("span", { className: "flex items-center gap-1.5", children: [
545
546
  "Deliver at",
546
547
  /* @__PURE__ */ e(
547
- K,
548
+ M,
548
549
  {
549
550
  ariaLabel: "Digest delivery hour",
550
- value: String(V),
551
- onChange: (r) => T.mutate({ digest_hour: Number(r) }),
551
+ value: String(X),
552
+ onChange: (r) => P.mutate({ digest_hour: Number(r) }),
552
553
  options: Array.from({ length: 24 }, (r, h) => ({
553
554
  value: String(h),
554
- label: Z(h)
555
+ label: ee(h)
555
556
  }))
556
557
  }
557
558
  ),
@@ -563,7 +564,7 @@ function Xe() {
563
564
  {
564
565
  type: "checkbox",
565
566
  checked: (a == null ? void 0 : a.digest_layout) === "compact",
566
- onChange: (r) => T.mutate({ digest_layout: r.target.checked ? "compact" : "detailed" }),
567
+ onChange: (r) => P.mutate({ digest_layout: r.target.checked ? "compact" : "detailed" }),
567
568
  className: "rounded"
568
569
  }
569
570
  ),
@@ -573,13 +574,13 @@ function Xe() {
573
574
  "button",
574
575
  {
575
576
  type: "button",
576
- disabled: te.isPending,
577
- onClick: () => te.mutate(),
577
+ disabled: re.isPending,
578
+ onClick: () => re.mutate(),
578
579
  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",
579
- children: te.isPending ? "Building…" : "Send me a test summary now"
580
+ children: re.isPending ? "Building…" : "Send me a test summary now"
580
581
  }
581
582
  ),
582
- oe && /* @__PURE__ */ e("span", { className: "text-[11.5px] text-slate-400", children: oe })
583
+ G && /* @__PURE__ */ e("span", { className: "text-[11.5px] text-slate-400", children: G })
583
584
  ] })
584
585
  ] }),
585
586
  /* @__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: [
@@ -596,7 +597,7 @@ function Xe() {
596
597
  {
597
598
  type: "checkbox",
598
599
  checked: ((x = a == null ? void 0 : a.auto_watch) == null ? void 0 : x[r]) === !0,
599
- onChange: (g) => T.mutate({
600
+ onChange: (g) => P.mutate({
600
601
  auto_watch: {
601
602
  ...(a == null ? void 0 : a.auto_watch) ?? {},
602
603
  [r]: g.target.checked
@@ -614,15 +615,15 @@ function Xe() {
614
615
  }
615
616
  );
616
617
  }
617
- function et() {
618
- const l = F(), u = I(), { data: a } = C({
618
+ function tt() {
619
+ const i = T(), u = E(), { data: a } = q({
619
620
  queryKey: ["nvr-profile-prefs"],
620
- queryFn: () => l.request(D("/users/me")).then((d) => {
621
- var c;
622
- return ((c = d.data) == null ? void 0 : c.preferences) ?? {};
621
+ queryFn: () => i.request(F("/users/me")).then((c) => {
622
+ var m;
623
+ return ((m = c.data) == null ? void 0 : m.preferences) ?? {};
623
624
  })
624
- }), s = (a == null ? void 0 : a.link_app) === "portal" || (a == null ? void 0 : a.link_app) === "admin" ? a.link_app : "auto", o = q({
625
- mutationFn: (d) => l.request(W("/users/me/preferences", { link_app: d })),
625
+ }), s = (a == null ? void 0 : a.link_app) === "portal" || (a == null ? void 0 : a.link_app) === "admin" ? a.link_app : "auto", l = _({
626
+ mutationFn: (c) => i.request(V("/users/me/preferences", { link_app: c })),
626
627
  onSuccess: () => void u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] })
627
628
  });
628
629
  return /* @__PURE__ */ t(
@@ -637,50 +638,50 @@ function et() {
637
638
  { v: "auto", label: "Automatic", hint: "Admins open the admin, everyone else the portal" },
638
639
  { v: "portal", label: "Portal", hint: "Always the front-end app" },
639
640
  { v: "admin", label: "Admin", hint: "Always the admin console" }
640
- ].map((d) => /* @__PURE__ */ e(
641
+ ].map((c) => /* @__PURE__ */ e(
641
642
  "button",
642
643
  {
643
644
  type: "button",
644
- title: d.hint,
645
- onClick: () => o.mutate(d.v),
646
- className: s === d.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",
647
- children: d.label
645
+ title: c.hint,
646
+ onClick: () => l.mutate(c.v),
647
+ className: s === 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",
648
+ children: c.label
648
649
  },
649
- d.v
650
+ c.v
650
651
  )) })
651
652
  ]
652
653
  }
653
654
  );
654
655
  }
655
- function tt() {
656
- const l = F(), u = I(), [a, s] = P(""), o = (() => {
656
+ function at() {
657
+ const i = T(), u = E(), [a, s] = C(""), l = (() => {
657
658
  try {
658
659
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
659
660
  } catch {
660
661
  return "UTC";
661
662
  }
662
- })(), i = (() => {
663
- var m;
663
+ })(), o = (() => {
664
+ var p;
664
665
  try {
665
- return ((m = Intl.supportedValuesOf) == null ? void 0 : m.call(
666
+ return ((p = Intl.supportedValuesOf) == null ? void 0 : p.call(
666
667
  Intl,
667
668
  "timeZone"
668
669
  )) ?? [];
669
670
  } catch {
670
671
  return [];
671
672
  }
672
- })(), { data: d } = C({
673
+ })(), { data: c } = q({
673
674
  queryKey: ["nvr-profile-prefs"],
674
- queryFn: () => l.request(D("/users/me")).then((m) => {
675
- var S;
676
- return ((S = m.data) == null ? void 0 : S.preferences) ?? {};
675
+ queryFn: () => i.request(F("/users/me")).then((p) => {
676
+ var w;
677
+ return ((w = p.data) == null ? void 0 : w.preferences) ?? {};
677
678
  })
678
- }), c = typeof (d == null ? void 0 : d.timezone) == "string" ? d.timezone : null, n = q({
679
- mutationFn: (m) => l.request(W("/users/me/preferences", { timezone: m })),
680
- onSuccess: (m, S) => {
681
- Ie(S), s(""), u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] });
679
+ }), m = typeof (c == null ? void 0 : c.timezone) == "string" ? c.timezone : null, n = _({
680
+ mutationFn: (p) => i.request(V("/users/me/preferences", { timezone: p })),
681
+ onSuccess: (p, w) => {
682
+ Ie(w), s(""), u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] });
682
683
  }
683
- }), b = a.length > 1 ? i.filter((m) => m.toLowerCase().includes(a.toLowerCase())).slice(0, 8) : [];
684
+ }), b = a.length > 1 ? o.filter((p) => p.toLowerCase().includes(a.toLowerCase())).slice(0, 8) : [];
684
685
  return /* @__PURE__ */ t(
685
686
  "div",
686
687
  {
@@ -691,12 +692,12 @@ function tt() {
691
692
  /* @__PURE__ */ t("p", { className: "mt-0.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
692
693
  "Dates and times render in this zone. Your browser reports",
693
694
  " ",
694
- /* @__PURE__ */ e("span", { className: "font-medium", children: o }),
695
+ /* @__PURE__ */ e("span", { className: "font-medium", children: l }),
695
696
  "."
696
697
  ] }),
697
698
  /* @__PURE__ */ t("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [
698
- /* @__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: c ?? `${o} (browser default)` }),
699
- c && /* @__PURE__ */ e(
699
+ /* @__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 ?? `${l} (browser default)` }),
700
+ m && /* @__PURE__ */ e(
700
701
  "button",
701
702
  {
702
703
  type: "button",
@@ -711,114 +712,114 @@ function tt() {
711
712
  "input",
712
713
  {
713
714
  value: a,
714
- onChange: (m) => s(m.target.value),
715
+ onChange: (p) => s(p.target.value),
715
716
  placeholder: "Change zone… (e.g. America/Denver)",
716
717
  className: "h-8 w-[280px] rounded-md border border-slate-200 bg-background px-2.5 text-[12.5px] dark:border-border"
717
718
  }
718
719
  ),
719
- 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((m) => /* @__PURE__ */ e(
720
+ 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((p) => /* @__PURE__ */ e(
720
721
  "button",
721
722
  {
722
723
  type: "button",
723
- onClick: () => n.mutate(m),
724
+ onClick: () => n.mutate(p),
724
725
  className: "block w-full px-2.5 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-foreground",
725
- children: m
726
+ children: p
726
727
  },
727
- m
728
+ p
728
729
  )) })
729
730
  ] })
730
731
  ]
731
732
  }
732
733
  );
733
734
  }
734
- function at() {
735
- const l = F(), u = I(), { data: a } = C({
735
+ function rt() {
736
+ const i = T(), u = E(), { data: a } = q({
736
737
  queryKey: ["nvr-profile-scopes"],
737
- queryFn: () => l.request(ve()).then((o) => o.data)
738
- }), s = q({
739
- mutationFn: ({ dimension: o, values: i }) => l.request(ke(o, i)),
738
+ queryFn: () => i.request(ve()).then((l) => l.data)
739
+ }), s = _({
740
+ mutationFn: ({ dimension: l, values: o }) => i.request(ke(l, o)),
740
741
  onSuccess: () => void u.invalidateQueries({ queryKey: ["nvr-profile-scopes"] })
741
742
  });
742
743
  return !a || a.dimensions.length === 0 ? null : /* @__PURE__ */ e(
743
- le,
744
+ ie,
744
745
  {
745
746
  testId: "scopes",
746
747
  icon: /* @__PURE__ */ e(Te, { className: "h-4 w-4" }),
747
748
  title: "Default filters",
748
749
  hint: "Pre-selected in browsers and reports — clear anytime",
749
- children: /* @__PURE__ */ e("div", { className: "space-y-3", children: a.dimensions.map((o) => /* @__PURE__ */ e(
750
- rt,
750
+ children: /* @__PURE__ */ e("div", { className: "space-y-3", children: a.dimensions.map((l) => /* @__PURE__ */ e(
751
+ nt,
751
752
  {
752
- dimension: o,
753
- selected: a.defaults[o.name] ?? [],
754
- restricted: a.restricted[o.name],
755
- onSave: (i) => s.mutate({ dimension: o.name, values: i })
753
+ dimension: l,
754
+ selected: a.defaults[l.name] ?? [],
755
+ restricted: a.restricted[l.name],
756
+ onSave: (o) => s.mutate({ dimension: l.name, values: o })
756
757
  },
757
- o.name
758
+ l.name
758
759
  )) })
759
760
  }
760
761
  );
761
762
  }
762
- function rt({
763
- dimension: l,
763
+ function nt({
764
+ dimension: i,
764
765
  selected: u,
765
766
  restricted: a,
766
767
  onSave: s
767
768
  }) {
768
- const o = F(), i = l.display_field ?? "name", [d, c] = P(""), [n, b] = P(!1), { data: m = [] } = C({
769
- queryKey: ["nvr-scope-options", l.name],
770
- queryFn: async () => ((await o.request(
771
- ae(l.target_collection, {
772
- fields: ["id", i],
773
- sort: l.options_sort ? [l.options_sort] : void 0,
769
+ const l = T(), o = i.display_field ?? "name", [c, m] = C(""), [n, b] = C(!1), { data: p = [] } = q({
770
+ queryKey: ["nvr-scope-options", i.name],
771
+ queryFn: async () => ((await l.request(
772
+ ne(i.target_collection, {
773
+ fields: ["id", o],
774
+ sort: i.options_sort ? [i.options_sort] : void 0,
774
775
  limit: 200
775
776
  })
776
- )).data ?? []).map((w) => ({
777
- id: w.id,
778
- label: String(w[i] ?? w.id)
777
+ )).data ?? []).map((N) => ({
778
+ id: N.id,
779
+ label: String(N[o] ?? N.id)
779
780
  }))
780
- }), S = a != null && a.length ? new Set(a.map(String)) : null, N = S ? m.filter((p) => S.has(String(p.id))) : m, T = new Set(u.map(String)), f = N.length > 24 || m.length >= 200 && !S, { data: L = [], isFetching: M } = C({
781
- queryKey: ["nvr-scope-search", l.name, d],
781
+ }), w = a != null && a.length ? new Set(a.map(String)) : null, k = w ? p.filter((d) => w.has(String(d.id))) : p, P = new Set(u.map(String)), v = k.length > 24 || p.length >= 200 && !w, { data: O = [], isFetching: L } = q({
782
+ queryKey: ["nvr-scope-search", i.name, c],
782
783
  queryFn: async () => {
783
- const w = ((await o.request(
784
- ae(l.target_collection, {
785
- fields: ["id", i],
786
- filter: { [i]: { _contains: d } },
787
- sort: l.options_sort ? [l.options_sort] : void 0,
784
+ const N = ((await l.request(
785
+ ne(i.target_collection, {
786
+ fields: ["id", o],
787
+ filter: { [o]: { _contains: c } },
788
+ sort: i.options_sort ? [i.options_sort] : void 0,
788
789
  limit: 30
789
790
  })
790
791
  )).data ?? []).map((A) => ({
791
792
  id: A.id,
792
- label: String(A[i] ?? A.id)
793
+ label: String(A[o] ?? A.id)
793
794
  }));
794
- return S ? w.filter((A) => S.has(String(A.id))) : w;
795
+ return w ? N.filter((A) => w.has(String(A.id))) : N;
795
796
  },
796
- enabled: f && d.trim().length > 0,
797
- placeholderData: (p) => p
798
- }), _ = new Map(m.map((p) => [String(p.id), p.label]));
799
- for (const p of L) _.set(String(p.id), p.label);
800
- const y = u.filter((p) => !_.has(String(p))), { data: k = [] } = C({
801
- queryKey: ["nvr-scope-selected-labels", l.name, y.map(String).sort().join(",")],
802
- queryFn: async () => ((await o.request(
803
- ae(l.target_collection, {
804
- fields: ["id", i],
797
+ enabled: v && c.trim().length > 0,
798
+ placeholderData: (d) => d
799
+ }), S = new Map(p.map((d) => [String(d.id), d.label]));
800
+ for (const d of O) S.set(String(d.id), d.label);
801
+ const y = u.filter((d) => !S.has(String(d))), { data: z = [] } = q({
802
+ queryKey: ["nvr-scope-selected-labels", i.name, y.map(String).sort().join(",")],
803
+ queryFn: async () => ((await l.request(
804
+ ne(i.target_collection, {
805
+ fields: ["id", o],
805
806
  filter: { id: { _in: y } },
806
807
  limit: 100
807
808
  })
808
- )).data ?? []).map((w) => ({
809
- id: w.id,
810
- label: String(w[i] ?? w.id)
809
+ )).data ?? []).map((N) => ({
810
+ id: N.id,
811
+ label: String(N[o] ?? N.id)
811
812
  })),
812
813
  enabled: y.length > 0
813
814
  });
814
- for (const p of k) _.set(String(p.id), p.label);
815
- const E = (p) => {
816
- const w = T.has(String(p));
817
- s(w ? u.filter((A) => String(A) !== String(p)) : [...u, p]);
818
- }, O = d.trim().toLowerCase(), R = O ? N.filter((p) => p.label.toLowerCase().includes(O)) : N, v = O.length === 0 ? N.slice(0, 30) : M && L.length === 0 ? R.slice(0, 30) : L, j = f && (n || O.length > 0);
815
+ for (const d of z) S.set(String(d.id), d.label);
816
+ const I = (d) => {
817
+ const N = P.has(String(d));
818
+ s(N ? u.filter((A) => String(A) !== String(d)) : [...u, d]);
819
+ }, f = c.trim().toLowerCase(), K = f ? k.filter((d) => d.label.toLowerCase().includes(f)) : k, j = f.length === 0 ? k.slice(0, 30) : L && O.length === 0 ? K.slice(0, 30) : O, U = v && (n || f.length > 0);
819
820
  return /* @__PURE__ */ t("div", { children: [
820
821
  /* @__PURE__ */ t("p", { className: "mb-1 text-[11px] font-medium uppercase tracking-wide text-slate-400", children: [
821
- l.label,
822
+ i.label,
822
823
  a != null && a.length ? /* @__PURE__ */ e("span", { className: "ml-1.5 normal-case tracking-normal text-amber-500", children: "(limited by your access)" }) : null,
823
824
  u.length > 0 && /* @__PURE__ */ t(
824
825
  "button",
@@ -833,131 +834,131 @@ function rt({
833
834
  }
834
835
  )
835
836
  ] }),
836
- f ? /* @__PURE__ */ t("div", { className: "max-w-xl", children: [
837
- u.length > 0 && /* @__PURE__ */ e("div", { className: "mb-1.5 flex flex-wrap gap-1", children: u.map((p) => /* @__PURE__ */ t(
837
+ v ? /* @__PURE__ */ t("div", { className: "max-w-xl", children: [
838
+ u.length > 0 && /* @__PURE__ */ e("div", { className: "mb-1.5 flex flex-wrap gap-1", children: u.map((d) => /* @__PURE__ */ t(
838
839
  "span",
839
840
  {
840
841
  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",
841
842
  children: [
842
- _.get(String(p)) ?? String(p),
843
+ S.get(String(d)) ?? String(d),
843
844
  /* @__PURE__ */ e(
844
845
  "button",
845
846
  {
846
847
  type: "button",
847
- onClick: () => E(p),
848
- "aria-label": `Remove ${_.get(String(p)) ?? p}`,
848
+ onClick: () => I(d),
849
+ "aria-label": `Remove ${S.get(String(d)) ?? d}`,
849
850
  className: "rounded-full px-1 text-slate-400 hover:text-slate-600 dark:hover:text-slate-200",
850
851
  children: "×"
851
852
  }
852
853
  )
853
854
  ]
854
855
  },
855
- String(p)
856
+ String(d)
856
857
  )) }),
857
858
  /* @__PURE__ */ e(
858
859
  "input",
859
860
  {
860
- value: d,
861
- onChange: (p) => c(p.target.value),
861
+ value: c,
862
+ onChange: (d) => m(d.target.value),
862
863
  onFocus: () => b(!0),
863
864
  onBlur: () => b(!1),
864
- placeholder: `Search ${l.label.toLowerCase()} to add…`,
865
+ placeholder: `Search ${i.label.toLowerCase()} to add…`,
865
866
  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"
866
867
  }
867
868
  ),
868
- j && /* @__PURE__ */ t(
869
+ U && /* @__PURE__ */ t(
869
870
  "div",
870
871
  {
871
- onMouseDown: (p) => p.preventDefault(),
872
+ onMouseDown: (d) => d.preventDefault(),
872
873
  className: "mt-1 max-h-44 overflow-y-auto rounded-md border border-slate-200 dark:border-border",
873
874
  children: [
874
- v.map((p) => {
875
- const w = T.has(String(p.id));
875
+ j.map((d) => {
876
+ const N = P.has(String(d.id));
876
877
  return /* @__PURE__ */ t(
877
878
  "button",
878
879
  {
879
880
  type: "button",
880
- onClick: () => E(p.id),
881
- className: U(
881
+ onClick: () => I(d.id),
882
+ className: $(
882
883
  "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",
883
- w ? "font-medium text-nvr-navy dark:text-nvr-cyan" : "text-slate-600 dark:text-slate-300"
884
+ N ? "font-medium text-nvr-navy dark:text-nvr-cyan" : "text-slate-600 dark:text-slate-300"
884
885
  ),
885
886
  children: [
886
- /* @__PURE__ */ e("span", { className: "truncate", children: p.label }),
887
- /* @__PURE__ */ e("span", { className: "pl-2 text-[11px] text-slate-400", children: w ? "Remove" : "Add" })
887
+ /* @__PURE__ */ e("span", { className: "truncate", children: d.label }),
888
+ /* @__PURE__ */ e("span", { className: "pl-2 text-[11px] text-slate-400", children: N ? "Remove" : "Add" })
888
889
  ]
889
890
  },
890
- String(p.id)
891
+ String(d.id)
891
892
  );
892
893
  }),
893
- v.length === 0 && /* @__PURE__ */ e("p", { className: "px-2.5 py-2 text-[11.5px] text-slate-400", children: M ? "Searching…" : O ? "No matches." : "No options." }),
894
- O.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." })
894
+ j.length === 0 && /* @__PURE__ */ e("p", { className: "px-2.5 py-2 text-[11.5px] text-slate-400", children: L ? "Searching…" : f ? "No matches." : "No options." }),
895
+ f.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." })
895
896
  ]
896
897
  }
897
898
  ),
898
- !j && 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." })
899
+ !U && 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." })
899
900
  ] }) : /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: [
900
- N.map((p) => {
901
- const w = T.has(String(p.id));
901
+ k.map((d) => {
902
+ const N = P.has(String(d.id));
902
903
  return /* @__PURE__ */ e(
903
904
  "button",
904
905
  {
905
906
  type: "button",
906
- onClick: () => E(p.id),
907
- className: U(
907
+ onClick: () => I(d.id),
908
+ className: $(
908
909
  "rounded-full border px-2.5 py-0.5 text-[11.5px] transition-colors",
909
- w ? "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"
910
+ N ? "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"
910
911
  ),
911
- children: p.label
912
+ children: d.label
912
913
  },
913
- String(p.id)
914
+ String(d.id)
914
915
  );
915
916
  }),
916
- N.length === 0 && /* @__PURE__ */ e("span", { className: "text-[11.5px] text-slate-400", children: "No options." })
917
+ k.length === 0 && /* @__PURE__ */ e("span", { className: "text-[11.5px] text-slate-400", children: "No options." })
917
918
  ] })
918
919
  ] });
919
920
  }
920
- function nt() {
921
- const { data: l } = C({
921
+ function st() {
922
+ const { data: i } = q({
922
923
  queryKey: ["nvr-settings-2fa"],
923
924
  queryFn: () => a.request({ _method: "GET", _path: "/settings/" }).then((y) => (y == null ? void 0 : y.data) ?? null).catch(() => null),
924
925
  staleTime: 6e5
925
- }), u = (l == null ? void 0 : l.two_factor_enabled) !== !1, a = F(), s = I(), [o, i] = P(null), [d, c] = P(""), [n, b] = P(null), { data: m } = C({
926
+ }), u = (i == null ? void 0 : i.two_factor_enabled) !== !1, a = T(), s = E(), [l, o] = C(null), [c, m] = C(""), [n, b] = C(null), { data: p } = q({
926
927
  queryKey: ["nvr-profile-totp"],
927
928
  queryFn: () => a.request({ _method: "GET", _path: "/two-factor/status" }).then((y) => y.data)
928
- }), S = () => void s.invalidateQueries({ queryKey: ["nvr-profile-totp"] }), N = q({
929
+ }), w = () => void s.invalidateQueries({ queryKey: ["nvr-profile-totp"] }), k = _({
929
930
  mutationFn: () => a.request({ _method: "POST", _path: "/two-factor/setup" }).then((y) => y.data),
930
- onSuccess: (y) => i(y)
931
- }), T = q({
931
+ onSuccess: (y) => o(y)
932
+ }), P = _({
932
933
  mutationFn: (y) => a.request({
933
934
  _method: "POST",
934
935
  _path: "/two-factor/verify",
935
936
  _body: { token: y }
936
937
  }),
937
938
  onSuccess: () => {
938
- i(null), c(""), S();
939
+ o(null), m(""), w();
939
940
  }
940
- }), f = q({
941
+ }), v = _({
941
942
  mutationFn: (y) => a.request({
942
943
  _method: "POST",
943
944
  _path: "/two-factor/disable",
944
945
  _body: { token: y }
945
946
  }),
946
947
  onSuccess: () => {
947
- c(""), S();
948
+ m(""), w();
948
949
  }
949
- }), L = q({
950
+ }), O = _({
950
951
  mutationFn: () => a.request({ _method: "POST", _path: "/users/me/token" }).then((y) => y.data),
951
952
  onSuccess: (y) => b(y.token)
952
- }), M = q({
953
+ }), L = _({
953
954
  mutationFn: () => a.request({ _method: "DELETE", _path: "/users/me/token" }),
954
955
  onSuccess: () => b(null)
955
- }), _ = q({
956
+ }), S = _({
956
957
  mutationFn: () => a.request({ _method: "POST", _path: "/auth/logout-all" }),
957
958
  onSuccess: () => window.location.assign("/login")
958
959
  });
959
960
  return /* @__PURE__ */ e(
960
- le,
961
+ ie,
961
962
  {
962
963
  icon: /* @__PURE__ */ e(Oe, { className: "h-4 w-4" }),
963
964
  title: "Security",
@@ -969,28 +970,28 @@ function nt() {
969
970
  /* @__PURE__ */ e(
970
971
  "span",
971
972
  {
972
- className: U(
973
+ className: $(
973
974
  "rounded-full px-1.5 py-px text-[10px] font-semibold",
974
- m != null && m.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"
975
+ 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"
975
976
  ),
976
- children: m != null && m.enabled ? "Enabled" : "Off"
977
+ children: p != null && p.enabled ? "Enabled" : "Off"
977
978
  }
978
979
  )
979
980
  ] }),
980
- !(m != null && m.enabled) && !o && /* @__PURE__ */ e(
981
+ !(p != null && p.enabled) && !l && /* @__PURE__ */ e(
981
982
  "button",
982
983
  {
983
984
  type: "button",
984
- onClick: () => N.mutate(),
985
+ onClick: () => k.mutate(),
985
986
  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",
986
- children: N.isPending ? "Preparing…" : "Set up 2FA"
987
+ children: k.isPending ? "Preparing…" : "Set up 2FA"
987
988
  }
988
989
  ),
989
- o && /* @__PURE__ */ t("div", { className: "mt-3 flex flex-wrap items-start gap-4", children: [
990
+ l && /* @__PURE__ */ t("div", { className: "mt-3 flex flex-wrap items-start gap-4", children: [
990
991
  /* @__PURE__ */ e(
991
992
  "img",
992
993
  {
993
- src: o.qr,
994
+ src: l.qr,
994
995
  alt: "Scan with your authenticator app",
995
996
  className: "h-32 w-32 rounded-md border border-slate-200 dark:border-border"
996
997
  }
@@ -1001,8 +1002,8 @@ function nt() {
1001
1002
  /* @__PURE__ */ e(
1002
1003
  "input",
1003
1004
  {
1004
- value: d,
1005
- onChange: (y) => c(y.target.value),
1005
+ value: c,
1006
+ onChange: (y) => m(y.target.value),
1006
1007
  placeholder: "123456",
1007
1008
  inputMode: "numeric",
1008
1009
  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"
@@ -1012,8 +1013,8 @@ function nt() {
1012
1013
  "button",
1013
1014
  {
1014
1015
  type: "button",
1015
- disabled: d.trim().length < 6 || T.isPending,
1016
- onClick: () => T.mutate(d.trim()),
1016
+ disabled: c.trim().length < 6 || P.isPending,
1017
+ onClick: () => P.mutate(c.trim()),
1017
1018
  className: "h-8 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white disabled:opacity-50",
1018
1019
  children: "Confirm"
1019
1020
  }
@@ -1021,12 +1022,12 @@ function nt() {
1021
1022
  ] })
1022
1023
  ] })
1023
1024
  ] }),
1024
- (m == null ? void 0 : m.enabled) && /* @__PURE__ */ t("div", { className: "mt-2 flex gap-1.5", children: [
1025
+ (p == null ? void 0 : p.enabled) && /* @__PURE__ */ t("div", { className: "mt-2 flex gap-1.5", children: [
1025
1026
  /* @__PURE__ */ e(
1026
1027
  "input",
1027
1028
  {
1028
- value: d,
1029
- onChange: (y) => c(y.target.value),
1029
+ value: c,
1030
+ onChange: (y) => m(y.target.value),
1030
1031
  placeholder: "Code to disable",
1031
1032
  inputMode: "numeric",
1032
1033
  className: "h-8 w-[130px] rounded-md border border-slate-200 px-2.5 text-[12px] dark:border-border dark:bg-background"
@@ -1036,10 +1037,10 @@ function nt() {
1036
1037
  "button",
1037
1038
  {
1038
1039
  type: "button",
1039
- disabled: d.trim().length < 6 || f.isPending,
1040
- onClick: () => f.mutate(d.trim()),
1040
+ disabled: c.trim().length < 6 || v.isPending,
1041
+ onClick: () => v.mutate(c.trim()),
1041
1042
  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",
1042
- children: f.isPending ? "Disabling…" : "Disable"
1043
+ children: v.isPending ? "Disabling…" : "Disable"
1043
1044
  }
1044
1045
  )
1045
1046
  ] })
@@ -1057,16 +1058,16 @@ function nt() {
1057
1058
  "button",
1058
1059
  {
1059
1060
  type: "button",
1060
- onClick: () => L.mutate(),
1061
+ onClick: () => O.mutate(),
1061
1062
  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",
1062
- children: L.isPending ? "Generating…" : "Generate token"
1063
+ children: O.isPending ? "Generating…" : "Generate token"
1063
1064
  }
1064
1065
  ),
1065
1066
  /* @__PURE__ */ e(
1066
1067
  be,
1067
1068
  {
1068
1069
  title: "Revoke API token",
1069
- onConfirm: () => M.mutate(),
1070
+ onConfirm: () => L.mutate(),
1070
1071
  confirmLabel: "Revoke token?",
1071
1072
  className: "h-8 rounded-md px-3 text-[12px] font-medium text-slate-400 transition-colors hover:text-red-500",
1072
1073
  armedClassName: "font-semibold text-red-500",
@@ -1084,13 +1085,13 @@ function nt() {
1084
1085
  be,
1085
1086
  {
1086
1087
  title: "Sign out everywhere",
1087
- onConfirm: () => _.mutate(),
1088
+ onConfirm: () => S.mutate(),
1088
1089
  confirmLabel: "Sign out everywhere?",
1089
1090
  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",
1090
1091
  armedClassName: "border-red-300 font-semibold text-red-500 dark:border-red-500/40 dark:text-red-400",
1091
1092
  children: [
1092
1093
  /* @__PURE__ */ e(Fe, { className: "h-3.5 w-3.5" }),
1093
- _.isPending ? "Signing out…" : "Sign out everywhere"
1094
+ S.isPending ? "Signing out…" : "Sign out everywhere"
1094
1095
  ]
1095
1096
  }
1096
1097
  )
@@ -1099,31 +1100,31 @@ function nt() {
1099
1100
  }
1100
1101
  );
1101
1102
  }
1102
- function Lt({
1103
- userId: l,
1103
+ function It({
1104
+ userId: i,
1104
1105
  className: u,
1105
1106
  initialTab: a,
1106
1107
  extra: s,
1107
- pushServiceWorker: o = "/sw.js"
1108
+ pushServiceWorker: l = "/sw.js"
1108
1109
  }) {
1109
- const i = xe();
1110
- return !l || (i == null ? void 0 : i.userId) != null && String(i.userId) === String(l) ? /* @__PURE__ */ e(st, { className: u, extra: s, pushServiceWorker: o }) : /* @__PURE__ */ e(Ge, { userId: l, className: u, initialTab: a });
1110
+ const o = xe();
1111
+ return !i || (o == null ? void 0 : o.userId) != null && String(o.userId) === String(i) ? /* @__PURE__ */ e(lt, { className: u, extra: s, pushServiceWorker: l }) : /* @__PURE__ */ e(Je, { userId: i, className: u, initialTab: a });
1111
1112
  }
1112
- function st({
1113
- className: l,
1113
+ function lt({
1114
+ className: i,
1114
1115
  extra: u,
1115
1116
  pushServiceWorker: a
1116
1117
  }) {
1117
- var R;
1118
- const s = F(), o = I(), i = xe(), d = !0, c = "me", { data: n } = C({
1119
- queryKey: ["nvr-profile-user", c],
1120
- queryFn: () => s.request(ye(c)).then((v) => v.data),
1121
- enabled: d
1122
- }), b = (n == null ? void 0 : n.id) ?? null, { data: m } = C({
1118
+ var U;
1119
+ const s = T(), l = E(), o = xe(), c = !0, m = "me", { data: n } = q({
1120
+ queryKey: ["nvr-profile-user", m],
1121
+ queryFn: () => s.request(fe(m)).then((d) => d.data),
1122
+ enabled: c
1123
+ }), b = (n == null ? void 0 : n.id) ?? null, { data: p } = q({
1123
1124
  queryKey: ["nvr-profile-card", b],
1124
- queryFn: () => s.request(fe(b)).then((v) => v.data),
1125
+ queryFn: () => s.request(ye(b)).then((d) => d.data),
1125
1126
  enabled: !!b
1126
- }), [S, N] = P(null), T = De(
1127
+ }), [w, k] = C(null), P = Le(
1127
1128
  () => ({
1128
1129
  first_name: (n == null ? void 0 : n.first_name) ?? "",
1129
1130
  last_name: (n == null ? void 0 : n.last_name) ?? "",
@@ -1132,35 +1133,35 @@ function st({
1132
1133
  phone: (n == null ? void 0 : n.phone) ?? ""
1133
1134
  }),
1134
1135
  [n]
1135
- ), f = S ?? T, L = JSON.stringify(f) !== JSON.stringify(T), M = q({
1136
- mutationFn: () => s.request(me(n.id, f)),
1136
+ ), v = w ?? P, O = JSON.stringify(v) !== JSON.stringify(P), L = _({
1137
+ mutationFn: () => s.request(me(n.id, v)),
1137
1138
  onSuccess: () => {
1138
- N(null), o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] });
1139
+ k(null), l.invalidateQueries({ queryKey: ["nvr-profile-user"] }), l.invalidateQueries({ queryKey: ["nvr-profile-card"] });
1139
1140
  }
1140
- }), _ = Le(null), y = q({
1141
- mutationFn: async (v) => {
1142
- const j = await new Promise((p, w) => {
1143
- const A = new Image(), Y = URL.createObjectURL(v);
1144
- A.onload = () => {
1145
- URL.revokeObjectURL(Y);
1146
- const Q = 96, z = document.createElement("canvas");
1147
- z.width = Q, z.height = Q;
1148
- const G = z.getContext("2d");
1149
- if (!G) return w(new Error("canvas unavailable"));
1150
- const J = Math.max(Q / A.width, Q / A.height), V = A.width * J, Z = A.height * J;
1151
- G.drawImage(A, (Q - V) / 2, (Q - Z) / 2, V, Z), p(z.toDataURL("image/jpeg", 0.85));
1152
- }, A.onerror = () => {
1153
- URL.revokeObjectURL(Y), w(new Error("not an image"));
1154
- }, A.src = Y;
1141
+ }), [S, y] = C(ot), z = De(null), I = _({
1142
+ mutationFn: async (d) => {
1143
+ const N = await new Promise((A, Z) => {
1144
+ const D = new Image(), W = URL.createObjectURL(d);
1145
+ D.onload = () => {
1146
+ URL.revokeObjectURL(W);
1147
+ const Q = 96, B = document.createElement("canvas");
1148
+ B.width = Q, B.height = Q;
1149
+ const X = B.getContext("2d");
1150
+ if (!X) return Z(new Error("canvas unavailable"));
1151
+ const ee = Math.max(Q / D.width, Q / D.height), G = D.width * ee, J = D.height * ee;
1152
+ X.drawImage(D, (Q - G) / 2, (Q - J) / 2, G, J), A(B.toDataURL("image/jpeg", 0.85));
1153
+ }, D.onerror = () => {
1154
+ URL.revokeObjectURL(W), Z(new Error("not an image"));
1155
+ }, D.src = W;
1155
1156
  });
1156
- await s.request(me(n.id, { avatar: j }));
1157
+ await s.request(me(n.id, { avatar: N }));
1157
1158
  },
1158
1159
  onSuccess: () => {
1159
- o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] }), o.invalidateQueries({ queryKey: ["user-card"] }), o.invalidateQueries({ queryKey: ["user-avatar"] });
1160
+ l.invalidateQueries({ queryKey: ["nvr-profile-user"] }), l.invalidateQueries({ queryKey: ["nvr-profile-card"] }), l.invalidateQueries({ queryKey: ["user-card"] }), l.invalidateQueries({ queryKey: ["user-avatar"] });
1160
1161
  }
1161
- }), k = m ?? (n ? { ...n, role_name: null } : null);
1162
- if (!k)
1163
- return /* @__PURE__ */ t("div", { className: U("flex animate-pulse flex-col gap-4", l), "aria-busy": "true", children: [
1162
+ }), f = p ?? (n ? { ...n, role_name: null } : null);
1163
+ if (!f)
1164
+ return /* @__PURE__ */ t("div", { className: $("flex animate-pulse flex-col gap-4", i), "aria-busy": "true", children: [
1164
1165
  /* @__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: [
1165
1166
  /* @__PURE__ */ e("div", { className: "h-[76px] w-[76px] rounded-full bg-slate-100 dark:bg-muted" }),
1166
1167
  /* @__PURE__ */ t("div", { className: "flex-1 space-y-2.5", children: [
@@ -1174,29 +1175,29 @@ function st({
1174
1175
  /* @__PURE__ */ e("div", { className: "h-64 rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card" })
1175
1176
  ] })
1176
1177
  ] });
1177
- const E = (n == null ? void 0 : n.avatar) ?? null, O = k.status === "active";
1178
- return /* @__PURE__ */ t("div", { className: U("flex flex-col gap-4", l), "data-nvr-profile": !0, children: [
1178
+ const K = (n == null ? void 0 : n.avatar) ?? null, j = f.status === "active";
1179
+ return /* @__PURE__ */ t("div", { className: $("flex flex-col gap-4", i), "data-nvr-profile": !0, children: [
1179
1180
  /* @__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: [
1180
1181
  /* @__PURE__ */ t("div", { className: "relative", children: [
1181
- E ? /* @__PURE__ */ e(
1182
+ K ? /* @__PURE__ */ e(
1182
1183
  "img",
1183
1184
  {
1184
- src: E.startsWith("data:") ? E : `/api/files/${E}`,
1185
+ src: K.startsWith("data:") ? K : `/api/files/${K}`,
1185
1186
  alt: "",
1186
1187
  className: "h-[76px] w-[76px] rounded-full border border-slate-200 object-cover dark:border-border"
1187
1188
  }
1188
- ) : /* @__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: Ve(k) }),
1189
+ ) : /* @__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: Ze(f) }),
1189
1190
  /* @__PURE__ */ e(
1190
1191
  "span",
1191
1192
  {
1192
- className: U(
1193
+ className: $(
1193
1194
  "absolute bottom-0.5 right-0.5 h-3 w-3 rounded-full border-2 border-white dark:border-card",
1194
- O ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
1195
+ j ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
1195
1196
  ),
1196
- title: O ? "Active" : k.status
1197
+ title: j ? "Active" : f.status
1197
1198
  }
1198
1199
  ),
1199
- /* @__PURE__ */ t(se, { children: [
1200
+ /* @__PURE__ */ t(oe, { children: [
1200
1201
  /* @__PURE__ */ e(
1201
1202
  "button",
1202
1203
  {
@@ -1204,24 +1205,24 @@ function st({
1204
1205
  title: "Change photo",
1205
1206
  "aria-label": "Change photo",
1206
1207
  onClick: () => {
1207
- var v;
1208
- return (v = _.current) == null ? void 0 : v.click();
1208
+ var d;
1209
+ return (d = z.current) == null ? void 0 : d.click();
1209
1210
  },
1210
1211
  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",
1211
- children: y.isPending ? /* @__PURE__ */ e(ue, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Ne, { className: "h-3.5 w-3.5" })
1212
+ children: I.isPending ? /* @__PURE__ */ e(ue, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Ne, { className: "h-3.5 w-3.5" })
1212
1213
  }
1213
1214
  ),
1214
1215
  /* @__PURE__ */ e(
1215
1216
  "input",
1216
1217
  {
1217
- ref: _,
1218
+ ref: z,
1218
1219
  type: "file",
1219
1220
  accept: "image/*",
1220
1221
  className: "hidden",
1221
- onChange: (v) => {
1222
- var p;
1223
- const j = (p = v.target.files) == null ? void 0 : p[0];
1224
- j && y.mutate(j), v.target.value = "";
1222
+ onChange: (d) => {
1223
+ var A;
1224
+ const N = (A = d.target.files) == null ? void 0 : A[0];
1225
+ N && I.mutate(N), d.target.value = "";
1225
1226
  }
1226
1227
  }
1227
1228
  )
@@ -1229,10 +1230,10 @@ function st({
1229
1230
  ] }),
1230
1231
  /* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: [
1231
1232
  /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2", children: [
1232
- /* @__PURE__ */ e("h1", { className: "text-[21px] font-semibold tracking-[-0.015em] text-slate-900 dark:text-white", children: Je(k) }),
1233
- k.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: k.role_name }),
1234
- k.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" }),
1235
- /* @__PURE__ */ e(Be, { email: k.email, canClear: i.isAdmin })
1233
+ /* @__PURE__ */ e("h1", { className: "text-[21px] font-semibold tracking-[-0.015em] text-slate-900 dark:text-white", children: Ve(f) }),
1234
+ f.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: f.role_name }),
1235
+ f.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" }),
1236
+ /* @__PURE__ */ e(He, { email: f.email, canClear: o.isAdmin })
1236
1237
  ] }),
1237
1238
  n && // The same status the chat panel's Online tab sets — one editor,
1238
1239
  // one preference, so the profile always agrees with the top bar.
@@ -1240,46 +1241,46 @@ function st({
1240
1241
  je,
1241
1242
  {
1242
1243
  status: Qe(
1243
- (R = n.preferences) == null ? void 0 : R.custom_status
1244
+ (U = n.preferences) == null ? void 0 : U.custom_status
1244
1245
  ),
1245
1246
  showExpiry: !0,
1246
1247
  className: "mt-1.5"
1247
1248
  }
1248
1249
  ),
1249
- (k.title || k.department) && /* @__PURE__ */ e("p", { className: "mt-0.5 truncate text-[13px] text-slate-500 dark:text-slate-400", children: [k.title, k.department].filter(Boolean).join(" · ") }),
1250
+ (f.title || f.department) && /* @__PURE__ */ e("p", { className: "mt-0.5 truncate text-[13px] text-slate-500 dark:text-slate-400", children: [f.title, f.department].filter(Boolean).join(" · ") }),
1250
1251
  /* @__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: [
1251
- k.company && /* @__PURE__ */ t("span", { className: "inline-flex items-center gap-1.5", children: [
1252
+ f.company && /* @__PURE__ */ t("span", { className: "inline-flex items-center gap-1.5", children: [
1252
1253
  /* @__PURE__ */ e(we, { className: "h-3.5 w-3.5" }),
1253
1254
  " ",
1254
- k.company
1255
+ f.company
1255
1256
  ] }),
1256
1257
  /* @__PURE__ */ t(
1257
1258
  "a",
1258
1259
  {
1259
- href: `mailto:${k.email}`,
1260
+ href: `mailto:${f.email}`,
1260
1261
  className: "inline-flex items-center gap-1.5 transition-colors hover:text-nvr-navy dark:hover:text-nvr-cyan",
1261
1262
  children: [
1262
1263
  /* @__PURE__ */ e(Se, { className: "h-3.5 w-3.5" }),
1263
1264
  " ",
1264
- k.email
1265
+ f.email
1265
1266
  ]
1266
1267
  }
1267
1268
  ),
1268
- k.phone && /* @__PURE__ */ t(
1269
+ f.phone && /* @__PURE__ */ t(
1269
1270
  "a",
1270
1271
  {
1271
- href: `tel:${k.phone}`,
1272
+ href: `tel:${f.phone}`,
1272
1273
  className: "inline-flex items-center gap-1.5 transition-colors hover:text-nvr-navy dark:hover:text-nvr-cyan",
1273
1274
  children: [
1274
1275
  /* @__PURE__ */ e(_e, { className: "h-3.5 w-3.5" }),
1275
1276
  " ",
1276
- k.phone
1277
+ f.phone
1277
1278
  ]
1278
1279
  }
1279
1280
  ),
1280
- k.last_access && /* @__PURE__ */ t("span", { className: "inline-flex items-center gap-1.5", title: "Last active", children: [
1281
+ f.last_access && /* @__PURE__ */ t("span", { className: "inline-flex items-center gap-1.5", title: "Last active", children: [
1281
1282
  /* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" }),
1282
- new Date(k.last_access).toLocaleDateString(void 0, {
1283
+ new Date(f.last_access).toLocaleDateString(void 0, {
1283
1284
  month: "short",
1284
1285
  day: "numeric"
1285
1286
  })
@@ -1287,7 +1288,8 @@ function st({
1287
1288
  ] })
1288
1289
  ] })
1289
1290
  ] }) }),
1290
- n ? (
1291
+ /* @__PURE__ */ e(it, { tab: S, onChange: y }),
1292
+ S === "agents" ? /* @__PURE__ */ e(Re, {}) : n ? (
1291
1293
  // One list in reading order — you, then notifications, then access
1292
1294
  // and security — flowing into two balanced columns. Two fixed stacks
1293
1295
  // left thirteen cards on one side and four on the other, and the page
@@ -1299,18 +1301,18 @@ function st({
1299
1301
  "data-profile-columns": !0,
1300
1302
  children: [
1301
1303
  /* @__PURE__ */ e(
1302
- le,
1304
+ ie,
1303
1305
  {
1304
- icon: /* @__PURE__ */ e(Pe, { className: "h-4 w-4" }),
1306
+ icon: /* @__PURE__ */ e(Ae, { className: "h-4 w-4" }),
1305
1307
  title: "About you",
1306
1308
  hint: "Shown on your contact card across the app",
1307
- actions: L && /* @__PURE__ */ t("span", { className: "flex items-center gap-1.5", children: [
1309
+ actions: O && /* @__PURE__ */ t("span", { className: "flex items-center gap-1.5", children: [
1308
1310
  /* @__PURE__ */ t(
1309
1311
  "button",
1310
1312
  {
1311
1313
  type: "button",
1312
1314
  title: "Discard changes",
1313
- onClick: () => N(null),
1315
+ onClick: () => k(null),
1314
1316
  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",
1315
1317
  children: [
1316
1318
  /* @__PURE__ */ e(Ce, { className: "h-3 w-3" }),
@@ -1322,11 +1324,11 @@ function st({
1322
1324
  "button",
1323
1325
  {
1324
1326
  type: "button",
1325
- disabled: M.isPending,
1326
- onClick: () => M.mutate(),
1327
+ disabled: L.isPending,
1328
+ onClick: () => L.mutate(),
1327
1329
  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",
1328
1330
  children: [
1329
- M.isPending ? /* @__PURE__ */ e(ue, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(Ae, { className: "h-3 w-3" }),
1331
+ L.isPending ? /* @__PURE__ */ e(ue, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(Pe, { className: "h-3 w-3" }),
1330
1332
  " ",
1331
1333
  "Save"
1332
1334
  ]
@@ -1335,78 +1337,78 @@ function st({
1335
1337
  ] }),
1336
1338
  children: /* @__PURE__ */ t("div", { className: "grid gap-3 sm:grid-cols-2", children: [
1337
1339
  /* @__PURE__ */ e(
1338
- H,
1340
+ Y,
1339
1341
  {
1340
1342
  label: "First name",
1341
- value: f.first_name,
1342
- onChange: (v) => N({ ...f, first_name: v })
1343
+ value: v.first_name,
1344
+ onChange: (d) => k({ ...v, first_name: d })
1343
1345
  }
1344
1346
  ),
1345
1347
  /* @__PURE__ */ e(
1346
- H,
1348
+ Y,
1347
1349
  {
1348
1350
  label: "Last name",
1349
- value: f.last_name,
1350
- onChange: (v) => N({ ...f, last_name: v })
1351
+ value: v.last_name,
1352
+ onChange: (d) => k({ ...v, last_name: d })
1351
1353
  }
1352
1354
  ),
1353
1355
  /* @__PURE__ */ e(
1354
- H,
1356
+ Y,
1355
1357
  {
1356
1358
  label: "Title",
1357
- value: f.title,
1358
- onChange: (v) => N({ ...f, title: v }),
1359
+ value: v.title,
1360
+ onChange: (d) => k({ ...v, title: d }),
1359
1361
  placeholder: "e.g. Construction Manager"
1360
1362
  }
1361
1363
  ),
1362
1364
  /* @__PURE__ */ e(
1363
- H,
1365
+ Y,
1364
1366
  {
1365
1367
  label: "Department",
1366
- value: f.department,
1367
- onChange: (v) => N({ ...f, department: v })
1368
+ value: v.department,
1369
+ onChange: (d) => k({ ...v, department: d })
1368
1370
  }
1369
1371
  ),
1370
1372
  /* @__PURE__ */ e(
1371
- H,
1373
+ Y,
1372
1374
  {
1373
1375
  label: "Phone",
1374
- value: f.phone,
1375
- onChange: (v) => N({ ...f, phone: v }),
1376
+ value: v.phone,
1377
+ onChange: (d) => k({ ...v, phone: d }),
1376
1378
  placeholder: "+1 …",
1377
1379
  type: "tel"
1378
1380
  }
1379
1381
  ),
1380
- /* @__PURE__ */ e(H, { label: "Email", value: n.email ?? "", disabled: !0, hint: "managed by admin" })
1382
+ /* @__PURE__ */ e(Y, { label: "Email", value: n.email ?? "", disabled: !0, hint: "managed by admin" })
1381
1383
  ] })
1382
1384
  }
1383
1385
  ),
1384
1386
  /* @__PURE__ */ e(
1385
- ze,
1387
+ Be,
1386
1388
  {
1387
1389
  user: n,
1388
1390
  onSaved: () => {
1389
- o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] });
1391
+ l.invalidateQueries({ queryKey: ["nvr-profile-user"] }), l.invalidateQueries({ queryKey: ["nvr-profile-card"] });
1390
1392
  }
1391
1393
  }
1392
1394
  ),
1393
- /* @__PURE__ */ e(Ze, {}),
1395
+ /* @__PURE__ */ e(Xe, {}),
1396
+ /* @__PURE__ */ e(at, {}),
1397
+ /* @__PURE__ */ e(ht, {}),
1394
1398
  /* @__PURE__ */ e(tt, {}),
1399
+ /* @__PURE__ */ e($e, {}),
1400
+ /* @__PURE__ */ e(Ue, {}),
1401
+ o.isAdmin && (n != null && n.id) ? /* @__PURE__ */ e(Ge, { userId: String(n.id) }) : /* @__PURE__ */ e(rt, {}),
1402
+ /* @__PURE__ */ e(ct, {}),
1403
+ /* @__PURE__ */ e(Ye, { userId: "me" }),
1395
1404
  /* @__PURE__ */ e(mt, {}),
1396
1405
  /* @__PURE__ */ e(et, {}),
1397
- /* @__PURE__ */ e($e, {}),
1398
- /* @__PURE__ */ e(Re, {}),
1399
- i.isAdmin && (n != null && n.id) ? /* @__PURE__ */ e(We, { userId: String(n.id) }) : /* @__PURE__ */ e(at, {}),
1400
- /* @__PURE__ */ e(ot, {}),
1401
- /* @__PURE__ */ e(He, { userId: "me" }),
1402
- /* @__PURE__ */ e(it, {}),
1403
- /* @__PURE__ */ e(Xe, {}),
1404
- /* @__PURE__ */ e(Ye, {}),
1405
- a !== !1 && /* @__PURE__ */ e(Ue, { serviceWorkerPath: a }),
1406
+ /* @__PURE__ */ e(We, {}),
1407
+ a !== !1 && /* @__PURE__ */ e(ze, { serviceWorkerPath: a }),
1408
+ /* @__PURE__ */ e(ut, {}),
1409
+ /* @__PURE__ */ e(st, {}),
1410
+ /* @__PURE__ */ e(pt, {}),
1406
1411
  /* @__PURE__ */ e(dt, {}),
1407
- /* @__PURE__ */ e(nt, {}),
1408
- /* @__PURE__ */ e(ct, {}),
1409
- /* @__PURE__ */ e(lt, {}),
1410
1412
  u
1411
1413
  ]
1412
1414
  }
@@ -1414,23 +1416,69 @@ function st({
1414
1416
  ) : null
1415
1417
  ] });
1416
1418
  }
1417
- function lt() {
1418
- const l = F(), [u, a] = P(!1), { data: s = [], isLoading: o } = C({
1419
+ function ot() {
1420
+ try {
1421
+ return new URLSearchParams(window.location.search).get("tab") === "agents" ? "agents" : "profile";
1422
+ } catch {
1423
+ return "profile";
1424
+ }
1425
+ }
1426
+ function it({
1427
+ tab: i,
1428
+ onChange: u
1429
+ }) {
1430
+ const a = (l) => {
1431
+ u(l);
1432
+ try {
1433
+ const o = new URL(window.location.href);
1434
+ l === "agents" ? o.searchParams.set("tab", "agents") : o.searchParams.delete("tab"), window.history.replaceState(window.history.state, "", o);
1435
+ } catch {
1436
+ }
1437
+ };
1438
+ return /* @__PURE__ */ e(
1439
+ "div",
1440
+ {
1441
+ role: "tablist",
1442
+ "aria-label": "Profile sections",
1443
+ className: "flex gap-1 border-b border-slate-200 dark:border-border",
1444
+ children: [
1445
+ ["profile", "Profile"],
1446
+ ["agents", "What my agents did"]
1447
+ ].map(([l, o]) => /* @__PURE__ */ e(
1448
+ "button",
1449
+ {
1450
+ type: "button",
1451
+ role: "tab",
1452
+ "aria-selected": i === l,
1453
+ onClick: () => a(l),
1454
+ className: $(
1455
+ "-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",
1456
+ i === l ? "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"
1457
+ ),
1458
+ children: o
1459
+ },
1460
+ l
1461
+ ))
1462
+ }
1463
+ );
1464
+ }
1465
+ function dt() {
1466
+ const i = T(), [u, a] = C(!1), { data: s = [], isLoading: l } = q({
1419
1467
  queryKey: ["my-matrix-seats"],
1420
- queryFn: () => l.request(D("/pipelines/my-seats")).then((d) => d.data ?? []).catch(() => []),
1468
+ queryFn: () => i.request(F("/pipelines/my-seats")).then((c) => c.data ?? []).catch(() => []),
1421
1469
  enabled: u,
1422
1470
  staleTime: 6e4
1423
- }), i = /* @__PURE__ */ new Map();
1424
- for (const d of s) {
1425
- const c = i.get(d.template_name) ?? [];
1426
- c.push(d), i.set(d.template_name, c);
1471
+ }), o = /* @__PURE__ */ new Map();
1472
+ for (const c of s) {
1473
+ const m = o.get(c.template_name) ?? [];
1474
+ m.push(c), o.set(c.template_name, m);
1427
1475
  }
1428
1476
  return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white p-4 dark:border-border dark:bg-card", children: [
1429
1477
  /* @__PURE__ */ t(
1430
1478
  "button",
1431
1479
  {
1432
1480
  type: "button",
1433
- onClick: () => a((d) => !d),
1481
+ onClick: () => a((c) => !c),
1434
1482
  className: "flex w-full items-center justify-between text-left",
1435
1483
  children: [
1436
1484
  /* @__PURE__ */ t("div", { children: [
@@ -1441,10 +1489,10 @@ function lt() {
1441
1489
  ]
1442
1490
  }
1443
1491
  ),
1444
- u && (o ? /* @__PURE__ */ e("p", { className: "mt-3 text-[12.5px] text-slate-400", children: "Loading…" }) : s.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: [...i.entries()].map(([d, c]) => /* @__PURE__ */ t("div", { children: [
1445
- /* @__PURE__ */ e("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: d }),
1492
+ u && (l ? /* @__PURE__ */ e("p", { className: "mt-3 text-[12.5px] text-slate-400", children: "Loading…" }) : s.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: [...o.entries()].map(([c, m]) => /* @__PURE__ */ t("div", { children: [
1493
+ /* @__PURE__ */ e("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: c }),
1446
1494
  /* @__PURE__ */ t("ul", { className: "mt-1 space-y-0.5", children: [
1447
- c.slice(0, 40).map((n) => /* @__PURE__ */ t("li", { className: "text-[12.5px]", children: [
1495
+ m.slice(0, 40).map((n) => /* @__PURE__ */ t("li", { className: "text-[12.5px]", children: [
1448
1496
  /* @__PURE__ */ e("span", { className: "font-medium", children: n.state_label }),
1449
1497
  n.group_name && /* @__PURE__ */ t("span", { className: "text-slate-500 dark:text-muted-foreground", children: [
1450
1498
  " ",
@@ -1454,28 +1502,28 @@ function lt() {
1454
1502
  Array.isArray(n.filters) && n.filters.length > 0 && /* @__PURE__ */ e("span", { className: "ml-1.5 font-mono text-[10.5px] text-slate-400", children: n.filters.slice(0, 3).map((b) => `${b.field}=${String(b.value)}`).join(" · ") }),
1455
1503
  (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" })
1456
1504
  ] }, n.group_id)),
1457
- c.length > 40 && /* @__PURE__ */ t("li", { className: "text-[11.5px] text-slate-400", children: [
1505
+ m.length > 40 && /* @__PURE__ */ t("li", { className: "text-[11.5px] text-slate-400", children: [
1458
1506
  "…and ",
1459
- c.length - 40,
1507
+ m.length - 40,
1460
1508
  " more"
1461
1509
  ] })
1462
1510
  ] })
1463
- ] }, d)) }))
1511
+ ] }, c)) }))
1464
1512
  ] });
1465
1513
  }
1466
- function ot() {
1467
- const l = F(), u = I(), { data: a = [] } = C({
1514
+ function ct() {
1515
+ const i = T(), u = E(), { data: a = [] } = q({
1468
1516
  queryKey: ["my-reminders"],
1469
- queryFn: () => l.request(D("/reminders")).then((m) => m.data).catch(() => []),
1517
+ queryFn: () => i.request(F("/reminders")).then((p) => p.data).catch(() => []),
1470
1518
  staleTime: 3e4
1471
- }), [s, o] = P(""), [i, d] = P(""), c = () => void u.invalidateQueries({ queryKey: ["my-reminders"] }), n = q({
1472
- mutationFn: () => l.request(ee("/reminders", { note: s, remind_at: new Date(i).toISOString() })),
1519
+ }), [s, l] = C(""), [o, c] = C(""), m = () => void u.invalidateQueries({ queryKey: ["my-reminders"] }), n = _({
1520
+ mutationFn: () => i.request(ae("/reminders", { note: s, remind_at: new Date(o).toISOString() })),
1473
1521
  onSuccess: () => {
1474
- o(""), d(""), c();
1522
+ l(""), c(""), m();
1475
1523
  }
1476
- }), b = q({
1477
- mutationFn: (m) => l.request(Ee(`/reminders/${m}`)),
1478
- onSuccess: c
1524
+ }), b = _({
1525
+ mutationFn: (p) => i.request(Ee(`/reminders/${p}`)),
1526
+ onSuccess: m
1479
1527
  });
1480
1528
  return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
1481
1529
  /* @__PURE__ */ t("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
@@ -1484,34 +1532,34 @@ function ot() {
1484
1532
  ] }),
1485
1533
  /* @__PURE__ */ t("div", { className: "space-y-2 px-4 py-3", children: [
1486
1534
  a.length === 0 && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "No upcoming reminders." }),
1487
- a.map((m) => /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
1535
+ a.map((p) => /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
1488
1536
  /* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: [
1489
- /* @__PURE__ */ e("p", { className: "truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: m.note }),
1490
- /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400", children: new Date(m.remind_at).toLocaleString() })
1537
+ /* @__PURE__ */ e("p", { className: "truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: p.note }),
1538
+ /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400", children: new Date(p.remind_at).toLocaleString() })
1491
1539
  ] }),
1492
1540
  /* @__PURE__ */ e(
1493
1541
  "button",
1494
1542
  {
1495
1543
  type: "button",
1496
- onClick: () => b.mutate(m.id),
1544
+ onClick: () => b.mutate(p.id),
1497
1545
  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",
1498
1546
  children: "Cancel"
1499
1547
  }
1500
1548
  )
1501
- ] }, m.id)),
1549
+ ] }, p.id)),
1502
1550
  /* @__PURE__ */ t(
1503
1551
  "form",
1504
1552
  {
1505
1553
  className: "flex flex-wrap items-center gap-2 pt-1",
1506
- onSubmit: (m) => {
1507
- m.preventDefault(), s.trim() && i && n.mutate();
1554
+ onSubmit: (p) => {
1555
+ p.preventDefault(), s.trim() && o && n.mutate();
1508
1556
  },
1509
1557
  children: [
1510
1558
  /* @__PURE__ */ e(
1511
1559
  "input",
1512
1560
  {
1513
1561
  value: s,
1514
- onChange: (m) => o(m.target.value),
1562
+ onChange: (p) => l(p.target.value),
1515
1563
  placeholder: "Remind me to…",
1516
1564
  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"
1517
1565
  }
@@ -1520,8 +1568,8 @@ function ot() {
1520
1568
  "input",
1521
1569
  {
1522
1570
  type: "datetime-local",
1523
- value: i,
1524
- onChange: (m) => d(m.target.value),
1571
+ value: o,
1572
+ onChange: (p) => c(p.target.value),
1525
1573
  className: "h-7 rounded border border-slate-200 px-2 text-[12px] outline-none focus:border-nvr-cyan dark:border-border dark:bg-background"
1526
1574
  }
1527
1575
  ),
@@ -1529,7 +1577,7 @@ function ot() {
1529
1577
  "button",
1530
1578
  {
1531
1579
  type: "submit",
1532
- disabled: !s.trim() || !i || n.isPending,
1580
+ disabled: !s.trim() || !o || n.isPending,
1533
1581
  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",
1534
1582
  children: n.isPending ? "Adding…" : "Add"
1535
1583
  }
@@ -1540,10 +1588,10 @@ function ot() {
1540
1588
  ] })
1541
1589
  ] });
1542
1590
  }
1543
- function it() {
1544
- const l = F(), { data: u } = C({
1591
+ function mt() {
1592
+ const i = T(), { data: u } = q({
1545
1593
  queryKey: ["my-stats"],
1546
- queryFn: () => l.request(D("/users/me/stats")).then((s) => s.data).catch(() => null),
1594
+ queryFn: () => i.request(F("/users/me/stats")).then((s) => s.data).catch(() => null),
1547
1595
  staleTime: 5 * 6e4
1548
1596
  });
1549
1597
  if (!u) return null;
@@ -1560,16 +1608,16 @@ function it() {
1560
1608
  ] })
1561
1609
  ] }),
1562
1610
  /* @__PURE__ */ t("div", { className: "px-4 py-3", children: [
1563
- /* @__PURE__ */ e("div", { className: "flex items-end gap-1.5", style: { height: 56 }, children: u.weeks.map((s, o) => {
1564
- const i = s.transitions + s.tasks_done + s.created;
1611
+ /* @__PURE__ */ e("div", { className: "flex items-end gap-1.5", style: { height: 56 }, children: u.weeks.map((s, l) => {
1612
+ const o = s.transitions + s.tasks_done + s.created;
1565
1613
  return /* @__PURE__ */ e(
1566
1614
  "div",
1567
1615
  {
1568
1616
  className: "flex-1 rounded-t bg-nvr-cyan/60 transition-all dark:bg-nvr-cyan/40",
1569
- style: { height: `${Math.max(4, i / a * 100)}%` },
1570
- "data-tip": `${i} action${i === 1 ? "" : "s"}: ${s.transitions} transitions, ${s.tasks_done} tasks done, ${s.created} created`
1617
+ style: { height: `${Math.max(4, o / a * 100)}%` },
1618
+ "data-tip": `${o} action${o === 1 ? "" : "s"}: ${s.transitions} transitions, ${s.tasks_done} tasks done, ${s.created} created`
1571
1619
  },
1572
- o
1620
+ l
1573
1621
  );
1574
1622
  }) }),
1575
1623
  /* @__PURE__ */ t("div", { className: "mt-2 flex items-center justify-between text-[11px] text-slate-400", children: [
@@ -1596,19 +1644,19 @@ function it() {
1596
1644
  ] })
1597
1645
  ] });
1598
1646
  }
1599
- function dt() {
1600
- const l = F(), u = I(), { data: a } = C({
1647
+ function ut() {
1648
+ const i = T(), u = E(), { data: a } = q({
1601
1649
  queryKey: ["my-security"],
1602
- queryFn: () => l.request(D("/security/my/sessions")).then((i) => i.data).catch(() => ({ sessions: [], logins: [] })),
1650
+ queryFn: () => i.request(F("/security/my/sessions")).then((o) => o.data).catch(() => ({ sessions: [], logins: [] })),
1603
1651
  staleTime: 3e4
1604
- }), s = q({
1605
- mutationFn: () => l.request(ee("/security/my/sessions/sign-out-others", {})).then((i) => i.data),
1606
- onSuccess: (i) => {
1607
- u.invalidateQueries({ queryKey: ["my-security"] }), o(`Signed out ${(i == null ? void 0 : i.revoked) ?? 0} other session(s)`);
1652
+ }), s = _({
1653
+ mutationFn: () => i.request(ae("/security/my/sessions/sign-out-others", {})).then((o) => o.data),
1654
+ onSuccess: (o) => {
1655
+ u.invalidateQueries({ queryKey: ["my-security"] }), l(`Signed out ${(o == null ? void 0 : o.revoked) ?? 0} other session(s)`);
1608
1656
  }
1609
- }), o = (i) => {
1657
+ }), l = (o) => {
1610
1658
  try {
1611
- import("sonner").then(({ toast: d }) => d.success(i));
1659
+ import("sonner").then(({ toast: c }) => c.success(o));
1612
1660
  } catch {
1613
1661
  }
1614
1662
  };
@@ -1635,43 +1683,43 @@ function dt() {
1635
1683
  (a == null ? void 0 : a.sessions.length) ?? 0,
1636
1684
  ")"
1637
1685
  ] }),
1638
- ((a == null ? void 0 : a.sessions) ?? []).map((i) => /* @__PURE__ */ t(
1686
+ ((a == null ? void 0 : a.sessions) ?? []).map((o) => /* @__PURE__ */ t(
1639
1687
  "p",
1640
1688
  {
1641
1689
  className: "flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300",
1642
1690
  children: [
1643
1691
  /* @__PURE__ */ t("span", { className: "font-mono text-slate-400", children: [
1644
- i.sid_prefix,
1692
+ o.sid_prefix,
1645
1693
  "…"
1646
1694
  ] }),
1647
- i.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" }),
1695
+ o.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" }),
1648
1696
  /* @__PURE__ */ t("span", { className: "ml-auto text-[11px] text-slate-400", children: [
1649
1697
  "expires in ",
1650
- Math.round(i.ttl_seconds / 3600),
1698
+ Math.round(o.ttl_seconds / 3600),
1651
1699
  "h"
1652
1700
  ] })
1653
1701
  ]
1654
1702
  },
1655
- i.sid_prefix
1703
+ o.sid_prefix
1656
1704
  )),
1657
- ((a == null ? void 0 : a.logins) ?? []).length > 0 && /* @__PURE__ */ t(se, { children: [
1705
+ ((a == null ? void 0 : a.logins) ?? []).length > 0 && /* @__PURE__ */ t(oe, { children: [
1658
1706
  /* @__PURE__ */ e("p", { className: "pt-1 text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: "Recent sign-ins" }),
1659
- ((a == null ? void 0 : a.logins) ?? []).slice(0, 8).map((i, d) => (
1707
+ ((a == null ? void 0 : a.logins) ?? []).slice(0, 8).map((o, c) => (
1660
1708
  // biome-ignore lint/suspicious/noArrayIndexKey: log rows
1661
1709
  /* @__PURE__ */ t("p", { className: "flex items-center gap-2 text-[11.5px] text-slate-500", children: [
1662
- /* @__PURE__ */ e("span", { className: "font-mono", children: i.ip ?? "—" }),
1663
- i.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" }),
1664
- /* @__PURE__ */ e("span", { className: "ml-auto text-slate-400", children: new Date(i.created_at).toLocaleString() })
1665
- ] }, d)
1710
+ /* @__PURE__ */ e("span", { className: "font-mono", children: o.ip ?? "—" }),
1711
+ o.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" }),
1712
+ /* @__PURE__ */ e("span", { className: "ml-auto text-slate-400", children: new Date(o.created_at).toLocaleString() })
1713
+ ] }, c)
1666
1714
  ))
1667
1715
  ] })
1668
1716
  ] })
1669
1717
  ] });
1670
1718
  }
1671
- function ct() {
1672
- const l = F(), [u, a] = P(!1), { data: s } = C({
1719
+ function pt() {
1720
+ const i = T(), [u, a] = C(!1), { data: s } = q({
1673
1721
  queryKey: ["my-permissions"],
1674
- queryFn: () => l.request(D("/security/my/permissions")).then((o) => o.data),
1722
+ queryFn: () => i.request(F("/security/my/permissions")).then((l) => l.data),
1675
1723
  enabled: u,
1676
1724
  staleTime: 5 * 6e4
1677
1725
  });
@@ -1680,7 +1728,7 @@ function ct() {
1680
1728
  "button",
1681
1729
  {
1682
1730
  type: "button",
1683
- onClick: () => a((o) => !o),
1731
+ onClick: () => a((l) => !l),
1684
1732
  className: "flex w-full items-center justify-between px-4 py-2.5 text-left",
1685
1733
  children: [
1686
1734
  /* @__PURE__ */ t("div", { children: [
@@ -1701,7 +1749,7 @@ function ct() {
1701
1749
  s.scopes.length > 0 && /* @__PURE__ */ t("p", { children: [
1702
1750
  "Your data is limited to:",
1703
1751
  " ",
1704
- s.scopes.map((o) => `${o.dimension}: ${o.values.join(", ")}`).join(" · ")
1752
+ s.scopes.map((l) => `${l.dimension}: ${l.values.join(", ")}`).join(" · ")
1705
1753
  ] }),
1706
1754
  !s.is_admin && /* @__PURE__ */ t("div", { children: [
1707
1755
  /* @__PURE__ */ t("p", { className: "mb-1 text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: [
@@ -1709,48 +1757,48 @@ function ct() {
1709
1757
  s.collections.length,
1710
1758
  ")"
1711
1759
  ] }),
1712
- /* @__PURE__ */ e("div", { className: "max-h-48 overflow-y-auto", children: s.collections.map((o) => /* @__PURE__ */ t(
1760
+ /* @__PURE__ */ e("div", { className: "max-h-48 overflow-y-auto", children: s.collections.map((l) => /* @__PURE__ */ t(
1713
1761
  "p",
1714
1762
  {
1715
1763
  className: "flex items-center gap-2 border-b border-slate-50 py-0.5 text-[12px] last:border-b-0 dark:border-border/40",
1716
1764
  children: [
1717
- /* @__PURE__ */ e("span", { className: "font-mono", children: o.collection }),
1718
- /* @__PURE__ */ e("span", { className: "ml-auto text-[10.5px] text-slate-400", children: [...new Set(o.actions)].join(" · ") })
1765
+ /* @__PURE__ */ e("span", { className: "font-mono", children: l.collection }),
1766
+ /* @__PURE__ */ e("span", { className: "ml-auto text-[10.5px] text-slate-400", children: [...new Set(l.actions)].join(" · ") })
1719
1767
  ]
1720
1768
  },
1721
- o.collection
1769
+ l.collection
1722
1770
  )) })
1723
1771
  ] })
1724
1772
  ] })
1725
1773
  ] });
1726
1774
  }
1727
- function mt() {
1728
- const l = F(), u = I(), { data: a } = C({
1775
+ function ht() {
1776
+ const i = T(), u = E(), { data: a } = q({
1729
1777
  queryKey: ["nvr-profile-prefs"],
1730
- queryFn: () => l.request(D("/users/me")).then((c) => {
1778
+ queryFn: () => i.request(F("/users/me")).then((m) => {
1731
1779
  var n;
1732
- return ((n = c.data) == null ? void 0 : n.preferences) ?? {};
1780
+ return ((n = m.data) == null ? void 0 : n.preferences) ?? {};
1733
1781
  })
1734
- }), s = q({
1735
- mutationFn: (c) => l.request(W("/users/me/preferences", c)),
1736
- onSuccess: (c, n) => {
1737
- u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), ne(Object.keys(n)), import("sonner").then(
1782
+ }), s = _({
1783
+ mutationFn: (m) => i.request(V("/users/me/preferences", m)),
1784
+ onSuccess: (m, n) => {
1785
+ u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), le(Object.keys(n)), import("sonner").then(
1738
1786
  ({ toast: b }) => b.success("Saved — applied on all your open tabs and devices")
1739
1787
  );
1740
1788
  }
1741
- }), o = (a == null ? void 0 : a.number_format) ?? {}, { data: i = [re, ...he] } = C({
1789
+ }), l = (a == null ? void 0 : a.number_format) ?? {}, { data: o = [se, ...he] } = q({
1742
1790
  queryKey: ["nvr-theme-accents"],
1743
- queryFn: () => l.request(
1744
- D("/settings")
1745
- ).then((c) => {
1791
+ queryFn: () => i.request(
1792
+ F("/settings")
1793
+ ).then((m) => {
1746
1794
  var n, b;
1747
1795
  return [
1748
- { ...re, color: ((n = c.data) == null ? void 0 : n.project_color) ?? null },
1749
- ...Ke((b = c.data) == null ? void 0 : b.theme_accents)
1796
+ { ...se, color: ((n = m.data) == null ? void 0 : n.project_color) ?? null },
1797
+ ...Ke((b = m.data) == null ? void 0 : b.theme_accents)
1750
1798
  ];
1751
- }).catch(() => [re, ...he]),
1799
+ }).catch(() => [se, ...he]),
1752
1800
  staleTime: 5 * 6e4
1753
- }), d = typeof (a == null ? void 0 : a.theme_accent) == "string" ? a.theme_accent : "brand";
1801
+ }), c = typeof (a == null ? void 0 : a.theme_accent) == "string" ? a.theme_accent : "brand";
1754
1802
  return /* @__PURE__ */ t(
1755
1803
  "div",
1756
1804
  {
@@ -1765,10 +1813,10 @@ function mt() {
1765
1813
  /* @__PURE__ */ t("label", { className: "flex items-center gap-1.5", children: [
1766
1814
  "Timestamps",
1767
1815
  /* @__PURE__ */ e(
1768
- K,
1816
+ M,
1769
1817
  {
1770
1818
  value: String((a == null ? void 0 : a.time_display) ?? "relative"),
1771
- onChange: (c) => s.mutate({ time_display: c }),
1819
+ onChange: (m) => s.mutate({ time_display: m }),
1772
1820
  options: [
1773
1821
  { value: "relative", label: "Relative (3h ago)" },
1774
1822
  { value: "exact", label: "Exact (Aug 24, 3:12 PM)" }
@@ -1781,8 +1829,8 @@ function mt() {
1781
1829
  "input",
1782
1830
  {
1783
1831
  type: "checkbox",
1784
- checked: o.compact === !0,
1785
- onChange: (c) => s.mutate({ number_format: { ...o, compact: c.target.checked } }),
1832
+ checked: l.compact === !0,
1833
+ onChange: (m) => s.mutate({ number_format: { ...l, compact: m.target.checked } }),
1786
1834
  className: "rounded"
1787
1835
  }
1788
1836
  ),
@@ -1793,8 +1841,8 @@ function mt() {
1793
1841
  /* @__PURE__ */ e(
1794
1842
  "input",
1795
1843
  {
1796
- defaultValue: o.locale ?? "",
1797
- onBlur: (c) => s.mutate({ number_format: { ...o, locale: c.target.value.trim() || void 0 } }),
1844
+ defaultValue: l.locale ?? "",
1845
+ onBlur: (m) => s.mutate({ number_format: { ...l, locale: m.target.value.trim() || void 0 } }),
1798
1846
  placeholder: "en-US",
1799
1847
  className: "h-7 w-20 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
1800
1848
  }
@@ -1803,10 +1851,10 @@ function mt() {
1803
1851
  /* @__PURE__ */ t("label", { className: "flex items-center gap-1.5", children: [
1804
1852
  "Week starts",
1805
1853
  /* @__PURE__ */ e(
1806
- K,
1854
+ M,
1807
1855
  {
1808
1856
  value: String((a == null ? void 0 : a.week_start) ?? "sun"),
1809
- onChange: (c) => s.mutate({ week_start: c }),
1857
+ onChange: (m) => s.mutate({ week_start: m }),
1810
1858
  options: [
1811
1859
  { value: "sun", label: "Sunday" },
1812
1860
  { value: "mon", label: "Monday" }
@@ -1816,34 +1864,34 @@ function mt() {
1816
1864
  ] }),
1817
1865
  /* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", "data-theme-accent-picker": !0, children: [
1818
1866
  "Accent",
1819
- /* @__PURE__ */ e("span", { className: "flex items-center gap-1", children: i.map((c) => {
1820
- const n = c.key === "brand" && d === "brand" || c.key === d;
1867
+ /* @__PURE__ */ e("span", { className: "flex items-center gap-1", children: o.map((m) => {
1868
+ const n = m.key === "brand" && c === "brand" || m.key === c;
1821
1869
  return /* @__PURE__ */ e(
1822
1870
  "button",
1823
1871
  {
1824
1872
  type: "button",
1825
- title: c.label,
1826
- "aria-label": `Accent ${c.label}`,
1873
+ title: m.label,
1874
+ "aria-label": `Accent ${m.label}`,
1827
1875
  "aria-pressed": n,
1828
- "data-theme-accent": c.key,
1829
- onClick: () => s.mutate({ theme_accent: c.key === "brand" ? null : c.key }),
1830
- className: U(
1876
+ "data-theme-accent": m.key,
1877
+ onClick: () => s.mutate({ theme_accent: m.key === "brand" ? null : m.key }),
1878
+ className: $(
1831
1879
  "h-5 w-5 rounded-full border-2 transition-transform",
1832
1880
  n ? "scale-110 border-slate-800 dark:border-slate-100" : "border-transparent hover:scale-105"
1833
1881
  ),
1834
- style: { background: c.color ?? "var(--nvr-cyan)" }
1882
+ style: { background: m.color ?? "var(--nvr-cyan)" }
1835
1883
  },
1836
- c.key
1884
+ m.key
1837
1885
  );
1838
1886
  }) })
1839
1887
  ] }),
1840
1888
  /* @__PURE__ */ t("label", { className: "flex items-center gap-1.5", children: [
1841
1889
  "Text size",
1842
1890
  /* @__PURE__ */ e(
1843
- K,
1891
+ M,
1844
1892
  {
1845
1893
  value: String((a == null ? void 0 : a.font_size) ?? "default"),
1846
- onChange: (c) => s.mutate({ font_size: c }),
1894
+ onChange: (m) => s.mutate({ font_size: m }),
1847
1895
  options: [
1848
1896
  { value: "small", label: "Small" },
1849
1897
  { value: "default", label: "Default" },
@@ -1858,11 +1906,11 @@ function mt() {
1858
1906
  );
1859
1907
  }
1860
1908
  export {
1861
- ze as DelegationCard,
1862
- mt as DisplayPrefsCard,
1863
- et as LinkAppCard,
1864
- Xe as NotificationRulesCard,
1865
- Ze as ProfileFieldsCard,
1866
- Lt as ProfileView,
1867
- tt as TimezoneCard
1909
+ Be as DelegationCard,
1910
+ ht as DisplayPrefsCard,
1911
+ tt as LinkAppCard,
1912
+ et as NotificationRulesCard,
1913
+ Xe as ProfileFieldsCard,
1914
+ It as ProfileView,
1915
+ at as TimezoneCard
1868
1916
  };