@nivaro/react 0.3.43 → 0.3.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +38 -5
  4. package/dist/shared/components/CollectionBrowserView.js +1390 -1358
  5. package/dist/shared/components/DataTable.js +356 -334
  6. package/dist/shared/components/ProfileView.js +16 -21
  7. package/dist/shared/components/command-center/CommandCenterView.js +90 -355
  8. package/dist/shared/components/command-center/Header.js +70 -0
  9. package/dist/shared/components/command-center/PeekPanel.js +6 -0
  10. package/dist/shared/components/command-center/api.js +26 -0
  11. package/dist/shared/components/command-center/panels/AttentionPanel.js +6 -0
  12. package/dist/shared/components/command-center/panels/FeedPanel.js +33 -0
  13. package/dist/shared/components/command-center/panels/FlowPanel.js +61 -0
  14. package/dist/shared/components/command-center/panels/ForecastPanel.js +6 -0
  15. package/dist/shared/components/command-center/panels/MapPanel.js +74 -0
  16. package/dist/shared/components/command-center/panels/PartnersPanel.js +6 -0
  17. package/dist/shared/components/command-center/panels/PeoplePanel.js +47 -0
  18. package/dist/shared/components/command-center/panels/RegionPicker.js +6 -0
  19. package/dist/shared/components/command-center/panels/SystemPanel.js +53 -0
  20. package/dist/shared/components/command-center/panels/ThroughputPanel.js +6 -0
  21. package/dist/shared/components/command-center/panels/TimeBar.js +10 -0
  22. package/dist/shared/components/command-center/panels/TrafficPanel.js +11 -0
  23. package/dist/shared/components/command-center/panels/WorkloadPanel.js +6 -0
  24. package/dist/shared/components/command-center/panels/registry.js +28 -0
  25. package/dist/shared/components/command-center/state.js +12 -0
  26. package/dist/shared/components/command-center/theme.js +66 -0
  27. package/dist/shared/components/imports/ImportConsole.js +48 -47
  28. package/dist/shared/components/notifications/TestMyRules.js +39 -38
  29. package/dist/shared/components/profile/TeamsConnect.js +2 -2
  30. package/dist/shared/components/queue/QueueQuickFilters.js +81 -63
  31. package/dist/shared/components/queue/QueueWorklist.js +598 -586
  32. package/dist/shared/lib/quick-filter-cascade.js +29 -0
  33. package/package.json +1 -1
@@ -1,36 +1,36 @@
1
- import { jsxs as s, Fragment as H, jsx as e } from "react/jsx-runtime";
2
- import { Search as Ie, Pin as Ge, ChevronDown as Pe, Inbox as et, ChevronsUpDown as K, ChevronUp as tt, X as I, Check as rt, CalendarDays as at } from "lucide-react";
3
- import lt, { useMemo as _e, useRef as D, useState as O, useEffect as Q, useLayoutEffect as nt } from "react";
4
- import { parseDateFilter as Oe, describeDateFilter as st, DATE_FILTER_OPS as it, formatDateFilter as dt } from "../lib/date-filter.js";
5
- import { parseNumberFilter as Se, describeNumberFilter as ot, NUMBER_FILTER_OPS as ct, formatNumberFilter as bt } from "../lib/number-filter.js";
6
- import { fitPins as pt } from "../lib/table-pins.js";
1
+ import { jsxs as s, Fragment as Q, jsx as e } from "react/jsx-runtime";
2
+ import { Search as Ge, Pin as Pe, ChevronDown as et, Inbox as tt, ChevronsUpDown as I, ChevronUp as rt, X as G, Check as at, CalendarDays as lt } from "lucide-react";
3
+ import nt, { useMemo as Oe, useRef as K, useState as O, useEffect as Y, useLayoutEffect as st } from "react";
4
+ import { parseDateFilter as Se, describeDateFilter as it, DATE_FILTER_OPS as dt, formatDateFilter as ot } from "../lib/date-filter.js";
5
+ import { parseNumberFilter as $e, describeNumberFilter as ct, NUMBER_FILTER_OPS as pt, formatNumberFilter as bt } from "../lib/number-filter.js";
6
+ import { fitPins as ht } from "../lib/table-pins.js";
7
7
  import { cn as b, formatNumber as be } from "../lib/utils.js";
8
- import { CellCopyLayer as ht } from "./CellCopyLayer.js";
9
- import { EmptyState as mt } from "./EmptyState.js";
10
- import { HScrollProxy as ut } from "./HScrollProxy.js";
11
- import { TableSkeletonRows as xt } from "./Skeletons.js";
12
- import { Button as $e } from "./ui/button.js";
13
- import { Checkbox as Ce } from "./ui/checkbox.js";
14
- import { Command as ft, CommandInput as yt, CommandList as gt, CommandEmpty as kt, CommandItem as vt } from "./ui/command.js";
8
+ import { CellCopyLayer as mt } from "./CellCopyLayer.js";
9
+ import { EmptyState as ut } from "./EmptyState.js";
10
+ import { HScrollProxy as xt } from "./HScrollProxy.js";
11
+ import { TableSkeletonRows as ft } from "./Skeletons.js";
12
+ import { Button as Ce } from "./ui/button.js";
13
+ import { Checkbox as ze } from "./ui/checkbox.js";
14
+ import { Command as yt, CommandInput as gt, CommandList as kt, CommandEmpty as vt, CommandItem as Nt } from "./ui/command.js";
15
15
  import { Input as j } from "./ui/input.js";
