@nivaro/react 0.2.55 → 0.3.0
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/components/slots/TasksSlot.js +31 -29
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +101 -1
- package/dist/index.js +538 -525
- package/dist/shared/components/ItemEditForm.js +666 -658
- package/dist/shared/components/MyWorkView.js +47 -37
- package/dist/shared/components/ProfileView.js +163 -144
- package/dist/shared/components/ai/AiPlanCard.js +427 -0
- package/dist/shared/components/ai/AiPlanChanges.js +117 -0
- package/dist/shared/components/ai/TaskDo.js +1022 -0
- package/dist/shared/components/chat/ChatAnalyticsView.js +19 -17
- package/dist/shared/components/chat/ChatPanel.js +1356 -1317
- package/dist/shared/components/chat/HuddleAnalyticsTab.js +198 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +78 -65
- package/dist/shared/components/chat/chat-core.js +273 -264
- package/dist/shared/components/chat/huddle/HuddleAudioUi.js +397 -0
- package/dist/shared/components/chat/huddle/HuddleCallBar.js +296 -0
- package/dist/shared/components/chat/huddle/HuddleCallLayer.js +180 -0
- package/dist/shared/components/chat/huddle/HuddleCamera.js +124 -0
- package/dist/shared/components/chat/huddle/HuddleCollab.js +320 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +82 -121
- package/dist/shared/components/chat/huddle/HuddleDraw.js +231 -0
- package/dist/shared/components/chat/huddle/HuddleLiveBadge.js +52 -0
- package/dist/shared/components/chat/huddle/HuddlePeoplePicker.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleScheduleCard.js +190 -0
- package/dist/shared/components/chat/huddle/HuddleScheduleForm.js +188 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +184 -89
- package/dist/shared/components/chat/huddle/HuddleStageTools.js +197 -0
- package/dist/shared/components/chat/huddle/huddle-audio-logic.js +156 -0
- package/dist/shared/components/chat/huddle/huddle-audio.js +69 -0
- package/dist/shared/components/chat/huddle/huddle-calls.js +129 -0
- package/dist/shared/components/chat/huddle/huddle-camera.js +143 -0
- package/dist/shared/components/chat/huddle/huddle-collab-store.js +391 -0
- package/dist/shared/components/chat/huddle/huddle-device-prefs.js +55 -0
- package/dist/shared/components/chat/huddle/huddle-devices.js +99 -0
- package/dist/shared/components/chat/huddle/huddle-draw.js +226 -0
- package/dist/shared/components/chat/huddle/huddle-follow-bus.js +96 -0
- package/dist/shared/components/chat/huddle/huddle-hold.js +62 -0
- package/dist/shared/components/chat/huddle/huddle-link-quality.js +159 -0
- package/dist/shared/components/chat/huddle/huddle-live.js +82 -0
- package/dist/shared/components/chat/huddle/huddle-pip.js +343 -0
- package/dist/shared/components/chat/huddle/huddle-quality.js +22 -0
- package/dist/shared/components/chat/huddle/huddle-reactions.js +71 -0
- package/dist/shared/components/chat/huddle/huddle-ring-refused.js +34 -0
- package/dist/shared/components/chat/huddle/huddle-schedule.js +102 -0
- package/dist/shared/components/chat/huddle/huddle-sfu.js +176 -0
- package/dist/shared/components/chat/huddle/huddle-shortcuts.js +91 -0
- package/dist/shared/components/chat/huddle/huddle-speaking.js +100 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +431 -157
- package/dist/shared/components/chat/huddle/useHuddle.js +46 -38
- package/dist/shared/components/chat/huddle/useHuddleAudio.js +35 -0
- package/dist/shared/components/item-edit/GroupSection.js +1 -0
- package/dist/shared/components/item-edit/RecordChatActions.js +68 -59
- package/dist/shared/components/item-edit/UserChip.js +145 -142
- package/dist/shared/components/panels/TaskPanel.js +51 -49
- package/dist/shared/components/support/TicketDetailSheet.js +57 -42
- package/dist/shared/lib/notification-sound.js +25 -16
- package/dist/shared/lib/stale-chunk.js +60 -0
- package/package.json +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e, Fragment as oe } from "react/jsx-runtime";
|
|
2
|
-
import { readUser as fe, readUserCard as ye, updateUser as
|
|
2
|
+
import { readUser as fe, readUserCard as ye, updateUser as ue, readMyScopes as ve, saveMyScopeDefaults as ke, readItems as ne } from "@nivaro/sdk";
|
|
3
3
|
import { useQueryClient as E, useQuery as q, useMutation as _ } from "@tanstack/react-query";
|
|
4
|
-
import { Loader2 as
|
|
4
|
+
import { Loader2 as me, Camera as Ne, Building2 as we, Mail as Se, Phone as _e, Clock as qe, Undo2 as Ce, Check as Pe, UserRound as Ae, Filter as Te, LogOut as Fe, ShieldCheck as Oe } from "lucide-react";
|
|
5
5
|
import { useState as C, useMemo as Le, useRef as De } from "react";
|
|
6
6
|
import { useNivaroClient as T, useItemEditAuth as xe } from "../context.js";
|
|
7
7
|
import { get as F, patch as V, post as ae, put as Me, del as Ee } from "../lib/commands.js";
|
|
@@ -19,11 +19,11 @@ import { TeamLoadCard as Ye } from "./profile/PersonExtras.js";
|
|
|
19
19
|
import { NotificationSourcesCard as We } from "./NotificationSourcesCard.js";
|
|
20
20
|
import { UserScopesCard as Ge } from "./profile/PersonAccess.js";
|
|
21
21
|
import { PersonProfile as Je } from "./profile/PersonProfile.js";
|
|
22
|
-
import { SectionCard as ie, Field as Y, ConfirmButton as be } from "./profile/primitives.js";
|
|
22
|
+
import { Toggle as Ve, SectionCard as ie, Field as Y, ConfirmButton as be } from "./profile/primitives.js";
|
|
23
23
|
import { SimpleSelectXs as M } from "./ui/SimpleSelect.js";
|
|
24
|
-
const
|
|
25
|
-
var
|
|
26
|
-
return (`${((
|
|
24
|
+
const Ze = (i) => [i.first_name, i.last_name].filter(Boolean).join(" ") || (i.email ?? "Unknown"), Xe = (i) => {
|
|
25
|
+
var m, a;
|
|
26
|
+
return (`${((m = i.first_name) == null ? void 0 : m[0]) ?? ""}${((a = i.last_name) == null ? void 0 : a[0]) ?? ""}` || (i.email ?? "?").slice(0, 2)).toUpperCase();
|
|
27
27
|
}, te = [
|
|
28
28
|
{
|
|
29
29
|
key: "mentions",
|
|
@@ -65,6 +65,11 @@ const Ve = (i) => [i.first_name, i.last_name].filter(Boolean).join(" ") || (i.em
|
|
|
65
65
|
label: "Integrations",
|
|
66
66
|
help: "A partner system was not told something about your record, a send is still unanswered, or an integration alert you turned on in the Integrations console fired."
|
|
67
67
|
},
|
|
68
|
+
{
|
|
69
|
+
key: "huddle",
|
|
70
|
+
label: "Huddles & calls",
|
|
71
|
+
help: "Someone calls you in a huddle or adds you to one, and reminders for huddles you were invited to. Push is what rings a closed tab."
|
|
72
|
+
},
|
|
68
73
|
{
|
|
69
74
|
key: "system",
|
|
70
75
|
label: "System & digests",
|
|
@@ -76,18 +81,18 @@ const Ve = (i) => [i.first_name, i.last_name].filter(Boolean).join(" ") || (i.em
|
|
|
76
81
|
help: "Any notification that does not fit a category above — direct messages from other users, access requests, task assignments."
|
|
77
82
|
}
|
|
78
83
|
];
|
|
79
|
-
function
|
|
80
|
-
const i = T(),
|
|
84
|
+
function et() {
|
|
85
|
+
const i = T(), m = E(), { data: a = [] } = q({
|
|
81
86
|
queryKey: ["nvr-profile-fields"],
|
|
82
87
|
queryFn: () => i.request(F("/profile-fields/mine")).then((n) => n.data ?? []).catch(() => [])
|
|
83
88
|
}), [s, l] = C(null), o = _({
|
|
84
89
|
mutationFn: (n) => i.request(Me("/profile-fields/mine", { values: n })),
|
|
85
90
|
onSuccess: () => {
|
|
86
|
-
l(null),
|
|
91
|
+
l(null), m.invalidateQueries({ queryKey: ["nvr-profile-fields"] });
|
|
87
92
|
}
|
|
88
93
|
});
|
|
89
94
|
if (a.length === 0) return null;
|
|
90
|
-
const c = s ?? Object.fromEntries(a.map((n) => [n.key, n.value ?? ""])),
|
|
95
|
+
const c = s ?? Object.fromEntries(a.map((n) => [n.key, n.value ?? ""])), u = (n) => Array.isArray(n) ? n.map(String) : Array.isArray(n == null ? void 0 : n.choices) ? n.choices.map(
|
|
91
96
|
(b) => typeof b == "object" && b != null ? String(b.value ?? "") : String(b)
|
|
92
97
|
) : [];
|
|
93
98
|
return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
@@ -116,7 +121,7 @@ function Xe() {
|
|
|
116
121
|
value: c[n.key] || "",
|
|
117
122
|
options: [
|
|
118
123
|
{ value: "", label: "—" },
|
|
119
|
-
...
|
|
124
|
+
...u(n.options).map((b) => ({ value: b, label: b }))
|
|
120
125
|
],
|
|
121
126
|
onChange: (b) => l({ ...c, [n.key]: b })
|
|
122
127
|
}
|
|
@@ -153,8 +158,8 @@ function Xe() {
|
|
|
153
158
|
] })
|
|
154
159
|
] });
|
|
155
160
|
}
|
|
156
|
-
function
|
|
157
|
-
const i = T(),
|
|
161
|
+
function tt() {
|
|
162
|
+
const i = T(), m = E(), { data: a } = q({
|
|
158
163
|
queryKey: ["nvr-profile-prefs"],
|
|
159
164
|
queryFn: () => i.request(F("/users/me")).then((r) => {
|
|
160
165
|
var h;
|
|
@@ -163,15 +168,15 @@ function et() {
|
|
|
163
168
|
}), s = (a == null ? void 0 : a.notification_prefs) ?? {}, l = (a == null ? void 0 : a.email_digest) === "daily" ? "daily" : "instant", o = (r) => {
|
|
164
169
|
var h, x;
|
|
165
170
|
return ((x = (h = s.matrix) == null ? void 0 : h[r]) == null ? void 0 : x.email) ?? l;
|
|
166
|
-
}, [c,
|
|
171
|
+
}, [c, u] = C(null), [n, b] = C(null), p = c ?? s.quiet_start ?? "", w = n ?? s.quiet_end ?? "", k = _({
|
|
167
172
|
mutationFn: (r) => i.request(V("/users/me/preferences", { notification_prefs: r })),
|
|
168
173
|
onSuccess: () => {
|
|
169
|
-
|
|
174
|
+
m.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), le(["notification_prefs"]);
|
|
170
175
|
}
|
|
171
176
|
}), P = _({
|
|
172
177
|
mutationFn: (r) => i.request(V("/users/me/preferences", r)),
|
|
173
178
|
onSuccess: (r, h) => {
|
|
174
|
-
|
|
179
|
+
m.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), le(Object.keys(h));
|
|
175
180
|
}
|
|
176
181
|
}), [v, O] = C(null), L = _({
|
|
177
182
|
mutationFn: (r) => i.request(ae("/notifications/rules-preview", { notification_prefs: r })),
|
|
@@ -357,7 +362,7 @@ function et() {
|
|
|
357
362
|
{
|
|
358
363
|
type: "time",
|
|
359
364
|
value: p,
|
|
360
|
-
onChange: (r) =>
|
|
365
|
+
onChange: (r) => u(r.target.value),
|
|
361
366
|
onBlur: () => S({ quiet_start: p || void 0 }),
|
|
362
367
|
className: "h-7 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
|
|
363
368
|
}
|
|
@@ -378,7 +383,7 @@ function et() {
|
|
|
378
383
|
{
|
|
379
384
|
type: "button",
|
|
380
385
|
onClick: () => {
|
|
381
|
-
|
|
386
|
+
u(""), b(""), k.mutate({ matrix: s.matrix ?? {} });
|
|
382
387
|
},
|
|
383
388
|
className: "text-[11.5px] text-slate-400 underline decoration-dotted underline-offset-2",
|
|
384
389
|
children: "Clear"
|
|
@@ -403,6 +408,20 @@ function et() {
|
|
|
403
408
|
),
|
|
404
409
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "plays when a notification or a direct message arrives" })
|
|
405
410
|
] }),
|
|
411
|
+
/* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
|
|
412
|
+
/* @__PURE__ */ e(
|
|
413
|
+
Ve,
|
|
414
|
+
{
|
|
415
|
+
on: (a == null ? void 0 : a.huddle_hold_notifications) !== !1,
|
|
416
|
+
onChange: () => P.mutate({
|
|
417
|
+
huddle_hold_notifications: (a == null ? void 0 : a.huddle_hold_notifications) === !1
|
|
418
|
+
}),
|
|
419
|
+
label: "Hold notifications during huddles"
|
|
420
|
+
}
|
|
421
|
+
),
|
|
422
|
+
"Hold notifications during huddles",
|
|
423
|
+
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "toasts and sounds wait while you talk; you get one summary when you leave" })
|
|
424
|
+
] }),
|
|
406
425
|
/* @__PURE__ */ t("table", { className: "w-full text-[12px]", children: [
|
|
407
426
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { className: "text-left text-[10.5px] uppercase tracking-wide text-slate-400", children: [
|
|
408
427
|
/* @__PURE__ */ e("th", { className: "py-1 font-semibold", children: "Category" }),
|
|
@@ -615,16 +634,16 @@ function et() {
|
|
|
615
634
|
}
|
|
616
635
|
);
|
|
617
636
|
}
|
|
618
|
-
function
|
|
619
|
-
const i = T(),
|
|
637
|
+
function at() {
|
|
638
|
+
const i = T(), m = E(), { data: a } = q({
|
|
620
639
|
queryKey: ["nvr-profile-prefs"],
|
|
621
640
|
queryFn: () => i.request(F("/users/me")).then((c) => {
|
|
622
|
-
var
|
|
623
|
-
return ((
|
|
641
|
+
var u;
|
|
642
|
+
return ((u = c.data) == null ? void 0 : u.preferences) ?? {};
|
|
624
643
|
})
|
|
625
644
|
}), s = (a == null ? void 0 : a.link_app) === "portal" || (a == null ? void 0 : a.link_app) === "admin" ? a.link_app : "auto", l = _({
|
|
626
645
|
mutationFn: (c) => i.request(V("/users/me/preferences", { link_app: c })),
|
|
627
|
-
onSuccess: () => void
|
|
646
|
+
onSuccess: () => void m.invalidateQueries({ queryKey: ["nvr-profile-prefs"] })
|
|
628
647
|
});
|
|
629
648
|
return /* @__PURE__ */ t(
|
|
630
649
|
"div",
|
|
@@ -653,8 +672,8 @@ function tt() {
|
|
|
653
672
|
}
|
|
654
673
|
);
|
|
655
674
|
}
|
|
656
|
-
function
|
|
657
|
-
const i = T(),
|
|
675
|
+
function rt() {
|
|
676
|
+
const i = T(), m = E(), [a, s] = C(""), l = (() => {
|
|
658
677
|
try {
|
|
659
678
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
660
679
|
} catch {
|
|
@@ -676,10 +695,10 @@ function at() {
|
|
|
676
695
|
var w;
|
|
677
696
|
return ((w = p.data) == null ? void 0 : w.preferences) ?? {};
|
|
678
697
|
})
|
|
679
|
-
}),
|
|
698
|
+
}), u = typeof (c == null ? void 0 : c.timezone) == "string" ? c.timezone : null, n = _({
|
|
680
699
|
mutationFn: (p) => i.request(V("/users/me/preferences", { timezone: p })),
|
|
681
700
|
onSuccess: (p, w) => {
|
|
682
|
-
Ie(w), s(""),
|
|
701
|
+
Ie(w), s(""), m.invalidateQueries({ queryKey: ["nvr-profile-prefs"] });
|
|
683
702
|
}
|
|
684
703
|
}), b = a.length > 1 ? o.filter((p) => p.toLowerCase().includes(a.toLowerCase())).slice(0, 8) : [];
|
|
685
704
|
return /* @__PURE__ */ t(
|
|
@@ -696,8 +715,8 @@ function at() {
|
|
|
696
715
|
"."
|
|
697
716
|
] }),
|
|
698
717
|
/* @__PURE__ */ t("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [
|
|
699
|
-
/* @__PURE__ */ e("span", { className: "inline-flex items-center gap-1.5 rounded-full bg-nvr-cyan/10 px-2.5 py-1 text-[12px] font-medium text-nvr-navy dark:text-nvr-cyan", children:
|
|
700
|
-
|
|
718
|
+
/* @__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 ?? `${l} (browser default)` }),
|
|
719
|
+
u && /* @__PURE__ */ e(
|
|
701
720
|
"button",
|
|
702
721
|
{
|
|
703
722
|
type: "button",
|
|
@@ -732,13 +751,13 @@ function at() {
|
|
|
732
751
|
}
|
|
733
752
|
);
|
|
734
753
|
}
|
|
735
|
-
function
|
|
736
|
-
const i = T(),
|
|
754
|
+
function nt() {
|
|
755
|
+
const i = T(), m = E(), { data: a } = q({
|
|
737
756
|
queryKey: ["nvr-profile-scopes"],
|
|
738
757
|
queryFn: () => i.request(ve()).then((l) => l.data)
|
|
739
758
|
}), s = _({
|
|
740
759
|
mutationFn: ({ dimension: l, values: o }) => i.request(ke(l, o)),
|
|
741
|
-
onSuccess: () => void
|
|
760
|
+
onSuccess: () => void m.invalidateQueries({ queryKey: ["nvr-profile-scopes"] })
|
|
742
761
|
});
|
|
743
762
|
return !a || a.dimensions.length === 0 ? null : /* @__PURE__ */ e(
|
|
744
763
|
ie,
|
|
@@ -748,7 +767,7 @@ function rt() {
|
|
|
748
767
|
title: "Default filters",
|
|
749
768
|
hint: "Pre-selected in browsers and reports — clear anytime",
|
|
750
769
|
children: /* @__PURE__ */ e("div", { className: "space-y-3", children: a.dimensions.map((l) => /* @__PURE__ */ e(
|
|
751
|
-
|
|
770
|
+
st,
|
|
752
771
|
{
|
|
753
772
|
dimension: l,
|
|
754
773
|
selected: a.defaults[l.name] ?? [],
|
|
@@ -760,13 +779,13 @@ function rt() {
|
|
|
760
779
|
}
|
|
761
780
|
);
|
|
762
781
|
}
|
|
763
|
-
function
|
|
782
|
+
function st({
|
|
764
783
|
dimension: i,
|
|
765
|
-
selected:
|
|
784
|
+
selected: m,
|
|
766
785
|
restricted: a,
|
|
767
786
|
onSave: s
|
|
768
787
|
}) {
|
|
769
|
-
const l = T(), o = i.display_field ?? "name", [c,
|
|
788
|
+
const l = T(), o = i.display_field ?? "name", [c, u] = C(""), [n, b] = C(!1), { data: p = [] } = q({
|
|
770
789
|
queryKey: ["nvr-scope-options", i.name],
|
|
771
790
|
queryFn: async () => ((await l.request(
|
|
772
791
|
ne(i.target_collection, {
|
|
@@ -778,7 +797,7 @@ function nt({
|
|
|
778
797
|
id: N.id,
|
|
779
798
|
label: String(N[o] ?? N.id)
|
|
780
799
|
}))
|
|
781
|
-
}), w = a != null && a.length ? new Set(a.map(String)) : null, k = w ? p.filter((d) => w.has(String(d.id))) : p, P = new Set(
|
|
800
|
+
}), w = a != null && a.length ? new Set(a.map(String)) : null, k = w ? p.filter((d) => w.has(String(d.id))) : p, P = new Set(m.map(String)), v = k.length > 24 || p.length >= 200 && !w, { data: O = [], isFetching: L } = q({
|
|
782
801
|
queryKey: ["nvr-scope-search", i.name, c],
|
|
783
802
|
queryFn: async () => {
|
|
784
803
|
const N = ((await l.request(
|
|
@@ -798,7 +817,7 @@ function nt({
|
|
|
798
817
|
placeholderData: (d) => d
|
|
799
818
|
}), S = new Map(p.map((d) => [String(d.id), d.label]));
|
|
800
819
|
for (const d of O) S.set(String(d.id), d.label);
|
|
801
|
-
const y =
|
|
820
|
+
const y = m.filter((d) => !S.has(String(d))), { data: z = [] } = q({
|
|
802
821
|
queryKey: ["nvr-scope-selected-labels", i.name, y.map(String).sort().join(",")],
|
|
803
822
|
queryFn: async () => ((await l.request(
|
|
804
823
|
ne(i.target_collection, {
|
|
@@ -815,13 +834,13 @@ function nt({
|
|
|
815
834
|
for (const d of z) S.set(String(d.id), d.label);
|
|
816
835
|
const I = (d) => {
|
|
817
836
|
const N = P.has(String(d));
|
|
818
|
-
s(N ?
|
|
837
|
+
s(N ? m.filter((A) => String(A) !== String(d)) : [...m, d]);
|
|
819
838
|
}, f = c.trim().toLowerCase(), K = f ? k.filter((d) => d.label.toLowerCase().includes(f)) : k, j = f.length === 0 ? k.slice(0, 30) : L && O.length === 0 ? K.slice(0, 30) : O, U = v && (n || f.length > 0);
|
|
820
839
|
return /* @__PURE__ */ t("div", { children: [
|
|
821
840
|
/* @__PURE__ */ t("p", { className: "mb-1 text-[11px] font-medium uppercase tracking-wide text-slate-400", children: [
|
|
822
841
|
i.label,
|
|
823
842
|
a != null && a.length ? /* @__PURE__ */ e("span", { className: "ml-1.5 normal-case tracking-normal text-amber-500", children: "(limited by your access)" }) : null,
|
|
824
|
-
|
|
843
|
+
m.length > 0 && /* @__PURE__ */ t(
|
|
825
844
|
"button",
|
|
826
845
|
{
|
|
827
846
|
type: "button",
|
|
@@ -829,13 +848,13 @@ function nt({
|
|
|
829
848
|
className: "ml-2 normal-case tracking-normal text-slate-400 underline-offset-2 hover:text-slate-600 hover:underline",
|
|
830
849
|
children: [
|
|
831
850
|
"clear ",
|
|
832
|
-
|
|
851
|
+
m.length
|
|
833
852
|
]
|
|
834
853
|
}
|
|
835
854
|
)
|
|
836
855
|
] }),
|
|
837
856
|
v ? /* @__PURE__ */ t("div", { className: "max-w-xl", children: [
|
|
838
|
-
|
|
857
|
+
m.length > 0 && /* @__PURE__ */ e("div", { className: "mb-1.5 flex flex-wrap gap-1", children: m.map((d) => /* @__PURE__ */ t(
|
|
839
858
|
"span",
|
|
840
859
|
{
|
|
841
860
|
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",
|
|
@@ -859,7 +878,7 @@ function nt({
|
|
|
859
878
|
"input",
|
|
860
879
|
{
|
|
861
880
|
value: c,
|
|
862
|
-
onChange: (d) =>
|
|
881
|
+
onChange: (d) => u(d.target.value),
|
|
863
882
|
onFocus: () => b(!0),
|
|
864
883
|
onBlur: () => b(!1),
|
|
865
884
|
placeholder: `Search ${i.label.toLowerCase()} to add…`,
|
|
@@ -896,7 +915,7 @@ function nt({
|
|
|
896
915
|
]
|
|
897
916
|
}
|
|
898
917
|
),
|
|
899
|
-
!U &&
|
|
918
|
+
!U && m.length === 0 && /* @__PURE__ */ e("p", { className: "mt-1 text-[11px] text-slate-400", children: "No defaults set — click to browse or type to search." })
|
|
900
919
|
] }) : /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: [
|
|
901
920
|
k.map((d) => {
|
|
902
921
|
const N = P.has(String(d.id));
|
|
@@ -918,12 +937,12 @@ function nt({
|
|
|
918
937
|
] })
|
|
919
938
|
] });
|
|
920
939
|
}
|
|
921
|
-
function
|
|
940
|
+
function lt() {
|
|
922
941
|
const { data: i } = q({
|
|
923
942
|
queryKey: ["nvr-settings-2fa"],
|
|
924
943
|
queryFn: () => a.request({ _method: "GET", _path: "/settings/" }).then((y) => (y == null ? void 0 : y.data) ?? null).catch(() => null),
|
|
925
944
|
staleTime: 6e5
|
|
926
|
-
}),
|
|
945
|
+
}), m = (i == null ? void 0 : i.two_factor_enabled) !== !1, a = T(), s = E(), [l, o] = C(null), [c, u] = C(""), [n, b] = C(null), { data: p } = q({
|
|
927
946
|
queryKey: ["nvr-profile-totp"],
|
|
928
947
|
queryFn: () => a.request({ _method: "GET", _path: "/two-factor/status" }).then((y) => y.data)
|
|
929
948
|
}), w = () => void s.invalidateQueries({ queryKey: ["nvr-profile-totp"] }), k = _({
|
|
@@ -936,7 +955,7 @@ function st() {
|
|
|
936
955
|
_body: { token: y }
|
|
937
956
|
}),
|
|
938
957
|
onSuccess: () => {
|
|
939
|
-
o(null),
|
|
958
|
+
o(null), u(""), w();
|
|
940
959
|
}
|
|
941
960
|
}), v = _({
|
|
942
961
|
mutationFn: (y) => a.request({
|
|
@@ -945,7 +964,7 @@ function st() {
|
|
|
945
964
|
_body: { token: y }
|
|
946
965
|
}),
|
|
947
966
|
onSuccess: () => {
|
|
948
|
-
|
|
967
|
+
u(""), w();
|
|
949
968
|
}
|
|
950
969
|
}), O = _({
|
|
951
970
|
mutationFn: () => a.request({ _method: "POST", _path: "/users/me/token" }).then((y) => y.data),
|
|
@@ -962,9 +981,9 @@ function st() {
|
|
|
962
981
|
{
|
|
963
982
|
icon: /* @__PURE__ */ e(Oe, { className: "h-4 w-4" }),
|
|
964
983
|
title: "Security",
|
|
965
|
-
hint:
|
|
984
|
+
hint: m ? "Two-factor sign-in and API access" : "API access",
|
|
966
985
|
children: /* @__PURE__ */ t("div", { className: "space-y-4", children: [
|
|
967
|
-
|
|
986
|
+
m && /* @__PURE__ */ t("div", { children: [
|
|
968
987
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
969
988
|
/* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-slate-200", children: "Two-factor authentication" }),
|
|
970
989
|
/* @__PURE__ */ e(
|
|
@@ -1003,7 +1022,7 @@ function st() {
|
|
|
1003
1022
|
"input",
|
|
1004
1023
|
{
|
|
1005
1024
|
value: c,
|
|
1006
|
-
onChange: (y) =>
|
|
1025
|
+
onChange: (y) => u(y.target.value),
|
|
1007
1026
|
placeholder: "123456",
|
|
1008
1027
|
inputMode: "numeric",
|
|
1009
1028
|
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"
|
|
@@ -1027,7 +1046,7 @@ function st() {
|
|
|
1027
1046
|
"input",
|
|
1028
1047
|
{
|
|
1029
1048
|
value: c,
|
|
1030
|
-
onChange: (y) =>
|
|
1049
|
+
onChange: (y) => u(y.target.value),
|
|
1031
1050
|
placeholder: "Code to disable",
|
|
1032
1051
|
inputMode: "numeric",
|
|
1033
1052
|
className: "h-8 w-[130px] rounded-md border border-slate-200 px-2.5 text-[12px] dark:border-border dark:bg-background"
|
|
@@ -1048,7 +1067,7 @@ function st() {
|
|
|
1048
1067
|
/* @__PURE__ */ t(
|
|
1049
1068
|
"div",
|
|
1050
1069
|
{
|
|
1051
|
-
className:
|
|
1070
|
+
className: m ? "border-t border-slate-100 pt-3 dark:border-border/60" : void 0,
|
|
1052
1071
|
children: [
|
|
1053
1072
|
/* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-slate-200", children: "API token" }),
|
|
1054
1073
|
/* @__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." }),
|
|
@@ -1100,25 +1119,25 @@ function st() {
|
|
|
1100
1119
|
}
|
|
1101
1120
|
);
|
|
1102
1121
|
}
|
|
1103
|
-
function
|
|
1122
|
+
function jt({
|
|
1104
1123
|
userId: i,
|
|
1105
|
-
className:
|
|
1124
|
+
className: m,
|
|
1106
1125
|
initialTab: a,
|
|
1107
1126
|
extra: s,
|
|
1108
1127
|
pushServiceWorker: l = "/sw.js"
|
|
1109
1128
|
}) {
|
|
1110
1129
|
const o = xe();
|
|
1111
|
-
return !i || (o == null ? void 0 : o.userId) != null && String(o.userId) === String(i) ? /* @__PURE__ */ e(
|
|
1130
|
+
return !i || (o == null ? void 0 : o.userId) != null && String(o.userId) === String(i) ? /* @__PURE__ */ e(ot, { className: m, extra: s, pushServiceWorker: l }) : /* @__PURE__ */ e(Je, { userId: i, className: m, initialTab: a });
|
|
1112
1131
|
}
|
|
1113
|
-
function
|
|
1132
|
+
function ot({
|
|
1114
1133
|
className: i,
|
|
1115
|
-
extra:
|
|
1134
|
+
extra: m,
|
|
1116
1135
|
pushServiceWorker: a
|
|
1117
1136
|
}) {
|
|
1118
1137
|
var U;
|
|
1119
|
-
const s = T(), l = E(), o = xe(), c = !0,
|
|
1120
|
-
queryKey: ["nvr-profile-user",
|
|
1121
|
-
queryFn: () => s.request(fe(
|
|
1138
|
+
const s = T(), l = E(), o = xe(), c = !0, u = "me", { data: n } = q({
|
|
1139
|
+
queryKey: ["nvr-profile-user", u],
|
|
1140
|
+
queryFn: () => s.request(fe(u)).then((d) => d.data),
|
|
1122
1141
|
enabled: c
|
|
1123
1142
|
}), b = (n == null ? void 0 : n.id) ?? null, { data: p } = q({
|
|
1124
1143
|
queryKey: ["nvr-profile-card", b],
|
|
@@ -1134,11 +1153,11 @@ function lt({
|
|
|
1134
1153
|
}),
|
|
1135
1154
|
[n]
|
|
1136
1155
|
), v = w ?? P, O = JSON.stringify(v) !== JSON.stringify(P), L = _({
|
|
1137
|
-
mutationFn: () => s.request(
|
|
1156
|
+
mutationFn: () => s.request(ue(n.id, v)),
|
|
1138
1157
|
onSuccess: () => {
|
|
1139
1158
|
k(null), l.invalidateQueries({ queryKey: ["nvr-profile-user"] }), l.invalidateQueries({ queryKey: ["nvr-profile-card"] });
|
|
1140
1159
|
}
|
|
1141
|
-
}), [S, y] = C(
|
|
1160
|
+
}), [S, y] = C(it), z = De(null), I = _({
|
|
1142
1161
|
mutationFn: async (d) => {
|
|
1143
1162
|
const N = await new Promise((A, Z) => {
|
|
1144
1163
|
const D = new Image(), W = URL.createObjectURL(d);
|
|
@@ -1154,7 +1173,7 @@ function lt({
|
|
|
1154
1173
|
URL.revokeObjectURL(W), Z(new Error("not an image"));
|
|
1155
1174
|
}, D.src = W;
|
|
1156
1175
|
});
|
|
1157
|
-
await s.request(
|
|
1176
|
+
await s.request(ue(n.id, { avatar: N }));
|
|
1158
1177
|
},
|
|
1159
1178
|
onSuccess: () => {
|
|
1160
1179
|
l.invalidateQueries({ queryKey: ["nvr-profile-user"] }), l.invalidateQueries({ queryKey: ["nvr-profile-card"] }), l.invalidateQueries({ queryKey: ["user-card"] }), l.invalidateQueries({ queryKey: ["user-avatar"] });
|
|
@@ -1186,7 +1205,7 @@ function lt({
|
|
|
1186
1205
|
alt: "",
|
|
1187
1206
|
className: "h-[76px] w-[76px] rounded-full border border-slate-200 object-cover dark:border-border"
|
|
1188
1207
|
}
|
|
1189
|
-
) : /* @__PURE__ */ e("span", { className: "flex h-[76px] w-[76px] items-center justify-center rounded-full bg-[#c7f0fb] text-[24px] font-semibold text-[#04516b] dark:bg-nvr-cyan/15 dark:text-nvr-cyan", children:
|
|
1208
|
+
) : /* @__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: Xe(f) }),
|
|
1190
1209
|
/* @__PURE__ */ e(
|
|
1191
1210
|
"span",
|
|
1192
1211
|
{
|
|
@@ -1209,7 +1228,7 @@ function lt({
|
|
|
1209
1228
|
return (d = z.current) == null ? void 0 : d.click();
|
|
1210
1229
|
},
|
|
1211
1230
|
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",
|
|
1212
|
-
children: I.isPending ? /* @__PURE__ */ e(
|
|
1231
|
+
children: I.isPending ? /* @__PURE__ */ e(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Ne, { className: "h-3.5 w-3.5" })
|
|
1213
1232
|
}
|
|
1214
1233
|
),
|
|
1215
1234
|
/* @__PURE__ */ e(
|
|
@@ -1230,7 +1249,7 @@ function lt({
|
|
|
1230
1249
|
] }),
|
|
1231
1250
|
/* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: [
|
|
1232
1251
|
/* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
1233
|
-
/* @__PURE__ */ e("h1", { className: "text-[21px] font-semibold tracking-[-0.015em] text-slate-900 dark:text-white", children:
|
|
1252
|
+
/* @__PURE__ */ e("h1", { className: "text-[21px] font-semibold tracking-[-0.015em] text-slate-900 dark:text-white", children: Ze(f) }),
|
|
1234
1253
|
f.role_name && /* @__PURE__ */ e("span", { className: "rounded-full bg-nvr-cyan/10 px-2 py-px text-[10.5px] font-semibold text-nvr-navy dark:text-nvr-cyan", children: f.role_name }),
|
|
1235
1254
|
f.is_out_of_office && /* @__PURE__ */ e("span", { className: "rounded-full bg-amber-50 px-2 py-px text-[10.5px] font-semibold text-amber-600 dark:bg-amber-500/10 dark:text-amber-400", children: "Out of office" }),
|
|
1236
1255
|
/* @__PURE__ */ e(He, { email: f.email, canClear: o.isAdmin })
|
|
@@ -1288,7 +1307,7 @@ function lt({
|
|
|
1288
1307
|
] })
|
|
1289
1308
|
] })
|
|
1290
1309
|
] }) }),
|
|
1291
|
-
/* @__PURE__ */ e(
|
|
1310
|
+
/* @__PURE__ */ e(dt, { tab: S, onChange: y }),
|
|
1292
1311
|
S === "agents" ? /* @__PURE__ */ e(Re, {}) : n ? (
|
|
1293
1312
|
// One list in reading order — you, then notifications, then access
|
|
1294
1313
|
// and security — flowing into two balanced columns. Two fixed stacks
|
|
@@ -1328,7 +1347,7 @@ function lt({
|
|
|
1328
1347
|
onClick: () => L.mutate(),
|
|
1329
1348
|
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",
|
|
1330
1349
|
children: [
|
|
1331
|
-
L.isPending ? /* @__PURE__ */ e(
|
|
1350
|
+
L.isPending ? /* @__PURE__ */ e(me, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(Pe, { className: "h-3 w-3" }),
|
|
1332
1351
|
" ",
|
|
1333
1352
|
"Save"
|
|
1334
1353
|
]
|
|
@@ -1392,43 +1411,43 @@ function lt({
|
|
|
1392
1411
|
}
|
|
1393
1412
|
}
|
|
1394
1413
|
),
|
|
1395
|
-
/* @__PURE__ */ e(
|
|
1414
|
+
/* @__PURE__ */ e(et, {}),
|
|
1415
|
+
/* @__PURE__ */ e(rt, {}),
|
|
1416
|
+
/* @__PURE__ */ e(bt, {}),
|
|
1396
1417
|
/* @__PURE__ */ e(at, {}),
|
|
1397
|
-
/* @__PURE__ */ e(ht, {}),
|
|
1398
|
-
/* @__PURE__ */ e(tt, {}),
|
|
1399
1418
|
/* @__PURE__ */ e($e, {}),
|
|
1400
1419
|
/* @__PURE__ */ e(Ue, {}),
|
|
1401
|
-
o.isAdmin && (n != null && n.id) ? /* @__PURE__ */ e(Ge, { userId: String(n.id) }) : /* @__PURE__ */ e(
|
|
1402
|
-
/* @__PURE__ */ e(
|
|
1420
|
+
o.isAdmin && (n != null && n.id) ? /* @__PURE__ */ e(Ge, { userId: String(n.id) }) : /* @__PURE__ */ e(nt, {}),
|
|
1421
|
+
/* @__PURE__ */ e(ut, {}),
|
|
1403
1422
|
/* @__PURE__ */ e(Ye, { userId: "me" }),
|
|
1404
1423
|
/* @__PURE__ */ e(mt, {}),
|
|
1405
|
-
/* @__PURE__ */ e(
|
|
1424
|
+
/* @__PURE__ */ e(tt, {}),
|
|
1406
1425
|
/* @__PURE__ */ e(We, {}),
|
|
1407
1426
|
a !== !1 && /* @__PURE__ */ e(ze, { serviceWorkerPath: a }),
|
|
1408
|
-
/* @__PURE__ */ e(ut, {}),
|
|
1409
|
-
/* @__PURE__ */ e(st, {}),
|
|
1410
1427
|
/* @__PURE__ */ e(pt, {}),
|
|
1411
|
-
/* @__PURE__ */ e(
|
|
1412
|
-
|
|
1428
|
+
/* @__PURE__ */ e(lt, {}),
|
|
1429
|
+
/* @__PURE__ */ e(ht, {}),
|
|
1430
|
+
/* @__PURE__ */ e(ct, {}),
|
|
1431
|
+
m
|
|
1413
1432
|
]
|
|
1414
1433
|
}
|
|
1415
1434
|
)
|
|
1416
1435
|
) : null
|
|
1417
1436
|
] });
|
|
1418
1437
|
}
|
|
1419
|
-
function
|
|
1438
|
+
function it() {
|
|
1420
1439
|
try {
|
|
1421
1440
|
return new URLSearchParams(window.location.search).get("tab") === "agents" ? "agents" : "profile";
|
|
1422
1441
|
} catch {
|
|
1423
1442
|
return "profile";
|
|
1424
1443
|
}
|
|
1425
1444
|
}
|
|
1426
|
-
function
|
|
1445
|
+
function dt({
|
|
1427
1446
|
tab: i,
|
|
1428
|
-
onChange:
|
|
1447
|
+
onChange: m
|
|
1429
1448
|
}) {
|
|
1430
1449
|
const a = (l) => {
|
|
1431
|
-
|
|
1450
|
+
m(l);
|
|
1432
1451
|
try {
|
|
1433
1452
|
const o = new URL(window.location.href);
|
|
1434
1453
|
l === "agents" ? o.searchParams.set("tab", "agents") : o.searchParams.delete("tab"), window.history.replaceState(window.history.state, "", o);
|
|
@@ -1462,16 +1481,16 @@ function it({
|
|
|
1462
1481
|
}
|
|
1463
1482
|
);
|
|
1464
1483
|
}
|
|
1465
|
-
function
|
|
1466
|
-
const i = T(), [
|
|
1484
|
+
function ct() {
|
|
1485
|
+
const i = T(), [m, a] = C(!1), { data: s = [], isLoading: l } = q({
|
|
1467
1486
|
queryKey: ["my-matrix-seats"],
|
|
1468
1487
|
queryFn: () => i.request(F("/pipelines/my-seats")).then((c) => c.data ?? []).catch(() => []),
|
|
1469
|
-
enabled:
|
|
1488
|
+
enabled: m,
|
|
1470
1489
|
staleTime: 6e4
|
|
1471
1490
|
}), o = /* @__PURE__ */ new Map();
|
|
1472
1491
|
for (const c of s) {
|
|
1473
|
-
const
|
|
1474
|
-
|
|
1492
|
+
const u = o.get(c.template_name) ?? [];
|
|
1493
|
+
u.push(c), o.set(c.template_name, u);
|
|
1475
1494
|
}
|
|
1476
1495
|
return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white p-4 dark:border-border dark:bg-card", children: [
|
|
1477
1496
|
/* @__PURE__ */ t(
|
|
@@ -1485,14 +1504,14 @@ function dt() {
|
|
|
1485
1504
|
/* @__PURE__ */ e("h3", { className: "text-[14px] font-semibold", children: "My approval seats" }),
|
|
1486
1505
|
/* @__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." })
|
|
1487
1506
|
] }),
|
|
1488
|
-
/* @__PURE__ */ e("span", { className: "text-slate-400", children:
|
|
1507
|
+
/* @__PURE__ */ e("span", { className: "text-slate-400", children: m ? "▾" : "▸" })
|
|
1489
1508
|
]
|
|
1490
1509
|
}
|
|
1491
1510
|
),
|
|
1492
|
-
|
|
1511
|
+
m && (l ? /* @__PURE__ */ e("p", { className: "mt-3 text-[12.5px] text-slate-400", children: "Loading…" }) : s.length === 0 ? /* @__PURE__ */ e("p", { className: "mt-3 text-[12.5px] text-slate-400", children: "You're not in any owner groups — approvals never route to you automatically." }) : /* @__PURE__ */ e("div", { className: "mt-3 space-y-3", children: [...o.entries()].map(([c, u]) => /* @__PURE__ */ t("div", { children: [
|
|
1493
1512
|
/* @__PURE__ */ e("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: c }),
|
|
1494
1513
|
/* @__PURE__ */ t("ul", { className: "mt-1 space-y-0.5", children: [
|
|
1495
|
-
|
|
1514
|
+
u.slice(0, 40).map((n) => /* @__PURE__ */ t("li", { className: "text-[12.5px]", children: [
|
|
1496
1515
|
/* @__PURE__ */ e("span", { className: "font-medium", children: n.state_label }),
|
|
1497
1516
|
n.group_name && /* @__PURE__ */ t("span", { className: "text-slate-500 dark:text-muted-foreground", children: [
|
|
1498
1517
|
" ",
|
|
@@ -1502,28 +1521,28 @@ function dt() {
|
|
|
1502
1521
|
Array.isArray(n.filters) && n.filters.length > 0 && /* @__PURE__ */ e("span", { className: "ml-1.5 font-mono text-[10.5px] text-slate-400", children: n.filters.slice(0, 3).map((b) => `${b.field}=${String(b.value)}`).join(" · ") }),
|
|
1503
1522
|
(n.is_default === !0 || n.is_default === 1) && /* @__PURE__ */ e("span", { className: "ml-1.5 rounded bg-slate-100 px-1 py-px text-[9.5px] text-slate-500 dark:bg-muted", children: "default" })
|
|
1504
1523
|
] }, n.group_id)),
|
|
1505
|
-
|
|
1524
|
+
u.length > 40 && /* @__PURE__ */ t("li", { className: "text-[11.5px] text-slate-400", children: [
|
|
1506
1525
|
"…and ",
|
|
1507
|
-
|
|
1526
|
+
u.length - 40,
|
|
1508
1527
|
" more"
|
|
1509
1528
|
] })
|
|
1510
1529
|
] })
|
|
1511
1530
|
] }, c)) }))
|
|
1512
1531
|
] });
|
|
1513
1532
|
}
|
|
1514
|
-
function
|
|
1515
|
-
const i = T(),
|
|
1533
|
+
function ut() {
|
|
1534
|
+
const i = T(), m = E(), { data: a = [] } = q({
|
|
1516
1535
|
queryKey: ["my-reminders"],
|
|
1517
1536
|
queryFn: () => i.request(F("/reminders")).then((p) => p.data).catch(() => []),
|
|
1518
1537
|
staleTime: 3e4
|
|
1519
|
-
}), [s, l] = C(""), [o, c] = C(""),
|
|
1538
|
+
}), [s, l] = C(""), [o, c] = C(""), u = () => void m.invalidateQueries({ queryKey: ["my-reminders"] }), n = _({
|
|
1520
1539
|
mutationFn: () => i.request(ae("/reminders", { note: s, remind_at: new Date(o).toISOString() })),
|
|
1521
1540
|
onSuccess: () => {
|
|
1522
|
-
l(""), c(""),
|
|
1541
|
+
l(""), c(""), u();
|
|
1523
1542
|
}
|
|
1524
1543
|
}), b = _({
|
|
1525
1544
|
mutationFn: (p) => i.request(Ee(`/reminders/${p}`)),
|
|
1526
|
-
onSuccess:
|
|
1545
|
+
onSuccess: u
|
|
1527
1546
|
});
|
|
1528
1547
|
return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
1529
1548
|
/* @__PURE__ */ t("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
|
|
@@ -1589,26 +1608,26 @@ function ct() {
|
|
|
1589
1608
|
] });
|
|
1590
1609
|
}
|
|
1591
1610
|
function mt() {
|
|
1592
|
-
const i = T(), { data:
|
|
1611
|
+
const i = T(), { data: m } = q({
|
|
1593
1612
|
queryKey: ["my-stats"],
|
|
1594
1613
|
queryFn: () => i.request(F("/users/me/stats")).then((s) => s.data).catch(() => null),
|
|
1595
1614
|
staleTime: 5 * 6e4
|
|
1596
1615
|
});
|
|
1597
|
-
if (!
|
|
1598
|
-
const a = Math.max(1, ...
|
|
1616
|
+
if (!m) return null;
|
|
1617
|
+
const a = Math.max(1, ...m.weeks.map((s) => s.transitions + s.tasks_done + s.created));
|
|
1599
1618
|
return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
1600
1619
|
/* @__PURE__ */ t("header", { className: "flex items-center justify-between border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
|
|
1601
1620
|
/* @__PURE__ */ t("div", { children: [
|
|
1602
1621
|
/* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "My activity" }),
|
|
1603
1622
|
/* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Last 8 weeks — just yours." })
|
|
1604
1623
|
] }),
|
|
1605
|
-
|
|
1606
|
-
|
|
1624
|
+
m.streak_days > 1 && /* @__PURE__ */ t("span", { className: "rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[11px] font-medium text-nvr-navy dark:text-nvr-cyan", children: [
|
|
1625
|
+
m.streak_days,
|
|
1607
1626
|
"-day streak"
|
|
1608
1627
|
] })
|
|
1609
1628
|
] }),
|
|
1610
1629
|
/* @__PURE__ */ t("div", { className: "px-4 py-3", children: [
|
|
1611
|
-
/* @__PURE__ */ e("div", { className: "flex items-end gap-1.5", style: { height: 56 }, children:
|
|
1630
|
+
/* @__PURE__ */ e("div", { className: "flex items-end gap-1.5", style: { height: 56 }, children: m.weeks.map((s, l) => {
|
|
1612
1631
|
const o = s.transitions + s.tasks_done + s.created;
|
|
1613
1632
|
return /* @__PURE__ */ e(
|
|
1614
1633
|
"div",
|
|
@@ -1626,17 +1645,17 @@ function mt() {
|
|
|
1626
1645
|
] }),
|
|
1627
1646
|
/* @__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: [
|
|
1628
1647
|
/* @__PURE__ */ t("span", { children: [
|
|
1629
|
-
/* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children:
|
|
1648
|
+
/* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: m.totals.transitions }),
|
|
1630
1649
|
" ",
|
|
1631
1650
|
"transitions"
|
|
1632
1651
|
] }),
|
|
1633
1652
|
/* @__PURE__ */ t("span", { children: [
|
|
1634
|
-
/* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children:
|
|
1653
|
+
/* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: m.totals.tasks_done }),
|
|
1635
1654
|
" ",
|
|
1636
1655
|
"tasks done"
|
|
1637
1656
|
] }),
|
|
1638
1657
|
/* @__PURE__ */ t("span", { children: [
|
|
1639
|
-
/* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children:
|
|
1658
|
+
/* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: m.totals.created }),
|
|
1640
1659
|
" ",
|
|
1641
1660
|
"records created"
|
|
1642
1661
|
] })
|
|
@@ -1644,15 +1663,15 @@ function mt() {
|
|
|
1644
1663
|
] })
|
|
1645
1664
|
] });
|
|
1646
1665
|
}
|
|
1647
|
-
function
|
|
1648
|
-
const i = T(),
|
|
1666
|
+
function pt() {
|
|
1667
|
+
const i = T(), m = E(), { data: a } = q({
|
|
1649
1668
|
queryKey: ["my-security"],
|
|
1650
1669
|
queryFn: () => i.request(F("/security/my/sessions")).then((o) => o.data).catch(() => ({ sessions: [], logins: [] })),
|
|
1651
1670
|
staleTime: 3e4
|
|
1652
1671
|
}), s = _({
|
|
1653
1672
|
mutationFn: () => i.request(ae("/security/my/sessions/sign-out-others", {})).then((o) => o.data),
|
|
1654
1673
|
onSuccess: (o) => {
|
|
1655
|
-
|
|
1674
|
+
m.invalidateQueries({ queryKey: ["my-security"] }), l(`Signed out ${(o == null ? void 0 : o.revoked) ?? 0} other session(s)`);
|
|
1656
1675
|
}
|
|
1657
1676
|
}), l = (o) => {
|
|
1658
1677
|
try {
|
|
@@ -1716,11 +1735,11 @@ function ut() {
|
|
|
1716
1735
|
] })
|
|
1717
1736
|
] });
|
|
1718
1737
|
}
|
|
1719
|
-
function
|
|
1720
|
-
const i = T(), [
|
|
1738
|
+
function ht() {
|
|
1739
|
+
const i = T(), [m, a] = C(!1), { data: s } = q({
|
|
1721
1740
|
queryKey: ["my-permissions"],
|
|
1722
1741
|
queryFn: () => i.request(F("/security/my/permissions")).then((l) => l.data),
|
|
1723
|
-
enabled:
|
|
1742
|
+
enabled: m,
|
|
1724
1743
|
staleTime: 5 * 6e4
|
|
1725
1744
|
});
|
|
1726
1745
|
return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
@@ -1735,11 +1754,11 @@ function pt() {
|
|
|
1735
1754
|
/* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "What can I access?" }),
|
|
1736
1755
|
/* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Your role, collections, and data limits in plain language." })
|
|
1737
1756
|
] }),
|
|
1738
|
-
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children:
|
|
1757
|
+
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: m ? "Hide" : "Show" })
|
|
1739
1758
|
]
|
|
1740
1759
|
}
|
|
1741
1760
|
),
|
|
1742
|
-
|
|
1761
|
+
m && s && /* @__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: [
|
|
1743
1762
|
/* @__PURE__ */ t("p", { children: [
|
|
1744
1763
|
"Your role is ",
|
|
1745
1764
|
/* @__PURE__ */ e("b", { children: s.role ?? "unassigned" }),
|
|
@@ -1772,17 +1791,17 @@ function pt() {
|
|
|
1772
1791
|
] })
|
|
1773
1792
|
] });
|
|
1774
1793
|
}
|
|
1775
|
-
function
|
|
1776
|
-
const i = T(),
|
|
1794
|
+
function bt() {
|
|
1795
|
+
const i = T(), m = E(), { data: a } = q({
|
|
1777
1796
|
queryKey: ["nvr-profile-prefs"],
|
|
1778
|
-
queryFn: () => i.request(F("/users/me")).then((
|
|
1797
|
+
queryFn: () => i.request(F("/users/me")).then((u) => {
|
|
1779
1798
|
var n;
|
|
1780
|
-
return ((n =
|
|
1799
|
+
return ((n = u.data) == null ? void 0 : n.preferences) ?? {};
|
|
1781
1800
|
})
|
|
1782
1801
|
}), s = _({
|
|
1783
|
-
mutationFn: (
|
|
1784
|
-
onSuccess: (
|
|
1785
|
-
|
|
1802
|
+
mutationFn: (u) => i.request(V("/users/me/preferences", u)),
|
|
1803
|
+
onSuccess: (u, n) => {
|
|
1804
|
+
m.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), le(Object.keys(n)), import("sonner").then(
|
|
1786
1805
|
({ toast: b }) => b.success("Saved — applied on all your open tabs and devices")
|
|
1787
1806
|
);
|
|
1788
1807
|
}
|
|
@@ -1790,11 +1809,11 @@ function ht() {
|
|
|
1790
1809
|
queryKey: ["nvr-theme-accents"],
|
|
1791
1810
|
queryFn: () => i.request(
|
|
1792
1811
|
F("/settings")
|
|
1793
|
-
).then((
|
|
1812
|
+
).then((u) => {
|
|
1794
1813
|
var n, b;
|
|
1795
1814
|
return [
|
|
1796
|
-
{ ...se, color: ((n =
|
|
1797
|
-
...Ke((b =
|
|
1815
|
+
{ ...se, color: ((n = u.data) == null ? void 0 : n.project_color) ?? null },
|
|
1816
|
+
...Ke((b = u.data) == null ? void 0 : b.theme_accents)
|
|
1798
1817
|
];
|
|
1799
1818
|
}).catch(() => [se, ...he]),
|
|
1800
1819
|
staleTime: 5 * 6e4
|
|
@@ -1816,7 +1835,7 @@ function ht() {
|
|
|
1816
1835
|
M,
|
|
1817
1836
|
{
|
|
1818
1837
|
value: String((a == null ? void 0 : a.time_display) ?? "relative"),
|
|
1819
|
-
onChange: (
|
|
1838
|
+
onChange: (u) => s.mutate({ time_display: u }),
|
|
1820
1839
|
options: [
|
|
1821
1840
|
{ value: "relative", label: "Relative (3h ago)" },
|
|
1822
1841
|
{ value: "exact", label: "Exact (Aug 24, 3:12 PM)" }
|
|
@@ -1830,7 +1849,7 @@ function ht() {
|
|
|
1830
1849
|
{
|
|
1831
1850
|
type: "checkbox",
|
|
1832
1851
|
checked: l.compact === !0,
|
|
1833
|
-
onChange: (
|
|
1852
|
+
onChange: (u) => s.mutate({ number_format: { ...l, compact: u.target.checked } }),
|
|
1834
1853
|
className: "rounded"
|
|
1835
1854
|
}
|
|
1836
1855
|
),
|
|
@@ -1842,7 +1861,7 @@ function ht() {
|
|
|
1842
1861
|
"input",
|
|
1843
1862
|
{
|
|
1844
1863
|
defaultValue: l.locale ?? "",
|
|
1845
|
-
onBlur: (
|
|
1864
|
+
onBlur: (u) => s.mutate({ number_format: { ...l, locale: u.target.value.trim() || void 0 } }),
|
|
1846
1865
|
placeholder: "en-US",
|
|
1847
1866
|
className: "h-7 w-20 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
|
|
1848
1867
|
}
|
|
@@ -1854,7 +1873,7 @@ function ht() {
|
|
|
1854
1873
|
M,
|
|
1855
1874
|
{
|
|
1856
1875
|
value: String((a == null ? void 0 : a.week_start) ?? "sun"),
|
|
1857
|
-
onChange: (
|
|
1876
|
+
onChange: (u) => s.mutate({ week_start: u }),
|
|
1858
1877
|
options: [
|
|
1859
1878
|
{ value: "sun", label: "Sunday" },
|
|
1860
1879
|
{ value: "mon", label: "Monday" }
|
|
@@ -1864,24 +1883,24 @@ function ht() {
|
|
|
1864
1883
|
] }),
|
|
1865
1884
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", "data-theme-accent-picker": !0, children: [
|
|
1866
1885
|
"Accent",
|
|
1867
|
-
/* @__PURE__ */ e("span", { className: "flex items-center gap-1", children: o.map((
|
|
1868
|
-
const n =
|
|
1886
|
+
/* @__PURE__ */ e("span", { className: "flex items-center gap-1", children: o.map((u) => {
|
|
1887
|
+
const n = u.key === "brand" && c === "brand" || u.key === c;
|
|
1869
1888
|
return /* @__PURE__ */ e(
|
|
1870
1889
|
"button",
|
|
1871
1890
|
{
|
|
1872
1891
|
type: "button",
|
|
1873
|
-
title:
|
|
1874
|
-
"aria-label": `Accent ${
|
|
1892
|
+
title: u.label,
|
|
1893
|
+
"aria-label": `Accent ${u.label}`,
|
|
1875
1894
|
"aria-pressed": n,
|
|
1876
|
-
"data-theme-accent":
|
|
1877
|
-
onClick: () => s.mutate({ theme_accent:
|
|
1895
|
+
"data-theme-accent": u.key,
|
|
1896
|
+
onClick: () => s.mutate({ theme_accent: u.key === "brand" ? null : u.key }),
|
|
1878
1897
|
className: $(
|
|
1879
1898
|
"h-5 w-5 rounded-full border-2 transition-transform",
|
|
1880
1899
|
n ? "scale-110 border-slate-800 dark:border-slate-100" : "border-transparent hover:scale-105"
|
|
1881
1900
|
),
|
|
1882
|
-
style: { background:
|
|
1901
|
+
style: { background: u.color ?? "var(--nvr-cyan)" }
|
|
1883
1902
|
},
|
|
1884
|
-
|
|
1903
|
+
u.key
|
|
1885
1904
|
);
|
|
1886
1905
|
}) })
|
|
1887
1906
|
] }),
|
|
@@ -1891,7 +1910,7 @@ function ht() {
|
|
|
1891
1910
|
M,
|
|
1892
1911
|
{
|
|
1893
1912
|
value: String((a == null ? void 0 : a.font_size) ?? "default"),
|
|
1894
|
-
onChange: (
|
|
1913
|
+
onChange: (u) => s.mutate({ font_size: u }),
|
|
1895
1914
|
options: [
|
|
1896
1915
|
{ value: "small", label: "Small" },
|
|
1897
1916
|
{ value: "default", label: "Default" },
|
|
@@ -1907,10 +1926,10 @@ function ht() {
|
|
|
1907
1926
|
}
|
|
1908
1927
|
export {
|
|
1909
1928
|
Be as DelegationCard,
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1929
|
+
bt as DisplayPrefsCard,
|
|
1930
|
+
at as LinkAppCard,
|
|
1931
|
+
tt as NotificationRulesCard,
|
|
1932
|
+
et as ProfileFieldsCard,
|
|
1933
|
+
jt as ProfileView,
|
|
1934
|
+
rt as TimezoneCard
|
|
1916
1935
|
};
|