@nivaro/react 0.3.111 → 0.3.113
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 +207 -3
- package/dist/index.js +745 -728
- package/dist/shared/components/CollectionBrowserView.js +3133 -2954
- package/dist/shared/components/CollectionImportBanner.js +135 -0
- package/dist/shared/components/ItemEditForm.js +2235 -2218
- package/dist/shared/components/JobsTray.js +54 -47
- package/dist/shared/components/ViewAsPersonButton.js +109 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +228 -150
- package/dist/shared/components/bulk/BulkFieldUpdateButton.js +35 -41
- package/dist/shared/components/bulk/BulkLinksValue.js +91 -0
- package/dist/shared/components/bulk/bulk-field-options.js +20 -19
- package/dist/shared/components/bulk/bulk-update-preview.js +39 -0
- package/dist/shared/components/cbv/ColumnHeaderMenu.js +130 -0
- package/dist/shared/components/cbv/column-totals.js +163 -0
- package/dist/shared/components/collections-directory/CollectionHoverCard.js +108 -81
- package/dist/shared/components/collections-directory/CollectionRow.js +164 -148
- package/dist/shared/components/collections-directory/CollectionsDirectory.js +167 -166
- package/dist/shared/components/collections-directory/directory-data.js +70 -58
- package/dist/shared/components/imports/CollectionImportPanel.js +120 -118
- package/dist/shared/components/imports/DefinitionsPanel.js +24 -24
- package/dist/shared/components/imports/ImportDuplicatesNotice.js +65 -0
- package/dist/shared/components/item-edit/CatalogPickerField.js +631 -639
- package/dist/shared/components/item-edit/DuplicateNotice.js +168 -0
- package/dist/shared/components/item-edit/FieldRow.js +248 -246
- package/dist/shared/components/item-edit/InlineGridField.js +34 -33
- package/dist/shared/components/item-edit/InlineTableField.js +3002 -2825
- package/dist/shared/components/item-edit/MembershipSetField.js +165 -169
- package/dist/shared/components/item-edit/NestedRelationEditor.js +184 -189
- package/dist/shared/components/item-edit/PlanGrid.js +2 -1
- package/dist/shared/components/item-edit/QuickPickerDialog.js +35 -34
- package/dist/shared/components/item-edit/RecordLiveSync.js +32 -30
- package/dist/shared/components/item-edit/RelationCombobox.js +101 -100
- package/dist/shared/components/item-edit/RowHistorySheet.js +28 -27
- package/dist/shared/components/item-edit/SummaryPanel.js +133 -135
- package/dist/shared/components/item-edit/UserChip.js +262 -239
- package/dist/shared/components/item-edit/ViewAsRole.js +129 -52
- package/dist/shared/components/item-edit/grid-search.js +375 -0
- package/dist/shared/components/item-edit/render-stability.js +61 -54
- package/dist/shared/components/notifications/NotificationRulesEditor.js +25 -20
- package/dist/shared/components/ops-report/DigestSections.js +163 -144
- package/dist/shared/components/ops-report/drill.js +97 -97
- package/dist/shared/components/panels/AddendumLinesDiff.js +52 -51
- package/dist/shared/components/panels/AddendumPanel.js +92 -91
- package/dist/shared/components/panels/AsyncUserPicker.js +108 -0
- package/dist/shared/components/panels/CommentPanel.js +265 -252
- package/dist/shared/components/panels/OwnersSlot.js +47 -35
- package/dist/shared/components/panels/PipelineInsight.js +186 -0
- package/dist/shared/components/panels/PipelinePanel.js +1440 -1397
- package/dist/shared/components/panels/RecordIntegrityBanner.js +39 -38
- package/dist/shared/components/panels/RevisionsPanel.js +261 -260
- package/dist/shared/components/panels/StandInReason.js +69 -0
- package/dist/shared/components/pipeline/FieldPicker.js +41 -40
- package/dist/shared/components/pipeline/OwnerMatrix.js +829 -700
- package/dist/shared/components/pipeline/OwnerRecordTrial.js +362 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +483 -467
- package/dist/shared/components/pipeline/PipelineStateOwners.js +65 -64
- package/dist/shared/components/pipeline/owner-matrix-draft.js +178 -0
- package/dist/shared/components/profile/MyDefaultsCard.js +36 -35
- package/dist/shared/components/profile/PersonHeader.js +29 -29
- package/dist/shared/components/profile/PersonProfile.js +30 -28
- package/dist/shared/components/profile/SlowScreensCard.js +286 -0
- package/dist/shared/components/queue/QueueWorklist.js +1090 -1071
- package/dist/shared/components/quick-filters/useQuickFilterEditing.js +45 -44
- package/dist/shared/components/support/TicketDetailSheet.js +25 -16
- package/dist/shared/components/support/TicketSlowScreens.js +32 -0
- package/dist/shared/lib/activity-sentence.js +224 -178
- package/dist/shared/lib/collection-import-banner.js +27 -0
- package/dist/shared/lib/crash-report.js +112 -0
- package/dist/shared/lib/export-runs.js +99 -0
- package/dist/shared/lib/jobs-tray.js +89 -67
- package/dist/shared/lib/list-link.js +76 -69
- package/dist/shared/lib/nav-trail.js +180 -76
- package/dist/shared/lib/query-keys.js +26 -0
- package/dist/shared/lib/view-as.js +16 -11
- package/package.json +1 -1
|
@@ -1,162 +1,167 @@
|
|
|
1
1
|
import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery as _ } from "@tanstack/react-query";
|
|
3
|
-
import { UserCheck as
|
|
4
|
-
import
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import { useOptionalNivaroClient as
|
|
7
|
-
import { get as
|
|
8
|
-
import { userCardQuery as
|
|
3
|
+
import { UserCheck as z, Mail as W, Phone as H, Building2 as J, User as $, Clock as Z, MessageCircle as G, ExternalLink as V, RefreshCw as X, LogOut as Y } from "lucide-react";
|
|
4
|
+
import q, { useState as j, useRef as S, useEffect as E } from "react";
|
|
5
|
+
import { createPortal as I } from "react-dom";
|
|
6
|
+
import { useOptionalNivaroClient as T, useNavigation as A, useItemEditAuth as Q } from "../../context.js";
|
|
7
|
+
import { get as L, post as ee } from "../../lib/commands.js";
|
|
8
|
+
import { userCardQuery as D } from "../../lib/user-cards.js";
|
|
9
9
|
import { cn as P } from "../../lib/utils.js";
|
|
10
|
-
import { canOpenDm as
|
|
11
|
-
import { HuddlePresenceLine as
|
|
12
|
-
import { useHuddleLive as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
d
|
|
10
|
+
import { canOpenDm as te, openDmWith as ae } from "../chat/chat-core.js";
|
|
11
|
+
import { HuddlePresenceLine as ne } from "../chat/huddle/HuddleLiveBadge.js";
|
|
12
|
+
import { useHuddleLive as re } from "../chat/huddle/huddle-live.js";
|
|
13
|
+
import { standInIds as le, StandInMark as B, StandInReasonLines as se } from "../panels/StandInReason.js";
|
|
14
|
+
import { MailSuppressedPill as ie } from "../profile/MailSuppressedPill.js";
|
|
15
|
+
import { SignOutMessageInput as oe } from "../profile/SignOutMessageInput.js";
|
|
16
|
+
import { SIGN_OUT_ARM_MS as de, useReloadTheirTabs as ce, useSignOutEverywhere as me } from "../profile/session-actions.js";
|
|
17
|
+
import { useCardPresence as pe } from "../profile/usePersonPresence.js";
|
|
18
|
+
import { UserAvatar as M } from "../UserAvatar.js";
|
|
19
|
+
import { Popover as fe, PopoverTrigger as xe, PopoverContent as he } from "../ui/popover.js";
|
|
20
|
+
function F(e, a, s) {
|
|
21
|
+
const i = S(a);
|
|
22
|
+
i.current = a;
|
|
23
|
+
const d = S(s);
|
|
24
|
+
d.current = s, E(() => {
|
|
24
25
|
if (!e) return;
|
|
25
|
-
const
|
|
26
|
+
const c = (r) => {
|
|
26
27
|
const p = r.target;
|
|
27
|
-
p &&
|
|
28
|
+
p && i.current(p) || d.current();
|
|
28
29
|
}, m = () => d.current();
|
|
29
|
-
return document.addEventListener("pointerdown",
|
|
30
|
-
document.removeEventListener("pointerdown",
|
|
30
|
+
return document.addEventListener("pointerdown", c, !0), window.addEventListener("blur", m), () => {
|
|
31
|
+
document.removeEventListener("pointerdown", c, !0), window.removeEventListener("blur", m);
|
|
31
32
|
};
|
|
32
33
|
}, [e]);
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
const
|
|
36
|
-
return !
|
|
35
|
+
function be(e) {
|
|
36
|
+
const a = String(e ?? "").trim();
|
|
37
|
+
return !a || /^redacted\b/i.test(a) ? "" : a.split(/\s+/).map((s) => s[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
-
const
|
|
40
|
-
return
|
|
39
|
+
function ge(e, a) {
|
|
40
|
+
const s = String(e ?? "").trim();
|
|
41
|
+
return s || [a == null ? void 0 : a.first_name, a == null ? void 0 : a.last_name].filter(Boolean).join(" ").trim();
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
+
function ue({
|
|
43
44
|
user: e,
|
|
44
|
-
avatarCls:
|
|
45
|
+
avatarCls: a
|
|
45
46
|
}) {
|
|
46
|
-
const
|
|
47
|
-
...
|
|
48
|
-
enabled: !!
|
|
47
|
+
const s = T(), { data: i } = _({
|
|
48
|
+
...D(s, e.id),
|
|
49
|
+
enabled: !!s && !!e.id && !String(e.name ?? "").trim(),
|
|
49
50
|
staleTime: 30 * 6e4,
|
|
50
51
|
retry: !1
|
|
51
|
-
}), d =
|
|
52
|
+
}), d = ge(e.name, i), c = be(d), m = /^redacted\b/i.test(d);
|
|
52
53
|
return /* @__PURE__ */ t(
|
|
53
54
|
"span",
|
|
54
55
|
{
|
|
55
56
|
className: "inline-flex",
|
|
56
57
|
"data-tip": m ? "Former user (account redacted)" : d || void 0,
|
|
57
58
|
children: /* @__PURE__ */ t(
|
|
58
|
-
|
|
59
|
+
M,
|
|
59
60
|
{
|
|
60
61
|
userId: e.id,
|
|
61
62
|
className: "h-6 w-6 border-2 border-white dark:border-slate-900",
|
|
62
|
-
fallback: /* @__PURE__ */ t("span", { "data-copy-skip": !0, "aria-hidden": "true", className:
|
|
63
|
+
fallback: /* @__PURE__ */ t("span", { "data-copy-skip": !0, "aria-hidden": "true", className: a, children: c || /* @__PURE__ */ t($, { className: "h-3 w-3", "aria-hidden": !0 }) })
|
|
63
64
|
}
|
|
64
65
|
)
|
|
65
66
|
}
|
|
66
67
|
);
|
|
67
68
|
}
|
|
68
|
-
function
|
|
69
|
+
function we(e) {
|
|
69
70
|
if (e.length === 0) return null;
|
|
70
|
-
const
|
|
71
|
-
return { name:
|
|
71
|
+
const a = e.find((s) => !s.inactive) ?? e[0];
|
|
72
|
+
return { name: a.name, more: e.length - 1, mark: a.inactive ?? null };
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
+
function ve({
|
|
74
75
|
users: e,
|
|
75
|
-
showSingleName:
|
|
76
|
-
nameLabel:
|
|
76
|
+
showSingleName: a = !0,
|
|
77
|
+
nameLabel: s = !1,
|
|
78
|
+
standIn: i = null
|
|
77
79
|
}) {
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
var g;
|
|
82
|
-
h();
|
|
83
|
-
const f = (g = s.current) == null ? void 0 : g.getBoundingClientRect();
|
|
84
|
-
f && b({ x: f.left, y: f.bottom + 6 }), r((x) => x === "pin" ? "pin" : a);
|
|
85
|
-
}, c = () => {
|
|
86
|
-
h(), o.current = setTimeout(() => r((a) => a === "pin" ? a : null), 160);
|
|
87
|
-
};
|
|
88
|
-
if (R.useLayoutEffect(() => {
|
|
80
|
+
const d = S(null), c = S(null), m = S(null), [r, p] = j(null), [h, b] = j({ x: 0, y: 0 }), g = () => {
|
|
81
|
+
m.current && clearTimeout(m.current), m.current = null;
|
|
82
|
+
}, o = (n) => {
|
|
89
83
|
var u;
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
84
|
+
g();
|
|
85
|
+
const f = (u = d.current) == null ? void 0 : u.getBoundingClientRect();
|
|
86
|
+
f && b({ x: f.left, y: f.bottom + 6 }), p((y) => y === "pin" ? "pin" : n);
|
|
87
|
+
}, w = () => {
|
|
88
|
+
g(), m.current = setTimeout(() => p((n) => n === "pin" ? n : null), 160);
|
|
89
|
+
};
|
|
90
|
+
if (q.useLayoutEffect(() => {
|
|
91
|
+
var U;
|
|
92
|
+
if (!r) return;
|
|
93
|
+
const n = c.current;
|
|
94
|
+
if (!n) return;
|
|
95
|
+
const f = n.getBoundingClientRect();
|
|
96
|
+
let { x: u, y } = h;
|
|
97
|
+
if (f.right > window.innerWidth - 8 && (u = Math.max(8, window.innerWidth - f.width - 8)), f.bottom > window.innerHeight - 8) {
|
|
98
|
+
const O = (U = d.current) == null ? void 0 : U.getBoundingClientRect();
|
|
99
|
+
y = Math.max(8, ((O == null ? void 0 : O.top) ?? y) - f.height - 6);
|
|
98
100
|
}
|
|
99
|
-
(
|
|
100
|
-
}, [
|
|
101
|
-
!!
|
|
102
|
-
(
|
|
103
|
-
var f,
|
|
101
|
+
(u !== h.x || y !== h.y) && b({ x: u, y });
|
|
102
|
+
}, [r, h]), F(
|
|
103
|
+
!!r,
|
|
104
|
+
(n) => {
|
|
105
|
+
var f, u, y;
|
|
104
106
|
return (
|
|
105
107
|
// Clicks inside the user-card popover (portaled by Radix) keep the
|
|
106
108
|
// roster mounted — closing would unmount the card mid-click.
|
|
107
|
-
!!((f =
|
|
109
|
+
!!((f = n.closest) != null && f.call(n, "[data-radix-popper-content-wrapper]")) || !!((u = c.current) != null && u.contains(n)) || !!((y = d.current) != null && y.contains(n))
|
|
108
110
|
);
|
|
109
111
|
},
|
|
110
|
-
() =>
|
|
112
|
+
() => p(null)
|
|
111
113
|
), e.length === 0)
|
|
112
114
|
return /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", "data-roster-empty": !0, children: "—" });
|
|
113
|
-
const
|
|
115
|
+
const v = e.slice(0, 4), N = e.length - v.length, x = le(i), k = (n) => x.has(String(n).toUpperCase()), C = "flex h-6 w-6 items-center justify-center rounded-full border-2 border-white bg-[#c7f0fb] text-[10px] font-bold leading-none text-[#04516b] dark:border-slate-900 dark:bg-[#0c3b4a] dark:text-[#7dd8f2]";
|
|
114
116
|
return /* @__PURE__ */ l(
|
|
115
117
|
"span",
|
|
116
118
|
{
|
|
117
|
-
ref:
|
|
118
|
-
onMouseEnter: () =>
|
|
119
|
-
onMouseLeave:
|
|
120
|
-
onClick: (
|
|
121
|
-
|
|
119
|
+
ref: d,
|
|
120
|
+
onMouseEnter: () => o("hover"),
|
|
121
|
+
onMouseLeave: w,
|
|
122
|
+
onClick: (n) => {
|
|
123
|
+
n.stopPropagation(), o("pin");
|
|
122
124
|
},
|
|
123
125
|
className: "inline-flex cursor-pointer items-center",
|
|
124
126
|
children: [
|
|
125
|
-
/* @__PURE__ */ t("span", { className:
|
|
126
|
-
|
|
127
|
+
/* @__PURE__ */ t("span", { className: s ? "flex -space-x-1" : "flex -space-x-2", children: v.map((n) => /* @__PURE__ */ t(ue, { user: n, avatarCls: C }, n.id)) }),
|
|
128
|
+
N > 0 && /* @__PURE__ */ l("span", { className: "ml-1 rounded-full bg-slate-200 px-1.5 py-0.5 text-[10.5px] font-bold leading-none text-slate-600 dark:bg-slate-700 dark:text-slate-300", children: [
|
|
127
129
|
"+",
|
|
128
|
-
|
|
130
|
+
N
|
|
129
131
|
] }),
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
|
|
132
|
+
s ? (() => {
|
|
133
|
+
const n = we(e);
|
|
134
|
+
if (!n) return null;
|
|
135
|
+
const f = e.find((u) => !u.inactive) ?? e[0];
|
|
136
|
+
return /* @__PURE__ */ l(
|
|
133
137
|
"span",
|
|
134
138
|
{
|
|
135
139
|
"data-roster-label": "",
|
|
136
140
|
className: "ml-1.5 inline-flex max-w-[170px] items-baseline gap-1 text-[13px] font-semibold leading-tight text-slate-900 dark:text-slate-100",
|
|
137
141
|
children: [
|
|
138
|
-
/* @__PURE__ */ t("span", { className: "truncate", children:
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: n.name }),
|
|
143
|
+
n.mark && /* @__PURE__ */ t(R, { mark: n.mark }),
|
|
144
|
+
!n.mark && k(f.id) && /* @__PURE__ */ t(B, { className: "self-center" }),
|
|
145
|
+
n.more > 0 && /* @__PURE__ */ l("span", { className: "shrink-0 font-normal text-slate-500 dark:text-slate-400", children: [
|
|
141
146
|
"+",
|
|
142
|
-
|
|
147
|
+
n.more
|
|
143
148
|
] })
|
|
144
149
|
]
|
|
145
150
|
}
|
|
146
|
-
)
|
|
147
|
-
})() :
|
|
148
|
-
|
|
151
|
+
);
|
|
152
|
+
})() : a && e.length === 1 && /* @__PURE__ */ t("span", { className: "ml-1.5 max-w-[130px] truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: e[0].name }),
|
|
153
|
+
r && I(
|
|
149
154
|
/* @__PURE__ */ l(
|
|
150
155
|
"div",
|
|
151
156
|
{
|
|
152
|
-
ref:
|
|
153
|
-
style:
|
|
154
|
-
onMouseEnter:
|
|
155
|
-
onMouseLeave:
|
|
156
|
-
onMouseDown: (
|
|
157
|
-
|
|
157
|
+
ref: c,
|
|
158
|
+
style: ke(d.current, h),
|
|
159
|
+
onMouseEnter: g,
|
|
160
|
+
onMouseLeave: w,
|
|
161
|
+
onMouseDown: (n) => {
|
|
162
|
+
n.stopPropagation(), p("pin");
|
|
158
163
|
},
|
|
159
|
-
onClick: (
|
|
164
|
+
onClick: (n) => n.stopPropagation(),
|
|
160
165
|
className: "w-max min-w-[190px] max-w-[300px] rounded-lg border border-slate-200 bg-white py-1.5 shadow-xl dark:border-slate-600 dark:bg-slate-800",
|
|
161
166
|
children: [
|
|
162
167
|
/* @__PURE__ */ l("p", { className: "px-3 pb-1 text-[10px] font-bold uppercase tracking-wide text-slate-400", children: [
|
|
@@ -164,20 +169,29 @@ function xe({
|
|
|
164
169
|
" user",
|
|
165
170
|
e.length === 1 ? "" : "s"
|
|
166
171
|
] }),
|
|
167
|
-
e.map((
|
|
168
|
-
/* @__PURE__ */ t(
|
|
169
|
-
|
|
170
|
-
|
|
172
|
+
e.map((n) => /* @__PURE__ */ l("div", { className: "flex items-center gap-1.5 px-2 py-0.5", children: [
|
|
173
|
+
/* @__PURE__ */ t(Ce, { userId: n.id, size: "compact" }),
|
|
174
|
+
n.inactive && /* @__PURE__ */ t(R, { mark: n.inactive }),
|
|
175
|
+
!n.inactive && k(n.id) && /* @__PURE__ */ t(B, {})
|
|
176
|
+
] }, n.id)),
|
|
177
|
+
i && e.some((n) => k(n.id)) && /* @__PURE__ */ t(
|
|
178
|
+
se,
|
|
179
|
+
{
|
|
180
|
+
reason: i,
|
|
181
|
+
onNavigate: () => p(null),
|
|
182
|
+
className: "mx-3 mt-1.5 border-t border-slate-100 pt-1.5 pb-0.5 dark:border-slate-700"
|
|
183
|
+
}
|
|
184
|
+
)
|
|
171
185
|
]
|
|
172
186
|
}
|
|
173
187
|
),
|
|
174
|
-
|
|
188
|
+
K(d.current)
|
|
175
189
|
)
|
|
176
190
|
]
|
|
177
191
|
}
|
|
178
192
|
);
|
|
179
193
|
}
|
|
180
|
-
function
|
|
194
|
+
function R({ mark: e }) {
|
|
181
195
|
return /* @__PURE__ */ t(
|
|
182
196
|
"span",
|
|
183
197
|
{
|
|
@@ -187,104 +201,113 @@ function T({ mark: e }) {
|
|
|
187
201
|
}
|
|
188
202
|
);
|
|
189
203
|
}
|
|
190
|
-
function
|
|
204
|
+
function K(e) {
|
|
191
205
|
return (e == null ? void 0 : e.closest('[role="dialog"]')) ?? document.body;
|
|
192
206
|
}
|
|
193
|
-
function
|
|
194
|
-
const
|
|
195
|
-
if (
|
|
196
|
-
const
|
|
197
|
-
return { position: "absolute", left:
|
|
207
|
+
function ke(e, a) {
|
|
208
|
+
const s = K(e);
|
|
209
|
+
if (s === document.body) return { position: "fixed", left: a.x, top: a.y, zIndex: 50 };
|
|
210
|
+
const i = s.getBoundingClientRect();
|
|
211
|
+
return { position: "absolute", left: a.x - i.left, top: a.y - i.top, zIndex: 120 };
|
|
198
212
|
}
|
|
199
|
-
function
|
|
213
|
+
function He({
|
|
200
214
|
collection: e,
|
|
201
|
-
itemId:
|
|
215
|
+
itemId: a
|
|
202
216
|
}) {
|
|
203
|
-
|
|
204
|
-
|
|
217
|
+
var b;
|
|
218
|
+
const s = T(), {
|
|
219
|
+
data: i = [],
|
|
205
220
|
isLoading: d,
|
|
206
|
-
isFetching:
|
|
221
|
+
isFetching: c
|
|
207
222
|
} = _({
|
|
208
|
-
queryKey: ["pipeline-owners-resolved", e,
|
|
209
|
-
queryFn: () =>
|
|
210
|
-
var
|
|
211
|
-
return ((
|
|
223
|
+
queryKey: ["pipeline-owners-resolved", e, a],
|
|
224
|
+
queryFn: () => s.request(ee(`/pipelines/instance/${e}/owners/batch`, { ids: [a] })).then((g) => {
|
|
225
|
+
var o;
|
|
226
|
+
return ((o = g.data) == null ? void 0 : o[a]) ?? [];
|
|
212
227
|
}),
|
|
213
|
-
enabled: !!
|
|
228
|
+
enabled: !!s && !!e && !!a && a !== "new",
|
|
214
229
|
staleTime: 3e4,
|
|
215
230
|
// Keep this RECORD's last answer while a move re-asks (the tile used to go
|
|
216
231
|
// blank for ~2 s after Submit) — never another record's (b01-N15).
|
|
217
|
-
placeholderData: (
|
|
232
|
+
placeholderData: (g, o) => (o == null ? void 0 : o.queryKey[1]) === e && String(o == null ? void 0 : o.queryKey[2]) === String(a) ? g : void 0
|
|
233
|
+
}), { data: m } = _({
|
|
234
|
+
queryKey: ["pipeline-instance", e, a],
|
|
235
|
+
queryFn: () => s.request(L(`/pipelines/instance/${e}/${a}`)).then((g) => g.data ?? null),
|
|
236
|
+
enabled: !!s && !!e && !!a && a !== "new",
|
|
237
|
+
staleTime: 1e4
|
|
218
238
|
});
|
|
219
|
-
|
|
239
|
+
if (d || c && i.length === 0)
|
|
240
|
+
return /* @__PURE__ */ t("span", { className: "animate-pulse h-3 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] inline-block" });
|
|
241
|
+
const r = (m == null ? void 0 : m.stand_in_reason) ?? null, p = (b = m == null ? void 0 : m.instance) == null ? void 0 : b.current_state, h = r && (!p || String(p).toUpperCase() === r.state.id.toUpperCase()) ? r : null;
|
|
242
|
+
return /* @__PURE__ */ t(ve, { users: i, nameLabel: !0, standIn: h });
|
|
220
243
|
}
|
|
221
|
-
function
|
|
244
|
+
function Je({
|
|
222
245
|
collection: e,
|
|
223
|
-
itemId:
|
|
224
|
-
label:
|
|
246
|
+
itemId: a,
|
|
247
|
+
label: s
|
|
225
248
|
}) {
|
|
226
|
-
const
|
|
227
|
-
queryKey: ["pipeline-instance-owners", e,
|
|
228
|
-
queryFn: () =>
|
|
229
|
-
enabled: !!
|
|
249
|
+
const i = T(), { data: d = [] } = _({
|
|
250
|
+
queryKey: ["pipeline-instance-owners", e, a],
|
|
251
|
+
queryFn: () => i.request(L(`/pipelines/instance/${e}/${a}/owners`)).then((r) => r.data ?? []),
|
|
252
|
+
enabled: !!i && !!e && !!a && a !== "new",
|
|
230
253
|
staleTime: 3e4
|
|
231
|
-
}),
|
|
254
|
+
}), c = (r) => [r.first_name, r.last_name].filter(Boolean).join(" ") || r.email, m = (r) => c(r).split(" ").map((p) => p[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
232
255
|
return /* @__PURE__ */ l("div", { children: [
|
|
233
|
-
/* @__PURE__ */ t("p", { className: "text-[11px] font-medium text-slate-400 mb-1.5", children:
|
|
256
|
+
/* @__PURE__ */ t("p", { className: "text-[11px] font-medium text-slate-400 mb-1.5", children: s }),
|
|
234
257
|
d.length === 0 ? /* @__PURE__ */ t("p", { className: "text-[13px] text-slate-400", children: "—" }) : /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: d.map((r) => /* @__PURE__ */ l(
|
|
235
258
|
"div",
|
|
236
259
|
{
|
|
237
260
|
className: "flex items-center gap-1.5 rounded-full border border-slate-200 bg-slate-50 py-0.5 pl-0.5 pr-2.5",
|
|
238
261
|
children: [
|
|
239
262
|
/* @__PURE__ */ t(
|
|
240
|
-
|
|
263
|
+
M,
|
|
241
264
|
{
|
|
242
265
|
userId: r.id,
|
|
243
266
|
className: "h-6 w-6",
|
|
244
267
|
fallback: /* @__PURE__ */ t("span", { className: "flex h-6 w-6 items-center justify-center rounded-full bg-nvr-cyan/15 text-[10px] font-semibold text-nvr-navy dark:text-nvr-cyan", children: m(r) })
|
|
245
268
|
}
|
|
246
269
|
),
|
|
247
|
-
/* @__PURE__ */ t("span", { className: "text-[12px] text-slate-700", children:
|
|
270
|
+
/* @__PURE__ */ t("span", { className: "text-[12px] text-slate-700", children: c(r) })
|
|
248
271
|
]
|
|
249
272
|
},
|
|
250
273
|
r.id
|
|
251
274
|
)) })
|
|
252
275
|
] });
|
|
253
276
|
}
|
|
254
|
-
function
|
|
277
|
+
function ye({
|
|
255
278
|
user: e,
|
|
256
|
-
userId:
|
|
257
|
-
initials:
|
|
258
|
-
navigate:
|
|
279
|
+
userId: a,
|
|
280
|
+
initials: s,
|
|
281
|
+
navigate: i,
|
|
259
282
|
profileUrl: d,
|
|
260
|
-
online:
|
|
283
|
+
online: c,
|
|
261
284
|
cardId: m,
|
|
262
285
|
onAction: r,
|
|
263
286
|
open: p = !1
|
|
264
287
|
}) {
|
|
265
|
-
var
|
|
266
|
-
const { isAdmin:
|
|
267
|
-
const
|
|
268
|
-
if (!
|
|
288
|
+
var C;
|
|
289
|
+
const { isAdmin: h, userId: b } = Q(), g = !!b && b.toUpperCase() === a.toUpperCase(), o = pe(a, p), w = re().roomOf(a), v = ((C = e == null ? void 0 : e.manager_name) == null ? void 0 : C.trim()) || null, N = (() => {
|
|
290
|
+
const n = e == null ? void 0 : e.timezone;
|
|
291
|
+
if (!n) return null;
|
|
269
292
|
try {
|
|
270
|
-
const
|
|
271
|
-
return
|
|
293
|
+
const f = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
294
|
+
return n === f ? null : new Intl.DateTimeFormat(void 0, {
|
|
272
295
|
hour: "numeric",
|
|
273
296
|
minute: "2-digit",
|
|
274
|
-
timeZone:
|
|
297
|
+
timeZone: n
|
|
275
298
|
}).format(/* @__PURE__ */ new Date());
|
|
276
299
|
} catch {
|
|
277
300
|
return null;
|
|
278
301
|
}
|
|
279
|
-
})(),
|
|
280
|
-
const
|
|
281
|
-
if (
|
|
282
|
-
if (
|
|
283
|
-
const
|
|
284
|
-
return
|
|
302
|
+
})(), k = !!c || !!o.word ? o.word ? null : "Just now" : e != null && e.last_access ? (() => {
|
|
303
|
+
const n = Date.now() - new Date(e.last_access).getTime(), f = Math.floor(n / 6e4);
|
|
304
|
+
if (f < 2) return "Just now";
|
|
305
|
+
if (f < 60) return `${f}m ago`;
|
|
306
|
+
const u = Math.floor(f / 60);
|
|
307
|
+
return u < 24 ? `${u}h ago` : `${Math.floor(u / 24)}d ago`;
|
|
285
308
|
})() : null;
|
|
286
309
|
return /* @__PURE__ */ l(
|
|
287
|
-
|
|
310
|
+
he,
|
|
288
311
|
{
|
|
289
312
|
align: "start",
|
|
290
313
|
className: "w-72 p-0 overflow-hidden",
|
|
@@ -292,27 +315,27 @@ function ge({
|
|
|
292
315
|
children: [
|
|
293
316
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-3 p-4 bg-gradient-to-br from-nvr-cyan/8 to-nvr-cyan/4 dark:from-nvr-cyan/10 dark:to-transparent border-b border-slate-100 dark:border-border", children: [
|
|
294
317
|
/* @__PURE__ */ t(
|
|
295
|
-
|
|
318
|
+
M,
|
|
296
319
|
{
|
|
297
|
-
userId:
|
|
320
|
+
userId: a,
|
|
298
321
|
className: "h-12 w-12 ring-2 ring-white shadow-sm dark:ring-card",
|
|
299
|
-
fallback: /* @__PURE__ */ t("span", { className: "flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[15px] font-bold text-nvr-navy dark:text-nvr-cyan ring-2 ring-white dark:ring-card shadow-sm", children:
|
|
322
|
+
fallback: /* @__PURE__ */ t("span", { className: "flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[15px] font-bold text-nvr-navy dark:text-nvr-cyan ring-2 ring-white dark:ring-card shadow-sm", children: s })
|
|
300
323
|
}
|
|
301
324
|
),
|
|
302
325
|
/* @__PURE__ */ l("div", { className: "min-w-0 flex-1", children: [
|
|
303
326
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
|
|
304
|
-
(
|
|
327
|
+
(c || o.word) && /* @__PURE__ */ t(
|
|
305
328
|
"span",
|
|
306
329
|
{
|
|
307
|
-
"data-card-presence":
|
|
330
|
+
"data-card-presence": o.word ?? "online",
|
|
308
331
|
className: P(
|
|
309
332
|
"h-2 w-2 shrink-0 rounded-full ring-2 ring-white dark:ring-card",
|
|
310
|
-
|
|
333
|
+
o.word === "away" ? "bg-white ring-amber-400 dark:bg-card" : o.word === "idle" ? "bg-amber-400" : "bg-emerald-400"
|
|
311
334
|
),
|
|
312
|
-
title:
|
|
335
|
+
title: o.word === "away" ? "Away" : o.word === "idle" ? "Idle" : "Online"
|
|
313
336
|
}
|
|
314
337
|
),
|
|
315
|
-
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100 truncate", children: e ? [e.first_name, e.last_name].filter(Boolean).join(" ") || e.email :
|
|
338
|
+
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100 truncate", children: e ? [e.first_name, e.last_name].filter(Boolean).join(" ") || e.email : a }),
|
|
316
339
|
(e == null ? void 0 : e.status) && e.status !== "active" && /* @__PURE__ */ t(
|
|
317
340
|
"span",
|
|
318
341
|
{
|
|
@@ -322,32 +345,32 @@ function ge({
|
|
|
322
345
|
)
|
|
323
346
|
] }),
|
|
324
347
|
((e == null ? void 0 : e.title) || (e == null ? void 0 : e.department)) && /* @__PURE__ */ t("p", { className: "text-[11px] text-slate-500 dark:text-slate-400 truncate mt-0.5", children: [e.title, e.department].filter(Boolean).join(" · ") }),
|
|
325
|
-
|
|
348
|
+
o.word && /* @__PURE__ */ l(
|
|
326
349
|
"p",
|
|
327
350
|
{
|
|
328
351
|
className: "mt-0.5 truncate text-[11px] text-slate-500 dark:text-slate-400",
|
|
329
352
|
"data-card-presence-line": !0,
|
|
330
353
|
children: [
|
|
331
|
-
|
|
332
|
-
|
|
354
|
+
o.word === "away" ? "Away" : o.word === "idle" ? `Idle${o.minutes ? ` · ${o.minutes}m` : ""}` : "Online now",
|
|
355
|
+
o.page ? ` · on ${o.page}` : ""
|
|
333
356
|
]
|
|
334
357
|
}
|
|
335
358
|
),
|
|
336
|
-
/* @__PURE__ */ t(
|
|
359
|
+
/* @__PURE__ */ t(ne, { label: (w == null ? void 0 : w.label) ?? null, className: "mt-0.5" }),
|
|
337
360
|
N && /* @__PURE__ */ l("p", { className: "mt-0.5 text-[11px] text-slate-500 dark:text-slate-400", children: [
|
|
338
361
|
"Local time: ",
|
|
339
362
|
N
|
|
340
363
|
] }),
|
|
341
364
|
(e == null ? void 0 : e.is_out_of_office) && /* @__PURE__ */ l("span", { className: "mt-1 inline-flex items-center gap-1 rounded-full bg-amber-100 dark:bg-amber-900/30 px-1.5 py-px text-[10px] font-medium text-amber-700 dark:text-amber-400", children: [
|
|
342
|
-
/* @__PURE__ */ t(
|
|
365
|
+
/* @__PURE__ */ t(z, { className: "h-2.5 w-2.5" }),
|
|
343
366
|
" Out of office"
|
|
344
367
|
] }),
|
|
345
368
|
/* @__PURE__ */ t(
|
|
346
|
-
|
|
369
|
+
ie,
|
|
347
370
|
{
|
|
348
371
|
email: e == null ? void 0 : e.email,
|
|
349
372
|
enabled: p,
|
|
350
|
-
canClear:
|
|
373
|
+
canClear: h,
|
|
351
374
|
className: "mt-1"
|
|
352
375
|
}
|
|
353
376
|
)
|
|
@@ -360,7 +383,7 @@ function ge({
|
|
|
360
383
|
href: `mailto:${e.email}`,
|
|
361
384
|
className: "flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300 hover:text-nvr-navy dark:hover:text-nvr-cyan transition-colors truncate group",
|
|
362
385
|
children: [
|
|
363
|
-
/* @__PURE__ */ t(
|
|
386
|
+
/* @__PURE__ */ t(W, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 group-hover:text-nvr-cyan transition-colors" }),
|
|
364
387
|
/* @__PURE__ */ t("span", { className: "truncate", children: e.email })
|
|
365
388
|
]
|
|
366
389
|
}
|
|
@@ -371,30 +394,30 @@ function ge({
|
|
|
371
394
|
href: `tel:${e.phone}`,
|
|
372
395
|
className: "flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300 hover:text-nvr-navy dark:hover:text-nvr-cyan transition-colors group",
|
|
373
396
|
children: [
|
|
374
|
-
/* @__PURE__ */ t(
|
|
397
|
+
/* @__PURE__ */ t(H, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 group-hover:text-nvr-cyan transition-colors" }),
|
|
375
398
|
/* @__PURE__ */ t("span", { children: e.phone })
|
|
376
399
|
]
|
|
377
400
|
}
|
|
378
401
|
)
|
|
379
402
|
] }),
|
|
380
|
-
((e == null ? void 0 : e.role_name) || v ||
|
|
403
|
+
((e == null ? void 0 : e.role_name) || v || k) && /* @__PURE__ */ l("div", { className: "px-4 py-3 space-y-1.5 border-b border-slate-100 dark:border-border", children: [
|
|
381
404
|
(e == null ? void 0 : e.role_name) && /* @__PURE__ */ l("div", { className: "flex items-center gap-2 text-[11px] text-slate-500 dark:text-slate-400", children: [
|
|
382
|
-
/* @__PURE__ */ t(
|
|
405
|
+
/* @__PURE__ */ t(J, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
383
406
|
/* @__PURE__ */ t("span", { children: e.role_name })
|
|
384
407
|
] }),
|
|
385
408
|
v && /* @__PURE__ */ l("div", { className: "flex items-center gap-2 text-[11px] text-slate-500 dark:text-slate-400", children: [
|
|
386
|
-
/* @__PURE__ */ t(
|
|
409
|
+
/* @__PURE__ */ t($, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
387
410
|
/* @__PURE__ */ l("span", { children: [
|
|
388
411
|
"Reports to",
|
|
389
412
|
" ",
|
|
390
413
|
/* @__PURE__ */ t("span", { className: "font-medium text-slate-600 dark:text-slate-300", children: v })
|
|
391
414
|
] })
|
|
392
415
|
] }),
|
|
393
|
-
|
|
394
|
-
/* @__PURE__ */ t(
|
|
416
|
+
k && /* @__PURE__ */ l("div", { className: "flex items-center gap-2 text-[11px] text-slate-400", children: [
|
|
417
|
+
/* @__PURE__ */ t(Z, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
395
418
|
/* @__PURE__ */ l("span", { children: [
|
|
396
419
|
"Last seen ",
|
|
397
|
-
|
|
420
|
+
k
|
|
398
421
|
] })
|
|
399
422
|
] })
|
|
400
423
|
] }),
|
|
@@ -404,28 +427,28 @@ function ge({
|
|
|
404
427
|
{
|
|
405
428
|
type: "button",
|
|
406
429
|
onClick: () => {
|
|
407
|
-
r == null || r(),
|
|
430
|
+
r == null || r(), i(d);
|
|
408
431
|
},
|
|
409
432
|
className: "flex flex-1 items-center justify-center gap-1.5 whitespace-nowrap rounded-md px-2 py-1.5 text-[11px] font-medium text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-accent transition-colors",
|
|
410
433
|
children: [
|
|
411
|
-
/* @__PURE__ */ t(
|
|
434
|
+
/* @__PURE__ */ t($, { className: "h-3.5 w-3.5" }),
|
|
412
435
|
" View profile"
|
|
413
436
|
]
|
|
414
437
|
}
|
|
415
438
|
),
|
|
416
|
-
|
|
439
|
+
te() && /* @__PURE__ */ l(
|
|
417
440
|
"button",
|
|
418
441
|
{
|
|
419
442
|
type: "button",
|
|
420
443
|
onClick: () => {
|
|
421
|
-
r == null || r(),
|
|
422
|
-
|
|
444
|
+
r == null || r(), ae(
|
|
445
|
+
a,
|
|
423
446
|
e ? [e.first_name, e.last_name].filter(Boolean).join(" ") || e.email : void 0
|
|
424
447
|
);
|
|
425
448
|
},
|
|
426
449
|
className: "flex flex-1 items-center justify-center gap-1.5 whitespace-nowrap rounded-md px-2 py-1.5 text-[11px] font-medium text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-accent transition-colors",
|
|
427
450
|
children: [
|
|
428
|
-
/* @__PURE__ */ t(
|
|
451
|
+
/* @__PURE__ */ t(G, { className: "h-3.5 w-3.5" }),
|
|
429
452
|
" Message"
|
|
430
453
|
]
|
|
431
454
|
}
|
|
@@ -439,17 +462,17 @@ function ge({
|
|
|
439
462
|
},
|
|
440
463
|
className: "flex flex-1 items-center justify-center gap-1.5 whitespace-nowrap rounded-md px-2 py-1.5 text-[11px] font-medium text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-accent transition-colors",
|
|
441
464
|
children: [
|
|
442
|
-
/* @__PURE__ */ t(
|
|
465
|
+
/* @__PURE__ */ t(V, { className: "h-3.5 w-3.5" }),
|
|
443
466
|
" Email"
|
|
444
467
|
]
|
|
445
468
|
}
|
|
446
469
|
)
|
|
447
470
|
] }),
|
|
448
|
-
|
|
449
|
-
|
|
471
|
+
h && !g && /* @__PURE__ */ t(
|
|
472
|
+
Ne,
|
|
450
473
|
{
|
|
451
|
-
userId:
|
|
452
|
-
name: e ? [e.first_name, e.last_name].filter(Boolean).join(" ") || e.email :
|
|
474
|
+
userId: a,
|
|
475
|
+
name: e ? [e.first_name, e.last_name].filter(Boolean).join(" ") || e.email : a,
|
|
453
476
|
onDone: r
|
|
454
477
|
}
|
|
455
478
|
)
|
|
@@ -457,18 +480,18 @@ function ge({
|
|
|
457
480
|
}
|
|
458
481
|
);
|
|
459
482
|
}
|
|
460
|
-
function
|
|
483
|
+
function Ne({
|
|
461
484
|
userId: e,
|
|
462
|
-
name:
|
|
463
|
-
onDone:
|
|
485
|
+
name: a,
|
|
486
|
+
onDone: s
|
|
464
487
|
}) {
|
|
465
|
-
const [
|
|
466
|
-
|
|
467
|
-
if (!
|
|
468
|
-
const
|
|
469
|
-
return () => clearTimeout(
|
|
470
|
-
}, [
|
|
471
|
-
const r =
|
|
488
|
+
const [i, d] = j(!1), [c, m] = j("");
|
|
489
|
+
E(() => {
|
|
490
|
+
if (!i || c.trim()) return;
|
|
491
|
+
const g = setTimeout(() => d(!1), de);
|
|
492
|
+
return () => clearTimeout(g);
|
|
493
|
+
}, [i, c]);
|
|
494
|
+
const r = ce(e, { onDone: s }), p = me(e, a, { onDone: s }), h = () => p.mutate({ message: c }), b = "flex flex-1 items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-[11px] font-medium transition-colors disabled:opacity-50";
|
|
472
495
|
return /* @__PURE__ */ l("div", { className: "border-t border-slate-100 p-2 dark:border-border", "data-user-card-admin": !0, children: [
|
|
473
496
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-1", children: [
|
|
474
497
|
/* @__PURE__ */ l(
|
|
@@ -479,12 +502,12 @@ function be({
|
|
|
479
502
|
onClick: () => r.mutate({}),
|
|
480
503
|
"data-tip": "Every tab they have open shows a 15-second countdown, then reloads",
|
|
481
504
|
className: P(
|
|
482
|
-
|
|
505
|
+
b,
|
|
483
506
|
"text-amber-800 hover:bg-amber-50 dark:text-amber-300 dark:hover:bg-amber-500/10"
|
|
484
507
|
),
|
|
485
508
|
"data-user-card-reload": !0,
|
|
486
509
|
children: [
|
|
487
|
-
/* @__PURE__ */ t(
|
|
510
|
+
/* @__PURE__ */ t(X, { className: P("h-3.5 w-3.5", r.isPending && "animate-spin") }),
|
|
488
511
|
r.isPending ? "Sending…" : "Reload tabs"
|
|
489
512
|
]
|
|
490
513
|
}
|
|
@@ -494,64 +517,64 @@ function be({
|
|
|
494
517
|
{
|
|
495
518
|
type: "button",
|
|
496
519
|
disabled: p.isPending,
|
|
497
|
-
onClick: () =>
|
|
498
|
-
"data-tip":
|
|
520
|
+
onClick: () => i ? h() : d(!0),
|
|
521
|
+
"data-tip": i ? "Click again to sign them out of every session" : "Ends every session they have, on every app — they can sign in again",
|
|
499
522
|
className: P(
|
|
500
|
-
|
|
501
|
-
|
|
523
|
+
b,
|
|
524
|
+
i ? "bg-red-600 text-white hover:bg-red-700" : "text-amber-800 hover:bg-amber-50 dark:text-amber-300 dark:hover:bg-amber-500/10"
|
|
502
525
|
),
|
|
503
|
-
"data-user-card-sign-out":
|
|
526
|
+
"data-user-card-sign-out": i ? "armed" : "",
|
|
504
527
|
children: [
|
|
505
|
-
/* @__PURE__ */ t(
|
|
506
|
-
p.isPending ? "Signing out…" :
|
|
528
|
+
/* @__PURE__ */ t(Y, { className: "h-3.5 w-3.5" }),
|
|
529
|
+
p.isPending ? "Signing out…" : i ? "Confirm sign out" : "Sign out"
|
|
507
530
|
]
|
|
508
531
|
}
|
|
509
532
|
)
|
|
510
533
|
] }),
|
|
511
|
-
|
|
512
|
-
|
|
534
|
+
i && /* @__PURE__ */ t(
|
|
535
|
+
oe,
|
|
513
536
|
{
|
|
514
|
-
value:
|
|
537
|
+
value: c,
|
|
515
538
|
onChange: m,
|
|
516
|
-
onSubmit:
|
|
539
|
+
onSubmit: h,
|
|
517
540
|
className: "mt-2"
|
|
518
541
|
}
|
|
519
542
|
)
|
|
520
543
|
] });
|
|
521
544
|
}
|
|
522
|
-
function
|
|
545
|
+
function Ce({
|
|
523
546
|
userId: e,
|
|
524
|
-
size:
|
|
525
|
-
children:
|
|
547
|
+
size: a = "default",
|
|
548
|
+
children: s
|
|
526
549
|
}) {
|
|
527
|
-
const
|
|
528
|
-
|
|
550
|
+
const i = T(), { navigate: d, userUrl: c } = A(), m = c ? c(e) : `/users/${e}`, [r, p] = j(!1), h = q.useId();
|
|
551
|
+
F(
|
|
529
552
|
r,
|
|
530
|
-
(
|
|
531
|
-
var
|
|
532
|
-
return !!((
|
|
533
|
-
!!((
|
|
553
|
+
(x) => {
|
|
554
|
+
var k, C, n, f;
|
|
555
|
+
return !!((k = x.closest) != null && k.call(x, `[data-nvr-user-card="${CSS.escape(h)}"]`)) || !!((C = x.closest) != null && C.call(x, `[data-nvr-user-chip="${CSS.escape(h)}"]`)) || // Anything else floating above the card (a tooltip, a nested menu).
|
|
556
|
+
!!((n = x.closest) != null && n.call(x, "[data-radix-popper-content-wrapper]")) && !((f = x.closest) != null && f.call(x, "[data-nvr-user-card]"));
|
|
534
557
|
},
|
|
535
558
|
() => p(!1)
|
|
536
559
|
);
|
|
537
|
-
const { data:
|
|
538
|
-
...
|
|
539
|
-
enabled: !!
|
|
560
|
+
const { data: b, isLoading: g } = _({
|
|
561
|
+
...D(i, e),
|
|
562
|
+
enabled: !!i && !!e,
|
|
540
563
|
staleTime: 12e4
|
|
541
|
-
}), { data:
|
|
564
|
+
}), { data: o } = _({
|
|
542
565
|
queryKey: ["user-presence", e],
|
|
543
|
-
queryFn: () =>
|
|
544
|
-
enabled: !!
|
|
566
|
+
queryFn: () => i.request(L(`/presence/users/${e}`)).then((x) => x),
|
|
567
|
+
enabled: !!i && !!e && r,
|
|
545
568
|
staleTime: 15e3,
|
|
546
569
|
refetchInterval: r ? 2e4 : !1
|
|
547
|
-
}), w =
|
|
548
|
-
return
|
|
570
|
+
}), w = b ? [b.first_name, b.last_name].filter(Boolean).join(" ") || b.email : e, v = w.split(" ").map((x) => x[0]).filter(Boolean).slice(0, 2).join("").toUpperCase(), N = (o == null ? void 0 : o.online) ?? !1;
|
|
571
|
+
return g && !s ? a === "compact" ? /* @__PURE__ */ t("span", { className: "animate-pulse inline-block h-3.5 w-16 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : /* @__PURE__ */ l("span", { className: "inline-flex items-center gap-1.5 rounded-full border border-slate-200 bg-slate-50 py-0.5 pl-0.5 pr-2.5", children: [
|
|
549
572
|
/* @__PURE__ */ t("span", { className: "flex h-6 w-6 shrink-0 rounded-full animate-pulse bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
550
573
|
/* @__PURE__ */ t("span", { className: "animate-pulse h-2.5 w-16 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] inline-block" })
|
|
551
|
-
] }) : /* @__PURE__ */ l(
|
|
552
|
-
/* @__PURE__ */ t(
|
|
574
|
+
] }) : /* @__PURE__ */ l(fe, { open: r, onOpenChange: p, children: [
|
|
575
|
+
/* @__PURE__ */ t(xe, { asChild: !0, "data-nvr-user-chip": h, children: s || (a === "compact" ? /* @__PURE__ */ l("span", { className: "inline-flex cursor-pointer items-center gap-1 rounded-full bg-slate-100 dark:bg-slate-800 py-px pl-px pr-1.5 hover:bg-slate-200 dark:hover:bg-slate-700 transition-colors", children: [
|
|
553
576
|
/* @__PURE__ */ t(
|
|
554
|
-
|
|
577
|
+
M,
|
|
555
578
|
{
|
|
556
579
|
userId: e,
|
|
557
580
|
className: "h-4 w-4",
|
|
@@ -569,7 +592,7 @@ function ue({
|
|
|
569
592
|
/* @__PURE__ */ t("span", { className: "text-[11px] font-medium text-slate-600 dark:text-slate-300", children: w })
|
|
570
593
|
] }) : /* @__PURE__ */ l("div", { className: "inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-slate-200 bg-slate-50 py-0.5 pl-0.5 pr-2.5 hover:bg-slate-100 dark:border-border dark:bg-card dark:hover:bg-accent transition-colors", children: [
|
|
571
594
|
/* @__PURE__ */ t(
|
|
572
|
-
|
|
595
|
+
M,
|
|
573
596
|
{
|
|
574
597
|
userId: e,
|
|
575
598
|
className: "h-6 w-6",
|
|
@@ -587,15 +610,15 @@ function ue({
|
|
|
587
610
|
/* @__PURE__ */ t("span", { className: "text-[12px] text-slate-700 dark:text-slate-300", children: w })
|
|
588
611
|
] })) }),
|
|
589
612
|
/* @__PURE__ */ t(
|
|
590
|
-
|
|
613
|
+
ye,
|
|
591
614
|
{
|
|
592
|
-
user:
|
|
615
|
+
user: b,
|
|
593
616
|
userId: e,
|
|
594
617
|
initials: v,
|
|
595
618
|
navigate: d,
|
|
596
619
|
profileUrl: m,
|
|
597
620
|
online: N,
|
|
598
|
-
cardId:
|
|
621
|
+
cardId: h,
|
|
599
622
|
onAction: () => p(!1),
|
|
600
623
|
open: r
|
|
601
624
|
}
|
|
@@ -603,12 +626,12 @@ function ue({
|
|
|
603
626
|
] });
|
|
604
627
|
}
|
|
605
628
|
export {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
629
|
+
Je as OwnersInline,
|
|
630
|
+
He as OwnersInlineCompact,
|
|
631
|
+
Ne as UserCardAdminRow,
|
|
632
|
+
Ce as UserChip,
|
|
633
|
+
ve as UserRosterCluster,
|
|
634
|
+
be as rosterInitials,
|
|
635
|
+
we as rosterLabel,
|
|
636
|
+
ge as rosterName
|
|
614
637
|
};
|