@fileflow/sdk 0.1.16 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import { jsx as g, jsxs as v, Fragment as ee } from "react/jsx-runtime";
2
- import * as ve from "react";
3
- import ut, { useCallback as _e, useState as K, useMemo as ke, useEffect as Le } from "react";
4
- import { h as A, j as ft, k as dt, X as re, m as b, U as je, n as Fe, T as we, q as gt, p as $e, o as He, t as ct, d as pt, V as ze, g as Y, S as ae, L as Ae } from "./index-D7j5dhUO.mjs";
1
+ import { jsx as g, jsxs as v, Fragment as oe } from "react/jsx-runtime";
2
+ import * as Se from "react";
3
+ import ut, { useCallback as Me, useState as Y, useMemo as ze, useEffect as Ae } from "react";
4
+ import { h as G, j as ft, k as dt, X as se, m as j, U as Xe, n as Ie, T as Re, q as gt, p as Ve, o as Ge, t as ct, d as pt, V as Oe, g as ee, S as de, L as be } from "./index-DnkwOjwi.mjs";
5
5
  /**
6
6
  * @license lucide-react v0.563.0 - ISC
7
7
  *
@@ -11,21 +11,21 @@ import { h as A, j as ft, k as dt, X as re, m as b, U as je, n as Fe, T as we, q
11
11
  const mt = [
12
12
  ["path", { d: "M5 12h14", key: "1ays0h" }],
13
13
  ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
14
- ], ht = A("arrow-right", mt);
14
+ ], ht = G("arrow-right", mt);
15
15
  /**
16
16
  * @license lucide-react v0.563.0 - ISC
17
17
  *
18
18
  * This source code is licensed under the ISC license.
19
19
  * See the LICENSE file in the root directory of this source tree.
20
20
  */
21
- const vt = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], wt = A("check", vt);
21
+ const vt = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], wt = G("check", vt);
22
22
  /**
23
23
  * @license lucide-react v0.563.0 - ISC
24
24
  *
25
25
  * This source code is licensed under the ISC license.
26
26
  * See the LICENSE file in the root directory of this source tree.
27
27
  */
28
- const Ct = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], St = A("chevron-left", Ct);
28
+ const Ct = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], St = G("chevron-left", Ct);
29
29
  /**
30
30
  * @license lucide-react v0.563.0 - ISC
31
31
  *
@@ -36,7 +36,7 @@ const Rt = [
36
36
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
37
37
  ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
38
38
  ["path", { d: "M12 17h.01", key: "p32p05" }]
39
- ], yt = A("circle-question-mark", Rt);
39
+ ], yt = G("circle-question-mark", Rt);
40
40
  /**
41
41
  * @license lucide-react v0.563.0 - ISC
42
42
  *
@@ -52,7 +52,7 @@ const xt = [
52
52
  }
53
53
  ],
54
54
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
55
- ], _t = A("eye", xt);
55
+ ], _t = G("eye", xt);
56
56
  /**
57
57
  * @license lucide-react v0.563.0 - ISC
58
58
  *
@@ -72,7 +72,7 @@ const Ft = [
72
72
  ["path", { d: "M14 13h2", key: "un5t4a" }],
73
73
  ["path", { d: "M8 17h2", key: "2yhykz" }],
74
74
  ["path", { d: "M14 17h2", key: "10kma7" }]
75
- ], $t = A("file-spreadsheet", Ft);
75
+ ], $t = G("file-spreadsheet", Ft);
76
76
  /**
77
77
  * @license lucide-react v0.563.0 - ISC
78
78
  *
@@ -88,7 +88,7 @@ const Mt = [
88
88
  }
89
89
  ],
90
90
  ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
91
- ], It = A("file", Mt);
91
+ ], It = G("file", Mt);
92
92
  /**
93
93
  * @license lucide-react v0.563.0 - ISC
94
94
  *
@@ -100,7 +100,7 @@ const Vt = [
100
100
  ["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
101
101
  ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
102
102
  ["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
103
- ], Nt = A("git-branch", Vt);
103
+ ], Nt = G("git-branch", Vt);
104
104
  /**
105
105
  * @license lucide-react v0.563.0 - ISC
106
106
  *
@@ -115,20 +115,33 @@ const Pt = [
115
115
  key: "1a8usu"
116
116
  }
117
117
  ]
118
- ], Dt = A("pen", Pt);
118
+ ], Et = G("pen", Pt);
119
119
  /**
120
120
  * @license lucide-react v0.563.0 - ISC
121
121
  *
122
122
  * This source code is licensed under the ISC license.
123
123
  * See the LICENSE file in the root directory of this source tree.
124
124
  */
