@nivaro/react 0.3.62 → 0.3.64

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.
@@ -1,318 +1,347 @@
1
- import { jsxs as a, jsx as e, Fragment as H } from "react/jsx-runtime";
2
- import { useQueryClient as ne, useQuery as B } from "@tanstack/react-query";
3
- import { RotateCw as se, Search as le, UserX as oe, ChevronDown as V, ChevronRight as X } from "lucide-react";
4
- import { useState as f, useMemo as A, useCallback as de } from "react";
5
- import { useNivaroClient as z, useNavigation as G, useItemNavigation as J } from "../../context.js";
6
- import { get as I, post as Y } from "../../lib/commands.js";
7
- import { userErrorMessage as K } from "../../lib/safe-error.js";
8
- import { cn as E, formatRelative as ie } from "../../lib/utils.js";
9
- import { UserAvatar as ce } from "../UserAvatar.js";
10
- const T = {
1
+ import { jsxs as r, jsx as e, Fragment as J } from "react/jsx-runtime";
2
+ import { useQueryClient as de, useQuery as M } from "@tanstack/react-query";
3
+ import { RotateCw as ie, Search as ce, UserX as ue, ChevronDown as Y, ChevronRight as Z } from "lucide-react";
4
+ import { useState as x, useEffect as me, useMemo as U, useCallback as xe } from "react";
5
+ import { useNivaroClient as F, useNavigation as ee, useItemNavigation as te } from "../../context.js";
6
+ import { get as Q, post as ae } from "../../lib/commands.js";
7
+ import { userErrorMessage as D } from "../../lib/safe-error.js";
8
+ import { cn as A, formatRelative as pe } from "../../lib/utils.js";
9
+ import { UserAvatar as he } from "../UserAvatar.js";
10
+ const K = {
11
11
  suspended: "Suspended",
12
12
  redacted: "Redacted",
13
13
  anonymised: "Anonymised",
14
14
  placeholder: "Placeholder"
15
- }, Z = {
15
+ }, re = {
16
16
  suspended: "The account is suspended — the person cannot sign in or act.",
17
17
  redacted: "Personal details were removed by a retention policy.",
18
18
  anonymised: "Details were overwritten by the nightly anonymisation of departed people.",
19
19
  placeholder: "Stands in for a legacy account that no longer exists."
20
- }, ue = {
20
+ }, fe = {
21
21
  suspended: "bg-[#fef3c7] text-[#92400e] dark:bg-[#3a2a12] dark:text-[#f5c97a]",
22
22
  redacted: "bg-[#ffe4e6] text-[#9f1239] dark:bg-[#3d1a20] dark:text-[#f4a3ad]",
23
23
  anonymised: "bg-[#ffe4e6] text-[#9f1239] dark:bg-[#3d1a20] dark:text-[#f4a3ad]",
24
24
  placeholder: "bg-[#e2e8f0] text-[#334155] dark:bg-[#2c3038] dark:text-[#cbd5e1]"
25
- }, g = (l) => l.toLocaleString();
26
- function Ce({ className: l }) {
27
- var Q;
28
- const n = z(), o = ne(), [b, C] = f(!0), [v, d] = f(!1), [u, y] = f(!1), [i, x] = f(!0), [p, $] = f(null), [h, S] = f(""), [_, O] = f(null), [q, j] = f(0), c = B({
29
- queryKey: ["inactive-user-links", q],
30
- queryFn: () => n.request(I(`/inactive-user-links${q ? "?fresh=1" : ""}`)).then((t) => t.data),
25
+ }, b = (l) => l.toLocaleString();
26
+ function qe({
27
+ className: l,
28
+ focusUserId: s,
29
+ onClearFocus: o
30
+ }) {
31
+ var V;
32
+ const y = F(), N = de(), [p, d] = x(!0), [u, k] = x(!1), [i, m] = x(!1), [g, w] = x(!0), [c, C] = x(null), [q, j] = x(""), [_, O] = x(s ?? null), [$, L] = x(s ?? null);
33
+ me(() => {
34
+ L(s ?? null), s && O(s);
35
+ }, [s]);
36
+ const [n, h] = x(0), a = M({
37
+ queryKey: ["inactive-user-links", n],
38
+ queryFn: () => y.request(Q(`/inactive-user-links${n ? "?fresh=1" : ""}`)).then((t) => t.data),
31
39
  staleTime: 6e4
32
- }), N = A(
40
+ }), f = U(
33
41
  () => {
34
42
  var t;
35
- return new Map((((t = c.data) == null ? void 0 : t.sources) ?? []).map((R) => [R.key, R]));
43
+ return new Map((((t = a.data) == null ? void 0 : t.sources) ?? []).map((S) => [S.key, S]));
36
44
  },
37
- [c.data]
38
- ), r = de(
39
- (t) => !(!t || t.role === "audit" && !v || t.role === "own" && !u || t.role === "seat" && !i || b && t.scope !== "open" && t.role !== "seat"),
40
- [b, v, u, i]
41
- ), m = A(() => {
42
- var R;
43
- const t = h.trim().toLowerCase();
44
- return (((R = c.data) == null ? void 0 : R.users) ?? []).map((w) => {
45
- const P = w.links.filter((L) => r(N.get(L.source))).sort(
46
- (L, U) => {
47
- var D, W;
48
- return +(((D = N.get(L.source)) == null ? void 0 : D.role) === "seat") - +(((W = N.get(U.source)) == null ? void 0 : W.role) === "seat") || U.count - L.count;
45
+ [a.data]
46
+ ), W = xe(
47
+ (t) => !(!t || t.role === "audit" && !u || t.role === "own" && !i || t.role === "seat" && !g || p && t.scope !== "open" && t.role !== "seat"),
48
+ [p, u, i, g]
49
+ ), z = U(() => {
50
+ var S;
51
+ const t = q.trim().toLowerCase();
52
+ return (((S = a.data) == null ? void 0 : S.users) ?? []).map((v) => {
53
+ const P = v.links.filter((R) => W(f.get(R.source))).sort(
54
+ (R, T) => {
55
+ var X, G;
56
+ return +(((X = f.get(R.source)) == null ? void 0 : X.role) === "seat") - +(((G = f.get(T.source)) == null ? void 0 : G.role) === "seat") || T.count - R.count;
49
57
  }
50
58
  );
51
- return { ...w, links: P, total: P.reduce((L, U) => L + U.count, 0) };
52
- }).filter((w) => w.total > 0).filter(
53
- (w) => !t || `${w.user.name} ${w.user.email ?? ""}`.toLowerCase().includes(t)
54
- ).sort((w, P) => P.total - w.total);
55
- }, [c.data, N, h, r]), s = A(() => {
59
+ return { ...v, links: P, total: P.reduce((R, T) => R + T.count, 0) };
60
+ }).filter((v) => v.total > 0).filter((v) => !$ || v.user.id.toUpperCase() === $.toUpperCase()).filter(
61
+ (v) => !t || `${v.user.name} ${v.user.email ?? ""}`.toLowerCase().includes(t)
62
+ ).sort((v, P) => P.total - v.total);
63
+ }, [a.data, f, q, W, $]), H = U(() => {
56
64
  const t = { suspended: 0, redacted: 0, anonymised: 0, placeholder: 0 };
57
- for (const R of m) t[R.user.reason]++;
65
+ for (const S of z) t[S.user.reason]++;
58
66
  return t;
59
- }, [m]), k = p ? m.filter((t) => t.user.reason === p) : m, M = A(() => {
60
- var w;
61
- let t = 0, R = 0;
62
- for (const P of k)
63
- for (const L of P.links)
64
- ((w = N.get(L.source)) == null ? void 0 : w.role) === "seat" ? R += L.count : t += L.count;
65
- return { records: t, seats: R };
66
- }, [k, N]), ae = () => {
67
- j((t) => t + 1), O(null);
68
- }, re = () => {
69
- o.invalidateQueries({ queryKey: ["inactive-user-links"] }), o.invalidateQueries({ queryKey: ["inactive-user-records"] });
67
+ }, [z]), E = c ? z.filter((t) => t.user.reason === c) : z, I = U(() => {
68
+ var v;
69
+ let t = 0, S = 0;
70
+ for (const P of E)
71
+ for (const R of P.links)
72
+ ((v = f.get(R.source)) == null ? void 0 : v.role) === "seat" ? S += R.count : t += R.count;
73
+ return { records: t, seats: S };
74
+ }, [E, f]), le = () => {
75
+ h((t) => t + 1), O(null);
76
+ }, oe = () => {
77
+ N.invalidateQueries({ queryKey: ["inactive-user-links"] }), N.invalidateQueries({ queryKey: ["inactive-user-records"] });
70
78
  };
71
- return /* @__PURE__ */ a("div", { className: E("flex min-h-0 flex-1 flex-col gap-4 p-6", l), "data-inactive-links": !0, children: [
72
- /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-x-5 gap-y-3", children: [
73
- /* @__PURE__ */ a("dl", { className: "flex items-baseline gap-5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
74
- /* @__PURE__ */ a("div", { className: "flex items-baseline gap-1.5", children: [
79
+ return /* @__PURE__ */ r("div", { className: A("flex min-h-0 flex-1 flex-col gap-4 p-6", l), "data-inactive-links": !0, children: [
80
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-x-5 gap-y-3", children: [
81
+ /* @__PURE__ */ r("dl", { className: "flex items-baseline gap-5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
82
+ /* @__PURE__ */ r("div", { className: "flex items-baseline gap-1.5", children: [
75
83
  /* @__PURE__ */ e(
76
84
  "dd",
77
85
  {
78
86
  className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground",
79
87
  "data-inactive-people": !0,
80
- children: c.isLoading ? "—" : g(k.length)
88
+ children: a.isLoading ? "—" : b(E.length)
81
89
  }
82
90
  ),
83
- /* @__PURE__ */ e("dt", { children: k.length === 1 ? "person" : "people" })
91
+ /* @__PURE__ */ e("dt", { children: E.length === 1 ? "person" : "people" })
84
92
  ] }),
85
- /* @__PURE__ */ a("div", { className: "flex items-baseline gap-1.5", children: [
86
- /* @__PURE__ */ e("dd", { className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: c.isLoading ? "—" : g(M.records) }),
87
- /* @__PURE__ */ e("dt", { children: b ? "links on open records" : "record links" })
93
+ /* @__PURE__ */ r("div", { className: "flex items-baseline gap-1.5", children: [
94
+ /* @__PURE__ */ e("dd", { className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: a.isLoading ? "—" : b(I.records) }),
95
+ /* @__PURE__ */ e("dt", { children: p ? "links on open records" : "record links" })
88
96
  ] }),
89
- /* @__PURE__ */ a("div", { className: "flex items-baseline gap-1.5", children: [
90
- /* @__PURE__ */ e("dd", { className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: c.isLoading ? "—" : g(M.seats) }),
97
+ /* @__PURE__ */ r("div", { className: "flex items-baseline gap-1.5", children: [
98
+ /* @__PURE__ */ e("dd", { className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: a.isLoading ? "—" : b(I.seats) }),
91
99
  /* @__PURE__ */ e("dt", { children: "owner seats and team places" })
92
100
  ] })
93
101
  ] }),
94
- /* @__PURE__ */ a(
102
+ /* @__PURE__ */ r(
95
103
  "button",
96
104
  {
97
105
  type: "button",
98
- onClick: ae,
99
- disabled: c.isFetching,
106
+ onClick: le,
107
+ disabled: a.isFetching,
100
108
  className: "ml-auto inline-flex h-8 items-center gap-1.5 rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-600 hover:border-slate-300 hover:text-slate-900 disabled:opacity-60 dark:border-border dark:text-muted-foreground dark:hover:text-foreground",
101
109
  "data-inactive-rescan": !0,
102
110
  children: [
103
- /* @__PURE__ */ e(se, { className: E("h-3.5 w-3.5", c.isFetching && "animate-spin") }),
111
+ /* @__PURE__ */ e(ie, { className: A("h-3.5 w-3.5", a.isFetching && "animate-spin") }),
104
112
  "Scan again"
105
113
  ]
106
114
  }
107
115
  )
108
116
  ] }),
109
- /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
110
- /* @__PURE__ */ a("label", { className: "relative", children: [
111
- /* @__PURE__ */ e(le, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
117
+ $ && /* @__PURE__ */ r(
118
+ "p",
119
+ {
120
+ className: "flex flex-wrap items-center gap-2 text-[12px] text-slate-600 dark:text-muted-foreground",
121
+ "data-inactive-focus": !0,
122
+ children: [
123
+ "Showing one person.",
124
+ /* @__PURE__ */ e(
125
+ "button",
126
+ {
127
+ type: "button",
128
+ onClick: () => {
129
+ L(null), o == null || o();
130
+ },
131
+ className: "font-medium text-slate-800 underline underline-offset-2 dark:text-foreground",
132
+ children: "Show everyone"
133
+ }
134
+ )
135
+ ]
136
+ }
137
+ ),
138
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2", children: [
139
+ /* @__PURE__ */ r("label", { className: "relative", children: [
140
+ /* @__PURE__ */ e(ce, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
112
141
  /* @__PURE__ */ e(
113
142
  "input",
114
143
  {
115
- value: h,
116
- onChange: (t) => S(t.target.value),
144
+ value: q,
145
+ onChange: (t) => j(t.target.value),
117
146
  placeholder: "Find a person",
118
147
  className: "h-8 w-56 rounded-md border border-slate-200 bg-background pl-7 pr-2 text-[12.5px] text-slate-800 placeholder:text-slate-500 focus:border-slate-400 focus:outline-none dark:border-border dark:text-foreground dark:placeholder:text-muted-foreground",
119
148
  "data-inactive-search": !0
120
149
  }
121
150
  )
122
151
  ] }),
123
- /* @__PURE__ */ e("span", { className: "flex flex-wrap items-center gap-1", children: Object.keys(T).map(
124
- (t) => s[t] || p === t ? /* @__PURE__ */ a(
152
+ /* @__PURE__ */ e("span", { className: "flex flex-wrap items-center gap-1", children: Object.keys(K).map(
153
+ (t) => H[t] || c === t ? /* @__PURE__ */ r(
125
154
  "button",
126
155
  {
127
156
  type: "button",
128
- "aria-pressed": p === t,
129
- onClick: () => $(p === t ? null : t),
130
- "data-tip": Z[t],
157
+ "aria-pressed": c === t,
158
+ onClick: () => C(c === t ? null : t),
159
+ "data-tip": re[t],
131
160
  "data-inactive-reason": t,
132
- className: E(
161
+ className: A(
133
162
  "h-7 rounded-md border px-2 text-[11.5px] font-medium transition-colors",
134
- p === t ? "border-slate-400 bg-slate-100 text-slate-900 dark:border-border dark:bg-muted dark:text-foreground" : "border-slate-200 text-slate-600 hover:border-slate-300 dark:border-border dark:text-muted-foreground"
163
+ c === t ? "border-slate-400 bg-slate-100 text-slate-900 dark:border-border dark:bg-muted dark:text-foreground" : "border-slate-200 text-slate-600 hover:border-slate-300 dark:border-border dark:text-muted-foreground"
135
164
  ),
136
165
  children: [
137
- T[t],
166
+ K[t],
138
167
  " ",
139
- /* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: g(s[t]) })
168
+ /* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: b(H[t]) })
140
169
  ]
141
170
  },
142
171
  t
143
172
  ) : null
144
173
  ) }),
145
- /* @__PURE__ */ a("span", { className: "ml-auto flex flex-wrap items-center gap-x-4 gap-y-1", children: [
174
+ /* @__PURE__ */ r("span", { className: "ml-auto flex flex-wrap items-center gap-x-4 gap-y-1", children: [
146
175
  /* @__PURE__ */ e(
147
- F,
176
+ B,
148
177
  {
149
178
  label: "Only records in an open workflow",
150
- checked: b,
151
- onChange: C,
179
+ checked: p,
180
+ onChange: d,
152
181
  hook: "open"
153
182
  }
154
183
  ),
155
184
  /* @__PURE__ */ e(
156
- F,
185
+ B,
157
186
  {
158
187
  label: "Owner seats and team places",
159
- checked: i,
160
- onChange: x,
188
+ checked: g,
189
+ onChange: w,
161
190
  hook: "seats"
162
191
  }
163
192
  ),
164
193
  /* @__PURE__ */ e(
165
- F,
194
+ B,
166
195
  {
167
196
  label: "Created by / updated by",
168
- checked: v,
169
- onChange: d,
197
+ checked: u,
198
+ onChange: k,
170
199
  hook: "audit"
171
200
  }
172
201
  ),
173
202
  /* @__PURE__ */ e(
174
- F,
203
+ B,
175
204
  {
176
205
  label: "The person's own saved sets",
177
- checked: u,
178
- onChange: y,
206
+ checked: i,
207
+ onChange: m,
179
208
  hook: "own"
180
209
  }
181
210
  )
182
211
  ] })
183
212
  ] }),
184
- (Q = c.data) != null && Q.failed.length ? /* @__PURE__ */ a("p", { className: "text-[11.5px] text-amber-700 dark:text-amber-300", children: [
185
- c.data.failed.length,
213
+ (V = a.data) != null && V.failed.length ? /* @__PURE__ */ r("p", { className: "text-[11.5px] text-amber-700 dark:text-amber-300", children: [
214
+ a.data.failed.length,
186
215
  " link ",
187
- c.data.failed.length === 1 ? "type" : "types",
216
+ a.data.failed.length === 1 ? "type" : "types",
188
217
  " could not be read and are left out: ",
189
- c.data.failed.join(", ")
218
+ a.data.failed.join(", ")
190
219
  ] }) : null,
191
- /* @__PURE__ */ e("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: c.isLoading ? /* @__PURE__ */ e("div", { className: "space-y-2 p-4", children: [0, 1, 2, 3, 4].map((t) => /* @__PURE__ */ e(
220
+ /* @__PURE__ */ e("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: a.isLoading ? /* @__PURE__ */ e("div", { className: "space-y-2 p-4", children: [0, 1, 2, 3, 4].map((t) => /* @__PURE__ */ e(
192
221
  "div",
193
222
  {
194
223
  className: "h-9 animate-pulse rounded",
195
224
  style: { background: "hsl(var(--nvr-skeleton))" }
196
225
  },
197
226
  t
198
- )) }) : c.isError ? /* @__PURE__ */ a("p", { className: "p-6 text-[12.5px] text-rose-700 dark:text-rose-300", children: [
227
+ )) }) : a.isError ? /* @__PURE__ */ r("p", { className: "p-6 text-[12.5px] text-rose-700 dark:text-rose-300", children: [
199
228
  "The scan failed. ",
200
- K(c.error, "")
201
- ] }) : k.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 p-10 text-center", children: [
202
- /* @__PURE__ */ e(oe, { className: "h-6 w-6 text-slate-400" }),
203
- /* @__PURE__ */ e("p", { className: "text-[13px] font-medium text-slate-800 dark:text-foreground", children: b ? "Nobody inactive is named on open work" : "Nothing matches" }),
204
- /* @__PURE__ */ e("p", { className: "max-w-[52ch] text-[12px] text-slate-500 dark:text-muted-foreground", children: b ? "Every contact, owner and task on a record in an open workflow belongs to someone who can still act. Clear the first switch to look at closed records too." : "Change the switches above to widen what counts as a link." })
205
- ] }) : /* @__PURE__ */ e("ul", { className: "min-h-0 flex-1 divide-y divide-slate-100 overflow-y-auto dark:divide-border", children: k.map((t) => /* @__PURE__ */ e(
206
- me,
229
+ D(a.error, "")
230
+ ] }) : E.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 p-10 text-center", children: [
231
+ /* @__PURE__ */ e(ue, { className: "h-6 w-6 text-slate-400" }),
232
+ /* @__PURE__ */ e("p", { className: "text-[13px] font-medium text-slate-800 dark:text-foreground", children: p ? "Nobody inactive is named on open work" : "Nothing matches" }),
233
+ /* @__PURE__ */ e("p", { className: "max-w-[52ch] text-[12px] text-slate-500 dark:text-muted-foreground", children: p ? "Every contact, owner and task on a record in an open workflow belongs to someone who can still act. Clear the first switch to look at closed records too." : "Change the switches above to widen what counts as a link." })
234
+ ] }) : /* @__PURE__ */ e("ul", { className: "min-h-0 flex-1 divide-y divide-slate-100 overflow-y-auto dark:divide-border", children: E.map((t) => /* @__PURE__ */ e(
235
+ be,
207
236
  {
208
237
  person: t,
209
- sources: N,
238
+ sources: f,
210
239
  open: _ === t.user.id,
211
240
  onToggle: () => O(_ === t.user.id ? null : t.user.id),
212
- onChanged: re
241
+ onChanged: oe
213
242
  },
214
243
  t.user.id
215
244
  )) }) })
216
245
  ] });
217
246
  }
218
- function F({
247
+ function B({
219
248
  label: l,
220
- checked: n,
249
+ checked: s,
221
250
  onChange: o,
222
- hook: b
251
+ hook: y
223
252
  }) {
224
- return /* @__PURE__ */ a("label", { className: "flex cursor-pointer items-center gap-1.5 text-[11.5px] text-slate-600 dark:text-muted-foreground", children: [
253
+ return /* @__PURE__ */ r("label", { className: "flex cursor-pointer items-center gap-1.5 text-[11.5px] text-slate-600 dark:text-muted-foreground", children: [
225
254
  /* @__PURE__ */ e(
226
255
  "input",
227
256
  {
228
257
  type: "checkbox",
229
- checked: n,
230
- onChange: (C) => o(C.target.checked),
258
+ checked: s,
259
+ onChange: (N) => o(N.target.checked),
231
260
  className: "h-3.5 w-3.5 accent-slate-700",
232
- "data-inactive-switch": b
261
+ "data-inactive-switch": y
233
262
  }
234
263
  ),
235
264
  l
236
265
  ] });
237
266
  }
238
- function ee(l) {
267
+ function ne(l) {
239
268
  return l.kind === "builtin" ? l.label : `${l.collection_label} · ${l.label}`;
240
269
  }
241
- function me({
270
+ function be({
242
271
  person: l,
243
- sources: n,
272
+ sources: s,
244
273
  open: o,
245
- onToggle: b,
246
- onChanged: C
274
+ onToggle: y,
275
+ onChanged: N
247
276
  }) {
248
- const v = G(), d = l.user, u = v.userUrl ? v.userUrl(d.id) : `/users/${d.id}`, y = d.name.split(/\s+/).map((i) => i[0]).join("").slice(0, 2).toUpperCase();
249
- return /* @__PURE__ */ a("li", { "data-inactive-person": d.id, children: [
250
- /* @__PURE__ */ a(
277
+ const p = ee(), d = l.user, u = p.userUrl ? p.userUrl(d.id) : `/users/${d.id}`, k = d.name.split(/\s+/).map((i) => i[0]).join("").slice(0, 2).toUpperCase();
278
+ return /* @__PURE__ */ r("li", { "data-inactive-person": d.id, children: [
279
+ /* @__PURE__ */ r(
251
280
  "button",
252
281
  {
253
282
  type: "button",
254
- onClick: b,
283
+ onClick: y,
255
284
  "aria-expanded": o,
256
285
  className: "flex w-full items-center gap-3 px-4 py-2.5 text-left hover:bg-muted",
257
286
  children: [
258
- o ? /* @__PURE__ */ e(V, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }) : /* @__PURE__ */ e(X, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
287
+ o ? /* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }) : /* @__PURE__ */ e(Z, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
259
288
  /* @__PURE__ */ e(
260
- ce,
289
+ he,
261
290
  {
262
291
  userId: d.id,
263
292
  className: "h-6 w-6 shrink-0 rounded-full object-cover",
264
- fallback: /* @__PURE__ */ e("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-slate-200 text-[9px] font-semibold text-slate-600 dark:bg-muted dark:text-muted-foreground", children: y })
293
+ fallback: /* @__PURE__ */ e("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-slate-200 text-[9px] font-semibold text-slate-600 dark:bg-muted dark:text-muted-foreground", children: k })
265
294
  }
266
295
  ),
267
- /* @__PURE__ */ a("span", { className: "min-w-0 flex-[0_1_260px]", children: [
296
+ /* @__PURE__ */ r("span", { className: "min-w-0 flex-[0_1_260px]", children: [
268
297
  /* @__PURE__ */ e("span", { className: "block truncate text-[12.5px] font-medium text-slate-900 dark:text-foreground", children: d.name }),
269
298
  /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-500 dark:text-muted-foreground", children: d.email ?? "—" })
270
299
  ] }),
271
300
  /* @__PURE__ */ e(
272
301
  "span",
273
302
  {
274
- className: E(
303
+ className: A(
275
304
  "shrink-0 rounded px-1.5 py-0.5 text-[10.5px] font-medium",
276
- ue[d.reason]
305
+ fe[d.reason]
277
306
  ),
278
- "data-tip": Z[d.reason],
279
- children: T[d.reason]
307
+ "data-tip": re[d.reason],
308
+ children: K[d.reason]
280
309
  }
281
310
  ),
282
- /* @__PURE__ */ a("span", { className: "hidden min-w-0 flex-1 truncate text-[11.5px] text-slate-500 md:block dark:text-muted-foreground", children: [
311
+ /* @__PURE__ */ r("span", { className: "hidden min-w-0 flex-1 truncate text-[11.5px] text-slate-500 md:block dark:text-muted-foreground", children: [
283
312
  l.links.slice(0, 3).map((i) => {
284
- const x = n.get(i.source);
285
- return x ? `${ee(x)} ${g(i.count)}` : "";
313
+ const m = s.get(i.source);
314
+ return m ? `${ne(m)} ${b(i.count)}` : "";
286
315
  }).filter(Boolean).join(" · "),
287
316
  l.links.length > 3 ? ` · +${l.links.length - 3} more` : ""
288
317
  ] }),
289
- /* @__PURE__ */ e("span", { className: "ml-auto shrink-0 text-[11px] text-slate-500 dark:text-muted-foreground", children: d.last_access ? `last active ${ie(d.last_access)}` : "never signed in" }),
290
- /* @__PURE__ */ e("span", { className: "w-14 shrink-0 text-right text-[12.5px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: g(l.total) })
318
+ /* @__PURE__ */ e("span", { className: "ml-auto shrink-0 text-[11px] text-slate-500 dark:text-muted-foreground", children: d.last_access ? `last active ${pe(d.last_access)}` : "never signed in" }),
319
+ /* @__PURE__ */ e("span", { className: "w-14 shrink-0 text-right text-[12.5px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: b(l.total) })
291
320
  ]
292
321
  }
293
322
  ),
294
- o && /* @__PURE__ */ a("div", { className: "border-t border-slate-100 bg-slate-50/60 px-4 py-3 pl-11 dark:border-border dark:bg-white/[0.02]", children: [
323
+ o && /* @__PURE__ */ r("div", { className: "border-t border-slate-100 bg-slate-50/60 px-4 py-3 pl-11 dark:border-border dark:bg-white/[0.02]", children: [
295
324
  /* @__PURE__ */ e("ul", { className: "space-y-1", children: l.links.map((i) => {
296
- const x = n.get(i.source);
297
- return x ? /* @__PURE__ */ e(
298
- xe,
325
+ const m = s.get(i.source);
326
+ return m ? /* @__PURE__ */ e(
327
+ ge,
299
328
  {
300
329
  userId: d.id,
301
- source: x,
330
+ source: m,
302
331
  count: i.count,
303
- onChanged: C
332
+ onChanged: N
304
333
  },
305
334
  i.source
306
335
  ) : null;
307
336
  }) }),
308
- u && /* @__PURE__ */ a("p", { className: "mt-3 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
337
+ u && /* @__PURE__ */ r("p", { className: "mt-3 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
309
338
  "Everything this person holds can also move in one pass from",
310
339
  " ",
311
340
  /* @__PURE__ */ e(
312
341
  "button",
313
342
  {
314
343
  type: "button",
315
- onClick: () => v.navigate(u),
344
+ onClick: () => p.navigate(u),
316
345
  className: "font-medium text-slate-700 underline decoration-dotted underline-offset-2 hover:text-slate-900 dark:text-foreground",
317
346
  children: "their account page"
318
347
  }
@@ -323,110 +352,110 @@ function me({
323
352
  ] })
324
353
  ] });
325
354
  }
326
- function xe({
355
+ function ge({
327
356
  userId: l,
328
- source: n,
357
+ source: s,
329
358
  count: o,
330
- onChanged: b
359
+ onChanged: y
331
360
  }) {
332
- var p, $;
333
- const C = z(), { open: v } = J(), [d, u] = f(!1), y = !0, i = n.kind === "builtin", x = B({
334
- queryKey: ["inactive-user-records", l, n.key],
335
- queryFn: () => C.request(
336
- I(
337
- `/inactive-user-links/${l}/records?source=${encodeURIComponent(n.key)}&limit=100`
361
+ var g, w;
362
+ const N = F(), { open: p } = te(), [d, u] = x(!1), k = !0, i = s.kind === "builtin", m = M({
363
+ queryKey: ["inactive-user-records", l, s.key],
364
+ queryFn: () => N.request(
365
+ Q(
366
+ `/inactive-user-links/${l}/records?source=${encodeURIComponent(s.key)}&limit=100`
338
367
  )
339
- ).then((h) => h.data),
340
- enabled: d && y
368
+ ).then((c) => c.data),
369
+ enabled: d && k
341
370
  });
342
- return /* @__PURE__ */ a("li", { "data-inactive-source": n.key, children: [
343
- /* @__PURE__ */ a("div", { className: "flex items-center gap-2 text-[12px]", children: [
344
- /* @__PURE__ */ a(
371
+ return /* @__PURE__ */ r("li", { "data-inactive-source": s.key, children: [
372
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[12px]", children: [
373
+ /* @__PURE__ */ r(
345
374
  "button",
346
375
  {
347
376
  type: "button",
348
- disabled: !y,
349
- onClick: () => u((h) => !h),
377
+ disabled: !k,
378
+ onClick: () => u((c) => !c),
350
379
  "aria-expanded": d,
351
380
  className: "flex min-w-0 items-center gap-1.5 text-left text-slate-700 enabled:hover:text-slate-900 dark:text-foreground",
352
381
  children: [
353
- d ? /* @__PURE__ */ e(V, { className: "h-3 w-3 shrink-0 text-slate-400" }) : /* @__PURE__ */ e(X, { className: "h-3 w-3 shrink-0 text-slate-400" }),
354
- /* @__PURE__ */ e("span", { className: "truncate", children: ee(n) })
382
+ d ? /* @__PURE__ */ e(Y, { className: "h-3 w-3 shrink-0 text-slate-400" }) : /* @__PURE__ */ e(Z, { className: "h-3 w-3 shrink-0 text-slate-400" }),
383
+ /* @__PURE__ */ e("span", { className: "truncate", children: ne(s) })
355
384
  ]
356
385
  }
357
386
  ),
358
- /* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: g(o) }),
359
- n.scope === "open" && /* @__PURE__ */ e("span", { className: "rounded bg-[#e0f2fe] px-1.5 py-0.5 text-[10px] font-medium text-[#075985] dark:bg-[#15303f] dark:text-[#8fcdf0]", children: "open workflow" }),
360
- n.reassignable && !i && /* @__PURE__ */ e("span", { className: "ml-auto", children: /* @__PURE__ */ e(te, { userId: l, source: n, count: o, onDone: b }) })
387
+ /* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: b(o) }),
388
+ s.scope === "open" && /* @__PURE__ */ e("span", { className: "rounded bg-[#e0f2fe] px-1.5 py-0.5 text-[10px] font-medium text-[#075985] dark:bg-[#15303f] dark:text-[#8fcdf0]", children: "open workflow" }),
389
+ s.reassignable && !i && /* @__PURE__ */ e("span", { className: "ml-auto", children: /* @__PURE__ */ e(se, { userId: l, source: s, count: o, onDone: y }) })
361
390
  ] }),
362
- d && y && /* @__PURE__ */ e("div", { className: "ml-[18px] mt-1 mb-2", children: x.isLoading ? /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Loading…" }) : i ? /* @__PURE__ */ e(
363
- he,
391
+ d && k && /* @__PURE__ */ e("div", { className: "ml-[18px] mt-1 mb-2", children: m.isLoading ? /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Loading…" }) : i ? /* @__PURE__ */ e(
392
+ ke,
364
393
  {
365
394
  userId: l,
366
- source: n,
367
- entries: ((p = x.data) == null ? void 0 : p.entries) ?? [],
368
- onChanged: b
395
+ source: s,
396
+ entries: ((g = m.data) == null ? void 0 : g.entries) ?? [],
397
+ onChanged: y
369
398
  }
370
- ) : ($ = x.data) != null && $.records.length ? /* @__PURE__ */ a("ul", { className: "flex flex-wrap gap-1", "data-inactive-records": !0, children: [
371
- x.data.records.map((h) => {
372
- var S;
399
+ ) : (w = m.data) != null && w.records.length ? /* @__PURE__ */ r("ul", { className: "flex flex-wrap gap-1", "data-inactive-records": !0, children: [
400
+ m.data.records.map((c) => {
401
+ var C;
373
402
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
374
403
  "button",
375
404
  {
376
405
  type: "button",
377
- onClick: () => v({ collection: h.collection, itemId: h.id }),
406
+ onClick: () => p({ collection: c.collection, itemId: c.id }),
378
407
  className: "rounded border border-slate-200 bg-white px-1.5 py-0.5 text-[11px] text-slate-700 hover:border-slate-400 dark:border-border dark:bg-card dark:text-foreground",
379
- children: ((S = h.label) == null ? void 0 : S.trim()) || `#${h.id}`
408
+ children: ((C = c.label) == null ? void 0 : C.trim()) || `#${c.id}`
380
409
  }
381
- ) }, `${h.collection}:${h.id}`);
410
+ ) }, `${c.collection}:${c.id}`);
382
411
  }),
383
- o > x.data.records.length && /* @__PURE__ */ a("li", { className: "px-1 py-0.5 text-[11px] text-slate-500 dark:text-muted-foreground", children: [
412
+ o > m.data.records.length && /* @__PURE__ */ r("li", { className: "px-1 py-0.5 text-[11px] text-slate-500 dark:text-muted-foreground", children: [
384
413
  "+",
385
- g(o - x.data.records.length),
414
+ b(o - m.data.records.length),
386
415
  " more"
387
416
  ] })
388
417
  ] }) : /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Nothing to list." }) })
389
418
  ] });
390
419
  }
391
- function te({
420
+ function se({
392
421
  userId: l,
393
- source: n,
422
+ source: s,
394
423
  count: o,
395
- ids: b,
396
- label: C = "Hand to…",
397
- onDone: v
424
+ ids: y,
425
+ label: N = "Hand to…",
426
+ onDone: p
398
427
  }) {
399
- var m;
400
- const d = z(), [u, y] = f(!1), [i, x] = f(""), [p, $] = f(null), [h, S] = f(!1), [_, O] = f(null), [q, j] = f(null), c = B({
428
+ var h;
429
+ const d = F(), [u, k] = x(!1), [i, m] = x(""), [g, w] = x(null), [c, C] = x(!1), [q, j] = x(null), [_, O] = x(null), $ = M({
401
430
  queryKey: ["inactive-reassign-users", i],
402
- queryFn: () => d.request(I(`/users?search=${encodeURIComponent(i)}&limit=8`)).then((s) => s.data),
403
- enabled: u && !p && i.trim().length >= 2,
431
+ queryFn: () => d.request(Q(`/users?search=${encodeURIComponent(i)}&limit=8`)).then((a) => a.data),
432
+ enabled: u && !g && i.trim().length >= 2,
404
433
  staleTime: 3e4
405
- }), N = (s) => [s.first_name, s.last_name].filter(Boolean).join(" ") || s.email, r = async () => {
406
- if (p) {
407
- S(!0), j(null);
434
+ }), L = (a) => [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email, n = async () => {
435
+ if (g) {
436
+ C(!0), O(null);
408
437
  try {
409
- const k = (await d.request(Y(`/inactive-user-links/${l}/reassign`, { source: n.key, to: p.id, ids: b }))).data;
410
- O(
411
- `${g(k.moved)} moved to ${N(p)}` + (k.removed ? ` · ${g(k.removed)} already theirs` : "") + (k.failed.length ? ` · ${g(k.failed.length)} refused (${k.failed[0].error})` : "")
412
- ), y(!1), v();
413
- } catch (s) {
414
- const k = s.response;
415
- j((k == null ? void 0 : k.error) ?? K(s, ""));
438
+ const f = (await d.request(ae(`/inactive-user-links/${l}/reassign`, { source: s.key, to: g.id, ids: y }))).data;
439
+ j(
440
+ `${b(f.moved)} moved to ${L(g)}` + (f.removed ? ` · ${b(f.removed)} already theirs` : "") + (f.failed.length ? ` · ${b(f.failed.length)} refused (${f.failed[0].error})` : "")
441
+ ), k(!1), p();
442
+ } catch (a) {
443
+ const f = a.response;
444
+ O((f == null ? void 0 : f.error) ?? D(a, ""));
416
445
  } finally {
417
- S(!1);
446
+ C(!1);
418
447
  }
419
448
  }
420
449
  };
421
- return _ ? /* @__PURE__ */ e("span", { className: "text-[11px] text-emerald-700 dark:text-emerald-400", "data-inactive-reassigned": !0, children: _ }) : /* @__PURE__ */ a("span", { className: "relative inline-block", children: [
450
+ return q ? /* @__PURE__ */ e("span", { className: "text-[11px] text-emerald-700 dark:text-emerald-400", "data-inactive-reassigned": !0, children: q }) : /* @__PURE__ */ r("span", { className: "relative inline-block", children: [
422
451
  /* @__PURE__ */ e(
423
452
  "button",
424
453
  {
425
454
  type: "button",
426
- onClick: () => y((s) => !s),
427
- "data-inactive-reassign": n.key,
455
+ onClick: () => k((a) => !a),
456
+ "data-inactive-reassign": s.key,
428
457
  className: "rounded-md border border-slate-200 bg-white px-2 py-0.5 text-[11px] text-slate-600 hover:border-slate-300 hover:text-slate-900 dark:border-border dark:bg-card dark:text-muted-foreground dark:hover:text-foreground",
429
- children: C
458
+ children: N
430
459
  }
431
460
  ),
432
461
  u && /* @__PURE__ */ e(
@@ -434,30 +463,30 @@ function te({
434
463
  {
435
464
  className: "absolute right-0 top-7 z-30 w-72 rounded-md border border-slate-200 bg-white p-2 text-left shadow-md dark:border-border dark:bg-card",
436
465
  "data-inactive-reassign-panel": !0,
437
- children: p ? /* @__PURE__ */ a("div", { className: "space-y-2", children: [
438
- /* @__PURE__ */ a("p", { className: "text-[12px] text-slate-700 dark:text-foreground", children: [
466
+ children: g ? /* @__PURE__ */ r("div", { className: "space-y-2", children: [
467
+ /* @__PURE__ */ r("p", { className: "text-[12px] text-slate-700 dark:text-foreground", children: [
439
468
  "Put ",
440
- /* @__PURE__ */ e("strong", { className: "font-semibold", children: N(p) }),
469
+ /* @__PURE__ */ e("strong", { className: "font-semibold", children: L(g) }),
441
470
  " on",
442
471
  " ",
443
- g(Math.min(o, 500)),
472
+ b(Math.min(o, 500)),
444
473
  " ",
445
- n.kind === "builtin" ? o === 1 ? "place" : "places" : o === 1 ? "record" : "records",
474
+ s.kind === "builtin" ? o === 1 ? "place" : "places" : o === 1 ? "record" : "records",
446
475
  " ",
447
476
  "as ",
448
- n.label.toLowerCase(),
477
+ s.label.toLowerCase(),
449
478
  o > 500 ? " (500 at a time)" : "",
450
479
  "?",
451
480
  " ",
452
- n.kind === "builtin" ? "Places they already hold are not doubled." : "Each change is saved to the record's history."
481
+ s.kind === "builtin" ? "Places they already hold are not doubled." : "Each change is saved to the record's history."
453
482
  ] }),
454
- q && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-rose-700 dark:text-rose-300", children: q }),
455
- /* @__PURE__ */ a("div", { className: "flex justify-end gap-1.5", children: [
483
+ _ && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-rose-700 dark:text-rose-300", children: _ }),
484
+ /* @__PURE__ */ r("div", { className: "flex justify-end gap-1.5", children: [
456
485
  /* @__PURE__ */ e(
457
486
  "button",
458
487
  {
459
488
  type: "button",
460
- onClick: () => $(null),
489
+ onClick: () => w(null),
461
490
  className: "h-7 rounded-md px-2 text-[11.5px] text-slate-600 hover:text-slate-900 dark:text-muted-foreground",
462
491
  children: "Back"
463
492
  }
@@ -466,125 +495,125 @@ function te({
466
495
  "button",
467
496
  {
468
497
  type: "button",
469
- onClick: r,
470
- disabled: h,
498
+ onClick: n,
499
+ disabled: c,
471
500
  "data-inactive-reassign-confirm": !0,
472
501
  className: "h-7 rounded-md bg-nvr-cyan px-2.5 text-[11.5px] font-medium text-white disabled:opacity-60",
473
- children: h ? "Moving…" : "Move them"
502
+ children: c ? "Moving…" : "Move them"
474
503
  }
475
504
  )
476
505
  ] })
477
- ] }) : /* @__PURE__ */ a(H, { children: [
506
+ ] }) : /* @__PURE__ */ r(J, { children: [
478
507
  /* @__PURE__ */ e(
479
508
  "input",
480
509
  {
481
510
  autoFocus: !0,
482
511
  value: i,
483
- onChange: (s) => x(s.target.value),
512
+ onChange: (a) => m(a.target.value),
484
513
  placeholder: "Search people",
485
514
  className: "h-8 w-full rounded-md border border-slate-200 bg-background px-2 text-[12.5px] text-slate-800 placeholder:text-slate-500 focus:border-slate-400 focus:outline-none dark:border-border dark:text-foreground"
486
515
  }
487
516
  ),
488
- /* @__PURE__ */ a("ul", { className: "mt-1 max-h-56 overflow-y-auto", children: [
489
- (c.data ?? []).filter((s) => s.id.toLowerCase() !== l.toLowerCase()).map((s) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ a(
517
+ /* @__PURE__ */ r("ul", { className: "mt-1 max-h-56 overflow-y-auto", children: [
518
+ ($.data ?? []).filter((a) => a.id.toLowerCase() !== l.toLowerCase()).map((a) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ r(
490
519
  "button",
491
520
  {
492
521
  type: "button",
493
- onClick: () => $(s),
494
- "data-inactive-candidate": s.id,
522
+ onClick: () => w(a),
523
+ "data-inactive-candidate": a.id,
495
524
  className: "flex w-full flex-col rounded px-2 py-1 text-left hover:bg-muted",
496
525
  children: [
497
- /* @__PURE__ */ e("span", { className: "text-[12px] text-slate-800 dark:text-foreground", children: N(s) }),
498
- /* @__PURE__ */ e("span", { className: "text-[10.5px] text-slate-500 dark:text-muted-foreground", children: s.email })
526
+ /* @__PURE__ */ e("span", { className: "text-[12px] text-slate-800 dark:text-foreground", children: L(a) }),
527
+ /* @__PURE__ */ e("span", { className: "text-[10.5px] text-slate-500 dark:text-muted-foreground", children: a.email })
499
528
  ]
500
529
  }
501
- ) }, s.id)),
502
- i.trim().length >= 2 && !c.isLoading && !((m = c.data) != null && m.length) && /* @__PURE__ */ e("li", { className: "px-2 py-1 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "No active person matches." })
530
+ ) }, a.id)),
531
+ i.trim().length >= 2 && !$.isLoading && !((h = $.data) != null && h.length) && /* @__PURE__ */ e("li", { className: "px-2 py-1 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "No active person matches." })
503
532
  ] })
504
533
  ] })
505
534
  }
506
535
  )
507
536
  ] });
508
537
  }
509
- function he({
538
+ function ke({
510
539
  userId: l,
511
- source: n,
540
+ source: s,
512
541
  entries: o,
513
- onChanged: b
542
+ onChanged: y
514
543
  }) {
515
- const C = z(), v = G(), { open: d } = J(), [u, y] = f(/* @__PURE__ */ new Set()), [i, x] = f(!1), [p, $] = f(!1), [h, S] = f(null), _ = n.key !== "builtin:tasks", O = [...u], q = o.length > 0 && u.size === o.length, j = (r) => y((m) => {
516
- const s = new Set(m);
517
- return s.has(r) ? s.delete(r) : s.add(r), s;
518
- }), c = async () => {
519
- var r;
520
- $(!0);
544
+ const N = F(), p = ee(), { open: d } = te(), [u, k] = x(/* @__PURE__ */ new Set()), [i, m] = x(!1), [g, w] = x(!1), [c, C] = x(null), q = s.key !== "builtin:tasks", j = [...u], _ = o.length > 0 && u.size === o.length, O = (n) => k((h) => {
545
+ const a = new Set(h);
546
+ return a.has(n) ? a.delete(n) : a.add(n), a;
547
+ }), $ = async () => {
548
+ var n;
549
+ w(!0);
521
550
  try {
522
- const m = await C.request(
523
- Y(`/inactive-user-links/${l}/remove`, { source: n.key, ids: O })
551
+ const h = await N.request(
552
+ ae(`/inactive-user-links/${l}/remove`, { source: s.key, ids: j })
524
553
  );
525
- S(
526
- `${g(m.data.removed)} removed${m.data.failed.length ? ` · ${g(m.data.failed.length)} refused` : ""}`
527
- ), y(/* @__PURE__ */ new Set()), x(!1), b();
528
- } catch (m) {
529
- S(((r = m.response) == null ? void 0 : r.error) ?? K(m, ""));
554
+ C(
555
+ `${b(h.data.removed)} removed${h.data.failed.length ? ` · ${b(h.data.failed.length)} refused` : ""}`
556
+ ), k(/* @__PURE__ */ new Set()), m(!1), y();
557
+ } catch (h) {
558
+ C(((n = h.response) == null ? void 0 : n.error) ?? D(h, ""));
530
559
  } finally {
531
- $(!1);
560
+ w(!1);
532
561
  }
533
562
  };
534
563
  if (!o.length)
535
564
  return /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Nothing to list." });
536
- const N = o.filter((r) => r.sole).length;
537
- return /* @__PURE__ */ a("div", { "data-inactive-entries": n.key, children: [
538
- /* @__PURE__ */ a("div", { className: "mb-1 flex min-h-7 flex-wrap items-center gap-2 text-[11.5px] text-slate-600 dark:text-muted-foreground", children: [
539
- /* @__PURE__ */ a("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
565
+ const L = o.filter((n) => n.sole).length;
566
+ return /* @__PURE__ */ r("div", { "data-inactive-entries": s.key, children: [
567
+ /* @__PURE__ */ r("div", { className: "mb-1 flex min-h-7 flex-wrap items-center gap-2 text-[11.5px] text-slate-600 dark:text-muted-foreground", children: [
568
+ /* @__PURE__ */ r("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
540
569
  /* @__PURE__ */ e(
541
570
  "input",
542
571
  {
543
572
  type: "checkbox",
544
- checked: q,
545
- onChange: () => y(q ? /* @__PURE__ */ new Set() : new Set(o.map((r) => r.id))),
573
+ checked: _,
574
+ onChange: () => k(_ ? /* @__PURE__ */ new Set() : new Set(o.map((n) => n.id))),
546
575
  className: "h-3.5 w-3.5 accent-slate-700",
547
576
  "data-inactive-entries-all": !0
548
577
  }
549
578
  ),
550
- u.size ? `${g(u.size)} picked` : "Pick all"
579
+ u.size ? `${b(u.size)} picked` : "Pick all"
551
580
  ] }),
552
- N > 0 && /* @__PURE__ */ a("span", { className: "rounded bg-[#ffe4e6] px-1.5 py-0.5 text-[10.5px] font-medium text-[#9f1239] dark:bg-[#3d1a20] dark:text-[#f4a3ad]", children: [
553
- g(N),
581
+ L > 0 && /* @__PURE__ */ r("span", { className: "rounded bg-[#ffe4e6] px-1.5 py-0.5 text-[10.5px] font-medium text-[#9f1239] dark:bg-[#3d1a20] dark:text-[#f4a3ad]", children: [
582
+ b(L),
554
583
  " with nobody else who can act"
555
584
  ] }),
556
- h && /* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: h }),
557
- u.size > 0 && /* @__PURE__ */ a("span", { className: "ml-auto flex items-center gap-1.5", children: [
585
+ c && /* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: c }),
586
+ u.size > 0 && /* @__PURE__ */ r("span", { className: "ml-auto flex items-center gap-1.5", children: [
558
587
  /* @__PURE__ */ e(
559
- te,
588
+ se,
560
589
  {
561
590
  userId: l,
562
- source: n,
591
+ source: s,
563
592
  count: u.size,
564
- ids: O,
565
- label: `Hand ${g(u.size)} to…`,
593
+ ids: j,
594
+ label: `Hand ${b(u.size)} to…`,
566
595
  onDone: () => {
567
- y(/* @__PURE__ */ new Set()), b();
596
+ k(/* @__PURE__ */ new Set()), y();
568
597
  }
569
598
  }
570
599
  ),
571
- _ && (i ? /* @__PURE__ */ a(H, { children: [
600
+ q && (i ? /* @__PURE__ */ r(J, { children: [
572
601
  /* @__PURE__ */ e(
573
602
  "button",
574
603
  {
575
604
  type: "button",
576
- onClick: c,
577
- disabled: p,
605
+ onClick: $,
606
+ disabled: g,
578
607
  "data-inactive-remove-confirm": !0,
579
608
  className: "h-[22px] rounded-md bg-[#be123c] px-2 text-[11px] font-medium text-white disabled:opacity-60",
580
- children: p ? "Removing…" : `Remove ${g(u.size)}, no successor`
609
+ children: g ? "Removing…" : `Remove ${b(u.size)}, no successor`
581
610
  }
582
611
  ),
583
612
  /* @__PURE__ */ e(
584
613
  "button",
585
614
  {
586
615
  type: "button",
587
- onClick: () => x(!1),
616
+ onClick: () => m(!1),
588
617
  className: "text-[11px] text-slate-600 hover:text-slate-900 dark:text-muted-foreground",
589
618
  children: "Keep"
590
619
  }
@@ -593,7 +622,7 @@ function he({
593
622
  "button",
594
623
  {
595
624
  type: "button",
596
- onClick: () => x(!0),
625
+ onClick: () => m(!0),
597
626
  "data-inactive-remove": !0,
598
627
  className: "rounded-md border border-slate-200 bg-white px-2 py-0.5 text-[11px] text-slate-600 hover:border-[#be123c] hover:text-[#be123c] dark:border-border dark:bg-card dark:text-muted-foreground",
599
628
  children: "Remove…"
@@ -601,64 +630,64 @@ function he({
601
630
  ))
602
631
  ] })
603
632
  ] }),
604
- /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 rounded-md border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children: o.map((r) => {
605
- const m = r.console_path ? v.consoleUrl ? v.consoleUrl(r.console_path) : r.console_path : null;
606
- return /* @__PURE__ */ a(
633
+ /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 rounded-md border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children: o.map((n) => {
634
+ const h = n.console_path ? p.consoleUrl ? p.consoleUrl(n.console_path) : n.console_path : null;
635
+ return /* @__PURE__ */ r(
607
636
  "li",
608
637
  {
609
638
  className: "flex items-start gap-2 px-2.5 py-1.5",
610
- "data-inactive-entry": r.id,
639
+ "data-inactive-entry": n.id,
611
640
  children: [
612
641
  /* @__PURE__ */ e(
613
642
  "input",
614
643
  {
615
644
  type: "checkbox",
616
- checked: u.has(r.id),
617
- onChange: () => j(r.id),
618
- "aria-label": `Pick ${r.title}`,
645
+ checked: u.has(n.id),
646
+ onChange: () => O(n.id),
647
+ "aria-label": `Pick ${n.title}`,
619
648
  className: "mt-0.5 h-3.5 w-3.5 shrink-0 accent-slate-700"
620
649
  }
621
650
  ),
622
- /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
623
- /* @__PURE__ */ a("div", { className: "flex flex-wrap items-baseline gap-x-2", children: [
624
- r.record ? /* @__PURE__ */ e(
651
+ /* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
652
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap items-baseline gap-x-2", children: [
653
+ n.record ? /* @__PURE__ */ e(
625
654
  "button",
626
655
  {
627
656
  type: "button",
628
- onClick: () => r.record && d({ collection: r.record.collection, itemId: r.record.id }),
657
+ onClick: () => n.record && d({ collection: n.record.collection, itemId: n.record.id }),
629
658
  className: "text-left text-[12px] font-medium text-slate-900 underline decoration-dotted underline-offset-2 dark:text-foreground",
630
- children: r.title
659
+ children: n.title
631
660
  }
632
- ) : m ? /* @__PURE__ */ e(
661
+ ) : h ? /* @__PURE__ */ e(
633
662
  "button",
634
663
  {
635
664
  type: "button",
636
- onClick: () => /^https?:/.test(m) ? window.open(m, "_blank") : v.navigate(m),
665
+ onClick: () => /^https?:/.test(h) ? window.open(h, "_blank") : p.navigate(h),
637
666
  className: "text-left text-[12px] font-medium text-slate-900 underline decoration-dotted underline-offset-2 dark:text-foreground",
638
- children: r.title
667
+ children: n.title
639
668
  }
640
- ) : /* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-slate-900 dark:text-foreground", children: r.title }),
641
- /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-500 dark:text-muted-foreground", children: r.facts.join(" · ") })
669
+ ) : /* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-slate-900 dark:text-foreground", children: n.title }),
670
+ /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-500 dark:text-muted-foreground", children: n.facts.join(" · ") })
642
671
  ] }),
643
- r.subtitle && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-600 dark:text-muted-foreground", children: r.subtitle }),
644
- (n.key === "builtin:owner_seats" || n.key === "builtin:teams") && /* @__PURE__ */ e(
672
+ n.subtitle && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-600 dark:text-muted-foreground", children: n.subtitle }),
673
+ (s.key === "builtin:owner_seats" || s.key === "builtin:teams") && /* @__PURE__ */ e(
645
674
  "p",
646
675
  {
647
- className: E(
676
+ className: A(
648
677
  "text-[11px]",
649
- r.sole ? "font-medium text-[#9f1239] dark:text-[#f4a3ad]" : "text-slate-500 dark:text-muted-foreground"
678
+ n.sole ? "font-medium text-[#9f1239] dark:text-[#f4a3ad]" : "text-slate-500 dark:text-muted-foreground"
650
679
  ),
651
- children: r.sole ? "Nobody else who can act holds this — records here resolve no owner." : `Also held by ${r.others.slice(0, 4).join(", ")}${r.others.length > 4 ? ` +${r.others.length - 4}` : ""}${r.others.length ? "" : "a linked team"}`
680
+ children: n.sole ? "Nobody else who can act holds this — records here resolve no owner." : `Also held by ${n.others.slice(0, 4).join(", ")}${n.others.length > 4 ? ` +${n.others.length - 4}` : ""}${n.others.length ? "" : "a linked team"}`
652
681
  }
653
682
  )
654
683
  ] })
655
684
  ]
656
685
  },
657
- r.id
686
+ n.id
658
687
  );
659
688
  }) })
660
689
  ] });
661
690
  }
662
691
  export {
663
- Ce as InactiveUserLinksView
692
+ qe as InactiveUserLinksView
664
693
  };