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