@umriss-ui/table 0.40.3 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/table.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import "./table.css";
3
- import { useState as P, useCallback as fe, useMemo as H, useRef as q, useId as be, useContext as _e, createContext as rt, useSyncExternalStore as st, useLayoutEffect as Z, useEffect as xe } from "react";
4
- import { DEFAULT_FORMATS as xn, treeModel as rn, useVirtual as To, useFormats as ke, useWording as ie, Checkbox as We, DateRangePicker as Ro, FormField as vt, NumberInput as yt, separatorsOf as Oo, Tooltip as tt, Popover as it, Button as Q, TagGroup as An, Tag as Bt, Menu as Nn, MenuItem as nt, MenuSeparator as Eo, ControlSizeProvider as jn, Select as Tn, VisuallyHidden as Re, DatePicker as Mo, Input as Rn, announce as Lo, usePortalTarget as Fo, IconButton as Do, AngleGlyph as Bo, useDensityFor as Vo, assess as Po, verdictWeight as _t, allBranches as Io, duplicateKey as $o } from "@umriss-ui/core";
5
- import { jsx as f, jsxs as j, Fragment as re } from "react/jsx-runtime";
6
- import { createPortal as On } from "react-dom";
7
- function zo(e) {
8
- const [t, n] = P(/* @__PURE__ */ new Set()), o = fe((a) => t.has(a), [t]), r = fe((a) => {
3
+ import { useState as I, useCallback as fe, useMemo as H, useRef as q, useId as be, useContext as _e, createContext as rt, useSyncExternalStore as st, useLayoutEffect as Z, useEffect as Ce } from "react";
4
+ import { DEFAULT_FORMATS as Cn, treeModel as rn, useVirtual as Oo, useFormats as xe, useWording as ie, Checkbox as We, DateRangePicker as Eo, FormField as vt, NumberInput as yt, separatorsOf as Mo, Tooltip as tt, Popover as it, Button as Q, TagGroup as An, Tag as Pt, Menu as Nn, MenuItem as nt, MenuSeparator as Lo, ControlSizeProvider as Tn, Select as Rn, VisuallyHidden as Oe, DatePicker as Fo, Input as On, announce as Bo, usePortalTarget as Do, IconButton as Po, AngleGlyph as Vo, useDensityFor as Io, assess as $o, verdictWeight as _t, allBranches as zo, duplicateKey as Ko } from "@umriss-ui/core";
5
+ import { jsx as f, jsxs as T, Fragment as re } from "react/jsx-runtime";
6
+ import { createPortal as En } from "react-dom";
7
+ function Go(e) {
8
+ const [t, n] = I(/* @__PURE__ */ new Set()), o = fe((a) => t.has(a), [t]), r = fe((a) => {
9
9
  n((u) => {
10
10
  const d = new Set(u);
11
11
  return d.has(a) ? d.delete(a) : d.add(a), d;
@@ -28,7 +28,7 @@ const se = (e) => e == null || typeof e == "number" && Number.isNaN(e);
28
28
  function lt(e) {
29
29
  return se(e) ? "empty" : typeof e == "string" ? "text" : typeof e == "number" ? "number" : typeof e == "boolean" ? "boolean" : e instanceof Date ? Number.isNaN(e.getTime()) ? "empty" : "date" : "other";
30
30
  }
31
- function En(e, t) {
31
+ function Mn(e, t) {
32
32
  for (const n of e) {
33
33
  const o = lt(t(n));
34
34
  if (o !== "empty") return o;
@@ -36,7 +36,7 @@ function En(e, t) {
36
36
  return "empty";
37
37
  }
38
38
  const Vt = (e, t) => t ?? e === "number";
39
- function Be(e, t, n, o) {
39
+ function Pe(e, t, n, o) {
40
40
  switch (lt(e)) {
41
41
  case "text":
42
42
  return e;
@@ -54,9 +54,9 @@ function Be(e, t, n, o) {
54
54
  return null;
55
55
  }
56
56
  }
57
- function kt(e, t) {
57
+ function xt(e, t) {
58
58
  if (!se(e)) {
59
- if (t) return kt(t(e));
59
+ if (t) return xt(t(e));
60
60
  switch (lt(e)) {
61
61
  case "text":
62
62
  return e;
@@ -71,9 +71,9 @@ function kt(e, t) {
71
71
  }
72
72
  }
73
73
  }
74
- function Pt(e, t) {
74
+ function It(e, t) {
75
75
  if (!se(e)) {
76
- if (t) return Pt(t(e));
76
+ if (t) return It(t(e));
77
77
  switch (lt(e)) {
78
78
  case "text":
79
79
  return e;
@@ -88,12 +88,12 @@ function Pt(e, t) {
88
88
  }
89
89
  }
90
90
  }
91
- const It = "absent", Ce = (e) => se(e) ? It : e instanceof Date ? `value:${e.getTime()}` : `value:${String(e)}`, sn = (e) => e instanceof Date ? e.getTime() : typeof e == "number" && !Number.isNaN(e) ? e : void 0;
92
- function $t(e, t) {
91
+ const $t = "absent", Se = (e) => se(e) ? $t : e instanceof Date ? `value:${e.getTime()}` : `value:${String(e)}`, sn = (e) => e instanceof Date ? e.getTime() : typeof e == "number" && !Number.isNaN(e) ? e : void 0;
92
+ function zt(e, t) {
93
93
  const n = t.map(e.read).filter((u) => !se(u) && !(u instanceof Date && Number.isNaN(u.getTime()))), o = e.aggregate;
94
94
  if (typeof o == "function") return o(n, t);
95
95
  if (o === "count") return n.length;
96
- if (o === "distinct") return new Set(n.map(Ce)).size;
96
+ if (o === "distinct") return new Set(n.map(Se)).size;
97
97
  const r = n.filter((u) => sn(u) !== void 0);
98
98
  if (r.length === 0) return;
99
99
  const s = r.map((u) => sn(u)), i = r[0] instanceof Date, l = (u) => i ? new Date(u) : u;
@@ -113,7 +113,7 @@ function $t(e, t) {
113
113
  return [l(c), l(a)];
114
114
  }
115
115
  }
116
- const zt = 3, He = (e) => {
116
+ const Kt = 3, He = (e) => {
117
117
  if (!se(e))
118
118
  return e instanceof Date ? e.getTime() : typeof e == "boolean" ? e ? 1 : 0 : typeof e == "number" ? e : String(e);
119
119
  };
@@ -121,31 +121,31 @@ function pt(e, t, n) {
121
121
  const o = He(e), r = He(t);
122
122
  return o === void 0 || r === void 0 ? o === r ? 0 : o === void 0 ? 1 : -1 : typeof o == "number" && typeof r == "number" ? o - r : n(String(o), String(r));
123
123
  }
124
- function Ko(e, t) {
125
- const n = t.compareText ?? xn.compareText, o = (r, s, i) => {
124
+ function jo(e, t) {
125
+ const n = t.compareText ?? Cn.compareText, o = (r, s, i) => {
126
126
  const l = /* @__PURE__ */ new Map(), c = t.levels[s];
127
127
  if (!c) return [];
128
128
  const a = /* @__PURE__ */ new Map();
129
129
  for (const g of r) {
130
- const v = c.value(g), x = Ce(v);
131
- let y = a.get(x);
130
+ const v = c.value(g), C = Se(v);
131
+ let y = a.get(C);
132
132
  y || (y = {
133
- path: JSON.stringify([...i, x]),
133
+ path: JSON.stringify([...i, C]),
134
134
  value: se(v) ? void 0 : v,
135
135
  level: s,
136
136
  rows: [],
137
137
  groups: [],
138
138
  aggregates: {}
139
- }, a.set(x, y), l.set(y, [...i, x])), y.rows.push(g);
139
+ }, a.set(C, y), l.set(y, [...i, C])), y.rows.push(g);
140
140
  }
141
141
  for (const g of a.values())
142
- for (const v of t.aggregates ?? []) g.aggregates[v.id] = $t(v, g.rows);
142
+ for (const v of t.aggregates ?? []) g.aggregates[v.id] = zt(v, g.rows);
143
143
  const u = t.sort?.find(
144
144
  (g) => g.column === c.id || t.aggregates?.some((v) => v.id === g.column)
145
145
  ), d = u?.direction === "desc" ? -1 : 1, b = u !== void 0 && u.column !== c.id ? u.column : void 0, p = (g) => {
146
146
  let v;
147
- for (const x of g.rows) {
148
- const y = c.order(x);
147
+ for (const C of g.rows) {
148
+ const y = c.order(C);
149
149
  He(y) !== void 0 && (v === void 0 || pt(y, v, n) < 0) && (v = y);
150
150
  }
151
151
  return v;
@@ -155,8 +155,8 @@ function Ko(e, t) {
155
155
  return Array.isArray(v) ? v[0] : v;
156
156
  }, w = [...a.values()].sort((g, v) => {
157
157
  if (g.value === void 0 || v.value === void 0) return pt(g.value, v.value, n);
158
- const x = m(g), y = m(v), _ = pt(x, y, n);
159
- return He(x) === void 0 || He(y) === void 0 ? _ : _ * d;
158
+ const C = m(g), y = m(v), _ = pt(C, y, n);
159
+ return He(C) === void 0 || He(y) === void 0 ? _ : _ * d;
160
160
  });
161
161
  for (const g of w)
162
162
  g.groups = o(g.rows, s + 1, l.get(g));
@@ -164,32 +164,32 @@ function Ko(e, t) {
164
164
  };
165
165
  return o(e, 0, []);
166
166
  }
167
- function Go(e, t) {
167
+ function Ho(e, t) {
168
168
  const n = /* @__PURE__ */ new Set(), o = (r) => {
169
169
  for (const s of r)
170
170
  n.add(s.path), o(s.groups);
171
171
  };
172
172
  return o(e), t.filter((r) => n.has(r));
173
173
  }
174
- const Ho = (e) => (t) => {
174
+ const Wo = (e) => (t) => {
175
175
  if (!(t instanceof Date) || Number.isNaN(t.getTime())) return;
176
176
  const n = t.getFullYear(), o = t.getMonth(), r = t.getDate();
177
177
  return e === "year" ? new Date(n, 0, 1) : e === "month" ? new Date(n, o, 1) : e === "week" ? new Date(n, o, r - (t.getDay() + 6) % 7) : new Date(n, o, r);
178
178
  };
179
- function Wo(e) {
179
+ function qo(e) {
180
180
  const t = new Date(e.getFullYear(), e.getMonth(), e.getDate() + 3 - (e.getDay() + 6) % 7), n = new Date(t.getFullYear(), 0, 4);
181
181
  return { week: 1 + Math.round((t.getTime() - n.getTime()) / 864e5 / 7 - ((n.getDay() + 6) % 7 - 3) / 7), year: t.getFullYear() };
182
182
  }
183
- function qo(e, t, n, o) {
183
+ function Yo(e, t, n, o) {
184
184
  if (e === "year") return String(t.getFullYear());
185
185
  if (e === "month") return n.month(t);
186
186
  if (e === "week") {
187
- const { week: r, year: s } = Wo(t);
187
+ const { week: r, year: s } = qo(t);
188
188
  return o.calendarWeek(r, s);
189
189
  }
190
190
  return n.date(t);
191
191
  }
192
- function Mn(e, t) {
192
+ function Ln(e, t) {
193
193
  const n = [], o = (r, s) => {
194
194
  for (const i of r) {
195
195
  const l = t.has(i.path);
@@ -201,16 +201,16 @@ function Mn(e, t) {
201
201
  };
202
202
  return o(e, []), n;
203
203
  }
204
- function Yo(e, t, n) {
204
+ function Uo(e, t, n) {
205
205
  const o = [0];
206
206
  if (n > 0)
207
207
  for (let l = 0; l += Math.max(1, n - (e[l]?.parents.length ?? 0)), !(l >= e.length); )
208
208
  o.push(l);
209
209
  const r = o.length, s = Math.min(Math.max(1, t), r), i = n > 0 ? e.slice(o[s - 1], o[s] ?? e.length) : [...e];
210
- return { lines: Fn(i), page: s, pageCount: r };
210
+ return { lines: Bn(i), page: s, pageCount: r };
211
211
  }
212
- const Ln = (e) => e.flatMap((t) => t.kind === "row" ? [t.row] : []);
213
- function Fn(e) {
212
+ const Fn = (e) => e.flatMap((t) => t.kind === "row" ? [t.row] : []);
213
+ function Bn(e) {
214
214
  const t = e[0];
215
215
  if (!t) return [...e];
216
216
  const n = t.parents.map((r, s) => ({
@@ -227,11 +227,11 @@ function Dn(e, t) {
227
227
  ...e.filter((n) => !t.includes(n.id))
228
228
  ] : e;
229
229
  }
230
- const Fe = (e) => e == null || typeof e == "number" && Number.isNaN(e), Uo = (e, t) => typeof e == "number" && typeof t == "number" ? e - t : xn.compareText(String(e), String(t));
231
- function Bn(e, t, n) {
230
+ const Be = (e) => e == null || typeof e == "number" && Number.isNaN(e), Jo = (e, t) => typeof e == "number" && typeof t == "number" ? e - t : Cn.compareText(String(e), String(t));
231
+ function Pn(e, t, n) {
232
232
  const o = (t ?? "").trim().toLowerCase(), r = e.filter((i) => i.searchable && i.value), s = (i) => !o || r.some((l) => {
233
233
  const c = l.value(i);
234
- return !Fe(c) && String(c).toLowerCase().includes(o);
234
+ return !Be(c) && String(c).toLowerCase().includes(o);
235
235
  });
236
236
  return { term: o, matches: (i) => s(i) && (n ? n(i) : !0) };
237
237
  }
@@ -242,7 +242,7 @@ function Vn(e, t) {
242
242
  const c = i.direction === "asc" ? 1 : -1, a = l.compare, u = l.value, d = o.length;
243
243
  return o.push(u), u ? (b, p) => {
244
244
  const m = b.keys[d], w = p.keys[d];
245
- return Fe(m) || Fe(w) ? Fe(m) === Fe(w) ? 0 : Fe(m) ? 1 : -1 : (a ? a(b.row, p.row) : Uo(m, w)) * c;
245
+ return Be(m) || Be(w) ? Be(m) === Be(w) ? 0 : Be(m) ? 1 : -1 : (a ? a(b.row, p.row) : Jo(m, w)) * c;
246
246
  } : (b, p) => a(b.row, p.row) * c;
247
247
  }).filter((i) => i !== null);
248
248
  return { levels: n, sorted: (i) => (
@@ -256,21 +256,21 @@ function Vn(e, t) {
256
256
  }).map((l) => l.row)
257
257
  ) };
258
258
  }
259
- function Pn(e, t, n) {
260
- const { matches: o } = Bn(t, n.search, n.filter), { levels: r, sorted: s } = Vn(t, n.sort);
259
+ function In(e, t, n) {
260
+ const { matches: o } = Pn(t, n.search, n.filter), { levels: r, sorted: s } = Vn(t, n.sort);
261
261
  return { filtered: s(e.filter(o)), levels: r };
262
262
  }
263
- function In(e, t, n) {
264
- return Ko(e, { levels: n.levels, aggregates: n.aggregates, compareText: n.compareText, sort: t });
263
+ function $n(e, t, n) {
264
+ return jo(e, { levels: n.levels, aggregates: n.aggregates, compareText: n.compareText, sort: t });
265
265
  }
266
- function St(e, t, n, o) {
267
- const { page: r = 1, pageSize: s, hidden: i, order: l } = t, c = Ct(e, i, l);
266
+ function kt(e, t, n, o) {
267
+ const { page: r = 1, pageSize: s, hidden: i, order: l } = t, c = St(e, i, l);
268
268
  if (o) {
269
- const b = Yo(o.lines, r, s ?? 0);
269
+ const b = Uo(o.lines, r, s ?? 0);
270
270
  return {
271
271
  columns: c,
272
272
  filtered: n,
273
- visible: Ln(b.lines),
273
+ visible: Fn(b.lines),
274
274
  groups: o.groups,
275
275
  lines: o.lines,
276
276
  visibleLines: b.lines,
@@ -289,14 +289,14 @@ function St(e, t, n, o) {
289
289
  columnCount: c.length
290
290
  };
291
291
  }
292
- const Ct = (e, t, n) => {
292
+ const St = (e, t, n) => {
293
293
  const o = Dn(e, n);
294
294
  return t?.length ? o.filter((r) => r.hideable === !1 || !t.includes(r.id)) : o;
295
295
  };
296
- function $n(e, t, n) {
296
+ function zn(e, t, n) {
297
297
  const { page: o = 1, pageSize: r, hidden: s, order: i } = n;
298
298
  if (n.server) {
299
- const u = Ct(t, s, i), { rowCount: d } = n.server, b = r && r > 0 ? r : Math.max(d, 1), p = Math.max(1, Math.ceil(d / b)), m = d > 0 ? Math.min(Math.max(1, o), p) : Math.max(1, o);
299
+ const u = St(t, s, i), { rowCount: d } = n.server, b = r && r > 0 ? r : Math.max(d, 1), p = Math.max(1, Math.ceil(d / b)), m = d > 0 ? Math.min(Math.max(1, o), p) : Math.max(1, o);
300
300
  return {
301
301
  columns: u,
302
302
  filtered: [...e],
@@ -307,21 +307,21 @@ function $n(e, t, n) {
307
307
  };
308
308
  }
309
309
  if (n.tree) {
310
- const { term: u, matches: d } = Bn(t, n.search, n.filter), { sorted: b } = Vn(t, n.sort);
311
- return Jo(e, n.tree, b, u || n.filter ? d : void 0, Ct(t, s, i));
310
+ const { term: u, matches: d } = Pn(t, n.search, n.filter), { sorted: b } = Vn(t, n.sort);
311
+ return Xo(e, n.tree, b, u || n.filter ? d : void 0, St(t, s, i));
312
312
  }
313
- const { filtered: l, levels: c } = Pn(e, t, n);
314
- if (!n.grouping?.levels.length) return St(t, n, l);
315
- const a = In(l, c, n.grouping);
316
- return St(t, n, l, { groups: a, lines: Mn(a, n.grouping.folded) });
313
+ const { filtered: l, levels: c } = In(e, t, n);
314
+ if (!n.grouping?.levels.length) return kt(t, n, l);
315
+ const a = $n(l, c, n.grouping);
316
+ return kt(t, n, l, { groups: a, lines: Ln(a, n.grouping.folded) });
317
317
  }
318
- function Jo(e, t, n, o, r) {
318
+ function Xo(e, t, n, o, r) {
319
319
  const { admit: s } = t, i = (v) => n(s ? v.filter(s) : v), l = /* @__PURE__ */ new Map(), c = {
320
320
  key: t.key,
321
321
  children: (v) => {
322
322
  if (!l.has(v)) {
323
- const x = t.children(v);
324
- l.set(v, x && i(x));
323
+ const C = t.children(v);
324
+ l.set(v, C && i(C));
325
325
  }
326
326
  return l.get(v);
327
327
  },
@@ -330,10 +330,10 @@ function Jo(e, t, n, o, r) {
330
330
  }, a = i(e), u = { expanded: t.open, checked: /* @__PURE__ */ new Set(), active: null, anchor: null, search: "" }, d = rn(a, c, u), b = /* @__PURE__ */ new Set();
331
331
  let p = 0;
332
332
  const m = (v) => {
333
- for (const x of v) {
333
+ for (const C of v) {
334
334
  p++;
335
- const y = c.children(x);
336
- y && (b.add(t.key(x)), m(y));
335
+ const y = c.children(C);
336
+ y && (b.add(t.key(C)), m(y));
337
337
  }
338
338
  };
339
339
  m(a);
@@ -352,46 +352,46 @@ function Jo(e, t, n, o, r) {
352
352
  columnCount: r.length
353
353
  };
354
354
  }
355
- function xt(e) {
355
+ function Ct(e) {
356
356
  const t = {};
357
357
  for (const n of e) n.width !== void 0 && (t[n.id] = n.width);
358
358
  return t;
359
359
  }
360
- function zn(e, t, n) {
360
+ function Kn(e, t, n) {
361
361
  if (!e.lines) return { ...e, visible: (e.shown ?? e.filtered).slice(t, n) };
362
362
  const o = e.lines.slice(t, n);
363
- return { ...e, visibleLines: o, visible: Ln(o) };
363
+ return { ...e, visibleLines: o, visible: Fn(o) };
364
364
  }
365
- function Xo(e, t, n) {
366
- const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual: l, grouping: c, server: a, tree: u } = n, d = (V) => V?.sort?.length ? [...V.sort] : s ? Array.isArray(s) ? [...s] : [s] : [], b = (V) => V?.widths ? { ...V.widths } : xt(t), [p, m] = P(i?.search ?? ""), [w, g] = P(() => d(i)), [v, x] = P(i?.page ?? 1), [y, _] = P(
365
+ function Qo(e, t, n) {
366
+ const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual: l, grouping: c, server: a, tree: u } = n, d = (V) => V?.sort?.length ? [...V.sort] : s ? Array.isArray(s) ? [...s] : [s] : [], b = (V) => V?.widths ? { ...V.widths } : Ct(t), [p, m] = I(i?.search ?? ""), [w, g] = I(() => d(i)), [v, C] = I(i?.page ?? 1), [y, _] = I(
367
367
  i?.pageSize ?? n.pageSize ?? 10
368
- ), [S, C] = P([]), [A, M] = P(i?.hidden ?? []), [k, R] = P(i?.order ?? []), [E, T] = P(() => b(i)), O = (V) => {
369
- m(V.search ?? ""), g(d(V)), x(V.page ?? 1), _(V.pageSize ?? n.pageSize ?? 10), M(V.hidden ?? []), R(V.order ?? []), T(b(V));
370
- }, D = l || u ? 0 : y, I = !a && !u, B = H(
371
- () => I ? Pn(e, t, { search: p, filter: r, sort: w }) : null,
372
- [I, e, t, p, r, w]
373
- ), z = c?.levels.length ? c : void 0, Y = H(
374
- () => B && z ? In(B.filtered, B.levels, z) : void 0,
368
+ ), [k, S] = I([]), [A, L] = I(i?.hidden ?? []), [x, O] = I(i?.order ?? []), [M, R] = I(() => b(i)), E = (V) => {
369
+ m(V.search ?? ""), g(d(V)), C(V.page ?? 1), _(V.pageSize ?? n.pageSize ?? 10), L(V.hidden ?? []), O(V.order ?? []), R(b(V));
370
+ }, D = l || u ? 0 : y, $ = !a && !u, P = H(
371
+ () => $ ? In(e, t, { search: p, filter: r, sort: w }) : null,
372
+ [$, e, t, p, r, w]
373
+ ), K = c?.levels.length ? c : void 0, Y = H(
374
+ () => P && K ? $n(P.filtered, P.levels, K) : void 0,
375
375
  // The fold is not an input of the grouping: it only chooses lines.
376
376
  // eslint-disable-next-line react-hooks/exhaustive-deps
377
- [B, z?.levels, z?.aggregates, z?.compareText]
377
+ [P, K?.levels, K?.aggregates, K?.compareText]
378
378
  ), ce = H(
379
- () => Y && z ? Mn(Y, z.folded) : void 0,
379
+ () => Y && K ? Ln(Y, K.folded) : void 0,
380
380
  // eslint-disable-next-line react-hooks/exhaustive-deps
381
- [Y, z?.folded]
382
- ), G = H(
383
- () => B ? St(t, { page: v, pageSize: D, hidden: A, order: k }, B.filtered, Y && ce ? { groups: Y, lines: ce } : void 0) : $n(e, t, { search: p, filter: r, sort: w, page: v, pageSize: D, hidden: A, order: k, grouping: c, server: a, tree: u }),
384
- [B, Y, ce, t, v, D, A, k, e, p, r, w, c, a, u]
385
- ), [ne, de] = P(36), le = To(l ? (G.lines ?? G.shown ?? G.filtered).length : 0, {
381
+ [Y, K?.folded]
382
+ ), j = H(
383
+ () => P ? kt(t, { page: v, pageSize: D, hidden: A, order: x }, P.filtered, Y && ce ? { groups: Y, lines: ce } : void 0) : zn(e, t, { search: p, filter: r, sort: w, page: v, pageSize: D, hidden: A, order: x, grouping: c, server: a, tree: u }),
384
+ [P, Y, ce, t, v, D, A, x, e, p, r, w, c, a, u]
385
+ ), [ne, de] = I(36), le = Oo(l ? (j.lines ?? j.shown ?? j.filtered).length : 0, {
386
386
  rowHeight: l ? ne : 0,
387
387
  overscan: typeof l == "object" ? l.overscan : void 0
388
388
  }), ee = H(
389
- () => l ? zn(G, le.from, le.to) : G,
390
- [l, G, le.from, le.to]
391
- ), oe = ee.visibleLines, W = ee.visible, ge = H(() => G.filtered.map(o), [G.filtered, o]), L = zo(ge), ae = fe((V) => {
392
- m(V), x(1);
389
+ () => l ? Kn(j, le.from, le.to) : j,
390
+ [l, j, le.from, le.to]
391
+ ), oe = ee.visibleLines, W = ee.visible, ge = H(() => j.filtered.map(o), [j.filtered, o]), F = Go(ge), ae = fe((V) => {
392
+ m(V), C(1);
393
393
  }, []), Ae = fe((V) => {
394
- _(V), x(1);
394
+ _(V), C(1);
395
395
  }, []), ue = fe((V, J = !1) => {
396
396
  g((te) => {
397
397
  const me = te.find((we) => we.column === V);
@@ -402,17 +402,17 @@ function Xo(e, t, n) {
402
402
  return me ? me.direction === "asc" ? te.map(
403
403
  (we) => we.column === V ? { column: V, direction: "desc" } : we
404
404
  ) : te.filter((we) => we.column !== V) : [...te, { column: V, direction: "asc" }];
405
- }), x(1);
405
+ }), C(1);
406
406
  }, []), Ne = fe((V) => {
407
- C(
407
+ S(
408
408
  (J) => J.includes(V) ? J.filter((te) => te !== V) : [...J, V]
409
409
  );
410
- }, []), Ee = fe((V) => {
411
- M(
410
+ }, []), Me = fe((V) => {
411
+ L(
412
412
  (J) => J.includes(V) ? J.filter((te) => te !== V) : [...J, V]
413
413
  );
414
414
  }, []), pe = fe((V, J) => {
415
- T((te) => {
415
+ R((te) => {
416
416
  if (J === void 0) {
417
417
  if (!(V in te)) return te;
418
418
  const me = { ...te };
@@ -420,106 +420,106 @@ function Xo(e, t, n) {
420
420
  }
421
421
  return { ...te, [V]: J };
422
422
  });
423
- }, []), U = n.pageSize ?? 10, Se = H(() => xt(t), [t]), Me = H(() => {
423
+ }, []), U = n.pageSize ?? 10, ke = H(() => Ct(t), [t]), Le = H(() => {
424
424
  const V = {};
425
- for (const [J, te] of Object.entries(E))
426
- Se[J] !== te && (V[J] = te);
425
+ for (const [J, te] of Object.entries(M))
426
+ ke[J] !== te && (V[J] = te);
427
427
  return V;
428
- }, [E, Se]), Pe = H(
428
+ }, [M, ke]), Ie = H(
429
429
  () => s ? Array.isArray(s) ? s : [s] : [],
430
430
  [s]
431
- ), Le = w.length === Pe.length && w.every(
432
- (V, J) => V.column === Pe[J]?.column && V.direction === Pe[J]?.direction
431
+ ), Fe = w.length === Ie.length && w.every(
432
+ (V, J) => V.column === Ie[J]?.column && V.direction === Ie[J]?.direction
433
433
  ), Je = H(
434
434
  () => ({
435
435
  ...p ? { search: p } : {},
436
- ...w.length && !Le ? { sort: w } : {},
436
+ ...w.length && !Fe ? { sort: w } : {},
437
437
  /* Without paging there is no page a view could carry - a page three in
438
438
  the view of a virtualised table would be a promise nobody redeems on
439
439
  opening. */
440
- ...!l && G.page > 1 ? { page: G.page } : {},
440
+ ...!l && j.page > 1 ? { page: j.page } : {},
441
441
  ...!l && y !== U ? { pageSize: y } : {},
442
442
  ...A.length ? { hidden: A } : {},
443
- ...k.length ? { order: k } : {},
444
- ...Object.keys(Me).length ? { widths: Me } : {}
443
+ ...x.length ? { order: x } : {},
444
+ ...Object.keys(Le).length ? { widths: Le } : {}
445
445
  }),
446
446
  [
447
447
  l,
448
448
  p,
449
449
  w,
450
- Le,
451
- G.page,
450
+ Fe,
451
+ j.page,
452
452
  y,
453
453
  U,
454
454
  A,
455
- k,
456
- Me
455
+ x,
456
+ Le
457
457
  ]
458
458
  );
459
459
  return {
460
- ...G,
460
+ ...j,
461
461
  visible: W,
462
462
  visibleLines: oe,
463
463
  virtual: l ? le : void 0,
464
464
  setPitch: de,
465
465
  server: a,
466
- restart: O,
466
+ restart: E,
467
467
  view: Je,
468
468
  search: p,
469
469
  setSearch: ae,
470
470
  sort: w,
471
471
  toggleSort: ue,
472
- setPage: x,
472
+ setPage: C,
473
473
  pageSize: y,
474
474
  setPageSize: Ae,
475
- expanded: S,
475
+ expanded: k,
476
476
  toggleRow: Ne,
477
477
  hidden: A,
478
- toggleColumn: Ee,
479
- order: k,
480
- setOrder: R,
481
- widths: E,
478
+ toggleColumn: Me,
479
+ order: x,
480
+ setOrder: O,
481
+ widths: M,
482
482
  setWidth: pe,
483
- selection: L
483
+ selection: F
484
484
  };
485
485
  }
486
- function Qo(e, t) {
486
+ function Zo(e, t) {
487
487
  return [
488
488
  ...e.filter((n) => t[n.id] === "start"),
489
489
  ...e.filter((n) => t[n.id] === void 0),
490
490
  ...e.filter((n) => t[n.id] === "end")
491
491
  ];
492
492
  }
493
- function Zo(e, t) {
493
+ function er(e, t) {
494
494
  const n = {};
495
495
  for (const o of e) o.pin && (n[o.id] = o.pin);
496
496
  return t !== void 0 && !n[t] && (n[t] = "start"), n;
497
497
  }
498
- function er(e, t, n) {
498
+ function tr(e, t, n) {
499
499
  const o = { ...e };
500
500
  return n ? o[t] = n : delete o[t], o;
501
501
  }
502
- const tr = (e, t) => Object.keys(e).length === Object.keys(t).length && Object.entries(e).every(([n, o]) => t[n] === o);
503
- function nr(e, t, n) {
502
+ const nr = (e, t) => Object.keys(e).length === Object.keys(t).length && Object.entries(e).every(([n, o]) => t[n] === o);
503
+ function or(e, t, n) {
504
504
  if (!e) return;
505
505
  const o = n.size === 0 ? e : Object.fromEntries(Object.entries(e).filter(([r]) => n.has(r)));
506
- return tr(o, t) ? void 0 : o;
506
+ return nr(o, t) ? void 0 : o;
507
507
  }
508
- function or(e, t, n = t) {
508
+ function rr(e, t, n = t) {
509
509
  if (n < e.start) return { side: "start", at: t, edge: n === e.start - 1 };
510
510
  const o = e.count - e.end;
511
511
  if (e.end > 0 && t >= o) return { side: "end", at: e.count - 1 - n, edge: t === o };
512
512
  }
513
- const rr = 256;
514
- function sr(e, t, n) {
515
- const o = n - Math.min(n / 2, rr);
513
+ const sr = 256;
514
+ function ir(e, t, n) {
515
+ const o = n - Math.min(n / 2, sr);
516
516
  return n <= 0 || e + t <= o ? { start: !0, end: !0 } : e > 0 && e <= o ? { start: !0, end: !1 } : { start: !1, end: t > 0 && t <= o };
517
517
  }
518
- const ir = (e) => JSON.stringify([e.search, e.conditions, e.sort, e.page, e.pageSize]), lr = (e) => JSON.stringify(
518
+ const lr = (e) => JSON.stringify([e.search, e.conditions, e.sort, e.page, e.pageSize]), ar = (e) => JSON.stringify(
519
519
  { ...e, hidden: mt(e.hidden), folded: mt(e.folded), branches: mt(e.branches) },
520
520
  (t, n) => n && typeof n == "object" && !Array.isArray(n) ? Object.fromEntries(Object.entries(n).sort(([o], [r]) => o < r ? -1 : o > r ? 1 : 0)) : n
521
521
  ), mt = (e) => e === void 0 ? void 0 : [...e].sort();
522
- function ar(e, t) {
522
+ function cr(e, t) {
523
523
  if (t.size === 0) return e;
524
524
  const n = e.sort?.filter((l) => t.has(l.column)), o = e.hidden?.filter((l) => t.has(l)), r = e.order?.filter((l) => t.has(l)), s = e.widths ? Object.fromEntries(Object.entries(e.widths).filter(([l]) => t.has(l))) : void 0;
525
525
  return n?.length === e.sort?.length && o?.length === e.hidden?.length && r?.length === e.order?.length && Object.keys(s ?? {}).length === Object.keys(e.widths ?? {}).length ? e : {
@@ -532,149 +532,152 @@ function ar(e, t) {
532
532
  ...s && Object.keys(s).length ? { widths: s } : {}
533
533
  };
534
534
  }
535
- function cr() {
536
- const e = import.meta;
537
- return typeof e.env?.DEV == "boolean" ? e.env.DEV : typeof process < "u" && process?.env ? process.env.NODE_ENV !== "production" : !1;
535
+ function dr() {
536
+ try {
537
+ return process.env.NODE_ENV !== "production";
538
+ } catch {
539
+ return !1;
540
+ }
538
541
  }
539
- const Kt = cr(), ln = /* @__PURE__ */ new Set();
542
+ const Gt = dr(), ln = /* @__PURE__ */ new Set();
540
543
  function X(e, t) {
541
- !Kt || ln.has(e) || (ln.add(e), console.warn(`@umriss-ui/table: ${t}`));
542
- }
543
- const dr = "_frame_r82ej_11 _text_18806_22", ur = "_children_r82ej_24", fr = "_scroll_r82ej_33 _scroll_18806_96", hr = "_footerTarget_r82ej_62", gr = "_table_r82ej_74", pr = "_th_r82ej_86 _ring_18806_125", mr = "_sticky_r82ej_106", wr = "_td_r82ej_126", br = "_rowHeader_r82ej_140", vr = "_compact_r82ej_161 _dense_18806_38", yr = "_numeric_r82ej_192", _r = "_value_r82ej_212", kr = "_valueText_r82ej_222", Sr = "_sized_r82ej_226", Cr = "_cutTip_r82ej_243 _text_18806_22", xr = "_absent_r82ej_285", Ar = "_striped_r82ej_289", Nr = "_pinned_r82ej_314", jr = "_pinStartEdge_r82ej_330", Tr = "_pinEndEdge_r82ej_331", Rr = "_sortButton_r82ej_361 _ring_18806_125", Or = "_sortIndicator_r82ej_386", Er = "_sortArrow_r82ej_393", Mr = "_sortArrowDesc_r82ej_397", Lr = "_sortActive_r82ej_405", Fr = "_sortRank_r82ej_411", Dr = "_thFlex_r82ej_419", Br = "_headLine_r82ej_439", Vr = "_headLabel_r82ej_462", Pr = "_footerKind_r82ej_478", Ir = "_emptyCell_r82ej_496", $r = "_emptyTitle_r82ej_518", zr = "_skeleton_r82ej_527", Kr = "_toolbar_r82ej_559 _text_18806_22", Gr = "_toolbarGroup_r82ej_575", Hr = "_toolbarGroupIdle_r82ej_591", Wr = "_searchGrow_r82ej_598", qr = "_toolbarMd_r82ej_608", Yr = "_toolbarInfo_r82ej_612", Ur = "_pagination_r82ej_618 _text_18806_22", Jr = "_paginationControls_r82ej_631", Xr = "_pageSize_r82ej_638", Qr = "_pageSteps_r82ej_646", Zr = "_paginationStatus_r82ej_652", es = "_filterButton_r82ej_661 _ring_18806_125", ts = "_filterActive_r82ej_688", ns = "_filterPanel_r82ej_693", os = "_filterContent_r82ej_707 _scroll_18806_96", rs = "_filterFooter_r82ej_718", ss = "_filterLabel_r82ej_732", is = "_filterValue_r82ej_742", ls = "_filteredCount_r82ej_748", as = "_rangeFields_r82ej_759", cs = "_rangePeriod_r82ej_769", ds = "_conditions_r82ej_775", us = "_conditionButton_r82ej_781", fs = "_condition_r82ej_775", hs = "_columnsPanel_r82ej_806", gs = "_columnsList_r82ej_815", ps = "_columnsEntry_r82ej_824", ms = "_move_r82ej_836", ws = "_pinOn_r82ej_874", bs = "_groupingChoice_r82ej_884", vs = "_groupingHeading_r82ej_892", ys = "_groupingOptions_r82ej_901", _s = "_groupingOption_r82ej_901 _ring_18806_125", ks = "_groupingLevel_r82ej_944", Ss = "_groupingTag_r82ej_949", Cs = "_groupingTrigger_r82ej_956", xs = "_groupingPrefix_r82ej_962", As = "_groupingPath_r82ej_967", Ns = "_groupingSeparator_r82ej_971", js = "_groupHeader_r82ej_988", Ts = "_spanCell_r82ej_1031", Rs = "_groupFolded_r82ej_1112", Os = "_spanValue_r82ej_1116", Es = "_groupLabel_r82ej_1117", Ms = "_spanText_r82ej_1130", Ls = "_groupValue_r82ej_1131", Fs = "_groupCount_r82ej_1138", Ds = "_continued_r82ej_1152", Bs = "_spanSelect_r82ej_1183", Vs = "_treeCell_r82ej_1199", Ps = "_treeText_r82ej_1207", Is = "_foldSlot_r82ej_1211", $s = "_treeRow_r82ej_1221", zs = "_branchRow_r82ej_1225", Ks = "_detailCell_r82ej_1237", Gs = "_pathRow_r82ej_1243", Hs = "_fold_r82ej_1211", Ws = "_foldClosed_r82ej_1284", qs = "_foldedCount_r82ej_1294", Ys = "_shareHost_r82ej_1302", Us = "_shareBar_r82ej_1309", Js = "_expander_r82ej_1321", Xs = "_expanderOpen_r82ej_1356", Qs = "_detailRow_r82ej_1360", Zs = "_treeDetail_r82ej_1369", ei = "_treeDetailRail_r82ej_1374", ti = "_actionsCell_r82ej_1389", ni = "_actions_r82ej_1389", oi = "_decision_r82ej_1408", ri = "_reserve_r82ej_1427", si = "_grip_r82ej_1437", ii = "_virtualBody_r82ej_1478", li = "_virtualRow_r82ej_1494", ai = "_fillerRow_r82ej_1518", ci = "_grid_r82ej_1531", di = "_editing_r82ej_1547", ui = "_editingValue_r82ej_1551", fi = "_editor_r82ej_1557", hi = "_editorField_r82ej_1570", gi = "_draftButtons_r82ej_1602", pi = "_held_r82ej_1610", mi = "_deleteAsk_r82ej_1614", wi = "_newRowBar_r82ej_1621", bi = "_draftMessage_r82ej_1628", vi = "_editorMessage_r82ej_1653", yi = "_control_r82ej_302", _i = "_empty_r82ej_496", ki = "_toned_r82ej_1414", h = {
544
- frame: dr,
545
- children: ur,
546
- scroll: fr,
547
- footerTarget: hr,
548
- table: gr,
549
- th: pr,
550
- sticky: mr,
551
- td: wr,
552
- rowHeader: br,
553
- compact: vr,
554
- numeric: yr,
555
- value: _r,
544
+ !Gt || ln.has(e) || (ln.add(e), console.warn(`@umriss-ui/table: ${t}`));
545
+ }
546
+ const ur = "_frame_1lxch_11 _text_18806_22", fr = "_children_1lxch_24", hr = "_scroll_1lxch_33 _scroll_18806_96", gr = "_footerTarget_1lxch_62", pr = "_table_1lxch_76", mr = "_th_1lxch_88 _ring_18806_125", wr = "_sticky_1lxch_108", br = "_td_1lxch_128", vr = "_rowHeader_1lxch_142", yr = "_compact_1lxch_163 _dense_18806_38", _r = "_numeric_1lxch_194", xr = "_value_1lxch_214", kr = "_valueText_1lxch_224", Sr = "_sized_1lxch_228", Cr = "_cutTip_1lxch_245 _text_18806_22", Ar = "_absent_1lxch_287", Nr = "_striped_1lxch_291", Tr = "_pinned_1lxch_316", Rr = "_pinStartEdge_1lxch_332", Or = "_pinEndEdge_1lxch_333", Er = "_sortButton_1lxch_363 _ring_18806_125", Mr = "_sortIndicator_1lxch_388", Lr = "_sortArrow_1lxch_395", Fr = "_sortArrowDesc_1lxch_399", Br = "_sortActive_1lxch_407", Dr = "_sortRank_1lxch_413", Pr = "_thFlex_1lxch_421", Vr = "_headLine_1lxch_441", Ir = "_headLabel_1lxch_464", $r = "_footerKind_1lxch_480", zr = "_emptyCell_1lxch_498", Kr = "_emptyTitle_1lxch_520", Gr = "_skeleton_1lxch_529", jr = "_toolbar_1lxch_561 _text_18806_22", Hr = "_toolbarGroup_1lxch_577", Wr = "_toolbarGroupIdle_1lxch_593", qr = "_searchGrow_1lxch_600", Yr = "_toolbarMd_1lxch_610", Ur = "_toolbarInfo_1lxch_614", Jr = "_pagination_1lxch_620 _text_18806_22", Xr = "_paginationControls_1lxch_633", Qr = "_pageSize_1lxch_640", Zr = "_pageSteps_1lxch_648", es = "_paginationStatus_1lxch_654", ts = "_filterButton_1lxch_663 _ring_18806_125", ns = "_filterActive_1lxch_690", os = "_filterPanel_1lxch_695", rs = "_filterContent_1lxch_709 _scroll_18806_96", ss = "_filterFooter_1lxch_720", is = "_filterLabel_1lxch_734", ls = "_filterValue_1lxch_744", as = "_filteredCount_1lxch_750", cs = "_rangeFields_1lxch_761", ds = "_rangePeriod_1lxch_771", us = "_conditions_1lxch_777", fs = "_conditionButton_1lxch_783", hs = "_condition_1lxch_777", gs = "_columnsPanel_1lxch_808", ps = "_columnsList_1lxch_817", ms = "_columnsEntry_1lxch_826", ws = "_move_1lxch_838", bs = "_pinOn_1lxch_876", vs = "_groupingChoice_1lxch_886", ys = "_groupingHeading_1lxch_894", _s = "_groupingOptions_1lxch_903", xs = "_groupingOption_1lxch_903 _ring_18806_125", ks = "_groupingLevel_1lxch_946", Ss = "_groupingTag_1lxch_951", Cs = "_groupingTrigger_1lxch_958", As = "_groupingPrefix_1lxch_964", Ns = "_groupingPath_1lxch_969", Ts = "_groupingSeparator_1lxch_973", Rs = "_groupHeader_1lxch_990", Os = "_spanCell_1lxch_1033", Es = "_groupFolded_1lxch_1114", Ms = "_spanValue_1lxch_1118", Ls = "_groupLabel_1lxch_1119", Fs = "_spanText_1lxch_1132", Bs = "_groupValue_1lxch_1133", Ds = "_groupCount_1lxch_1140", Ps = "_continued_1lxch_1154", Vs = "_spanSelect_1lxch_1185", Is = "_treeCell_1lxch_1201", $s = "_treeText_1lxch_1209", zs = "_foldSlot_1lxch_1213", Ks = "_treeRow_1lxch_1223", Gs = "_branchRow_1lxch_1227", js = "_detailCell_1lxch_1239", Hs = "_pathRow_1lxch_1245", Ws = "_fold_1lxch_1213", qs = "_foldClosed_1lxch_1286", Ys = "_foldedCount_1lxch_1296", Us = "_shareHost_1lxch_1304", Js = "_shareBar_1lxch_1311", Xs = "_expander_1lxch_1323", Qs = "_expanderOpen_1lxch_1358", Zs = "_detailRow_1lxch_1362", ei = "_treeDetail_1lxch_1371", ti = "_treeDetailRail_1lxch_1376", ni = "_actionsCell_1lxch_1391", oi = "_actions_1lxch_1391", ri = "_decision_1lxch_1410", si = "_reserve_1lxch_1429", ii = "_grip_1lxch_1439", li = "_virtualBody_1lxch_1480", ai = "_virtualRow_1lxch_1496", ci = "_fillerRow_1lxch_1520", di = "_grid_1lxch_1533", ui = "_editing_1lxch_1549", fi = "_editingValue_1lxch_1553", hi = "_editor_1lxch_1559", gi = "_editorField_1lxch_1572", pi = "_draftButtons_1lxch_1604", mi = "_held_1lxch_1612", wi = "_deleteAsk_1lxch_1616", bi = "_newRowBar_1lxch_1623", vi = "_draftMessage_1lxch_1630", yi = "_editorMessage_1lxch_1655", _i = "_control_1lxch_304", xi = "_empty_1lxch_498", ki = "_toned_1lxch_1416", h = {
547
+ frame: ur,
548
+ children: fr,
549
+ scroll: hr,
550
+ footerTarget: gr,
551
+ table: pr,
552
+ th: mr,
553
+ sticky: wr,
554
+ td: br,
555
+ rowHeader: vr,
556
+ compact: yr,
557
+ numeric: _r,
558
+ value: xr,
556
559
  valueText: kr,
557
560
  sized: Sr,
558
561
  cutTip: Cr,
559
- absent: xr,
560
- striped: Ar,
561
- pinned: Nr,
562
- pinStartEdge: jr,
563
- pinEndEdge: Tr,
564
- sortButton: Rr,
565
- sortIndicator: Or,
566
- sortArrow: Er,
567
- sortArrowDesc: Mr,
568
- sortActive: Lr,
569
- sortRank: Fr,
570
- thFlex: Dr,
571
- headLine: Br,
572
- headLabel: Vr,
573
- footerKind: Pr,
574
- emptyCell: Ir,
575
- emptyTitle: $r,
576
- skeleton: zr,
577
- toolbar: Kr,
578
- toolbarGroup: Gr,
579
- toolbarGroupIdle: Hr,
580
- searchGrow: Wr,
581
- toolbarMd: qr,
582
- toolbarInfo: Yr,
583
- pagination: Ur,
584
- paginationControls: Jr,
585
- pageSize: Xr,
586
- pageSteps: Qr,
587
- paginationStatus: Zr,
588
- filterButton: es,
589
- filterActive: ts,
590
- filterPanel: ns,
591
- filterContent: os,
592
- filterFooter: rs,
593
- filterLabel: ss,
594
- filterValue: is,
595
- filteredCount: ls,
596
- rangeFields: as,
597
- rangePeriod: cs,
598
- conditions: ds,
599
- conditionButton: us,
600
- condition: fs,
601
- columnsPanel: hs,
602
- columnsList: gs,
603
- columnsEntry: ps,
604
- move: ms,
605
- pinOn: ws,
606
- groupingChoice: bs,
607
- groupingHeading: vs,
608
- groupingOptions: ys,
609
- groupingOption: _s,
562
+ absent: Ar,
563
+ striped: Nr,
564
+ pinned: Tr,
565
+ pinStartEdge: Rr,
566
+ pinEndEdge: Or,
567
+ sortButton: Er,
568
+ sortIndicator: Mr,
569
+ sortArrow: Lr,
570
+ sortArrowDesc: Fr,
571
+ sortActive: Br,
572
+ sortRank: Dr,
573
+ thFlex: Pr,
574
+ headLine: Vr,
575
+ headLabel: Ir,
576
+ footerKind: $r,
577
+ emptyCell: zr,
578
+ emptyTitle: Kr,
579
+ skeleton: Gr,
580
+ toolbar: jr,
581
+ toolbarGroup: Hr,
582
+ toolbarGroupIdle: Wr,
583
+ searchGrow: qr,
584
+ toolbarMd: Yr,
585
+ toolbarInfo: Ur,
586
+ pagination: Jr,
587
+ paginationControls: Xr,
588
+ pageSize: Qr,
589
+ pageSteps: Zr,
590
+ paginationStatus: es,
591
+ filterButton: ts,
592
+ filterActive: ns,
593
+ filterPanel: os,
594
+ filterContent: rs,
595
+ filterFooter: ss,
596
+ filterLabel: is,
597
+ filterValue: ls,
598
+ filteredCount: as,
599
+ rangeFields: cs,
600
+ rangePeriod: ds,
601
+ conditions: us,
602
+ conditionButton: fs,
603
+ condition: hs,
604
+ columnsPanel: gs,
605
+ columnsList: ps,
606
+ columnsEntry: ms,
607
+ move: ws,
608
+ pinOn: bs,
609
+ groupingChoice: vs,
610
+ groupingHeading: ys,
611
+ groupingOptions: _s,
612
+ groupingOption: xs,
610
613
  groupingLevel: ks,
611
614
  groupingTag: Ss,
612
615
  groupingTrigger: Cs,
613
- groupingPrefix: xs,
614
- groupingPath: As,
615
- groupingSeparator: Ns,
616
- groupHeader: js,
617
- spanCell: Ts,
618
- groupFolded: Rs,
619
- spanValue: Os,
620
- groupLabel: Es,
621
- spanText: Ms,
622
- groupValue: Ls,
623
- groupCount: Fs,
624
- continued: Ds,
625
- spanSelect: Bs,
626
- treeCell: Vs,
627
- treeText: Ps,
628
- foldSlot: Is,
629
- treeRow: $s,
630
- branchRow: zs,
631
- detailCell: Ks,
632
- pathRow: Gs,
633
- fold: Hs,
634
- foldClosed: Ws,
635
- foldedCount: qs,
636
- shareHost: Ys,
637
- shareBar: Us,
638
- expander: Js,
639
- expanderOpen: Xs,
640
- detailRow: Qs,
641
- treeDetail: Zs,
642
- treeDetailRail: ei,
643
- actionsCell: ti,
644
- actions: ni,
645
- decision: oi,
646
- reserve: ri,
647
- grip: si,
648
- virtualBody: ii,
649
- virtualRow: li,
650
- fillerRow: ai,
651
- grid: ci,
652
- editing: di,
653
- editingValue: ui,
654
- editor: fi,
655
- editorField: hi,
656
- draftButtons: gi,
657
- held: pi,
658
- deleteAsk: mi,
659
- newRowBar: wi,
660
- draftMessage: bi,
661
- editorMessage: vi,
662
- control: yi,
663
- empty: _i,
616
+ groupingPrefix: As,
617
+ groupingPath: Ns,
618
+ groupingSeparator: Ts,
619
+ groupHeader: Rs,
620
+ spanCell: Os,
621
+ groupFolded: Es,
622
+ spanValue: Ms,
623
+ groupLabel: Ls,
624
+ spanText: Fs,
625
+ groupValue: Bs,
626
+ groupCount: Ds,
627
+ continued: Ps,
628
+ spanSelect: Vs,
629
+ treeCell: Is,
630
+ treeText: $s,
631
+ foldSlot: zs,
632
+ treeRow: Ks,
633
+ branchRow: Gs,
634
+ detailCell: js,
635
+ pathRow: Hs,
636
+ fold: Ws,
637
+ foldClosed: qs,
638
+ foldedCount: Ys,
639
+ shareHost: Us,
640
+ shareBar: Js,
641
+ expander: Xs,
642
+ expanderOpen: Qs,
643
+ detailRow: Zs,
644
+ treeDetail: ei,
645
+ treeDetailRail: ti,
646
+ actionsCell: ni,
647
+ actions: oi,
648
+ decision: ri,
649
+ reserve: si,
650
+ grip: ii,
651
+ virtualBody: li,
652
+ virtualRow: ai,
653
+ fillerRow: ci,
654
+ grid: di,
655
+ editing: ui,
656
+ editingValue: fi,
657
+ editor: hi,
658
+ editorField: gi,
659
+ draftButtons: pi,
660
+ held: mi,
661
+ deleteAsk: wi,
662
+ newRowBar: bi,
663
+ draftMessage: vi,
664
+ editorMessage: yi,
665
+ control: _i,
666
+ empty: xi,
664
667
  toned: ki
665
668
  };
666
- function Va(e) {
669
+ function Ia(e) {
667
670
  return e;
668
671
  }
669
672
  const qe = /* @__PURE__ */ new WeakMap();
670
- function Kn(e, t) {
673
+ function Gn(e, t) {
671
674
  return qe.set(e, t), e;
672
675
  }
673
676
  const Si = (e) => qe.has(e);
674
- function Oe(e) {
675
- return e === "list" ? Ni : e === "range" ? Fi : typeof e == "object" && e !== null ? e : void 0;
677
+ function Ee(e) {
678
+ return e === "list" ? Ti : e === "range" ? Di : typeof e == "object" && e !== null ? e : void 0;
676
679
  }
677
- function Gn(e, t) {
680
+ function jn(e, t) {
678
681
  if (t == null) return "empty";
679
682
  const n = qe.get(e);
680
683
  return n ? n.isCondition(t) ? n.isEmpty(t) ? "empty" : "effective" : "foreign" : "effective";
@@ -682,7 +685,7 @@ function Gn(e, t) {
682
685
  function Ci(e, t, n) {
683
686
  return se(t) ? qe.get(e)?.absentMatches(n) ?? !1 : e.matches(t, n);
684
687
  }
685
- function xi(e, t, n) {
688
+ function Ai(e, t, n) {
686
689
  const o = qe.get(e);
687
690
  return o ? o.describeIn(t, n) : e.describe(t);
688
691
  }
@@ -707,23 +710,23 @@ function At(e, t, n) {
707
710
  const cn = /* @__PURE__ */ new WeakMap();
708
711
  function Nt(e) {
709
712
  let t = cn.get(e);
710
- return t || (t = new Set(e.map(Ce)), cn.set(e, t)), t;
713
+ return t || (t = new Set(e.map(Se)), cn.set(e, t)), t;
711
714
  }
712
- const jt = (e, t) => se(e) ? t.wording.cellAbsentValue : Be(e, t.format, t.formats, t.wording) ?? String(e);
713
- function Ai({
715
+ const Tt = (e, t) => se(e) ? t.wording.cellAbsentValue : Pe(e, t.format, t.formats, t.wording) ?? String(e);
716
+ function Ni({
714
717
  condition: e,
715
718
  setCondition: t,
716
719
  values: n,
717
720
  absentOccurs: o = !1,
718
721
  format: r
719
722
  }) {
720
- const s = ke(), i = ie(), l = H(() => e ?? [], [e]), c = H(() => {
721
- const d = { formats: s, wording: i, format: r }, b = n.map((g) => ({ key: Ce(g), text: jt(g, d), value: g }));
723
+ const s = xe(), i = ie(), l = H(() => e ?? [], [e]), c = H(() => {
724
+ const d = { formats: s, wording: i, format: r }, b = n.map((g) => ({ key: Se(g), text: Tt(g, d), value: g }));
722
725
  b.sort(Hn(s));
723
- const p = new Set(b.map((g) => g.key)), m = l.filter((g) => !se(g) && !p.has(Ce(g))).map((g) => ({ key: Ce(g), text: jt(g, d), value: g })), w = o || l.some(se) ? [{ key: It, text: i.cellAbsentValue, value: null }] : [];
726
+ const p = new Set(b.map((g) => g.key)), m = l.filter((g) => !se(g) && !p.has(Se(g))).map((g) => ({ key: Se(g), text: Tt(g, d), value: g })), w = o || l.some(se) ? [{ key: $t, text: i.cellAbsentValue, value: null }] : [];
724
727
  return [...b, ...m, ...w];
725
728
  }, [n, l, o, r, s, i]), a = Nt(l), u = (d) => {
726
- const b = a.has(d.key) ? l.filter((p) => Ce(p) !== d.key) : [...l, d.value];
729
+ const b = a.has(d.key) ? l.filter((p) => Se(p) !== d.key) : [...l, d.value];
727
730
  t(b.length > 0 ? b : null);
728
731
  };
729
732
  return /* @__PURE__ */ f("div", { className: h.filterContent, children: c.map((d) => /* @__PURE__ */ f(
@@ -736,28 +739,28 @@ function Ai({
736
739
  d.key
737
740
  )) });
738
741
  }
739
- const Ni = /* @__PURE__ */ Kn(
742
+ const Ti = /* @__PURE__ */ Gn(
740
743
  {
741
- matches: (e, t) => Nt(t).has(Ce(e)),
742
- Input: Ai,
744
+ matches: (e, t) => Nt(t).has(Se(e)),
745
+ Input: Ni,
743
746
  describe: (e) => e.map((t) => se(t) ? "–" : String(t)).join(", ")
744
747
  },
745
748
  {
746
749
  isCondition: (e) => Array.isArray(e),
747
750
  isEmpty: (e) => e.length === 0,
748
- absentMatches: (e) => Nt(e).has(It),
751
+ absentMatches: (e) => Nt(e).has($t),
749
752
  /* From three values on the first two and how many more: a condition is one
750
753
  line in the table toolbar, not a list. */
751
754
  describeIn: (e, t) => {
752
- const n = e.map((r) => jt(r, t));
755
+ const n = e.map((r) => Tt(r, t));
753
756
  if (n.length <= 2) return n.join(", ");
754
757
  const o = n.length - 2;
755
758
  return `${n.slice(0, 2).join(", ")} ${t.wording.moreValues(o, t.formats.count(o))}`;
756
759
  }
757
760
  }
758
- ), ji = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), Ti = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1).getTime(), De = (e) => typeof e == "number" && Number.isFinite(e), ye = (e) => e instanceof Date && !Number.isNaN(e.getTime()), Ri = (e) => ye(e) ? ji(e) : De(e) ? e : void 0, Oi = (e) => ye(e) ? { value: Ti(e), open: !0 } : De(e) ? { value: e, open: !1 } : void 0, Qe = (e, t) => ye(e) ? t.formats.date(e) : Be(e, t.format, t.formats, t.wording) ?? String(e);
759
- function Ei({ condition: e, setCondition: t }) {
760
- const n = ie(), [o, r] = P(null), s = o !== null, i = o ? o.from : De(e?.from) ? e.from : null, l = o ? o.to : De(e?.to) ? e.to : null, c = (a, u) => {
761
+ ), Ri = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), Oi = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1).getTime(), De = (e) => typeof e == "number" && Number.isFinite(e), ye = (e) => e instanceof Date && !Number.isNaN(e.getTime()), Ei = (e) => ye(e) ? Ri(e) : De(e) ? e : void 0, Mi = (e) => ye(e) ? { value: Oi(e), open: !0 } : De(e) ? { value: e, open: !1 } : void 0, Qe = (e, t) => ye(e) ? t.formats.date(e) : Pe(e, t.format, t.formats, t.wording) ?? String(e);
762
+ function Li({ condition: e, setCondition: t }) {
763
+ const n = ie(), [o, r] = I(null), s = o !== null, i = o ? o.from : De(e?.from) ? e.from : null, l = o ? o.to : De(e?.to) ? e.to : null, c = (a, u) => {
761
764
  const d = { from: i, to: l, [a]: u };
762
765
  if (d.from !== null && d.to !== null && d.from > d.to) {
763
766
  r(d);
@@ -772,15 +775,15 @@ function Ei({ condition: e, setCondition: t }) {
772
775
  ...d.to !== null ? { to: d.to } : {}
773
776
  });
774
777
  };
775
- return /* @__PURE__ */ j("div", { className: h.rangeFields, children: [
778
+ return /* @__PURE__ */ T("div", { className: h.rangeFields, children: [
776
779
  /* @__PURE__ */ f(vt, { label: n.filterFrom, children: /* @__PURE__ */ f(yt, { size: "sm", value: i, invalid: s, onChange: (a) => c("from", a) }) }),
777
780
  /* @__PURE__ */ f(vt, { label: n.filterTo, error: s ? n.rangeInvalid : void 0, children: /* @__PURE__ */ f(yt, { size: "sm", value: l, onChange: (a) => c("to", a) }) })
778
781
  ] });
779
782
  }
780
- function Mi({ condition: e, setCondition: t }) {
783
+ function Fi({ condition: e, setCondition: t }) {
781
784
  const n = ye(e?.from) && ye(e?.to) ? { from: e.from, to: e.to } : null;
782
785
  return /* @__PURE__ */ f("div", { className: h.rangePeriod, children: /* @__PURE__ */ f(
783
- Ro,
786
+ Eo,
784
787
  {
785
788
  size: "sm",
786
789
  clearable: !0,
@@ -789,18 +792,18 @@ function Mi({ condition: e, setCondition: t }) {
789
792
  }
790
793
  ) });
791
794
  }
792
- function Li(e) {
793
- return e.kind === "date" ? /* @__PURE__ */ f(Mi, { ...e }) : /* @__PURE__ */ f(Ei, { ...e });
795
+ function Bi(e) {
796
+ return e.kind === "date" ? /* @__PURE__ */ f(Fi, { ...e }) : /* @__PURE__ */ f(Li, { ...e });
794
797
  }
795
- const Fi = /* @__PURE__ */ Kn(
798
+ const Di = /* @__PURE__ */ Gn(
796
799
  {
797
800
  matches: (e, t) => {
798
801
  const n = ye(e) ? e.getTime() : De(e) ? e : void 0;
799
802
  if (n === void 0) return !1;
800
- const o = Ri(t.from), r = Oi(t.to);
803
+ const o = Ei(t.from), r = Mi(t.to);
801
804
  return !(o !== void 0 && n < o || r !== void 0 && (r.open ? n >= r.value : n > r.value));
802
805
  },
803
- Input: Li,
806
+ Input: Bi,
804
807
  describe: (e) => [e.from, e.to].map((t) => t === void 0 ? "" : String(t)).join("–")
805
808
  },
806
809
  {
@@ -875,13 +878,13 @@ const dn = (e) => JSON.stringify([
875
878
  /* Whether a column edits, and how - not its editor or its check, which
876
879
  are new functions on every render and are read when an edit starts. */
877
880
  typeof e.edit == "function" ? "ƒ" : e.edit
878
- ]), Di = (e, t) => e?.[t], un = (e, t) => {
881
+ ]), Pi = (e, t) => e?.[t], un = (e, t) => {
879
882
  const n = {
880
883
  key: e,
881
884
  spec: t,
882
885
  read: (o) => {
883
886
  const r = n.spec.value;
884
- return typeof r == "string" ? Di(o, r) : r(o);
887
+ return typeof r == "string" ? Pi(o, r) : r(o);
885
888
  }
886
889
  };
887
890
  return n;
@@ -896,7 +899,7 @@ function fn(e, t) {
896
899
  const n = ot(e.value, t.value) ? e.value : t.value, o = ot(e.ownSortValue, t.ownSortValue) ? e.ownSortValue : t.ownSortValue, r = ot(e.ownGroupValue, t.ownGroupValue) ? e.ownGroupValue : t.ownGroupValue;
897
900
  return n === t.value && o === t.ownSortValue && r === t.ownGroupValue ? t : { ...t, value: n, ownSortValue: o, ownGroupValue: r };
898
901
  }
899
- class Bi {
902
+ class Vi {
900
903
  columns = new wt("data-umriss-column");
901
904
  actions = new wt("data-umriss-action");
902
905
  /** The group keys: values to group by that are no column. */
@@ -987,7 +990,7 @@ class Bi {
987
990
  }
988
991
  /** What the columns of this pass declare. */
989
992
  declaredPins() {
990
- return Zo(
993
+ return er(
991
994
  this.orderedColumns().map((t) => ({ id: t.spec.id, pin: t.spec.pin })),
992
995
  this.stickyRowHeader ? this.rowHeader()?.spec.id : void 0
993
996
  );
@@ -999,7 +1002,7 @@ class Bi {
999
1002
  /** The columns with the pinned blocks at either end - the one place where
1000
1003
  that is decided, for screen, column menu and export. */
1001
1004
  inPinOrder(t) {
1002
- return Qo(t, this.pins());
1005
+ return Zo(t, this.pins());
1003
1006
  }
1004
1007
  /** The columns in JSX order, the first one per id. */
1005
1008
  orderedColumns() {
@@ -1081,7 +1084,7 @@ class Bi {
1081
1084
  each once. */
1082
1085
  effectiveGrouping(t, n) {
1083
1086
  const o = new Set(this.groupingEntries(n).map((r) => r.spec.id));
1084
- return [...new Set(t)].filter((r) => o.has(r)).slice(0, zt);
1087
+ return [...new Set(t)].filter((r) => o.has(r)).slice(0, Kt);
1085
1088
  }
1086
1089
  groupingCache = null;
1087
1090
  /** The levels and aggregates for the model - the same identity as long as
@@ -1095,10 +1098,10 @@ class Bi {
1095
1098
  const a = l.read(c);
1096
1099
  if (a == null) return;
1097
1100
  const { ownGroupValue: u, group: d } = l.spec;
1098
- return u ? u(a) : d ? Ho(d)(a) : a;
1101
+ return u ? u(a) : d ? Wo(d)(a) : a;
1099
1102
  },
1100
1103
  /* A value of one's own is a name; its groups stand by what they hold. */
1101
- order: l.spec.ownGroupValue ? (c) => kt(l.read(c), l.spec.ownSortValue) : void 0
1104
+ order: l.spec.ownGroupValue ? (c) => xt(l.read(c), l.spec.ownSortValue) : void 0
1102
1105
  })), i = this.orderedColumns().filter((l) => l.spec.aggregate !== void 0).map(
1103
1106
  (l) => ({
1104
1107
  id: l.spec.id,
@@ -1124,7 +1127,7 @@ class Bi {
1124
1127
  kindOf(t, n) {
1125
1128
  const o = this.kinds.get(t.key);
1126
1129
  if (o && o.rows === n && o.value === t.spec.value) return o.kind;
1127
- const r = En(n, t.read);
1130
+ const r = Mn(n, t.read);
1128
1131
  return this.kinds.set(t.key, { rows: n, value: t.spec.value, kind: r }), r;
1129
1132
  }
1130
1133
  /** Can it be sorted by this column? Without a statement: when its value is
@@ -1144,7 +1147,7 @@ class Bi {
1144
1147
  if (this.modelCache?.key === r && this.modelCache.rows === t && this.modelCache.formats === n)
1145
1148
  return this.modelCache.columns;
1146
1149
  const s = o.map((i) => {
1147
- const { spec: l } = i, c = this.kindOf(i, t), a = this.isSortable(i, t), u = l.searchable ?? c === "text", d = (b) => kt(i.read(b), l.ownSortValue);
1150
+ const { spec: l } = i, c = this.kindOf(i, t), a = this.isSortable(i, t), u = l.searchable ?? c === "text", d = (b) => xt(i.read(b), l.ownSortValue);
1148
1151
  return {
1149
1152
  id: l.id,
1150
1153
  label: l.label,
@@ -1189,7 +1192,7 @@ class Bi {
1189
1192
  grouping: this.groupingFor(t),
1190
1193
  server: o.server,
1191
1194
  tree: t.tree
1192
- }, s = $n(t.admitted, n, r), i = o.virtual ? zn(s, o.virtual.from, o.virtual.to) : s;
1195
+ }, s = zn(t.admitted, n, r), i = o.virtual ? Kn(s, o.virtual.from, o.virtual.to) : s;
1193
1196
  return this.projectionCache = { hook: t, columns: n, projection: i }, i;
1194
1197
  }
1195
1198
  /* --- The hook's snapshot ---------------------------------------------------------- */
@@ -1237,7 +1240,7 @@ class Bi {
1237
1240
  /** Whether the table puts up a table toolbar of its own - also while it is
1238
1241
  grouped: the tag that names and removes the grouping needs a place. */
1239
1242
  needsOwnToolbar() {
1240
- return this.count("toolbar") > 0 ? !1 : this.count("search") > 0 || this.orderedColumns().some((t) => Oe(t.spec.filter) !== void 0) || (this.hook?.rowFilters.size ?? 0) > 0 || (this.hook?.publicSnapshot.grouping.length ?? 0) > 0;
1243
+ return this.count("toolbar") > 0 ? !1 : this.count("search") > 0 || this.orderedColumns().some((t) => Ee(t.spec.filter) !== void 0) || (this.hook?.rowFilters.size ?? 0) > 0 || (this.hook?.publicSnapshot.grouping.length ?? 0) > 0;
1241
1244
  }
1242
1245
  /* --- Row detail ------------------------------------------------------------------- */
1243
1246
  registerDetail(t, n) {
@@ -1277,33 +1280,33 @@ class Bi {
1277
1280
  this.actions.entries.delete(t) && this.structure++;
1278
1281
  }
1279
1282
  }
1280
- const Wn = /* @__PURE__ */ new WeakMap(), Vi = (e, t) => {
1283
+ const Wn = /* @__PURE__ */ new WeakMap(), Ii = (e, t) => {
1281
1284
  Wn.set(e, t);
1282
- }, Pi = (e) => typeof e == "function" || typeof e == "object" && e !== null ? Wn.get(e) : void 0, F = (...e) => e.filter(Boolean).join(" "), qn = { separator: ",", decimal: ".", yes: "yes", no: "no" }, Ii = `\r
1283
- `, $i = "\uFEFF", Yn = (e, t) => typeof e == "number" ? String(e).replace(".", t.decimal) : typeof e == "boolean" ? e ? t.yes : t.no : e, Un = (e, t) => e.includes(t) || /["\r\n]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e, zi = (e, t, n) => {
1284
- const o = t.value?.(e);
1285
- return o == null ? "" : Un(Yn(o, n), n.separator);
1286
- }, Jn = (e, t, n) => [
1287
- t.map((o) => Un(o.label ?? o.id, n.separator)).join(n.separator),
1288
- ...e.map((o) => t.map((r) => zi(o, r, n)).join(n.separator))
1285
+ }, $i = (e) => typeof e == "function" || typeof e == "object" && e !== null ? Wn.get(e) : void 0, B = (...e) => e.filter(Boolean).join(" "), qn = { separator: ",", decimal: ".", yes: "yes", no: "no" }, zi = `\r
1286
+ `, Ki = "\uFEFF", Yn = (e, t) => typeof e == "number" ? String(e).replace(".", t.decimal) : typeof e == "boolean" ? e ? t.yes : t.no : e, Un = (e, t) => e.includes(t) || /["\r\n]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e, Jn = (e, t) => t && /^[=+\-@\t\r]/.test(e) ? `'${e}` : e, Gi = (e, t, n, o) => {
1287
+ const r = t.value?.(e);
1288
+ return r == null ? "" : Un(typeof r == "string" ? Jn(r, o) : Yn(r, n), n.separator);
1289
+ }, Xn = (e, t, n, o) => [
1290
+ t.map((r) => Un(Jn(r.label ?? r.id, o), n.separator)).join(n.separator),
1291
+ ...e.map((r) => t.map((s) => Gi(r, s, n, o)).join(n.separator))
1289
1292
  ];
1290
1293
  function hn(e, t, n = qn) {
1291
- return $i + Jn(e, t, n).join(Ii);
1294
+ return Ki + Xn(e, t, n, !0).join(zi);
1292
1295
  }
1293
- function Ki(e, t, n = qn) {
1294
- return Jn(e, t, { ...n, separator: " " }).join(`
1296
+ function ji(e, t, n = qn) {
1297
+ return Xn(e, t, { ...n, separator: " " }, !1).join(`
1295
1298
  `);
1296
1299
  }
1297
- function Xn(e) {
1300
+ function Qn(e) {
1298
1301
  const t = new Map(e.orderedColumns().map((o) => [o.spec.id, o])), n = e.projection().columns.map((o) => t.get(o.id)).filter((o) => o !== void 0);
1299
1302
  return e.inPinOrder(n.map((o) => ({ id: o.spec.id, e: o }))).map(({ e: o }) => o);
1300
1303
  }
1301
- function Qn(e) {
1304
+ function Zn(e) {
1302
1305
  e.setSearch("");
1303
1306
  for (const t of Object.keys(e.filter)) e.setFilter(t, null);
1304
1307
  }
1305
- function Gt(e, t) {
1306
- const { decimal: n } = Oo(e);
1308
+ function jt(e, t) {
1309
+ const { decimal: n } = Mo(e);
1307
1310
  return {
1308
1311
  separator: n === "," ? ";" : ",",
1309
1312
  decimal: n,
@@ -1311,41 +1314,41 @@ function Gt(e, t) {
1311
1314
  no: t.booleanNo.toLocaleLowerCase()
1312
1315
  };
1313
1316
  }
1314
- function Zn(e, t) {
1315
- return Xn(e).filter((n) => e.kindOf(n, t) !== "other" || n.spec.ownExportValue).map(
1317
+ function eo(e, t) {
1318
+ return Qn(e).filter((n) => e.kindOf(n, t) !== "other" || n.spec.ownExportValue).map(
1316
1319
  (n) => ({
1317
1320
  id: n.spec.id,
1318
1321
  label: n.spec.label,
1319
- value: (o) => Pt(n.read(o), n.spec.ownExportValue)
1322
+ value: (o) => It(n.read(o), n.spec.ownExportValue)
1320
1323
  })
1321
1324
  );
1322
1325
  }
1323
- function Gi(e, t, n, o) {
1326
+ function Hi(e, t, n, o) {
1324
1327
  const r = e.hook;
1325
1328
  if (!r) return "";
1326
- const s = Zn(e, r.rows), i = Gt(n, o), { exported: l, filtered: c } = e.projection();
1329
+ const s = eo(e, r.rows), i = jt(n, o), { exported: l, filtered: c } = e.projection();
1327
1330
  if (!l) return hn(c, s, i);
1328
1331
  const a = new Map(l.map((d) => [d.node, d.level + 1])), u = { id: "#level", label: t, value: (d) => a.get(d) };
1329
1332
  return hn(l.map((d) => d.node), [u, ...s], i);
1330
1333
  }
1331
- function eo(e) {
1334
+ function to(e) {
1332
1335
  const t = e.hook;
1333
1336
  if (!t) return [];
1334
1337
  const { exported: n, filtered: o } = e.projection(), r = n ? n.map((s) => s.node) : o;
1335
1338
  return t.selectedRows ?? r.filter((s) => t.publicSnapshot.selection.isSelected(t.rowKey(s)));
1336
1339
  }
1337
- function to(e, t, n) {
1338
- const o = e.hook, r = eo(e);
1339
- return !o || r.length === 0 ? "" : Ki(r, Zn(e, o.rows), Gt(t, n));
1340
+ function no(e, t, n) {
1341
+ const o = e.hook, r = to(e);
1342
+ return !o || r.length === 0 ? "" : ji(r, eo(e, o.rows), jt(t, n));
1340
1343
  }
1341
- function Hi(e, t, n, o) {
1342
- return no(e, e.read(t), n, o);
1344
+ function Wi(e, t, n, o) {
1345
+ return oo(e, e.read(t), n, o);
1343
1346
  }
1344
- function no(e, t, n, o) {
1345
- const r = Pt(t, e.spec.ownExportValue);
1346
- return r === void 0 ? "" : Yn(r, Gt(n, o));
1347
+ function oo(e, t, n, o) {
1348
+ const r = It(t, e.spec.ownExportValue);
1349
+ return r === void 0 ? "" : Yn(r, jt(n, o));
1347
1350
  }
1348
- function oo({
1351
+ function ro({
1349
1352
  entry: e,
1350
1353
  registry: t,
1351
1354
  hook: n,
@@ -1356,18 +1359,18 @@ function oo({
1356
1359
  setOpen: l,
1357
1360
  panelId: c
1358
1361
  }) {
1359
- const a = ie(), u = ke(), { id: d, label: b, format: p } = e.spec, { filterOptions: m } = n, w = m?.(d), { values: g, absent: v } = H(
1362
+ const a = ie(), u = xe(), { id: d, label: b, format: p } = e.spec, { filterOptions: m } = n, w = m?.(d), { values: g, absent: v } = H(
1360
1363
  () => w ? At(w, (A) => A, u) : At(n.admitted, e.read, u),
1361
1364
  [w, n.admitted, e, u]
1362
- ), x = Oe(e.spec.filter);
1365
+ ), C = Ee(e.spec.filter);
1363
1366
  if (n.publicSnapshot.server && !w && e.spec.filter === "list" && X(
1364
1367
  `server-filter-options:${d}`,
1365
1368
  `The list filter of "${d}" offers only the values of the page in server mode; \`filterOptions\` gives it the server's.`
1366
- ), !x) return null;
1367
- const y = n.publicSnapshot, _ = x.Input, S = Si(x) ? { absentOccurs: v, format: p, kind: t.kindOf(e, n.rows) } : {}, C = () => {
1369
+ ), !C) return null;
1370
+ const y = n.publicSnapshot, _ = C.Input, k = Si(C) ? { absentOccurs: v, format: p, kind: t.kindOf(e, n.rows) } : {}, S = () => {
1368
1371
  l(!1), (s ?? o).current?.focus();
1369
1372
  };
1370
- return /* @__PURE__ */ j(
1373
+ return /* @__PURE__ */ T(
1371
1374
  it,
1372
1375
  {
1373
1376
  open: i,
@@ -1386,29 +1389,29 @@ function oo({
1386
1389
  setCondition: (A) => y.setFilter(d, A),
1387
1390
  values: g,
1388
1391
  column: { id: d, label: b },
1389
- ...S
1392
+ ...k
1390
1393
  }
1391
1394
  ),
1392
- /* @__PURE__ */ j("div", { className: h.filterFooter, children: [
1395
+ /* @__PURE__ */ T("div", { className: h.filterFooter, children: [
1393
1396
  /* @__PURE__ */ f(Q, { size: "sm", variant: "ghost", onClick: () => y.setFilter(d, null), children: a.filterReset }),
1394
- /* @__PURE__ */ f(Q, { size: "sm", onClick: C, children: a.filterDone })
1397
+ /* @__PURE__ */ f(Q, { size: "sm", onClick: S, children: a.filterDone })
1395
1398
  ] })
1396
1399
  ]
1397
1400
  }
1398
1401
  );
1399
1402
  }
1400
- function Wi({
1403
+ function qi({
1401
1404
  entry: e,
1402
1405
  registry: t,
1403
1406
  hook: n
1404
1407
  }) {
1405
- const o = ie(), [r, s] = P(!1), i = q(null), l = be(), { id: c, label: a } = e.spec, u = c in n.publicSnapshot.filter;
1406
- return /* @__PURE__ */ j(re, { children: [
1408
+ const o = ie(), [r, s] = I(!1), i = q(null), l = be(), { id: c, label: a } = e.spec, u = c in n.publicSnapshot.filter;
1409
+ return /* @__PURE__ */ T(re, { children: [
1407
1410
  /* @__PURE__ */ f(tt, { content: o.filterHint, children: /* @__PURE__ */ f(
1408
1411
  "button",
1409
1412
  {
1410
1413
  type: "button",
1411
- className: F(h.filterButton, u && h.filterActive),
1414
+ className: B(h.filterButton, u && h.filterActive),
1412
1415
  "aria-label": o.filterColumn(a),
1413
1416
  "aria-haspopup": "dialog",
1414
1417
  "aria-expanded": r,
@@ -1430,7 +1433,7 @@ function Wi({
1430
1433
  }
1431
1434
  ) }),
1432
1435
  /* @__PURE__ */ f(
1433
- oo,
1436
+ ro,
1434
1437
  {
1435
1438
  entry: e,
1436
1439
  registry: t,
@@ -1444,18 +1447,18 @@ function Wi({
1444
1447
  )
1445
1448
  ] });
1446
1449
  }
1447
- function qi({ registry: e, hook: t }) {
1448
- const n = ie(), o = ke(), r = Object.entries(t.publicSnapshot.filter).flatMap(([s, i]) => {
1450
+ function Yi({ registry: e, hook: t }) {
1451
+ const n = ie(), o = xe(), r = Object.entries(t.publicSnapshot.filter).flatMap(([s, i]) => {
1449
1452
  const l = t.rowFilters.get(s);
1450
1453
  if (l) return l.describe ? [{ id: s, rowFilter: l, text: l.describe(i) }] : [];
1451
- const c = e.columnById(s), a = c ? Oe(c.spec.filter) : void 0;
1454
+ const c = e.columnById(s), a = c ? Ee(c.spec.filter) : void 0;
1452
1455
  if (!c || !a) return [];
1453
1456
  const u = { formats: o, wording: n, format: c.spec.format, kind: e.kindOf(c, t.rows) };
1454
- return [{ id: s, entry: c, text: xi(a, i, u) }];
1457
+ return [{ id: s, entry: c, text: Ai(a, i, u) }];
1455
1458
  });
1456
1459
  return r.length === 0 ? null : /* @__PURE__ */ f(An, { "aria-label": n.conditions, className: h.conditions, children: r.map(
1457
- (s) => "rowFilter" in s ? /* @__PURE__ */ j(
1458
- Bt,
1460
+ (s) => "rowFilter" in s ? /* @__PURE__ */ T(
1461
+ Pt,
1459
1462
  {
1460
1463
  className: h.condition,
1461
1464
  onRemove: () => t.publicSnapshot.setFilter(s.id, null),
@@ -1466,25 +1469,25 @@ function qi({ registry: e, hook: t }) {
1466
1469
  ]
1467
1470
  },
1468
1471
  s.id
1469
- ) : /* @__PURE__ */ f(Yi, { entry: s.entry, text: s.text, registry: e, hook: t }, s.id)
1472
+ ) : /* @__PURE__ */ f(Ui, { entry: s.entry, text: s.text, registry: e, hook: t }, s.id)
1470
1473
  ) });
1471
1474
  }
1472
- function Yi({
1475
+ function Ui({
1473
1476
  entry: e,
1474
1477
  text: t,
1475
1478
  registry: n,
1476
1479
  hook: o
1477
1480
  }) {
1478
- const r = ie(), [s, i] = P(!1), l = q(null), c = q(null), a = be(), { id: u, label: d } = e.spec;
1479
- return /* @__PURE__ */ j(re, { children: [
1481
+ const r = ie(), [s, i] = I(!1), l = q(null), c = q(null), a = be(), { id: u, label: d } = e.spec;
1482
+ return /* @__PURE__ */ T(re, { children: [
1480
1483
  /* @__PURE__ */ f(
1481
- Bt,
1484
+ Pt,
1482
1485
  {
1483
1486
  ref: l,
1484
1487
  className: h.condition,
1485
1488
  onRemove: () => o.publicSnapshot.setFilter(u, null),
1486
1489
  removeLabel: r.removeConditionNamed(d, t),
1487
- children: /* @__PURE__ */ j(
1490
+ children: /* @__PURE__ */ T(
1488
1491
  "button",
1489
1492
  {
1490
1493
  ref: c,
@@ -1504,7 +1507,7 @@ function Yi({
1504
1507
  }
1505
1508
  ),
1506
1509
  /* @__PURE__ */ f(
1507
- oo,
1510
+ ro,
1508
1511
  {
1509
1512
  entry: e,
1510
1513
  registry: n,
@@ -1519,23 +1522,23 @@ function Yi({
1519
1522
  )
1520
1523
  ] });
1521
1524
  }
1522
- const Ui = (e, t, n) => e.groupingEntries(t.rows).find((o) => o.spec.id === n)?.spec.label ?? n;
1523
- function Ji({ registry: e, hook: t }) {
1525
+ const Ji = (e, t, n) => e.groupingEntries(t.rows).find((o) => o.spec.id === n)?.spec.label ?? n;
1526
+ function Xi({ registry: e, hook: t }) {
1524
1527
  const n = ie(), o = e.groupingEntries(t.rows);
1525
1528
  if (o.length === 0) return null;
1526
1529
  const { grouping: r, setGrouping: s } = t.publicSnapshot;
1527
- return /* @__PURE__ */ j("section", { className: h.groupingChoice, "aria-label": n.grouping, children: [
1530
+ return /* @__PURE__ */ T("section", { className: h.groupingChoice, "aria-label": n.grouping, children: [
1528
1531
  /* @__PURE__ */ f("h3", { className: h.groupingHeading, children: n.grouping }),
1529
1532
  /* @__PURE__ */ f("div", { className: h.groupingOptions, children: o.map((i) => {
1530
1533
  const { id: l, label: c } = i.spec, a = r.indexOf(l), u = a !== -1;
1531
- return /* @__PURE__ */ j(
1534
+ return /* @__PURE__ */ T(
1532
1535
  "button",
1533
1536
  {
1534
1537
  type: "button",
1535
1538
  className: h.groupingOption,
1536
1539
  "aria-label": n.groupBy(c),
1537
1540
  "aria-pressed": u,
1538
- disabled: !u && r.length >= zt,
1541
+ disabled: !u && r.length >= Kt,
1539
1542
  onClick: () => s(u ? r.filter((d) => d !== l) : [...r, l]),
1540
1543
  children: [
1541
1544
  u && /* @__PURE__ */ f("span", { className: h.groupingLevel, "aria-hidden": "true", children: a + 1 }),
@@ -1547,35 +1550,35 @@ function Ji({ registry: e, hook: t }) {
1547
1550
  }) })
1548
1551
  ] });
1549
1552
  }
1550
- function Xi({ registry: e, hook: t }) {
1553
+ function Qi({ registry: e, hook: t }) {
1551
1554
  const n = ie();
1552
1555
  if (!e.tree) return null;
1553
1556
  const o = t.publicSnapshot;
1554
- return /* @__PURE__ */ j("div", { className: F(h.groupingChoice, h.groupingOptions), children: [
1557
+ return /* @__PURE__ */ T("div", { className: B(h.groupingChoice, h.groupingOptions), children: [
1555
1558
  /* @__PURE__ */ f("button", { type: "button", className: h.groupingOption, onClick: o.unfoldAllBranches, children: n.unfoldAll }),
1556
1559
  /* @__PURE__ */ f("button", { type: "button", className: h.groupingOption, onClick: o.foldAllBranches, children: n.foldAll })
1557
1560
  ] });
1558
1561
  }
1559
- function Qi({ registry: e, hook: t }) {
1562
+ function Zi({ registry: e, hook: t }) {
1560
1563
  const n = ie(), o = t.publicSnapshot, { grouping: r } = o;
1561
1564
  if (r.length === 0) return null;
1562
- const s = r.map((i) => Ui(e, t, i));
1565
+ const s = r.map((i) => Ji(e, t, i));
1563
1566
  return (
1564
1567
  /* In a tag group, as the conditions stand: the tag is one stop, its button
1565
1568
  the thing one tabs to, and the ring stands on the tag. */
1566
- /* @__PURE__ */ f(An, { "aria-label": n.groupedBy, className: h.groupingTag, children: /* @__PURE__ */ f(Bt, { onRemove: () => o.setGrouping([]), removeLabel: n.removeGrouping, children: /* @__PURE__ */ j(
1569
+ /* @__PURE__ */ f(An, { "aria-label": n.groupedBy, className: h.groupingTag, children: /* @__PURE__ */ f(Pt, { onRemove: () => o.setGrouping([]), removeLabel: n.removeGrouping, children: /* @__PURE__ */ T(
1567
1570
  Nn,
1568
1571
  {
1569
- trigger: /* @__PURE__ */ j("button", { type: "button", className: F(h.conditionButton, h.groupingTrigger), children: [
1572
+ trigger: /* @__PURE__ */ T("button", { type: "button", className: B(h.conditionButton, h.groupingTrigger), children: [
1570
1573
  /* @__PURE__ */ f("span", { className: h.groupingPrefix, children: n.groupedBy }),
1571
- s.map((i, l) => /* @__PURE__ */ j("span", { className: h.groupingPath, children: [
1574
+ s.map((i, l) => /* @__PURE__ */ T("span", { className: h.groupingPath, children: [
1572
1575
  l > 0 && /* @__PURE__ */ f("span", { className: h.groupingSeparator, "aria-hidden": "true", children: "›" }),
1573
1576
  i
1574
1577
  ] }, r[l]))
1575
1578
  ] }),
1576
1579
  children: [
1577
1580
  r.map((i, l) => /* @__PURE__ */ f(nt, { onSelect: () => o.setGrouping(r.filter((c) => c !== i)), children: n.removeGroupingLevel(s[l]) }, i)),
1578
- /* @__PURE__ */ f(Eo, {}),
1581
+ /* @__PURE__ */ f(Lo, {}),
1579
1582
  /* @__PURE__ */ f(nt, { onSelect: o.unfoldAll, children: n.unfoldAll }),
1580
1583
  /* @__PURE__ */ f(nt, { onSelect: o.foldAll, children: n.foldAll })
1581
1584
  ]
@@ -1583,38 +1586,38 @@ function Qi({ registry: e, hook: t }) {
1583
1586
  ) }) })
1584
1587
  );
1585
1588
  }
1586
- const ro = /* @__PURE__ */ rt("sm");
1589
+ const so = /* @__PURE__ */ rt("sm");
1587
1590
  function at(e) {
1588
- const t = _e(ro);
1591
+ const t = _e(so);
1589
1592
  return e ?? t;
1590
1593
  }
1591
- function so({ registry: e }) {
1594
+ function io({ registry: e }) {
1592
1595
  const t = ie(), n = at();
1593
1596
  return /* @__PURE__ */ f(Q, { size: n, variant: "secondary", onClick: () => e.addRow?.(), children: t.newRow });
1594
1597
  }
1595
- function io({
1598
+ function lo({
1596
1599
  registry: e,
1597
1600
  className: t,
1598
1601
  children: n,
1599
1602
  own: o = !1,
1600
1603
  size: r = "sm"
1601
1604
  }) {
1602
- const s = ie(), i = ke(), l = e?.hook ?? null;
1605
+ const s = ie(), i = xe(), l = e?.hook ?? null;
1603
1606
  let c = null, a = null;
1604
1607
  if (e && l) {
1605
1608
  const u = l.publicSnapshot, d = u.search !== "" || Object.keys(u.filter).length > 0, b = o || u.selection.count === 0 ? [] : l.selectedRows ?? u.filtered.filter((w) => u.selection.isSelected(l.rowKey(w))), p = e.hasRowActions() ? e.actions.ordered().filter((w) => w.spec.bulk) : [];
1606
- c = /* @__PURE__ */ j(re, { children: [
1607
- /* @__PURE__ */ f(Qi, { registry: e, hook: l }),
1608
- /* @__PURE__ */ f(qi, { registry: e, hook: l })
1609
+ c = /* @__PURE__ */ T(re, { children: [
1610
+ /* @__PURE__ */ f(Zi, { registry: e, hook: l }),
1611
+ /* @__PURE__ */ f(Yi, { registry: e, hook: l })
1609
1612
  ] });
1610
1613
  const m = !d && b.length === 0 && !e.rowAdding;
1611
- a = /* @__PURE__ */ j("div", { className: F(h.toolbarGroup, m && h.toolbarGroupIdle), children: [
1614
+ a = /* @__PURE__ */ T("div", { className: B(h.toolbarGroup, m && h.toolbarGroupIdle), children: [
1612
1615
  /* @__PURE__ */ f("span", { role: "status", className: h.filteredCount, children: d ? u.server ? (
1613
1616
  /* The server counts the matches only; a total beside them would be a second request. */
1614
1617
  s.entries(u.rowCount, i.count(u.rowCount))
1615
1618
  ) : s.filteredOfTotal(i.count(u.filtered.length), i.count(l.tableState.total ?? l.admitted.length)) : "" }),
1616
- d && /* @__PURE__ */ f(Q, { size: r, variant: "ghost", onClick: () => Qn(u), children: s.resetAll }),
1617
- b.length > 0 && /* @__PURE__ */ j(re, { children: [
1619
+ d && /* @__PURE__ */ f(Q, { size: r, variant: "ghost", onClick: () => Zn(u), children: s.resetAll }),
1620
+ b.length > 0 && /* @__PURE__ */ T(re, { children: [
1618
1621
  /* @__PURE__ */ f("span", { className: h.toolbarInfo, children: s.selectedCount(b.length, i.count(b.length)) }),
1619
1622
  p.map(({ key: w, spec: g }) => /* @__PURE__ */ f(
1620
1623
  Q,
@@ -1627,30 +1630,30 @@ function io({
1627
1630
  w
1628
1631
  ))
1629
1632
  ] }),
1630
- e.rowAdding && /* @__PURE__ */ f(so, { registry: e })
1633
+ e.rowAdding && /* @__PURE__ */ f(io, { registry: e })
1631
1634
  ] });
1632
1635
  }
1633
- return /* @__PURE__ */ f(ro, { value: r, children: /* @__PURE__ */ f(jn, { size: r, children: /* @__PURE__ */ j("div", { className: F(h.toolbar, r === "md" && h.toolbarMd, t), children: [
1634
- /* @__PURE__ */ j("div", { className: h.toolbarGroup, children: [
1636
+ return /* @__PURE__ */ f(so, { value: r, children: /* @__PURE__ */ f(Tn, { size: r, children: /* @__PURE__ */ T("div", { className: B(h.toolbar, r === "md" && h.toolbarMd, t), children: [
1637
+ /* @__PURE__ */ T("div", { className: h.toolbarGroup, children: [
1635
1638
  n,
1636
1639
  c
1637
1640
  ] }),
1638
1641
  a
1639
1642
  ] }) }) });
1640
1643
  }
1641
- const Tt = /* @__PURE__ */ rt(null), Zi = () => () => {
1644
+ const Rt = /* @__PURE__ */ rt(null), el = () => () => {
1642
1645
  }, gn = () => 0;
1643
1646
  function Ye(e) {
1644
- const t = _e(Tt), n = e ? Pi(e.Table) ?? null : t?.registry ?? null;
1647
+ const t = _e(Rt), n = e ? $i(e.Table) ?? null : t?.registry ?? null;
1645
1648
  st(
1646
- n ? n.subscribe : Zi,
1649
+ n ? n.subscribe : el,
1647
1650
  n ? n.bodyVersion : gn,
1648
1651
  n ? n.bodyVersion : gn
1649
1652
  );
1650
1653
  const o = n?.hook?.publicSnapshot;
1651
1654
  return !n || !o ? null : { registry: n, snapshot: o, inside: !e && t !== null, footerTarget: e ? null : t?.footerTarget ?? null };
1652
1655
  }
1653
- function el(e, t) {
1656
+ function tl(e, t) {
1654
1657
  const n = /* @__PURE__ */ new Map();
1655
1658
  for (const [o, r] of t) {
1656
1659
  const s = e.get(o);
@@ -1658,38 +1661,38 @@ function el(e, t) {
1658
1661
  }
1659
1662
  return n;
1660
1663
  }
1661
- function lo(e, t) {
1664
+ function ao(e, t) {
1662
1665
  const n = getComputedStyle(e).getPropertyValue(t).trim(), o = Number.parseFloat(n);
1663
1666
  return Number.isFinite(o) ? n.endsWith("ms") ? o : o * 1e3 : 0;
1664
1667
  }
1665
- const tl = (e) => {
1668
+ const nl = (e) => {
1666
1669
  const t = /* @__PURE__ */ new Map(), n = e.getBoundingClientRect().top;
1667
1670
  for (const o of Array.from(e.querySelectorAll("tbody > tr[data-motion]")))
1668
1671
  t.set(o.dataset.motion, o.getBoundingClientRect().top - n);
1669
1672
  return t;
1670
1673
  };
1671
- function nl(e, t) {
1674
+ function ol(e, t) {
1672
1675
  const n = q(null);
1673
1676
  Z(() => {
1674
1677
  const o = e.current;
1675
1678
  if (!o) return;
1676
- const r = tl(o), s = n.current;
1679
+ const r = nl(o), s = n.current;
1677
1680
  if (n.current = { trigger: t, positions: r }, !s || s.trigger === t) return;
1678
- const i = lo(o, "--u-duration-medium");
1681
+ const i = ao(o, "--u-duration-medium");
1679
1682
  if (i === 0 || typeof o.animate != "function") return;
1680
- const l = getComputedStyle(o).getPropertyValue("--u-ease-out").trim() || "ease-out", c = el(s.positions, r);
1683
+ const l = getComputedStyle(o).getPropertyValue("--u-ease-out").trim() || "ease-out", c = tl(s.positions, r);
1681
1684
  for (const a of Array.from(o.querySelectorAll("tbody > tr[data-motion]"))) {
1682
1685
  const u = a.dataset.motion, d = c.get(u);
1683
1686
  d !== void 0 ? a.animate([{ transform: `translateY(${d}px)` }, { transform: "none" }], { duration: i, easing: l }) : s.positions.has(u) || a.animate([{ opacity: 0, transform: "translateY(-4px)" }, { opacity: 1, transform: "none" }], { duration: i, easing: l });
1684
1687
  }
1685
1688
  });
1686
1689
  }
1687
- function ol(e, t, n) {
1690
+ function rl(e, t, n) {
1688
1691
  const o = q(t);
1689
1692
  Z(() => {
1690
1693
  const r = e.current, s = o.current;
1691
1694
  if (o.current = t, !r || s === t || typeof r.animate != "function") return;
1692
- const i = lo(r, "--u-duration-medium");
1695
+ const i = ao(r, "--u-duration-medium");
1693
1696
  if (i === 0) return;
1694
1697
  const l = performance.now();
1695
1698
  let c = requestAnimationFrame(function a(u) {
@@ -1701,8 +1704,8 @@ function ol(e, t, n) {
1701
1704
  };
1702
1705
  }, [e, t, n]);
1703
1706
  }
1704
- const rl = (e) => e.controls + (e.span ? 1 : 0) + e.aggregates.length + (e.actions ? 1 : 0);
1705
- function ao(e) {
1707
+ const sl = (e) => e.controls + (e.span ? 1 : 0) + e.aggregates.length + (e.actions ? 1 : 0);
1708
+ function co(e) {
1706
1709
  const { controls: t, span: n, aggregates: o, actions: r, blocks: s } = e, i = o.length, l = o.indexOf(!0), c = s.end > 0 ? s.end - (r ? 1 : 0) : 0, a = Math.max(n || i === 0 ? 0 : 1, Math.min(l === -1 ? i : l, i - c)), u = t + (n ? 1 : 0), d = s.start > 0 ? s.start - u : 0;
1707
1710
  return {
1708
1711
  lead: a,
@@ -1711,14 +1714,14 @@ function ao(e) {
1711
1714
  };
1712
1715
  }
1713
1716
  function bt(e, t) {
1714
- const n = rl(t);
1717
+ const n = sl(t);
1715
1718
  if (e === "cells") return Array.from({ length: n }, () => 1);
1716
1719
  if (e === "whole") return [n];
1717
- const { lead: o, labelColumns: r, countColumns: s } = ao(t), i = Array.from({ length: t.controls }, () => 1), l = Array.from({ length: t.aggregates.length - o + (t.actions ? 1 : 0) }, () => 1), c = (a) => o - a > 0 ? [o - a] : [];
1720
+ const { lead: o, labelColumns: r, countColumns: s } = co(t), i = Array.from({ length: t.controls }, () => 1), l = Array.from({ length: t.aggregates.length - o + (t.actions ? 1 : 0) }, () => 1), c = (a) => o - a > 0 ? [o - a] : [];
1718
1721
  return e === "header" ? [...i, (t.span ? 1 : 0) + r, ...c(r), ...l] : [...i, 1, ...s > 0 ? [s] : [], ...c(s), ...l];
1719
1722
  }
1720
1723
  const Ue = (e) => `row:${e}`;
1721
- function sl({ layout: e, body: t, rowKey: n, expanded: o, foot: r }) {
1724
+ function il({ layout: e, body: t, rowKey: n, expanded: o, foot: r }) {
1722
1725
  const s = bt("cells", e), i = bt("whole", e), l = [{ key: "head", cells: s, at: -1 }], c = (a, u) => {
1723
1726
  const d = n(a);
1724
1727
  l.push({ key: Ue(d), cells: s, at: u, row: a }), o.has(d) && l.push({ key: `detail:${d}`, cells: i, at: u, row: a });
@@ -1727,7 +1730,7 @@ function sl({ layout: e, body: t, rowKey: n, expanded: o, foot: r }) {
1727
1730
  a.kind === "row" ? c(a.row, u) : l.push({ key: `${a.kind}:${a.group.path}`, cells: bt(a.kind, e), at: u });
1728
1731
  }), l.length === 1 && l.push({ key: "empty", cells: i, at: -1 }), r && l.push({ key: "foot", cells: s, at: -1 }), l;
1729
1732
  }
1730
- function co(e, t) {
1733
+ function uo(e, t) {
1731
1734
  let n = 0;
1732
1735
  for (let o = 0; o < e.length; o++) {
1733
1736
  const r = n + e[o];
@@ -1736,16 +1739,16 @@ function co(e, t) {
1736
1739
  }
1737
1740
  return { index: 0, start: 0 };
1738
1741
  }
1739
- const Ge = (e, t) => e.slice(0, t).reduce((n, o) => n + o, 0);
1740
- function il(e, t, n, o) {
1742
+ const je = (e, t) => e.slice(0, t).reduce((n, o) => n + o, 0);
1743
+ function ll(e, t, n, o) {
1741
1744
  const r = e.length - 1, s = e[t.line];
1742
1745
  if (!s) return t;
1743
- const { index: i } = co(s.cells, t.column), l = (c) => ({ line: Math.max(0, Math.min(r, c)), column: t.column });
1746
+ const { index: i } = uo(s.cells, t.column), l = (c) => ({ line: Math.max(0, Math.min(r, c)), column: t.column });
1744
1747
  switch (n) {
1745
1748
  case "left":
1746
- return i > 0 ? { line: t.line, column: Ge(s.cells, i - 1) } : t;
1749
+ return i > 0 ? { line: t.line, column: je(s.cells, i - 1) } : t;
1747
1750
  case "right":
1748
- return i < s.cells.length - 1 ? { line: t.line, column: Ge(s.cells, i + 1) } : t;
1751
+ return i < s.cells.length - 1 ? { line: t.line, column: je(s.cells, i + 1) } : t;
1749
1752
  case "up":
1750
1753
  return l(t.line - 1);
1751
1754
  case "down":
@@ -1757,15 +1760,15 @@ function il(e, t, n, o) {
1757
1760
  case "lineStart":
1758
1761
  return { line: t.line, column: 0 };
1759
1762
  case "lineEnd":
1760
- return { line: t.line, column: Ge(s.cells, s.cells.length - 1) };
1763
+ return { line: t.line, column: je(s.cells, s.cells.length - 1) };
1761
1764
  case "first":
1762
1765
  return { line: 0, column: 0 };
1763
1766
  case "last":
1764
- return { line: r, column: Ge(e[r].cells, e[r].cells.length - 1) };
1767
+ return { line: r, column: je(e[r].cells, e[r].cells.length - 1) };
1765
1768
  }
1766
1769
  }
1767
- function ll(e, t, n, o) {
1768
- const r = e.flatMap((l, c) => l.cells.map((a, u) => ({ line: c, column: Ge(l.cells, u) }))), s = r.findIndex((l) => l.line === t.line && l.column === co(e[t.line].cells, t.column).start);
1770
+ function al(e, t, n, o) {
1771
+ const r = e.flatMap((l, c) => l.cells.map((a, u) => ({ line: c, column: je(l.cells, u) }))), s = r.findIndex((l) => l.line === t.line && l.column === uo(e[t.line].cells, t.column).start);
1769
1772
  return (n ? r.slice(0, Math.max(0, s)).reverse() : r.slice(s + 1)).find(o) ?? null;
1770
1773
  }
1771
1774
  function pn(e, t, n) {
@@ -1773,7 +1776,7 @@ function pn(e, t, n) {
1773
1776
  return o >= 0 ? o : Math.max(0, Math.min(e.length - 1, n));
1774
1777
  }
1775
1778
  const he = "new";
1776
- class al {
1779
+ class cl {
1777
1780
  wish = null;
1778
1781
  /** `open`: the editor, with its list or calendar open - a click asked for it. */
1779
1782
  want(t) {
@@ -1785,78 +1788,78 @@ class al {
1785
1788
  return n && (this.wish = null), n;
1786
1789
  }
1787
1790
  }
1788
- function cl() {
1789
- const [e, t] = P({ active: null, widget: !1, editing: null }), [n] = P(() => new al());
1791
+ function dl() {
1792
+ const [e, t] = I({ active: null, widget: !1, editing: null }), [n] = I(() => new cl());
1790
1793
  return { state: e, setState: t, focus: n };
1791
1794
  }
1792
1795
  const mn = (e) => e?.spec.edit !== void 0;
1793
- function uo(e, t) {
1796
+ function fo(e, t) {
1794
1797
  const n = (o) => se(o) || o === "" ? null : o instanceof Date ? o.getTime() : o;
1795
1798
  return Object.is(n(e), n(t));
1796
1799
  }
1797
- function dl(e) {
1798
- const { grid: t, lines: n, ids: o, columnById: r, rowKey: s, onCellEdit: i, rowMode: l, onRowSave: c, onRowAdd: a, newRow: u } = e, { setState: d } = t, b = n.map((k) => k.key), p = t.state.editing, m = (k) => k === he ? p?.fresh : n.find((R) => R.key === k)?.row, w = (k) => {
1799
- const R = n[k.line];
1800
- return R?.key === he ? { row: R.row } : R?.row !== void 0 && R.key === Ue(s(R.row)) ? { row: R.row } : null;
1801
- }, g = (k) => w(k) !== null && mn(r(o[k.column] ?? "")), v = () => o.map(r).filter(mn), x = (k, R, E = !1) => {
1802
- const T = n[k.line], O = r(o[k.column] ?? ""), D = l ? Object.fromEntries(v().map((I) => [I.spec.id, I.read(T.row)])) : {};
1803
- D[O.spec.id] = R === void 0 ? O.read(T.row) : R, t.focus.want(E ? "open" : "editor"), d((I) => ({
1804
- ...I,
1805
- active: { line: T.key, column: O.spec.id, lineIndex: k.line, columnIndex: k.column },
1806
- editing: { line: T.key, column: O.spec.id, row: l, drafts: D, errors: {}, refused: !1 }
1800
+ function ul(e) {
1801
+ const { grid: t, lines: n, ids: o, columnById: r, rowKey: s, onCellEdit: i, rowMode: l, onRowSave: c, onRowAdd: a, newRow: u } = e, { setState: d } = t, b = n.map((x) => x.key), p = t.state.editing, m = (x) => x === he ? p?.fresh : n.find((O) => O.key === x)?.row, w = (x) => {
1802
+ const O = n[x.line];
1803
+ return O?.key === he ? { row: O.row } : O?.row !== void 0 && O.key === Ue(s(O.row)) ? { row: O.row } : null;
1804
+ }, g = (x) => w(x) !== null && mn(r(o[x.column] ?? "")), v = () => o.map(r).filter(mn), C = (x, O, M = !1) => {
1805
+ const R = n[x.line], E = r(o[x.column] ?? ""), D = l ? Object.fromEntries(v().map(($) => [$.spec.id, $.read(R.row)])) : {};
1806
+ D[E.spec.id] = O === void 0 ? E.read(R.row) : O, t.focus.want(M ? "open" : "editor"), d(($) => ({
1807
+ ...$,
1808
+ active: { line: R.key, column: E.spec.id, lineIndex: x.line, columnIndex: x.column },
1809
+ editing: { line: R.key, column: E.spec.id, row: l, drafts: D, errors: {}, refused: !1 }
1807
1810
  }));
1808
- }, y = (k = {}, R = !0) => {
1811
+ }, y = (x = {}, O = !0) => {
1809
1812
  if (!p) return !0;
1810
- const E = { ...p.drafts, ...k }, T = m(p.line);
1811
- if (T === void 0)
1812
- return d((B) => ({ ...B, editing: null })), !0;
1813
- const O = {};
1814
- for (const [B, z] of Object.entries(E)) {
1815
- const Y = r(B)?.spec.validate?.(z, T);
1816
- Y && (O[B] = Y);
1813
+ const M = { ...p.drafts, ...x }, R = m(p.line);
1814
+ if (R === void 0)
1815
+ return d((P) => ({ ...P, editing: null })), !0;
1816
+ const E = {};
1817
+ for (const [P, K] of Object.entries(M)) {
1818
+ const Y = r(P)?.spec.validate?.(K, R);
1819
+ Y && (E[P] = Y);
1817
1820
  }
1818
- const D = Object.keys(E).find((B) => O[B] !== void 0);
1821
+ const D = Object.keys(M).find((P) => E[P] !== void 0);
1819
1822
  if (D !== void 0) {
1820
- const B = p.row ? D : p.column;
1821
- return R && t.focus.want("editor"), d((z) => ({
1822
- ...z,
1823
- active: { line: p.line, column: B, lineIndex: Math.max(0, b.indexOf(p.line)), columnIndex: o.indexOf(B) },
1824
- editing: z.editing && { ...z.editing, column: B, drafts: E, errors: O, refused: !1 }
1823
+ const P = p.row ? D : p.column;
1824
+ return O && t.focus.want("editor"), d((K) => ({
1825
+ ...K,
1826
+ active: { line: p.line, column: P, lineIndex: Math.max(0, b.indexOf(p.line)), columnIndex: o.indexOf(P) },
1827
+ editing: K.editing && { ...K.editing, column: P, drafts: M, errors: E, refused: !1 }
1825
1828
  })), !1;
1826
1829
  }
1827
- const I = Object.keys(E).filter((B) => !uo(E[B], r(B)?.read(T)));
1828
- return p.line === he ? a?.({ values: E }) : p.row ? I.length > 0 && c?.({ rowKey: s(T), changes: Object.fromEntries(I.map((B) => [B, E[B]])), row: T }) : I.length > 0 && i?.({ rowKey: s(T), columnId: p.column, value: E[p.column], row: T }), R && t.focus.want("cell"), d((B) => ({ ...B, editing: null })), !0;
1829
- }, _ = (k, R) => y({ [k]: R }), S = () => {
1830
- t.focus.want("cell"), d((k) => ({ ...k, editing: null }));
1831
- }, C = () => {
1832
- t.focus.want("editor"), d((k) => k.editing ? { ...k, editing: { ...k.editing, refused: !0 } } : k);
1830
+ const $ = Object.keys(M).filter((P) => !fo(M[P], r(P)?.read(R)));
1831
+ return p.line === he ? a?.({ values: M }) : p.row ? $.length > 0 && c?.({ rowKey: s(R), changes: Object.fromEntries($.map((P) => [P, M[P]])), row: R }) : $.length > 0 && i?.({ rowKey: s(R), columnId: p.column, value: M[p.column], row: R }), O && t.focus.want("cell"), d((P) => ({ ...P, editing: null })), !0;
1832
+ }, _ = (x, O) => y({ [x]: O }), k = () => {
1833
+ t.focus.want("cell"), d((x) => ({ ...x, editing: null }));
1834
+ }, S = () => {
1835
+ t.focus.want("editor"), d((x) => x.editing ? { ...x, editing: { ...x.editing, refused: !0 } } : x);
1833
1836
  };
1834
- return { rowAt: w, editable: g, startEdit: x, save: y, commit: _, discard: S, refuse: C, setDraft: (k, R) => d((E) => {
1835
- if (!E.editing) return E;
1836
- const T = { ...E.editing.errors };
1837
- if (T[k] !== void 0) {
1838
- const O = r(k)?.spec.validate?.(R, m(E.editing.line));
1839
- O ? T[k] = O : delete T[k];
1837
+ return { rowAt: w, editable: g, startEdit: C, save: y, commit: _, discard: k, refuse: S, setDraft: (x, O) => d((M) => {
1838
+ if (!M.editing) return M;
1839
+ const R = { ...M.editing.errors };
1840
+ if (R[x] !== void 0) {
1841
+ const E = r(x)?.spec.validate?.(O, m(M.editing.line));
1842
+ E ? R[x] = E : delete R[x];
1840
1843
  }
1841
- return { ...E, editing: { ...E.editing, drafts: { ...E.editing.drafts, [k]: R }, errors: T, refused: !1 } };
1844
+ return { ...M, editing: { ...M.editing, drafts: { ...M.editing.drafts, [x]: O }, errors: R, refused: !1 } };
1842
1845
  }), addRow: () => {
1843
- if (p && (p.row || !y())) return C();
1844
- const k = v(), R = k[0];
1845
- if (!R) return;
1846
- const E = u?.() ?? {};
1847
- t.focus.want("editor"), d((T) => ({
1848
- ...T,
1846
+ if (p && (p.row || !y())) return S();
1847
+ const x = v(), O = x[0];
1848
+ if (!O) return;
1849
+ const M = u?.() ?? {};
1850
+ t.focus.want("editor"), d((R) => ({
1851
+ ...R,
1849
1852
  widget: !1,
1850
- active: { line: he, column: R.spec.id, lineIndex: 1, columnIndex: o.indexOf(R.spec.id) },
1853
+ active: { line: he, column: O.spec.id, lineIndex: 1, columnIndex: o.indexOf(O.spec.id) },
1851
1854
  editing: {
1852
1855
  line: he,
1853
- column: R.spec.id,
1856
+ column: O.spec.id,
1854
1857
  row: !0,
1855
1858
  /* What `newRow` leaves out is empty - `null`, as an emptied field says it. */
1856
- drafts: Object.fromEntries(k.map((O) => [O.spec.id, O.read(E) ?? null])),
1859
+ drafts: Object.fromEntries(x.map((E) => [E.spec.id, E.read(M) ?? null])),
1857
1860
  errors: {},
1858
1861
  refused: !1,
1859
- fresh: E
1862
+ fresh: M
1860
1863
  }
1861
1864
  }));
1862
1865
  } };
@@ -1876,7 +1879,7 @@ function qt(e, t) {
1876
1879
  const { start: s, end: i } = Wt(o).find((l) => l.cell === n);
1877
1880
  return { cell: n, line: r, column: s, end: i };
1878
1881
  }
1879
- const ul = {
1882
+ const fl = {
1880
1883
  ArrowLeft: "left",
1881
1884
  ArrowRight: "right",
1882
1885
  ArrowUp: "up",
@@ -1886,26 +1889,26 @@ const ul = {
1886
1889
  PageUp: "pageUp",
1887
1890
  PageDown: "pageDown"
1888
1891
  };
1889
- function fl(e, t) {
1892
+ function hl(e, t) {
1890
1893
  const n = e.parentElement?.getBoundingClientRect().height ?? 0, o = t.parentElement, r = Math.min(o?.clientHeight || window.innerHeight, window.innerHeight);
1891
1894
  return n > 0 ? Math.max(1, Math.floor(r / n) - 1) : 10;
1892
1895
  }
1893
- function fo(e, t) {
1896
+ function ho(e, t) {
1894
1897
  return t && t.line === e.line && t.columnIndex >= e.column && t.columnIndex < e.end ? t.columnIndex : e.column;
1895
1898
  }
1896
- function hl({ grid: e, lines: t, ids: n, virtual: o }, r, s) {
1899
+ function gl({ grid: e, lines: t, ids: n, virtual: o }, r, s) {
1897
1900
  const i = t[s.line];
1898
1901
  if (!i) return;
1899
1902
  e.setState((a) => ({ ...a, widget: !1, active: { line: i.key, column: n[s.column] ?? "", lineIndex: s.line, columnIndex: s.column } }));
1900
1903
  const l = Array.from(r.querySelectorAll("tr[data-grid-line]")).find((a) => a.dataset.gridLine === i.key), c = l ? Wt(l).find((a) => s.column >= a.start && s.column < a.end)?.cell : void 0;
1901
1904
  c ? c.focus({ preventScroll: i.key === "head" }) : (e.focus.want("cell"), o && i.at >= 0 && o.showRow(i.at));
1902
1905
  }
1903
- function gl(e, t, n) {
1906
+ function pl(e, t, n) {
1904
1907
  const { grid: o, lines: r, ids: s, columnById: i, select: l } = e, { rowAt: c, editable: a, startEdit: u, save: d, discard: b } = t, p = r.map((y) => y.key), m = o.state.editing, w = n.currentTarget;
1905
1908
  if (n.defaultPrevented) return;
1906
1909
  const g = qt(w, n.target);
1907
1910
  if (!g) return;
1908
- const v = { line: p.indexOf(g.line), column: fo(g, o.state.active) };
1911
+ const v = { line: p.indexOf(g.line), column: ho(g, o.state.active) };
1909
1912
  if (v.line < 0) return;
1910
1913
  if (m?.row && m.line === g.line) {
1911
1914
  n.key === "Escape" ? (n.preventDefault(), b()) : n.key === "Enter" && !(n.target instanceof HTMLButtonElement) && (n.preventDefault(), d());
@@ -1917,7 +1920,7 @@ function gl(e, t, n) {
1917
1920
  else if (n.key === "Enter" && !(n.target instanceof HTMLButtonElement))
1918
1921
  n.preventDefault(), d();
1919
1922
  else if (n.key === "Tab") {
1920
- const y = ll(r, v, n.shiftKey, a), _ = d();
1923
+ const y = al(r, v, n.shiftKey, a), _ = d();
1921
1924
  if ((y || !_) && n.preventDefault(), !_) return;
1922
1925
  y ? u(y) : o.focus.want(null);
1923
1926
  }
@@ -1928,9 +1931,9 @@ function gl(e, t, n) {
1928
1931
  return;
1929
1932
  }
1930
1933
  if (n.altKey || n.metaKey) return;
1931
- const x = n.ctrlKey ? { Home: "first", End: "last" }[n.key] : ul[n.key];
1932
- if (x) {
1933
- n.preventDefault(), hl(e, w, il(r, v, x, fl(g.cell, w)));
1934
+ const C = n.ctrlKey ? { Home: "first", End: "last" }[n.key] : fl[n.key];
1935
+ if (C) {
1936
+ n.preventDefault(), gl(e, w, ll(r, v, C, hl(g.cell, w)));
1934
1937
  return;
1935
1938
  }
1936
1939
  if (!n.ctrlKey) {
@@ -1954,14 +1957,14 @@ function gl(e, t, n) {
1954
1957
  }
1955
1958
  }
1956
1959
  }
1957
- function pl({ grid: e, lines: t }, { editable: n, startEdit: o }, r) {
1960
+ function ml({ grid: e, lines: t }, { editable: n, startEdit: o }, r) {
1958
1961
  if (r.button !== 0 || e.state.editing) return;
1959
1962
  const s = qt(r.currentTarget, r.target);
1960
1963
  if (!s || r.target.closest(Ht) !== s.cell) return;
1961
1964
  const i = { line: t.findIndex((l) => l.key === s.line), column: s.column };
1962
1965
  i.line >= 0 && n(i) && o(i, void 0, !0);
1963
1966
  }
1964
- function ml({ grid: e, lines: t, ids: n }, { save: o, refuse: r }, s) {
1967
+ function wl({ grid: e, lines: t, ids: n }, { save: o, refuse: r }, s) {
1965
1968
  const i = e.state.editing, l = qt(s.currentTarget, s.target);
1966
1969
  if (!l) return;
1967
1970
  const c = t.findIndex((u) => u.key === l.line), a = n[l.column] ?? "";
@@ -1973,7 +1976,7 @@ function ml({ grid: e, lines: t, ids: n }, { save: o, refuse: r }, s) {
1973
1976
  return;
1974
1977
  }
1975
1978
  e.focus.want(null), e.setState((u) => {
1976
- const d = fo(l, u.active);
1979
+ const d = ho(l, u.active);
1977
1980
  return {
1978
1981
  ...u,
1979
1982
  widget: s.target !== l.cell,
@@ -1981,11 +1984,11 @@ function ml({ grid: e, lines: t, ids: n }, { save: o, refuse: r }, s) {
1981
1984
  };
1982
1985
  });
1983
1986
  }
1984
- function wl({ grid: e }, t) {
1987
+ function bl({ grid: e }, t) {
1985
1988
  t.currentTarget.contains(t.relatedTarget) || e.setState((n) => n.widget ? { ...n, widget: !1 } : n);
1986
1989
  }
1987
- function bl(e) {
1988
- const { grid: t, rowKey: n, onRowDelete: o } = e, r = dl(e), { save: s, discard: i, commit: l, setDraft: c, editable: a, addRow: u } = r, d = {
1990
+ function vl(e) {
1991
+ const { grid: t, rowKey: n, onRowDelete: o } = e, r = ul(e), { save: s, discard: i, commit: l, setDraft: c, editable: a, addRow: u } = r, d = {
1989
1992
  editing: t.state.editing,
1990
1993
  setDraft: c,
1991
1994
  commit: l,
@@ -1994,10 +1997,10 @@ function bl(e) {
1994
1997
  remove: o && ((m) => o({ rowKey: n(m), row: m }))
1995
1998
  }, b = t.state.editing, p = b && !b.row ? () => void s({}, !1) : void 0;
1996
1999
  return {
1997
- onKeyDown: (m) => gl(e, r, m),
1998
- onClick: (m) => pl(e, r, m),
1999
- onFocus: (m) => ml(e, r, m),
2000
- onBlur: (m) => wl(e, m),
2000
+ onKeyDown: (m) => pl(e, r, m),
2001
+ onClick: (m) => ml(e, r, m),
2002
+ onFocus: (m) => wl(e, r, m),
2003
+ onBlur: (m) => bl(e, m),
2001
2004
  context: d,
2002
2005
  editable: a,
2003
2006
  addRow: u,
@@ -2005,20 +2008,20 @@ function bl(e) {
2005
2008
  };
2006
2009
  }
2007
2010
  const Ve = /* @__PURE__ */ rt(null);
2008
- function vl(e, t) {
2011
+ function yl(e, t) {
2009
2012
  const n = _e(Ve), o = n?.editing;
2010
2013
  return o && o.line === e && t in o.drafts ? n : null;
2011
2014
  }
2012
- const ze = "data-grid-tabindex";
2013
- function yl(e, t) {
2014
- if (t && !e.hasAttribute(ze))
2015
- e.setAttribute(ze, e.getAttribute("tabindex") ?? ""), e.tabIndex = -1;
2016
- else if (!t && e.hasAttribute(ze)) {
2017
- const n = e.getAttribute(ze);
2018
- n === "" ? e.removeAttribute("tabindex") : e.setAttribute("tabindex", n), e.removeAttribute(ze);
2015
+ const Ke = "data-grid-tabindex";
2016
+ function _l(e, t) {
2017
+ if (t && !e.hasAttribute(Ke))
2018
+ e.setAttribute(Ke, e.getAttribute("tabindex") ?? ""), e.tabIndex = -1;
2019
+ else if (!t && e.hasAttribute(Ke)) {
2020
+ const n = e.getAttribute(Ke);
2021
+ n === "" ? e.removeAttribute("tabindex") : e.setAttribute("tabindex", n), e.removeAttribute(Ke);
2019
2022
  }
2020
2023
  }
2021
- function _l({
2024
+ function xl({
2022
2025
  table: e,
2023
2026
  grid: t,
2024
2027
  lines: n,
@@ -2031,7 +2034,7 @@ function _l({
2031
2034
  i.current = s;
2032
2035
  });
2033
2036
  const l = s !== void 0;
2034
- return xe(() => {
2037
+ return Ce(() => {
2035
2038
  const c = e.current;
2036
2039
  if (!l || !c) return;
2037
2040
  const a = (u) => {
@@ -2046,26 +2049,26 @@ function _l({
2046
2049
  const { active: a, widget: u, editing: d } = t.state, b = kl(a, n, o), p = n[b.line]?.key, m = new Map(n.map((y, _) => [y.key, _]));
2047
2050
  let w = null, g = null;
2048
2051
  for (const y of Array.from(c.querySelectorAll("tr[data-grid-line]"))) {
2049
- const _ = y.dataset.gridLine, S = Wt(y);
2050
- for (const { cell: C, start: A, end: M } of S) {
2051
- const k = b.column >= A && b.column < M || C === S.at(-1).cell && b.column >= M;
2052
- k && _ === p && (w = C), k && g === null && _ !== "head" && (g = C), C.tabIndex = -1, r && _ !== "head" && !r({ line: m.get(_) ?? -1, column: A }) ? C.setAttribute("aria-readonly", "true") : C.removeAttribute("aria-readonly");
2053
- const R = d?.row === !0 && d.line === _ || C === w && (u || d !== null && d.line === _);
2054
- for (const E of Array.from(C.querySelectorAll(Ht))) yl(E, !R);
2052
+ const _ = y.dataset.gridLine, k = Wt(y);
2053
+ for (const { cell: S, start: A, end: L } of k) {
2054
+ const x = b.column >= A && b.column < L || S === k.at(-1).cell && b.column >= L;
2055
+ x && _ === p && (w = S), x && g === null && _ !== "head" && (g = S), S.tabIndex = -1, r && _ !== "head" && !r({ line: m.get(_) ?? -1, column: A }) ? S.setAttribute("aria-readonly", "true") : S.removeAttribute("aria-readonly");
2056
+ const O = d?.row === !0 && d.line === _ || S === w && (u || d !== null && d.line === _);
2057
+ for (const M of Array.from(S.querySelectorAll(Ht))) _l(M, !O);
2055
2058
  }
2056
2059
  }
2057
2060
  const v = w ?? g ?? c.querySelector("tr[data-grid-line] > *");
2058
2061
  v && !(d?.row && v.parentElement?.dataset.gridLine === d.line) && (v.tabIndex = 0);
2059
- const x = t.focus.take(w !== null);
2060
- if (x === "editor" || x === "open") {
2062
+ const C = t.focus.take(w !== null);
2063
+ if (C === "editor" || C === "open") {
2061
2064
  const y = w?.querySelector("input, select, textarea, button");
2062
- if (y?.focus(), y instanceof HTMLInputElement && y.type === "text" && y.setSelectionRange(y.value.length, y.value.length), x === "open" && y instanceof HTMLSelectElement)
2065
+ if (y?.focus(), y instanceof HTMLInputElement && y.type === "text" && y.setSelectionRange(y.value.length, y.value.length), C === "open" && y instanceof HTMLSelectElement)
2063
2066
  try {
2064
2067
  y.showPicker();
2065
2068
  } catch {
2066
2069
  }
2067
- else x === "open" && y instanceof HTMLButtonElement && y.click();
2068
- } else x === "cell" && w?.focus();
2070
+ else C === "open" && y instanceof HTMLButtonElement && y.click();
2071
+ } else C === "cell" && w?.focus();
2069
2072
  }), null;
2070
2073
  }
2071
2074
  function kl(e, t, n) {
@@ -2079,7 +2082,7 @@ function kl(e, t, n) {
2079
2082
  } : { line: Math.min(1, t.length - 1), column: 0 };
2080
2083
  }
2081
2084
  function Sl({ entry: e, row: t, rowName: n, grid: o }) {
2082
- const r = ke(), s = q(null), { spec: i } = e, l = o.editing, c = i.id, a = l.drafts[c], u = l.errors[c] ?? null, d = (m) => o.setDraft(c, m), b = o.wording.editCell(i.label, n);
2085
+ const r = xe(), s = q(null), { spec: i } = e, l = o.editing, c = i.id, a = l.drafts[c], u = l.errors[c] ?? null, d = (m) => o.setDraft(c, m), b = o.wording.editCell(i.label, n);
2083
2086
  let p;
2084
2087
  if (typeof i.edit == "function")
2085
2088
  p = i.edit({
@@ -2093,28 +2096,28 @@ function Sl({ entry: e, row: t, rowName: n, grid: o }) {
2093
2096
  else if (i.edit === "number")
2094
2097
  p = /* @__PURE__ */ f(yt, { size: "sm", value: typeof a == "number" ? a : null, onChange: d });
2095
2098
  else if (i.edit === "date")
2096
- p = /* @__PURE__ */ f(Mo, { size: "sm", value: a instanceof Date ? a : null, onChange: (m) => l.row ? d(m) : o.commit(c, m) });
2099
+ p = /* @__PURE__ */ f(Fo, { size: "sm", value: a instanceof Date ? a : null, onChange: (m) => l.row ? d(m) : o.commit(c, m) });
2097
2100
  else if (i.edit === "select") {
2098
- const m = i.editOptions ?? At(o.hook.admitted, e.read, r).values, w = m.findIndex((g) => uo(g, a));
2099
- p = /* @__PURE__ */ j(Tn, { size: "sm", value: w < 0 ? "" : String(w), onChange: (g) => d(m[Number(g.target.value)]), children: [
2101
+ const m = i.editOptions ?? At(o.hook.admitted, e.read, r).values, w = m.findIndex((g) => fo(g, a));
2102
+ p = /* @__PURE__ */ T(Rn, { size: "sm", value: w < 0 ? "" : String(w), onChange: (g) => d(m[Number(g.target.value)]), children: [
2100
2103
  w < 0 && /* @__PURE__ */ f("option", { value: "" }),
2101
2104
  m.map((g, v) => /* @__PURE__ */ f("option", { value: v, children: g instanceof Date ? r.date(g) : String(g) }, v))
2102
2105
  ] });
2103
2106
  } else
2104
- p = /* @__PURE__ */ f(Rn, { size: "sm", value: se(a) ? "" : String(a), onChange: (m) => d(m.target.value) });
2105
- return /* @__PURE__ */ j("div", { ref: s, className: h.editor, children: [
2106
- /* @__PURE__ */ f(vt, { className: h.editorField, label: /* @__PURE__ */ f(Re, { children: b }), error: u ?? void 0, children: p }),
2107
+ p = /* @__PURE__ */ f(On, { size: "sm", value: se(a) ? "" : String(a), onChange: (m) => d(m.target.value) });
2108
+ return /* @__PURE__ */ T("div", { ref: s, className: h.editor, children: [
2109
+ /* @__PURE__ */ f(vt, { className: h.editorField, label: /* @__PURE__ */ f(Oe, { children: b }), error: u ?? void 0, children: p }),
2107
2110
  /* @__PURE__ */ f(it, { open: u !== null, onOpenChange: () => {
2108
2111
  }, anchorRef: s, restoreFocus: !1, offset: 4, className: h.editorMessage, children: /* @__PURE__ */ f("span", { "aria-hidden": "true", children: u }) })
2109
2112
  ] });
2110
2113
  }
2111
- function ho({ wording: e }) {
2112
- return /* @__PURE__ */ j(re, { children: [
2114
+ function go({ wording: e }) {
2115
+ return /* @__PURE__ */ T(re, { children: [
2113
2116
  /* @__PURE__ */ f("span", { "aria-hidden": "true", className: h.absent, children: "—" }),
2114
- /* @__PURE__ */ f(Re, { children: e.cellAbsentValue })
2117
+ /* @__PURE__ */ f(Oe, { children: e.cellAbsentValue })
2115
2118
  ] });
2116
2119
  }
2117
- const Cl = { sum: "Σ", avg: "⌀", min: "min", max: "max" }, xl = (e, t) => ({
2120
+ const Cl = { sum: "Σ", avg: "⌀", min: "min", max: "max" }, Al = (e, t) => ({
2118
2121
  sum: t.footerSum,
2119
2122
  avg: t.footerAverage,
2120
2123
  min: t.footerMinimum,
@@ -2123,23 +2126,23 @@ const Cl = { sum: "Σ", avg: "⌀", min: "min", max: "max" }, xl = (e, t) => ({
2123
2126
  count: t.footerCount,
2124
2127
  distinct: t.footerDistinct
2125
2128
  })[e] ?? t.footerAggregate, wn = /* @__PURE__ */ new WeakMap();
2126
- function go(e, t, n) {
2129
+ function po(e, t, n) {
2127
2130
  const o = e.spec.aggregate;
2128
2131
  let r = wn.get(t);
2129
2132
  r || wn.set(t, r = /* @__PURE__ */ new Map());
2130
2133
  const s = r.get(e), i = e.spec.value, l = e.spec.rightAligned;
2131
2134
  if (s && s.spec === o && s.reader === i && s.aligned === l) return s;
2132
- const c = n ? n.value : $t({ id: e.spec.id, read: e.read, aggregate: o }, t);
2135
+ const c = n ? n.value : zt({ id: e.spec.id, read: e.read, aggregate: o }, t);
2133
2136
  let a = 0;
2134
2137
  if ((o === "sum" || o === "avg") && typeof c == "number")
2135
2138
  for (const b of t) {
2136
2139
  const p = e.read(b);
2137
- Al(p) && (a = Math.max(a, Nl(p)));
2140
+ Nl(p) && (a = Math.max(a, Tl(p)));
2138
2141
  }
2139
- const u = o === "count" || o === "distinct" || (l ?? En(t, e.read) === "number"), d = { spec: o, reader: i, aligned: l, value: c, places: a, numeric: u };
2142
+ const u = o === "count" || o === "distinct" || (l ?? Mn(t, e.read) === "number"), d = { spec: o, reader: i, aligned: l, value: c, places: a, numeric: u };
2140
2143
  return r.set(e, d), d;
2141
2144
  }
2142
- function Rt({
2145
+ function Ot({
2143
2146
  entry: e,
2144
2147
  rows: t,
2145
2148
  formats: n,
@@ -2149,12 +2152,12 @@ function Rt({
2149
2152
  }) {
2150
2153
  const { aggregate: i, format: l, presentation: c } = e.spec;
2151
2154
  if (!i) return null;
2152
- const a = typeof i == "function" ? "own" : i, { value: u, places: d } = go(e, t, s), b = (w) => Be(w, l, n, o);
2155
+ const a = typeof i == "function" ? "own" : i, { value: u, places: d } = po(e, t, s), b = (w) => Pe(w, l, n, o);
2153
2156
  let p;
2154
- if (se(u)) p = /* @__PURE__ */ f(ho, { wording: o });
2157
+ if (se(u)) p = /* @__PURE__ */ f(go, { wording: o });
2155
2158
  else if ((a === "sum" || a === "avg") && l === void 0 && typeof u == "number")
2156
2159
  p = n.number(u, Math.min(10, a === "avg" ? d + 1 : d));
2157
- else if (a === "range" && l === "date" && jl(u)) {
2160
+ else if (a === "range" && l === "date" && Rl(u)) {
2158
2161
  const [w, g] = u;
2159
2162
  p = w.getTime() === g.getTime() ? n.date(w) : o.rangeFromTo(n.dateShort(w), n.dateShort(g));
2160
2163
  } else if (a === "count" || a === "distinct") p = n.count(u);
@@ -2163,29 +2166,29 @@ function Rt({
2163
2166
  p = b(w) === b(g) ? b(w) : o.rangeFromTo(b(w) ?? "", b(g) ?? "");
2164
2167
  } else a === "own" && c ? p = c(u, t[0]) : p = b(u);
2165
2168
  const m = Cl[a];
2166
- return /* @__PURE__ */ j(re, { children: [
2169
+ return /* @__PURE__ */ T(re, { children: [
2167
2170
  r && m && /* @__PURE__ */ f("span", { "aria-hidden": "true", className: h.footerKind, children: m }),
2168
- r && /* @__PURE__ */ j(Re, { children: [
2169
- xl(a, o),
2171
+ r && /* @__PURE__ */ T(Oe, { children: [
2172
+ Al(a, o),
2170
2173
  " "
2171
2174
  ] }),
2172
2175
  p
2173
2176
  ] });
2174
2177
  }
2175
- const Al = (e) => typeof e == "number" && Number.isFinite(e), Nl = (e) => {
2178
+ const Nl = (e) => typeof e == "number" && Number.isFinite(e), Tl = (e) => {
2176
2179
  const [t = "", n = "0"] = e.toExponential().split("e");
2177
2180
  return Math.max(0, (t.split(".")[1]?.length ?? 0) - Number(n));
2178
- }, jl = ([e, t]) => e instanceof Date && t instanceof Date && e.getFullYear() === t.getFullYear();
2179
- function po(e, t, n) {
2180
- return e.spec.aggregate ? go(e, t, n).numeric : !1;
2181
+ }, Rl = ([e, t]) => e instanceof Date && t instanceof Date && e.getFullYear() === t.getFullYear();
2182
+ function mo(e, t, n) {
2183
+ return e.spec.aggregate ? po(e, t, n).numeric : !1;
2181
2184
  }
2182
- const mo = {};
2185
+ const wo = {};
2183
2186
  function ct(e, t, n = t) {
2184
- const o = or(e, t, n);
2185
- if (!o) return mo;
2187
+ const o = rr(e, t, n);
2188
+ if (!o) return wo;
2186
2189
  const r = o.side === "start";
2187
2190
  return {
2188
- className: F(h.pinned, o.edge && (r ? h.pinStartEdge : h.pinEndEdge)),
2191
+ className: B(h.pinned, o.edge && (r ? h.pinStartEdge : h.pinEndEdge)),
2189
2192
  /* The scroll area keeps a padding as wide as the block for the browser's
2190
2193
  scroll into view; a pinned cell lies inside it and would scroll the
2191
2194
  table back to its start when focused. Its target is shifted out of the
@@ -2204,15 +2207,15 @@ function ct(e, t, n = t) {
2204
2207
  function dt(e, t, n, o) {
2205
2208
  if (t === void 0) return o.groupNoValue;
2206
2209
  const r = e?.spec;
2207
- if (r?.group && t instanceof Date) return qo(r.group, t, n, o);
2210
+ if (r?.group && t instanceof Date) return Yo(r.group, t, n, o);
2208
2211
  const s = r?.ownGroupValue ? void 0 : r?.format;
2209
- return Be(t, s, n, o) ?? String(t);
2212
+ return Pe(t, s, n, o) ?? String(t);
2210
2213
  }
2211
- function Ot({ entry: e, group: t, formats: n, wording: o }) {
2214
+ function Et({ entry: e, group: t, formats: n, wording: o }) {
2212
2215
  const r = e?.spec;
2213
2216
  return t.value !== void 0 && r?.presentation && !r.ownGroupValue && !r.group ? /* @__PURE__ */ f(re, { children: r.presentation(t.value, t.rows[0]) }) : /* @__PURE__ */ f(re, { children: dt(e, t.value, n, o) });
2214
2217
  }
2215
- function Et({
2218
+ function Mt({
2216
2219
  group: e,
2217
2220
  parent: t,
2218
2221
  entry: n,
@@ -2242,7 +2245,7 @@ function Et({
2242
2245
  "button",
2243
2246
  {
2244
2247
  type: "button",
2245
- className: F(h.fold, !o && h.foldClosed),
2248
+ className: B(h.fold, !o && h.foldClosed),
2246
2249
  "data-fold-path": e.path,
2247
2250
  "aria-expanded": o,
2248
2251
  "aria-label": o ? i.foldGroup(l, c) : i.unfoldGroup(l, c),
@@ -2251,15 +2254,15 @@ function Et({
2251
2254
  if (!d.altKey) return a();
2252
2255
  bn(e, o, r);
2253
2256
  },
2254
- children: /* @__PURE__ */ f(wo, {})
2257
+ children: /* @__PURE__ */ f(bo, {})
2255
2258
  }
2256
2259
  );
2257
2260
  }
2258
- function Tl({ value: e, formats: t }) {
2261
+ function Ol({ value: e, formats: t }) {
2259
2262
  const n = q(null);
2260
- return ol(n, e, t.count), /* @__PURE__ */ f("span", { ref: n, className: h.groupCount, children: t.count(e) });
2263
+ return rl(n, e, t.count), /* @__PURE__ */ f("span", { ref: n, className: h.groupCount, children: t.count(e) });
2261
2264
  }
2262
- function Mt({ group: e, entry: t, hook: n, formats: o, wording: r }) {
2265
+ function Lt({ group: e, entry: t, hook: n, formats: o, wording: r }) {
2263
2266
  const { selection: s } = n.publicSnapshot, i = e.rows.map(n.rowKey), l = i.filter((a) => s.isSelected(a)).length, c = l === i.length;
2264
2267
  return /* @__PURE__ */ f(
2265
2268
  We,
@@ -2282,7 +2285,7 @@ function bn(e, t, n) {
2282
2285
  for (const i of r)
2283
2286
  o.folded.includes(i.path) !== t && o.toggleFold(i.path);
2284
2287
  }
2285
- function Rl({
2288
+ function El({
2286
2289
  line: e,
2287
2290
  entry: t,
2288
2291
  selectable: n,
@@ -2292,17 +2295,17 @@ function Rl({
2292
2295
  wording: i
2293
2296
  }) {
2294
2297
  const l = e.span;
2295
- return /* @__PURE__ */ f("td", { className: F(h.td, h.spanCell, o.className), style: o.style, children: e.first && /* @__PURE__ */ j("span", { className: h.spanValue, children: [
2296
- n && /* @__PURE__ */ f("span", { className: h.spanSelect, children: /* @__PURE__ */ f(Mt, { group: l, entry: t, hook: r, formats: s, wording: i }) }),
2297
- /* @__PURE__ */ f(Et, { group: l, parent: e.parents.at(-1), entry: t, open: !0, hook: r, formats: s, wording: i }),
2298
- /* @__PURE__ */ j("span", { className: h.spanText, title: dt(t, l.value, s, i), children: [
2299
- /* @__PURE__ */ f(Ot, { entry: t, group: l, formats: s, wording: i }),
2298
+ return /* @__PURE__ */ f("td", { className: B(h.td, h.spanCell, o.className), style: o.style, children: e.first && /* @__PURE__ */ T("span", { className: h.spanValue, children: [
2299
+ n && /* @__PURE__ */ f("span", { className: h.spanSelect, children: /* @__PURE__ */ f(Lt, { group: l, entry: t, hook: r, formats: s, wording: i }) }),
2300
+ /* @__PURE__ */ f(Mt, { group: l, parent: e.parents.at(-1), entry: t, open: !0, hook: r, formats: s, wording: i }),
2301
+ /* @__PURE__ */ T("span", { className: h.spanText, title: dt(t, l.value, s, i), children: [
2302
+ /* @__PURE__ */ f(Et, { entry: t, group: l, formats: s, wording: i }),
2300
2303
  e.continued && /* @__PURE__ */ f("span", { className: h.continued, children: i.groupContinued })
2301
2304
  ] }),
2302
2305
  /* @__PURE__ */ f("span", { className: h.groupCount, children: s.count(l.rows.length) })
2303
2306
  ] }) });
2304
2307
  }
2305
- function Ol({
2308
+ function Ml({
2306
2309
  line: e,
2307
2310
  index: t,
2308
2311
  absolute: n,
@@ -2321,97 +2324,97 @@ function Ol({
2321
2324
  wording: w,
2322
2325
  grid: g
2323
2326
  }) {
2324
- const { group: v } = e, x = e.kind === "header", y = x && !p.publicSnapshot.folded.includes(v.path), { lead: _, labelColumns: S, countColumns: C } = ao({
2327
+ const { group: v } = e, C = e.kind === "header", y = C && !p.publicSnapshot.folded.includes(v.path), { lead: _, labelColumns: k, countColumns: S } = co({
2325
2328
  controls: i,
2326
2329
  span: o !== void 0,
2327
2330
  aggregates: s.map((D) => D.spec.aggregate !== void 0),
2328
2331
  actions: a,
2329
2332
  blocks: l
2330
- }), A = s.slice(_), M = i + (o ? 1 : 0), k = (D, I = D) => ct(l, D, I), R = (D) => _ - D > 0 && /* @__PURE__ */ f("td", { className: h.td, colSpan: _ - D }), E = s.find((D) => D.spec.aggregate === "sum" && D.spec.share !== !1), T = n !== void 0, O = /* @__PURE__ */ j("span", { className: h.groupLabel, children: [
2331
- /* @__PURE__ */ f(Et, { group: v, parent: e.parents.at(-1), entry: r, open: y, hook: p, formats: m, wording: w }),
2332
- /* @__PURE__ */ f("span", { className: h.groupValue, children: /* @__PURE__ */ f(Ot, { entry: r, group: v, formats: m, wording: w }) }),
2333
- /* @__PURE__ */ f(Tl, { value: v.rows.length, formats: m }),
2334
- x && e.continued && /* @__PURE__ */ f("span", { className: h.continued, children: w.groupContinued })
2333
+ }), A = s.slice(_), L = i + (o ? 1 : 0), x = (D, $ = D) => ct(l, D, $), O = (D) => _ - D > 0 && /* @__PURE__ */ f("td", { className: h.td, colSpan: _ - D }), M = s.find((D) => D.spec.aggregate === "sum" && D.spec.share !== !1), R = n !== void 0, E = /* @__PURE__ */ T("span", { className: h.groupLabel, children: [
2334
+ /* @__PURE__ */ f(Mt, { group: v, parent: e.parents.at(-1), entry: r, open: y, hook: p, formats: m, wording: w }),
2335
+ /* @__PURE__ */ f("span", { className: h.groupValue, children: /* @__PURE__ */ f(Et, { entry: r, group: v, formats: m, wording: w }) }),
2336
+ /* @__PURE__ */ f(Ol, { value: v.rows.length, formats: m }),
2337
+ C && e.continued && /* @__PURE__ */ f("span", { className: h.continued, children: w.groupContinued })
2335
2338
  ] });
2336
- return /* @__PURE__ */ j(
2339
+ return /* @__PURE__ */ T(
2337
2340
  "tr",
2338
2341
  {
2339
- className: F(x ? h.groupHeader : h.groupFolded, T && h.virtualRow),
2342
+ className: B(C ? h.groupHeader : h.groupFolded, R && h.virtualRow),
2340
2343
  "data-line": e.kind,
2341
2344
  "data-level": v.level,
2342
- "data-motion": n !== void 0 || !(x && e.continued) ? `${e.kind}:${v.path}` : void 0,
2343
- "data-continued": x && e.continued ? "" : void 0,
2344
- "data-group-first": x ? void 0 : "",
2345
+ "data-motion": n !== void 0 || !(C && e.continued) ? `${e.kind}:${v.path}` : void 0,
2346
+ "data-continued": C && e.continued ? "" : void 0,
2347
+ "data-group-first": C ? void 0 : "",
2345
2348
  "data-group": v.path,
2346
2349
  "data-grid-line": g ? `${e.kind}:${v.path}` : void 0,
2347
- "data-row": T ? n : void 0,
2348
- "aria-rowindex": T ? n + 2 : void 0,
2350
+ "data-row": R ? n : void 0,
2351
+ "aria-rowindex": R ? n + 2 : void 0,
2349
2352
  "data-index": t,
2350
- style: x ? { "--u-header-level": v.level } : void 0,
2351
- "aria-level": x ? v.level + 1 : b,
2353
+ style: C ? { "--u-header-level": v.level } : void 0,
2354
+ "aria-level": C ? v.level + 1 : b,
2352
2355
  "aria-expanded": y,
2353
2356
  "aria-posinset": d.indexOf(v) + 1 || void 0,
2354
2357
  "aria-setsize": d.length || void 0,
2355
2358
  children: [
2356
- Array.from({ length: i }, (D, I) => /* @__PURE__ */ f("td", { className: F(h.td, h.control, k(I).className), style: k(I).style, children: I === 0 && c && x && /* @__PURE__ */ f(Mt, { group: v, entry: r, hook: p, formats: m, wording: w }) }, `c${I}`)),
2357
- x ? /* @__PURE__ */ j(re, { children: [
2359
+ Array.from({ length: i }, (D, $) => /* @__PURE__ */ f("td", { className: B(h.td, h.control, x($).className), style: x($).style, children: $ === 0 && c && C && /* @__PURE__ */ f(Lt, { group: v, entry: r, hook: p, formats: m, wording: w }) }, `c${$}`)),
2360
+ C ? /* @__PURE__ */ T(re, { children: [
2358
2361
  /* @__PURE__ */ f(
2359
2362
  "td",
2360
2363
  {
2361
- className: F(h.td, k(i, M + S - 1).className),
2362
- colSpan: (o ? 1 : 0) + S,
2364
+ className: B(h.td, x(i, L + k - 1).className),
2365
+ colSpan: (o ? 1 : 0) + k,
2363
2366
  style: {
2364
- ...k(i, M + S - 1).style,
2367
+ ...x(i, L + k - 1).style,
2365
2368
  paddingLeft: `calc(var(--u-space-3) + ${v.level * 20}px)`
2366
2369
  },
2367
- children: O
2370
+ children: E
2368
2371
  }
2369
2372
  ),
2370
- R(S)
2371
- ] }) : /* @__PURE__ */ j(re, { children: [
2372
- /* @__PURE__ */ f("td", { className: F(h.td, h.spanCell, k(i).className), style: k(i).style, children: /* @__PURE__ */ j("span", { className: h.spanValue, children: [
2373
- c && /* @__PURE__ */ f("span", { className: h.spanSelect, children: /* @__PURE__ */ f(Mt, { group: v, entry: o, hook: p, formats: m, wording: w }) }),
2374
- /* @__PURE__ */ f(Et, { group: v, parent: e.parents.at(-1), entry: o, open: !1, hook: p, formats: m, wording: w }),
2375
- /* @__PURE__ */ f("span", { className: h.spanText, children: /* @__PURE__ */ f(Ot, { entry: o, group: v, formats: m, wording: w }) }),
2373
+ O(k)
2374
+ ] }) : /* @__PURE__ */ T(re, { children: [
2375
+ /* @__PURE__ */ f("td", { className: B(h.td, h.spanCell, x(i).className), style: x(i).style, children: /* @__PURE__ */ T("span", { className: h.spanValue, children: [
2376
+ c && /* @__PURE__ */ f("span", { className: h.spanSelect, children: /* @__PURE__ */ f(Lt, { group: v, entry: o, hook: p, formats: m, wording: w }) }),
2377
+ /* @__PURE__ */ f(Mt, { group: v, parent: e.parents.at(-1), entry: o, open: !1, hook: p, formats: m, wording: w }),
2378
+ /* @__PURE__ */ f("span", { className: h.spanText, children: /* @__PURE__ */ f(Et, { entry: o, group: v, formats: m, wording: w }) }),
2376
2379
  /* @__PURE__ */ f("span", { className: h.groupCount, children: m.count(v.rows.length) })
2377
2380
  ] }) }),
2378
- C > 0 && /* @__PURE__ */ f(
2381
+ S > 0 && /* @__PURE__ */ f(
2379
2382
  "td",
2380
2383
  {
2381
- className: F(h.td, h.foldedCount, k(M, M + C - 1).className),
2382
- style: k(M, M + C - 1).style,
2383
- colSpan: C,
2384
+ className: B(h.td, h.foldedCount, x(L, L + S - 1).className),
2385
+ style: x(L, L + S - 1).style,
2386
+ colSpan: S,
2384
2387
  children: w.entries(v.rows.length, m.count(v.rows.length))
2385
2388
  }
2386
2389
  ),
2387
- R(C)
2390
+ O(S)
2388
2391
  ] }),
2389
- A.map((D, I) => /* @__PURE__ */ f(
2390
- Ml,
2392
+ A.map((D, $) => /* @__PURE__ */ f(
2393
+ Fl,
2391
2394
  {
2392
- pin: k(M + _ + I),
2395
+ pin: x(L + _ + $),
2393
2396
  entry: D,
2394
2397
  group: v,
2395
- share: x && D === E,
2398
+ share: C && D === M,
2396
2399
  total: u,
2397
2400
  formats: m,
2398
2401
  wording: w
2399
2402
  },
2400
2403
  D.key
2401
2404
  )),
2402
- a && /* @__PURE__ */ f("td", { className: F(h.td, k(l.count - 1).className), style: k(l.count - 1).style })
2405
+ a && /* @__PURE__ */ f("td", { className: B(h.td, x(l.count - 1).className), style: x(l.count - 1).style })
2403
2406
  ]
2404
2407
  }
2405
2408
  );
2406
2409
  }
2407
2410
  const vn = /* @__PURE__ */ new WeakMap();
2408
- function El(e, t) {
2411
+ function Ll(e, t) {
2409
2412
  let n = vn.get(t);
2410
2413
  n || vn.set(t, n = /* @__PURE__ */ new Map());
2411
2414
  let o = n.get(e);
2412
- return (!o || o.reader !== e.spec.value) && (o = { reader: e.spec.value, sum: $t({ id: e.spec.id, read: e.read, aggregate: "sum" }, t) }, n.set(e, o)), o.sum;
2415
+ return (!o || o.reader !== e.spec.value) && (o = { reader: e.spec.value, sum: zt({ id: e.spec.id, read: e.read, aggregate: "sum" }, t) }, n.set(e, o)), o.sum;
2413
2416
  }
2414
- function Ml({
2417
+ function Fl({
2415
2418
  entry: e,
2416
2419
  pin: t,
2417
2420
  group: n,
@@ -2421,38 +2424,38 @@ function Ml({
2421
2424
  wording: i
2422
2425
  }) {
2423
2426
  const { spec: l } = e;
2424
- if (!l.aggregate) return /* @__PURE__ */ f("td", { className: F(h.td, t.className), style: t.style });
2427
+ if (!l.aggregate) return /* @__PURE__ */ f("td", { className: B(h.td, t.className), style: t.style });
2425
2428
  let c = null;
2426
2429
  if (o && l.aggregate === "sum" && l.share !== !1) {
2427
- const a = El(e, r), u = n.aggregates[l.id];
2430
+ const a = Ll(e, r), u = n.aggregates[l.id];
2428
2431
  if (typeof a == "number" && a > 0 && typeof u == "number" && u > 0) {
2429
2432
  const d = Math.min(1, u / a);
2430
2433
  c = /* @__PURE__ */ f("span", { className: h.shareBar, style: { width: `${Math.max(2, Math.round(d * 64))}px` }, "aria-hidden": "true" });
2431
2434
  }
2432
2435
  }
2433
- return /* @__PURE__ */ f("td", { className: F(h.td, po(e, n.rows, { value: n.aggregates[l.id] }) && h.numeric, h.aggregateCell, t.className), style: t.style, "data-aggregate": typeof l.aggregate == "function" ? "own" : l.aggregate, children: c ? /* @__PURE__ */ j("span", { className: h.shareHost, children: [
2434
- /* @__PURE__ */ f(Rt, { entry: e, rows: n.rows, known: { value: n.aggregates[l.id] }, formats: s, wording: i }),
2436
+ return /* @__PURE__ */ f("td", { className: B(h.td, mo(e, n.rows, { value: n.aggregates[l.id] }) && h.numeric, h.aggregateCell, t.className), style: t.style, "data-aggregate": typeof l.aggregate == "function" ? "own" : l.aggregate, children: c ? /* @__PURE__ */ T("span", { className: h.shareHost, children: [
2437
+ /* @__PURE__ */ f(Ot, { entry: e, rows: n.rows, known: { value: n.aggregates[l.id] }, formats: s, wording: i }),
2435
2438
  c
2436
- ] }) : /* @__PURE__ */ f(Rt, { entry: e, rows: n.rows, known: { value: n.aggregates[l.id] }, formats: s, wording: i }) });
2439
+ ] }) : /* @__PURE__ */ f(Ot, { entry: e, rows: n.rows, known: { value: n.aggregates[l.id] }, formats: s, wording: i }) });
2437
2440
  }
2438
- function wo() {
2441
+ function bo() {
2439
2442
  return /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "12", height: "12", "aria-hidden": "true", children: /* @__PURE__ */ f("path", { d: "M2.5 3.75 5 6.25 7.5 3.75", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) });
2440
2443
  }
2441
- function bo(e, t, n, o, r) {
2444
+ function vo(e, t, n, o, r) {
2442
2445
  const s = e.detail?.presentation(n);
2443
2446
  if (s == null || s === !1) return null;
2444
2447
  const i = r !== void 0 && r.branch && !r.empty;
2445
2448
  return { content: s, open: i ? t.branches.includes(o) : t.expanded.includes(o) };
2446
2449
  }
2447
- function Ll(e, t, n, o, r) {
2450
+ function Bl(e, t, n, o, r) {
2448
2451
  const s = /* @__PURE__ */ new Set([...t.expanded, ...t.branches]), i = /* @__PURE__ */ new Set();
2449
2452
  for (const l of n) {
2450
2453
  const c = o(l);
2451
- s.has(c) && bo(e, t, l, c, r?.entry(l))?.open && i.add(c);
2454
+ s.has(c) && vo(e, t, l, c, r?.entry(l))?.open && i.add(c);
2452
2455
  }
2453
2456
  return i;
2454
2457
  }
2455
- function Fl({
2458
+ function Dl({
2456
2459
  setup: e,
2457
2460
  entry: t,
2458
2461
  detail: n,
@@ -2474,27 +2477,27 @@ function Fl({
2474
2477
  }
2475
2478
  }
2476
2479
  };
2477
- return /* @__PURE__ */ j("span", { className: h.treeCell, style: { "--tree-level": t.level }, children: [
2480
+ return /* @__PURE__ */ T("span", { className: h.treeCell, style: { "--_table-tree-level": t.level }, children: [
2478
2481
  l ? /* @__PURE__ */ f(
2479
2482
  "button",
2480
2483
  {
2481
2484
  type: "button",
2482
- className: F(h.fold, !c && h.foldClosed),
2485
+ className: B(h.fold, !c && h.foldClosed),
2483
2486
  "data-branch-key": t.key,
2484
2487
  "aria-expanded": c,
2485
2488
  "aria-label": c ? r.foldBranch(o) : r.unfoldBranch(o),
2486
2489
  onKeyDown: u,
2487
2490
  onClick: (d) => d.altKey ? e.siblings(t.key, !c) : a(!c),
2488
- children: /* @__PURE__ */ f(wo, {})
2491
+ children: /* @__PURE__ */ f(bo, {})
2489
2492
  }
2490
2493
  ) : /* @__PURE__ */ f("span", { className: h.foldSlot }),
2491
- /* @__PURE__ */ j("span", { className: h.treeText, children: [
2494
+ /* @__PURE__ */ T("span", { className: h.treeText, children: [
2492
2495
  s,
2493
- t.pathOnly && /* @__PURE__ */ f(Re, { children: `, ${r.pathRow}` })
2496
+ t.pathOnly && /* @__PURE__ */ f(Oe, { children: `, ${r.pathRow}` })
2494
2497
  ] })
2495
2498
  ] });
2496
2499
  }
2497
- function Dl(e, t, n, o) {
2500
+ function Pl(e, t, n, o) {
2498
2501
  const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), l = [];
2499
2502
  return e.forEach((c, a) => {
2500
2503
  r.set(c.key, c), l.length = c.level, s.set(c.key, l.at(-1)), l.push(c.key), e[a + 1]?.level === 0 && i.add(c.key);
@@ -2517,32 +2520,32 @@ function Dl(e, t, n, o) {
2517
2520
  }
2518
2521
  };
2519
2522
  }
2520
- function Bl({
2523
+ function Vl({
2521
2524
  registry: e,
2522
2525
  hook: t,
2523
2526
  props: n,
2524
2527
  layout: o,
2525
2528
  grid: r
2526
2529
  }) {
2527
- const { selectable: s = !1, loading: i = !1, grid: l = !1 } = n, { snapshot: c, projection: a, virtual: u, lines: d, spanEntry: b, dataColumns: p, expanderColumn: m, controlColumns: w, trailing: g, blocks: v, rows: x, footerShown: y } = o, _ = l ? sl({
2528
- layout: { controls: w, span: b !== void 0, aggregates: p.map((M) => M.spec.aggregate !== void 0), actions: g, blocks: v },
2529
- body: i ? { rows: [] } : d ? { lines: u ? a.lines : d } : { rows: u ? a.shown ?? a.filtered : x },
2530
+ const { selectable: s = !1, loading: i = !1, grid: l = !1 } = n, { snapshot: c, projection: a, virtual: u, lines: d, spanEntry: b, dataColumns: p, expanderColumn: m, controlColumns: w, trailing: g, blocks: v, rows: C, footerShown: y } = o, _ = l ? il({
2531
+ layout: { controls: w, span: b !== void 0, aggregates: p.map((L) => L.spec.aggregate !== void 0), actions: g, blocks: v },
2532
+ body: i ? { rows: [] } : d ? { lines: u ? a.lines : d } : { rows: u ? a.shown ?? a.filtered : C },
2530
2533
  rowKey: t.rowKey,
2531
- expanded: o.detail ? Ll(e, c, a.shown ?? a.filtered, t.rowKey, o.tree) : /* @__PURE__ */ new Set(),
2534
+ expanded: o.detail ? Bl(e, c, a.shown ?? a.filtered, t.rowKey, o.tree) : /* @__PURE__ */ new Set(),
2532
2535
  foot: y
2533
- }) : [], S = r.state.editing?.line === he ? r.state.editing : null;
2534
- S && _[0] && _.splice(1, 0, { key: he, cells: _[0].cells, at: -1, row: S.fresh });
2535
- const C = [
2536
+ }) : [], k = r.state.editing?.line === he ? r.state.editing : null;
2537
+ k && _[0] && _.splice(1, 0, { key: he, cells: _[0].cells, at: -1, row: k.fresh });
2538
+ const S = [
2536
2539
  ...s ? ["#select"] : [],
2537
2540
  ...m ? ["#detail"] : [],
2538
2541
  ...b ? ["#span"] : [],
2539
- ...p.map((M) => M.spec.id),
2542
+ ...p.map((L) => L.spec.id),
2540
2543
  ...g ? ["#actions"] : []
2541
- ], A = l ? bl({
2544
+ ], A = l ? vl({
2542
2545
  grid: r,
2543
2546
  lines: _,
2544
- ids: C,
2545
- columnById: (M) => p.find((k) => k.spec.id === M),
2547
+ ids: S,
2548
+ columnById: (L) => p.find((x) => x.spec.id === L),
2546
2549
  rowKey: t.rowKey,
2547
2550
  virtual: u,
2548
2551
  onCellEdit: n.onCellEdit,
@@ -2551,16 +2554,16 @@ function Bl({
2551
2554
  onRowAdd: n.onRowAdd,
2552
2555
  newRow: n.newRow,
2553
2556
  onRowDelete: n.onRowDelete,
2554
- select: s ? (M) => c.selection.toggle(t.rowKey(M)) : void 0
2557
+ select: s ? (L) => c.selection.toggle(t.rowKey(L)) : void 0
2555
2558
  }) : void 0;
2556
- return { lines: _, fresh: S, ids: C, events: A };
2559
+ return { lines: _, fresh: k, ids: S, events: A };
2557
2560
  }
2558
- function Vl(e) {
2561
+ function Il(e) {
2559
2562
  for (const t of e) t.removeAttribute("data-copied");
2560
2563
  document.body.offsetWidth;
2561
2564
  for (const t of e) t.setAttribute("data-copied", "");
2562
2565
  }
2563
- function Pl({
2566
+ function $l({
2564
2567
  registry: e,
2565
2568
  hook: t,
2566
2569
  grid: n,
@@ -2572,38 +2575,38 @@ function Pl({
2572
2575
  tableElement: c
2573
2576
  }) {
2574
2577
  return (a) => {
2575
- const u = (A) => Lo(A, c());
2578
+ const u = (A) => Bo(A, c());
2576
2579
  if (a.defaultPrevented || a.altKey || a.shiftKey || a.ctrlKey === a.metaKey || a.key.toLowerCase() !== "c") return;
2577
2580
  const { target: d, currentTarget: b } = a;
2578
2581
  if (!(d instanceof Element)) return;
2579
2582
  const p = d.closest("td, th"), m = p?.dataset.editing, w = d.closest("input, textarea, select, [contenteditable]:not([contenteditable='false'])");
2580
2583
  if (w?.matches("textarea, [contenteditable]:not([contenteditable='false']), input:not([type=checkbox], [type=radio], [type=button], [type=submit], [type=reset], [type=range], [type=color], [type=file], [type=image])") && m === void 0 || window.getSelection()?.toString() || (w instanceof HTMLInputElement || w instanceof HTMLTextAreaElement) && w.selectionStart !== w.selectionEnd) return;
2581
- let v = "", x = "", y = p ? [p] : [];
2582
- const _ = eo(e), S = m === void 0 ? void 0 : s.find((A) => A.spec.id === m);
2583
- if (S)
2584
- v = w instanceof HTMLInputElement || w instanceof HTMLTextAreaElement ? w.value : no(S, n.state.editing?.drafts[S.spec.id], i, l), x = l.copiedCell;
2584
+ let v = "", C = "", y = p ? [p] : [];
2585
+ const _ = to(e), k = m === void 0 ? void 0 : s.find((A) => A.spec.id === m);
2586
+ if (k)
2587
+ v = w instanceof HTMLInputElement || w instanceof HTMLTextAreaElement ? w.value : oo(k, n.state.editing?.drafts[k.spec.id], i, l), C = l.copiedCell;
2585
2588
  else if (_.length > 0) {
2586
- v = to(e, i, l), x = l.copiedRows(_.length, i.count(_.length));
2587
- const A = new Set(_.map((M) => t.rowKey(M)));
2588
- y = Array.from(b.querySelectorAll("tr[data-motion]")).filter((M) => A.has(M.dataset.motion)).flatMap((M) => Array.from(M.children));
2589
+ v = no(e, i, l), C = l.copiedRows(_.length, i.count(_.length));
2590
+ const A = new Set(_.map((L) => t.rowKey(L)));
2591
+ y = Array.from(b.querySelectorAll("tr[data-motion]")).filter((L) => A.has(L.dataset.motion)).flatMap((L) => Array.from(L.children));
2589
2592
  } else if (o && n.state.active) {
2590
- const { line: A, column: M } = n.state.active, k = r.find((T) => T.key === A), R = s.find((T) => T.spec.id === M);
2591
- if (!k || k.row === void 0 || k.key !== Ue(t.rowKey(k.row)) || !R) return;
2592
- const E = Array.from(b.querySelectorAll("tr[data-grid-line]")).find((T) => T.dataset.gridLine === A)?.children[n.state.active.columnIndex];
2593
- E && (y = [E]), v = Hi(R, k.row, i, l), x = l.copiedCell;
2593
+ const { line: A, column: L } = n.state.active, x = r.find((R) => R.key === A), O = s.find((R) => R.spec.id === L);
2594
+ if (!x || x.row === void 0 || x.key !== Ue(t.rowKey(x.row)) || !O) return;
2595
+ const M = Array.from(b.querySelectorAll("tr[data-grid-line]")).find((R) => R.dataset.gridLine === A)?.children[n.state.active.columnIndex];
2596
+ M && (y = [M]), v = Wi(O, x.row, i, l), C = l.copiedCell;
2594
2597
  } else return;
2595
2598
  a.preventDefault();
2596
- const C = (A) => {
2599
+ const S = (A) => {
2597
2600
  X("copy-failed", `The clipboard refused the copy (${String(A)}). It needs a secure context and a focused document.`), u(l.copyFailed);
2598
2601
  };
2599
2602
  Promise.resolve().then(() => navigator.clipboard.writeText(v)).then(() => {
2600
- Vl(y), u(x);
2601
- }, C);
2603
+ Il(y), u(C);
2604
+ }, S);
2602
2605
  };
2603
2606
  }
2604
- function Il({ table: e }) {
2605
- const [t, n] = P(null), o = Fo(), r = q(null);
2606
- xe(() => {
2607
+ function zl({ table: e }) {
2608
+ const [t, n] = I(null), o = Do(), r = q(null);
2609
+ Ce(() => {
2607
2610
  const i = e.current;
2608
2611
  if (!i) return;
2609
2612
  let l;
@@ -2613,8 +2616,8 @@ function Il({ table: e }) {
2613
2616
  clearTimeout(l);
2614
2617
  const w = p instanceof Element ? p.closest("td, th") : null, g = p instanceof Element ? p.closest(`.${h.headLine}`) : null, v = g ? g.querySelector(`.${h.headLabel}`) : w?.querySelector(`:scope > .${h.value}, :scope .${h.treeText} > .${h.value}`);
2615
2618
  if (!w || !v || v.childElementCount > 0 || v.scrollWidth <= v.clientWidth + 1) return n(null);
2616
- const x = i.closest("dialog") ?? o() ?? document.body;
2617
- l = setTimeout(() => n({ text: v.textContent ?? "", cell: w.getBoundingClientRect(), target: x }), m);
2619
+ const C = i.closest("dialog") ?? o() ?? document.body;
2620
+ l = setTimeout(() => n({ text: v.textContent ?? "", cell: w.getBoundingClientRect(), target: C }), m);
2618
2621
  }, u = (p) => a(p.target, 300), d = (p) => a(p.target, 0), b = (p) => {
2619
2622
  p.key === "Escape" && c();
2620
2623
  };
@@ -2637,41 +2640,41 @@ function Il({ table: e }) {
2637
2640
  if (!t || !i) return;
2638
2641
  const l = 4, c = t.cell.bottom + l + i.offsetHeight <= window.innerHeight;
2639
2642
  i.style.top = `${c ? t.cell.bottom + l : t.cell.top - l - i.offsetHeight}px`, i.style.left = `${Math.max(8, Math.min(t.cell.left, window.innerWidth - 8 - i.offsetWidth))}px`, i.style.visibility = "";
2640
- }, [t]), t ? On(
2643
+ }, [t]), t ? En(
2641
2644
  /* @__PURE__ */ f("div", { ref: r, role: "tooltip", popover: s ? "manual" : void 0, className: h.cutTip, style: { visibility: "hidden", top: 0, left: 0 }, children: t.text }),
2642
2645
  t.target
2643
2646
  ) : null;
2644
2647
  }
2645
- function Lt(e, t) {
2648
+ function Ft(e, t) {
2646
2649
  const n = e.scrollWidth - e.clientWidth;
2647
2650
  e.toggleAttribute("data-beyond-start", !t.start && e.scrollLeft > 0.5), e.toggleAttribute("data-beyond-end", !t.end && e.scrollLeft < n - 0.5);
2648
2651
  }
2649
- function vo(e) {
2652
+ function yo(e) {
2650
2653
  const t = e.scrollWidth - e.clientWidth;
2651
2654
  e.toggleAttribute("data-under-start", e.scrollLeft > 0.5), e.toggleAttribute("data-under-end", e.scrollLeft < t - 0.5);
2652
2655
  }
2653
- function yo(e) {
2656
+ function _o(e) {
2654
2657
  for (const t of Array.from(e.querySelectorAll("tbody > tr[data-line='header']"))) {
2655
2658
  const n = t.cells[t.cells.length - 1], o = !!n && n.getBoundingClientRect().top > t.getBoundingClientRect().top + 0.5;
2656
2659
  t.toggleAttribute("data-stuck", o);
2657
2660
  }
2658
2661
  }
2659
- function $l(e, t) {
2662
+ function Kl(e, t) {
2660
2663
  const n = t.state.editing?.line;
2661
2664
  Z(() => {
2662
2665
  const o = e.hook;
2663
2666
  !o || n === void 0 || n === he || o.rows.some((r) => Ue(o.rowKey(r)) === n) || t.setState((r) => ({ ...r, editing: null }));
2664
2667
  });
2665
2668
  }
2666
- function zl(e, t) {
2669
+ function Gl(e, t) {
2667
2670
  Z(() => {
2668
2671
  const n = e.current;
2669
2672
  if (n?.parentElement && !t && n.parentElement.style.removeProperty("scroll-padding-top"), !n || !t) return;
2670
2673
  const o = n.tHead?.getBoundingClientRect().height ?? 0, r = n.querySelector("tr[data-line='header']")?.getBoundingClientRect().height ?? 0;
2671
- n.style.setProperty("--u-table-head", `${o}px`), n.style.setProperty("--u-table-group-header", `${r}px`), n.parentElement?.style.setProperty("scroll-padding-top", `${o}px`), n.parentElement && yo(n.parentElement);
2674
+ n.style.setProperty("--u-table-head", `${o}px`), n.style.setProperty("--u-table-group-header", `${r}px`), n.parentElement?.style.setProperty("scroll-padding-top", `${o}px`), n.parentElement && _o(n.parentElement);
2672
2675
  });
2673
2676
  }
2674
- function Kl(e, t) {
2677
+ function jl(e, t) {
2675
2678
  Z(() => {
2676
2679
  const n = e.takeFocusBeforeFold(), o = t.current;
2677
2680
  if (!n || !o || n.table !== o || n.element.isConnected) return;
@@ -2682,7 +2685,7 @@ function Kl(e, t) {
2682
2685
  }
2683
2686
  });
2684
2687
  }
2685
- function Gl(e, t, n) {
2688
+ function Hl(e, t, n) {
2686
2689
  const o = q(null);
2687
2690
  Z(() => {
2688
2691
  const r = t.current?.tBodies[0];
@@ -2696,13 +2699,13 @@ function Gl(e, t, n) {
2696
2699
  s && i?.cells.length === s.length && Array.from(i.cells).forEach((l, c) => l.style.width = `${s[c]}px`);
2697
2700
  });
2698
2701
  }
2699
- function Hl(e) {
2700
- xe(() => {
2702
+ function Wl(e) {
2703
+ Ce(() => {
2701
2704
  const t = e.current;
2702
- if (!(!Kt || !t)) {
2705
+ if (!(!Gt || !t)) {
2703
2706
  for (const n of Array.from(t.querySelectorAll(`tbody .${h.value}`))) {
2704
2707
  if (n.scrollHeight <= n.clientHeight + 1) continue;
2705
- const o = n.closest("td, th"), r = o?.parentElement ? Array.from(o.parentElement.children).indexOf(o) : -1, s = t.tHead?.rows[0]?.cells[r]?.textContent?.trim() || `column ${r + 1}`;
2708
+ const o = n.closest("td, th"), r = o?.parentElement ? Array.from(o.parentElement.children).indexOf(o) : -1, s = t.tHead?.rows?.[0]?.cells[r]?.textContent?.trim() || `column ${r + 1}`;
2706
2709
  X(
2707
2710
  `taller-than-a-row:${s}`,
2708
2711
  `a value in "${s}" is taller than a row and is cut at its edge. A row's height never follows what it shows (ADR-0042): draw it with a small control, or show it whole in the row's detail.`
@@ -2718,28 +2721,28 @@ function Hl(e) {
2718
2721
  }
2719
2722
  });
2720
2723
  }
2721
- function Wl(e, t) {
2724
+ function ql(e, t) {
2722
2725
  Z(() => {
2723
- const n = t.current?.tHead?.rows[0]?.getBoundingClientRect().height;
2726
+ const n = t.current?.tHead?.rows?.[0]?.getBoundingClientRect().height;
2724
2727
  n && e.hook?.tableState.virtual && e.hook.tableState.setPitch(n);
2725
2728
  });
2726
2729
  }
2727
2730
  const Yt = (e, t) => e ? t : void 0;
2728
- function ql({
2731
+ function Yl({
2729
2732
  registry: e,
2730
2733
  hook: t,
2731
2734
  props: n,
2732
2735
  drafting: o,
2733
2736
  sticking: r
2734
2737
  }) {
2735
- const { selectable: s = !1, loading: i = !1, grid: l = !1 } = n, c = t.publicSnapshot, a = e.projection(), u = e.rowHeader(), d = Xn(e), b = e.detail, p = e.hasRowActions() ? e.actions.ordered() : [], m = t.tableState.virtual, w = c.grouping, g = w.length > 0 ? a.visibleLines : void 0, v = g ? e.groupingEntries(t.rows) : [], x = (oe) => v.find((W) => W.spec.id === oe), y = g && w.length > 1 ? x(w.at(-1)) : void 0, _ = g ? d.filter((oe) => !w.includes(oe.spec.id)) : d, S = a.entries, C = S ? Dl(S, t, c, _[0]) : void 0, A = b !== null && !S, M = (s ? 1 : 0) + (A ? 1 : 0), k = M + (y ? 1 : 0), R = l && n.editMode === "row", E = l && (R || n.onRowAdd !== void 0 || n.onRowDelete !== void 0), T = p.length > 0 || E, O = k + _.length + (T ? 1 : 0), D = e.pins(), I = _.filter((oe) => D[oe.spec.id] === "start").length, B = _.filter((oe) => D[oe.spec.id] === "end").length, z = y !== void 0 && D[y.spec.id] === "start", Y = p.length > 0 || n.onRowDelete !== void 0 || o, ce = e.actionsPinned() ? Y : o && E, G = {
2736
- start: I > 0 || z ? k + I : 0,
2737
- end: B > 0 ? B + (T ? 1 : 0) : T && ce ? 1 : 0,
2738
- count: O
2738
+ const { selectable: s = !1, loading: i = !1, grid: l = !1 } = n, c = t.publicSnapshot, a = e.projection(), u = e.rowHeader(), d = Qn(e), b = e.detail, p = e.hasRowActions() ? e.actions.ordered() : [], m = t.tableState.virtual, w = c.grouping, g = w.length > 0 ? a.visibleLines : void 0, v = g ? e.groupingEntries(t.rows) : [], C = (oe) => v.find((W) => W.spec.id === oe), y = g && w.length > 1 ? C(w.at(-1)) : void 0, _ = g ? d.filter((oe) => !w.includes(oe.spec.id)) : d, k = a.entries, S = k ? Pl(k, t, c, _[0]) : void 0, A = b !== null && !k, L = (s ? 1 : 0) + (A ? 1 : 0), x = L + (y ? 1 : 0), O = l && n.editMode === "row", M = l && (O || n.onRowAdd !== void 0 || n.onRowDelete !== void 0), R = p.length > 0 || M, E = x + _.length + (R ? 1 : 0), D = e.pins(), $ = _.filter((oe) => D[oe.spec.id] === "start").length, P = _.filter((oe) => D[oe.spec.id] === "end").length, K = y !== void 0 && D[y.spec.id] === "start", Y = p.length > 0 || n.onRowDelete !== void 0 || o, ce = e.actionsPinned() ? Y : o && M, j = {
2739
+ start: $ > 0 || K ? x + $ : 0,
2740
+ end: P > 0 ? P + (R ? 1 : 0) : R && ce ? 1 : 0,
2741
+ count: E
2739
2742
  }, ne = {
2740
- start: r.start ? G.start : 0,
2741
- end: r.end || o && E ? G.end : 0,
2742
- count: O
2743
+ start: r.start ? j.start : 0,
2744
+ end: r.end || o && M ? j.end : 0,
2745
+ count: E
2743
2746
  }, de = a.visible, le = !i && !c.server && _.some((oe) => oe.spec.aggregate), ee = c.search !== "" || Object.keys(c.filter).length > 0;
2744
2747
  return {
2745
2748
  snapshot: c,
@@ -2750,27 +2753,27 @@ function ql({
2750
2753
  virtual: m,
2751
2754
  grouping: w,
2752
2755
  lines: g,
2753
- entryOf: x,
2756
+ entryOf: C,
2754
2757
  spanEntry: y,
2755
2758
  dataColumns: _,
2756
- entries: S,
2757
- tree: C,
2759
+ entries: k,
2760
+ tree: S,
2758
2761
  expanderColumn: A,
2759
- controlColumns: M,
2760
- leading: k,
2761
- rowMode: R,
2762
- rowTools: E,
2763
- trailing: T,
2764
- columnCount: O,
2762
+ controlColumns: L,
2763
+ leading: x,
2764
+ rowMode: O,
2765
+ rowTools: M,
2766
+ trailing: R,
2767
+ columnCount: E,
2765
2768
  pins: D,
2766
- pinned: G,
2769
+ pinned: j,
2767
2770
  blocks: ne,
2768
2771
  rows: de,
2769
2772
  footerShown: le,
2770
2773
  restricted: ee
2771
2774
  };
2772
2775
  }
2773
- const Yl = 2;
2776
+ const Ul = 2;
2774
2777
  function yn({
2775
2778
  actions: e,
2776
2779
  row: t,
@@ -2778,22 +2781,22 @@ function yn({
2778
2781
  wording: o,
2779
2782
  line: r
2780
2783
  }) {
2781
- const s = _e(Ve), i = s?.editing?.row === !0 && s.editing.line !== r, l = s?.remove, [c, a] = P(!1), u = q(!1), d = q(null), b = q(null);
2782
- xe(() => {
2784
+ const s = _e(Ve), i = s?.editing?.row === !0 && s.editing.line !== r, l = s?.remove, [c, a] = I(!1), u = q(!1), d = q(null), b = q(null);
2785
+ Ce(() => {
2783
2786
  c ? b.current?.focus() : u.current && d.current?.focus(), u.current = c;
2784
2787
  }, [c]);
2785
2788
  const p = (w) => {
2786
2789
  if (i) return;
2787
2790
  const g = w.onSelect;
2788
2791
  g(w.bulk ? [t] : t);
2789
- }, m = l && (c ? /* @__PURE__ */ j(re, { children: [
2792
+ }, m = l && (c ? /* @__PURE__ */ T(re, { children: [
2790
2793
  /* @__PURE__ */ f("span", { className: h.deleteAsk, children: o.deleteRowAsk }),
2791
2794
  /* @__PURE__ */ f(Q, { className: h.toned, size: "sm", variant: "danger", "aria-label": o.rowAction(o.deleteRow, n), onClick: () => {
2792
2795
  a(!1), l(t);
2793
2796
  }, children: o.deleteRow }),
2794
2797
  /* @__PURE__ */ f(Q, { ref: b, size: "sm", variant: "ghost", "aria-label": o.rowAction(o.keepRow, n), onClick: () => a(!1), children: o.keepRow })
2795
2798
  ] }) : /* @__PURE__ */ f(Q, { ref: d, size: "sm", variant: "ghost", "aria-label": o.rowAction(o.deleteRow, n), onClick: () => !i && a(!0), children: o.deleteRow }));
2796
- return e.length <= Yl ? /* @__PURE__ */ j("div", { className: F(h.actions, c && h.decision), children: [
2799
+ return e.length <= Ul ? /* @__PURE__ */ T("div", { className: B(h.actions, c && h.decision), children: [
2797
2800
  !c && e.map(({ key: w, spec: g }) => /* @__PURE__ */ f(
2798
2801
  Q,
2799
2802
  {
@@ -2806,21 +2809,21 @@ function yn({
2806
2809
  w
2807
2810
  )),
2808
2811
  m
2809
- ] }) : /* @__PURE__ */ j("div", { className: F(h.actions, c && h.decision), children: [
2812
+ ] }) : /* @__PURE__ */ T("div", { className: B(h.actions, c && h.decision), children: [
2810
2813
  !c && /* @__PURE__ */ f(
2811
2814
  Nn,
2812
2815
  {
2813
2816
  align: "end",
2814
- trigger: /* @__PURE__ */ f(Do, { size: "sm", variant: "ghost", "aria-label": o.rowActionsMenu(n), children: "⋯" }),
2817
+ trigger: /* @__PURE__ */ f(Po, { size: "sm", variant: "ghost", "aria-label": o.rowActionsMenu(n), children: "⋯" }),
2815
2818
  children: e.map(({ key: w, spec: g }) => /* @__PURE__ */ f(nt, { tone: g.tone, onSelect: () => p(g), children: g.label }, w))
2816
2819
  }
2817
2820
  ),
2818
2821
  m
2819
2822
  ] });
2820
2823
  }
2821
- function Ul({ name: e, wording: t }) {
2824
+ function Jl({ name: e, wording: t }) {
2822
2825
  const n = _e(Ve), o = q(null);
2823
- return /* @__PURE__ */ j("div", { ref: o, className: F(h.actions, h.decision, h.draftButtons), children: [
2826
+ return /* @__PURE__ */ T("div", { ref: o, className: B(h.actions, h.decision, h.draftButtons), children: [
2824
2827
  /* @__PURE__ */ f(Q, { className: h.toned, size: "sm", variant: "primary", "aria-label": t.rowAction(t.saveRow, e), onClick: n.save, children: t.saveRow }),
2825
2828
  /* @__PURE__ */ f(Q, { size: "sm", variant: "ghost", "aria-label": t.rowAction(t.discardRow, e), onClick: n.discard, children: t.discardRow }),
2826
2829
  /* @__PURE__ */ f(
@@ -2838,12 +2841,12 @@ function Ul({ name: e, wording: t }) {
2838
2841
  )
2839
2842
  ] });
2840
2843
  }
2841
- function Jl({ columns: e, rightAligned: t = [], rows: n = 4 }) {
2844
+ function Xl({ columns: e, rightAligned: t = [], rows: n = 4 }) {
2842
2845
  const o = [72, 48, 60, 40, 56, 64];
2843
- return /* @__PURE__ */ f(re, { children: Array.from({ length: n }, (r, s) => /* @__PURE__ */ f("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (i, l) => /* @__PURE__ */ f("td", { className: F(h.td, t[l] && h.numeric), children: /* @__PURE__ */ f("span", { className: h.skeleton, style: { width: `${o[(s + l) % o.length]}%` } }) }, l)) }, s)) });
2846
+ return /* @__PURE__ */ f(re, { children: Array.from({ length: n }, (r, s) => /* @__PURE__ */ f("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (i, l) => /* @__PURE__ */ f("td", { className: B(h.td, t[l] && h.numeric), children: /* @__PURE__ */ f("span", { className: h.skeleton, style: { width: `${o[(s + l) % o.length]}%` } }) }, l)) }, s)) });
2844
2847
  }
2845
- const _o = /* @__PURE__ */ rt(0);
2846
- function Ft({ height: e, colSpan: t }) {
2848
+ const xo = /* @__PURE__ */ rt(0);
2849
+ function Bt({ height: e, colSpan: t }) {
2847
2850
  return typeof e == "number" && e <= 0 ? null : /* @__PURE__ */ f("tr", { "aria-hidden": "true", "data-filler": "", className: h.fillerRow, children: /* @__PURE__ */ f("td", { colSpan: t, style: { height: e } }) });
2848
2851
  }
2849
2852
  function ko({
@@ -2851,7 +2854,7 @@ function ko({
2851
2854
  colSpan: t,
2852
2855
  children: n
2853
2856
  }) {
2854
- const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, l = q(null), [c, a] = P(0), u = (p, m) => {
2857
+ const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, l = q(null), [c, a] = I(0), u = (p, m) => {
2855
2858
  l.current = m, a(m), i(m), requestAnimationFrame(() => {
2856
2859
  p.querySelector(`[data-row="${m}"]`)?.focus();
2857
2860
  });
@@ -2872,18 +2875,18 @@ function ko({
2872
2875
  const m = p.target.closest("[data-row]");
2873
2876
  m && a(Number(m.dataset.row));
2874
2877
  },
2875
- children: /* @__PURE__ */ j(_o, { value: d, children: [
2876
- /* @__PURE__ */ f(Ft, { height: r, colSpan: t }),
2878
+ children: /* @__PURE__ */ T(xo, { value: d, children: [
2879
+ /* @__PURE__ */ f(Bt, { height: r, colSpan: t }),
2877
2880
  n,
2878
- /* @__PURE__ */ f(Ft, { height: s, colSpan: t })
2881
+ /* @__PURE__ */ f(Bt, { height: s, colSpan: t })
2879
2882
  ] })
2880
2883
  }
2881
2884
  );
2882
2885
  }
2883
- function Xl(e, t, n, o, r) {
2886
+ function Ql(e, t, n, o, r) {
2884
2887
  if (!t) return n.rowKey(e);
2885
2888
  const s = t.read(e);
2886
- return se(s) ? r.cellAbsentValue : Be(s, t.spec.format, o, r) ?? n.rowKey(e);
2889
+ return se(s) ? r.cellAbsentValue : Pe(s, t.spec.format, o, r) ?? n.rowKey(e);
2887
2890
  }
2888
2891
  function So({
2889
2892
  row: e,
@@ -2904,64 +2907,64 @@ function So({
2904
2907
  line: w,
2905
2908
  tree: g,
2906
2909
  spanEntry: v,
2907
- grid: x,
2910
+ grid: C,
2908
2911
  trailing: y,
2909
2912
  fresh: _ = !1
2910
2913
  }) {
2911
- const S = _e(_o), C = r.publicSnapshot, A = _ ? he : r.rowKey(e), M = _ ? m.newRow : Xl(e, i, r, p, m), k = _ ? he : Ue(A), R = _e(Ve)?.editing, E = R?.row === !0 && R.line === k, T = o.detail, O = _ ? void 0 : g?.entry(e), D = _ ? null : bo(o, C, e, A, O), I = D !== null, B = D?.open ?? !1, z = D?.content, Y = `${b}-detail-${t}`, { className: ce, ...G } = d?.(e) ?? {}, ne = n !== void 0, de = w ? w.span ?? w.parents.at(-1) : void 0, le = T !== null && !g, ee = (l ? 1 : 0) + (le ? 1 : 0), oe = ee + (v ? 1 : 0), W = (L) => ct(a, L), ge = O !== void 0 && O.branch && !O.empty;
2912
- return /* @__PURE__ */ j(re, { children: [
2913
- /* @__PURE__ */ j(
2914
+ const k = _e(xo), S = r.publicSnapshot, A = _ ? he : r.rowKey(e), L = _ ? m.newRow : Ql(e, i, r, p, m), x = _ ? he : Ue(A), O = _e(Ve)?.editing, M = O?.row === !0 && O.line === x, R = o.detail, E = _ ? void 0 : g?.entry(e), D = _ ? null : vo(o, S, e, A, E), $ = D !== null, P = D?.open ?? !1, K = D?.content, Y = `${b}-detail-${t}`, { className: ce, ...j } = d?.(e) ?? {}, ne = n !== void 0, de = w ? w.span ?? w.parents.at(-1) : void 0, le = R !== null && !g, ee = (l ? 1 : 0) + (le ? 1 : 0), oe = ee + (v ? 1 : 0), W = (F) => ct(a, F), ge = E !== void 0 && E.branch && !E.empty;
2915
+ return /* @__PURE__ */ T(re, { children: [
2916
+ /* @__PURE__ */ T(
2914
2917
  "tr",
2915
2918
  {
2916
- ...G,
2917
- className: F(
2919
+ ...j,
2920
+ className: B(
2918
2921
  ce,
2919
2922
  ne && h.virtualRow,
2920
- O && h.treeRow,
2923
+ E && h.treeRow,
2921
2924
  ge && h.branchRow,
2922
- O?.pathOnly && h.pathRow
2925
+ E?.pathOnly && h.pathRow
2923
2926
  ),
2924
- "data-before-root": O && !B && g?.beforeRoot(A) ? "" : void 0,
2927
+ "data-before-root": E && !P && g?.beforeRoot(A) ? "" : void 0,
2925
2928
  "data-row": ne ? n : void 0,
2926
2929
  "data-line": w ? "row" : void 0,
2927
2930
  "data-motion": A,
2928
- "data-selected": l && C.selection.isSelected(A) ? "" : void 0,
2931
+ "data-selected": l && S.selection.isSelected(A) ? "" : void 0,
2929
2932
  "data-group-first": w?.first ? "" : void 0,
2930
2933
  "data-group": de?.path,
2931
- "aria-level": w ? w.parents.length + 1 : O ? O.level + 1 : void 0,
2932
- "aria-posinset": de ? de.rows.indexOf(e) + 1 : O?.position,
2933
- "aria-setsize": de ? de.rows.length : O?.siblings,
2934
- "aria-expanded": ge ? O.expanded : void 0,
2935
- "data-branch": ge ? O.expanded ? "open" : "closed" : void 0,
2936
- tabIndex: ne && !x ? n === S ? 0 : -1 : void 0,
2937
- "data-grid-line": x ? k : void 0,
2938
- "data-draft": E ? "" : void 0,
2934
+ "aria-level": w ? w.parents.length + 1 : E ? E.level + 1 : void 0,
2935
+ "aria-posinset": de ? de.rows.indexOf(e) + 1 : E?.position,
2936
+ "aria-setsize": de ? de.rows.length : E?.siblings,
2937
+ "aria-expanded": ge ? E.expanded : void 0,
2938
+ "data-branch": ge ? E.expanded ? "open" : "closed" : void 0,
2939
+ tabIndex: ne && !C ? n === k ? 0 : -1 : void 0,
2940
+ "data-grid-line": C ? x : void 0,
2941
+ "data-draft": M ? "" : void 0,
2939
2942
  "data-even": ne && n % 2 === 1 ? "" : void 0,
2940
2943
  "aria-rowindex": ne ? n + 2 : void 0,
2941
2944
  children: [
2942
- _ && Array.from({ length: ee + (v ? 1 : 0) }, (L, ae) => /* @__PURE__ */ f("td", { className: F(h.td, ae < ee && h.control, W(ae).className), style: W(ae).style }, ae)),
2943
- !_ && l && /* @__PURE__ */ f("td", { className: F(h.td, h.control, W(0).className), style: W(0).style, children: /* @__PURE__ */ f(
2945
+ _ && Array.from({ length: ee + (v ? 1 : 0) }, (F, ae) => /* @__PURE__ */ f("td", { className: B(h.td, ae < ee && h.control, W(ae).className), style: W(ae).style }, ae)),
2946
+ !_ && l && /* @__PURE__ */ f("td", { className: B(h.td, h.control, W(0).className), style: W(0).style, children: /* @__PURE__ */ f(
2944
2947
  We,
2945
2948
  {
2946
- "aria-label": m.selectRow(M),
2947
- checked: C.selection.isSelected(A),
2948
- onChange: () => C.selection.toggle(A)
2949
+ "aria-label": m.selectRow(L),
2950
+ checked: S.selection.isSelected(A),
2951
+ onChange: () => S.selection.toggle(A)
2949
2952
  }
2950
2953
  ) }),
2951
- !_ && le && /* @__PURE__ */ f("td", { className: F(h.td, h.control, W(ee - 1).className), style: W(ee - 1).style, children: I && /* @__PURE__ */ f(
2954
+ !_ && le && /* @__PURE__ */ f("td", { className: B(h.td, h.control, W(ee - 1).className), style: W(ee - 1).style, children: $ && /* @__PURE__ */ f(
2952
2955
  "button",
2953
2956
  {
2954
2957
  type: "button",
2955
- "aria-expanded": B,
2956
- "aria-controls": B ? Y : void 0,
2957
- "aria-label": B ? m.collapseRowNamed(M) : m.expandRowNamed(M),
2958
- className: F(h.expander, B && h.expanderOpen),
2959
- onClick: () => C.toggleRow(A),
2960
- children: /* @__PURE__ */ f(Bo, {})
2958
+ "aria-expanded": P,
2959
+ "aria-controls": P ? Y : void 0,
2960
+ "aria-label": P ? m.collapseRowNamed(L) : m.expandRowNamed(L),
2961
+ className: B(h.expander, P && h.expanderOpen),
2962
+ onClick: () => S.toggleRow(A),
2963
+ children: /* @__PURE__ */ f(Vo, {})
2961
2964
  }
2962
2965
  ) }),
2963
2966
  w && w.span && /* @__PURE__ */ f(
2964
- Rl,
2967
+ El,
2965
2968
  {
2966
2969
  line: { ...w, span: w.span },
2967
2970
  entry: v,
@@ -2972,52 +2975,52 @@ function So({
2972
2975
  wording: m
2973
2976
  }
2974
2977
  ),
2975
- s.map((L, ae) => /* @__PURE__ */ f(
2976
- ea,
2978
+ s.map((F, ae) => /* @__PURE__ */ f(
2979
+ ta,
2977
2980
  {
2978
- entry: L,
2981
+ entry: F,
2979
2982
  row: e,
2980
- kind: o.kindOf(L, r.rows),
2983
+ kind: o.kindOf(F, r.rows),
2981
2984
  pin: W(oe + ae),
2982
2985
  formats: p,
2983
2986
  wording: m,
2984
- line: k,
2985
- rowName: M,
2986
- width: C.widths[L.spec.id],
2987
- tree: O && L === g?.column ? { setup: g, entry: O, detail: I && !ge ? { open: B, toggle: () => C.toggleRow(A) } : void 0 } : void 0
2987
+ line: x,
2988
+ rowName: L,
2989
+ width: S.widths[F.spec.id],
2990
+ tree: E && F === g?.column ? { setup: g, entry: E, detail: $ && !ge ? { open: P, toggle: () => S.toggleRow(A) } : void 0 } : void 0
2988
2991
  },
2989
- L.key
2992
+ F.key
2990
2993
  )),
2991
2994
  y && /* @__PURE__ */ f(
2992
- Ql,
2995
+ Zl,
2993
2996
  {
2994
- draft: E,
2997
+ draft: M,
2995
2998
  actions: _ ? [] : c,
2996
2999
  row: e,
2997
- name: M,
3000
+ name: L,
2998
3001
  wording: m,
2999
- line: k,
3002
+ line: x,
3000
3003
  pin: W(u - 1)
3001
3004
  }
3002
3005
  )
3003
3006
  ]
3004
3007
  }
3005
3008
  ),
3006
- B && /* @__PURE__ */ f(
3007
- Zl,
3009
+ P && /* @__PURE__ */ f(
3010
+ ea,
3008
3011
  {
3009
3012
  id: Y,
3010
3013
  group: de?.path,
3011
- gridLine: x ? `detail:${A}` : void 0,
3012
- beforeRoot: O && g?.beforeRoot(A) ? "" : void 0,
3014
+ gridLine: C ? `detail:${A}` : void 0,
3015
+ beforeRoot: E && g?.beforeRoot(A) ? "" : void 0,
3013
3016
  colSpan: u,
3014
- entry: O,
3015
- children: z
3017
+ entry: E,
3018
+ children: K
3016
3019
  }
3017
3020
  )
3018
3021
  ] });
3019
3022
  }
3020
- function Ql({
3023
+ function Zl({
3021
3024
  draft: e,
3022
3025
  actions: t,
3023
3026
  row: n,
@@ -3026,12 +3029,12 @@ function Ql({
3026
3029
  line: s,
3027
3030
  pin: i
3028
3031
  }) {
3029
- return /* @__PURE__ */ f("td", { className: F(h.td, h.actionsCell, i.className, e && h.editing), style: i.style, children: e ? /* @__PURE__ */ j(re, { children: [
3030
- /* @__PURE__ */ f(Ul, { name: o, wording: r }),
3032
+ return /* @__PURE__ */ f("td", { className: B(h.td, h.actionsCell, i.className, e && h.editing), style: i.style, children: e ? /* @__PURE__ */ T(re, { children: [
3033
+ /* @__PURE__ */ f(Jl, { name: o, wording: r }),
3031
3034
  /* @__PURE__ */ f("span", { className: h.held, "aria-hidden": "true", children: /* @__PURE__ */ f(yn, { actions: t, row: n, name: o, wording: r, line: s }) })
3032
3035
  ] }) : /* @__PURE__ */ f(yn, { actions: t, row: n, name: o, wording: r, line: s }) });
3033
3036
  }
3034
- function Zl({
3037
+ function ea({
3035
3038
  id: e,
3036
3039
  group: t,
3037
3040
  gridLine: n,
@@ -3044,13 +3047,13 @@ function Zl({
3044
3047
  "td",
3045
3048
  {
3046
3049
  colSpan: r,
3047
- className: F(h.detailCell, s && h.treeDetail),
3048
- style: s ? { "--tree-level": s.level } : void 0,
3050
+ className: B(h.detailCell, s && h.treeDetail),
3051
+ style: s ? { "--_table-tree-level": s.level } : void 0,
3049
3052
  children: s ? /* @__PURE__ */ f("div", { className: h.treeDetailRail, children: i }) : i
3050
3053
  }
3051
3054
  ) });
3052
3055
  }
3053
- function ea({
3056
+ function ta({
3054
3057
  entry: e,
3055
3058
  row: t,
3056
3059
  kind: n,
@@ -3062,25 +3065,25 @@ function ea({
3062
3065
  tree: c,
3063
3066
  width: a
3064
3067
  }) {
3065
- const { spec: u } = e, d = e.read(t), b = Vt(n, u.rightAligned), p = vl(i, u.id), w = !(_e(Ve) !== null) || u.edit === void 0 ? void 0 : u.edit === "text" || u.edit === "number" ? "type" : "pick";
3068
+ const { spec: u } = e, d = e.read(t), b = Vt(n, u.rightAligned), p = yl(i, u.id), w = !(_e(Ve) !== null) || u.edit === void 0 ? void 0 : u.edit === "text" || u.edit === "number" ? "type" : "pick";
3066
3069
  let g;
3067
- se(d) ? g = /* @__PURE__ */ f(ho, { wording: s }) : u.presentation ? g = u.presentation(d, t) : g = Be(d, u.format, r, s);
3070
+ se(d) ? g = /* @__PURE__ */ f(go, { wording: s }) : u.presentation ? g = u.presentation(d, t) : g = Pe(d, u.format, r, s);
3068
3071
  const v = typeof g == "string";
3069
3072
  g = /* @__PURE__ */ f(
3070
3073
  "div",
3071
3074
  {
3072
- className: F(h.value, v && h.valueText, a !== void 0 && h.sized, p && h.editingValue),
3073
- style: a !== void 0 ? { "--_width": `${a}px` } : void 0,
3075
+ className: B(h.value, v && h.valueText, a !== void 0 && h.sized, p && h.editingValue),
3076
+ style: a !== void 0 ? { "--_table-width": `${a}px` } : void 0,
3074
3077
  "aria-hidden": p ? !0 : void 0,
3075
3078
  children: g
3076
3079
  }
3077
- ), c && (g = /* @__PURE__ */ f(Fl, { ...c, name: l, wording: s, children: g }));
3078
- const x = u.rowHeader ? "th" : "td";
3079
- return /* @__PURE__ */ j(
3080
- x,
3080
+ ), c && (g = /* @__PURE__ */ f(Dl, { ...c, name: l, wording: s, children: g }));
3081
+ const C = u.rowHeader ? "th" : "td";
3082
+ return /* @__PURE__ */ T(
3083
+ C,
3081
3084
  {
3082
3085
  scope: u.rowHeader ? "row" : void 0,
3083
- className: F(h.td, b && h.numeric, u.rowHeader && h.rowHeader, o.className, p && h.editing),
3086
+ className: B(h.td, b && h.numeric, u.rowHeader && h.rowHeader, o.className, p && h.editing),
3084
3087
  style: o.style,
3085
3088
  "data-edit": w,
3086
3089
  "data-editing": p ? u.id : void 0,
@@ -3120,7 +3123,7 @@ function Dt(e, t, n, o, r) {
3120
3123
  i.rowKey(t)
3121
3124
  );
3122
3125
  }
3123
- function ta(e, t) {
3126
+ function na(e, t) {
3124
3127
  const { registry: n, hook: o, layout: r } = e;
3125
3128
  return /* @__PURE__ */ f("tbody", { children: /* @__PURE__ */ f(
3126
3129
  So,
@@ -3149,10 +3152,10 @@ function ta(e, t) {
3149
3152
  he
3150
3153
  ) });
3151
3154
  }
3152
- function na(e) {
3155
+ function oa(e) {
3153
3156
  const { registry: t, hook: n, layout: o } = e;
3154
3157
  return /* @__PURE__ */ f("tbody", { children: /* @__PURE__ */ f(
3155
- Jl,
3158
+ Xl,
3156
3159
  {
3157
3160
  columns: o.columnCount,
3158
3161
  rows: e.pageSize ? e.heldLines || e.pageSize : void 0,
@@ -3163,24 +3166,24 @@ function na(e) {
3163
3166
  }
3164
3167
  ) });
3165
3168
  }
3166
- function oa(e) {
3169
+ function ra(e) {
3167
3170
  const { hook: t, layout: n, wording: o } = e, { snapshot: r } = n;
3168
3171
  return /* @__PURE__ */ f("tbody", { children: /* @__PURE__ */ f("tr", { "data-grid-line": Yt(e.gridMode, "empty"), children: /* @__PURE__ */ f(
3169
3172
  "td",
3170
3173
  {
3171
3174
  colSpan: n.columnCount,
3172
3175
  className: h.emptyCell,
3173
- style: e.pageSize && e.heldLines ? { height: `calc(var(--_pitch) * ${e.heldLines})`, verticalAlign: "top" } : void 0,
3174
- children: /* @__PURE__ */ f("div", { className: h.empty, children: (r.server || t.admitted.length > 0) && n.restricted ? /* @__PURE__ */ j(re, { children: [
3176
+ style: e.pageSize && e.heldLines ? { height: `calc(var(--_table-pitch) * ${e.heldLines})`, verticalAlign: "top" } : void 0,
3177
+ children: /* @__PURE__ */ f("div", { className: h.empty, children: (r.server || t.admitted.length > 0) && n.restricted ? /* @__PURE__ */ T(re, { children: [
3175
3178
  /* @__PURE__ */ f("p", { className: h.emptyTitle, children: o.nothingMatchesFilters }),
3176
- /* @__PURE__ */ f(Q, { size: "sm", variant: "ghost", onClick: () => Qn(r), children: o.resetAll })
3179
+ /* @__PURE__ */ f(Q, { size: "sm", variant: "ghost", onClick: () => Zn(r), children: o.resetAll })
3177
3180
  ] }) : e.empty ?? /* @__PURE__ */ f("p", { className: h.emptyTitle, children: o.noEntries }) })
3178
3181
  }
3179
3182
  ) }) });
3180
3183
  }
3181
- function ra(e, t) {
3182
- const { hook: n, layout: o, wording: r, formats: s } = e, { virtual: i, grouping: l, projection: c } = o, a = i ? Fn(t).map((m) => m.kind === "folded" || !m.continued ? m : { ...m, continued: !1 }) : t, u = a.length - t.length, d = i && i.from > 0 ? i.fillerBefore / i.from : 0, b = (m, w, g, v) => /* @__PURE__ */ f(
3183
- Ol,
3184
+ function sa(e, t) {
3185
+ const { hook: n, layout: o, wording: r, formats: s } = e, { virtual: i, grouping: l, projection: c } = o, a = i ? Bn(t).map((m) => m.kind === "folded" || !m.continued ? m : { ...m, continued: !1 }) : t, u = a.length - t.length, d = i && i.from > 0 ? i.fillerBefore / i.from : 0, b = (m, w, g, v) => /* @__PURE__ */ f(
3186
+ Ml,
3184
3187
  {
3185
3188
  line: m,
3186
3189
  index: g,
@@ -3217,21 +3220,21 @@ function ra(e, t) {
3217
3220
  colSpan: o.columnCount,
3218
3221
  children: a.map(p)
3219
3222
  }
3220
- ) : /* @__PURE__ */ j("tbody", { children: [
3223
+ ) : /* @__PURE__ */ T("tbody", { children: [
3221
3224
  t.map(p),
3222
3225
  e.filler
3223
3226
  ] });
3224
3227
  }
3225
- function sa(e, t, n, o) {
3226
- return n && t > 0 && t < e ? /* @__PURE__ */ f(Ft, { height: `calc(var(--_pitch) * ${e - t})`, colSpan: o }) : null;
3228
+ function ia(e, t, n, o) {
3229
+ return n && t > 0 && t < e ? /* @__PURE__ */ f(Bt, { height: `calc(var(--_table-pitch) * ${e - t})`, colSpan: o }) : null;
3227
3230
  }
3228
- function ia(e, t, n) {
3231
+ function la(e, t, n) {
3229
3232
  const { layout: o } = e, { virtual: r, lines: s, rows: i, projection: l } = o;
3230
- return t && !n ? { body: na(e), empty: !1 } : l.filtered.length === 0 ? { body: oa(e), empty: !0 } : s ? { body: ra(e, s), empty: !1 } : r ? {
3233
+ return t && !n ? { body: oa(e), empty: !1 } : l.filtered.length === 0 ? { body: ra(e), empty: !0 } : s ? { body: sa(e, s), empty: !1 } : r ? {
3231
3234
  body: /* @__PURE__ */ f(ko, { virtual: r, colSpan: o.columnCount, children: i.map((c, a) => Dt(e, c, a, r.from + a)) }),
3232
3235
  empty: !1
3233
3236
  } : {
3234
- body: /* @__PURE__ */ j("tbody", { children: [
3237
+ body: /* @__PURE__ */ T("tbody", { children: [
3235
3238
  i.map((c, a) => Dt(e, c, a, a)),
3236
3239
  e.filler
3237
3240
  ] }),
@@ -3244,62 +3247,62 @@ function _n({
3244
3247
  hook: n,
3245
3248
  pin: o
3246
3249
  }) {
3247
- const { spec: r } = e, s = n.publicSnapshot, i = t.kindOf(e, n.rows), l = Vt(i, r.rightAligned), c = t.isSortable(e, n.rows), a = r.id, u = s.sort.findIndex((S) => S.column === a), d = u === -1 ? void 0 : s.sort[u].direction, b = s.sort.length > 1 && u !== -1 ? u + 1 : void 0, p = s.widths[a], m = 48, w = (S) => {
3248
- S.stopPropagation(), S.preventDefault();
3249
- const C = S.currentTarget, A = C.closest("th");
3250
+ const { spec: r } = e, s = n.publicSnapshot, i = t.kindOf(e, n.rows), l = Vt(i, r.rightAligned), c = t.isSortable(e, n.rows), a = r.id, u = s.sort.findIndex((k) => k.column === a), d = u === -1 ? void 0 : s.sort[u].direction, b = s.sort.length > 1 && u !== -1 ? u + 1 : void 0, p = s.widths[a], m = 48, w = (k) => {
3251
+ k.stopPropagation(), k.preventDefault();
3252
+ const S = k.currentTarget, A = S.closest("th");
3250
3253
  if (!A) return;
3251
- const M = S.clientX, k = A.getBoundingClientRect().width, R = S.pointerId;
3252
- C.setPointerCapture(R);
3253
- const E = (O) => {
3254
- O.pointerId === R && s.setWidth(a, Math.max(m, k + (O.clientX - M)));
3255
- }, T = (O) => {
3256
- O.pointerId === R && (C.removeEventListener("pointermove", E), C.removeEventListener("pointerup", T), C.removeEventListener("pointercancel", T), C.hasPointerCapture(R) && C.releasePointerCapture(R));
3254
+ const L = k.clientX, x = A.getBoundingClientRect().width, O = k.pointerId;
3255
+ S.setPointerCapture(O);
3256
+ const M = (E) => {
3257
+ E.pointerId === O && s.setWidth(a, Math.max(m, x + (E.clientX - L)));
3258
+ }, R = (E) => {
3259
+ E.pointerId === O && (S.removeEventListener("pointermove", M), S.removeEventListener("pointerup", R), S.removeEventListener("pointercancel", R), S.hasPointerCapture(O) && S.releasePointerCapture(O));
3257
3260
  };
3258
- C.addEventListener("pointermove", E), C.addEventListener("pointerup", T), C.addEventListener("pointercancel", T);
3259
- }, g = (S) => {
3260
- const C = S?.parentElement, A = S?.closest("table");
3261
- if (!S || !C || !A) return;
3262
- const M = Array.from(C.children).indexOf(S), k = C.children.length, R = { cell: S.style.width, table: A.style.width };
3263
- S.style.width = "", A.style.width = "auto";
3264
- let E = 0;
3265
- for (const T of Array.from(A.rows)) {
3266
- if (T.cells.length !== k) continue;
3267
- const O = T.cells[M];
3268
- if (!O) continue;
3269
- const D = O.querySelector(`.${h.value}`), I = getComputedStyle(O), B = (parseFloat(I.paddingLeft) || 0) + (parseFloat(I.paddingRight) || 0), z = O.querySelector(`.${h.headLabel}`), Y = z ? z.scrollWidth - z.clientWidth : 0;
3270
- E = Math.max(E, O.scrollWidth + Y, D ? D.scrollWidth + B : 0);
3261
+ S.addEventListener("pointermove", M), S.addEventListener("pointerup", R), S.addEventListener("pointercancel", R);
3262
+ }, g = (k) => {
3263
+ const S = k?.parentElement, A = k?.closest("table");
3264
+ if (!k || !S || !A) return;
3265
+ const L = Array.from(S.children).indexOf(k), x = S.children.length, O = { cell: k.style.width, table: A.style.width };
3266
+ k.style.width = "", A.style.width = "auto";
3267
+ let M = 0;
3268
+ for (const R of Array.from(A.rows)) {
3269
+ if (R.cells.length !== x) continue;
3270
+ const E = R.cells[L];
3271
+ if (!E) continue;
3272
+ const D = E.querySelector(`.${h.value}`), $ = getComputedStyle(E), P = (parseFloat($.paddingLeft) || 0) + (parseFloat($.paddingRight) || 0), K = E.querySelector(`.${h.headLabel}`), Y = K ? K.scrollWidth - K.clientWidth : 0;
3273
+ M = Math.max(M, E.scrollWidth + Y, D ? D.scrollWidth + P : 0);
3271
3274
  }
3272
- S.style.width = R.cell, A.style.width = R.table, E > 0 && s.setWidth(a, Math.max(m, E + 1));
3273
- }, v = (S) => {
3274
- if (!r.resizable || !S.altKey) return;
3275
- const C = S.key === "ArrowRight", A = S.key === "ArrowLeft", M = S.key === "Home";
3276
- if (!C && !A && !M) return;
3277
- S.preventDefault();
3278
- const k = S.currentTarget;
3279
- if (M) {
3280
- g(k);
3275
+ k.style.width = O.cell, A.style.width = O.table, M > 0 && s.setWidth(a, Math.max(m, M + 1));
3276
+ }, v = (k) => {
3277
+ if (!r.resizable || !k.altKey) return;
3278
+ const S = k.key === "ArrowRight", A = k.key === "ArrowLeft", L = k.key === "Home";
3279
+ if (!S && !A && !L) return;
3280
+ k.preventDefault();
3281
+ const x = k.currentTarget;
3282
+ if (L) {
3283
+ g(x);
3281
3284
  return;
3282
3285
  }
3283
- const R = k.getBoundingClientRect().width, E = S.shiftKey ? 32 : 8;
3284
- s.setWidth(a, Math.max(m, R + (C ? E : -E)));
3285
- }, x = c ? /* @__PURE__ */ j(
3286
+ const O = x.getBoundingClientRect().width, M = k.shiftKey ? 32 : 8;
3287
+ s.setWidth(a, Math.max(m, O + (S ? M : -M)));
3288
+ }, C = c ? /* @__PURE__ */ T(
3286
3289
  "button",
3287
3290
  {
3288
3291
  type: "button",
3289
- className: F(h.sortButton, h.headLine),
3290
- onClick: (S) => s.toggleSort(a, S.shiftKey || S.metaKey),
3292
+ className: B(h.sortButton, h.headLine),
3293
+ onClick: (k) => s.toggleSort(a, k.shiftKey || k.metaKey),
3291
3294
  children: [
3292
3295
  /* @__PURE__ */ f("span", { className: h.headLabel, children: r.label }),
3293
3296
  b !== void 0 && /* @__PURE__ */ f("span", { className: h.sortRank, "aria-hidden": "true", children: b }),
3294
- /* @__PURE__ */ f("span", { className: F(h.sortIndicator, d && h.sortActive), "aria-hidden": "true", children: d ? /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", className: F(h.sortArrow, d === "desc" && h.sortArrowDesc), children: /* @__PURE__ */ f("path", { d: "M2.2 6.2 5 3.4l2.8 2.8", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) }) : (
3297
+ /* @__PURE__ */ f("span", { className: B(h.sortIndicator, d && h.sortActive), "aria-hidden": "true", children: d ? /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", className: B(h.sortArrow, d === "desc" && h.sortArrowDesc), children: /* @__PURE__ */ f("path", { d: "M2.2 6.2 5 3.4l2.8 2.8", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) }) : (
3295
3298
  /* Drawn in the nominal box and set in the 12 pixels the indicator
3296
3299
  takes, so that the head does not move. */
3297
3300
  /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "12", "aria-hidden": "true", children: /* @__PURE__ */ f("path", { d: "M2.8 3.7 5 1.5l2.2 2.2M2.8 6.3 5 8.5l2.2-2.2", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
3298
3301
  ) })
3299
3302
  ]
3300
3303
  }
3301
- ) : /* @__PURE__ */ f("span", { className: h.headLine, children: /* @__PURE__ */ f("span", { className: h.headLabel, children: r.label }) }), y = d === "asc" ? "ascending" : d === "desc" ? "descending" : "none", _ = Oe(r.filter) !== void 0 && !(r.filter === "list" && i === "other");
3302
- return /* @__PURE__ */ j(
3304
+ ) : /* @__PURE__ */ f("span", { className: h.headLine, children: /* @__PURE__ */ f("span", { className: h.headLabel, children: r.label }) }), y = d === "asc" ? "ascending" : d === "desc" ? "descending" : "none", _ = Ee(r.filter) !== void 0 && !(r.filter === "list" && i === "other");
3305
+ return /* @__PURE__ */ T(
3303
3306
  "th",
3304
3307
  {
3305
3308
  scope: "col",
@@ -3307,25 +3310,25 @@ function _n({
3307
3310
  "aria-sort": c ? y : void 0,
3308
3311
  tabIndex: r.resizable && !c ? 0 : void 0,
3309
3312
  onKeyDown: v,
3310
- className: F(h.th, l && h.numeric, p !== void 0 && h.sized, o.className),
3313
+ className: B(h.th, l && h.numeric, p !== void 0 && h.sized, o.className),
3311
3314
  style: {
3312
3315
  ...p !== void 0 ? { width: p } : {},
3313
3316
  ...o.style
3314
3317
  },
3315
3318
  children: [
3316
- _ ? /* @__PURE__ */ j("span", { className: h.thFlex, children: [
3317
- x,
3318
- /* @__PURE__ */ f(Wi, { entry: e, registry: t, hook: n })
3319
- ] }) : x,
3319
+ _ ? /* @__PURE__ */ T("span", { className: h.thFlex, children: [
3320
+ C,
3321
+ /* @__PURE__ */ f(qi, { entry: e, registry: t, hook: n })
3322
+ ] }) : C,
3320
3323
  r.resizable && /* @__PURE__ */ f(
3321
3324
  "span",
3322
3325
  {
3323
3326
  role: "presentation",
3324
3327
  className: h.grip,
3325
3328
  onPointerDown: w,
3326
- onClick: (S) => S.stopPropagation(),
3327
- onDoubleClick: (S) => {
3328
- S.stopPropagation(), g(S.currentTarget.closest("th"));
3329
+ onClick: (k) => k.stopPropagation(),
3330
+ onDoubleClick: (k) => {
3331
+ k.stopPropagation(), g(k.currentTarget.closest("th"));
3329
3332
  }
3330
3333
  }
3331
3334
  )
@@ -3333,16 +3336,16 @@ function _n({
3333
3336
  }
3334
3337
  );
3335
3338
  }
3336
- function la({
3339
+ function aa({
3337
3340
  registry: e,
3338
3341
  hook: t,
3339
3342
  layout: n,
3340
3343
  props: o,
3341
3344
  wording: r
3342
3345
  }) {
3343
- const { selectable: s = !1, grid: i = !1 } = o, { snapshot: l, virtual: c, spanEntry: a, dataColumns: u, expanderColumn: d, controlColumns: b, leading: p, rowMode: m, rowTools: w, trailing: g, columnCount: v, blocks: x } = n, y = (_, S = _) => ct(x, _, S);
3344
- return /* @__PURE__ */ f("thead", { children: /* @__PURE__ */ j("tr", { "aria-rowindex": c ? 1 : void 0, "data-grid-line": Yt(i, "head"), children: [
3345
- s && /* @__PURE__ */ f("th", { scope: "col", className: F(h.th, h.control, y(0).className), style: y(0).style, children: /* @__PURE__ */ f(
3346
+ const { selectable: s = !1, grid: i = !1 } = o, { snapshot: l, virtual: c, spanEntry: a, dataColumns: u, expanderColumn: d, controlColumns: b, leading: p, rowMode: m, rowTools: w, trailing: g, columnCount: v, blocks: C } = n, y = (_, k = _) => ct(C, _, k);
3347
+ return /* @__PURE__ */ f("thead", { children: /* @__PURE__ */ T("tr", { "aria-rowindex": c ? 1 : void 0, "data-grid-line": Yt(i, "head"), children: [
3348
+ s && /* @__PURE__ */ f("th", { scope: "col", className: B(h.th, h.control, y(0).className), style: y(0).style, children: /* @__PURE__ */ f(
3346
3349
  We,
3347
3350
  {
3348
3351
  "aria-label": l.server ? r.selectAllOnPage : r.selectAllRows,
@@ -3354,26 +3357,26 @@ function la({
3354
3357
  d && /* @__PURE__ */ f(
3355
3358
  "td",
3356
3359
  {
3357
- className: F(h.th, h.control, y(b - 1).className),
3360
+ className: B(h.th, h.control, y(b - 1).className),
3358
3361
  style: y(b - 1).style
3359
3362
  }
3360
3363
  ),
3361
- a && (e.columnById(a.spec.id) === a ? /* @__PURE__ */ f(_n, { entry: a, registry: e, hook: t, pin: y(b) }) : /* @__PURE__ */ f("th", { scope: "col", className: F(h.th, y(b).className), style: y(b).style, children: a.spec.label })),
3362
- u.map((_, S) => /* @__PURE__ */ f(_n, { entry: _, registry: e, hook: t, pin: y(p + S) }, _.key)),
3363
- g && /* @__PURE__ */ j(
3364
+ a && (e.columnById(a.spec.id) === a ? /* @__PURE__ */ f(_n, { entry: a, registry: e, hook: t, pin: y(b) }) : /* @__PURE__ */ f("th", { scope: "col", className: B(h.th, y(b).className), style: y(b).style, children: a.spec.label })),
3365
+ u.map((_, k) => /* @__PURE__ */ f(_n, { entry: _, registry: e, hook: t, pin: y(p + k) }, _.key)),
3366
+ g && /* @__PURE__ */ T(
3364
3367
  "th",
3365
3368
  {
3366
3369
  scope: "col",
3367
- className: F(h.th, h.actionsCell, y(v - 1).className),
3370
+ className: B(h.th, h.actionsCell, y(v - 1).className),
3368
3371
  style: y(v - 1).style,
3369
3372
  children: [
3370
- /* @__PURE__ */ f(Re, { children: r.rowActions }),
3371
- w && /* @__PURE__ */ j("span", { className: h.reserve, "aria-hidden": "true", children: [
3372
- (m || o.onRowAdd) && /* @__PURE__ */ j("span", { className: F(h.actions, h.decision), children: [
3373
+ /* @__PURE__ */ f(Oe, { children: r.rowActions }),
3374
+ w && /* @__PURE__ */ T("span", { className: h.reserve, "aria-hidden": "true", children: [
3375
+ (m || o.onRowAdd) && /* @__PURE__ */ T("span", { className: B(h.actions, h.decision), children: [
3373
3376
  /* @__PURE__ */ f(Q, { tabIndex: -1, size: "sm", children: r.saveRow }),
3374
3377
  /* @__PURE__ */ f(Q, { tabIndex: -1, size: "sm", children: r.discardRow })
3375
3378
  ] }),
3376
- o.onRowDelete && /* @__PURE__ */ j("span", { className: F(h.actions, h.decision), children: [
3379
+ o.onRowDelete && /* @__PURE__ */ T("span", { className: B(h.actions, h.decision), children: [
3377
3380
  /* @__PURE__ */ f("span", { className: h.deleteAsk, children: r.deleteRowAsk }),
3378
3381
  /* @__PURE__ */ f(Q, { tabIndex: -1, size: "sm", children: r.deleteRow }),
3379
3382
  /* @__PURE__ */ f(Q, { tabIndex: -1, size: "sm", children: r.keepRow })
@@ -3384,18 +3387,18 @@ function la({
3384
3387
  )
3385
3388
  ] }) });
3386
3389
  }
3387
- function aa({
3390
+ function ca({
3388
3391
  layout: e,
3389
3392
  gridMode: t,
3390
3393
  formats: n,
3391
3394
  wording: o
3392
3395
  }) {
3393
3396
  const { projection: r, virtual: s, spanEntry: i, dataColumns: l, controlColumns: c, leading: a, trailing: u, columnCount: d, blocks: b } = e, p = (m, w = m) => ct(b, m, w);
3394
- return /* @__PURE__ */ f("tfoot", { children: /* @__PURE__ */ j("tr", { "aria-rowindex": s ? (r.lines ?? r.shown ?? r.filtered).length + 2 : void 0, "data-grid-line": Yt(t, "foot"), children: [
3395
- Array.from({ length: c }, (m, w) => /* @__PURE__ */ f("td", { className: F(h.td, h.control, p(w).className), style: p(w).style }, w)),
3396
- i && /* @__PURE__ */ f("td", { className: F(h.td, p(c).className), style: p(c).style }),
3397
+ return /* @__PURE__ */ f("tfoot", { children: /* @__PURE__ */ T("tr", { "aria-rowindex": s ? (r.lines ?? r.shown ?? r.filtered).length + 2 : void 0, "data-grid-line": Yt(t, "foot"), children: [
3398
+ Array.from({ length: c }, (m, w) => /* @__PURE__ */ f("td", { className: B(h.td, h.control, p(w).className), style: p(w).style }, w)),
3399
+ i && /* @__PURE__ */ f("td", { className: B(h.td, p(c).className), style: p(c).style }),
3397
3400
  l.map((m, w) => /* @__PURE__ */ f(
3398
- ca,
3401
+ da,
3399
3402
  {
3400
3403
  entry: m,
3401
3404
  rows: r.roots ?? r.filtered,
@@ -3406,34 +3409,34 @@ function aa({
3406
3409
  },
3407
3410
  m.key
3408
3411
  )),
3409
- u && /* @__PURE__ */ f("td", { className: F(h.td, p(d - 1).className), style: p(d - 1).style })
3412
+ u && /* @__PURE__ */ f("td", { className: B(h.td, p(d - 1).className), style: p(d - 1).style })
3410
3413
  ] }) });
3411
3414
  }
3412
- function ca({
3415
+ function da({
3413
3416
  entry: e,
3414
3417
  rows: t,
3415
3418
  formats: n,
3416
3419
  wording: o,
3417
- pin: r = mo,
3420
+ pin: r = wo,
3418
3421
  topLevel: s = !1
3419
3422
  }) {
3420
- if (!e.spec.aggregate) return /* @__PURE__ */ f("td", { className: F(h.td, r.className), style: r.style });
3423
+ if (!e.spec.aggregate) return /* @__PURE__ */ f("td", { className: B(h.td, r.className), style: r.style });
3421
3424
  const i = typeof e.spec.aggregate == "function" ? "own" : e.spec.aggregate;
3422
- return /* @__PURE__ */ j(
3425
+ return /* @__PURE__ */ T(
3423
3426
  "td",
3424
3427
  {
3425
- className: F(h.td, po(e, t) && h.numeric, r.className),
3428
+ className: B(h.td, mo(e, t) && h.numeric, r.className),
3426
3429
  style: r.style,
3427
3430
  "data-footer": i,
3428
3431
  title: s ? o.footerTopLevel : void 0,
3429
3432
  children: [
3430
- /* @__PURE__ */ f(Rt, { entry: e, rows: t, formats: n, wording: o, signed: !0 }),
3431
- s && /* @__PURE__ */ f(Re, { children: ` (${o.footerTopLevel})` })
3433
+ /* @__PURE__ */ f(Ot, { entry: e, rows: t, formats: n, wording: o, signed: !0 }),
3434
+ s && /* @__PURE__ */ f(Oe, { children: ` (${o.footerTopLevel})` })
3432
3435
  ]
3433
3436
  }
3434
3437
  );
3435
3438
  }
3436
- function da({
3439
+ function ua({
3437
3440
  table: e,
3438
3441
  blocks: t,
3439
3442
  onSticking: n,
@@ -3445,7 +3448,7 @@ function da({
3445
3448
  }), l = () => {
3446
3449
  const c = e.current, a = c?.parentElement;
3447
3450
  if (!c || !a || (a.style.removeProperty("scroll-padding-left"), a.style.removeProperty("scroll-padding-right"), !r && !s)) return;
3448
- const u = Array.from(c.tHead?.rows[0]?.cells ?? []);
3451
+ const u = Array.from(c.tHead?.rows?.[0]?.cells ?? []);
3449
3452
  let d = 0;
3450
3453
  for (let g = 0; g < r; g++)
3451
3454
  c.style.setProperty(`--u-table-pin-start-${g}`, `${d}px`), d += u[g]?.getBoundingClientRect().width ?? 0;
@@ -3456,18 +3459,18 @@ function da({
3456
3459
  i.current.key !== p && (i.current = { key: p, sticking: i.current.sticking });
3457
3460
  const m = i.current;
3458
3461
  m.sticking.start && (m.start = d), m.sticking.end && (m.end = b);
3459
- const w = sr(m.start ?? d, m.end ?? b, a.clientWidth);
3460
- m.sticking = w, n(w), w.start || (d = 0), w.end || (b = 0), c.style.setProperty("--u-table-pin-start", `${d}px`), c.style.setProperty("--u-table-pin-end", `${b}px`), d && a.style.setProperty("scroll-padding-left", `${d}px`), b && a.style.setProperty("scroll-padding-right", `${b}px`), vo(a);
3462
+ const w = ir(m.start ?? d, m.end ?? b, a.clientWidth);
3463
+ m.sticking = w, n(w), w.start || (d = 0), w.end || (b = 0), c.style.setProperty("--u-table-pin-start", `${d}px`), c.style.setProperty("--u-table-pin-end", `${b}px`), d && a.style.setProperty("scroll-padding-left", `${d}px`), b && a.style.setProperty("scroll-padding-right", `${b}px`), yo(a);
3461
3464
  };
3462
- return Z(l), xe(() => {
3465
+ return Z(l), Ce(() => {
3463
3466
  const c = e.current;
3464
3467
  if (!c || !r && !s || typeof ResizeObserver > "u") return;
3465
- const a = new ResizeObserver(l), u = Array.from(c.tHead?.rows[0]?.cells ?? []);
3468
+ const a = new ResizeObserver(l), u = Array.from(c.tHead?.rows?.[0]?.cells ?? []);
3466
3469
  for (const d of [...u.slice(0, r), ...u.slice(u.length - s)]) a.observe(d);
3467
3470
  return c.parentElement && a.observe(c.parentElement), () => a.disconnect();
3468
3471
  }, [e, r, s, t.count, o]), null;
3469
3472
  }
3470
- function ua({ table: e }) {
3473
+ function fa({ table: e }) {
3471
3474
  return Z(() => {
3472
3475
  const t = e.current?.parentElement;
3473
3476
  if (!t) return;
@@ -3477,20 +3480,20 @@ function ua({ table: e }) {
3477
3480
  return o.observe(t), () => o.disconnect();
3478
3481
  }, [e]), null;
3479
3482
  }
3480
- function fa({ table: e, blocks: t }) {
3483
+ function ha({ table: e, blocks: t }) {
3481
3484
  const n = q(t);
3482
3485
  return Z(() => {
3483
3486
  n.current = t;
3484
3487
  const o = e.current?.parentElement;
3485
- o && Lt(o, t);
3486
- }), xe(() => {
3488
+ o && Ft(o, t);
3489
+ }), Ce(() => {
3487
3490
  const o = e.current, r = o?.parentElement;
3488
3491
  if (!o || !r || typeof ResizeObserver > "u") return;
3489
- const s = new ResizeObserver(() => Lt(r, n.current));
3492
+ const s = new ResizeObserver(() => Ft(r, n.current));
3490
3493
  return s.observe(r), s.observe(o), () => s.disconnect();
3491
3494
  }, [e]), null;
3492
3495
  }
3493
- function ha({ registry: e, props: t }) {
3496
+ function ga({ registry: e, props: t }) {
3494
3497
  const {
3495
3498
  selectable: n = !1,
3496
3499
  stickyHeader: o = !1,
@@ -3504,20 +3507,20 @@ function ha({ registry: e, props: t }) {
3504
3507
  grid: d = !1
3505
3508
  } = t;
3506
3509
  st(e.subscribe, e.bodyVersion, e.bodyVersion);
3507
- const b = ie(), p = ke(), m = Vo(s, "regular"), w = be(), g = q(null), [v, x] = P(0), y = cl(), [_, S] = P({ start: !0, end: !0 });
3508
- $l(e, y), zl(g, o), Kl(e, g), Gl(e, g, c), Hl(g), Wl(e, g);
3509
- const C = e.hook && !e.hook.tableState.virtual ? e.hook.publicSnapshot : null;
3510
- nl(g, C ? `${C.grouping.join("|")}#${C.folded.join("|")}` : "");
3510
+ const b = ie(), p = xe(), m = Io(s, "regular"), w = be(), g = q(null), [v, C] = I(0), y = dl(), [_, k] = I({ start: !0, end: !0 });
3511
+ Kl(e, y), Gl(g, o), jl(e, g), Hl(e, g, c), Wl(g), ql(e, g);
3512
+ const S = e.hook && !e.hook.tableState.virtual ? e.hook.publicSnapshot : null;
3513
+ ol(g, S ? `${S.grouping.join("|")}#${S.folded.join("|")}` : "");
3511
3514
  const A = e.hook;
3512
3515
  if (!A) return null;
3513
- const M = y.state.editing?.row === !0, k = ql({ registry: e, hook: A, props: t, drafting: M, sticking: _ }), { snapshot: R, projection: E, virtual: T, lines: O, entries: D, grouping: I, dataColumns: B, columnCount: z, pins: Y, pinned: ce, blocks: G, rows: ne, footerShown: de } = k, { lines: le, fresh: ee, ids: oe, events: W } = Bl({ registry: e, hook: A, props: t, layout: k, grid: y }), ge = Pl({ registry: e, hook: A, grid: y, gridMode: d, gridLines: le, dataColumns: B, formats: p, wording: b, tableElement: () => g.current });
3516
+ const L = y.state.editing?.row === !0, x = Yl({ registry: e, hook: A, props: t, drafting: L, sticking: _ }), { snapshot: O, projection: M, virtual: R, lines: E, entries: D, grouping: $, dataColumns: P, columnCount: K, pins: Y, pinned: ce, blocks: j, rows: ne, footerShown: de } = x, { lines: le, fresh: ee, ids: oe, events: W } = Vl({ registry: e, hook: A, props: t, layout: x, grid: y }), ge = $l({ registry: e, hook: A, grid: y, gridMode: d, gridLines: le, dataColumns: P, formats: p, wording: b, tableElement: () => g.current });
3514
3517
  e.setAddRow(W?.addRow ?? null);
3515
- const L = (e.paginates() || R.server) && !T ? R.pageSize : 0, ae = O ? O.length : ne.length, Ae = L && !c ? Math.min(ae, L) : 0;
3516
- Ae > v && x(Ae);
3517
- const ue = Math.min(Math.max(Ae, v, R.pageCount > 1 ? L : 0), L), Ne = c && ae > 0, Ee = {
3518
+ const F = (e.paginates() || O.server) && !R ? O.pageSize : 0, ae = E ? E.length : ne.length, Ae = F && !c ? Math.min(ae, F) : 0;
3519
+ Ae > v && C(Ae);
3520
+ const ue = Math.min(Math.max(Ae, v, O.pageCount > 1 ? F : 0), F), Ne = c && ae > 0, Me = {
3518
3521
  registry: e,
3519
3522
  hook: A,
3520
- layout: k,
3523
+ layout: x,
3521
3524
  selectable: n,
3522
3525
  gridMode: d,
3523
3526
  empty: l,
@@ -3525,40 +3528,40 @@ function ha({ registry: e, props: t }) {
3525
3528
  baseId: w,
3526
3529
  formats: p,
3527
3530
  wording: b,
3528
- pageSize: L,
3531
+ pageSize: F,
3529
3532
  heldLines: ue,
3530
- filler: sa(ue, ae, L, z)
3531
- }, pe = ia(Ee, c, Ne);
3532
- return /* @__PURE__ */ j(re, { children: [
3533
- /* @__PURE__ */ j(
3533
+ filler: ia(ue, ae, F, K)
3534
+ }, pe = la(Me, c, Ne);
3535
+ return /* @__PURE__ */ T(re, { children: [
3536
+ /* @__PURE__ */ T(
3534
3537
  "div",
3535
3538
  {
3536
- ref: T?.scrollRef,
3539
+ ref: R?.scrollRef,
3537
3540
  onScroll: (U) => {
3538
- T?.onScroll(), O && o && yo(U.currentTarget), (G.start || G.end) && vo(U.currentTarget), Lt(U.currentTarget, G);
3541
+ R?.onScroll(), E && o && _o(U.currentTarget), (j.start || j.end) && yo(U.currentTarget), Ft(U.currentTarget, j);
3539
3542
  },
3540
3543
  onKeyDown: ge,
3541
3544
  onAnimationEnd: (U) => U.target.removeAttribute("data-copied"),
3542
3545
  className: h.scroll,
3543
3546
  style: i ? { maxHeight: i } : void 0,
3544
3547
  children: [
3545
- /* @__PURE__ */ f(jn, { size: "sm", children: /* @__PURE__ */ j(
3548
+ /* @__PURE__ */ f(Tn, { size: "sm", children: /* @__PURE__ */ T(
3546
3549
  "table",
3547
3550
  {
3548
3551
  ref: g,
3549
- role: O || D ? "treegrid" : d ? "grid" : void 0,
3550
- "aria-readonly": d && !B.some((U) => U.spec.edit !== void 0) ? !0 : void 0,
3552
+ role: E || D ? "treegrid" : d ? "grid" : void 0,
3553
+ "aria-readonly": d && !P.some((U) => U.spec.edit !== void 0) ? !0 : void 0,
3551
3554
  onKeyDown: W?.onKeyDown,
3552
3555
  onFocus: W?.onFocus,
3553
3556
  onClick: W?.onClick,
3554
3557
  onBlur: W?.onBlur,
3555
- "data-depth": O ? I.length : void 0,
3556
- style: O ? { "--u-header-levels": I.length - 1 } : void 0,
3558
+ "data-depth": E ? $.length : void 0,
3559
+ style: E ? { "--u-header-levels": $.length - 1 } : void 0,
3557
3560
  "aria-label": u,
3558
- "aria-rowcount": T ? (E.lines ?? E.shown ?? E.filtered).length + 1 + (de ? 1 : 0) : void 0,
3561
+ "aria-rowcount": R ? (M.lines ?? M.shown ?? M.filtered).length + 1 + (de ? 1 : 0) : void 0,
3559
3562
  "aria-busy": c || void 0,
3560
3563
  "data-stale": Ne || void 0,
3561
- className: F(
3564
+ className: B(
3562
3565
  h.table,
3563
3566
  m === "compact" && h.compact,
3564
3567
  o && h.sticky,
@@ -3566,45 +3569,45 @@ function ha({ registry: e, props: t }) {
3566
3569
  d && h.grid
3567
3570
  ),
3568
3571
  children: [
3569
- /* @__PURE__ */ f(la, { registry: e, hook: A, layout: k, props: t, wording: b }),
3570
- /* @__PURE__ */ j(Ve, { value: W ? { ...W.context, hook: A, wording: b } : null, children: [
3571
- ee && ta(Ee, ee),
3572
+ /* @__PURE__ */ f(aa, { registry: e, hook: A, layout: x, props: t, wording: b }),
3573
+ /* @__PURE__ */ T(Ve, { value: W ? { ...W.context, hook: A, wording: b } : null, children: [
3574
+ ee && na(Me, ee),
3572
3575
  pe.body
3573
3576
  ] }),
3574
- de && /* @__PURE__ */ f(aa, { layout: k, gridMode: d, formats: p, wording: b })
3577
+ de && /* @__PURE__ */ f(ca, { layout: x, gridMode: d, formats: p, wording: b })
3575
3578
  ]
3576
3579
  }
3577
3580
  ) }),
3578
- pe.empty && /* @__PURE__ */ f(ua, { table: g }),
3579
- /* @__PURE__ */ f(fa, { table: g, blocks: G }),
3580
- /* @__PURE__ */ f(Il, { table: g }),
3581
+ pe.empty && /* @__PURE__ */ f(fa, { table: g }),
3582
+ /* @__PURE__ */ f(ha, { table: g, blocks: j }),
3583
+ /* @__PURE__ */ f(zl, { table: g }),
3581
3584
  /* @__PURE__ */ f(
3582
- da,
3585
+ ua,
3583
3586
  {
3584
3587
  table: g,
3585
3588
  blocks: ce,
3586
- onSticking: (U) => S((Se) => Se.start === U.start && Se.end === U.end ? Se : U),
3587
- pinnedKeys: B.filter((U) => Y[U.spec.id]).map((U) => U.key).join("|")
3589
+ onSticking: (U) => k((ke) => ke.start === U.start && ke.end === U.end ? ke : U),
3590
+ pinnedKeys: P.filter((U) => Y[U.spec.id]).map((U) => U.key).join("|")
3588
3591
  }
3589
3592
  ),
3590
3593
  d && /* @__PURE__ */ f(
3591
- _l,
3594
+ xl,
3592
3595
  {
3593
3596
  table: g,
3594
3597
  grid: y,
3595
3598
  lines: le,
3596
3599
  ids: oe,
3597
- editable: B.some((U) => U.spec.edit !== void 0) ? W?.editable : void 0,
3600
+ editable: P.some((U) => U.spec.edit !== void 0) ? W?.editable : void 0,
3598
3601
  outside: W?.outside
3599
3602
  }
3600
3603
  )
3601
3604
  ]
3602
3605
  }
3603
3606
  ),
3604
- e.rowAdding && !e.showsToolbar() && /* @__PURE__ */ f("div", { className: h.newRowBar, children: /* @__PURE__ */ f(so, { registry: e }) })
3607
+ e.rowAdding && !e.showsToolbar() && /* @__PURE__ */ f("div", { className: h.newRowBar, children: /* @__PURE__ */ f(io, { registry: e }) })
3605
3608
  ] });
3606
3609
  }
3607
- function ga(e) {
3610
+ function pa(e) {
3608
3611
  const t = typeof e.value == "string" ? e.value : void 0;
3609
3612
  let n = e.id ?? t;
3610
3613
  return n === void 0 && (X(`without-id:${e.label}`, `The column "${e.label}" has a computed value but no id. Its label serves as the id.`), n = e.label), e.children !== void 0 && typeof e.children != "function" && X(`children:${n}`, `The children of the column "${n}" are not a function and are passed over.`), {
@@ -3633,7 +3636,7 @@ function ga(e) {
3633
3636
  validate: e.validate
3634
3637
  };
3635
3638
  }
3636
- function Ke(e, t, n, o, r) {
3639
+ function Ge(e, t, n, o, r) {
3637
3640
  Z(
3638
3641
  () => () => {
3639
3642
  n(), e.commit();
@@ -3644,25 +3647,25 @@ function Ke(e, t, n, o, r) {
3644
3647
  o(), r && e.checkOrder(), e.commit();
3645
3648
  });
3646
3649
  }
3647
- function pa(e) {
3650
+ function ma(e) {
3648
3651
  function t(c) {
3649
- const a = be(), u = _e(Tt), d = ga(c);
3650
- return e.registerColumn(a, d), Ke(e, a, () => e.removeColumn(a), () => {
3652
+ const a = be(), u = _e(Rt), d = pa(c);
3653
+ return e.registerColumn(a, d), Ge(e, a, () => e.removeColumn(a), () => {
3651
3654
  e.ensureColumn(a, d);
3652
- }, !0), Kt && u && u.registry !== e && X(
3655
+ }, !0), Gt && u && u.registry !== e && X(
3653
3656
  `foreign:${d.id}`,
3654
3657
  `The column "${d.id}" comes from a different useTable call than the table it stands in. It reads the rows of its own hook.`
3655
3658
  ), /* @__PURE__ */ f("span", { hidden: !0, "data-umriss-column": a });
3656
3659
  }
3657
3660
  function n({ children: c }) {
3658
3661
  const a = be();
3659
- return e.registerDetail(a, c), Ke(e, a, () => e.removeDetail(a), () => {
3662
+ return e.registerDetail(a, c), Ge(e, a, () => e.removeDetail(a), () => {
3660
3663
  e.detail || e.registerDetail(a, c);
3661
3664
  }, !1), null;
3662
3665
  }
3663
3666
  function o({ children: c, pin: a = !0 }) {
3664
3667
  const u = be();
3665
- return e.registerActionGroup(u, a), Ke(e, u, () => e.removeActionGroup(u), () => {
3668
+ return e.registerActionGroup(u, a), Ge(e, u, () => e.removeActionGroup(u), () => {
3666
3669
  e.registerActionGroup(u, a);
3667
3670
  }, !1), /* @__PURE__ */ f(re, { children: c });
3668
3671
  }
@@ -3673,7 +3676,7 @@ function pa(e) {
3673
3676
  tone: c.tone ?? "default",
3674
3677
  onSelect: c.onSelect
3675
3678
  };
3676
- return e.registerAction(a, u), Ke(e, a, () => e.removeAction(a), () => {
3679
+ return e.registerAction(a, u), Ge(e, a, () => e.removeAction(a), () => {
3677
3680
  e.ensureAction(a, u);
3678
3681
  }, !0), /* @__PURE__ */ f("span", { hidden: !0, "data-umriss-action": a });
3679
3682
  }
@@ -3688,58 +3691,58 @@ function pa(e) {
3688
3691
  group: c.group,
3689
3692
  groupable: !0
3690
3693
  };
3691
- return e.registerGroupKey(a, b), Ke(e, a, () => e.removeGroupKey(a), () => {
3694
+ return e.registerGroupKey(a, b), Ge(e, a, () => e.removeGroupKey(a), () => {
3692
3695
  e.ensureGroupKey(a, b);
3693
3696
  }, !0), /* @__PURE__ */ f("span", { hidden: !0, "data-umriss-groupkey": a });
3694
3697
  }
3695
3698
  function i(c) {
3696
3699
  e.beginPass(), e.setStickyRowHeader(c.stickyRowHeader === !0), e.setTableGroupable(c.groupable !== !1), e.setRowAdding(c.grid === !0 && c.onRowAdd !== void 0), e.server && c.groupable === !0 && X("server-groupable", "`groupable` is passed over in server mode: the groups would be the page's, not the server's.");
3697
- const a = q(null), [u, d] = P(null);
3700
+ const a = q(null), [u, d] = I(null);
3698
3701
  Z(() => {
3699
3702
  e.children = a.current, e.checkOrder(), e.commit();
3700
3703
  });
3701
3704
  const b = H(() => ({ registry: e, footerTarget: u }), [u]);
3702
- return /* @__PURE__ */ f(Tt, { value: b, children: /* @__PURE__ */ j("div", { className: F(h.frame, c.className), children: [
3705
+ return /* @__PURE__ */ f(Rt, { value: b, children: /* @__PURE__ */ T("div", { className: B(h.frame, c.className), children: [
3703
3706
  /* @__PURE__ */ f("div", { ref: a, className: h.children, children: c.children }),
3704
- /* @__PURE__ */ f(ma, { registry: e }),
3705
- /* @__PURE__ */ f(ha, { registry: e, props: c }),
3707
+ /* @__PURE__ */ f(wa, { registry: e }),
3708
+ /* @__PURE__ */ f(ga, { registry: e, props: c }),
3706
3709
  /* @__PURE__ */ f("div", { ref: d, className: h.footerTarget })
3707
3710
  ] }) });
3708
3711
  }
3709
3712
  const l = { Table: i, Column: t, RowDetail: n, RowActions: o, Action: r, GroupBy: s };
3710
- return Vi(i, e), l;
3713
+ return Ii(i, e), l;
3711
3714
  }
3712
- function ma({ registry: e }) {
3713
- return st(e.subscribe, e.bodyVersion, e.bodyVersion), !e.hook || !e.needsOwnToolbar() ? null : /* @__PURE__ */ f(io, { registry: e, own: !0 });
3715
+ function wa({ registry: e }) {
3716
+ return st(e.subscribe, e.bodyVersion, e.bodyVersion), !e.hook || !e.needsOwnToolbar() ? null : /* @__PURE__ */ f(lo, { registry: e, own: !0 });
3714
3717
  }
3715
- const wa = "_verdict_1mxfd_6", ba = "_glyph_1mxfd_13", va = "_value_1mxfd_23", ya = "_excess_1mxfd_28", Ze = {
3716
- verdict: wa,
3717
- glyph: ba,
3718
- value: va,
3719
- excess: ya
3720
- }, kn = (e, t, n) => t === "percent" ? n.percent(e) : t === "count" ? n.count(e) : n.number(e, typeof t == "object" ? t.decimals : void 0), _a = (e, t) => e === "alarm" ? t.verdictAlarm : e === "warning" ? t.verdictWarning : e === "unknown" ? t.verdictUnknown : t.verdictOk, ka = {
3718
+ const ba = "_verdict_1mxfd_6", va = "_glyph_1mxfd_13", ya = "_value_1mxfd_23", _a = "_excess_1mxfd_28", Ze = {
3719
+ verdict: ba,
3720
+ glyph: va,
3721
+ value: ya,
3722
+ excess: _a
3723
+ }, xn = (e, t, n) => t === "percent" ? n.percent(e) : t === "count" ? n.count(e) : n.number(e, typeof t == "object" ? t.decimals : void 0), xa = (e, t) => e === "alarm" ? t.verdictAlarm : e === "warning" ? t.verdictWarning : e === "unknown" ? t.verdictUnknown : t.verdictOk, ka = {
3721
3724
  ok: "✓",
3722
3725
  unknown: "?",
3723
3726
  warning: "▲",
3724
3727
  alarm: "■"
3725
3728
  };
3726
3729
  function Sa({ reading: e, format: t }) {
3727
- const n = ke(), o = ie(), { measured: r, assessment: s } = e, i = _a(s.verdict, o);
3728
- return /* @__PURE__ */ j("span", { className: Ze.verdict, "data-verdict": s.verdict, title: i, children: [
3730
+ const n = xe(), o = ie(), { measured: r, assessment: s } = e, i = xa(s.verdict, o);
3731
+ return /* @__PURE__ */ T("span", { className: Ze.verdict, "data-verdict": s.verdict, title: i, children: [
3729
3732
  /* @__PURE__ */ f("span", { "aria-hidden": "true", className: Ze.glyph, children: ka[s.verdict] }),
3730
- /* @__PURE__ */ f("span", { className: Ze.value, children: r === null ? o.statAbsentValue : kn(r, t, n) }),
3731
- s.excess !== void 0 && /* @__PURE__ */ j("span", { className: Ze.excess, children: [
3733
+ /* @__PURE__ */ f("span", { className: Ze.value, children: r === null ? o.statAbsentValue : xn(r, t, n) }),
3734
+ s.excess !== void 0 && /* @__PURE__ */ T("span", { className: Ze.excess, children: [
3732
3735
  "+",
3733
- kn(s.excess, t, n)
3736
+ xn(s.excess, t, n)
3734
3737
  ] }),
3735
- /* @__PURE__ */ f(Re, { children: i })
3738
+ /* @__PURE__ */ f(Oe, { children: i })
3736
3739
  ] });
3737
3740
  }
3738
- const Ca = (e) => e.measured, xa = (e) => e.reduce(
3741
+ const Ca = (e) => e.measured, Aa = (e) => e.reduce(
3739
3742
  (t, n) => !t || _t(n.assessment.verdict) > _t(t.assessment.verdict) ? n : t,
3740
3743
  void 0
3741
3744
  );
3742
- function Aa(e) {
3745
+ function Na(e) {
3743
3746
  return function({ id: n, value: o, label: r, limits: s, format: i, sortBy: l = "verdict", width: c, resizable: a, pin: u, aggregate: d }) {
3744
3747
  const b = JSON.stringify(s), p = H(() => {
3745
3748
  const w = JSON.parse(b);
@@ -3747,7 +3750,7 @@ function Aa(e) {
3747
3750
  const v = typeof o == "string" ? g?.[o] : o(g);
3748
3751
  return {
3749
3752
  measured: typeof v == "number" && Number.isFinite(v) ? v : null,
3750
- assessment: Po(v, w)
3753
+ assessment: $o(v, w)
3751
3754
  };
3752
3755
  };
3753
3756
  }, [o, b]), m = fe(
@@ -3766,23 +3769,23 @@ function Aa(e) {
3766
3769
  value: p,
3767
3770
  sortValue: m,
3768
3771
  exportValue: Ca,
3769
- aggregate: d === "worst" ? xa : void 0,
3772
+ aggregate: d === "worst" ? Aa : void 0,
3770
3773
  children: (w) => /* @__PURE__ */ f(Sa, { reading: w, format: i })
3771
3774
  }
3772
3775
  );
3773
3776
  };
3774
3777
  }
3775
- const Na = [], Co = (e) => X(
3778
+ const Ta = [], Co = (e) => X(
3776
3779
  `condition-foreign:${e}`,
3777
3780
  `The condition for "${e}" is not of the kind of its filter and is passed over.`
3778
3781
  );
3779
- function xo(e, t, n) {
3780
- const o = e.columnById(t), r = o ? Oe(o.spec.filter) : void 0;
3782
+ function Ao(e, t, n) {
3783
+ const o = e.columnById(t), r = o ? Ee(o.spec.filter) : void 0;
3781
3784
  if (!r) return !1;
3782
- const s = Gn(r, n);
3785
+ const s = jn(r, n);
3783
3786
  return s === "foreign" && Co(t), s === "effective";
3784
3787
  }
3785
- function ja(e, t, n) {
3788
+ function Ra(e, t, n) {
3786
3789
  if (e.length === 0) return;
3787
3790
  let o = -1, r = [];
3788
3791
  return (s) => {
@@ -3795,8 +3798,8 @@ function ja(e, t, n) {
3795
3798
  continue;
3796
3799
  }
3797
3800
  const a = t.columnById(i);
3798
- a && xo(t, i, l) && r.push((u) => {
3799
- const d = Oe(a.spec.filter);
3801
+ a && Ao(t, i, l) && r.push((u) => {
3802
+ const d = Ee(a.spec.filter);
3800
3803
  return !d || Ci(d, a.read(u), l);
3801
3804
  });
3802
3805
  }
@@ -3804,25 +3807,25 @@ function ja(e, t, n) {
3804
3807
  return r.every((i) => i(s));
3805
3808
  };
3806
3809
  }
3807
- function Ta(e) {
3808
- const [t, n] = P({ fn: e });
3810
+ function Oa(e) {
3811
+ const [t, n] = I({ fn: e });
3809
3812
  return ot(t.fn, e) ? t.fn : (n({ fn: e }), e);
3810
3813
  }
3811
- function Ra(e, t) {
3812
- const n = H(() => t ? e.filter((i) => t(i)) : e, [e, t]), [o, r] = P(n);
3814
+ function Ea(e, t) {
3815
+ const n = H(() => t ? e.filter((i) => t(i)) : e, [e, t]), [o, r] = I(n);
3813
3816
  if (!t) return e;
3814
3817
  const s = o === n || o.length === n.length && o.every((i, l) => i === n[l]);
3815
3818
  return s || r(n), s ? o : n;
3816
3819
  }
3817
- const et = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : [...e], Oa = (e, t) => e.length === t.length && e.every((n, o) => n === t[o]);
3818
- function Sn(e) {
3820
+ const et = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : [...e], Ma = (e, t) => e.length === t.length && e.every((n, o) => n === t[o]);
3821
+ function kn(e) {
3819
3822
  const t = [], n = (o) => {
3820
3823
  for (const r of o)
3821
3824
  t.push(r.path), n(r.groups);
3822
3825
  };
3823
3826
  return n(e ?? []), t;
3824
3827
  }
3825
- function Ea(e, t, n) {
3828
+ function La(e, t, n) {
3826
3829
  const o = [], r = (s, i) => {
3827
3830
  if (!(i >= n))
3828
3831
  for (const l of s) {
@@ -3832,60 +3835,60 @@ function Ea(e, t, n) {
3832
3835
  };
3833
3836
  return r(e, 0), o;
3834
3837
  }
3835
- const Cn = (e, t) => e.size === t.size && [...e].every((n) => t.has(n));
3836
- function Ma(e, t) {
3837
- return { ...xt(e), ...t };
3838
+ const Sn = (e, t) => e.size === t.size && [...e].every((n) => t.has(n));
3839
+ function Fa(e, t) {
3840
+ return { ...Ct(e), ...t };
3838
3841
  }
3839
- function Pa(e, t) {
3840
- const [n] = P(() => new Bi()), [o] = P(() => {
3841
- const N = pa(n);
3842
- return { ...N, VerdictColumn: Aa(N.Column) };
3842
+ function $a(e, t) {
3843
+ const [n] = I(() => new Vi()), [o] = I(() => {
3844
+ const N = ma(n);
3845
+ return { ...N, VerdictColumn: Na(N.Column) };
3843
3846
  });
3844
3847
  st(n.subscribe, n.structureVersion, n.structureVersion);
3845
- const r = ke(), s = ie(), i = e, l = n.modelColumns(i, r), [c] = P(() => t.initialView), a = t.server === !0, u = t.server ? t.rowCount : 0, d = H(() => a ? { rowCount: u } : void 0, [a, u]);
3848
+ const r = xe(), s = ie(), i = e, l = n.modelColumns(i, r), [c] = I(() => t.initialView), a = t.server === !0, u = t.server ? t.rowCount : 0, d = H(() => a ? { rowCount: u } : void 0, [a, u]);
3846
3849
  n.setServer(a), a && (t.preFilter && X("server-prefilter", "`preFilter` is passed over in server mode: the server decides which rows the table has."), t.virtual && X("server-virtual", "`virtual` is passed over in server mode: the table pages instead."), (t.defaultGrouping !== void 0 || c?.grouping?.length) && X("server-grouping", "A grouping is passed over in server mode: the groups would be the page's, not the server's."));
3847
- const [b, p] = P(() => Object.entries(c?.conditions ?? {})), m = t.rowFilters ?? Na, w = m.map((N) => N.id).join("\0"), g = H(
3850
+ const [b, p] = I(() => Object.entries(c?.conditions ?? {})), m = t.rowFilters ?? Ta, w = m.map((N) => N.id).join("\0"), g = H(
3848
3851
  () => new Map(m.map((N) => [N.id, N])),
3849
3852
  // eslint-disable-next-line react-hooks/exhaustive-deps -- the filters by their ids; they are defined outside the component
3850
3853
  [w]
3851
3854
  );
3852
3855
  for (const N of m)
3853
3856
  n.columnById(N.id) && X(`row-filter-column:${N.id}`, `The row filter "${N.id}" has the id of a column; a condition under that id is the row filter's, and the column's filter cannot hold one of its own.`);
3854
- const v = H(() => ja(b, n, g), [b, n, g]), x = t.preFilter, y = Ra(i, a ? void 0 : x), [_, S] = P(
3857
+ const v = H(() => Ra(b, n, g), [b, n, g]), C = t.preFilter, y = Ea(i, a ? void 0 : C), [_, k] = I(
3855
3858
  () => c?.grouping ? [...c.grouping] : et(t.defaultGrouping)
3856
- ), [C, A] = P(() => c?.folded ?? []), [M, k] = P(() => c?.pinned ? { ...c.pinned } : null), R = Ta(t.rowKey), E = t.server ? void 0 : t.childRows, T = E !== void 0;
3857
- n.setTree(T);
3858
- const O = q({ children: E, key: R });
3859
+ ), [S, A] = I(() => c?.folded ?? []), [L, x] = I(() => c?.pinned ? { ...c.pinned } : null), O = Oa(t.rowKey), M = t.server ? void 0 : t.childRows, R = M !== void 0;
3860
+ n.setTree(R);
3861
+ const E = q({ children: M, key: O });
3859
3862
  Z(() => {
3860
- O.current = { children: E, key: R };
3863
+ E.current = { children: M, key: O };
3861
3864
  });
3862
- const [D] = P(() => ({
3863
- key: (N) => O.current.key(N),
3864
- children: (N) => O.current.children?.(N),
3865
+ const [D] = I(() => ({
3866
+ key: (N) => E.current.key(N),
3867
+ children: (N) => E.current.children?.(N),
3865
3868
  label: () => ""
3866
- })), [I] = P(() => {
3869
+ })), [$] = I(() => {
3867
3870
  const N = t.server ? void 0 : t.defaultBranches;
3868
- return !T || N === void 0 ? [] : typeof N == "number" ? Ea(i, D, N) : [...N];
3869
- }), [B, z] = P(() => c?.branches ?? I), Y = H(() => T ? new Set(Io(i, D)) : /* @__PURE__ */ new Set(), [T, i, D]), ce = T ? B.filter((N) => Y.has(N)) : [];
3871
+ return !R || N === void 0 ? [] : typeof N == "number" ? La(i, D, N) : [...N];
3872
+ }), [P, K] = I(() => c?.branches ?? $), Y = H(() => R ? new Set(zo(i, D)) : /* @__PURE__ */ new Set(), [R, i, D]), ce = R ? P.filter((N) => Y.has(N)) : [];
3870
3873
  H(() => {
3871
- if (!T) return;
3872
- const N = $o(i, D);
3874
+ if (!R) return;
3875
+ const N = Ko(i, D);
3873
3876
  N !== null && X(`tree-duplicate:${N}`, `The row key "${N}" occurs twice in the tree: its fold and its selection would act on both rows.`);
3874
- }, [T, i, D]), T && (t.defaultGrouping !== void 0 || c?.grouping?.length) && X("tree-grouping", "A grouping is passed over with `childRows`: tree rows and grouping both build levels.");
3875
- const G = n.orderedColumns().length + n.groupKeys.entries.size > 0, ne = a || T ? [] : G ? n.effectiveGrouping(_, i) : _.slice(0, zt), de = ne.join("|"), le = H(() => new Set(C), [C]), ee = ne.length ? n.groupingModel(ne, i) : null, oe = H(
3877
+ }, [R, i, D]), R && (t.defaultGrouping !== void 0 || c?.grouping?.length) && X("tree-grouping", "A grouping is passed over with `childRows`: tree rows and grouping both build levels.");
3878
+ const j = n.orderedColumns().length + n.groupKeys.entries.size > 0, ne = a || R ? [] : j ? n.effectiveGrouping(_, i) : _.slice(0, Kt), de = ne.join("|"), le = H(() => new Set(S), [S]), ee = ne.length ? n.groupingModel(ne, i) : null, oe = H(
3876
3879
  () => ee && ee.levels.length ? { ...ee, folded: le, compareText: r.compareText } : void 0,
3877
3880
  // eslint-disable-next-line react-hooks/exhaustive-deps -- the model's identity carries the ids and the columns
3878
3881
  [ee, le, r.compareText, de]
3879
3882
  ), W = ce.join("\0"), ge = H(
3880
- () => T ? { key: R, children: D.children, open: new Set(ce), admit: x } : void 0,
3883
+ () => R ? { key: O, children: D.children, open: new Set(ce), admit: C } : void 0,
3881
3884
  /* ponytail: the pre-filter is read through the roots it admits - a new
3882
3885
  pre-filter that only drops children takes hold with the next change of
3883
3886
  rows or branches. Compare its admitted children, as useAdmitted does
3884
3887
  the roots, if a caller needs that live. */
3885
3888
  // eslint-disable-next-line react-hooks/exhaustive-deps -- the open keys by value; the rows the pre-filter admits stand for it
3886
- [T, W, y, D]
3887
- ), L = Xo(y, l, {
3888
- rowKey: R,
3889
+ [R, W, y, D]
3890
+ ), F = Qo(y, l, {
3891
+ rowKey: O,
3889
3892
  pageSize: t.pageSize,
3890
3893
  defaultSort: t.defaultSort,
3891
3894
  filter: v,
@@ -3894,156 +3897,156 @@ function Pa(e, t) {
3894
3897
  grouping: oe,
3895
3898
  server: d,
3896
3899
  tree: ge
3897
- }), { setPage: ae } = L, Ae = fe(
3898
- (N, $) => {
3899
- const K = typeof N == "string" ? N : N.id;
3900
- let $e = $ == null;
3901
- const on = g.has(K);
3900
+ }), { setPage: ae } = F, Ae = fe(
3901
+ (N, z) => {
3902
+ const G = typeof N == "string" ? N : N.id;
3903
+ let ze = z == null;
3904
+ const on = g.has(G);
3902
3905
  if (typeof N != "string" && !on) {
3903
3906
  X(
3904
- `row-filter-unknown:${K}`,
3905
- `The row filter "${K}" is not among the table's \`rowFilters\`; its condition is passed over.`
3907
+ `row-filter-unknown:${G}`,
3908
+ `The row filter "${G}" is not among the table's \`rowFilters\`; its condition is passed over.`
3906
3909
  );
3907
3910
  return;
3908
3911
  }
3909
- if (!$e && !on && n.orderedColumns().length > 0) {
3910
- const ve = n.columnById(K), je = ve ? Oe(ve.spec.filter) : void 0;
3911
- if (!je) {
3912
+ if (!ze && !on && n.orderedColumns().length > 0) {
3913
+ const ve = n.columnById(G), Te = ve ? Ee(ve.spec.filter) : void 0;
3914
+ if (!Te) {
3912
3915
  X(
3913
- `condition-without-filter:${K}`,
3914
- ve ? `The column "${K}" has no filter; its condition is passed over.` : `No column is called "${K}"; its condition is passed over.`
3916
+ `condition-without-filter:${G}`,
3917
+ ve ? `The column "${G}" has no filter; its condition is passed over.` : `No column is called "${G}"; its condition is passed over.`
3915
3918
  );
3916
3919
  return;
3917
3920
  }
3918
- const Te = Gn(je, $);
3919
- if (Te === "foreign") {
3920
- Co(K);
3921
+ const Re = jn(Te, z);
3922
+ if (Re === "foreign") {
3923
+ Co(G);
3921
3924
  return;
3922
3925
  }
3923
- $e = Te === "empty";
3926
+ ze = Re === "empty";
3924
3927
  }
3925
3928
  p((ve) => {
3926
- const je = ve.findIndex(([Te]) => Te === K);
3927
- return $e ? je === -1 ? ve : ve.filter((Te, gt) => gt !== je) : je === -1 ? [...ve, [K, $]] : ve.map((Te, gt) => gt === je ? [K, $] : Te);
3929
+ const Te = ve.findIndex(([Re]) => Re === G);
3930
+ return ze ? Te === -1 ? ve : ve.filter((Re, gt) => gt !== Te) : Te === -1 ? [...ve, [G, z]] : ve.map((Re, gt) => gt === Te ? [G, z] : Re);
3928
3931
  }), ae(1);
3929
3932
  },
3930
3933
  [n, ae, g]
3931
- ), ue = new Set(n.orderedColumns().map((N) => N.spec.id)), [Ne, Ee] = P(() => /* @__PURE__ */ new Set());
3932
- if (!Cn(Ne, ue)) {
3933
- const N = new Set([...Ne].filter((K) => !ue.has(K)));
3934
- Ee(ue);
3935
- const $ = (K) => N.has(K) && !g.has(K);
3936
- b.some(([K]) => $(K)) && p((K) => K.filter(([$e]) => !$($e)));
3934
+ ), ue = new Set(n.orderedColumns().map((N) => N.spec.id)), [Ne, Me] = I(() => /* @__PURE__ */ new Set());
3935
+ if (!Sn(Ne, ue)) {
3936
+ const N = new Set([...Ne].filter((G) => !ue.has(G)));
3937
+ Me(ue);
3938
+ const z = (G) => N.has(G) && !g.has(G);
3939
+ b.some(([G]) => z(G)) && p((G) => G.filter(([ze]) => !z(ze)));
3937
3940
  }
3938
- const pe = ue.size === 0 ? b : b.filter(([N, $]) => g.has(N) || xo(n, N, $)), U = ar(L.view, ue), Se = pe.length > 0 ? { ...U, conditions: Object.fromEntries(pe) } : U, Me = ue.size === 0 ? L.sort : L.sort.filter((N) => ue.has(N.column)), Pe = a || T ? [] : G ? n.effectiveGrouping(et(t.defaultGrouping), i) : et(t.defaultGrouping), Le = L.groups ? Go(L.groups, C) : G ? [] : [...C], Je = n.declaredPins(), V = nr(M, Je, ue), J = {
3939
- ...Se,
3940
- ...Oa(ne, Pe) ? {} : { grouping: ne },
3941
- ...Le.length ? { folded: Le } : {},
3941
+ const pe = ue.size === 0 ? b : b.filter(([N, z]) => g.has(N) || Ao(n, N, z)), U = cr(F.view, ue), ke = pe.length > 0 ? { ...U, conditions: Object.fromEntries(pe) } : U, Le = ue.size === 0 ? F.sort : F.sort.filter((N) => ue.has(N.column)), Ie = a || R ? [] : j ? n.effectiveGrouping(et(t.defaultGrouping), i) : et(t.defaultGrouping), Fe = F.groups ? Ho(F.groups, S) : j ? [] : [...S], Je = n.declaredPins(), V = or(L, Je, ue), J = {
3942
+ ...ke,
3943
+ ...Ma(ne, Ie) ? {} : { grouping: ne },
3944
+ ...Fe.length ? { folded: Fe } : {},
3942
3945
  ...V ? { pinned: V } : {},
3943
- ...T && !Cn(new Set(ce), new Set(I.filter((N) => Y.has(N)))) ? { branches: ce } : {}
3944
- }, te = (N, $) => k((K) => er(K ?? n.declaredPins(), N, $)), [me, we] = P(0), Ao = (N) => {
3945
- L.restart(N), p(Object.entries(N.conditions ?? {})), S(N.grouping ? [...N.grouping] : et(t.defaultGrouping)), A(N.folded ?? []), k(N.pinned ? { ...N.pinned } : null), z(N.branches ?? I), we(($) => $ + 1);
3946
- }, No = (N) => {
3947
- S([...N]), ae(1);
3948
- }, jo = (N) => {
3949
- Sn(L.groups).includes(N) && (n.noteFocusBeforeFold(), A(($) => $.includes(N) ? $.filter((K) => K !== N) : [...$, N]));
3950
- }, Jt = !a && !!t.virtual, ut = !T && n.paginates() || Jt, ft = t.selection ?? L.selection, Xe = lr(J), Xt = q(Xe), Qt = q(0);
3951
- xe(() => {
3946
+ ...R && !Sn(new Set(ce), new Set($.filter((N) => Y.has(N)))) ? { branches: ce } : {}
3947
+ }, te = (N, z) => x((G) => tr(G ?? n.declaredPins(), N, z)), [me, we] = I(0), No = (N) => {
3948
+ F.restart(N), p(Object.entries(N.conditions ?? {})), k(N.grouping ? [...N.grouping] : et(t.defaultGrouping)), A(N.folded ?? []), x(N.pinned ? { ...N.pinned } : null), K(N.branches ?? $), we((z) => z + 1);
3949
+ }, To = (N) => {
3950
+ k([...N]), ae(1);
3951
+ }, Ro = (N) => {
3952
+ kn(F.groups).includes(N) && (n.noteFocusBeforeFold(), A((z) => z.includes(N) ? z.filter((G) => G !== N) : [...z, N]));
3953
+ }, Jt = !a && !!t.virtual, ut = !R && n.paginates() || Jt, ft = t.selection ?? F.selection, Xe = ar(J), Xt = q(Xe), Qt = q(0);
3954
+ Ce(() => {
3952
3955
  const N = Qt.current !== me;
3953
3956
  Qt.current = me, Xt.current !== Xe && (Xt.current = Xe, N || t.onViewChange?.(J));
3954
3957
  }, [Xe, me]);
3955
3958
  const Zt = {
3956
- search: L.search,
3959
+ search: F.search,
3957
3960
  conditions: Object.fromEntries(pe),
3958
- sort: Me,
3959
- page: L.page,
3960
- pageSize: L.pageSize
3961
- }, ht = a ? ir(Zt) : "", en = q(null);
3962
- xe(() => {
3961
+ sort: Le,
3962
+ page: F.page,
3963
+ pageSize: F.pageSize
3964
+ }, ht = a ? lr(Zt) : "", en = q(null);
3965
+ Ce(() => {
3963
3966
  !a || en.current === ht || (en.current = ht, t.onRequest?.(Zt));
3964
3967
  }, [ht]);
3965
- const [Ie] = P(() => /* @__PURE__ */ new Map());
3968
+ const [$e] = I(() => /* @__PURE__ */ new Map());
3966
3969
  let tn;
3967
3970
  if (a) {
3968
3971
  const N = /* @__PURE__ */ new Set();
3969
- for (const $ of i) {
3970
- const K = R($);
3971
- N.add(K), Ie.set(K, $);
3972
+ for (const z of i) {
3973
+ const G = O(z);
3974
+ N.add(G), $e.set(G, z);
3972
3975
  }
3973
- for (const $ of [...Ie.keys()])
3974
- !N.has($) && !ft.isSelected($) && Ie.delete($);
3975
- tn = [...ft.selected].filter(($) => Ie.has($)).map(($) => Ie.get($));
3976
+ for (const z of [...$e.keys()])
3977
+ !N.has(z) && !ft.isSelected(z) && $e.delete(z);
3978
+ tn = [...ft.selected].filter((z) => $e.has(z)).map((z) => $e.get(z));
3976
3979
  }
3977
3980
  const nn = {
3978
3981
  rows: e,
3979
- filtered: L.filtered,
3980
- visible: ut || T ? L.visible : L.filtered,
3981
- page: ut ? L.page : 1,
3982
- pageCount: ut ? L.pageCount : 1,
3983
- pageSize: L.pageSize,
3984
- setPage: L.setPage,
3985
- setPageSize: L.setPageSize,
3986
- search: L.search,
3987
- setSearch: L.setSearch,
3988
- sort: Me,
3989
- toggleSort: L.toggleSort,
3990
- hidden: L.hidden,
3991
- toggleColumn: L.toggleColumn,
3992
- order: L.order,
3993
- setOrder: L.setOrder,
3994
- pinned: M ?? Je,
3982
+ filtered: F.filtered,
3983
+ visible: ut || R ? F.visible : F.filtered,
3984
+ page: ut ? F.page : 1,
3985
+ pageCount: ut ? F.pageCount : 1,
3986
+ pageSize: F.pageSize,
3987
+ setPage: F.setPage,
3988
+ setPageSize: F.setPageSize,
3989
+ search: F.search,
3990
+ setSearch: F.setSearch,
3991
+ sort: Le,
3992
+ toggleSort: F.toggleSort,
3993
+ hidden: F.hidden,
3994
+ toggleColumn: F.toggleColumn,
3995
+ order: F.order,
3996
+ setOrder: F.setOrder,
3997
+ pinned: L ?? Je,
3995
3998
  setPin: te,
3996
- widths: Ma(l, L.widths),
3997
- setWidth: L.setWidth,
3998
- expanded: L.expanded,
3999
- toggleRow: L.toggleRow,
3999
+ widths: Fa(l, F.widths),
4000
+ setWidth: F.setWidth,
4001
+ expanded: F.expanded,
4002
+ toggleRow: F.toggleRow,
4000
4003
  filter: Object.fromEntries(pe),
4001
4004
  setFilter: Ae,
4002
- conditionOf: (N) => pe.find(([$]) => $ === N.id)?.[1] ?? null,
4005
+ conditionOf: (N) => pe.find(([z]) => z === N.id)?.[1] ?? null,
4003
4006
  selection: ft,
4004
4007
  view: J,
4005
4008
  grouping: ne,
4006
- setGrouping: No,
4007
- setView: Ao,
4008
- folded: Le,
4009
- toggleFold: jo,
4009
+ setGrouping: To,
4010
+ setView: No,
4011
+ folded: Fe,
4012
+ toggleFold: Ro,
4010
4013
  foldAll: () => {
4011
- n.noteFocusBeforeFold(), A(Sn(L.groups));
4014
+ n.noteFocusBeforeFold(), A(kn(F.groups));
4012
4015
  },
4013
4016
  unfoldAll: () => {
4014
4017
  n.noteFocusBeforeFold(), A([]);
4015
4018
  },
4016
4019
  branches: ce,
4017
4020
  toggleBranch: (N) => {
4018
- Y.has(N) && z(($) => $.includes(N) ? $.filter((K) => K !== N) : [...$, N]);
4021
+ Y.has(N) && K((z) => z.includes(N) ? z.filter((G) => G !== N) : [...z, N]);
4019
4022
  },
4020
- unfoldAllBranches: () => z([...Y]),
4021
- foldAllBranches: () => z([]),
4022
- asCsv: () => Gi(n, s.levelColumn, r, s),
4023
- selectionAsText: () => to(n, r, s),
4023
+ unfoldAllBranches: () => K([...Y]),
4024
+ foldAllBranches: () => K([]),
4025
+ asCsv: () => Hi(n, s.levelColumn, r, s),
4026
+ selectionAsText: () => no(n, r, s),
4024
4027
  virtual: Jt,
4025
- rowCount: a ? u : L.filtered.length,
4028
+ rowCount: a ? u : F.filtered.length,
4026
4029
  server: a
4027
4030
  };
4028
4031
  return n.setHook({
4029
4032
  rows: i,
4030
4033
  admitted: y,
4031
4034
  modelColumns: l,
4032
- tableState: L,
4035
+ tableState: F,
4033
4036
  filter: v,
4034
4037
  grouping: oe,
4035
4038
  tree: ge,
4036
4039
  folded: le,
4037
4040
  publicSnapshot: nn,
4038
- rowKey: R,
4041
+ rowKey: O,
4039
4042
  formats: r,
4040
- pins: M,
4043
+ pins: L,
4041
4044
  filterOptions: a ? t.filterOptions : void 0,
4042
4045
  selectedRows: tn,
4043
4046
  rowFilters: g
4044
4047
  }), { ...nn, ...o };
4045
4048
  }
4046
- function Ia(e) {
4049
+ function za(e) {
4047
4050
  return e;
4048
4051
  }
4049
4052
  function Ut(e, t) {
@@ -4055,22 +4058,22 @@ function Ut(e, t) {
4055
4058
  };
4056
4059
  }, [e, t, n]);
4057
4060
  }
4058
- function $a({ children: e, className: t, size: n = "sm", of: o }) {
4061
+ function Ka({ children: e, className: t, size: n = "sm", of: o }) {
4059
4062
  const r = Ye(o);
4060
4063
  Ut(r?.registry, "toolbar");
4061
4064
  const s = r?.registry;
4062
- return /* @__PURE__ */ f(io, { registry: s ?? null, className: t, size: n, children: e });
4065
+ return /* @__PURE__ */ f(lo, { registry: s ?? null, className: t, size: n, children: e });
4063
4066
  }
4064
- function za({ placeholder: e, "aria-label": t, className: n, size: o, grow: r, of: s }) {
4067
+ function Ga({ placeholder: e, "aria-label": t, className: n, size: o, grow: r, of: s }) {
4065
4068
  const i = Ye(s), l = at(o), c = ie();
4066
4069
  if (Ut(i?.registry, "search"), !i) return null;
4067
4070
  const { snapshot: a } = i;
4068
4071
  return /* @__PURE__ */ f(
4069
- Rn,
4072
+ On,
4070
4073
  {
4071
4074
  size: l,
4072
4075
  type: "search",
4073
- className: F(r && h.searchGrow, n),
4076
+ className: B(r && h.searchGrow, n),
4074
4077
  value: a.search,
4075
4078
  onChange: (u) => a.setSearch(u.target.value),
4076
4079
  clearable: !0,
@@ -4080,40 +4083,40 @@ function za({ placeholder: e, "aria-label": t, className: n, size: o, grow: r, o
4080
4083
  }
4081
4084
  );
4082
4085
  }
4083
- function Ka({ size: e, of: t }) {
4084
- const n = Ye(t), o = at(e), r = ie(), [s, i] = P(!1), l = q(null), c = q(null), a = be(), [u, d] = P(null);
4086
+ function ja({ size: e, of: t }) {
4087
+ const n = Ye(t), o = at(e), r = ie(), [s, i] = I(!1), l = q(null), c = q(null), a = be(), [u, d] = I(null);
4085
4088
  if (Z(() => {
4086
4089
  if (!u || !c.current) return;
4087
4090
  const _ = Array.from(c.current.children).find(
4088
4091
  (A) => A.dataset.column === u.id
4089
- ), S = _?.querySelector(u.key), C = u.otherwise ? _?.querySelector(u.otherwise) : void 0;
4090
- (S && !S.disabled ? S : C)?.focus();
4092
+ ), k = _?.querySelector(u.key), S = u.otherwise ? _?.querySelector(u.otherwise) : void 0;
4093
+ (k && !k.disabled ? k : S)?.focus();
4091
4094
  }, [u]), !n) return null;
4092
- const { registry: b, snapshot: p } = n, m = b.hook, w = b.inPinOrder(Dn(b.modelColumns(m.rows, m.formats), p.order)), g = b.pins(), v = (_, S) => {
4093
- const C = w[_ + S];
4094
- return C !== void 0 && g[C.id] === g[w[_].id];
4095
- }, x = (_, S) => {
4096
- const C = w.map((R) => R.id), A = _ + S;
4097
- if (!v(_, S)) return;
4098
- [C[_], C[A]] = [C[A], C[_]], p.setOrder(C);
4099
- const [M, k] = S < 0 ? ["forward", "backward"] : ["backward", "forward"];
4100
- d({ id: w[_].id, key: `[data-direction="${M}"]`, otherwise: `[data-direction="${k}"]` });
4101
- }, y = (_, S, C) => {
4102
- const A = g[_] === C;
4103
- return /* @__PURE__ */ f(tt, { content: A ? r.unpinHint : C === "start" ? r.pinToStartHint : r.pinToEndHint, children: /* @__PURE__ */ f(
4095
+ const { registry: b, snapshot: p } = n, m = b.hook, w = b.inPinOrder(Dn(b.modelColumns(m.rows, m.formats), p.order)), g = b.pins(), v = (_, k) => {
4096
+ const S = w[_ + k];
4097
+ return S !== void 0 && g[S.id] === g[w[_].id];
4098
+ }, C = (_, k) => {
4099
+ const S = w.map((O) => O.id), A = _ + k;
4100
+ if (!v(_, k)) return;
4101
+ [S[_], S[A]] = [S[A], S[_]], p.setOrder(S);
4102
+ const [L, x] = k < 0 ? ["forward", "backward"] : ["backward", "forward"];
4103
+ d({ id: w[_].id, key: `[data-direction="${L}"]`, otherwise: `[data-direction="${x}"]` });
4104
+ }, y = (_, k, S) => {
4105
+ const A = g[_] === S;
4106
+ return /* @__PURE__ */ f(tt, { content: A ? r.unpinHint : S === "start" ? r.pinToStartHint : r.pinToEndHint, children: /* @__PURE__ */ f(
4104
4107
  "button",
4105
4108
  {
4106
4109
  type: "button",
4107
- className: F(h.move, A && h.pinOn),
4108
- "data-pin": C,
4109
- "aria-label": A ? r.unpinColumn(S) : C === "start" ? r.pinColumnToStart(S) : r.pinColumnToEnd(S),
4110
+ className: B(h.move, A && h.pinOn),
4111
+ "data-pin": S,
4112
+ "aria-label": A ? r.unpinColumn(k) : S === "start" ? r.pinColumnToStart(k) : r.pinColumnToEnd(k),
4110
4113
  onClick: () => {
4111
- p.setPin(_, A ? null : C), d({ id: _, key: `[data-pin="${C}"]` });
4114
+ p.setPin(_, A ? null : S), d({ id: _, key: `[data-pin="${S}"]` });
4112
4115
  },
4113
4116
  children: /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ f(
4114
4117
  "path",
4115
4118
  {
4116
- d: C === "start" ? "M2 1.5v7M8.5 5H4.5M6 3.5 4.5 5 6 6.5" : "M8 1.5v7M1.5 5h4M4 3.5 5.5 5 4 6.5",
4119
+ d: S === "start" ? "M2 1.5v7M8.5 5H4.5M6 3.5 4.5 5 6 6.5" : "M8 1.5v7M1.5 5h4M4 3.5 5.5 5 4 6.5",
4117
4120
  fill: "none",
4118
4121
  stroke: "currentColor",
4119
4122
  strokeWidth: "1.4",
@@ -4124,7 +4127,7 @@ function Ka({ size: e, of: t }) {
4124
4127
  }
4125
4128
  ) });
4126
4129
  };
4127
- return /* @__PURE__ */ j(re, { children: [
4130
+ return /* @__PURE__ */ T(re, { children: [
4128
4131
  /* @__PURE__ */ f(
4129
4132
  Q,
4130
4133
  {
@@ -4137,7 +4140,7 @@ function Ka({ size: e, of: t }) {
4137
4140
  children: r.columns
4138
4141
  }
4139
4142
  ),
4140
- /* @__PURE__ */ j(
4143
+ /* @__PURE__ */ T(
4141
4144
  it,
4142
4145
  {
4143
4146
  open: s,
@@ -4149,13 +4152,13 @@ function Ka({ size: e, of: t }) {
4149
4152
  id: a,
4150
4153
  className: h.columnsPanel,
4151
4154
  children: [
4152
- /* @__PURE__ */ f("ul", { ref: c, className: h.columnsList, "aria-label": r.arrangeColumns, children: w.map((_, S) => {
4153
- const C = _.label ?? _.id;
4154
- return /* @__PURE__ */ j("li", { className: h.columnsEntry, "data-column": _.id, children: [
4155
+ /* @__PURE__ */ f("ul", { ref: c, className: h.columnsList, "aria-label": r.arrangeColumns, children: w.map((_, k) => {
4156
+ const S = _.label ?? _.id;
4157
+ return /* @__PURE__ */ T("li", { className: h.columnsEntry, "data-column": _.id, children: [
4155
4158
  /* @__PURE__ */ f(
4156
4159
  We,
4157
4160
  {
4158
- label: C,
4161
+ label: S,
4159
4162
  checked: !p.hidden.includes(_.id),
4160
4163
  disabled: _.hideable === !1,
4161
4164
  onChange: () => p.toggleColumn(_.id)
@@ -4167,9 +4170,9 @@ function Ka({ size: e, of: t }) {
4167
4170
  type: "button",
4168
4171
  className: h.move,
4169
4172
  "data-direction": "forward",
4170
- "aria-label": r.columnForward(C),
4171
- disabled: !v(S, -1),
4172
- onClick: () => x(S, -1),
4173
+ "aria-label": r.columnForward(S),
4174
+ disabled: !v(k, -1),
4175
+ onClick: () => C(k, -1),
4173
4176
  children: /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ f("path", { d: "M2 6.5 5 3.5l3 3", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
4174
4177
  }
4175
4178
  ) }),
@@ -4179,24 +4182,24 @@ function Ka({ size: e, of: t }) {
4179
4182
  type: "button",
4180
4183
  className: h.move,
4181
4184
  "data-direction": "backward",
4182
- "aria-label": r.columnBackward(C),
4183
- disabled: !v(S, 1),
4184
- onClick: () => x(S, 1),
4185
+ "aria-label": r.columnBackward(S),
4186
+ disabled: !v(k, 1),
4187
+ onClick: () => C(k, 1),
4185
4188
  children: /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ f("path", { d: "M2 3.5 5 6.5l3-3", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
4186
4189
  }
4187
4190
  ) }),
4188
- y(_.id, C, "start"),
4189
- y(_.id, C, "end")
4191
+ y(_.id, S, "start"),
4192
+ y(_.id, S, "end")
4190
4193
  ] }, _.id);
4191
4194
  }) }),
4192
- /* @__PURE__ */ f(Ji, { registry: b, hook: m }),
4193
- /* @__PURE__ */ f(Xi, { registry: b, hook: m })
4195
+ /* @__PURE__ */ f(Xi, { registry: b, hook: m }),
4196
+ /* @__PURE__ */ f(Qi, { registry: b, hook: m })
4194
4197
  ]
4195
4198
  }
4196
4199
  )
4197
4200
  ] });
4198
4201
  }
4199
- function Ga({ filename: e, onExport: t, size: n, of: o }) {
4202
+ function Ha({ filename: e, onExport: t, size: n, of: o }) {
4200
4203
  const r = Ye(o), s = at(n), i = ie();
4201
4204
  if (!r) return null;
4202
4205
  const { snapshot: l } = r;
@@ -4210,16 +4213,16 @@ function Ga({ filename: e, onExport: t, size: n, of: o }) {
4210
4213
  d.href = u, d.download = e ?? i.exportFileName, d.click(), setTimeout(() => URL.revokeObjectURL(u), 1e4);
4211
4214
  }, children: l.server ? i.exportPageLabel : i.exportLabel });
4212
4215
  }
4213
- function Ha({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
4214
- const o = Ye(n), r = ie(), s = ke();
4216
+ function Wa({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
4217
+ const o = Ye(n), r = ie(), s = xe();
4215
4218
  if (Ut(o?.registry, "pagination"), o?.registry.tree && X("tree-pagination", "`Pagination` is passed over with `childRows`: a page cut through a branch tears rows from their parent. A large tree uses `virtual`."), !o || o.snapshot.virtual || o.registry.tree) return null;
4216
- const { snapshot: i } = o, l = i.rowCount, c = e.includes(i.pageSize) ? e : [...e, i.pageSize].sort((u, d) => u - d), a = /* @__PURE__ */ j("nav", { "aria-label": r.pagination, className: F(h.pagination, t), children: [
4219
+ const { snapshot: i } = o, l = i.rowCount, c = e.includes(i.pageSize) ? e : [...e, i.pageSize].sort((u, d) => u - d), a = /* @__PURE__ */ T("nav", { "aria-label": r.pagination, className: B(h.pagination, t), children: [
4217
4220
  /* @__PURE__ */ f("span", { children: r.entries(l, s.count(l)) }),
4218
- /* @__PURE__ */ j("div", { className: h.paginationControls, children: [
4219
- /* @__PURE__ */ j("label", { className: h.pageSize, children: [
4221
+ /* @__PURE__ */ T("div", { className: h.paginationControls, children: [
4222
+ /* @__PURE__ */ T("label", { className: h.pageSize, children: [
4220
4223
  r.rows,
4221
4224
  /* @__PURE__ */ f(
4222
- Tn,
4225
+ Rn,
4223
4226
  {
4224
4227
  size: "sm",
4225
4228
  chars: Math.max(...c.map((u) => String(u).length)),
@@ -4230,7 +4233,7 @@ function Ha({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
4230
4233
  }
4231
4234
  )
4232
4235
  ] }),
4233
- /* @__PURE__ */ j("span", { className: h.pageSteps, children: [
4236
+ /* @__PURE__ */ T("span", { className: h.pageSteps, children: [
4234
4237
  /* @__PURE__ */ f("span", { className: h.paginationStatus, children: r.pageOfPages(i.page, i.pageCount, {
4235
4238
  page: s.count(i.page),
4236
4239
  total: s.count(i.pageCount)
@@ -4240,20 +4243,20 @@ function Ha({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
4240
4243
  ] })
4241
4244
  ] })
4242
4245
  ] });
4243
- return o.inside ? o.footerTarget ? On(a, o.footerTarget) : null : a;
4246
+ return o.inside ? o.footerTarget ? En(a, o.footerTarget) : null : a;
4244
4247
  }
4245
- function Wa(e) {
4248
+ function qa(e) {
4246
4249
  return e;
4247
4250
  }
4248
4251
  export {
4249
- Ka as ColumnMenu,
4250
- Ga as Export,
4251
- Ha as Pagination,
4252
- za as Search,
4253
- $a as Toolbar,
4254
- Ia as column,
4255
- Va as columnFilter,
4256
- Wa as rowFilter,
4257
- Pa as useTable,
4258
- zo as useTableSelection
4252
+ ja as ColumnMenu,
4253
+ Ha as Export,
4254
+ Wa as Pagination,
4255
+ Ga as Search,
4256
+ Ka as Toolbar,
4257
+ za as column,
4258
+ Ia as columnFilter,
4259
+ qa as rowFilter,
4260
+ $a as useTable,
4261
+ Go as useTableSelection
4259
4262
  };