16
- import { Popover as G, PopoverTrigger as P, PopoverContent as ee } from "./ui/popover.js";
17
- import { Select as Nt, SelectTrigger as wt, SelectValue as _t, SelectContent as Ot, SelectItem as ze } from "./ui/select.js";
18
- import { Table as Re, TableHeader as Me, TableRow as B, TableHead as U, TableBody as Ee, TableCell as Z } from "./ui/table.js";
19
- const St = [1, 2, 3, 4, 5, 6, 7, 8];
20
- function Te(a) {
16
+ import { Popover as P, PopoverTrigger as ee, PopoverContent as te } from "./ui/popover.js";
17
+ import { Select as wt, SelectTrigger as _t, SelectValue as Ot, SelectContent as St, SelectItem as Me } from "./ui/select.js";
18
+ import { Table as Re, TableHeader as Ee, TableRow as U, TableHead as J, TableBody as Te, TableCell as D } from "./ui/table.js";
19
+ const $t = [1, 2, 3, 4, 5, 6, 7, 8];
20
+ function Ve(a) {
21
21
  return a.startsWith("-") ? a.slice(1) : a;
22
22
  }
23
- function Ve(a) {
23
+ function je(a) {
24
24
  return a ? a.startsWith("-") ? "desc" : "asc" : null;
25
25
  }
26
- function $t(a, i) {
27
- const c = Te(a), o = Ve(a);
26
+ function Ct(a, i) {
27
+ const c = Ve(a), o = je(a);
28
28
  return c !== i || !a ? i : o === "asc" ? `-${i}` : "";
29
29
  }
30
- function Ct({ field: a, sort: i }) {
31
- const c = Te(i), o = Ve(i);
32
- return c !== a || !i ? /* @__PURE__ */ e(K, { className: "ml-1 inline h-3 w-3 shrink-0 text-slate-300" }) : /* @__PURE__ */ e(
33
- tt,
30
+ function zt({ field: a, sort: i }) {
31
+ const c = Ve(i), o = je(i);
32
+ return c !== a || !i ? /* @__PURE__ */ e(I, { className: "ml-1 inline h-3 w-3 shrink-0 text-slate-300" }) : /* @__PURE__ */ e(
33
+ rt,
34
34
  {
35
35
  className: b(
36
36
  "ml-1 inline h-3 w-3 shrink-0 text-nvr-cyan transition-transform duration-200",
@@ -39,76 +39,76 @@ function Ct({ field: a, sort: i }) {
39
39
  }
40
40
  );
41
41
  }
42
- function zt({
42
+ function Mt({
43
43
  def: a,
44
44
  value: i,
45
45
  onChange: c
46
46
  }) {
47
- const [o, u] = O(!1), [l, d] = O(""), [y, g] = O([]), [k, x] = O(!1), [h, v] = O({}), r = D(0), S = !!a.loadOptions, N = Array.isArray(i) ? i : i === "" ? [] : [i];
48
- Q(() => {
47
+ const [o, m] = O(!1), [l, d] = O(""), [y, g] = O([]), [k, u] = O(!1), [p, w] = O({}), r = K(0), S = !!a.loadOptions, v = Array.isArray(i) ? i : i === "" ? [] : [i];
48
+ Y(() => {
49
49
  if (!S || !o) return;
50
- const m = ++r.current;
51
- x(!0);
52
- const F = setTimeout(
50
+ const x = ++r.current;
51
+ u(!0);
52
+ const C = setTimeout(
53
53
  () => {
54
- var M;
55
- (M = a.loadOptions) == null || M.call(a, l).then((E) => {
56
- r.current === m && g(E);
54
+ var E;
55
+ (E = a.loadOptions) == null || E.call(a, l).then((F) => {
56
+ r.current === x && g(F);
57
57
  }).catch(() => {
58
- r.current === m && g([]);
58
+ r.current === x && g([]);
59
59
  }).finally(() => {
60
- r.current === m && x(!1);
60
+ r.current === x && u(!1);
61
61
  });
62
62
  },
63
63
  l ? 250 : 0
64
64
  );
65
- return () => clearTimeout(F);
65
+ return () => clearTimeout(C);
66
66
  }, [l, o, S]);
67
- const Y = S ? y : a.options ?? [], R = (m) => {
68
- var F, M;
69
- return ((F = Y.find((E) => E.value === m)) == null ? void 0 : F.label) ?? ((M = (a.options ?? []).find((E) => E.value === m)) == null ? void 0 : M.label) ?? h[m] ?? m;
70
- }, J = N.length === 0 ? null : N.length === 1 ? R(N[0]) : `${R(N[0])} +${N.length - 1}`;
67
+ const X = S ? y : a.options ?? [], Z = (x) => {
68
+ var C, E;
69
+ return ((C = X.find((F) => F.value === x)) == null ? void 0 : C.label) ?? ((E = (a.options ?? []).find((F) => F.value === x)) == null ? void 0 : E.label) ?? p[x] ?? x;
70
+ }, R = v.length === 0 ? null : v.length === 1 ? Z(v[0]) : `${Z(v[0])} +${v.length - 1}`;
71
71
  return /* @__PURE__ */ s(
72
- G,
72
+ P,
73
73
  {
74
74
  open: o,
75
- onOpenChange: (m) => {
76
- u(m), m || d("");
75
+ onOpenChange: (x) => {
76
+ m(x), x || d("");
77
77
  },
78
78
  children: [
79
- /* @__PURE__ */ e(P, { asChild: !0, children: /* @__PURE__ */ s(
79
+ /* @__PURE__ */ e(ee, { asChild: !0, children: /* @__PURE__ */ s(
80
80
  "button",
81
81
  {
82
82
  type: "button",
83
83
  className: b(
84
84
  "flex h-8 w-40 items-center justify-between rounded-md border border-slate-200 bg-slate-50 px-2.5 text-[13px] dark:border-border dark:bg-muted/40",
85
- J ? "text-slate-800 dark:text-foreground" : "text-slate-500"
85
+ R ? "text-slate-800 dark:text-foreground" : "text-slate-500"
86
86
  ),
87
87
  children: [
88
- /* @__PURE__ */ e("span", { className: "truncate", children: J ?? a.placeholder }),
88
+ /* @__PURE__ */ e("span", { className: "truncate", children: R ?? a.placeholder }),
89
89
  /* @__PURE__ */ s("span", { className: "ml-1 flex shrink-0 items-center gap-0.5", children: [
90
- N.length > 0 && // biome-ignore lint/a11y/useKeyWithClickEvents: auxiliary clear affordance; Esc + reselect cover keyboard
90
+ v.length > 0 && // biome-ignore lint/a11y/useKeyWithClickEvents: auxiliary clear affordance; Esc + reselect cover keyboard
91
91
  /* @__PURE__ */ e(
92
92
  "span",
93
93
  {
94
94
  role: "button",
95
95
  tabIndex: -1,
96
96
  "aria-label": "Clear filter",
97
- onClick: (m) => {
98
- m.stopPropagation(), c(a.multi ? [] : "");
97
+ onClick: (x) => {
98
+ x.stopPropagation(), c(a.multi ? [] : "");
99
99
  },
100
100
  className: "rounded p-0.5 text-slate-400 hover:text-slate-600",
101
- children: /* @__PURE__ */ e(I, { className: "h-3 w-3" })
101
+ children: /* @__PURE__ */ e(G, { className: "h-3 w-3" })
102
102
  }
103
103
  ),
104
- /* @__PURE__ */ e(K, { className: "h-3 w-3 text-slate-400" })
104
+ /* @__PURE__ */ e(I, { className: "h-3 w-3 text-slate-400" })
105
105
  ] })
106
106
  ]
107
107
  }
108
108
  ) }),
109
- /* @__PURE__ */ e(ee, { className: "w-[240px] p-0", align: "start", children: /* @__PURE__ */ s(ft, { shouldFilter: !S, children: [
109
+ /* @__PURE__ */ e(te, { className: "w-[240px] p-0", align: "start", children: /* @__PURE__ */ s(yt, { shouldFilter: !S, children: [
110
110
  /* @__PURE__ */ e(
111
- yt,
111
+ gt,
112
112
  {
113
113
  placeholder: "Search…",
114
114
  className: "h-8 text-[12px]",
@@ -116,26 +116,26 @@ function zt({
116
116
  onValueChange: d
117
117
  }
118
118
  ),
119
- /* @__PURE__ */ s(gt, { children: [
120
- /* @__PURE__ */ e(kt, { className: "py-3 text-center text-[12px] text-slate-400", children: k ? "Searching…" : "No results" }),
121
- Y.map((m) => {
122
- const F = N.includes(m.value);
119
+ /* @__PURE__ */ s(kt, { children: [
120
+ /* @__PURE__ */ e(vt, { className: "py-3 text-center text-[12px] text-slate-400", children: k ? "Searching…" : "No results" }),
121
+ X.map((x) => {
122
+ const C = v.includes(x.value);
123
123
  return /* @__PURE__ */ s(
124
- vt,
124
+ Nt,
125
125
  {
126
- value: S ? m.value : m.label,
126
+ value: S ? x.value : x.label,
127
127
  onSelect: () => {
128
- v((M) => ({ ...M, [m.value]: m.label })), a.multi ? c(
129
- F ? N.filter((M) => M !== m.value) : [...N, m.value]
130
- ) : (c(F ? "" : m.value), u(!1));
128
+ w((E) => ({ ...E, [x.value]: x.label })), a.multi ? c(
129
+ C ? v.filter((E) => E !== x.value) : [...v, x.value]
130
+ ) : (c(C ? "" : x.value), m(!1));
131
131
  },
132
132
  className: "text-[12px]",
133
133
  children: [
134
- /* @__PURE__ */ e(rt, { className: b("mr-2 h-3 w-3", F ? "opacity-100" : "opacity-0") }),
135
- m.label
134
+ /* @__PURE__ */ e(at, { className: b("mr-2 h-3 w-3", C ? "opacity-100" : "opacity-0") }),
135
+ x.label
136
136
  ]
137
137
  },
138
- m.value
138
+ x.value
139
139
  );
140
140
  })
141
141
  ] })
@@ -149,45 +149,45 @@ function Rt({
149
149
  placeholder: i,
150
150
  onChange: c
151
151
  }) {
152
- const [o, u] = O(!1), l = Oe(a), [d, y] = O((l == null ? void 0 : l.op) ?? "on"), [g, k] = O((l == null ? void 0 : l.from) ?? ""), [x, h] = O((l == null ? void 0 : l.to) ?? "");
153
- Q(() => {
152
+ const [o, m] = O(!1), l = Se(a), [d, y] = O((l == null ? void 0 : l.op) ?? "on"), [g, k] = O((l == null ? void 0 : l.from) ?? ""), [u, p] = O((l == null ? void 0 : l.to) ?? "");
153
+ Y(() => {
154
154
  if (!o) return;
155
- const r = Oe(a);
156
- y((r == null ? void 0 : r.op) ?? "on"), k((r == null ? void 0 : r.from) ?? ""), h((r == null ? void 0 : r.to) ?? "");
155
+ const r = Se(a);
156
+ y((r == null ? void 0 : r.op) ?? "on"), k((r == null ? void 0 : r.from) ?? ""), p((r == null ? void 0 : r.to) ?? "");
157
157
  }, [o, a]);
158
- const v = (r, S, N) => {
159
- S && (c(dt({ op: r, from: S, to: N || S })), (r !== "between" || N) && u(!1));
158
+ const w = (r, S, v) => {
159
+ S && (c(ot({ op: r, from: S, to: v || S })), (r !== "between" || v) && m(!1));
160
160
  };
161
- return /* @__PURE__ */ s(G, { open: o, onOpenChange: u, children: [
162
- /* @__PURE__ */ e(P, { asChild: !0, children: /* @__PURE__ */ s(
161
+ return /* @__PURE__ */ s(P, { open: o, onOpenChange: m, children: [
162
+ /* @__PURE__ */ e(ee, { asChild: !0, children: /* @__PURE__ */ s(
163
163
  "button",
164
164
  {
165
165
  type: "button",
166
166
  "data-date-filter": !0,
167
167
  className: "flex h-8 w-full items-center justify-between gap-1 rounded-md border border-slate-200 bg-slate-50 px-2 text-left text-[12px] dark:border-border dark:bg-muted",
168
168
  children: [
169
- /* @__PURE__ */ e("span", { className: b("truncate", !l && "text-slate-500 dark:text-muted-foreground"), children: l ? st(l) : i }),
169
+ /* @__PURE__ */ e("span", { className: b("truncate", !l && "text-slate-500 dark:text-muted-foreground"), children: l ? it(l) : i }),
170
170
  l ? /* @__PURE__ */ e(
171
- I,
171
+ G,
172
172
  {
173
173
  className: "h-3 w-3 shrink-0 text-slate-400 hover:text-slate-700",
174
174
  onClick: (r) => {
175
175
  r.stopPropagation(), c(null);
176
176
  }
177
177
  }
178
- ) : /* @__PURE__ */ e(at, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
178
+ ) : /* @__PURE__ */ e(lt, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
179
179
  ]
180
180
  }
181
181
  ) }),
182
- /* @__PURE__ */ s(ee, { align: "start", className: "w-[248px] space-y-2 p-2", children: [
183
- /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-1", children: it.map((r) => /* @__PURE__ */ e(
182
+ /* @__PURE__ */ s(te, { align: "start", className: "w-[248px] space-y-2 p-2", children: [
183
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-1", children: dt.map((r) => /* @__PURE__ */ e(
184
184
  "button",
185
185
  {
186
186
  type: "button",
187
187
  "data-date-op": r.op,
188
188
  "aria-pressed": d === r.op,
189
189
  onClick: () => {
190
- y(r.op), g && v(r.op, g, x);
190
+ y(r.op), g && w(r.op, g, u);
191
191
  },
192
192
  className: b(
193
193
  "rounded border px-1 py-1 text-[11px] leading-tight transition-colors",
@@ -204,20 +204,20 @@ function Rt({
204
204
  type: "date",
205
205
  value: g,
206
206
  onChange: (r) => {
207
- k(r.target.value), d !== "between" && v(d, r.target.value, "");
207
+ k(r.target.value), d !== "between" && w(d, r.target.value, "");
208
208
  },
209
209
  className: "h-7 flex-1 rounded border border-slate-200 bg-background px-1 text-[12px] dark:border-border"
210
210
  }
211
211
  ),
212
- d === "between" && /* @__PURE__ */ s(H, { children: [
212
+ d === "between" && /* @__PURE__ */ s(Q, { children: [
213
213
  /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "to" }),
214
214
  /* @__PURE__ */ e(
215
215
  "input",
216
216
  {
217
217
  type: "date",
218
- value: x,
218
+ value: u,
219
219
  onChange: (r) => {
220
- h(r.target.value), v("between", g, r.target.value);
220
+ p(r.target.value), w("between", g, r.target.value);
221
221
  },
222
222
  className: "h-7 flex-1 rounded border border-slate-200 bg-background px-1 text-[12px] dark:border-border"
223
223
  }
@@ -227,15 +227,15 @@ function Rt({
227
227
  ] })
228
228
  ] });
229
229
  }
230
- function Mt({
230
+ function Et({
231
231
  value: a,
232
232
  placeholder: i,
233
233
  unit: c,
234
234
  onChange: o
235
235
  }) {
236
- const [u, l] = O(!1), [d, y] = a.split(":"), g = c ?? "", k = d && y ? `${d}–${y}${g}` : d ? `${d}${g}+` : y ? `≤ ${y}${g}` : i, x = (h, v) => o(h === "" && v === "" ? null : `${h}:${v}`);
237
- return /* @__PURE__ */ s(G, { open: u, onOpenChange: l, children: [
238
- /* @__PURE__ */ e(P, { asChild: !0, children: /* @__PURE__ */ s(
236
+ const [m, l] = O(!1), [d, y] = a.split(":"), g = c ?? "", k = d && y ? `${d}–${y}${g}` : d ? `${d}${g}+` : y ? `≤ ${y}${g}` : i, u = (p, w) => o(p === "" && w === "" ? null : `${p}:${w}`);
237
+ return /* @__PURE__ */ s(P, { open: m, onOpenChange: l, children: [
238
+ /* @__PURE__ */ e(ee, { asChild: !0, children: /* @__PURE__ */ s(
239
239
  "button",
240
240
  {
241
241
  type: "button",
@@ -250,18 +250,18 @@ function Mt({
250
250
  }
251
251
  ),
252
252
  d || y ? /* @__PURE__ */ e(
253
- I,
253
+ G,
254
254
  {
255
255
  className: "h-3 w-3 shrink-0 text-slate-400 hover:text-slate-700",
256
- onClick: (h) => {
257
- h.stopPropagation(), o(null);
256
+ onClick: (p) => {
257
+ p.stopPropagation(), o(null);
258
258
  }
259
259
  }
260
- ) : /* @__PURE__ */ e(K, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
260
+ ) : /* @__PURE__ */ e(I, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
261
261
  ]
262
262
  }
263
263
  ) }),
264
- /* @__PURE__ */ s(ee, { align: "start", className: "w-[200px] p-2", children: [
264
+ /* @__PURE__ */ s(te, { align: "start", className: "w-[200px] p-2", children: [
265
265
  /* @__PURE__ */ e("p", { className: "pb-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: i }),
266
266
  /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
267
267
  /* @__PURE__ */ e(
@@ -271,7 +271,7 @@ function Mt({
271
271
  "aria-label": `Minimum ${i}`,
272
272
  placeholder: "Min",
273
273
  value: d ?? "",
274
- onChange: (h) => x(h.target.value, y ?? ""),
274
+ onChange: (p) => u(p.target.value, y ?? ""),
275
275
  className: "h-7 text-[12px]"
276
276
  }
277
277
  ),
@@ -283,7 +283,7 @@ function Mt({
283
283
  "aria-label": `Maximum ${i}`,
284
284
  placeholder: "Max",
285
285
  value: y ?? "",
286
- onChange: (h) => x(d ?? "", h.target.value),
286
+ onChange: (p) => u(d ?? "", p.target.value),
287
287
  className: "h-7 text-[12px]"
288
288
  }
289
289
  )
@@ -291,50 +291,50 @@ function Mt({
291
291
  ] })
292
292
  ] });
293
293
  }
294
- function Et({
294
+ function Tt({
295
295
  value: a,
296
296
  placeholder: i,
297
297
  onChange: c
298
298
  }) {
299
- const [o, u] = O(!1), l = Se(a), [d, y] = O((l == null ? void 0 : l.op) ?? "eq"), [g, k] = O(l ? String(l.a) : ""), [x, h] = O((l == null ? void 0 : l.b) != null ? String(l.b) : "");
300
- Q(() => {
299
+ const [o, m] = O(!1), l = $e(a), [d, y] = O((l == null ? void 0 : l.op) ?? "eq"), [g, k] = O(l ? String(l.a) : ""), [u, p] = O((l == null ? void 0 : l.b) != null ? String(l.b) : "");
300
+ Y(() => {
301
301
  if (!o) return;
302
- const r = Se(a);
303
- y((r == null ? void 0 : r.op) ?? "eq"), k(r ? String(r.a) : ""), h((r == null ? void 0 : r.b) != null ? String(r.b) : "");
302
+ const r = $e(a);
303
+ y((r == null ? void 0 : r.op) ?? "eq"), k(r ? String(r.a) : ""), p((r == null ? void 0 : r.b) != null ? String(r.b) : "");
304
304
  }, [o, a]);
305
- const v = (r, S, N) => {
306
- S === "" || Number.isNaN(Number(S)) || r === "between" && (N === "" || Number.isNaN(Number(N))) || c(bt({ op: r, a: Number(S), b: N === "" ? void 0 : Number(N) }));
305
+ const w = (r, S, v) => {
306
+ S === "" || Number.isNaN(Number(S)) || r === "between" && (v === "" || Number.isNaN(Number(v))) || c(bt({ op: r, a: Number(S), b: v === "" ? void 0 : Number(v) }));
307
307
  };
308
- return /* @__PURE__ */ s(G, { open: o, onOpenChange: u, children: [
309
- /* @__PURE__ */ e(P, { asChild: !0, children: /* @__PURE__ */ s(
308
+ return /* @__PURE__ */ s(P, { open: o, onOpenChange: m, children: [
309
+ /* @__PURE__ */ e(ee, { asChild: !0, children: /* @__PURE__ */ s(
310
310
  "button",
311
311
  {
312
312
  type: "button",
313
313
  "data-number-filter": !0,
314
314
  className: "flex h-8 w-full items-center justify-between gap-1 rounded-md border border-slate-200 bg-slate-50 px-2 text-left text-[12px] dark:border-border dark:bg-muted",
315
315
  children: [
316
- /* @__PURE__ */ e("span", { className: b("truncate", !l && "text-slate-500 dark:text-muted-foreground"), children: l ? ot(l) : i }),
316
+ /* @__PURE__ */ e("span", { className: b("truncate", !l && "text-slate-500 dark:text-muted-foreground"), children: l ? ct(l) : i }),
317
317
  l ? /* @__PURE__ */ e(
318
- I,
318
+ G,
319
319
  {
320
320
  className: "h-3 w-3 shrink-0 text-slate-400 hover:text-slate-700",
321
321
  onClick: (r) => {
322
322
  r.stopPropagation(), c(null);
323
323
  }
324
324
  }
325
- ) : /* @__PURE__ */ e(K, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
325
+ ) : /* @__PURE__ */ e(I, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
326
326
  ]
327
327
  }
328
328
  ) }),
329
- /* @__PURE__ */ s(ee, { align: "start", className: "w-[220px] space-y-2 p-2", children: [
330
- /* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-1", children: ct.map((r) => /* @__PURE__ */ e(
329
+ /* @__PURE__ */ s(te, { align: "start", className: "w-[220px] space-y-2 p-2", children: [
330
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-1", children: pt.map((r) => /* @__PURE__ */ e(
331
331
  "button",
332
332
  {
333
333
  type: "button",
334
334
  "data-number-op": r.op,
335
335
  "aria-pressed": d === r.op,
336
336
  onClick: () => {
337
- y(r.op), v(r.op, g, x);
337
+ y(r.op), w(r.op, g, u);
338
338
  },
339
339
  className: b(
340
340
  "rounded border px-1 py-1 text-[11px] transition-colors",
@@ -351,20 +351,20 @@ function Et({
351
351
  type: "number",
352
352
  value: g,
353
353
  onChange: (r) => {
354
- k(r.target.value), v(d, r.target.value, x);
354
+ k(r.target.value), w(d, r.target.value, u);
355
355
  },
356
356
  className: "h-7 text-[12px]"
357
357
  }
358
358
  ),
359
- d === "between" && /* @__PURE__ */ s(H, { children: [
359
+ d === "between" && /* @__PURE__ */ s(Q, { children: [
360
360
  /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "–" }),
361
361
  /* @__PURE__ */ e(
362
362
  j,
363
363
  {
364
364
  type: "number",
365
- value: x,
365
+ value: u,
366
366
  onChange: (r) => {
367
- h(r.target.value), v(d, g, r.target.value);
367
+ p(r.target.value), w(d, g, r.target.value);
368
368
  },
369
369
  className: "h-7 text-[12px]"
370
370
  }
@@ -380,7 +380,7 @@ function Fe({
380
380
  onChange: c,
381
381
  layout: o = "inline"
382
382
  }) {
383
- const u = o === "stacked", l = o === "cell", d = typeof i == "string" ? i : "", y = u || l ? "w-full" : "w-40", g = l ? "h-7 text-[12px]" : "text-[13px]";
383
+ const m = o === "stacked", l = o === "cell", d = typeof i == "string" ? i : "", y = m || l ? "w-full" : "w-40", g = l ? "h-7 text-[12px]" : "text-[13px]";
384
384
  let k;
385
385
  if (a.type === "text")
386
386
  k = /* @__PURE__ */ e(
@@ -389,7 +389,7 @@ function Fe({
389
389
  className: b("h-8 border-slate-200 bg-slate-50", g, y),
390
390
  placeholder: a.placeholder,
391
391
  value: d,
392
- onChange: (x) => c(x.target.value)
392
+ onChange: (u) => c(u.target.value)
393
393
  }
394
394
  );
395
395
  else if (a.type === "combobox")
@@ -397,10 +397,10 @@ function Fe({
397
397
  "div",
398
398
  {
399
399
  className: b(
400
- (u || l) && "[&>button]:w-full",
400
+ (m || l) && "[&>button]:w-full",
401
401
  l && "[&>button]:h-7 [&>button]:min-w-[88px] [&>button]:px-1.5 [&>button]:text-[12px]"
402
402
  ),
403
- children: /* @__PURE__ */ e(zt, { def: a, value: i, onChange: c })
403
+ children: /* @__PURE__ */ e(Mt, { def: a, value: i, onChange: c })
404
404
  }
405
405
  );
406
406
  else if (a.type === "date")
@@ -409,30 +409,30 @@ function Fe({
409
409
  {
410
410
  value: d,
411
411
  placeholder: a.placeholder,
412
- onChange: (x) => c(x ?? "")
412
+ onChange: (u) => c(u ?? "")
413
413
  }
414
414
  ) });
415
415
  else if (a.type === "number")
416
416
  k = /* @__PURE__ */ e("div", { className: b(l && "[&>div>button]:h-7 [&>div>button]:text-[12px]", y), children: /* @__PURE__ */ e(
417
- Et,
417
+ Tt,
418
418
  {
419
419
  value: d,
420
420
  placeholder: a.placeholder,
421
- onChange: (x) => c(x ?? "")
421
+ onChange: (u) => c(u ?? "")
422
422
  }
423
423
  ) });
424
424
  else if (a.type === "range" && l)
425
425
  k = /* @__PURE__ */ e("div", { className: "[&>div>button]:h-7 [&>div>button]:text-[12px] w-full", children: /* @__PURE__ */ e(
426
- Mt,
426
+ Et,
427
427
  {
428
428
  value: d,
429
429
  placeholder: a.placeholder,
430
430
  unit: a.range_unit,
431
- onChange: (x) => c(x ?? "")
431
+ onChange: (u) => c(u ?? "")
432
432
  }
433
433
  ) });
434
434
  else if (a.type === "range") {
435
- const [x, h] = d.split(":");
435
+ const [u, p] = d.split(":");
436
436
  k = /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
437
437
  /* @__PURE__ */ e(
438
438
  j,
@@ -441,11 +441,11 @@ function Fe({
441
441
  className: b(
442
442
  "h-8 border-slate-200 bg-slate-50",
443
443
  g,
444
- u || l ? "w-full min-w-[48px]" : "w-20"
444
+ m || l ? "w-full min-w-[48px]" : "w-20"
445
445
  ),
446
446
  placeholder: "Min",
447
- value: x ?? "",
448
- onChange: (v) => c(`${v.target.value}:${h ?? ""}`)
447
+ value: u ?? "",
448
+ onChange: (w) => c(`${w.target.value}:${p ?? ""}`)
449
449
  }
450
450
  ),
451
451
  /* @__PURE__ */ e("span", { className: "text-[12px] text-slate-400", children: "–" }),
@@ -456,23 +456,23 @@ function Fe({
456
456
  className: b(
457
457
  "h-8 border-slate-200 bg-slate-50",
458
458
  g,
459
- u || l ? "w-full min-w-[48px]" : "w-20"
459
+ m || l ? "w-full min-w-[48px]" : "w-20"
460
460
  ),
461
461
  placeholder: "Max",
462
- value: h ?? "",
463
- onChange: (v) => c(`${x ?? ""}:${v.target.value}`)
462
+ value: p ?? "",
463
+ onChange: (w) => c(`${u ?? ""}:${w.target.value}`)
464
464
  }
465
465
  )
466
466
  ] });
467
467
  } else
468
- k = /* @__PURE__ */ s(Nt, { value: d === "" ? "__all__" : d, onValueChange: (h) => c(h === "__all__" ? "" : h), children: [
469
- /* @__PURE__ */ e(wt, { className: b("h-8 border-slate-200 bg-slate-50", g, y), children: /* @__PURE__ */ e(_t, { placeholder: a.placeholder }) }),
470
- /* @__PURE__ */ s(Ot, { children: [
471
- /* @__PURE__ */ e(ze, { value: "__all__", children: a.placeholder }),
472
- (a.options ?? []).filter((h) => h.value !== "").map((h) => /* @__PURE__ */ e(ze, { value: h.value, children: h.label }, h.value))
468
+ k = /* @__PURE__ */ s(wt, { value: d === "" ? "__all__" : d, onValueChange: (p) => c(p === "__all__" ? "" : p), children: [
469
+ /* @__PURE__ */ e(_t, { className: b("h-8 border-slate-200 bg-slate-50", g, y), children: /* @__PURE__ */ e(Ot, { placeholder: a.placeholder }) }),
470
+ /* @__PURE__ */ s(St, { children: [
471
+ /* @__PURE__ */ e(Me, { value: "__all__", children: a.placeholder }),
472
+ (a.options ?? []).filter((p) => p.value !== "").map((p) => /* @__PURE__ */ e(Me, { value: p.value, children: p.label }, p.value))
473
473
  ] })
474
474
  ] });
475
- return u ? /* @__PURE__ */ s("div", { className: "space-y-1", children: [
475
+ return m ? /* @__PURE__ */ s("div", { className: "space-y-1", children: [
476
476
  /* @__PURE__ */ s("span", { className: "flex items-center gap-1.5 text-[11px] font-medium text-slate-500 dark:text-muted-foreground", children: [
477
477
  Ft(a),
478
478
  a.restricted && /* @__PURE__ */ e(
@@ -492,192 +492,193 @@ function Fe({
492
492
  className: "[&_button]:!border-amber-400 [&_input]:!border-amber-400 dark:[&_button]:!border-amber-500/60 dark:[&_input]:!border-amber-500/60",
493
493
  children: k
494
494
  }
495
- ) : /* @__PURE__ */ e(H, { children: k });
495
+ ) : /* @__PURE__ */ e(Q, { children: k });
496
496
  }
497
497
  function Ft(a) {
498
498
  return a.placeholder.replace(/^Search\s+/i, "").replace(/[…]|\.{3}$/g, "");
499
499
  }
500
- function Gt(a, i) {
500
+ function Pt(a, i) {
501
501
  const c = (o) => {
502
- var u, l;
503
- return ((l = (u = a.options) == null ? void 0 : u.find((d) => d.value === o)) == null ? void 0 : l.label) ?? o;
502
+ var m, l;
503
+ return ((l = (m = a.options) == null ? void 0 : m.find((d) => d.value === o)) == null ? void 0 : l.label) ?? o;
504
504
  };
505
505
  if (Array.isArray(i)) {
506
506
  const o = i.map(c);
507
507
  return o.slice(0, 2).join(", ") + (o.length > 2 ? ` +${o.length - 2}` : "");
508
508
  }
509
509
  if (a.type === "range") {
510
- const [o, u] = i.split(":");
511
- return [o && `≥${o}`, u && `≤${u}`].filter(Boolean).join(" ");
510
+ const [o, m] = i.split(":");
511
+ return [o && `≥${o}`, m && `≤${m}`].filter(Boolean).join(" ");
512
512
  }
513
513
  return c(i);
514
514
  }
515
- function Pt({
515
+ function er({
516
516
  columns: a,
517
517
  rows: i,
518
518
  rowKey: c,
519
519
  total: o,
520
- page: u,
520
+ page: m,
521
521
  limit: l = 25,
522
522
  isLoading: d,
523
523
  isError: y,
524
524
  errorMessage: g,
525
- sort: k = "",
526
- onSortChange: x,
527
- onPageChange: h,
528
- onRowClick: v,
529
- onRowContextMenu: r,
530
- searchValue: S,
531
- onSearchChange: N,
532
- searchPlaceholder: Y = "Search…",
525
+ onRetry: k,
526
+ sort: u = "",
527
+ onSortChange: p,
528
+ onPageChange: w,
529
+ onRowClick: r,
530
+ onRowContextMenu: S,
531
+ searchValue: v,
532
+ onSearchChange: X,
533
+ searchPlaceholder: Z = "Search…",
533
534
  filterDefs: R,
534
- filterValues: J = {},
535
- onFilterChange: m,
536
- toolbarRight: F,
537
- emptyMessage: M = "No records found.",
538
- minBodyHeight: E,
539
- fillHeight: te = !1,
540
- footer: je,
541
- hideFilterRow: Ae = !1,
542
- nowrapCells: Le = !1,
543
- density: re = "comfortable",
535
+ filterValues: x = {},
536
+ onFilterChange: C,
537
+ toolbarRight: E,
538
+ emptyMessage: F = "No records found.",
539
+ minBodyHeight: q,
540
+ fillHeight: re = !1,
541
+ footer: Ae,
542
+ hideFilterRow: Le = !1,
543
+ nowrapCells: We = !1,
544
+ density: ae = "comfortable",
544
545
  pinFirstColumn: V = !1,
545
546
  columnPins: f,
546
- onColumnPinChange: ae,
547
- columnFilterRow: We = !1,
548
- hScrollProxy: pe = !1,
547
+ onColumnPinChange: le,
548
+ columnFilterRow: qe = !1,
549
+ hScrollProxy: he = !1,
549
550
  selectedIds: T,
550
- onSelectionChange: C,
551
- rowClassName: le,
552
- rowDragProps: ne,
553
- rowTitle: se,
554
- enterKey: qe,
551
+ onSelectionChange: z,
552
+ rowClassName: ne,
553
+ rowDragProps: se,
554
+ rowTitle: ie,
555
+ enterKey: Be,
555
556
  rowGroups: A,
556
- collapsedGroups: ie,
557
- onToggleGroup: de
557
+ collapsedGroups: de,
558
+ onToggleGroup: oe
558
559
  }) {
559
- const he = Math.ceil(o / l), Be = (u - 1) * l + 1, Ue = Math.min(u * l, o), me = !Ae && R && R.length > 0, Je = S !== void 0 || me || F !== void 0, Xe = (t) => {
560
- !t.sortable || !x || x($t(k, t.key));
561
- }, _ = f !== void 0, L = _e(() => {
560
+ const me = Math.ceil(o / l), Ue = (m - 1) * l + 1, Je = Math.min(m * l, o), ue = !Le && R && R.length > 0, Xe = v !== void 0 || ue || E !== void 0, He = (t) => {
561
+ !t.sortable || !p || p(Ct(u, t.key));
562
+ }, _ = f !== void 0, L = Oe(() => {
562
563
  if (!_ || !f) return a;
563
- const t = a.filter((z) => f[z.key] === "left"), n = a.filter((z) => f[z.key] === "right"), p = a.filter((z) => !f[z.key]);
564
- return [...t, ...p, ...n];
565
- }, [a, f, _]), ue = D({}), X = D(null), xe = D(null), fe = !d && (A ? A.length === 0 : i.length === 0), [ye, He] = O(null);
566
- Q(() => {
567
- const t = X.current;
568
- if (!fe || !t) return;
569
- const n = () => He(t.clientWidth);
564
+ const t = a.filter((M) => f[M.key] === "left"), n = a.filter((M) => f[M.key] === "right"), h = a.filter((M) => !f[M.key]);
565
+ return [...t, ...h, ...n];
566
+ }, [a, f, _]), xe = K({}), H = K(null), fe = K(null), ye = !d && (A ? A.length === 0 : i.length === 0), [ge, Qe] = O(null);
567
+ Y(() => {
568
+ const t = H.current;
569
+ if (!ye || !t) return;
570
+ const n = () => Qe(t.clientWidth);
570
571
  if (n(), typeof ResizeObserver > "u") return;
571
- const p = new ResizeObserver(n);
572
- return p.observe(t), () => p.disconnect();
573
- }, [fe]);
574
- const [ge, Qe] = O({}), [, Ye] = O(0);
575
- Q(() => {
576
- const t = X.current;
572
+ const h = new ResizeObserver(n);
573
+ return h.observe(t), () => h.disconnect();
574
+ }, [ye]);
575
+ const [ke, Ye] = O({}), [, Ze] = O(0);
576
+ Y(() => {
577
+ const t = H.current;
577
578
  if (!_ || !t || typeof ResizeObserver > "u") return;
578
- const n = new ResizeObserver(() => Ye(t.clientWidth));
579
+ const n = new ResizeObserver(() => Ze(t.clientWidth));
579
580
  return n.observe(t), () => n.disconnect();
580
- }, [_, d]), nt(() => {
581
- var Ne, we;
581
+ }, [_, d]), st(() => {
582
+ var we, _e;
582
583
  if (!_ || !f) return;
583
- const t = (w) => {
584
+ const t = (N) => {
584
585
  var W;
585
- return ((W = ue.current[w]) == null ? void 0 : W.getBoundingClientRect().width) ?? 120;
586
- }, n = C ? ((Ne = xe.current) == null ? void 0 : Ne.getBoundingClientRect().width) ?? 40 : 0, { left: p, right: z } = pt(
587
- L.filter((w) => f[w.key] === "left").map((w) => w.key),
588
- L.filter((w) => f[w.key] === "right").map((w) => w.key),
586
+ return ((W = xe.current[N]) == null ? void 0 : W.getBoundingClientRect().width) ?? 120;
587
+ }, n = z ? ((we = fe.current) == null ? void 0 : we.getBoundingClientRect().width) ?? 40 : 0, { left: h, right: M } = ht(
588
+ L.filter((N) => f[N.key] === "left").map((N) => N.key),
589
+ L.filter((N) => f[N.key] === "right").map((N) => N.key),
589
590
  t,
590
591
  n,
591
- ((we = X.current) == null ? void 0 : we.clientWidth) ?? 0
592
+ ((_e = H.current) == null ? void 0 : _e.clientWidth) ?? 0
592
593
  ), $ = {};
593
- let q = n;
594
- p.forEach((w, W) => {
595
- $[w] = { side: "left", offset: Math.floor(q), seam: W === p.length - 1 }, q += t(w);
594
+ let B = n;
595
+ h.forEach((N, W) => {
596
+ $[N] = { side: "left", offset: Math.floor(B), seam: W === h.length - 1 }, B += t(N);
596
597
  });
597
- let ve = 0;
598
- for (let w = z.length - 1; w >= 0; w--) {
599
- const W = z[w];
600
- $[W] = { side: "right", offset: Math.floor(ve), seam: w === 0 }, ve += t(W);
598
+ let Ne = 0;
599
+ for (let N = M.length - 1; N >= 0; N--) {
600
+ const W = M[N];
601
+ $[W] = { side: "right", offset: Math.floor(Ne), seam: N === 0 }, Ne += t(W);
601
602
  }
602
- Qe((w) => JSON.stringify(w) === JSON.stringify($) ? w : $);
603
+ Ye((N) => JSON.stringify(N) === JSON.stringify($) ? N : $);
603
604
  });
604
- const oe = (t) => {
605
- const n = ge[t];
605
+ const ce = (t) => {
606
+ const n = ke[t];
606
607
  if (!(!_ || !n))
607
608
  return n.side === "left" ? { left: n.offset } : { right: n.offset };
608
- }, ce = (t, n) => {
609
- const p = ge[t];
610
- if (!(!_ || !p))
609
+ }, pe = (t, n) => {
610
+ const h = ke[t];
611
+ if (!(!_ || !h))
611
612
  return b(
612
613
  // dt-pinned: pinned headers offset via inline style (not left-0), so the
613
614
  // fillHeight wrapper's z variants need a CLASS to elevate them above the
614
615
  // other header cells — same-z siblings paint in DOM order and a later
615
616
  // header scrolls OVER the pinned one otherwise.
616
617
  n ? "dt-pinned sticky z-[2]" : "sticky z-[1] bg-inherit",
617
- p.side === "left" && p.seam && "border-r border-slate-200 dark:border-border",
618
- p.side === "right" && p.seam && "border-l border-slate-200 dark:border-border"
618
+ h.side === "left" && h.seam && "border-r border-slate-200 dark:border-border",
619
+ h.side === "right" && h.seam && "border-l border-slate-200 dark:border-border"
619
620
  );
620
- }, Ze = (t) => {
621
- if (!ae) return;
621
+ }, De = (t) => {
622
+ if (!le) return;
622
623
  const n = (f == null ? void 0 : f[t]) ?? null;
623
- ae(t, n === null ? "left" : n === "left" ? "right" : null);
624
- }, De = _e(() => {
624
+ le(t, n === null ? "left" : n === "left" ? "right" : null);
625
+ }, Ke = Oe(() => {
625
626
  const t = /* @__PURE__ */ new Map();
626
627
  for (const n of R ?? []) t.set(n.key, n);
627
628
  return t;
628
- }, [R]), Ke = We && ((R == null ? void 0 : R.length) ?? 0) > 0, ke = (t, n) => {
629
- const p = c ? c(t, n) : String(n), z = (T == null ? void 0 : T.includes(p)) ?? !1;
629
+ }, [R]), Ie = qe && ((R == null ? void 0 : R.length) ?? 0) > 0, ve = (t, n) => {
630
+ const h = c ? c(t, n) : String(n), M = (T == null ? void 0 : T.includes(h)) ?? !1;
630
631
  return /* @__PURE__ */ s(
631
- B,
632
+ U,
632
633
  {
633
- ...ne == null ? void 0 : ne(t),
634
+ ...se == null ? void 0 : se(t),
634
635
  className: b(
635
636
  // NAMED group: queue cells already use bare `group-hover:` against
636
637
  // their own local group, and claiming the unnamed one here would
637
638
  // make those reveal on row hover instead.
638
639
  "group/row nvr-row-enter border-slate-100 transition-colors duration-150",
639
640
  (V || _) && "bg-white dark:bg-card",
640
- v && (V || _ ? "cursor-pointer hover:bg-slate-50 dark:hover:bg-muted" : "cursor-pointer hover:bg-slate-50/80"),
641
- le == null ? void 0 : le(t),
641
+ r && (V || _ ? "cursor-pointer hover:bg-slate-50 dark:hover:bg-muted" : "cursor-pointer hover:bg-slate-50/80"),
642
+ ne == null ? void 0 : ne(t),
642
643
  // Pinned sticky cells use bg-inherit, so a selected row's bg must be
643
644
  // OPAQUE or horizontally-scrolled content bleeds through the pinned
644
645
  // column. bg-nvr-cyan/5 is semi-transparent — use an opaque equivalent
645
646
  // (5% nvr-cyan #00ceff over white / card) when pinning.
646
- z && (V || _ ? "bg-[#f2fdff] dark:bg-[#20303a]" : "bg-nvr-cyan/5")
647
+ M && (V || _ ? "bg-[#f2fdff] dark:bg-[#20303a]" : "bg-nvr-cyan/5")
647
648
  ),
648
649
  style: { animationDelay: `${Math.min(n, 14) * 16}ms` },
649
- "data-row-key": p,
650
- title: se == null ? void 0 : se(t),
651
- onClick: () => v == null ? void 0 : v(t),
652
- onContextMenu: r ? ($) => r(t, $) : void 0,
650
+ "data-row-key": h,
651
+ title: ie == null ? void 0 : ie(t),
652
+ onClick: () => r == null ? void 0 : r(t),
653
+ onContextMenu: S ? ($) => S(t, $) : void 0,
653
654
  children: [
654
- C && /* @__PURE__ */ e(
655
- Z,
655
+ z && /* @__PURE__ */ e(
656
+ D,
656
657
  {
657
658
  className: b(
658
659
  "w-9 px-3",
659
- re === "compact" ? "py-1" : "py-2",
660
+ ae === "compact" ? "py-1" : "py-2",
660
661
  (V || _) && "sticky left-0 z-[1] min-w-[40px] bg-inherit"
661
662
  ),
662
663
  onClick: ($) => {
663
- $.stopPropagation(), C(z ? (T == null ? void 0 : T.filter((q) => q !== p)) ?? [] : [...T ?? [], p]);
664
+ $.stopPropagation(), z(M ? (T == null ? void 0 : T.filter((B) => B !== h)) ?? [] : [...T ?? [], h]);
664
665
  },
665
- children: /* @__PURE__ */ e(Ce, { checked: z, "aria-label": "Select row" })
666
+ children: /* @__PURE__ */ e(ze, { checked: M, "aria-label": "Select row" })
666
667
  }
667
668
  ),
668
- L.map(($, q) => /* @__PURE__ */ e(
669
- Z,
669
+ L.map(($, B) => /* @__PURE__ */ e(
670
+ D,
670
671
  {
671
- style: oe($.key),
672
+ style: ce($.key),
672
673
  className: b(
673
674
  "px-3",
674
- re === "compact" ? "py-1" : "py-2",
675
- Le && "whitespace-nowrap",
676
- !_ && V && q === 0 && b(
675
+ ae === "compact" ? "py-1" : "py-2",
676
+ We && "whitespace-nowrap",
677
+ !_ && V && B === 0 && b(
677
678
  "sticky z-[1] border-r border-slate-100 bg-inherit dark:border-border",
678
- C ? "left-[39px]" : "left-0"
679
+ z ? "left-[39px]" : "left-0"
679
680
  ),
680
- ce($.key, !1),
681
+ pe($.key, !1),
681
682
  $.className
682
683
  ),
683
684
  children: $.render ? $.render(t, n) : String(t[$.key] ?? "—")
@@ -686,44 +687,65 @@ function Pt({
686
687
  ))
687
688
  ]
688
689
  },
689
- p
690
+ h
690
691
  );
691
692
  };
692
- return /* @__PURE__ */ s(H, { children: [
693
- /* @__PURE__ */ e(ht, {}),
694
- y && g && /* @__PURE__ */ e("div", { className: "mb-4 rounded-md border border-red-200 bg-red-50 px-4 py-2.5 text-[13px] text-red-700", children: g }),
693
+ return /* @__PURE__ */ s(Q, { children: [
694
+ /* @__PURE__ */ e(mt, {}),
695
+ y && g && /* @__PURE__ */ s(
696
+ "div",
697
+ {
698
+ role: "alert",
699
+ className: "mb-4 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md border border-red-200 bg-red-50 px-4 py-2.5 text-[13px] text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300",
700
+ children: [
701
+ /* @__PURE__ */ s("span", { children: [
702
+ g,
703
+ i.length > 0 && " Showing the last list that loaded."
704
+ ] }),
705
+ k && /* @__PURE__ */ e(
706
+ "button",
707
+ {
708
+ type: "button",
709
+ onClick: k,
710
+ className: "font-medium underline underline-offset-2 hover:text-red-900 dark:hover:text-red-200",
711
+ children: "Try again"
712
+ }
713
+ )
714
+ ]
715
+ }
716
+ ),
695
717
  /* @__PURE__ */ s(
696
718
  "div",
697
719
  {
698
720
  className: b(
699
721
  "overflow-hidden rounded-lg border border-slate-200 bg-white",
700
- te && "flex h-full min-h-0 flex-col"
722
+ re && "flex h-full min-h-0 flex-col"
701
723
  ),
702
724
  children: [
703
- Je && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 border-b border-slate-100 px-3 py-2.5", children: [
704
- N !== void 0 && /* @__PURE__ */ s("div", { className: "relative", children: [
705
- /* @__PURE__ */ e(Ie, { className: "absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
725
+ Xe && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 border-b border-slate-100 px-3 py-2.5", children: [
726
+ X !== void 0 && /* @__PURE__ */ s("div", { className: "relative", children: [
727
+ /* @__PURE__ */ e(Ge, { className: "absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
706
728
  /* @__PURE__ */ e(
707
729
  j,
708
730
  {
709
731
  className: "h-8 w-56 border-slate-200 bg-slate-50 pl-8 text-[13px]",
710
- placeholder: Y,
711
- value: S ?? "",
712
- onChange: (t) => N(t.target.value)
732
+ placeholder: Z,
733
+ value: v ?? "",
734
+ onChange: (t) => X(t.target.value)
713
735
  }
714
736
  )
715
737
  ] }),
716
- me && (R == null ? void 0 : R.map((t) => /* @__PURE__ */ e(
738
+ ue && (R == null ? void 0 : R.map((t) => /* @__PURE__ */ e(
717
739
  Fe,
718
740
  {
719
741
  def: t,
720
- value: J[t.key] ?? "",
721
- onChange: (n) => m == null ? void 0 : m(t.key, n)
742
+ value: x[t.key] ?? "",
743
+ onChange: (n) => C == null ? void 0 : C(t.key, n)
722
744
  },
723
745
  t.key
724
746
  ))),
725
747
  /* @__PURE__ */ e("div", { className: "flex-1" }),
726
- F
748
+ E
727
749
  ] }),
728
750
  d ? (
729
751
  // #3229 — the real header (same labels, h-9) over rows with the real cell padding
@@ -734,13 +756,13 @@ function Pt({
734
756
  {
735
757
  "data-skeleton": "table",
736
758
  "aria-busy": "true",
737
- className: b(te && "min-h-0 flex-1 overflow-hidden"),
738
- style: E ? { minHeight: E } : void 0,
759
+ className: b(re && "min-h-0 flex-1 overflow-hidden"),
760
+ style: q ? { minHeight: q } : void 0,
739
761
  children: /* @__PURE__ */ s(Re, { className: "border-separate border-spacing-0", children: [
740
- /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ s(B, { className: "border-b border-slate-200 hover:bg-transparent", children: [
741
- C && /* @__PURE__ */ e(U, { className: "h-9 w-9 border-b border-slate-200 bg-slate-50 px-3 py-0 dark:border-border dark:bg-muted" }),
762
+ /* @__PURE__ */ e(Ee, { children: /* @__PURE__ */ s(U, { className: "border-b border-slate-200 hover:bg-transparent", children: [
763
+ z && /* @__PURE__ */ e(J, { className: "h-9 w-9 border-b border-slate-200 bg-slate-50 px-3 py-0 dark:border-border dark:bg-muted" }),
742
764
  L.map((t) => /* @__PURE__ */ e(
743
- U,
765
+ J,
744
766
  {
745
767
  className: b(
746
768
  "h-9 whitespace-nowrap border-b border-slate-200 bg-slate-50 px-3 py-0 text-[11px] font-medium text-slate-500 dark:border-border dark:bg-muted",
@@ -751,59 +773,59 @@ function Pt({
751
773
  t.key
752
774
  ))
753
775
  ] }) }),
754
- /* @__PURE__ */ e(Ee, { children: /* @__PURE__ */ e(
755
- xt,
776
+ /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(
777
+ ft,
756
778
  {
757
779
  columns: L.map((t) => ({ key: t.key })),
758
- rows: Math.min(Math.max(l ?? St.length, 1), 15),
780
+ rows: Math.min(Math.max(l ?? $t.length, 1), 15),
759
781
  rowClassName: "",
760
- cellClassName: b("px-3", re === "compact" ? "py-1" : "py-2"),
761
- leadingCells: C ? 1 : 0
782
+ cellClassName: b("px-3", ae === "compact" ? "py-1" : "py-2"),
783
+ leadingCells: z ? 1 : 0
762
784
  }
763
785
  ) })
764
786
  ] })
765
787
  }
766
788
  )
767
- ) : /* @__PURE__ */ s(H, { children: [
789
+ ) : /* @__PURE__ */ s(Q, { children: [
768
790
  /* @__PURE__ */ e(
769
791
  "div",
770
792
  {
771
- ref: X,
793
+ ref: H,
772
794
  className: b(
773
- pe && "overflow-x-hidden [&>div]:overflow-visible",
795
+ he && "overflow-x-hidden [&>div]:overflow-visible",
774
796
  // Bounded mode: rows scroll here under a sticky header. Header
775
797
  // cells sit above pinned body cells (z-[1/2]); the pinned
776
798
  // header corner (left-0) tops the other header cells so
777
799
  // horizontal scroll cannot bleed through it.
778
- te && "min-h-0 flex-1 overflow-y-auto [&_thead_th]:sticky [&_thead_th]:top-0 [&_thead_th]:z-[5] [&_thead_th.left-0]:z-[6] [&_thead_th.dt-pinned]:z-[6]"
800
+ re && "min-h-0 flex-1 overflow-y-auto [&_thead_th]:sticky [&_thead_th]:top-0 [&_thead_th]:z-[5] [&_thead_th.left-0]:z-[6] [&_thead_th.dt-pinned]:z-[6]"
779
801
  ),
780
- style: E ? { minHeight: E } : void 0,
802
+ style: q ? { minHeight: q } : void 0,
781
803
  children: /* @__PURE__ */ s(
782
804
  Re,
783
805
  {
784
806
  "data-copy-cells": "",
785
807
  className: "border-separate border-spacing-0 [&>tbody>tr.border-b:not(:last-child)>td]:border-b [&>tbody>tr.border-b:not(:last-child)>td]:[border-bottom-color:inherit] [&>thead>tr.border-b>th]:border-b [&>thead>tr.border-b>th]:[border-bottom-color:inherit]",
786
808
  children: [
787
- /* @__PURE__ */ s(Me, { children: [
788
- /* @__PURE__ */ s(B, { className: "border-b border-slate-200 hover:bg-transparent", children: [
789
- C && /* @__PURE__ */ e(
790
- U,
809
+ /* @__PURE__ */ s(Ee, { children: [
810
+ /* @__PURE__ */ s(U, { className: "border-b border-slate-200 hover:bg-transparent", children: [
811
+ z && /* @__PURE__ */ e(
812
+ J,
791
813
  {
792
- ref: xe,
814
+ ref: fe,
793
815
  className: b(
794
816
  "h-9 w-9 bg-slate-50 px-3 py-0",
795
817
  (V || _) && "sticky left-0 z-[2] min-w-[40px]"
796
818
  ),
797
819
  children: /* @__PURE__ */ e(
798
- Ce,
820
+ ze,
799
821
  {
800
822
  checked: i.length > 0 && i.every((t, n) => {
801
- const p = c ? c(t, n) : String(n);
802
- return T == null ? void 0 : T.includes(p);
823
+ const h = c ? c(t, n) : String(n);
824
+ return T == null ? void 0 : T.includes(h);
803
825
  }),
804
826
  onCheckedChange: (t) => {
805
- C(
806
- t ? i.map((n, p) => c ? c(n, p) : String(p)) : []
827
+ z(
828
+ t ? i.map((n, h) => c ? c(n, h) : String(h)) : []
807
829
  );
808
830
  },
809
831
  "aria-label": "Select all"
@@ -812,33 +834,33 @@ function Pt({
812
834
  }
813
835
  ),
814
836
  L.map((t, n) => /* @__PURE__ */ e(
815
- U,
837
+ J,
816
838
  {
817
- ref: (p) => {
818
- ue.current[t.key] = p;
839
+ ref: (h) => {
840
+ xe.current[t.key] = h;
819
841
  },
820
- style: oe(t.key),
842
+ style: ce(t.key),
821
843
  className: b(
822
844
  "group/th h-9 whitespace-nowrap bg-slate-50 px-3 py-0 text-[11px] font-medium text-slate-500",
823
- t.sortable && x && "cursor-pointer select-none hover:text-slate-600",
845
+ t.sortable && p && "cursor-pointer select-none hover:text-slate-600",
824
846
  !_ && V && n === 0 && b(
825
847
  "sticky z-[2] border-r border-slate-200 dark:border-border",
826
- C ? "left-[39px]" : "left-0"
848
+ z ? "left-[39px]" : "left-0"
827
849
  ),
828
850
  _ && "bg-slate-50 dark:bg-muted",
829
- ce(t.key, !0),
851
+ pe(t.key, !0),
830
852
  t.headerClassName
831
853
  ),
832
- onClick: () => Xe(t),
854
+ onClick: () => He(t),
833
855
  children: /* @__PURE__ */ s("span", { className: "inline-flex items-center", children: [
834
856
  t.header,
835
- t.sortable && x && /* @__PURE__ */ e(Ct, { field: t.key, sort: k }),
836
- _ && ae && t.key !== "claim" && /* @__PURE__ */ e(
857
+ t.sortable && p && /* @__PURE__ */ e(zt, { field: t.key, sort: u }),
858
+ _ && le && t.key !== "claim" && /* @__PURE__ */ e(
837
859
  "button",
838
860
  {
839
861
  type: "button",
840
- onClick: (p) => {
841
- p.stopPropagation(), Ze(t.key);
862
+ onClick: (h) => {
863
+ h.stopPropagation(), De(t.key);
842
864
  },
843
865
  "aria-label": `Pin column ${t.key}`,
844
866
  title: (f == null ? void 0 : f[t.key]) === "left" ? "Pinned left — click to pin right" : (f == null ? void 0 : f[t.key]) === "right" ? "Pinned right — click to unpin" : "Pin column",
@@ -847,7 +869,7 @@ function Pt({
847
869
  f != null && f[t.key] ? "text-nvr-cyan opacity-100" : "text-slate-300 opacity-0 hover:text-slate-500 group-hover/th:opacity-100"
848
870
  ),
849
871
  children: /* @__PURE__ */ e(
850
- Ge,
872
+ Pe,
851
873
  {
852
874
  className: b(
853
875
  "h-3 w-3",
@@ -862,9 +884,9 @@ function Pt({
862
884
  t.key
863
885
  ))
864
886
  ] }),
865
- Ke && /* @__PURE__ */ s(B, { className: "border-b border-slate-200 hover:bg-transparent", children: [
866
- C && /* @__PURE__ */ e(
867
- U,
887
+ Ie && /* @__PURE__ */ s(U, { className: "border-b border-slate-200 hover:bg-transparent", children: [
888
+ z && /* @__PURE__ */ e(
889
+ J,
868
890
  {
869
891
  className: b(
870
892
  "h-9 w-9 bg-slate-50 px-3 py-1",
@@ -873,22 +895,22 @@ function Pt({
873
895
  }
874
896
  ),
875
897
  L.map((t) => {
876
- const n = De.get(t.key);
898
+ const n = Ke.get(t.key);
877
899
  return /* @__PURE__ */ e(
878
- U,
900
+ J,
879
901
  {
880
- style: oe(t.key),
902
+ style: ce(t.key),
881
903
  className: b(
882
904
  "h-9 bg-slate-50 px-1.5 py-1 align-middle",
883
905
  _ && "bg-slate-50 dark:bg-muted",
884
- ce(t.key, !0)
906
+ pe(t.key, !0)
885
907
  ),
886
- children: n && m ? /* @__PURE__ */ e(
908
+ children: n && C ? /* @__PURE__ */ e(
887
909
  Fe,
888
910
  {
889
911
  def: n,
890
- value: J[n.key] ?? "",
891
- onChange: (p) => m(n.key, p),
912
+ value: x[n.key] ?? "",
913
+ onChange: (h) => C(n.key, h),
892
914
  layout: "cell"
893
915
  }
894
916
  ) : null
@@ -898,23 +920,23 @@ function Pt({
898
920
  })
899
921
  ] })
900
922
  ] }),
901
- /* @__PURE__ */ s(Ee, { className: "tabular-nums", children: [
923
+ /* @__PURE__ */ s(Te, { className: "tabular-nums", children: [
902
924
  A ? A.map((t) => {
903
- const n = (ie == null ? void 0 : ie.has(t.key)) ?? !1;
904
- return /* @__PURE__ */ s(lt.Fragment, { children: [
925
+ const n = (de == null ? void 0 : de.has(t.key)) ?? !1;
926
+ return /* @__PURE__ */ s(nt.Fragment, { children: [
905
927
  /* @__PURE__ */ e(
906
- B,
928
+ U,
907
929
  {
908
930
  className: "nvr-row-enter cursor-pointer border-slate-200 bg-slate-50/80 transition-colors hover:bg-slate-100/80 dark:bg-muted/40",
909
- onClick: () => de == null ? void 0 : de(t.key),
931
+ onClick: () => oe == null ? void 0 : oe(t.key),
910
932
  children: /* @__PURE__ */ e(
911
- Z,
933
+ D,
912
934
  {
913
- colSpan: a.length + (C ? 1 : 0),
935
+ colSpan: a.length + (z ? 1 : 0),
914
936
  className: "px-3 py-1.5",
915
937
  children: /* @__PURE__ */ s("span", { className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 dark:text-foreground", children: [
916
938
  /* @__PURE__ */ e(
917
- Pe,
939
+ et,
918
940
  {
919
941
  className: b(
920
942
  "h-3.5 w-3.5 text-slate-400 transition-transform duration-200",
@@ -928,68 +950,68 @@ function Pt({
928
950
  )
929
951
  }
930
952
  ),
931
- !n && t.rows.map((p, z) => ke(p, z))
953
+ !n && t.rows.map((h, M) => ve(h, M))
932
954
  ] }, t.key);
933
- }) : i.map((t, n) => ke(t, n)),
934
- (A ? A.length === 0 : i.length === 0) && /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(
935
- Z,
955
+ }) : i.map((t, n) => ve(t, n)),
956
+ (A ? A.length === 0 : i.length === 0) && /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(
957
+ D,
936
958
  {
937
- colSpan: a.length + (C ? 1 : 0),
959
+ colSpan: a.length + (z ? 1 : 0),
938
960
  className: "nvr-fade-in p-0 text-center align-middle text-[13px] text-slate-400",
939
- style: E ? { height: Math.max(96, E - 56) } : void 0,
961
+ style: q ? { height: Math.max(96, q - 56) } : void 0,
940
962
  children: /* @__PURE__ */ e(
941
963
  "div",
942
964
  {
943
965
  className: "sticky left-0 py-12",
944
- style: ye ? { width: ye } : void 0,
966
+ style: ge ? { width: ge } : void 0,
945
967
  "data-table-empty": !0,
946
- children: typeof M == "string" ? /* @__PURE__ */ e(mt, { icon: et, title: M }) : M
968
+ children: typeof F == "string" ? /* @__PURE__ */ e(ut, { icon: tt, title: F }) : F
947
969
  }
948
970
  )
949
971
  }
950
972
  ) })
951
- ] }, qe)
973
+ ] }, Be)
952
974
  ]
953
975
  }
954
976
  )
955
977
  }
956
978
  ),
957
- pe && /* @__PURE__ */ e(ut, { scrollerRef: X }),
958
- je,
979
+ he && /* @__PURE__ */ e(xt, { scrollerRef: H }),
980
+ Ae,
959
981
  !A && o > l && /* @__PURE__ */ s("div", { className: "flex items-center justify-between border-t border-slate-100 px-4 py-2.5", children: [
960
982
  /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-400", children: [
961
- be(Be),
962
- "–",
963
983
  be(Ue),
984
+ "–",
985
+ be(Je),
964
986
  " of ",
965
987
  be(o),
966
988
  " records"
967
989
  ] }),
968
990
  /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
969
991
  /* @__PURE__ */ e(
970
- $e,
992
+ Ce,
971
993
  {
972
994
  variant: "ghost",
973
995
  size: "sm",
974
996
  className: "h-7 px-2.5 text-[12px] text-slate-600",
975
- disabled: u <= 1,
976
- onClick: () => h(u - 1),
997
+ disabled: m <= 1,
998
+ onClick: () => w(m - 1),
977
999
  children: "← Prev"
978
1000
  }
979
1001
  ),
980
1002
  /* @__PURE__ */ s("span", { className: "px-2 text-[12px] text-slate-400", children: [
981
- u,
1003
+ m,
982
1004
  " / ",
983
- he
1005
+ me
984
1006
  ] }),
985
1007
  /* @__PURE__ */ e(
986
- $e,
1008
+ Ce,
987
1009
  {
988
1010
  variant: "ghost",
989
1011
  size: "sm",
990
1012
  className: "h-7 px-2.5 text-[12px] text-slate-600",
991
- disabled: u >= he,
992
- onClick: () => h(u + 1),
1013
+ disabled: m >= me,
1014
+ onClick: () => w(m + 1),
993
1015
  children: "Next →"
994
1016
  }
995
1017
  )
@@ -1002,8 +1024,8 @@ function Pt({
1002
1024
  ] });
1003
1025
  }
1004
1026
  export {
1005
- Pt as DataTable,
1027
+ er as DataTable,
1006
1028
  Fe as FilterControl,
1007
1029
  Ft as filterDefLabel,
1008
- Gt as filterValueDisplay
1030
+ Pt as filterValueDisplay
1009
1031
  };