125
- const Et = [
125
+ const Dt = [
126
126
  [
127
127
  "path",
128
128
  { d: "M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344", key: "2acyp4" }
129
129
  ],
130
130
  ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
131
- ], kt = A("square-check-big", Et), Ge = {
131
+ ], kt = G("square-check-big", Dt);
132
+ /**
133
+ * @license lucide-react v0.563.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */
138
+ const Lt = [
139
+ ["path", { d: "M10 11v6", key: "nco0om" }],
140
+ ["path", { d: "M14 11v6", key: "outv1u" }],
141
+ ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
142
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
143
+ ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
144
+ ], Ht = G("trash-2", Lt), Be = {
132
145
  sessionId: null,
133
146
  status: "idle",
134
147
  step: "upload",
@@ -149,8 +162,8 @@ const Et = [
149
162
  error: null,
150
163
  editingCell: null,
151
164
  editedRows: /* @__PURE__ */ new Set()
152
- }, X = ft((e, o) => ({
153
- ...Ge,
165
+ }, J = ft((e, o) => ({
166
+ ...Be,
154
167
  setSchema: (t) => e({ schema: t }),
155
168
  setSessionId: (t) => e({ sessionId: t }),
156
169
  setFile: (t) => e({
@@ -197,32 +210,52 @@ const Et = [
197
210
  updateCell: (t, n, r) => e((l) => {
198
211
  const i = [...l.rows], s = i.find((f) => f.rowIndex === t);
199
212
  s && (s.data = { ...s.data, [n]: String(r) });
200
- const u = new Set(l.editedRows);
201
- return u.add(t), { rows: i, editedRows: u, editingCell: null };
213
+ const a = new Set(l.editedRows);
214
+ return a.add(t), { rows: i, editedRows: a, editingCell: null };
215
+ }),
216
+ deleteRow: (t) => e((n) => {
217
+ const l = n.rows.filter((a) => a.rowIndex !== t).map((a, f) => ({ ...a, rowIndex: f })), i = /* @__PURE__ */ new Map();
218
+ n.errorsByRow.forEach((a, f) => {
219
+ if (f !== t) {
220
+ const p = f > t ? f - 1 : f;
221
+ i.set(p, a.map((c) => ({ ...c, rowIndex: p })));
222
+ }
223
+ });
224
+ const s = n.validationResults ? {
225
+ ...n.validationResults,
226
+ totalRows: n.validationResults.totalRows - 1,
227
+ errors: n.validationResults.errors.filter((a) => a.rowIndex !== t).map((a) => ({ ...a, rowIndex: a.rowIndex > t ? a.rowIndex - 1 : a.rowIndex }))
228
+ } : null;
229
+ return {
230
+ rows: l,
231
+ totalRows: l.length,
232
+ errorsByRow: i,
233
+ validationResults: s
234
+ };
202
235
  }),
203
236
  setStatus: (t) => e({ status: t }),
204
237
  setLoading: (t) => e({ isLoading: t }),
205
238
  setError: (t) => e({ error: t }),
206
- reset: () => e(Ge)
207
- })), Lt = ({
239
+ reset: () => e(Be)
240
+ })), zt = ({
208
241
  onFileSelect: e,
209
242
  maxSize: o = 50 * 1024 * 1024,
210
243
  // 50MB
211
244
  acceptedTypes: t = [".csv", ".xlsx", ".xls"]
212
245
  }) => {
213
- const { file: n, fileName: r, fileSize: l, setFile: i, error: s, setError: u, isLoading: f } = X(), p = _e(
246
+ const { file: n, fileName: r, fileSize: l, setFile: i, error: s, setError: a, isLoading: f } = J(), p = Me(
214
247
  (w, R) => {
215
248
  if (R.length > 0) {
216
- u("Invalid file type or file too large");
249
+ a("Invalid file type or file too large");
217
250
  return;
218
251
  }
219
252
  if (w.length > 0) {
220
- const x = w[0];
221
- i(x), e == null || e(x);
253
+ const _ = w[0];
254
+ i(_), e == null || e(_);
222
255
  }
223
256
  },
224
- [e, i, u]
225
- ), { getRootProps: c, getInputProps: d, isDragActive: a } = dt({
257
+ [e, i, a]
258
+ ), { getRootProps: c, getInputProps: d, isDragActive: u } = dt({
226
259
  onDrop: p,
227
260
  accept: {
228
261
  "text/csv": [".csv"],
@@ -233,7 +266,7 @@ const Et = [
233
266
  multiple: !1,
234
267
  disabled: f
235
268
  }), m = (w) => w < 1024 ? `${w} B` : w < 1024 * 1024 ? `${(w / 1024).toFixed(1)} KB` : `${(w / (1024 * 1024)).toFixed(1)} MB`, h = (w) => {
236
- w.stopPropagation(), X.getState().reset();
269
+ w.stopPropagation(), J.getState().reset();
237
270
  };
238
271
  return n ? /* @__PURE__ */ g("div", { className: "ff-p-4 ff-rounded-xl ff-border", style: { backgroundColor: "var(--ff-success-light)", borderColor: "var(--ff-success)" }, children: /* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-gap-3", children: [
239
272
  /* @__PURE__ */ g("div", { className: "ff-p-2 ff-rounded-lg", style: { backgroundColor: "rgba(41, 142, 51, 0.15)" }, children: /* @__PURE__ */ g(It, { className: "ff-w-6 ff-h-6", style: { color: "var(--ff-success)" } }) }),
@@ -248,7 +281,7 @@ const Et = [
248
281
  className: "ff-p-1.5 ff-rounded-full ff-transition-colors",
249
282
  style: { color: "var(--ff-success)" },
250
283
  "aria-label": "Remove file",
251
- children: /* @__PURE__ */ g(re, { className: "ff-w-5 ff-h-5" })
284
+ children: /* @__PURE__ */ g(se, { className: "ff-w-5 ff-h-5" })
252
285
  }
253
286
  )
254
287
  ] }) }) : /* @__PURE__ */ v("div", { className: "ff-space-y-6", children: [
@@ -256,17 +289,17 @@ const Et = [
256
289
  "div",
257
290
  {
258
291
  ...c(),
259
- className: b(
292
+ className: j(
260
293
  "ff-dropzone",
261
- a && "ff-dropzone-active",
294
+ u && "ff-dropzone-active",
262
295
  f && "ff-opacity-50 ff-cursor-not-allowed"
263
296
  ),
264
297
  children: [
265
298
  /* @__PURE__ */ g("input", { ...d() }),
266
- /* @__PURE__ */ g("div", { className: "ff-dropzone-icon-wrapper", children: /* @__PURE__ */ g(je, { className: "ff-dropzone-icon" }) }),
267
- /* @__PURE__ */ g("h3", { className: "ff-dropzone-text", children: a ? "Drop your file here" : "Upload your file" }),
299
+ /* @__PURE__ */ g("div", { className: "ff-dropzone-icon-wrapper", children: /* @__PURE__ */ g(Xe, { className: "ff-dropzone-icon" }) }),
300
+ /* @__PURE__ */ g("h3", { className: "ff-dropzone-text", children: u ? "Drop your file here" : "Upload your file" }),
268
301
  /* @__PURE__ */ g("p", { className: "ff-dropzone-hint", children: "Drag and drop or click to select" }),
269
- /* @__PURE__ */ g("label", { className: "ff-inline-block", children: /* @__PURE__ */ g("span", { className: b(
302
+ /* @__PURE__ */ g("label", { className: "ff-inline-block", children: /* @__PURE__ */ g("span", { className: j(
270
303
  "ff-btn ff-btn-primary",
271
304
  f && "ff-opacity-50 ff-cursor-wait"
272
305
  ), children: f ? "Processing..." : "Choose file" }) }),
@@ -280,15 +313,15 @@ const Et = [
280
313
  }
281
314
  ),
282
315
  s && /* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-gap-2 ff-p-4 ff-rounded-lg ff-text-sm", style: { backgroundColor: "var(--ff-error-light)", color: "var(--ff-error)" }, children: [
283
- /* @__PURE__ */ g(Fe, { className: "ff-w-4 ff-h-4 ff-flex-shrink-0" }),
316
+ /* @__PURE__ */ g(Ie, { className: "ff-w-4 ff-h-4 ff-flex-shrink-0" }),
284
317
  /* @__PURE__ */ g("p", { children: s })
285
318
  ] })
286
319
  ] });
287
- }, Ht = ({ onMappingChange: e }) => {
288
- const { mappings: o, schema: t, unmappedSource: n, updateMapping: r } = X(), l = (t == null ? void 0 : t.columns) || [], i = (c, d) => {
289
- const a = d === "" ? null : d;
290
- r(c, a), e == null || e(c, a);
291
- }, s = (c) => c >= 0.85 ? "var(--ff-success)" : c >= 0.6 ? "var(--ff-warning)" : "var(--ff-error)", u = (c) => c >= 0.85 ? "High" : c >= 0.6 ? "Medium" : "Low", p = new Set(
320
+ }, At = ({ onMappingChange: e }) => {
321
+ const { mappings: o, schema: t, unmappedSource: n, updateMapping: r } = J(), l = (t == null ? void 0 : t.columns) || [], i = (c, d) => {
322
+ const u = d === "" ? null : d;
323
+ r(c, u), e == null || e(c, u);
324
+ }, s = (c) => c >= 0.85 ? "var(--ff-success)" : c >= 0.6 ? "var(--ff-warning)" : "var(--ff-error)", a = (c) => c >= 0.85 ? "High" : c >= 0.6 ? "Medium" : "Low", p = new Set(
292
325
  o.filter((c) => c.targetKey !== null).map((c) => c.targetKey)
293
326
  );
294
327
  return /* @__PURE__ */ v("div", { className: "ff-space-y-4", children: [
@@ -314,14 +347,14 @@ const Et = [
314
347
  ] }),
315
348
  /* @__PURE__ */ g("div", { className: "ff-space-y-2", children: o.map((c) => {
316
349
  l.find((m) => m.key === c.targetKey);
317
- const d = c.targetKey !== null, a = c.confidence >= 0.85;
350
+ const d = c.targetKey !== null, u = c.confidence >= 0.85;
318
351
  return /* @__PURE__ */ v(
319
352
  "div",
320
353
  {
321
- className: b(
354
+ className: j(
322
355
  "ff-mapping-row",
323
- d && a && "ff-mapping-row-success",
324
- d && !a && "ff-mapping-row-warning"
356
+ d && u && "ff-mapping-row-success",
357
+ d && !u && "ff-mapping-row-warning"
325
358
  ),
326
359
  children: [
327
360
  /* @__PURE__ */ g("div", { className: "ff-flex-1", children: /* @__PURE__ */ g("div", { className: "ff-mapping-source", children: c.sourceColumn }) }),
@@ -352,7 +385,7 @@ const Et = [
352
385
  ]
353
386
  }
354
387
  ) }),
355
- /* @__PURE__ */ g("div", { className: "ff-mapping-status", children: d ? a ? /* @__PURE__ */ g(wt, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ g(yt, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-warning)" } }) : /* @__PURE__ */ g("span", { className: "ff-w-5 ff-h-5" }) }),
388
+ /* @__PURE__ */ g("div", { className: "ff-mapping-status", children: d ? u ? /* @__PURE__ */ g(wt, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ g(yt, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-warning)" } }) : /* @__PURE__ */ g("span", { className: "ff-w-5 ff-h-5" }) }),
356
389
  c.confidence > 0 && /* @__PURE__ */ v("div", { className: "ff-confidence", style: { color: s(c.confidence) }, children: [
357
390
  /* @__PURE__ */ v("span", { children: [
358
391
  Math.round(c.confidence * 100),
@@ -360,7 +393,7 @@ const Et = [
360
393
  ] }),
361
394
  /* @__PURE__ */ v("span", { style: { color: "var(--ff-text-muted)" }, children: [
362
395
  "(",
363
- u(c.confidence),
396
+ a(c.confidence),
364
397
  ")"
365
398
  ] })
366
399
  ] })
@@ -374,7 +407,7 @@ const Et = [
374
407
  (d) => d.required && !p.has(d.key)
375
408
  );
376
409
  return c.length > 0 ? /* @__PURE__ */ v("div", { className: "ff-flex ff-items-start ff-gap-2 ff-p-4 ff-rounded-lg", style: { backgroundColor: "var(--ff-warning-light)", borderColor: "var(--ff-warning)" }, children: [
377
- /* @__PURE__ */ g(Fe, { className: "ff-w-5 ff-h-5 ff-flex-shrink-0 ff-mt-0.5", style: { color: "var(--ff-warning)" } }),
410
+ /* @__PURE__ */ g(Ie, { className: "ff-w-5 ff-h-5 ff-flex-shrink-0 ff-mt-0.5", style: { color: "var(--ff-warning)" } }),
378
411
  /* @__PURE__ */ v("div", { children: [
379
412
  /* @__PURE__ */ g("p", { className: "ff-text-sm ff-font-medium", style: { color: "var(--ff-warning-dark)" }, children: "Required fields not mapped" }),
380
413
  /* @__PURE__ */ g("p", { className: "ff-text-sm ff-mt-1", style: { color: "var(--ff-warning)" }, children: c.map((d) => d.label).join(", ") })
@@ -393,7 +426,7 @@ const Et = [
393
426
  *
394
427
  * @license MIT
395
428
  */
396
- function zt() {
429
+ function Gt() {
397
430
  return {
398
431
  accessor: (e, o) => typeof e == "function" ? {
399
432
  ...o,
@@ -406,24 +439,24 @@ function zt() {
406
439
  group: (e) => e
407
440
  };
408
441
  }
409
- function O(e, o) {
442
+ function q(e, o) {
410
443
  return typeof e == "function" ? e(o) : e;
411
444
  }
412
445
  function L(e, o) {
413
446
  return (t) => {
414
447
  o.setState((n) => ({
415
448
  ...n,
416
- [e]: O(t, n[e])
449
+ [e]: q(t, n[e])
417
450
  }));
418
451
  };
419
452
  }
420
- function le(e) {
453
+ function ae(e) {
421
454
  return e instanceof Function;
422
455
  }
423
- function At(e) {
456
+ function Ot(e) {
424
457
  return Array.isArray(e) && e.every((o) => typeof o == "number");
425
458
  }
426
- function Gt(e, o) {
459
+ function bt(e, o) {
427
460
  const t = [], n = (r) => {
428
461
  r.forEach((l) => {
429
462
  t.push(l);
@@ -444,12 +477,12 @@ function C(e, o, t) {
444
477
  n = s;
445
478
  let f;
446
479
  if (t.key && t.debug && (f = Date.now()), r = o(...s), t == null || t.onChange == null || t.onChange(r), t.key && t.debug && t != null && t.debug()) {
447
- const p = Math.round((Date.now() - i) * 100) / 100, c = Math.round((Date.now() - f) * 100) / 100, d = c / 16, a = (m, h) => {
480
+ const p = Math.round((Date.now() - i) * 100) / 100, c = Math.round((Date.now() - f) * 100) / 100, d = c / 16, u = (m, h) => {
448
481
  for (m = String(m); m.length < h; )
449
482
  m = " " + m;
450
483
  return m;
451
484
  };
452
- console.info(`%c⏱ ${a(c, 5)} /${a(p, 5)} ms`, `
485
+ console.info(`%c⏱ ${u(c, 5)} /${u(p, 5)} ms`, `
453
486
  font-size: .6rem;
454
487
  font-weight: bold;
455
488
  color: hsl(${Math.max(0, Math.min(120 - 120 * d, 120))}deg 100% 31%);`, t == null ? void 0 : t.key);
@@ -467,7 +500,7 @@ function S(e, o, t, n) {
467
500
  onChange: n
468
501
  };
469
502
  }
470
- function Ot(e, o, t, n) {
503
+ function Bt(e, o, t, n) {
471
504
  const r = () => {
472
505
  var i;
473
506
  return (i = l.getValue()) != null ? i : e.options.renderFallbackValue;
@@ -477,10 +510,10 @@ function Ot(e, o, t, n) {
477
510
  column: t,
478
511
  getValue: () => o.getValue(n),
479
512
  renderValue: r,
480
- getContext: C(() => [e, t, o, l], (i, s, u, f) => ({
513
+ getContext: C(() => [e, t, o, l], (i, s, a, f) => ({
481
514
  table: i,
482
515
  column: s,
483
- row: u,
516
+ row: a,
484
517
  cell: f,
485
518
  getValue: f.getValue,
486
519
  renderValue: f.renderValue
@@ -490,20 +523,20 @@ function Ot(e, o, t, n) {
490
523
  i.createCell == null || i.createCell(l, t, o, e);
491
524
  }, {}), l;
492
525
  }
493
- function bt(e, o, t, n) {
526
+ function Tt(e, o, t, n) {
494
527
  var r, l;
495
528
  const s = {
496
529
  ...e._getDefaultColumnDef(),
497
530
  ...o
498
- }, u = s.accessorKey;
499
- let f = (r = (l = s.id) != null ? l : u ? typeof String.prototype.replaceAll == "function" ? u.replaceAll(".", "_") : u.replace(/\./g, "_") : void 0) != null ? r : typeof s.header == "string" ? s.header : void 0, p;
500
- if (s.accessorFn ? p = s.accessorFn : u && (u.includes(".") ? p = (d) => {
501
- let a = d;
502
- for (const h of u.split(".")) {
531
+ }, a = s.accessorKey;
532
+ let f = (r = (l = s.id) != null ? l : a ? typeof String.prototype.replaceAll == "function" ? a.replaceAll(".", "_") : a.replace(/\./g, "_") : void 0) != null ? r : typeof s.header == "string" ? s.header : void 0, p;
533
+ if (s.accessorFn ? p = s.accessorFn : a && (a.includes(".") ? p = (d) => {
534
+ let u = d;
535
+ for (const h of a.split(".")) {
503
536
  var m;
504
- a = (m = a) == null ? void 0 : m[h], process.env.NODE_ENV !== "production" && a === void 0 && console.warn(`"${h}" in deeply nested key "${u}" returned undefined.`);
537
+ u = (m = u) == null ? void 0 : m[h], process.env.NODE_ENV !== "production" && u === void 0 && console.warn(`"${h}" in deeply nested key "${a}" returned undefined.`);
505
538
  }
506
- return a;
539
+ return u;
507
540
  } : p = (d) => d[s.accessorKey]), !f)
508
541
  throw process.env.NODE_ENV !== "production" ? new Error(s.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header") : new Error();
509
542
  let c = {
@@ -515,11 +548,11 @@ function bt(e, o, t, n) {
515
548
  columns: [],
516
549
  getFlatColumns: C(() => [!0], () => {
517
550
  var d;
518
- return [c, ...(d = c.columns) == null ? void 0 : d.flatMap((a) => a.getFlatColumns())];
551
+ return [c, ...(d = c.columns) == null ? void 0 : d.flatMap((u) => u.getFlatColumns())];
519
552
  }, S(e.options, "debugColumns", "column.getFlatColumns")),
520
553
  getLeafColumns: C(() => [e._getOrderColumnsFn()], (d) => {
521
- var a;
522
- if ((a = c.columns) != null && a.length) {
554
+ var u;
555
+ if ((u = c.columns) != null && u.length) {
523
556
  let m = c.columns.flatMap((h) => h.getLeafColumns());
524
557
  return d(m);
525
558
  }
@@ -531,7 +564,7 @@ function bt(e, o, t, n) {
531
564
  return c;
532
565
  }
533
566
  const P = "debugHeaders";
534
- function Oe(e, o, t) {
567
+ function Te(e, o, t) {
535
568
  var n;
536
569
  let l = {
537
570
  id: (n = t.id) != null ? n : o.id,
@@ -545,8 +578,8 @@ function Oe(e, o, t) {
545
578
  rowSpan: 0,
546
579
  headerGroup: null,
547
580
  getLeafHeaders: () => {
548
- const i = [], s = (u) => {
549
- u.subHeaders && u.subHeaders.length && u.subHeaders.map(s), i.push(u);
581
+ const i = [], s = (a) => {
582
+ a.subHeaders && a.subHeaders.length && a.subHeaders.map(s), i.push(a);
550
583
  };
551
584
  return s(l), i;
552
585
  },
@@ -560,20 +593,20 @@ function Oe(e, o, t) {
560
593
  i.createHeader == null || i.createHeader(l, e);
561
594
  }), l;
562
595
  }
563
- const Bt = {
596
+ const qt = {
564
597
  createTable: (e) => {
565
598
  e.getHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => {
566
599
  var l, i;
567
- const s = (l = n == null ? void 0 : n.map((c) => t.find((d) => d.id === c)).filter(Boolean)) != null ? l : [], u = (i = r == null ? void 0 : r.map((c) => t.find((d) => d.id === c)).filter(Boolean)) != null ? i : [], f = t.filter((c) => !(n != null && n.includes(c.id)) && !(r != null && r.includes(c.id)));
568
- return te(o, [...s, ...f, ...u], e);
569
- }, S(e.options, P, "getHeaderGroups")), e.getCenterHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => (t = t.filter((l) => !(n != null && n.includes(l.id)) && !(r != null && r.includes(l.id))), te(o, t, e, "center")), S(e.options, P, "getCenterHeaderGroups")), e.getLeftHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
600
+ const s = (l = n == null ? void 0 : n.map((c) => t.find((d) => d.id === c)).filter(Boolean)) != null ? l : [], a = (i = r == null ? void 0 : r.map((c) => t.find((d) => d.id === c)).filter(Boolean)) != null ? i : [], f = t.filter((c) => !(n != null && n.includes(c.id)) && !(r != null && r.includes(c.id)));
601
+ return re(o, [...s, ...f, ...a], e);
602
+ }, S(e.options, P, "getHeaderGroups")), e.getCenterHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => (t = t.filter((l) => !(n != null && n.includes(l.id)) && !(r != null && r.includes(l.id))), re(o, t, e, "center")), S(e.options, P, "getCenterHeaderGroups")), e.getLeftHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
570
603
  var r;
571
604
  const l = (r = n == null ? void 0 : n.map((i) => t.find((s) => s.id === i)).filter(Boolean)) != null ? r : [];
572
- return te(o, l, e, "left");
605
+ return re(o, l, e, "left");
573
606
  }, S(e.options, P, "getLeftHeaderGroups")), e.getRightHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (o, t, n) => {
574
607
  var r;
575
608
  const l = (r = n == null ? void 0 : n.map((i) => t.find((s) => s.id === i)).filter(Boolean)) != null ? r : [];
576
- return te(o, l, e, "right");
609
+ return re(o, l, e, "right");
577
610
  }, S(e.options, P, "getRightHeaderGroups")), e.getFooterGroups = C(() => [e.getHeaderGroups()], (o) => [...o].reverse(), S(e.options, P, "getFooterGroups")), e.getLeftFooterGroups = C(() => [e.getLeftHeaderGroups()], (o) => [...o].reverse(), S(e.options, P, "getLeftFooterGroups")), e.getCenterFooterGroups = C(() => [e.getCenterHeaderGroups()], (o) => [...o].reverse(), S(e.options, P, "getCenterFooterGroups")), e.getRightFooterGroups = C(() => [e.getRightHeaderGroups()], (o) => [...o].reverse(), S(e.options, P, "getRightFooterGroups")), e.getFlatHeaders = C(() => [e.getHeaderGroups()], (o) => o.map((t) => t.headers).flat(), S(e.options, P, "getFlatHeaders")), e.getLeftFlatHeaders = C(() => [e.getLeftHeaderGroups()], (o) => o.map((t) => t.headers).flat(), S(e.options, P, "getLeftFlatHeaders")), e.getCenterFlatHeaders = C(() => [e.getCenterHeaderGroups()], (o) => o.map((t) => t.headers).flat(), S(e.options, P, "getCenterFlatHeaders")), e.getRightFlatHeaders = C(() => [e.getRightHeaderGroups()], (o) => o.map((t) => t.headers).flat(), S(e.options, P, "getRightFlatHeaders")), e.getCenterLeafHeaders = C(() => [e.getCenterFlatHeaders()], (o) => o.filter((t) => {
578
611
  var n;
579
612
  return !((n = t.subHeaders) != null && n.length);
@@ -584,68 +617,68 @@ const Bt = {
584
617
  var n;
585
618
  return !((n = t.subHeaders) != null && n.length);
586
619
  }), S(e.options, P, "getRightLeafHeaders")), e.getLeafHeaders = C(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (o, t, n) => {
587
- var r, l, i, s, u, f;
588
- return [...(r = (l = o[0]) == null ? void 0 : l.headers) != null ? r : [], ...(i = (s = t[0]) == null ? void 0 : s.headers) != null ? i : [], ...(u = (f = n[0]) == null ? void 0 : f.headers) != null ? u : []].map((p) => p.getLeafHeaders()).flat();
620
+ var r, l, i, s, a, f;
621
+ return [...(r = (l = o[0]) == null ? void 0 : l.headers) != null ? r : [], ...(i = (s = t[0]) == null ? void 0 : s.headers) != null ? i : [], ...(a = (f = n[0]) == null ? void 0 : f.headers) != null ? a : []].map((p) => p.getLeafHeaders()).flat();
589
622
  }, S(e.options, P, "getLeafHeaders"));
590
623
  }
591
624
  };
592
- function te(e, o, t, n) {
625
+ function re(e, o, t, n) {
593
626
  var r, l;
594
627
  let i = 0;
595
- const s = function(d, a) {
596
- a === void 0 && (a = 1), i = Math.max(i, a), d.filter((m) => m.getIsVisible()).forEach((m) => {
628
+ const s = function(d, u) {
629
+ u === void 0 && (u = 1), i = Math.max(i, u), d.filter((m) => m.getIsVisible()).forEach((m) => {
597
630
  var h;
598
- (h = m.columns) != null && h.length && s(m.columns, a + 1);
631
+ (h = m.columns) != null && h.length && s(m.columns, u + 1);
599
632
  }, 0);
600
633
  };
601
634
  s(e);
602
- let u = [];
603
- const f = (d, a) => {
635
+ let a = [];
636
+ const f = (d, u) => {
604
637
  const m = {
605
- depth: a,
606
- id: [n, `${a}`].filter(Boolean).join("_"),
638
+ depth: u,
639
+ id: [n, `${u}`].filter(Boolean).join("_"),
607
640
  headers: []
608
641
  }, h = [];
609
642
  d.forEach((w) => {
610
- const R = [...h].reverse()[0], x = w.column.depth === m.depth;
611
- let $, D = !1;
612
- if (x && w.column.parent ? $ = w.column.parent : ($ = w.column, D = !0), R && (R == null ? void 0 : R.column) === $)
643
+ const R = [...h].reverse()[0], _ = w.column.depth === m.depth;
644
+ let $, E = !1;
645
+ if (_ && w.column.parent ? $ = w.column.parent : ($ = w.column, E = !0), R && (R == null ? void 0 : R.column) === $)
613
646
  R.subHeaders.push(w);
614
647
  else {
615
- const N = Oe(t, $, {
616
- id: [n, a, $.id, w == null ? void 0 : w.id].filter(Boolean).join("_"),
617
- isPlaceholder: D,
618
- placeholderId: D ? `${h.filter((E) => E.column === $).length}` : void 0,
619
- depth: a,
648
+ const I = Te(t, $, {
649
+ id: [n, u, $.id, w == null ? void 0 : w.id].filter(Boolean).join("_"),
650
+ isPlaceholder: E,
651
+ placeholderId: E ? `${h.filter((D) => D.column === $).length}` : void 0,
652
+ depth: u,
620
653
  index: h.length
621
654
  });
622
- N.subHeaders.push(w), h.push(N);
655
+ I.subHeaders.push(w), h.push(I);
623
656
  }
624
657
  m.headers.push(w), w.headerGroup = m;
625
- }), u.push(m), a > 0 && f(h, a - 1);
626
- }, p = o.map((d, a) => Oe(t, d, {
658
+ }), a.push(m), u > 0 && f(h, u - 1);
659
+ }, p = o.map((d, u) => Te(t, d, {
627
660
  depth: i,
628
- index: a
661
+ index: u
629
662
  }));
630
- f(p, i - 1), u.reverse();
663
+ f(p, i - 1), a.reverse();
631
664
  const c = (d) => d.filter((m) => m.column.getIsVisible()).map((m) => {
632
665
  let h = 0, w = 0, R = [0];
633
666
  m.subHeaders && m.subHeaders.length ? (R = [], c(m.subHeaders).forEach(($) => {
634
667
  let {
635
- colSpan: D,
636
- rowSpan: N
668
+ colSpan: E,
669
+ rowSpan: I
637
670
  } = $;
638
- h += D, R.push(N);
671
+ h += E, R.push(I);
639
672
  })) : h = 1;
640
- const x = Math.min(...R);
641
- return w = w + x, m.colSpan = h, m.rowSpan = w, {
673
+ const _ = Math.min(...R);
674
+ return w = w + _, m.colSpan = h, m.rowSpan = w, {
642
675
  colSpan: h,
643
676
  rowSpan: w
644
677
  };
645
678
  });
646
- return c((r = (l = u[0]) == null ? void 0 : l.headers) != null ? r : []), u;
679
+ return c((r = (l = a[0]) == null ? void 0 : l.headers) != null ? r : []), a;
647
680
  }
648
- const Me = (e, o, t, n, r, l, i) => {
681
+ const Ne = (e, o, t, n, r, l, i) => {
649
682
  let s = {
650
683
  id: o,
651
684
  index: n,
@@ -654,92 +687,92 @@ const Me = (e, o, t, n, r, l, i) => {
654
687
  parentId: i,
655
688
  _valuesCache: {},
656
689
  _uniqueValuesCache: {},
657
- getValue: (u) => {
658
- if (s._valuesCache.hasOwnProperty(u))
659
- return s._valuesCache[u];
660
- const f = e.getColumn(u);
690
+ getValue: (a) => {
691
+ if (s._valuesCache.hasOwnProperty(a))
692
+ return s._valuesCache[a];
693
+ const f = e.getColumn(a);
661
694
  if (f != null && f.accessorFn)
662
- return s._valuesCache[u] = f.accessorFn(s.original, n), s._valuesCache[u];
695
+ return s._valuesCache[a] = f.accessorFn(s.original, n), s._valuesCache[a];
663
696
  },
664
- getUniqueValues: (u) => {
665
- if (s._uniqueValuesCache.hasOwnProperty(u))
666
- return s._uniqueValuesCache[u];
667
- const f = e.getColumn(u);
697
+ getUniqueValues: (a) => {
698
+ if (s._uniqueValuesCache.hasOwnProperty(a))
699
+ return s._uniqueValuesCache[a];
700
+ const f = e.getColumn(a);
668
701
  if (f != null && f.accessorFn)
669
- return f.columnDef.getUniqueValues ? (s._uniqueValuesCache[u] = f.columnDef.getUniqueValues(s.original, n), s._uniqueValuesCache[u]) : (s._uniqueValuesCache[u] = [s.getValue(u)], s._uniqueValuesCache[u]);
702
+ return f.columnDef.getUniqueValues ? (s._uniqueValuesCache[a] = f.columnDef.getUniqueValues(s.original, n), s._uniqueValuesCache[a]) : (s._uniqueValuesCache[a] = [s.getValue(a)], s._uniqueValuesCache[a]);
670
703
  },
671
- renderValue: (u) => {
704
+ renderValue: (a) => {
672
705
  var f;
673
- return (f = s.getValue(u)) != null ? f : e.options.renderFallbackValue;
706
+ return (f = s.getValue(a)) != null ? f : e.options.renderFallbackValue;
674
707
  },
675
708
  subRows: [],
676
- getLeafRows: () => Gt(s.subRows, (u) => u.subRows),
709
+ getLeafRows: () => bt(s.subRows, (a) => a.subRows),
677
710
  getParentRow: () => s.parentId ? e.getRow(s.parentId, !0) : void 0,
678
711
  getParentRows: () => {
679
- let u = [], f = s;
712
+ let a = [], f = s;
680
713
  for (; ; ) {
681
714
  const p = f.getParentRow();
682
715
  if (!p) break;
683
- u.push(p), f = p;
716
+ a.push(p), f = p;
684
717
  }
685
- return u.reverse();
718
+ return a.reverse();
686
719
  },
687
- getAllCells: C(() => [e.getAllLeafColumns()], (u) => u.map((f) => Ot(e, s, f, f.id)), S(e.options, "debugRows", "getAllCells")),
688
- _getAllCellsByColumnId: C(() => [s.getAllCells()], (u) => u.reduce((f, p) => (f[p.column.id] = p, f), {}), S(e.options, "debugRows", "getAllCellsByColumnId"))
720
+ getAllCells: C(() => [e.getAllLeafColumns()], (a) => a.map((f) => Bt(e, s, f, f.id)), S(e.options, "debugRows", "getAllCells")),
721
+ _getAllCellsByColumnId: C(() => [s.getAllCells()], (a) => a.reduce((f, p) => (f[p.column.id] = p, f), {}), S(e.options, "debugRows", "getAllCellsByColumnId"))
689
722
  };
690
- for (let u = 0; u < e._features.length; u++) {
691
- const f = e._features[u];
723
+ for (let a = 0; a < e._features.length; a++) {
724
+ const f = e._features[a];
692
725
  f == null || f.createRow == null || f.createRow(s, e);
693
726
  }
694
727
  return s;
695
- }, Tt = {
728
+ }, jt = {
696
729
  createColumn: (e, o) => {
697
730
  e._getFacetedRowModel = o.options.getFacetedRowModel && o.options.getFacetedRowModel(o, e.id), e.getFacetedRowModel = () => e._getFacetedRowModel ? e._getFacetedRowModel() : o.getPreFilteredRowModel(), e._getFacetedUniqueValues = o.options.getFacetedUniqueValues && o.options.getFacetedUniqueValues(o, e.id), e.getFacetedUniqueValues = () => e._getFacetedUniqueValues ? e._getFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getFacetedMinMaxValues = o.options.getFacetedMinMaxValues && o.options.getFacetedMinMaxValues(o, e.id), e.getFacetedMinMaxValues = () => {
698
731
  if (e._getFacetedMinMaxValues)
699
732
  return e._getFacetedMinMaxValues();
700
733
  };
701
734
  }
702
- }, Ue = (e, o, t) => {
735
+ }, We = (e, o, t) => {
703
736
  var n, r;
704
737
  const l = t == null || (n = t.toString()) == null ? void 0 : n.toLowerCase();
705
738
  return !!(!((r = e.getValue(o)) == null || (r = r.toString()) == null || (r = r.toLowerCase()) == null) && r.includes(l));
706
739
  };
707
- Ue.autoRemove = (e) => H(e);
708
- const Ke = (e, o, t) => {
740
+ We.autoRemove = (e) => A(e);
741
+ const Qe = (e, o, t) => {
709
742
  var n;
710
743
  return !!(!((n = e.getValue(o)) == null || (n = n.toString()) == null) && n.includes(t));
711
744
  };
712
- Ke.autoRemove = (e) => H(e);
713
- const Xe = (e, o, t) => {
745
+ Qe.autoRemove = (e) => A(e);
746
+ const Ye = (e, o, t) => {
714
747
  var n;
715
748
  return ((n = e.getValue(o)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === (t == null ? void 0 : t.toLowerCase());
716
749
  };
717
- Xe.autoRemove = (e) => H(e);
718
- const We = (e, o, t) => {
750
+ Ye.autoRemove = (e) => A(e);
751
+ const Je = (e, o, t) => {
719
752
  var n;
720
753
  return (n = e.getValue(o)) == null ? void 0 : n.includes(t);
721
754
  };
722
- We.autoRemove = (e) => H(e);
723
- const Qe = (e, o, t) => !t.some((n) => {
755
+ Je.autoRemove = (e) => A(e);
756
+ const Ze = (e, o, t) => !t.some((n) => {
724
757
  var r;
725
758
  return !((r = e.getValue(o)) != null && r.includes(n));
726
759
  });
727
- Qe.autoRemove = (e) => H(e) || !(e != null && e.length);
728
- const Ye = (e, o, t) => t.some((n) => {
760
+ Ze.autoRemove = (e) => A(e) || !(e != null && e.length);
761
+ const et = (e, o, t) => t.some((n) => {
729
762
  var r;
730
763
  return (r = e.getValue(o)) == null ? void 0 : r.includes(n);
731
764
  });
732
- Ye.autoRemove = (e) => H(e) || !(e != null && e.length);
733
- const Je = (e, o, t) => e.getValue(o) === t;
734
- Je.autoRemove = (e) => H(e);
735
- const Ze = (e, o, t) => e.getValue(o) == t;
736
- Ze.autoRemove = (e) => H(e);
737
- const Ie = (e, o, t) => {
765
+ et.autoRemove = (e) => A(e) || !(e != null && e.length);
766
+ const tt = (e, o, t) => e.getValue(o) === t;
767
+ tt.autoRemove = (e) => A(e);
768
+ const nt = (e, o, t) => e.getValue(o) == t;
769
+ nt.autoRemove = (e) => A(e);
770
+ const Pe = (e, o, t) => {
738
771
  let [n, r] = t;
739
772
  const l = e.getValue(o);
740
773
  return l >= n && l <= r;
741
774
  };
742
- Ie.resolveFilterValue = (e) => {
775
+ Pe.resolveFilterValue = (e) => {
743
776
  let [o, t] = e, n = typeof o != "number" ? parseFloat(o) : o, r = typeof t != "number" ? parseFloat(t) : t, l = o === null || Number.isNaN(n) ? -1 / 0 : n, i = t === null || Number.isNaN(r) ? 1 / 0 : r;
744
777
  if (l > i) {
745
778
  const s = l;
@@ -747,22 +780,22 @@ Ie.resolveFilterValue = (e) => {
747
780
  }
748
781
  return [l, i];
749
782
  };
750
- Ie.autoRemove = (e) => H(e) || H(e[0]) && H(e[1]);
751
- const G = {
752
- includesString: Ue,
753
- includesStringSensitive: Ke,
754
- equalsString: Xe,
755
- arrIncludes: We,
756
- arrIncludesAll: Qe,
757
- arrIncludesSome: Ye,
758
- equals: Je,
759
- weakEquals: Ze,
760
- inNumberRange: Ie
783
+ Pe.autoRemove = (e) => A(e) || A(e[0]) && A(e[1]);
784
+ const B = {
785
+ includesString: We,
786
+ includesStringSensitive: Qe,
787
+ equalsString: Ye,
788
+ arrIncludes: Je,
789
+ arrIncludesAll: Ze,
790
+ arrIncludesSome: et,
791
+ equals: tt,
792
+ weakEquals: nt,
793
+ inNumberRange: Pe
761
794
  };
762
- function H(e) {
795
+ function A(e) {
763
796
  return e == null || e === "";
764
797
  }
765
- const qt = {
798
+ const Ut = {
766
799
  getDefaultColumnDef: () => ({
767
800
  filterFn: "auto"
768
801
  }),
@@ -778,12 +811,12 @@ const qt = {
778
811
  createColumn: (e, o) => {
779
812
  e.getAutoFilterFn = () => {
780
813
  const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
781
- return typeof n == "string" ? G.includesString : typeof n == "number" ? G.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? G.equals : Array.isArray(n) ? G.arrIncludes : G.weakEquals;
814
+ return typeof n == "string" ? B.includesString : typeof n == "number" ? B.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? B.equals : Array.isArray(n) ? B.arrIncludes : B.weakEquals;
782
815
  }, e.getFilterFn = () => {
783
816
  var t, n;
784
- return le(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : (
817
+ return ae(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : (
785
818
  // @ts-ignore
786
- (t = (n = o.options.filterFns) == null ? void 0 : n[e.columnDef.filterFn]) != null ? t : G[e.columnDef.filterFn]
819
+ (t = (n = o.options.filterFns) == null ? void 0 : n[e.columnDef.filterFn]) != null ? t : B[e.columnDef.filterFn]
787
820
  );
788
821
  }, e.getCanFilter = () => {
789
822
  var t, n, r;
@@ -796,20 +829,20 @@ const qt = {
796
829
  return (t = (n = o.getState().columnFilters) == null ? void 0 : n.findIndex((r) => r.id === e.id)) != null ? t : -1;
797
830
  }, e.setFilterValue = (t) => {
798
831
  o.setColumnFilters((n) => {
799
- const r = e.getFilterFn(), l = n == null ? void 0 : n.find((p) => p.id === e.id), i = O(t, l ? l.value : void 0);
800
- if (be(r, i, e)) {
832
+ const r = e.getFilterFn(), l = n == null ? void 0 : n.find((p) => p.id === e.id), i = q(t, l ? l.value : void 0);
833
+ if (qe(r, i, e)) {
801
834
  var s;
802
835
  return (s = n == null ? void 0 : n.filter((p) => p.id !== e.id)) != null ? s : [];
803
836
  }
804
- const u = {
837
+ const a = {
805
838
  id: e.id,
806
839
  value: i
807
840
  };
808
841
  if (l) {
809
842
  var f;
810
- return (f = n == null ? void 0 : n.map((p) => p.id === e.id ? u : p)) != null ? f : [];
843
+ return (f = n == null ? void 0 : n.map((p) => p.id === e.id ? a : p)) != null ? f : [];
811
844
  }
812
- return n != null && n.length ? [...n, u] : [u];
845
+ return n != null && n.length ? [...n, a] : [a];
813
846
  });
814
847
  };
815
848
  },
@@ -820,11 +853,11 @@ const qt = {
820
853
  e.setColumnFilters = (o) => {
821
854
  const t = e.getAllLeafColumns(), n = (r) => {
822
855
  var l;
823
- return (l = O(o, r)) == null ? void 0 : l.filter((i) => {
824
- const s = t.find((u) => u.id === i.id);
856
+ return (l = q(o, r)) == null ? void 0 : l.filter((i) => {
857
+ const s = t.find((a) => a.id === i.id);
825
858
  if (s) {
826
- const u = s.getFilterFn();
827
- if (be(u, i.value, s))
859
+ const a = s.getFilterFn();
860
+ if (qe(a, i.value, s))
828
861
  return !1;
829
862
  }
830
863
  return !0;
@@ -837,57 +870,57 @@ const qt = {
837
870
  }, e.getPreFilteredRowModel = () => e.getCoreRowModel(), e.getFilteredRowModel = () => (!e._getFilteredRowModel && e.options.getFilteredRowModel && (e._getFilteredRowModel = e.options.getFilteredRowModel(e)), e.options.manualFiltering || !e._getFilteredRowModel ? e.getPreFilteredRowModel() : e._getFilteredRowModel());
838
871
  }
839
872
  };
840
- function be(e, o, t) {
873
+ function qe(e, o, t) {
841
874
  return (e && e.autoRemove ? e.autoRemove(o, t) : !1) || typeof o > "u" || typeof o == "string" && !o;
842
875
  }
843
- const jt = (e, o, t) => t.reduce((n, r) => {
876
+ const Kt = (e, o, t) => t.reduce((n, r) => {
844
877
  const l = r.getValue(e);
845
878
  return n + (typeof l == "number" ? l : 0);
846
- }, 0), Ut = (e, o, t) => {
879
+ }, 0), Xt = (e, o, t) => {
847
880
  let n;
848
881
  return t.forEach((r) => {
849
882
  const l = r.getValue(e);
850
883
  l != null && (n > l || n === void 0 && l >= l) && (n = l);
851
884
  }), n;
852
- }, Kt = (e, o, t) => {
885
+ }, Wt = (e, o, t) => {
853
886
  let n;
854
887
  return t.forEach((r) => {
855
888
  const l = r.getValue(e);
856
889
  l != null && (n < l || n === void 0 && l >= l) && (n = l);
857
890
  }), n;
858
- }, Xt = (e, o, t) => {
891
+ }, Qt = (e, o, t) => {
859
892
  let n, r;
860
893
  return t.forEach((l) => {
861
894
  const i = l.getValue(e);
862
895
  i != null && (n === void 0 ? i >= i && (n = r = i) : (n > i && (n = i), r < i && (r = i)));
863
896
  }), [n, r];
864
- }, Wt = (e, o) => {
897
+ }, Yt = (e, o) => {
865
898
  let t = 0, n = 0;
866
899
  if (o.forEach((r) => {
867
900
  let l = r.getValue(e);
868
901
  l != null && (l = +l) >= l && (++t, n += l);
869
902
  }), t) return n / t;
870
- }, Qt = (e, o) => {
903
+ }, Jt = (e, o) => {
871
904
  if (!o.length)
872
905
  return;
873
906
  const t = o.map((l) => l.getValue(e));
874
- if (!At(t))
907
+ if (!Ot(t))
875
908
  return;
876
909
  if (t.length === 1)
877
910
  return t[0];
878
911
  const n = Math.floor(t.length / 2), r = t.sort((l, i) => l - i);
879
912
  return t.length % 2 !== 0 ? r[n] : (r[n - 1] + r[n]) / 2;
880
- }, Yt = (e, o) => Array.from(new Set(o.map((t) => t.getValue(e))).values()), Jt = (e, o) => new Set(o.map((t) => t.getValue(e))).size, Zt = (e, o) => o.length, ue = {
881
- sum: jt,
882
- min: Ut,
883
- max: Kt,
884
- extent: Xt,
885
- mean: Wt,
886
- median: Qt,
887
- unique: Yt,
888
- uniqueCount: Jt,
889
- count: Zt
890
- }, en = {
913
+ }, Zt = (e, o) => Array.from(new Set(o.map((t) => t.getValue(e))).values()), en = (e, o) => new Set(o.map((t) => t.getValue(e))).size, tn = (e, o) => o.length, ge = {
914
+ sum: Kt,
915
+ min: Xt,
916
+ max: Wt,
917
+ extent: Qt,
918
+ mean: Yt,
919
+ median: Jt,
920
+ unique: Zt,
921
+ uniqueCount: en,
922
+ count: tn
923
+ }, nn = {
891
924
  getDefaultColumnDef: () => ({
892
925
  aggregatedCell: (e) => {
893
926
  var o, t;
@@ -923,14 +956,14 @@ const jt = (e, o, t) => t.reduce((n, r) => {
923
956
  }, e.getAutoAggregationFn = () => {
924
957
  const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
925
958
  if (typeof n == "number")
926
- return ue.sum;
959
+ return ge.sum;
927
960
  if (Object.prototype.toString.call(n) === "[object Date]")
928
- return ue.extent;
961
+ return ge.extent;
929
962
  }, e.getAggregationFn = () => {
930
963
  var t, n;
931
964
  if (!e)
932
965
  throw new Error();
933
- return le(e.columnDef.aggregationFn) ? e.columnDef.aggregationFn : e.columnDef.aggregationFn === "auto" ? e.getAutoAggregationFn() : (t = (n = o.options.aggregationFns) == null ? void 0 : n[e.columnDef.aggregationFn]) != null ? t : ue[e.columnDef.aggregationFn];
966
+ return ae(e.columnDef.aggregationFn) ? e.columnDef.aggregationFn : e.columnDef.aggregationFn === "auto" ? e.getAutoAggregationFn() : (t = (n = o.options.aggregationFns) == null ? void 0 : n[e.columnDef.aggregationFn]) != null ? t : ge[e.columnDef.aggregationFn];
934
967
  };
935
968
  },
936
969
  createTable: (e) => {
@@ -954,13 +987,13 @@ const jt = (e, o, t) => t.reduce((n, r) => {
954
987
  };
955
988
  }
956
989
  };
957
- function tn(e, o, t) {
990
+ function on(e, o, t) {
958
991
  if (!(o != null && o.length) || !t)
959
992
  return e;
960
993
  const n = e.filter((l) => !o.includes(l.id));
961
994
  return t === "remove" ? n : [...o.map((l) => e.find((i) => i.id === l)).filter(Boolean), ...n];
962
995
  }
963
- const nn = {
996
+ const rn = {
964
997
  getInitialState: (e) => ({
965
998
  columnOrder: [],
966
999
  ...e
@@ -969,12 +1002,12 @@ const nn = {
969
1002
  onColumnOrderChange: L("columnOrder", e)
970
1003
  }),
971
1004
  createColumn: (e, o) => {
972
- e.getIndex = C((t) => [Z(o, t)], (t) => t.findIndex((n) => n.id === e.id), S(o.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
1005
+ e.getIndex = C((t) => [ne(o, t)], (t) => t.findIndex((n) => n.id === e.id), S(o.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
973
1006
  var n;
974
- return ((n = Z(o, t)[0]) == null ? void 0 : n.id) === e.id;
1007
+ return ((n = ne(o, t)[0]) == null ? void 0 : n.id) === e.id;
975
1008
  }, e.getIsLastColumn = (t) => {
976
1009
  var n;
977
- const r = Z(o, t);
1010
+ const r = ne(o, t);
978
1011
  return ((n = r[r.length - 1]) == null ? void 0 : n.id) === e.id;
979
1012
  };
980
1013
  },
@@ -989,20 +1022,20 @@ const nn = {
989
1022
  else {
990
1023
  const i = [...o], s = [...r];
991
1024
  for (; s.length && i.length; ) {
992
- const u = i.shift(), f = s.findIndex((p) => p.id === u);
1025
+ const a = i.shift(), f = s.findIndex((p) => p.id === a);
993
1026
  f > -1 && l.push(s.splice(f, 1)[0]);
994
1027
  }
995
1028
  l = [...l, ...s];
996
1029
  }
997
- return tn(l, t, n);
1030
+ return on(l, t, n);
998
1031
  }, S(e.options, "debugTable", "_getOrderColumnsFn"));
999
1032
  }
1000
- }, fe = () => ({
1033
+ }, ce = () => ({
1001
1034
  left: [],
1002
1035
  right: []
1003
- }), on = {
1036
+ }), ln = {
1004
1037
  getInitialState: (e) => ({
1005
- columnPinning: fe(),
1038
+ columnPinning: ce(),
1006
1039
  ...e
1007
1040
  }),
1008
1041
  getDefaultOptions: (e) => ({
@@ -1014,10 +1047,10 @@ const nn = {
1014
1047
  o.setColumnPinning((r) => {
1015
1048
  var l, i;
1016
1049
  if (t === "right") {
1017
- var s, u;
1050
+ var s, a;
1018
1051
  return {
1019
1052
  left: ((s = r == null ? void 0 : r.left) != null ? s : []).filter((c) => !(n != null && n.includes(c))),
1020
- right: [...((u = r == null ? void 0 : r.right) != null ? u : []).filter((c) => !(n != null && n.includes(c))), ...n]
1053
+ right: [...((a = r == null ? void 0 : r.right) != null ? a : []).filter((c) => !(n != null && n.includes(c))), ...n]
1021
1054
  };
1022
1055
  }
1023
1056
  if (t === "left") {
@@ -1062,7 +1095,7 @@ const nn = {
1062
1095
  createTable: (e) => {
1063
1096
  e.setColumnPinning = (o) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(o), e.resetColumnPinning = (o) => {
1064
1097
  var t, n;
1065
- return e.setColumnPinning(o ? fe() : (t = (n = e.initialState) == null ? void 0 : n.columnPinning) != null ? t : fe());
1098
+ return e.setColumnPinning(o ? ce() : (t = (n = e.initialState) == null ? void 0 : n.columnPinning) != null ? t : ce());
1066
1099
  }, e.getIsSomeColumnsPinned = (o) => {
1067
1100
  var t;
1068
1101
  const n = e.getState().columnPinning;
@@ -1077,25 +1110,25 @@ const nn = {
1077
1110
  }, S(e.options, "debugColumns", "getCenterLeafColumns"));
1078
1111
  }
1079
1112
  };
1080
- function rn(e) {
1113
+ function sn(e) {
1081
1114
  return e || (typeof document < "u" ? document : null);
1082
1115
  }
1083
- const ne = {
1116
+ const le = {
1084
1117
  size: 150,
1085
1118
  minSize: 20,
1086
1119
  maxSize: Number.MAX_SAFE_INTEGER
1087
- }, de = () => ({
1120
+ }, pe = () => ({
1088
1121
  startOffset: null,
1089
1122
  startSize: null,
1090
1123
  deltaOffset: null,
1091
1124
  deltaPercentage: null,
1092
1125
  isResizingColumn: !1,
1093
1126
  columnSizingStart: []
1094
- }), ln = {
1095
- getDefaultColumnDef: () => ne,
1127
+ }), an = {
1128
+ getDefaultColumnDef: () => le,
1096
1129
  getInitialState: (e) => ({
1097
1130
  columnSizing: {},
1098
- columnSizingInfo: de(),
1131
+ columnSizingInfo: pe(),
1099
1132
  ...e
1100
1133
  }),
1101
1134
  getDefaultOptions: (e) => ({
@@ -1108,8 +1141,8 @@ const ne = {
1108
1141
  e.getSize = () => {
1109
1142
  var t, n, r;
1110
1143
  const l = o.getState().columnSizing[e.id];
1111
- return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : ne.minSize, (n = l ?? e.columnDef.size) != null ? n : ne.size), (r = e.columnDef.maxSize) != null ? r : ne.maxSize);
1112
- }, e.getStart = C((t) => [t, Z(o, t), o.getState().columnSizing], (t, n) => n.slice(0, e.getIndex(t)).reduce((r, l) => r + l.getSize(), 0), S(o.options, "debugColumns", "getStart")), e.getAfter = C((t) => [t, Z(o, t), o.getState().columnSizing], (t, n) => n.slice(e.getIndex(t) + 1).reduce((r, l) => r + l.getSize(), 0), S(o.options, "debugColumns", "getAfter")), e.resetSize = () => {
1144
+ return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : le.minSize, (n = l ?? e.columnDef.size) != null ? n : le.size), (r = e.columnDef.maxSize) != null ? r : le.maxSize);
1145
+ }, e.getStart = C((t) => [t, ne(o, t), o.getState().columnSizing], (t, n) => n.slice(0, e.getIndex(t)).reduce((r, l) => r + l.getSize(), 0), S(o.options, "debugColumns", "getStart")), e.getAfter = C((t) => [t, ne(o, t), o.getState().columnSizing], (t, n) => n.slice(e.getIndex(t) + 1).reduce((r, l) => r + l.getSize(), 0), S(o.options, "debugColumns", "getAfter")), e.resetSize = () => {
1113
1146
  o.setColumnSizing((t) => {
1114
1147
  let {
1115
1148
  [e.id]: n,
@@ -1143,27 +1176,27 @@ const ne = {
1143
1176
  }, e.getResizeHandler = (t) => {
1144
1177
  const n = o.getColumn(e.column.id), r = n == null ? void 0 : n.getCanResize();
1145
1178
  return (l) => {
1146
- if (!n || !r || (l.persist == null || l.persist(), ge(l) && l.touches && l.touches.length > 1))
1179
+ if (!n || !r || (l.persist == null || l.persist(), me(l) && l.touches && l.touches.length > 1))
1147
1180
  return;
1148
- const i = e.getSize(), s = e ? e.getLeafHeaders().map((R) => [R.column.id, R.column.getSize()]) : [[n.id, n.getSize()]], u = ge(l) ? Math.round(l.touches[0].clientX) : l.clientX, f = {}, p = (R, x) => {
1149
- typeof x == "number" && (o.setColumnSizingInfo(($) => {
1150
- var D, N;
1151
- const E = o.options.columnResizeDirection === "rtl" ? -1 : 1, q = (x - ((D = $ == null ? void 0 : $.startOffset) != null ? D : 0)) * E, V = Math.max(q / ((N = $ == null ? void 0 : $.startSize) != null ? N : 0), -0.999999);
1152
- return $.columnSizingStart.forEach((y) => {
1153
- let [_, M] = y;
1154
- f[_] = Math.round(Math.max(M + M * V, 0) * 100) / 100;
1181
+ const i = e.getSize(), s = e ? e.getLeafHeaders().map((R) => [R.column.id, R.column.getSize()]) : [[n.id, n.getSize()]], a = me(l) ? Math.round(l.touches[0].clientX) : l.clientX, f = {}, p = (R, _) => {
1182
+ typeof _ == "number" && (o.setColumnSizingInfo(($) => {
1183
+ var E, I;
1184
+ const D = o.options.columnResizeDirection === "rtl" ? -1 : 1, K = (_ - ((E = $ == null ? void 0 : $.startOffset) != null ? E : 0)) * D, N = Math.max(K / ((I = $ == null ? void 0 : $.startSize) != null ? I : 0), -0.999999);
1185
+ return $.columnSizingStart.forEach((z) => {
1186
+ let [T, O] = z;
1187
+ f[T] = Math.round(Math.max(O + O * N, 0) * 100) / 100;
1155
1188
  }), {
1156
1189
  ...$,
1157
- deltaOffset: q,
1158
- deltaPercentage: V
1190
+ deltaOffset: K,
1191
+ deltaPercentage: N
1159
1192
  };
1160
1193
  }), (o.options.columnResizeMode === "onChange" || R === "end") && o.setColumnSizing(($) => ({
1161
1194
  ...$,
1162
1195
  ...f
1163
1196
  })));
1164
1197
  }, c = (R) => p("move", R), d = (R) => {
1165
- p("end", R), o.setColumnSizingInfo((x) => ({
1166
- ...x,
1198
+ p("end", R), o.setColumnSizingInfo((_) => ({
1199
+ ..._,
1167
1200
  isResizingColumn: !1,
1168
1201
  startOffset: null,
1169
1202
  startSize: null,
@@ -1171,23 +1204,23 @@ const ne = {
1171
1204
  deltaPercentage: null,
1172
1205
  columnSizingStart: []
1173
1206
  }));
1174
- }, a = rn(t), m = {
1207
+ }, u = sn(t), m = {
1175
1208
  moveHandler: (R) => c(R.clientX),
1176
1209
  upHandler: (R) => {
1177
- a == null || a.removeEventListener("mousemove", m.moveHandler), a == null || a.removeEventListener("mouseup", m.upHandler), d(R.clientX);
1210
+ u == null || u.removeEventListener("mousemove", m.moveHandler), u == null || u.removeEventListener("mouseup", m.upHandler), d(R.clientX);
1178
1211
  }
1179
1212
  }, h = {
1180
1213
  moveHandler: (R) => (R.cancelable && (R.preventDefault(), R.stopPropagation()), c(R.touches[0].clientX), !1),
1181
1214
  upHandler: (R) => {
1182
- var x;
1183
- a == null || a.removeEventListener("touchmove", h.moveHandler), a == null || a.removeEventListener("touchend", h.upHandler), R.cancelable && (R.preventDefault(), R.stopPropagation()), d((x = R.touches[0]) == null ? void 0 : x.clientX);
1215
+ var _;
1216
+ u == null || u.removeEventListener("touchmove", h.moveHandler), u == null || u.removeEventListener("touchend", h.upHandler), R.cancelable && (R.preventDefault(), R.stopPropagation()), d((_ = R.touches[0]) == null ? void 0 : _.clientX);
1184
1217
  }
1185
- }, w = sn() ? {
1218
+ }, w = un() ? {
1186
1219
  passive: !1
1187
1220
  } : !1;
1188
- ge(l) ? (a == null || a.addEventListener("touchmove", h.moveHandler, w), a == null || a.addEventListener("touchend", h.upHandler, w)) : (a == null || a.addEventListener("mousemove", m.moveHandler, w), a == null || a.addEventListener("mouseup", m.upHandler, w)), o.setColumnSizingInfo((R) => ({
1221
+ me(l) ? (u == null || u.addEventListener("touchmove", h.moveHandler, w), u == null || u.addEventListener("touchend", h.upHandler, w)) : (u == null || u.addEventListener("mousemove", m.moveHandler, w), u == null || u.addEventListener("mouseup", m.upHandler, w)), o.setColumnSizingInfo((R) => ({
1189
1222
  ...R,
1190
- startOffset: u,
1223
+ startOffset: a,
1191
1224
  startSize: i,
1192
1225
  deltaOffset: 0,
1193
1226
  deltaPercentage: 0,
@@ -1203,7 +1236,7 @@ const ne = {
1203
1236
  e.setColumnSizing(o ? {} : (t = e.initialState.columnSizing) != null ? t : {});
1204
1237
  }, e.resetHeaderSizeInfo = (o) => {
1205
1238
  var t;
1206
- e.setColumnSizingInfo(o ? de() : (t = e.initialState.columnSizingInfo) != null ? t : de());
1239
+ e.setColumnSizingInfo(o ? pe() : (t = e.initialState.columnSizingInfo) != null ? t : pe());
1207
1240
  }, e.getTotalSize = () => {
1208
1241
  var o, t;
1209
1242
  return (o = (t = e.getHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
@@ -1219,9 +1252,9 @@ const ne = {
1219
1252
  };
1220
1253
  }
1221
1254
  };
1222
- let oe = null;
1223
- function sn() {
1224
- if (typeof oe == "boolean") return oe;
1255
+ let ie = null;
1256
+ function un() {
1257
+ if (typeof ie == "boolean") return ie;
1225
1258
  let e = !1;
1226
1259
  try {
1227
1260
  const o = {
@@ -1234,12 +1267,12 @@ function sn() {
1234
1267
  } catch {
1235
1268
  e = !1;
1236
1269
  }
1237
- return oe = e, oe;
1270
+ return ie = e, ie;
1238
1271
  }
1239
- function ge(e) {
1272
+ function me(e) {
1240
1273
  return e.type === "touchstart";
1241
1274
  }
1242
- const an = {
1275
+ const fn = {
1243
1276
  getInitialState: (e) => ({
1244
1277
  columnVisibility: {},
1245
1278
  ...e
@@ -1284,17 +1317,17 @@ const an = {
1284
1317
  };
1285
1318
  }
1286
1319
  };
1287
- function Z(e, o) {
1320
+ function ne(e, o) {
1288
1321
  return o ? o === "center" ? e.getCenterVisibleLeafColumns() : o === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
1289
1322
  }
1290
- const un = {
1323
+ const dn = {
1291
1324
  createTable: (e) => {
1292
1325
  e._getGlobalFacetedRowModel = e.options.getFacetedRowModel && e.options.getFacetedRowModel(e, "__global__"), e.getGlobalFacetedRowModel = () => e.options.manualFiltering || !e._getGlobalFacetedRowModel ? e.getPreFilteredRowModel() : e._getGlobalFacetedRowModel(), e._getGlobalFacetedUniqueValues = e.options.getFacetedUniqueValues && e.options.getFacetedUniqueValues(e, "__global__"), e.getGlobalFacetedUniqueValues = () => e._getGlobalFacetedUniqueValues ? e._getGlobalFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getGlobalFacetedMinMaxValues = e.options.getFacetedMinMaxValues && e.options.getFacetedMinMaxValues(e, "__global__"), e.getGlobalFacetedMinMaxValues = () => {
1293
1326
  if (e._getGlobalFacetedMinMaxValues)
1294
1327
  return e._getGlobalFacetedMinMaxValues();
1295
1328
  };
1296
1329
  }
1297
- }, fn = {
1330
+ }, gn = {
1298
1331
  getInitialState: (e) => ({
1299
1332
  globalFilter: void 0,
1300
1333
  ...e
@@ -1315,19 +1348,19 @@ const un = {
1315
1348
  };
1316
1349
  },
1317
1350
  createTable: (e) => {
1318
- e.getGlobalAutoFilterFn = () => G.includesString, e.getGlobalFilterFn = () => {
1351
+ e.getGlobalAutoFilterFn = () => B.includesString, e.getGlobalFilterFn = () => {
1319
1352
  var o, t;
1320
1353
  const {
1321
1354
  globalFilterFn: n
1322
1355
  } = e.options;
1323
- return le(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (o = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? o : G[n];
1356
+ return ae(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (o = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? o : B[n];
1324
1357
  }, e.setGlobalFilter = (o) => {
1325
1358
  e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(o);
1326
1359
  }, e.resetGlobalFilter = (o) => {
1327
1360
  e.setGlobalFilter(o ? void 0 : e.initialState.globalFilter);
1328
1361
  };
1329
1362
  }
1330
- }, dn = {
1363
+ }, cn = {
1331
1364
  getInitialState: (e) => ({
1332
1365
  expanded: {},
1333
1366
  ...e
@@ -1389,9 +1422,9 @@ const un = {
1389
1422
  if (l && !t) {
1390
1423
  const {
1391
1424
  [e.id]: s,
1392
- ...u
1425
+ ...a
1393
1426
  } = i;
1394
- return u;
1427
+ return a;
1395
1428
  }
1396
1429
  return n;
1397
1430
  });
@@ -1414,14 +1447,14 @@ const un = {
1414
1447
  };
1415
1448
  };
1416
1449
  }
1417
- }, Ce = 0, Se = 10, ce = () => ({
1418
- pageIndex: Ce,
1419
- pageSize: Se
1420
- }), gn = {
1450
+ }, ye = 0, xe = 10, he = () => ({
1451
+ pageIndex: ye,
1452
+ pageSize: xe
1453
+ }), pn = {
1421
1454
  getInitialState: (e) => ({
1422
1455
  ...e,
1423
1456
  pagination: {
1424
- ...ce(),
1457
+ ...he(),
1425
1458
  ...e == null ? void 0 : e.pagination
1426
1459
  }
1427
1460
  }),
@@ -1445,14 +1478,14 @@ const un = {
1445
1478
  });
1446
1479
  }
1447
1480
  }, e.setPagination = (n) => {
1448
- const r = (l) => O(n, l);
1481
+ const r = (l) => q(n, l);
1449
1482
  return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(r);
1450
1483
  }, e.resetPagination = (n) => {
1451
1484
  var r;
1452
- e.setPagination(n ? ce() : (r = e.initialState.pagination) != null ? r : ce());
1485
+ e.setPagination(n ? he() : (r = e.initialState.pagination) != null ? r : he());
1453
1486
  }, e.setPageIndex = (n) => {
1454
1487
  e.setPagination((r) => {
1455
- let l = O(n, r.pageIndex);
1488
+ let l = q(n, r.pageIndex);
1456
1489
  const i = typeof e.options.pageCount > "u" || e.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : e.options.pageCount - 1;
1457
1490
  return l = Math.max(0, Math.min(l, i)), {
1458
1491
  ...r,
@@ -1461,13 +1494,13 @@ const un = {
1461
1494
  });
1462
1495
  }, e.resetPageIndex = (n) => {
1463
1496
  var r, l;
1464
- e.setPageIndex(n ? Ce : (r = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageIndex) != null ? r : Ce);
1497
+ e.setPageIndex(n ? ye : (r = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageIndex) != null ? r : ye);
1465
1498
  }, e.resetPageSize = (n) => {
1466
1499
  var r, l;
1467
- e.setPageSize(n ? Se : (r = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageSize) != null ? r : Se);
1500
+ e.setPageSize(n ? xe : (r = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageSize) != null ? r : xe);
1468
1501
  }, e.setPageSize = (n) => {
1469
1502
  e.setPagination((r) => {
1470
- const l = Math.max(1, O(n, r.pageSize)), i = r.pageSize * r.pageIndex, s = Math.floor(i / l);
1503
+ const l = Math.max(1, q(n, r.pageSize)), i = r.pageSize * r.pageIndex, s = Math.floor(i / l);
1471
1504
  return {
1472
1505
  ...r,
1473
1506
  pageIndex: s,
@@ -1476,7 +1509,7 @@ const un = {
1476
1509
  });
1477
1510
  }, e.setPageCount = (n) => e.setPagination((r) => {
1478
1511
  var l;
1479
- let i = O(n, (l = e.options.pageCount) != null ? l : -1);
1512
+ let i = q(n, (l = e.options.pageCount) != null ? l : -1);
1480
1513
  return typeof i == "number" && (i = Math.max(-1, i)), {
1481
1514
  ...r,
1482
1515
  pageCount: i
@@ -1497,12 +1530,12 @@ const un = {
1497
1530
  return (n = e.options.rowCount) != null ? n : e.getPrePaginationRowModel().rows.length;
1498
1531
  };
1499
1532
  }
1500
- }, pe = () => ({
1533
+ }, ve = () => ({
1501
1534
  top: [],
1502
1535
  bottom: []
1503
- }), cn = {
1536
+ }), mn = {
1504
1537
  getInitialState: (e) => ({
1505
- rowPinning: pe(),
1538
+ rowPinning: ve(),
1506
1539
  ...e
1507
1540
  }),
1508
1541
  getDefaultOptions: (e) => ({
@@ -1510,36 +1543,36 @@ const un = {
1510
1543
  }),
1511
1544
  createRow: (e, o) => {
1512
1545
  e.pin = (t, n, r) => {
1513
- const l = n ? e.getLeafRows().map((u) => {
1546
+ const l = n ? e.getLeafRows().map((a) => {
1514
1547
  let {
1515
1548
  id: f
1516
- } = u;
1549
+ } = a;
1517
1550
  return f;
1518
- }) : [], i = r ? e.getParentRows().map((u) => {
1551
+ }) : [], i = r ? e.getParentRows().map((a) => {
1519
1552
  let {
1520
1553
  id: f
1521
- } = u;
1554
+ } = a;
1522
1555
  return f;
1523
1556
  }) : [], s = /* @__PURE__ */ new Set([...i, e.id, ...l]);
1524
- o.setRowPinning((u) => {
1557
+ o.setRowPinning((a) => {
1525
1558
  var f, p;
1526
1559
  if (t === "bottom") {
1527
1560
  var c, d;
1528
1561
  return {
1529
- top: ((c = u == null ? void 0 : u.top) != null ? c : []).filter((h) => !(s != null && s.has(h))),
1530
- bottom: [...((d = u == null ? void 0 : u.bottom) != null ? d : []).filter((h) => !(s != null && s.has(h))), ...Array.from(s)]
1562
+ top: ((c = a == null ? void 0 : a.top) != null ? c : []).filter((h) => !(s != null && s.has(h))),
1563
+ bottom: [...((d = a == null ? void 0 : a.bottom) != null ? d : []).filter((h) => !(s != null && s.has(h))), ...Array.from(s)]
1531
1564
  };
1532
1565
  }
1533
1566
  if (t === "top") {
1534
- var a, m;
1567
+ var u, m;
1535
1568
  return {
1536
- top: [...((a = u == null ? void 0 : u.top) != null ? a : []).filter((h) => !(s != null && s.has(h))), ...Array.from(s)],
1537
- bottom: ((m = u == null ? void 0 : u.bottom) != null ? m : []).filter((h) => !(s != null && s.has(h)))
1569
+ top: [...((u = a == null ? void 0 : a.top) != null ? u : []).filter((h) => !(s != null && s.has(h))), ...Array.from(s)],
1570
+ bottom: ((m = a == null ? void 0 : a.bottom) != null ? m : []).filter((h) => !(s != null && s.has(h)))
1538
1571
  };
1539
1572
  }
1540
1573
  return {
1541
- top: ((f = u == null ? void 0 : u.top) != null ? f : []).filter((h) => !(s != null && s.has(h))),
1542
- bottom: ((p = u == null ? void 0 : u.bottom) != null ? p : []).filter((h) => !(s != null && s.has(h)))
1574
+ top: ((f = a == null ? void 0 : a.top) != null ? f : []).filter((h) => !(s != null && s.has(h))),
1575
+ bottom: ((p = a == null ? void 0 : a.bottom) != null ? p : []).filter((h) => !(s != null && s.has(h)))
1543
1576
  };
1544
1577
  });
1545
1578
  }, e.getCanPin = () => {
@@ -1571,7 +1604,7 @@ const un = {
1571
1604
  createTable: (e) => {
1572
1605
  e.setRowPinning = (o) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(o), e.resetRowPinning = (o) => {
1573
1606
  var t, n;
1574
- return e.setRowPinning(o ? pe() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : pe());
1607
+ return e.setRowPinning(o ? ve() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : ve());
1575
1608
  }, e.getIsSomeRowsPinned = (o) => {
1576
1609
  var t;
1577
1610
  const n = e.getState().rowPinning;
@@ -1601,7 +1634,7 @@ const un = {
1601
1634
  return o.filter((l) => !r.has(l.id));
1602
1635
  }, S(e.options, "debugRows", "getCenterRows"));
1603
1636
  }
1604
- }, pn = {
1637
+ }, hn = {
1605
1638
  getInitialState: (e) => ({
1606
1639
  rowSelection: {},
1607
1640
  ...e
@@ -1636,17 +1669,17 @@ const un = {
1636
1669
  ...t
1637
1670
  };
1638
1671
  return e.getRowModel().rows.forEach((l) => {
1639
- Re(r, l.id, n, !0, e);
1672
+ _e(r, l.id, n, !0, e);
1640
1673
  }), r;
1641
- }), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = C(() => [e.getState().rowSelection, e.getCoreRowModel()], (o, t) => Object.keys(o).length ? me(e, t) : {
1674
+ }), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = C(() => [e.getState().rowSelection, e.getCoreRowModel()], (o, t) => Object.keys(o).length ? we(e, t) : {
1642
1675
  rows: [],
1643
1676
  flatRows: [],
1644
1677
  rowsById: {}
1645
- }, S(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = C(() => [e.getState().rowSelection, e.getFilteredRowModel()], (o, t) => Object.keys(o).length ? me(e, t) : {
1678
+ }, S(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = C(() => [e.getState().rowSelection, e.getFilteredRowModel()], (o, t) => Object.keys(o).length ? we(e, t) : {
1646
1679
  rows: [],
1647
1680
  flatRows: [],
1648
1681
  rowsById: {}
1649
- }, S(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = C(() => [e.getState().rowSelection, e.getSortedRowModel()], (o, t) => Object.keys(o).length ? me(e, t) : {
1682
+ }, S(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = C(() => [e.getState().rowSelection, e.getSortedRowModel()], (o, t) => Object.keys(o).length ? we(e, t) : {
1650
1683
  rows: [],
1651
1684
  flatRows: [],
1652
1685
  rowsById: {}
@@ -1685,23 +1718,23 @@ const un = {
1685
1718
  const s = {
1686
1719
  ...l
1687
1720
  };
1688
- return Re(s, e.id, t, (i = n == null ? void 0 : n.selectChildren) != null ? i : !0, o), s;
1721
+ return _e(s, e.id, t, (i = n == null ? void 0 : n.selectChildren) != null ? i : !0, o), s;
1689
1722
  });
1690
1723
  }, e.getIsSelected = () => {
1691
1724
  const {
1692
1725
  rowSelection: t
1693
1726
  } = o.getState();
1694
- return Ve(e, t);
1727
+ return Ee(e, t);
1695
1728
  }, e.getIsSomeSelected = () => {
1696
1729
  const {
1697
1730
  rowSelection: t
1698
1731
  } = o.getState();
1699
- return ye(e, t) === "some";
1732
+ return Fe(e, t) === "some";
1700
1733
  }, e.getIsAllSubRowsSelected = () => {
1701
1734
  const {
1702
1735
  rowSelection: t
1703
1736
  } = o.getState();
1704
- return ye(e, t) === "all";
1737
+ return Fe(e, t) === "all";
1705
1738
  }, e.getCanSelect = () => {
1706
1739
  var t;
1707
1740
  return typeof o.options.enableRowSelection == "function" ? o.options.enableRowSelection(e) : (t = o.options.enableRowSelection) != null ? t : !0;
@@ -1719,21 +1752,21 @@ const un = {
1719
1752
  };
1720
1753
  };
1721
1754
  }
1722
- }, Re = (e, o, t, n, r) => {
1755
+ }, _e = (e, o, t, n, r) => {
1723
1756
  var l;
1724
1757
  const i = r.getRow(o, !0);
1725
- t ? (i.getCanMultiSelect() || Object.keys(e).forEach((s) => delete e[s]), i.getCanSelect() && (e[o] = !0)) : delete e[o], n && (l = i.subRows) != null && l.length && i.getCanSelectSubRows() && i.subRows.forEach((s) => Re(e, s.id, t, n, r));
1758
+ t ? (i.getCanMultiSelect() || Object.keys(e).forEach((s) => delete e[s]), i.getCanSelect() && (e[o] = !0)) : delete e[o], n && (l = i.subRows) != null && l.length && i.getCanSelectSubRows() && i.subRows.forEach((s) => _e(e, s.id, t, n, r));
1726
1759
  };
1727
- function me(e, o) {
1760
+ function we(e, o) {
1728
1761
  const t = e.getState().rowSelection, n = [], r = {}, l = function(i, s) {
1729
- return i.map((u) => {
1762
+ return i.map((a) => {
1730
1763
  var f;
1731
- const p = Ve(u, t);
1732
- if (p && (n.push(u), r[u.id] = u), (f = u.subRows) != null && f.length && (u = {
1733
- ...u,
1734
- subRows: l(u.subRows)
1764
+ const p = Ee(a, t);
1765
+ if (p && (n.push(a), r[a.id] = a), (f = a.subRows) != null && f.length && (a = {
1766
+ ...a,
1767
+ subRows: l(a.subRows)
1735
1768
  }), p)
1736
- return u;
1769
+ return a;
1737
1770
  }).filter(Boolean);
1738
1771
  };
1739
1772
  return {
@@ -1742,43 +1775,43 @@ function me(e, o) {
1742
1775
  rowsById: r
1743
1776
  };
1744
1777
  }
1745
- function Ve(e, o) {
1778
+ function Ee(e, o) {
1746
1779
  var t;
1747
1780
  return (t = o[e.id]) != null ? t : !1;
1748
1781
  }
1749
- function ye(e, o, t) {
1782
+ function Fe(e, o, t) {
1750
1783
  var n;
1751
1784
  if (!((n = e.subRows) != null && n.length)) return !1;
1752
1785
  let r = !0, l = !1;
1753
1786
  return e.subRows.forEach((i) => {
1754
- if (!(l && !r) && (i.getCanSelect() && (Ve(i, o) ? l = !0 : r = !1), i.subRows && i.subRows.length)) {
1755
- const s = ye(i, o);
1787
+ if (!(l && !r) && (i.getCanSelect() && (Ee(i, o) ? l = !0 : r = !1), i.subRows && i.subRows.length)) {
1788
+ const s = Fe(i, o);
1756
1789
  s === "all" ? l = !0 : (s === "some" && (l = !0), r = !1);
1757
1790
  }
1758
1791
  }), r ? "all" : l ? "some" : !1;
1759
1792
  }
1760
- const xe = /([0-9]+)/gm, mn = (e, o, t) => et(B(e.getValue(t)).toLowerCase(), B(o.getValue(t)).toLowerCase()), hn = (e, o, t) => et(B(e.getValue(t)), B(o.getValue(t))), vn = (e, o, t) => Ne(B(e.getValue(t)).toLowerCase(), B(o.getValue(t)).toLowerCase()), wn = (e, o, t) => Ne(B(e.getValue(t)), B(o.getValue(t))), Cn = (e, o, t) => {
1793
+ const $e = /([0-9]+)/gm, vn = (e, o, t) => ot(U(e.getValue(t)).toLowerCase(), U(o.getValue(t)).toLowerCase()), wn = (e, o, t) => ot(U(e.getValue(t)), U(o.getValue(t))), Cn = (e, o, t) => De(U(e.getValue(t)).toLowerCase(), U(o.getValue(t)).toLowerCase()), Sn = (e, o, t) => De(U(e.getValue(t)), U(o.getValue(t))), Rn = (e, o, t) => {
1761
1794
  const n = e.getValue(t), r = o.getValue(t);
1762
1795
  return n > r ? 1 : n < r ? -1 : 0;
1763
- }, Sn = (e, o, t) => Ne(e.getValue(t), o.getValue(t));
1764
- function Ne(e, o) {
1796
+ }, yn = (e, o, t) => De(e.getValue(t), o.getValue(t));
1797
+ function De(e, o) {
1765
1798
  return e === o ? 0 : e > o ? 1 : -1;
1766
1799
  }
1767
- function B(e) {
1800
+ function U(e) {
1768
1801
  return typeof e == "number" ? isNaN(e) || e === 1 / 0 || e === -1 / 0 ? "" : String(e) : typeof e == "string" ? e : "";
1769
1802
  }
1770
- function et(e, o) {
1771
- const t = e.split(xe).filter(Boolean), n = o.split(xe).filter(Boolean);
1803
+ function ot(e, o) {
1804
+ const t = e.split($e).filter(Boolean), n = o.split($e).filter(Boolean);
1772
1805
  for (; t.length && n.length; ) {
1773
- const r = t.shift(), l = n.shift(), i = parseInt(r, 10), s = parseInt(l, 10), u = [i, s].sort();
1774
- if (isNaN(u[0])) {
1806
+ const r = t.shift(), l = n.shift(), i = parseInt(r, 10), s = parseInt(l, 10), a = [i, s].sort();
1807
+ if (isNaN(a[0])) {
1775
1808
  if (r > l)
1776
1809
  return 1;
1777
1810
  if (l > r)
1778
1811
  return -1;
1779
1812
  continue;
1780
1813
  }
1781
- if (isNaN(u[1]))
1814
+ if (isNaN(a[1]))
1782
1815
  return isNaN(i) ? -1 : 1;
1783
1816
  if (i > s)
1784
1817
  return 1;
@@ -1787,14 +1820,14 @@ function et(e, o) {
1787
1820
  }
1788
1821
  return t.length - n.length;
1789
1822
  }
1790
- const J = {
1791
- alphanumeric: mn,
1792
- alphanumericCaseSensitive: hn,
1793
- text: vn,
1794
- textCaseSensitive: wn,
1795
- datetime: Cn,
1796
- basic: Sn
1797
- }, Rn = {
1823
+ const te = {
1824
+ alphanumeric: vn,
1825
+ alphanumericCaseSensitive: wn,
1826
+ text: Cn,
1827
+ textCaseSensitive: Sn,
1828
+ datetime: Rn,
1829
+ basic: yn
1830
+ }, xn = {
1798
1831
  getInitialState: (e) => ({
1799
1832
  sorting: [],
1800
1833
  ...e
@@ -1814,11 +1847,11 @@ const J = {
1814
1847
  for (const r of t) {
1815
1848
  const l = r == null ? void 0 : r.getValue(e.id);
1816
1849
  if (Object.prototype.toString.call(l) === "[object Date]")
1817
- return J.datetime;
1818
- if (typeof l == "string" && (n = !0, l.split(xe).length > 1))
1819
- return J.alphanumeric;
1850
+ return te.datetime;
1851
+ if (typeof l == "string" && (n = !0, l.split($e).length > 1))
1852
+ return te.alphanumeric;
1820
1853
  }
1821
- return n ? J.text : J.basic;
1854
+ return n ? te.text : te.basic;
1822
1855
  }, e.getAutoSortDir = () => {
1823
1856
  const t = o.getFilteredRowModel().flatRows[0];
1824
1857
  return typeof (t == null ? void 0 : t.getValue(e.id)) == "string" ? "asc" : "desc";
@@ -1826,22 +1859,22 @@ const J = {
1826
1859
  var t, n;
1827
1860
  if (!e)
1828
1861
  throw new Error();
1829
- return le(e.columnDef.sortingFn) ? e.columnDef.sortingFn : e.columnDef.sortingFn === "auto" ? e.getAutoSortingFn() : (t = (n = o.options.sortingFns) == null ? void 0 : n[e.columnDef.sortingFn]) != null ? t : J[e.columnDef.sortingFn];
1862
+ return ae(e.columnDef.sortingFn) ? e.columnDef.sortingFn : e.columnDef.sortingFn === "auto" ? e.getAutoSortingFn() : (t = (n = o.options.sortingFns) == null ? void 0 : n[e.columnDef.sortingFn]) != null ? t : te[e.columnDef.sortingFn];
1830
1863
  }, e.toggleSorting = (t, n) => {
1831
1864
  const r = e.getNextSortingOrder(), l = typeof t < "u" && t !== null;
1832
1865
  o.setSorting((i) => {
1833
- const s = i == null ? void 0 : i.find((a) => a.id === e.id), u = i == null ? void 0 : i.findIndex((a) => a.id === e.id);
1866
+ const s = i == null ? void 0 : i.find((u) => u.id === e.id), a = i == null ? void 0 : i.findIndex((u) => u.id === e.id);
1834
1867
  let f = [], p, c = l ? t : r === "desc";
1835
- if (i != null && i.length && e.getCanMultiSort() && n ? s ? p = "toggle" : p = "add" : i != null && i.length && u !== i.length - 1 ? p = "replace" : s ? p = "toggle" : p = "replace", p === "toggle" && (l || r || (p = "remove")), p === "add") {
1868
+ if (i != null && i.length && e.getCanMultiSort() && n ? s ? p = "toggle" : p = "add" : i != null && i.length && a !== i.length - 1 ? p = "replace" : s ? p = "toggle" : p = "replace", p === "toggle" && (l || r || (p = "remove")), p === "add") {
1836
1869
  var d;
1837
1870
  f = [...i, {
1838
1871
  id: e.id,
1839
1872
  desc: c
1840
1873
  }], f.splice(0, f.length - ((d = o.options.maxMultiSortColCount) != null ? d : Number.MAX_SAFE_INTEGER));
1841
- } else p === "toggle" ? f = i.map((a) => a.id === e.id ? {
1842
- ...a,
1874
+ } else p === "toggle" ? f = i.map((u) => u.id === e.id ? {
1875
+ ...u,
1843
1876
  desc: c
1844
- } : a) : p === "remove" ? f = i.filter((a) => a.id !== e.id) : f = [{
1877
+ } : u) : p === "remove" ? f = i.filter((u) => u.id !== e.id) : f = [{
1845
1878
  id: e.id,
1846
1879
  desc: c
1847
1880
  }];
@@ -1883,44 +1916,44 @@ const J = {
1883
1916
  e.setSorting(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.sorting) != null ? t : []);
1884
1917
  }, e.getPreSortedRowModel = () => e.getGroupedRowModel(), e.getSortedRowModel = () => (!e._getSortedRowModel && e.options.getSortedRowModel && (e._getSortedRowModel = e.options.getSortedRowModel(e)), e.options.manualSorting || !e._getSortedRowModel ? e.getPreSortedRowModel() : e._getSortedRowModel());
1885
1918
  }
1886
- }, yn = [
1887
- Bt,
1888
- an,
1889
- nn,
1890
- on,
1891
- Tt,
1919
+ }, _n = [
1892
1920
  qt,
1893
- un,
1894
- //depends on ColumnFaceting
1895
1921
  fn,
1896
- //depends on ColumnFiltering
1897
- Rn,
1898
- en,
1899
- //depends on RowSorting
1922
+ rn,
1923
+ ln,
1924
+ jt,
1925
+ Ut,
1900
1926
  dn,
1927
+ //depends on ColumnFaceting
1901
1928
  gn,
1929
+ //depends on ColumnFiltering
1930
+ xn,
1931
+ nn,
1932
+ //depends on RowSorting
1902
1933
  cn,
1903
1934
  pn,
1904
- ln
1935
+ mn,
1936
+ hn,
1937
+ an
1905
1938
  ];
1906
- function xn(e) {
1939
+ function Fn(e) {
1907
1940
  var o, t;
1908
1941
  process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
1909
- const n = [...yn, ...(o = e._features) != null ? o : []];
1942
+ const n = [..._n, ...(o = e._features) != null ? o : []];
1910
1943
  let r = {
1911
1944
  _features: n
1912
1945
  };
1913
- const l = r._features.reduce((d, a) => Object.assign(d, a.getDefaultOptions == null ? void 0 : a.getDefaultOptions(r)), {}), i = (d) => r.options.mergeOptions ? r.options.mergeOptions(l, d) : {
1946
+ const l = r._features.reduce((d, u) => Object.assign(d, u.getDefaultOptions == null ? void 0 : u.getDefaultOptions(r)), {}), i = (d) => r.options.mergeOptions ? r.options.mergeOptions(l, d) : {
1914
1947
  ...l,
1915
1948
  ...d
1916
1949
  };
1917
- let u = {
1950
+ let a = {
1918
1951
  ...{},
1919
1952
  ...(t = e.initialState) != null ? t : {}
1920
1953
  };
1921
1954
  r._features.forEach((d) => {
1922
- var a;
1923
- u = (a = d.getInitialState == null ? void 0 : d.getInitialState(u)) != null ? a : u;
1955
+ var u;
1956
+ a = (u = d.getInitialState == null ? void 0 : d.getInitialState(a)) != null ? u : a;
1924
1957
  });
1925
1958
  const f = [];
1926
1959
  let p = !1;
@@ -1930,45 +1963,45 @@ function xn(e) {
1930
1963
  ...l,
1931
1964
  ...e
1932
1965
  },
1933
- initialState: u,
1966
+ initialState: a,
1934
1967
  _queue: (d) => {
1935
1968
  f.push(d), p || (p = !0, Promise.resolve().then(() => {
1936
1969
  for (; f.length; )
1937
1970
  f.shift()();
1938
1971
  p = !1;
1939
- }).catch((a) => setTimeout(() => {
1940
- throw a;
1972
+ }).catch((u) => setTimeout(() => {
1973
+ throw u;
1941
1974
  })));
1942
1975
  },
1943
1976
  reset: () => {
1944
1977
  r.setState(r.initialState);
1945
1978
  },
1946
1979
  setOptions: (d) => {
1947
- const a = O(d, r.options);
1948
- r.options = i(a);
1980
+ const u = q(d, r.options);
1981
+ r.options = i(u);
1949
1982
  },
1950
1983
  getState: () => r.options.state,
1951
1984
  setState: (d) => {
1952
1985
  r.options.onStateChange == null || r.options.onStateChange(d);
1953
1986
  },
1954
- _getRowId: (d, a, m) => {
1987
+ _getRowId: (d, u, m) => {
1955
1988
  var h;
1956
- return (h = r.options.getRowId == null ? void 0 : r.options.getRowId(d, a, m)) != null ? h : `${m ? [m.id, a].join(".") : a}`;
1989
+ return (h = r.options.getRowId == null ? void 0 : r.options.getRowId(d, u, m)) != null ? h : `${m ? [m.id, u].join(".") : u}`;
1957
1990
  },
1958
1991
  getCoreRowModel: () => (r._getCoreRowModel || (r._getCoreRowModel = r.options.getCoreRowModel(r)), r._getCoreRowModel()),
1959
1992
  // The final calls start at the bottom of the model,
1960
1993
  // expanded rows, which then work their way up
1961
1994
  getRowModel: () => r.getPaginationRowModel(),
1962
1995
  //in next version, we should just pass in the row model as the optional 2nd arg
1963
- getRow: (d, a) => {
1964
- let m = (a ? r.getPrePaginationRowModel() : r.getRowModel()).rowsById[d];
1996
+ getRow: (d, u) => {
1997
+ let m = (u ? r.getPrePaginationRowModel() : r.getRowModel()).rowsById[d];
1965
1998
  if (!m && (m = r.getCoreRowModel().rowsById[d], !m))
1966
1999
  throw process.env.NODE_ENV !== "production" ? new Error(`getRow could not find row with ID: ${d}`) : new Error();
1967
2000
  return m;
1968
2001
  },
1969
2002
  _getDefaultColumnDef: C(() => [r.options.defaultColumn], (d) => {
1970
- var a;
1971
- return d = (a = d) != null ? a : {}, {
2003
+ var u;
2004
+ return d = (u = d) != null ? u : {}, {
1972
2005
  header: (m) => {
1973
2006
  const h = m.header.column.columnDef;
1974
2007
  return h.accessorKey ? h.accessorKey : h.accessorFn ? h.id : null;
@@ -1984,33 +2017,33 @@ function xn(e) {
1984
2017
  }, S(e, "debugColumns", "_getDefaultColumnDef")),
1985
2018
  _getColumnDefs: () => r.options.columns,
1986
2019
  getAllColumns: C(() => [r._getColumnDefs()], (d) => {
1987
- const a = function(m, h, w) {
2020
+ const u = function(m, h, w) {
1988
2021
  return w === void 0 && (w = 0), m.map((R) => {
1989
- const x = bt(r, R, w, h), $ = R;
1990
- return x.columns = $.columns ? a($.columns, x, w + 1) : [], x;
2022
+ const _ = Tt(r, R, w, h), $ = R;
2023
+ return _.columns = $.columns ? u($.columns, _, w + 1) : [], _;
1991
2024
  });
1992
2025
  };
1993
- return a(d);
2026
+ return u(d);
1994
2027
  }, S(e, "debugColumns", "getAllColumns")),
1995
- getAllFlatColumns: C(() => [r.getAllColumns()], (d) => d.flatMap((a) => a.getFlatColumns()), S(e, "debugColumns", "getAllFlatColumns")),
1996
- _getAllFlatColumnsById: C(() => [r.getAllFlatColumns()], (d) => d.reduce((a, m) => (a[m.id] = m, a), {}), S(e, "debugColumns", "getAllFlatColumnsById")),
1997
- getAllLeafColumns: C(() => [r.getAllColumns(), r._getOrderColumnsFn()], (d, a) => {
2028
+ getAllFlatColumns: C(() => [r.getAllColumns()], (d) => d.flatMap((u) => u.getFlatColumns()), S(e, "debugColumns", "getAllFlatColumns")),
2029
+ _getAllFlatColumnsById: C(() => [r.getAllFlatColumns()], (d) => d.reduce((u, m) => (u[m.id] = m, u), {}), S(e, "debugColumns", "getAllFlatColumnsById")),
2030
+ getAllLeafColumns: C(() => [r.getAllColumns(), r._getOrderColumnsFn()], (d, u) => {
1998
2031
  let m = d.flatMap((h) => h.getLeafColumns());
1999
- return a(m);
2032
+ return u(m);
2000
2033
  }, S(e, "debugColumns", "getAllLeafColumns")),
2001
2034
  getColumn: (d) => {
2002
- const a = r._getAllFlatColumnsById()[d];
2003
- return process.env.NODE_ENV !== "production" && !a && console.error(`[Table] Column with id '${d}' does not exist.`), a;
2035
+ const u = r._getAllFlatColumnsById()[d];
2036
+ return process.env.NODE_ENV !== "production" && !u && console.error(`[Table] Column with id '${d}' does not exist.`), u;
2004
2037
  }
2005
2038
  };
2006
2039
  Object.assign(r, c);
2007
2040
  for (let d = 0; d < r._features.length; d++) {
2008
- const a = r._features[d];
2009
- a == null || a.createTable == null || a.createTable(r);
2041
+ const u = r._features[d];
2042
+ u == null || u.createTable == null || u.createTable(r);
2010
2043
  }
2011
2044
  return r;
2012
2045
  }
2013
- function _n() {
2046
+ function $n() {
2014
2047
  return (e) => C(() => [e.options.data], (o) => {
2015
2048
  const t = {
2016
2049
  rows: [],
@@ -2020,10 +2053,10 @@ function _n() {
2020
2053
  l === void 0 && (l = 0);
2021
2054
  const s = [];
2022
2055
  for (let f = 0; f < r.length; f++) {
2023
- const p = Me(e, e._getRowId(r[f], f, i), r[f], f, l, void 0, i == null ? void 0 : i.id);
2056
+ const p = Ne(e, e._getRowId(r[f], f, i), r[f], f, l, void 0, i == null ? void 0 : i.id);
2024
2057
  if (t.flatRows.push(p), t.rowsById[p.id] = p, s.push(p), e.options.getSubRows) {
2025
- var u;
2026
- p.originalSubRows = e.options.getSubRows(r[f], f), (u = p.originalSubRows) != null && u.length && (p.subRows = n(p.originalSubRows, l + 1, p));
2058
+ var a;
2059
+ p.originalSubRows = e.options.getSubRows(r[f], f), (a = p.originalSubRows) != null && a.length && (p.subRows = n(p.originalSubRows, l + 1, p));
2027
2060
  }
2028
2061
  }
2029
2062
  return s;
@@ -2031,7 +2064,7 @@ function _n() {
2031
2064
  return t.rows = n(o), t;
2032
2065
  }, S(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
2033
2066
  }
2034
- function Fn(e) {
2067
+ function Mn(e) {
2035
2068
  const o = [], t = (n) => {
2036
2069
  var r;
2037
2070
  o.push(n), (r = n.subRows) != null && r.length && n.getIsExpanded() && n.subRows.forEach(t);
@@ -2042,29 +2075,29 @@ function Fn(e) {
2042
2075
  rowsById: e.rowsById
2043
2076
  };
2044
2077
  }
2045
- function $n(e, o, t) {
2046
- return t.options.filterFromLeafRows ? Mn(e, o, t) : In(e, o, t);
2078
+ function In(e, o, t) {
2079
+ return t.options.filterFromLeafRows ? Vn(e, o, t) : Nn(e, o, t);
2047
2080
  }
2048
- function Mn(e, o, t) {
2081
+ function Vn(e, o, t) {
2049
2082
  var n;
2050
- const r = [], l = {}, i = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, s = function(u, f) {
2083
+ const r = [], l = {}, i = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, s = function(a, f) {
2051
2084
  f === void 0 && (f = 0);
2052
2085
  const p = [];
2053
- for (let d = 0; d < u.length; d++) {
2086
+ for (let d = 0; d < a.length; d++) {
2054
2087
  var c;
2055
- let a = u[d];
2056
- const m = Me(t, a.id, a.original, a.index, a.depth, void 0, a.parentId);
2057
- if (m.columnFilters = a.columnFilters, (c = a.subRows) != null && c.length && f < i) {
2058
- if (m.subRows = s(a.subRows, f + 1), a = m, o(a) && !m.subRows.length) {
2059
- p.push(a), l[a.id] = a, r.push(a);
2088
+ let u = a[d];
2089
+ const m = Ne(t, u.id, u.original, u.index, u.depth, void 0, u.parentId);
2090
+ if (m.columnFilters = u.columnFilters, (c = u.subRows) != null && c.length && f < i) {
2091
+ if (m.subRows = s(u.subRows, f + 1), u = m, o(u) && !m.subRows.length) {
2092
+ p.push(u), l[u.id] = u, r.push(u);
2060
2093
  continue;
2061
2094
  }
2062
- if (o(a) || m.subRows.length) {
2063
- p.push(a), l[a.id] = a, r.push(a);
2095
+ if (o(u) || m.subRows.length) {
2096
+ p.push(u), l[u.id] = u, r.push(u);
2064
2097
  continue;
2065
2098
  }
2066
2099
  } else
2067
- a = m, o(a) && (p.push(a), l[a.id] = a, r.push(a));
2100
+ u = m, o(u) && (p.push(u), l[u.id] = u, r.push(u));
2068
2101
  }
2069
2102
  return p;
2070
2103
  };
@@ -2074,20 +2107,20 @@ function Mn(e, o, t) {
2074
2107
  rowsById: l
2075
2108
  };
2076
2109
  }
2077
- function In(e, o, t) {
2110
+ function Nn(e, o, t) {
2078
2111
  var n;
2079
- const r = [], l = {}, i = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, s = function(u, f) {
2112
+ const r = [], l = {}, i = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, s = function(a, f) {
2080
2113
  f === void 0 && (f = 0);
2081
2114
  const p = [];
2082
- for (let d = 0; d < u.length; d++) {
2083
- let a = u[d];
2084
- if (o(a)) {
2115
+ for (let d = 0; d < a.length; d++) {
2116
+ let u = a[d];
2117
+ if (o(u)) {
2085
2118
  var c;
2086
- if ((c = a.subRows) != null && c.length && f < i) {
2087
- const h = Me(t, a.id, a.original, a.index, a.depth, void 0, a.parentId);
2088
- h.subRows = s(a.subRows, f + 1), a = h;
2119
+ if ((c = u.subRows) != null && c.length && f < i) {
2120
+ const h = Ne(t, u.id, u.original, u.index, u.depth, void 0, u.parentId);
2121
+ h.subRows = s(u.subRows, f + 1), u = h;
2089
2122
  }
2090
- p.push(a), r.push(a), l[a.id] = a;
2123
+ p.push(u), r.push(u), l[u.id] = u;
2091
2124
  }
2092
2125
  }
2093
2126
  return p;
@@ -2098,7 +2131,7 @@ function In(e, o, t) {
2098
2131
  rowsById: l
2099
2132
  };
2100
2133
  }
2101
- function Vn() {
2134
+ function Pn() {
2102
2135
  return (e) => C(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter], (o, t, n) => {
2103
2136
  if (!o.rows.length || !(t != null && t.length) && !n) {
2104
2137
  for (let d = 0; d < o.flatRows.length; d++)
@@ -2107,7 +2140,7 @@ function Vn() {
2107
2140
  }
2108
2141
  const r = [], l = [];
2109
2142
  (t ?? []).forEach((d) => {
2110
- var a;
2143
+ var u;
2111
2144
  const m = e.getColumn(d.id);
2112
2145
  if (!m)
2113
2146
  return;
@@ -2119,53 +2152,53 @@ function Vn() {
2119
2152
  r.push({
2120
2153
  id: d.id,
2121
2154
  filterFn: h,
2122
- resolvedValue: (a = h.resolveFilterValue == null ? void 0 : h.resolveFilterValue(d.value)) != null ? a : d.value
2155
+ resolvedValue: (u = h.resolveFilterValue == null ? void 0 : h.resolveFilterValue(d.value)) != null ? u : d.value
2123
2156
  });
2124
2157
  });
2125
- const i = (t ?? []).map((d) => d.id), s = e.getGlobalFilterFn(), u = e.getAllLeafColumns().filter((d) => d.getCanGlobalFilter());
2126
- n && s && u.length && (i.push("__global__"), u.forEach((d) => {
2127
- var a;
2158
+ const i = (t ?? []).map((d) => d.id), s = e.getGlobalFilterFn(), a = e.getAllLeafColumns().filter((d) => d.getCanGlobalFilter());
2159
+ n && s && a.length && (i.push("__global__"), a.forEach((d) => {
2160
+ var u;
2128
2161
  l.push({
2129
2162
  id: d.id,
2130
2163
  filterFn: s,
2131
- resolvedValue: (a = s.resolveFilterValue == null ? void 0 : s.resolveFilterValue(n)) != null ? a : n
2164
+ resolvedValue: (u = s.resolveFilterValue == null ? void 0 : s.resolveFilterValue(n)) != null ? u : n
2132
2165
  });
2133
2166
  }));
2134
2167
  let f, p;
2135
2168
  for (let d = 0; d < o.flatRows.length; d++) {
2136
- const a = o.flatRows[d];
2137
- if (a.columnFilters = {}, r.length)
2169
+ const u = o.flatRows[d];
2170
+ if (u.columnFilters = {}, r.length)
2138
2171
  for (let m = 0; m < r.length; m++) {
2139
2172
  f = r[m];
2140
2173
  const h = f.id;
2141
- a.columnFilters[h] = f.filterFn(a, h, f.resolvedValue, (w) => {
2142
- a.columnFiltersMeta[h] = w;
2174
+ u.columnFilters[h] = f.filterFn(u, h, f.resolvedValue, (w) => {
2175
+ u.columnFiltersMeta[h] = w;
2143
2176
  });
2144
2177
  }
2145
2178
  if (l.length) {
2146
2179
  for (let m = 0; m < l.length; m++) {
2147
2180
  p = l[m];
2148
2181
  const h = p.id;
2149
- if (p.filterFn(a, h, p.resolvedValue, (w) => {
2150
- a.columnFiltersMeta[h] = w;
2182
+ if (p.filterFn(u, h, p.resolvedValue, (w) => {
2183
+ u.columnFiltersMeta[h] = w;
2151
2184
  })) {
2152
- a.columnFilters.__global__ = !0;
2185
+ u.columnFilters.__global__ = !0;
2153
2186
  break;
2154
2187
  }
2155
2188
  }
2156
- a.columnFilters.__global__ !== !0 && (a.columnFilters.__global__ = !1);
2189
+ u.columnFilters.__global__ !== !0 && (u.columnFilters.__global__ = !1);
2157
2190
  }
2158
2191
  }
2159
2192
  const c = (d) => {
2160
- for (let a = 0; a < i.length; a++)
2161
- if (d.columnFilters[i[a]] === !1)
2193
+ for (let u = 0; u < i.length; u++)
2194
+ if (d.columnFilters[i[u]] === !1)
2162
2195
  return !1;
2163
2196
  return !0;
2164
2197
  };
2165
- return $n(o.rows, c, e);
2198
+ return In(o.rows, c, e);
2166
2199
  }, S(e.options, "debugTable", "getFilteredRowModel", () => e._autoResetPageIndex()));
2167
2200
  }
2168
- function Nn(e) {
2201
+ function En(e) {
2169
2202
  return (o) => C(() => [o.getState().pagination, o.getPrePaginationRowModel(), o.options.paginateExpandedRows ? void 0 : o.getState().expanded], (t, n) => {
2170
2203
  if (!n.rows.length)
2171
2204
  return n;
@@ -2176,7 +2209,7 @@ function Nn(e) {
2176
2209
  let {
2177
2210
  rows: i,
2178
2211
  flatRows: s,
2179
- rowsById: u
2212
+ rowsById: a
2180
2213
  } = n;
2181
2214
  const f = r * l, p = f + r;
2182
2215
  i = i.slice(f, p);
@@ -2184,53 +2217,53 @@ function Nn(e) {
2184
2217
  o.options.paginateExpandedRows ? c = {
2185
2218
  rows: i,
2186
2219
  flatRows: s,
2187
- rowsById: u
2188
- } : c = Fn({
2220
+ rowsById: a
2221
+ } : c = Mn({
2189
2222
  rows: i,
2190
2223
  flatRows: s,
2191
- rowsById: u
2224
+ rowsById: a
2192
2225
  }), c.flatRows = [];
2193
- const d = (a) => {
2194
- c.flatRows.push(a), a.subRows.length && a.subRows.forEach(d);
2226
+ const d = (u) => {
2227
+ c.flatRows.push(u), u.subRows.length && u.subRows.forEach(d);
2195
2228
  };
2196
2229
  return c.rows.forEach(d), c;
2197
2230
  }, S(o.options, "debugTable", "getPaginationRowModel"));
2198
2231
  }
2199
- function Pn() {
2232
+ function Dn() {
2200
2233
  return (e) => C(() => [e.getState().sorting, e.getPreSortedRowModel()], (o, t) => {
2201
2234
  if (!t.rows.length || !(o != null && o.length))
2202
2235
  return t;
2203
- const n = e.getState().sorting, r = [], l = n.filter((u) => {
2236
+ const n = e.getState().sorting, r = [], l = n.filter((a) => {
2204
2237
  var f;
2205
- return (f = e.getColumn(u.id)) == null ? void 0 : f.getCanSort();
2238
+ return (f = e.getColumn(a.id)) == null ? void 0 : f.getCanSort();
2206
2239
  }), i = {};
2207
- l.forEach((u) => {
2208
- const f = e.getColumn(u.id);
2209
- f && (i[u.id] = {
2240
+ l.forEach((a) => {
2241
+ const f = e.getColumn(a.id);
2242
+ f && (i[a.id] = {
2210
2243
  sortUndefined: f.columnDef.sortUndefined,
2211
2244
  invertSorting: f.columnDef.invertSorting,
2212
2245
  sortingFn: f.getSortingFn()
2213
2246
  });
2214
2247
  });
2215
- const s = (u) => {
2216
- const f = u.map((p) => ({
2248
+ const s = (a) => {
2249
+ const f = a.map((p) => ({
2217
2250
  ...p
2218
2251
  }));
2219
2252
  return f.sort((p, c) => {
2220
- for (let a = 0; a < l.length; a += 1) {
2253
+ for (let u = 0; u < l.length; u += 1) {
2221
2254
  var d;
2222
- const m = l[a], h = i[m.id], w = h.sortUndefined, R = (d = m == null ? void 0 : m.desc) != null ? d : !1;
2223
- let x = 0;
2255
+ const m = l[u], h = i[m.id], w = h.sortUndefined, R = (d = m == null ? void 0 : m.desc) != null ? d : !1;
2256
+ let _ = 0;
2224
2257
  if (w) {
2225
- const $ = p.getValue(m.id), D = c.getValue(m.id), N = $ === void 0, E = D === void 0;
2226
- if (N || E) {
2227
- if (w === "first") return N ? -1 : 1;
2228
- if (w === "last") return N ? 1 : -1;
2229
- x = N && E ? 0 : N ? w : -w;
2258
+ const $ = p.getValue(m.id), E = c.getValue(m.id), I = $ === void 0, D = E === void 0;
2259
+ if (I || D) {
2260
+ if (w === "first") return I ? -1 : 1;
2261
+ if (w === "last") return I ? 1 : -1;
2262
+ _ = I && D ? 0 : I ? w : -w;
2230
2263
  }
2231
2264
  }
2232
- if (x === 0 && (x = h.sortingFn(p, c, m.id)), x !== 0)
2233
- return R && (x *= -1), h.invertSorting && (x *= -1), x;
2265
+ if (_ === 0 && (_ = h.sortingFn(p, c, m.id)), _ !== 0)
2266
+ return R && (_ *= -1), h.invertSorting && (_ *= -1), _;
2234
2267
  }
2235
2268
  return p.index - c.index;
2236
2269
  }), f.forEach((p) => {
@@ -2255,22 +2288,22 @@ function Pn() {
2255
2288
  *
2256
2289
  * @license MIT
2257
2290
  */
2258
- function Be(e, o) {
2259
- return e ? Dn(e) ? /* @__PURE__ */ ve.createElement(e, o) : e : null;
2291
+ function je(e, o) {
2292
+ return e ? kn(e) ? /* @__PURE__ */ Se.createElement(e, o) : e : null;
2260
2293
  }
2261
- function Dn(e) {
2262
- return En(e) || typeof e == "function" || kn(e);
2294
+ function kn(e) {
2295
+ return Ln(e) || typeof e == "function" || Hn(e);
2263
2296
  }
2264
- function En(e) {
2297
+ function Ln(e) {
2265
2298
  return typeof e == "function" && (() => {
2266
2299
  const o = Object.getPrototypeOf(e);
2267
2300
  return o.prototype && o.prototype.isReactComponent;
2268
2301
  })();
2269
2302
  }
2270
- function kn(e) {
2303
+ function Hn(e) {
2271
2304
  return typeof e == "object" && typeof e.$$typeof == "symbol" && ["react.memo", "react.forward_ref"].includes(e.$$typeof.description);
2272
2305
  }
2273
- function Ln(e) {
2306
+ function zn(e) {
2274
2307
  const o = {
2275
2308
  state: {},
2276
2309
  // Dummy state
@@ -2279,9 +2312,9 @@ function Ln(e) {
2279
2312
  // noop
2280
2313
  renderFallbackValue: null,
2281
2314
  ...e
2282
- }, [t] = ve.useState(() => ({
2283
- current: xn(o)
2284
- })), [n, r] = ve.useState(() => t.current.initialState);
2315
+ }, [t] = Se.useState(() => ({
2316
+ current: Fn(o)
2317
+ })), [n, r] = Se.useState(() => t.current.initialState);
2285
2318
  return t.current.setOptions((l) => ({
2286
2319
  ...l,
2287
2320
  ...e,
@@ -2296,72 +2329,77 @@ function Ln(e) {
2296
2329
  }
2297
2330
  })), t.current;
2298
2331
  }
2299
- const Te = ({
2332
+ const Ue = ({
2300
2333
  editable: e = !0,
2301
- pageSize: o = 25,
2302
- onCellEdit: t
2334
+ deletable: o = !0,
2335
+ pageSize: t = 25,
2336
+ onCellEdit: n,
2337
+ onRowDelete: r
2303
2338
  }) => {
2304
2339
  const {
2305
- rows: n,
2306
- schema: r,
2307
- mappings: l,
2308
- errorsByRow: i,
2309
- editingCell: s,
2310
- startEditing: u,
2311
- stopEditing: f,
2312
- updateCell: p
2313
- } = X(), [c, d] = K([]), [a, m] = K(""), [h, w] = K(""), R = ke(() => l.filter((y) => y.targetKey !== null).map((y) => {
2314
- const _ = r == null ? void 0 : r.columns.find((M) => M.key === y.targetKey);
2340
+ rows: l,
2341
+ schema: i,
2342
+ mappings: s,
2343
+ errorsByRow: a,
2344
+ editingCell: f,
2345
+ startEditing: p,
2346
+ stopEditing: c,
2347
+ updateCell: d,
2348
+ deleteRow: u
2349
+ } = J(), [m, h] = Y([]), [w, R] = Y(""), [_, $] = Y(""), E = ze(() => s.filter((y) => y.targetKey !== null).map((y) => {
2350
+ const x = i == null ? void 0 : i.columns.find((V) => V.key === y.targetKey);
2315
2351
  return {
2316
2352
  sourceColumn: y.sourceColumn,
2317
2353
  targetKey: y.targetKey,
2318
- label: (_ == null ? void 0 : _.label) || y.targetKey,
2319
- type: (_ == null ? void 0 : _.type) || "string"
2354
+ label: (x == null ? void 0 : x.label) || y.targetKey,
2355
+ type: (x == null ? void 0 : x.type) || "string"
2320
2356
  };
2321
- }), [l, r]), x = _e(
2322
- (y, _) => {
2323
- const M = i.get(y);
2324
- return M == null ? void 0 : M.find((T) => T.columnKey === _);
2357
+ }), [s, i]), I = Me(
2358
+ (y, x) => {
2359
+ const V = a.get(y);
2360
+ return V == null ? void 0 : V.find((W) => W.columnKey === x);
2325
2361
  },
2326
- [i]
2327
- ), $ = (y, _, M) => {
2328
- w(M), u(y, _);
2329
- }, D = () => {
2330
- s && (p(s.rowIndex, s.columnKey, h), t == null || t(s.rowIndex, s.columnKey, h)), f();
2362
+ [a]
2363
+ ), D = (y, x, V) => {
2364
+ $(V), p(y, x);
2365
+ }, K = () => {
2366
+ f && (d(f.rowIndex, f.columnKey, _), n == null || n(f.rowIndex, f.columnKey, _)), c();
2331
2367
  }, N = () => {
2332
- w(""), f();
2333
- }, E = zt(), q = ke(
2368
+ $(""), c();
2369
+ }, z = (y) => {
2370
+ u(y), r == null || r(y);
2371
+ }, T = Gt(), O = ze(
2334
2372
  () => [
2335
- E.accessor("rowIndex", {
2373
+ T.accessor("rowIndex", {
2336
2374
  header: "#",
2337
2375
  size: 60,
2338
2376
  cell: (y) => /* @__PURE__ */ g("span", { className: "ff-font-mono ff-text-xs", style: { color: "var(--ff-text-muted)" }, children: y.getValue() + 1 })
2339
2377
  }),
2340
- ...R.map(
2341
- (y) => E.accessor((_) => _.data[y.targetKey] || _.data[y.sourceColumn], {
2378
+ ...E.map(
2379
+ (y) => T.accessor((x) => x.data[y.targetKey] || x.data[y.sourceColumn], {
2342
2380
  id: y.targetKey,
2343
2381
  header: y.label,
2344
- cell: (_) => {
2345
- const M = _.row.original.rowIndex, T = String(_.getValue() ?? ""), k = x(M, y.targetKey);
2346
- return (s == null ? void 0 : s.rowIndex) === M && (s == null ? void 0 : s.columnKey) === y.targetKey ? /* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-gap-1", children: [
2382
+ cell: (x) => {
2383
+ const V = x.row.original.rowIndex, W = String(x.getValue() ?? ""), k = I(V, y.targetKey);
2384
+ return (f == null ? void 0 : f.rowIndex) === V && (f == null ? void 0 : f.columnKey) === y.targetKey ? /* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-gap-2 ff-min-w-[280px]", children: [
2347
2385
  /* @__PURE__ */ g(
2348
2386
  "input",
2349
2387
  {
2350
2388
  type: "text",
2351
- value: h,
2352
- onChange: (j) => w(j.target.value),
2353
- onKeyDown: (j) => {
2354
- j.key === "Enter" && D(), j.key === "Escape" && N();
2389
+ value: _,
2390
+ onChange: (X) => $(X.target.value),
2391
+ onKeyDown: (X) => {
2392
+ X.key === "Enter" && K(), X.key === "Escape" && N();
2355
2393
  },
2356
- className: "ff-input ff-py-1 ff-text-sm",
2394
+ className: "ff-input ff-py-2 ff-px-3 ff-text-sm ff-flex-1 ff-min-w-[160px]",
2357
2395
  autoFocus: !0
2358
2396
  }
2359
2397
  ),
2360
2398
  /* @__PURE__ */ g(
2361
2399
  "button",
2362
2400
  {
2363
- onClick: D,
2364
- className: "ff-btn ff-btn-primary ff-btn-sm",
2401
+ onClick: K,
2402
+ className: "ff-btn ff-btn-primary ff-btn-sm ff-flex-shrink-0",
2365
2403
  children: "Save"
2366
2404
  }
2367
2405
  ),
@@ -2369,33 +2407,33 @@ const Te = ({
2369
2407
  "button",
2370
2408
  {
2371
2409
  onClick: N,
2372
- className: "ff-btn ff-btn-secondary ff-btn-sm",
2410
+ className: "ff-btn ff-btn-secondary ff-btn-sm ff-flex-shrink-0",
2373
2411
  children: "Cancel"
2374
2412
  }
2375
2413
  )
2376
2414
  ] }) : /* @__PURE__ */ v(
2377
2415
  "div",
2378
2416
  {
2379
- className: b(
2417
+ className: j(
2380
2418
  "ff-group ff-flex ff-items-center ff-gap-2",
2381
2419
  (k == null ? void 0 : k.severity) === "error" && "ff-cell-error",
2382
2420
  (k == null ? void 0 : k.severity) === "warning" && "ff-cell-warning"
2383
2421
  ),
2384
2422
  children: [
2385
- /* @__PURE__ */ g("span", { className: "ff-flex-1 ff-truncate", children: T || /* @__PURE__ */ g("span", { style: { color: "var(--ff-text-muted)" }, children: "—" }) }),
2423
+ /* @__PURE__ */ g("span", { className: "ff-flex-1 ff-truncate", children: W || /* @__PURE__ */ g("span", { style: { color: "var(--ff-text-muted)" }, children: "—" }) }),
2386
2424
  k && /* @__PURE__ */ v("div", { className: "ff-relative ff-group/tooltip", children: [
2387
- k.severity === "error" ? /* @__PURE__ */ g(Fe, { className: "ff-w-4 ff-h-4", style: { color: "var(--ff-error)" } }) : /* @__PURE__ */ g(we, { className: "ff-w-4 ff-h-4", style: { color: "var(--ff-warning)" } }),
2425
+ k.severity === "error" ? /* @__PURE__ */ g(Ie, { className: "ff-w-4 ff-h-4", style: { color: "var(--ff-error)" } }) : /* @__PURE__ */ g(Re, { className: "ff-w-4 ff-h-4", style: { color: "var(--ff-warning)" } }),
2388
2426
  /* @__PURE__ */ v("div", { className: "ff-tooltip ff-bottom-full ff-left-1/2 ff-transform ff--translate-x-1/2 ff-mb-2 ff-w-48 group-hover/tooltip:ff-tooltip-visible", children: [
2389
2427
  k.message,
2390
2428
  k.suggestion && /* @__PURE__ */ g("span", { className: "ff-block ff-mt-1", style: { color: "var(--ff-text-muted)" }, children: k.suggestion })
2391
2429
  ] })
2392
2430
  ] }),
2393
- e && !k && /* @__PURE__ */ g(
2431
+ e && /* @__PURE__ */ g(
2394
2432
  "button",
2395
2433
  {
2396
- onClick: () => $(M, y.targetKey, T),
2434
+ onClick: () => D(V, y.targetKey, W),
2397
2435
  className: "ff-opacity-0 group-hover:ff-opacity-100 ff-p-1 ff-rounded ff-transition-opacity ff-edit-btn",
2398
- children: /* @__PURE__ */ g(Dt, { className: "ff-w-3 ff-h-3" })
2436
+ children: /* @__PURE__ */ g(Et, { className: "ff-w-3 ff-h-3" })
2399
2437
  }
2400
2438
  )
2401
2439
  ]
@@ -2403,25 +2441,45 @@ const Te = ({
2403
2441
  );
2404
2442
  }
2405
2443
  })
2406
- )
2444
+ ),
2445
+ // Actions column (delete)
2446
+ ...o ? [
2447
+ T.display({
2448
+ id: "actions",
2449
+ header: "",
2450
+ size: 50,
2451
+ cell: (y) => {
2452
+ const x = y.row.original.rowIndex;
2453
+ return /* @__PURE__ */ g(
2454
+ "button",
2455
+ {
2456
+ onClick: () => z(x),
2457
+ className: "ff-delete-btn",
2458
+ title: "Delete row",
2459
+ children: /* @__PURE__ */ g(Ht, { className: "ff-w-4 ff-h-4" })
2460
+ }
2461
+ );
2462
+ }
2463
+ })
2464
+ ] : []
2407
2465
  ],
2408
- [R, s, h, e, x, E]
2409
- ), V = Ln({
2410
- data: n,
2411
- columns: q,
2466
+ [E, f, _, e, o, I, T]
2467
+ ), H = zn({
2468
+ data: l,
2469
+ columns: O,
2412
2470
  state: {
2413
- sorting: c,
2414
- globalFilter: a
2471
+ sorting: m,
2472
+ globalFilter: w
2415
2473
  },
2416
- onSortingChange: d,
2417
- onGlobalFilterChange: m,
2418
- getCoreRowModel: _n(),
2419
- getPaginationRowModel: Nn(),
2420
- getSortedRowModel: Pn(),
2421
- getFilteredRowModel: Vn(),
2474
+ onSortingChange: h,
2475
+ onGlobalFilterChange: R,
2476
+ getCoreRowModel: $n(),
2477
+ getPaginationRowModel: En(),
2478
+ getSortedRowModel: Dn(),
2479
+ getFilteredRowModel: Pn(),
2422
2480
  initialState: {
2423
2481
  pagination: {
2424
- pageSize: o
2482
+ pageSize: t
2425
2483
  }
2426
2484
  }
2427
2485
  });
@@ -2431,40 +2489,40 @@ const Te = ({
2431
2489
  "input",
2432
2490
  {
2433
2491
  type: "text",
2434
- value: a,
2435
- onChange: (y) => m(y.target.value),
2492
+ value: w,
2493
+ onChange: (y) => R(y.target.value),
2436
2494
  placeholder: "Search all columns...",
2437
2495
  className: "ff-input ff-max-w-xs"
2438
2496
  }
2439
2497
  ),
2440
2498
  /* @__PURE__ */ v("div", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
2441
- V.getFilteredRowModel().rows.length,
2499
+ H.getFilteredRowModel().rows.length,
2442
2500
  " rows"
2443
2501
  ] })
2444
2502
  ] }),
2445
2503
  /* @__PURE__ */ g("div", { className: "ff-table-container ff-max-h-[500px]", children: /* @__PURE__ */ v("table", { className: "ff-table", children: [
2446
- /* @__PURE__ */ g("thead", { children: V.getHeaderGroups().map((y) => /* @__PURE__ */ g("tr", { children: y.headers.map((_) => /* @__PURE__ */ g(
2504
+ /* @__PURE__ */ g("thead", { children: H.getHeaderGroups().map((y) => /* @__PURE__ */ g("tr", { children: y.headers.map((x) => /* @__PURE__ */ g(
2447
2505
  "th",
2448
2506
  {
2449
- style: { width: _.getSize() },
2450
- onClick: _.column.getToggleSortingHandler(),
2451
- className: b(
2452
- _.column.getCanSort() && "ff-cursor-pointer ff-select-none"
2507
+ style: { width: x.getSize() },
2508
+ onClick: x.column.getToggleSortingHandler(),
2509
+ className: j(
2510
+ x.column.getCanSort() && "ff-cursor-pointer ff-select-none"
2453
2511
  ),
2454
2512
  children: /* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-gap-1", children: [
2455
- Be(_.column.columnDef.header, _.getContext()),
2456
- _.column.getIsSorted() && /* @__PURE__ */ g("span", { children: _.column.getIsSorted() === "asc" ? "↑" : "↓" })
2513
+ je(x.column.columnDef.header, x.getContext()),
2514
+ x.column.getIsSorted() && /* @__PURE__ */ g("span", { children: x.column.getIsSorted() === "asc" ? "↑" : "↓" })
2457
2515
  ] })
2458
2516
  },
2459
- _.id
2517
+ x.id
2460
2518
  )) }, y.id)) }),
2461
- /* @__PURE__ */ g("tbody", { children: V.getRowModel().rows.map((y) => {
2462
- const _ = i.has(y.original.rowIndex);
2519
+ /* @__PURE__ */ g("tbody", { children: H.getRowModel().rows.map((y) => {
2520
+ const x = a.has(y.original.rowIndex);
2463
2521
  return /* @__PURE__ */ g(
2464
2522
  "tr",
2465
2523
  {
2466
- className: b(_ && "ff-row-error"),
2467
- children: y.getVisibleCells().map((M) => /* @__PURE__ */ g("td", { children: Be(M.column.columnDef.cell, M.getContext()) }, M.id))
2524
+ className: j(x && "ff-row-error"),
2525
+ children: y.getVisibleCells().map((V) => /* @__PURE__ */ g("td", { children: je(V.column.columnDef.cell, V.getContext()) }, V.id))
2468
2526
  },
2469
2527
  y.id
2470
2528
  );
@@ -2473,16 +2531,16 @@ const Te = ({
2473
2531
  /* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-justify-between ff-px-2", children: [
2474
2532
  /* @__PURE__ */ v("div", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
2475
2533
  "Page ",
2476
- V.getState().pagination.pageIndex + 1,
2534
+ H.getState().pagination.pageIndex + 1,
2477
2535
  " of ",
2478
- V.getPageCount()
2536
+ H.getPageCount()
2479
2537
  ] }),
2480
2538
  /* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-gap-2", children: [
2481
2539
  /* @__PURE__ */ v(
2482
2540
  "button",
2483
2541
  {
2484
- onClick: () => V.previousPage(),
2485
- disabled: !V.getCanPreviousPage(),
2542
+ onClick: () => H.previousPage(),
2543
+ disabled: !H.getCanPreviousPage(),
2486
2544
  className: "ff-btn ff-btn-secondary ff-btn-sm",
2487
2545
  children: [
2488
2546
  /* @__PURE__ */ g(St, { className: "ff-w-4 ff-h-4" }),
@@ -2493,8 +2551,8 @@ const Te = ({
2493
2551
  /* @__PURE__ */ v(
2494
2552
  "button",
2495
2553
  {
2496
- onClick: () => V.nextPage(),
2497
- disabled: !V.getCanNextPage(),
2554
+ onClick: () => H.nextPage(),
2555
+ disabled: !H.getCanNextPage(),
2498
2556
  className: "ff-btn ff-btn-secondary ff-btn-sm",
2499
2557
  children: [
2500
2558
  "Next",
@@ -2505,13 +2563,13 @@ const Te = ({
2505
2563
  ] })
2506
2564
  ] })
2507
2565
  ] });
2508
- }, qe = ({
2566
+ }, Ke = ({
2509
2567
  showDetails: e = !0
2510
2568
  }) => {
2511
- const { validationResults: o } = X();
2569
+ const { validationResults: o } = J();
2512
2570
  if (!o)
2513
2571
  return null;
2514
- const { isValid: t, totalRows: n, validRows: r, errorCount: l, warningCount: i, infoCount: s, summary: u } = o, f = Math.round(r / n * 100);
2572
+ const { isValid: t, totalRows: n, validRows: r, errorCount: l, warningCount: i, infoCount: s, summary: a } = o, f = Math.round(r / n * 100);
2515
2573
  return /* @__PURE__ */ v("div", { className: "ff-space-y-4", children: [
2516
2574
  /* @__PURE__ */ v(
2517
2575
  "div",
@@ -2522,7 +2580,7 @@ const Te = ({
2522
2580
  borderColor: t ? "var(--ff-success)" : "var(--ff-error)"
2523
2581
  },
2524
2582
  children: [
2525
- t ? /* @__PURE__ */ g($e, { className: "ff-w-8 ff-h-8", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ g(He, { className: "ff-w-8 ff-h-8", style: { color: "var(--ff-error)" } }),
2583
+ t ? /* @__PURE__ */ g(Ve, { className: "ff-w-8 ff-h-8", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ g(Ge, { className: "ff-w-8 ff-h-8", style: { color: "var(--ff-error)" } }),
2526
2584
  /* @__PURE__ */ v("div", { children: [
2527
2585
  /* @__PURE__ */ g(
2528
2586
  "h3",
@@ -2562,33 +2620,45 @@ const Te = ({
2562
2620
  /* @__PURE__ */ g("p", { className: "ff-text-sm", style: { color: "var(--ff-warning)" }, children: "Warnings" })
2563
2621
  ] })
2564
2622
  ] }),
2565
- e && u.byColumn && Object.keys(u.byColumn).length > 0 && /* @__PURE__ */ v("div", { className: "ff-border ff-rounded-lg ff-overflow-hidden", style: { backgroundColor: "var(--ff-bg-primary)", borderColor: "var(--ff-border-light)" }, children: [
2566
- /* @__PURE__ */ g("div", { className: "ff-px-4 ff-py-3 ff-border-b", style: { backgroundColor: "var(--ff-bg-secondary)", borderColor: "var(--ff-border-light)" }, children: /* @__PURE__ */ g("h4", { className: "ff-font-medium", style: { color: "var(--ff-text-secondary)" }, children: "Issues by Column" }) }),
2567
- /* @__PURE__ */ g("div", { className: "ff-divide-y", style: { borderColor: "var(--ff-border-light)" }, children: Object.entries(u.byColumn).filter(([, p]) => p.errorCount > 0 || p.warningCount > 0).map(([p, c]) => /* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-justify-between ff-px-4 ff-py-3", children: [
2568
- /* @__PURE__ */ v("div", { children: [
2569
- /* @__PURE__ */ g("p", { className: "ff-font-medium", style: { color: "var(--ff-text-primary)" }, children: c.columnKey }),
2570
- c.mostCommonError && /* @__PURE__ */ g("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: c.mostCommonError })
2571
- ] }),
2572
- /* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-gap-3", children: [
2573
- c.errorCount > 0 && /* @__PURE__ */ v("span", { className: "ff-badge ff-badge-error", children: [
2574
- /* @__PURE__ */ g(He, { className: "ff-w-3 ff-h-3 ff-mr-1" }),
2575
- c.errorCount,
2576
- " errors"
2577
- ] }),
2578
- c.warningCount > 0 && /* @__PURE__ */ v("span", { className: "ff-badge ff-badge-warning", children: [
2579
- /* @__PURE__ */ g(we, { className: "ff-w-3 ff-h-3 ff-mr-1" }),
2580
- c.warningCount,
2581
- " warnings"
2582
- ] })
2583
- ] })
2584
- ] }, p)) })
2623
+ e && a.byColumn && Object.keys(a.byColumn).length > 0 && /* @__PURE__ */ v("div", { className: "ff-border ff-rounded-xl ff-overflow-hidden", style: { backgroundColor: "var(--ff-bg-primary)", borderColor: "var(--ff-border-light)" }, children: [
2624
+ /* @__PURE__ */ g("div", { className: "ff-px-4 ff-py-3", style: { backgroundColor: "var(--ff-bg-secondary)" }, children: /* @__PURE__ */ g("h4", { className: "ff-font-medium ff-text-sm", style: { color: "var(--ff-text-secondary)" }, children: "Issues by Column" }) }),
2625
+ /* @__PURE__ */ g("div", { children: Object.entries(a.byColumn).filter(([, p]) => p.errorCount > 0 || p.warningCount > 0).map(([p, c], d, u) => /* @__PURE__ */ v(
2626
+ "div",
2627
+ {
2628
+ className: "ff-flex ff-items-center ff-justify-between ff-px-4 ff-py-3",
2629
+ style: {
2630
+ borderTop: d > 0 ? "1px solid var(--ff-border-light)" : void 0
2631
+ },
2632
+ children: [
2633
+ /* @__PURE__ */ v("div", { className: "ff-flex-1 ff-min-w-0 ff-mr-4", children: [
2634
+ /* @__PURE__ */ g("p", { className: "ff-font-medium ff-text-sm", style: { color: "var(--ff-text-primary)" }, children: c.columnKey }),
2635
+ c.mostCommonError && /* @__PURE__ */ g("p", { className: "ff-text-sm ff-truncate", style: { color: "var(--ff-text-muted)" }, children: c.mostCommonError })
2636
+ ] }),
2637
+ /* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-gap-2 ff-flex-shrink-0", children: [
2638
+ c.errorCount > 0 && /* @__PURE__ */ v("span", { className: "ff-badge ff-badge-error ff-whitespace-nowrap", children: [
2639
+ /* @__PURE__ */ g(Ge, { className: "ff-w-3 ff-h-3 ff-mr-1" }),
2640
+ c.errorCount,
2641
+ " ",
2642
+ c.errorCount === 1 ? "error" : "errors"
2643
+ ] }),
2644
+ c.warningCount > 0 && /* @__PURE__ */ v("span", { className: "ff-badge ff-badge-warning ff-whitespace-nowrap", children: [
2645
+ /* @__PURE__ */ g(Re, { className: "ff-w-3 ff-h-3 ff-mr-1" }),
2646
+ c.warningCount,
2647
+ " ",
2648
+ c.warningCount === 1 ? "warning" : "warnings"
2649
+ ] })
2650
+ ] })
2651
+ ]
2652
+ },
2653
+ p
2654
+ )) })
2585
2655
  ] }),
2586
- e && u.duplicates && u.duplicates.length > 0 && /* @__PURE__ */ g("div", { className: "ff-border ff-rounded-lg ff-p-4", style: { backgroundColor: "var(--ff-warning-light)", borderColor: "var(--ff-warning)" }, children: /* @__PURE__ */ v("div", { className: "ff-flex ff-items-start ff-gap-3", children: [
2587
- /* @__PURE__ */ g(we, { className: "ff-w-5 ff-h-5 ff-flex-shrink-0 ff-mt-0.5", style: { color: "var(--ff-warning)" } }),
2656
+ e && a.duplicates && a.duplicates.length > 0 && /* @__PURE__ */ g("div", { className: "ff-border ff-rounded-lg ff-p-4", style: { backgroundColor: "var(--ff-warning-light)", borderColor: "var(--ff-warning)" }, children: /* @__PURE__ */ v("div", { className: "ff-flex ff-items-start ff-gap-3", children: [
2657
+ /* @__PURE__ */ g(Re, { className: "ff-w-5 ff-h-5 ff-flex-shrink-0 ff-mt-0.5", style: { color: "var(--ff-warning)" } }),
2588
2658
  /* @__PURE__ */ v("div", { children: [
2589
2659
  /* @__PURE__ */ g("h4", { className: "ff-font-medium", style: { color: "var(--ff-warning-dark)" }, children: "Duplicate Values Found" }),
2590
2660
  /* @__PURE__ */ v("ul", { className: "ff-mt-2 ff-space-y-1 ff-text-sm", style: { color: "var(--ff-warning-dark)" }, children: [
2591
- u.duplicates.slice(0, 5).map((p, c) => /* @__PURE__ */ v("li", { children: [
2661
+ a.duplicates.slice(0, 5).map((p, c) => /* @__PURE__ */ v("li", { children: [
2592
2662
  /* @__PURE__ */ g("span", { className: "ff-font-mono", children: p.columnKey }),
2593
2663
  ': "',
2594
2664
  String(p.value),
@@ -2601,22 +2671,22 @@ const Te = ({
2601
2671
  p.rowIndices.length > 3 ? "..." : "",
2602
2672
  ")"
2603
2673
  ] }, c)),
2604
- u.duplicates.length > 5 && /* @__PURE__ */ v("li", { style: { color: "var(--ff-warning)" }, children: [
2674
+ a.duplicates.length > 5 && /* @__PURE__ */ v("li", { style: { color: "var(--ff-warning)" }, children: [
2605
2675
  "... and ",
2606
- u.duplicates.length - 5,
2676
+ a.duplicates.length - 5,
2607
2677
  " more duplicate groups"
2608
2678
  ] })
2609
2679
  ] })
2610
2680
  ] })
2611
2681
  ] }) })
2612
2682
  ] });
2613
- }, he = ["upload", "mapping", "validation", "complete"], Hn = [
2614
- { key: "upload", label: "Upload", icon: je },
2683
+ }, Ce = ["upload", "mapping", "validation", "complete"], An = [
2684
+ { key: "upload", label: "Upload", icon: Xe },
2615
2685
  { key: "mapping", label: "Map Columns", icon: Nt },
2616
2686
  { key: "validation", label: "Validate", icon: kt },
2617
2687
  { key: "review", label: "Review", icon: _t },
2618
- { key: "complete", label: "Complete", icon: $e }
2619
- ], bn = ({
2688
+ { key: "complete", label: "Complete", icon: Ve }
2689
+ ], Tn = ({
2620
2690
  template: e,
2621
2691
  schema: o,
2622
2692
  mode: t = "modal",
@@ -2627,115 +2697,115 @@ const Te = ({
2627
2697
  onError: s
2628
2698
  }) => {
2629
2699
  const {
2630
- step: u,
2700
+ step: a,
2631
2701
  sessionId: f,
2632
2702
  file: p,
2633
2703
  mappings: c,
2634
2704
  validationResults: d,
2635
- isLoading: a,
2705
+ isLoading: u,
2636
2706
  error: m,
2637
2707
  setSchema: h,
2638
2708
  setSessionId: w,
2639
2709
  setParsedData: R,
2640
- setMappings: x,
2710
+ setMappings: _,
2641
2711
  setUnmapped: $,
2642
- setValidationResults: D,
2643
- setStep: N,
2644
- nextStep: E,
2645
- previousStep: q,
2646
- setLoading: V,
2647
- setError: y,
2648
- reset: _
2649
- } = X(), [M, T] = K(null), [k, W] = K(null);
2650
- Le(() => {
2651
- if (W(null), e)
2712
+ setValidationResults: E,
2713
+ setStep: I,
2714
+ nextStep: D,
2715
+ previousStep: K,
2716
+ setLoading: N,
2717
+ setError: z,
2718
+ reset: T
2719
+ } = J(), [O, H] = Y(null), [y, x] = Y(null);
2720
+ Ae(() => {
2721
+ if (x(null), e)
2652
2722
  if (ct(e)) {
2653
2723
  const F = pt(e);
2654
- F ? T(F) : (W(`Failed to load template "${e}"`), s == null || s(new Error(`Failed to load template "${e}"`)));
2724
+ F ? H(F) : (x(`Failed to load template "${e}"`), s == null || s(new Error(`Failed to load template "${e}"`)));
2655
2725
  } else {
2656
- const F = `Template "${e}" not found. Available templates: ${ze.join(", ")}`;
2657
- W(F), s == null || s(new Error(F));
2726
+ const F = `Template "${e}" not found. Available templates: ${Oe.join(", ")}`;
2727
+ x(F), s == null || s(new Error(F));
2658
2728
  }
2659
2729
  else if (o)
2660
- T(o);
2730
+ H(o);
2661
2731
  else {
2662
- const F = `No template or schema provided. Please specify a template (${ze.join(", ")}) or provide a custom schema.`;
2663
- W(F), s == null || s(new Error(F));
2732
+ const F = `No template or schema provided. Please specify a template (${Oe.join(", ")}) or provide a custom schema.`;
2733
+ x(F), s == null || s(new Error(F));
2664
2734
  }
2665
- }, [e, o, s]), Le(() => {
2666
- M && (h(M), j(M));
2667
- }, [M]);
2668
- const j = async (F) => {
2735
+ }, [e, o, s]), Ae(() => {
2736
+ O && (h(O), V(O));
2737
+ }, [O]);
2738
+ const V = async (F) => {
2669
2739
  try {
2670
- V(!0);
2671
- const z = await Y().createImportSession(F);
2672
- w(z.sessionId);
2673
- } catch (I) {
2674
- const z = I;
2675
- y(z.message), s == null || s(z);
2740
+ N(!0);
2741
+ const b = await ee().createImportSession(F);
2742
+ w(b.sessionId);
2743
+ } catch (M) {
2744
+ const b = M;
2745
+ z(b.message), s == null || s(b);
2676
2746
  } finally {
2677
- V(!1);
2747
+ N(!1);
2678
2748
  }
2679
- }, tt = _e(async (F) => {
2749
+ }, W = Me(async (F) => {
2680
2750
  if (f)
2681
2751
  try {
2682
- V(!0), y(null);
2683
- const z = await Y().uploadFile(f, F), Ee = (U, at) => ({
2684
- rowIndex: U.rowIndex ?? at,
2685
- data: U.data ?? U,
2686
- rawData: U.rawData ?? Object.values(U.data ?? U)
2752
+ N(!0), z(null);
2753
+ const b = await ee().uploadFile(f, F), He = (Q, at) => ({
2754
+ rowIndex: Q.rowIndex ?? at,
2755
+ data: Q.data ?? Q,
2756
+ rawData: Q.rawData ?? Object.values(Q.data ?? Q)
2687
2757
  });
2688
2758
  R({
2689
- headers: z.data.headers,
2690
- rows: z.data.sampleRows.map(Ee),
2691
- totalRows: z.data.totalRows,
2692
- sampleRows: z.data.sampleRows.map(Ee)
2693
- }), E(), await nt();
2694
- } catch (I) {
2695
- y(`Failed to process the uploaded file: ${I.message}`);
2759
+ headers: b.data.headers,
2760
+ rows: b.data.sampleRows.map(He),
2761
+ totalRows: b.data.totalRows,
2762
+ sampleRows: b.data.sampleRows.map(He)
2763
+ }), D(), await k();
2764
+ } catch (M) {
2765
+ z(`Failed to process the uploaded file: ${M.message}`);
2696
2766
  } finally {
2697
- V(!1);
2767
+ N(!1);
2698
2768
  }
2699
- }, [f]), nt = async () => {
2769
+ }, [f]), k = async () => {
2700
2770
  if (f)
2701
2771
  try {
2702
- V(!0);
2703
- const I = await Y().matchColumns(f);
2704
- x(I.mappings), $(I.unmappedSource, I.unmappedTarget);
2772
+ N(!0);
2773
+ const M = await ee().matchColumns(f);
2774
+ _(M.mappings), $(M.unmappedSource, M.unmappedTarget);
2705
2775
  } catch (F) {
2706
- y(`Column matching failed: ${F.message}`);
2776
+ z(`Column matching failed: ${F.message}`);
2707
2777
  } finally {
2708
- V(!1);
2778
+ N(!1);
2709
2779
  }
2710
- }, ot = async () => {
2780
+ }, ke = async () => {
2711
2781
  if (f)
2712
2782
  try {
2713
- V(!0), y(null);
2714
- const I = await Y().validateImport(f);
2715
- D(I.validation), E();
2783
+ N(!0), z(null);
2784
+ const M = await ee().validateImport(f);
2785
+ E(M.validation), D();
2716
2786
  } catch (F) {
2717
- y(`Validation failed: ${F.message}`);
2787
+ z(`Validation failed: ${F.message}`);
2718
2788
  } finally {
2719
- V(!1);
2789
+ N(!1);
2720
2790
  }
2721
- }, [Pe, ie] = K(null), rt = async () => {
2791
+ }, [X, ue] = Y(null), rt = async () => {
2722
2792
  if (f)
2723
2793
  try {
2724
- V(!0), y(null), ie(null);
2725
- const I = await Y().completeImport(f, {
2794
+ N(!0), z(null), ue(null);
2795
+ const M = await ee().completeImport(f, {
2726
2796
  skipInvalidRows: !0,
2727
2797
  acknowledgeWarnings: !0
2728
2798
  });
2729
- N("complete"), l == null || l(I);
2799
+ I("complete"), l == null || l(M);
2730
2800
  } catch (F) {
2731
- ie(F.message), N("complete");
2801
+ ue(F.message), I("complete");
2732
2802
  } finally {
2733
- V(!1);
2803
+ N(!1);
2734
2804
  }
2735
- }, se = () => {
2736
- _(), i == null || i();
2737
- }, lt = () => Hn.findIndex((F) => F.key === u), it = () => {
2738
- switch (u) {
2805
+ }, fe = () => {
2806
+ T(), i == null || i();
2807
+ }, lt = () => An.findIndex((F) => F.key === a), it = () => {
2808
+ switch (a) {
2739
2809
  case "upload":
2740
2810
  return p !== null;
2741
2811
  case "mapping":
@@ -2748,111 +2818,111 @@ const Te = ({
2748
2818
  return !1;
2749
2819
  }
2750
2820
  }, st = async () => {
2751
- switch (u) {
2821
+ switch (a) {
2752
2822
  case "mapping":
2753
- await ot();
2823
+ await ke();
2754
2824
  break;
2755
2825
  case "validation":
2756
- E();
2826
+ D();
2757
2827
  break;
2758
2828
  case "review":
2759
2829
  await rt();
2760
2830
  break;
2761
2831
  default:
2762
- E();
2832
+ D();
2763
2833
  }
2764
2834
  };
2765
- if (k)
2766
- return /* @__PURE__ */ g(ae, { theme: n, useShadowDom: r, children: /* @__PURE__ */ g("div", { className: "ff-container ff-bg-white ff-rounded-xl ff-shadow-xl ff-overflow-hidden ff-p-6", children: /* @__PURE__ */ v("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-8", children: [
2767
- /* @__PURE__ */ g("div", { className: "ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4", style: { backgroundColor: "var(--ff-error-light)" }, children: /* @__PURE__ */ g(re, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-error)" } }) }),
2835
+ if (y)
2836
+ return /* @__PURE__ */ g(de, { theme: n, useShadowDom: r, children: /* @__PURE__ */ g("div", { className: "ff-container ff-bg-white ff-rounded-xl ff-shadow-xl ff-overflow-hidden ff-p-6", children: /* @__PURE__ */ v("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-8", children: [
2837
+ /* @__PURE__ */ g("div", { className: "ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4", style: { backgroundColor: "var(--ff-error-light)" }, children: /* @__PURE__ */ g(se, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-error)" } }) }),
2768
2838
  /* @__PURE__ */ g("h3", { className: "ff-text-xl ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: "Configuration Error" }),
2769
- /* @__PURE__ */ g("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children: k }),
2770
- i && /* @__PURE__ */ g("button", { onClick: se, className: "ff-btn ff-btn-secondary", children: "Close" })
2839
+ /* @__PURE__ */ g("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children: y }),
2840
+ i && /* @__PURE__ */ g("button", { onClick: fe, className: "ff-btn ff-btn-secondary", children: "Close" })
2771
2841
  ] }) }) });
2772
- if (!M)
2773
- return /* @__PURE__ */ g(ae, { theme: n, useShadowDom: r, children: /* @__PURE__ */ g("div", { className: "ff-container ff-bg-white ff-rounded-xl ff-shadow-xl ff-overflow-hidden ff-p-6", children: /* @__PURE__ */ v("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-8", children: [
2774
- /* @__PURE__ */ g(Ae, { className: "ff-w-10 ff-h-10 ff-animate-spin ff-mb-4", style: { color: "var(--ff-primary-90)" } }),
2842
+ if (!O)
2843
+ return /* @__PURE__ */ g(de, { theme: n, useShadowDom: r, children: /* @__PURE__ */ g("div", { className: "ff-container ff-bg-white ff-rounded-xl ff-shadow-xl ff-overflow-hidden ff-p-6", children: /* @__PURE__ */ v("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-8", children: [
2844
+ /* @__PURE__ */ g(be, { className: "ff-w-10 ff-h-10 ff-animate-spin ff-mb-4", style: { color: "var(--ff-primary-90)" } }),
2775
2845
  /* @__PURE__ */ g("p", { style: { color: "var(--ff-text-muted)" }, children: "Loading template..." })
2776
2846
  ] }) }) });
2777
- const Q = () => {
2778
- const F = u === "review" ? "validation" : u;
2779
- return he.indexOf(F);
2780
- }, De = /* @__PURE__ */ g(ee, { children: /* @__PURE__ */ v("div", { className: t === "embed" ? "ff-container ff-embed" : "ff-container ff-modal", children: [
2847
+ const Z = () => {
2848
+ const F = a === "review" ? "validation" : a;
2849
+ return Ce.indexOf(F);
2850
+ }, Le = /* @__PURE__ */ g(oe, { children: /* @__PURE__ */ v("div", { className: t === "embed" ? "ff-container ff-embed" : "ff-container ff-modal", children: [
2781
2851
  /* @__PURE__ */ v("div", { className: "ff-modal-header", children: [
2782
2852
  /* @__PURE__ */ v("div", { className: "ff-modal-header-left", children: [
2783
2853
  /* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-gap-3", children: [
2784
2854
  /* @__PURE__ */ g("div", { className: "ff-modal-icon", children: /* @__PURE__ */ g($t, {}) }),
2785
2855
  /* @__PURE__ */ g("h2", { className: "ff-modal-title", children: "Import Data" })
2786
2856
  ] }),
2787
- /* @__PURE__ */ g("div", { className: "ff-steps ff-ml-4", children: he.map((F, I) => /* @__PURE__ */ v(ut.Fragment, { children: [
2857
+ /* @__PURE__ */ g("div", { className: "ff-steps ff-ml-4", children: Ce.map((F, M) => /* @__PURE__ */ v(ut.Fragment, { children: [
2788
2858
  /* @__PURE__ */ g(
2789
2859
  "div",
2790
2860
  {
2791
- className: b(
2861
+ className: j(
2792
2862
  "ff-step",
2793
- Q() === I && "ff-step-active",
2794
- Q() > I && "ff-step-complete",
2795
- Q() < I && "ff-step-pending"
2863
+ Z() === M && "ff-step-active",
2864
+ Z() > M && "ff-step-complete",
2865
+ Z() < M && "ff-step-pending"
2796
2866
  ),
2797
- children: Q() > I ? "✓" : I + 1
2867
+ children: Z() > M ? "✓" : M + 1
2798
2868
  }
2799
2869
  ),
2800
- I < he.length - 1 && /* @__PURE__ */ g("div", { className: b(
2870
+ M < Ce.length - 1 && /* @__PURE__ */ g("div", { className: j(
2801
2871
  "ff-step-connector",
2802
- Q() > I && "ff-step-connector-complete"
2872
+ Z() > M && "ff-step-connector-complete"
2803
2873
  ) })
2804
2874
  ] }, F)) })
2805
2875
  ] }),
2806
2876
  /* @__PURE__ */ g(
2807
2877
  "button",
2808
2878
  {
2809
- onClick: se,
2879
+ onClick: fe,
2810
2880
  className: "ff-modal-close",
2811
- children: /* @__PURE__ */ g(re, { className: "ff-w-5 ff-h-5" })
2881
+ children: /* @__PURE__ */ g(se, { className: "ff-w-5 ff-h-5" })
2812
2882
  }
2813
2883
  )
2814
2884
  ] }),
2815
2885
  /* @__PURE__ */ v("div", { className: "ff-modal-body", children: [
2816
2886
  m && /* @__PURE__ */ g("div", { className: "ff-mb-4 ff-p-4 ff-border ff-rounded-lg ff-text-sm", style: { backgroundColor: "var(--ff-error-light)", borderColor: "var(--ff-error)", color: "var(--ff-error)" }, children: m }),
2817
- u === "upload" && /* @__PURE__ */ g("div", { className: "ff-py-4", children: /* @__PURE__ */ g("div", { className: "ff-max-w-xl ff-mx-auto", children: /* @__PURE__ */ g(Lt, { onFileSelect: tt }) }) }),
2818
- u === "mapping" && /* @__PURE__ */ g(Ht, {}),
2819
- u === "validation" && /* @__PURE__ */ v("div", { className: "ff-space-y-6", children: [
2820
- /* @__PURE__ */ g(qe, {}),
2821
- /* @__PURE__ */ g(Te, { editable: !0 })
2887
+ a === "upload" && /* @__PURE__ */ g("div", { className: "ff-py-4", children: /* @__PURE__ */ g("div", { className: "ff-max-w-xl ff-mx-auto", children: /* @__PURE__ */ g(zt, { onFileSelect: W }) }) }),
2888
+ a === "mapping" && /* @__PURE__ */ g(At, {}),
2889
+ a === "validation" && /* @__PURE__ */ v("div", { className: "ff-space-y-6", children: [
2890
+ /* @__PURE__ */ g(Ke, {}),
2891
+ /* @__PURE__ */ g(Ue, { editable: !0 })
2822
2892
  ] }),
2823
- u === "review" && /* @__PURE__ */ v("div", { className: "ff-space-y-6", children: [
2824
- /* @__PURE__ */ g(qe, { showDetails: !1 }),
2825
- /* @__PURE__ */ g(Te, { editable: !1, pageSize: 10 })
2893
+ a === "review" && /* @__PURE__ */ v("div", { className: "ff-space-y-6", children: [
2894
+ /* @__PURE__ */ g(Ke, { showDetails: !1 }),
2895
+ /* @__PURE__ */ g(Ue, { editable: !1, pageSize: 10 })
2826
2896
  ] }),
2827
- u === "complete" && /* @__PURE__ */ g("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-12", children: Pe ? /* @__PURE__ */ v(ee, { children: [
2828
- /* @__PURE__ */ g("div", { className: "ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4", style: { backgroundColor: "var(--ff-error-light)" }, children: /* @__PURE__ */ g(re, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-error)" } }) }),
2897
+ a === "complete" && /* @__PURE__ */ g("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-12", children: X ? /* @__PURE__ */ v(oe, { children: [
2898
+ /* @__PURE__ */ g("div", { className: "ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4", style: { backgroundColor: "var(--ff-error-light)" }, children: /* @__PURE__ */ g(se, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-error)" } }) }),
2829
2899
  /* @__PURE__ */ g("h3", { className: "ff-text-xl ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: "Import Failed" }),
2830
- /* @__PURE__ */ g("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children: Pe }),
2900
+ /* @__PURE__ */ g("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children: X }),
2831
2901
  /* @__PURE__ */ v("div", { className: "ff-flex ff-gap-3", children: [
2832
2902
  /* @__PURE__ */ g(
2833
2903
  "button",
2834
2904
  {
2835
2905
  onClick: () => {
2836
- ie(null), N("review");
2906
+ ue(null), I("review");
2837
2907
  },
2838
2908
  className: "ff-btn ff-btn-secondary",
2839
2909
  children: "Back to Review"
2840
2910
  }
2841
2911
  ),
2842
- i && /* @__PURE__ */ g("button", { onClick: se, className: "ff-btn ff-btn-secondary", children: "Close" })
2912
+ i && /* @__PURE__ */ g("button", { onClick: fe, className: "ff-btn ff-btn-secondary", children: "Close" })
2843
2913
  ] })
2844
- ] }) : /* @__PURE__ */ v(ee, { children: [
2845
- /* @__PURE__ */ g("div", { className: "ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4", style: { backgroundColor: "var(--ff-success-light)" }, children: /* @__PURE__ */ g($e, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-success)" } }) }),
2914
+ ] }) : /* @__PURE__ */ v(oe, { children: [
2915
+ /* @__PURE__ */ g("div", { className: "ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4", style: { backgroundColor: "var(--ff-success-light)" }, children: /* @__PURE__ */ g(Ve, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-success)" } }) }),
2846
2916
  /* @__PURE__ */ g("h3", { className: "ff-text-xl ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: "Import Complete!" }),
2847
2917
  /* @__PURE__ */ g("p", { style: { color: "var(--ff-text-muted)" }, children: "Your data has been successfully imported." })
2848
2918
  ] }) })
2849
2919
  ] }),
2850
- u !== "complete" && /* @__PURE__ */ v("div", { className: "ff-modal-footer", children: [
2920
+ a !== "complete" && /* @__PURE__ */ v("div", { className: "ff-modal-footer", children: [
2851
2921
  /* @__PURE__ */ g(
2852
2922
  "button",
2853
2923
  {
2854
- onClick: q,
2855
- disabled: lt() === 0 || a,
2924
+ onClick: K,
2925
+ disabled: lt() === 0 || u,
2856
2926
  className: "ff-btn ff-btn-secondary",
2857
2927
  children: "Back"
2858
2928
  }
@@ -2861,24 +2931,24 @@ const Te = ({
2861
2931
  "button",
2862
2932
  {
2863
2933
  onClick: st,
2864
- disabled: !it() || a,
2934
+ disabled: !it() || u,
2865
2935
  className: "ff-btn ff-btn-primary",
2866
- children: a ? /* @__PURE__ */ v(ee, { children: [
2867
- /* @__PURE__ */ g(Ae, { className: "ff-w-4 ff-h-4 ff-animate-spin" }),
2936
+ children: u ? /* @__PURE__ */ v(oe, { children: [
2937
+ /* @__PURE__ */ g(be, { className: "ff-w-4 ff-h-4 ff-animate-spin" }),
2868
2938
  "Processing..."
2869
- ] }) : u === "review" ? "Complete Import" : "Continue"
2939
+ ] }) : a === "review" ? "Complete Import" : "Continue"
2870
2940
  }
2871
2941
  )
2872
2942
  ] })
2873
2943
  ] }) });
2874
- return /* @__PURE__ */ g(ae, { theme: n, useShadowDom: r, children: t === "modal" ? /* @__PURE__ */ g("div", { className: "ff-overlay", children: De }) : De });
2944
+ return /* @__PURE__ */ g(de, { theme: n, useShadowDom: r, children: t === "modal" ? /* @__PURE__ */ g("div", { className: "ff-overlay", children: Le }) : Le });
2875
2945
  };
2876
2946
  export {
2877
- Ht as C,
2878
- Te as D,
2879
- Lt as F,
2880
- bn as I,
2881
- qe as V,
2882
- X as u
2947
+ At as C,
2948
+ Ue as D,
2949
+ zt as F,
2950
+ Tn as I,
2951
+ Ke as V,
2952
+ J as u
2883
2953
  };
2884
- //# sourceMappingURL=ImportWizard-B7BsndHa.mjs.map
2954
+ //# sourceMappingURL=ImportWizard-D4GlHhyY.mjs.map