overview-components 1.0.80 → 1.0.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/schemas/lit-attachments-tab.schema.js +1 -1
  2. package/dist/schemas/lit-attachments-tab.schema.js.map +1 -1
  3. package/dist/schemas/lit-tabs-overview-tab-array.schema.js +1 -1
  4. package/dist/schemas/lit-tabs-overview-tab-array.schema.js.map +1 -1
  5. package/dist/schemas/lit-tabs-overview.schema.js +1 -1
  6. package/dist/schemas/lit-tabs-overview.schema.js.map +1 -1
  7. package/package.json +1 -1
  8. package/dist/_virtual/FileSaver.min.js +0 -4
  9. package/dist/_virtual/_commonjsHelpers.js +0 -8
  10. package/dist/_virtual/air-datepicker.js +0 -4
  11. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -486
  12. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -391
  13. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -131
  14. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -129
  15. package/dist/node_modules/@lit/localize/init/install.js +0 -11
  16. package/dist/node_modules/@lit/localize/init/runtime.js +0 -42
  17. package/dist/node_modules/@lit/localize/internal/default-msg.js +0 -10
  18. package/dist/node_modules/@lit/localize/internal/deferred.js +0 -21
  19. package/dist/node_modules/@lit/localize/internal/fnv1a64.js +0 -17
  20. package/dist/node_modules/@lit/localize/internal/id-generation.js +0 -14
  21. package/dist/node_modules/@lit/localize/internal/locale-status-event.js +0 -9
  22. package/dist/node_modules/@lit/localize/internal/runtime-msg.js +0 -42
  23. package/dist/node_modules/@lit/localize/internal/str-tag.js +0 -15
  24. package/dist/node_modules/@lit/react/create-component.js +0 -35
  25. package/dist/node_modules/@lit/reactive-element/css-tag.js +0 -50
  26. package/dist/node_modules/@lit/reactive-element/decorators/base.js +0 -9
  27. package/dist/node_modules/@lit/reactive-element/decorators/custom-element.js +0 -13
  28. package/dist/node_modules/@lit/reactive-element/decorators/property.js +0 -37
  29. package/dist/node_modules/@lit/reactive-element/decorators/query.js +0 -20
  30. package/dist/node_modules/@lit/reactive-element/decorators/state.js +0 -12
  31. package/dist/node_modules/@lit/reactive-element/reactive-element.js +0 -250
  32. package/dist/node_modules/@tanstack/lit-table/build/lib/index.js +0 -104
  33. package/dist/node_modules/@tanstack/lit-virtual/dist/esm/index.js +0 -40
  34. package/dist/node_modules/@tanstack/table-core/build/lib/index.js +0 -1956
  35. package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +0 -490
  36. package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +0 -52
  37. package/dist/node_modules/air-datepicker/air-datepicker.js +0 -1147
  38. package/dist/node_modules/air-datepicker/index.es.js +0 -4
  39. package/dist/node_modules/file-saver/dist/FileSaver.min.js +0 -74
  40. package/dist/node_modules/lit-element/lit-element.js +0 -51
  41. package/dist/node_modules/lit-html/async-directive.js +0 -69
  42. package/dist/node_modules/lit-html/directive-helpers.js +0 -45
  43. package/dist/node_modules/lit-html/directive.js +0 -27
  44. package/dist/node_modules/lit-html/directives/class-map.js +0 -34
  45. package/dist/node_modules/lit-html/directives/ref.js +0 -42
  46. package/dist/node_modules/lit-html/directives/repeat.js +0 -61
  47. package/dist/node_modules/lit-html/directives/style-map.js +0 -36
  48. package/dist/node_modules/lit-html/directives/unsafe-html.js +0 -27
  49. package/dist/node_modules/lit-html/lit-html.js +0 -243
  50. package/dist/node_modules/luxon/src/datetime.js +0 -1793
  51. package/dist/node_modules/luxon/src/duration.js +0 -723
  52. package/dist/node_modules/luxon/src/errors.js +0 -40
  53. package/dist/node_modules/luxon/src/impl/conversions.js +0 -92
  54. package/dist/node_modules/luxon/src/impl/diff.js +0 -36
  55. package/dist/node_modules/luxon/src/impl/digits.js +0 -74
  56. package/dist/node_modules/luxon/src/impl/english.js +0 -138
  57. package/dist/node_modules/luxon/src/impl/formats.js +0 -150
  58. package/dist/node_modules/luxon/src/impl/formatter.js +0 -245
  59. package/dist/node_modules/luxon/src/impl/invalid.js +0 -11
  60. package/dist/node_modules/luxon/src/impl/locale.js +0 -282
  61. package/dist/node_modules/luxon/src/impl/regexParser.js +0 -202
  62. package/dist/node_modules/luxon/src/impl/tokenParser.js +0 -329
  63. package/dist/node_modules/luxon/src/impl/util.js +0 -206
  64. package/dist/node_modules/luxon/src/impl/zoneUtil.js +0 -19
  65. package/dist/node_modules/luxon/src/info.js +0 -180
  66. package/dist/node_modules/luxon/src/interval.js +0 -466
  67. package/dist/node_modules/luxon/src/settings.js +0 -150
  68. package/dist/node_modules/luxon/src/zone.js +0 -88
  69. package/dist/node_modules/luxon/src/zones/IANAZone.js +0 -178
  70. package/dist/node_modules/luxon/src/zones/fixedOffsetZone.js +0 -125
  71. package/dist/node_modules/luxon/src/zones/invalidZone.js +0 -41
  72. package/dist/node_modules/luxon/src/zones/systemZone.js +0 -47
  73. package/dist/node_modules/sortablejs/modular/sortable.esm.js +0 -1261
@@ -1,1956 +0,0 @@
1
- /**
2
- * table-core
3
- *
4
- * Copyright (c) TanStack
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE.md file in the root directory of this source tree.
8
- *
9
- * @license MIT
10
- */
11
- function I(e, o) {
12
- return typeof e == "function" ? e(o) : e;
13
- }
14
- function M(e, o) {
15
- return (t) => {
16
- o.setState((n) => ({
17
- ...n,
18
- [e]: I(t, n[e])
19
- }));
20
- };
21
- }
22
- function B(e) {
23
- return e instanceof Function;
24
- }
25
- function Ce(e) {
26
- return Array.isArray(e) && e.every((o) => typeof o == "number");
27
- }
28
- function re(e, o) {
29
- const t = [], n = (i) => {
30
- i.forEach((r) => {
31
- t.push(r);
32
- const l = o(r);
33
- l != null && l.length && n(l);
34
- });
35
- };
36
- return n(e), t;
37
- }
38
- function m(e, o, t) {
39
- let n = [], i;
40
- return (r) => {
41
- let l;
42
- t.key && t.debug && (l = Date.now());
43
- const s = e(r);
44
- if (!(s.length !== n.length || s.some((c, S) => n[S] !== c)))
45
- return i;
46
- n = s;
47
- let a;
48
- if (t.key && t.debug && (a = Date.now()), i = o(...s), t == null || t.onChange == null || t.onChange(i), t.key && t.debug && t != null && t.debug()) {
49
- const c = Math.round((Date.now() - l) * 100) / 100, S = Math.round((Date.now() - a) * 100) / 100, d = S / 16, u = (f, p) => {
50
- for (f = String(f); f.length < p; )
51
- f = " " + f;
52
- return f;
53
- };
54
- console.info(`%c⏱ ${u(S, 5)} /${u(c, 5)} ms`, `
55
- font-size: .6rem;
56
- font-weight: bold;
57
- color: hsl(${Math.max(0, Math.min(120 - 120 * d, 120))}deg 100% 31%);`, t == null ? void 0 : t.key);
58
- }
59
- return i;
60
- };
61
- }
62
- function C(e, o, t, n) {
63
- return {
64
- debug: () => {
65
- var i;
66
- return (i = e == null ? void 0 : e.debugAll) != null ? i : e[o];
67
- },
68
- key: !1,
69
- onChange: n
70
- };
71
- }
72
- function Re(e, o, t, n) {
73
- const i = () => {
74
- var l;
75
- return (l = r.getValue()) != null ? l : e.options.renderFallbackValue;
76
- }, r = {
77
- id: `${o.id}_${t.id}`,
78
- row: o,
79
- column: t,
80
- getValue: () => o.getValue(n),
81
- renderValue: i,
82
- getContext: m(() => [e, t, o, r], (l, s, g, a) => ({
83
- table: l,
84
- column: s,
85
- row: g,
86
- cell: a,
87
- getValue: a.getValue,
88
- renderValue: a.renderValue
89
- }), C(e.options, "debugCells"))
90
- };
91
- return e._features.forEach((l) => {
92
- l.createCell == null || l.createCell(r, t, o, e);
93
- }, {}), r;
94
- }
95
- function we(e, o, t, n) {
96
- var i, r;
97
- const s = {
98
- ...e._getDefaultColumnDef(),
99
- ...o
100
- }, g = s.accessorKey;
101
- let a = (i = (r = s.id) != null ? r : g ? typeof String.prototype.replaceAll == "function" ? g.replaceAll(".", "_") : g.replace(/\./g, "_") : void 0) != null ? i : typeof s.header == "string" ? s.header : void 0, c;
102
- if (s.accessorFn ? c = s.accessorFn : g && (g.includes(".") ? c = (d) => {
103
- let u = d;
104
- for (const p of g.split(".")) {
105
- var f;
106
- u = (f = u) == null ? void 0 : f[p];
107
- }
108
- return u;
109
- } : c = (d) => d[s.accessorKey]), !a)
110
- throw new Error();
111
- let S = {
112
- id: `${String(a)}`,
113
- accessorFn: c,
114
- parent: n,
115
- depth: t,
116
- columnDef: s,
117
- columns: [],
118
- getFlatColumns: m(() => [!0], () => {
119
- var d;
120
- return [S, ...(d = S.columns) == null ? void 0 : d.flatMap((u) => u.getFlatColumns())];
121
- }, C(e.options, "debugColumns")),
122
- getLeafColumns: m(() => [e._getOrderColumnsFn()], (d) => {
123
- var u;
124
- if ((u = S.columns) != null && u.length) {
125
- let f = S.columns.flatMap((p) => p.getLeafColumns());
126
- return d(f);
127
- }
128
- return [S];
129
- }, C(e.options, "debugColumns"))
130
- };
131
- for (const d of e._features)
132
- d.createColumn == null || d.createColumn(S, e);
133
- return S;
134
- }
135
- const $ = "debugHeaders";
136
- function oe(e, o, t) {
137
- var n;
138
- let r = {
139
- id: (n = t.id) != null ? n : o.id,
140
- column: o,
141
- index: t.index,
142
- isPlaceholder: !!t.isPlaceholder,
143
- placeholderId: t.placeholderId,
144
- depth: t.depth,
145
- subHeaders: [],
146
- colSpan: 0,
147
- rowSpan: 0,
148
- headerGroup: null,
149
- getLeafHeaders: () => {
150
- const l = [], s = (g) => {
151
- g.subHeaders && g.subHeaders.length && g.subHeaders.map(s), l.push(g);
152
- };
153
- return s(r), l;
154
- },
155
- getContext: () => ({
156
- table: e,
157
- header: r,
158
- column: o
159
- })
160
- };
161
- return e._features.forEach((l) => {
162
- l.createHeader == null || l.createHeader(r, e);
163
- }), r;
164
- }
165
- const ve = {
166
- createTable: (e) => {
167
- e.getHeaderGroups = m(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, i) => {
168
- var r, l;
169
- const s = (r = n == null ? void 0 : n.map((S) => t.find((d) => d.id === S)).filter(Boolean)) != null ? r : [], g = (l = i == null ? void 0 : i.map((S) => t.find((d) => d.id === S)).filter(Boolean)) != null ? l : [], a = t.filter((S) => !(n != null && n.includes(S.id)) && !(i != null && i.includes(S.id)));
170
- return L(o, [...s, ...a, ...g], e);
171
- }, C(e.options, $)), e.getCenterHeaderGroups = m(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, i) => (t = t.filter((r) => !(n != null && n.includes(r.id)) && !(i != null && i.includes(r.id))), L(o, t, e, "center")), C(e.options, $)), e.getLeftHeaderGroups = m(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
172
- var i;
173
- const r = (i = n == null ? void 0 : n.map((l) => t.find((s) => s.id === l)).filter(Boolean)) != null ? i : [];
174
- return L(o, r, e, "left");
175
- }, C(e.options, $)), e.getRightHeaderGroups = m(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (o, t, n) => {
176
- var i;
177
- const r = (i = n == null ? void 0 : n.map((l) => t.find((s) => s.id === l)).filter(Boolean)) != null ? i : [];
178
- return L(o, r, e, "right");
179
- }, C(e.options, $)), e.getFooterGroups = m(() => [e.getHeaderGroups()], (o) => [...o].reverse(), C(e.options, $)), e.getLeftFooterGroups = m(() => [e.getLeftHeaderGroups()], (o) => [...o].reverse(), C(e.options, $)), e.getCenterFooterGroups = m(() => [e.getCenterHeaderGroups()], (o) => [...o].reverse(), C(e.options, $)), e.getRightFooterGroups = m(() => [e.getRightHeaderGroups()], (o) => [...o].reverse(), C(e.options, $)), e.getFlatHeaders = m(() => [e.getHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, $)), e.getLeftFlatHeaders = m(() => [e.getLeftHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, $)), e.getCenterFlatHeaders = m(() => [e.getCenterHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, $)), e.getRightFlatHeaders = m(() => [e.getRightHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, $)), e.getCenterLeafHeaders = m(() => [e.getCenterFlatHeaders()], (o) => o.filter((t) => {
180
- var n;
181
- return !((n = t.subHeaders) != null && n.length);
182
- }), C(e.options, $)), e.getLeftLeafHeaders = m(() => [e.getLeftFlatHeaders()], (o) => o.filter((t) => {
183
- var n;
184
- return !((n = t.subHeaders) != null && n.length);
185
- }), C(e.options, $)), e.getRightLeafHeaders = m(() => [e.getRightFlatHeaders()], (o) => o.filter((t) => {
186
- var n;
187
- return !((n = t.subHeaders) != null && n.length);
188
- }), C(e.options, $)), e.getLeafHeaders = m(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (o, t, n) => {
189
- var i, r, l, s, g, a;
190
- return [...(i = (r = o[0]) == null ? void 0 : r.headers) != null ? i : [], ...(l = (s = t[0]) == null ? void 0 : s.headers) != null ? l : [], ...(g = (a = n[0]) == null ? void 0 : a.headers) != null ? g : []].map((c) => c.getLeafHeaders()).flat();
191
- }, C(e.options, $));
192
- }
193
- };
194
- function L(e, o, t, n) {
195
- var i, r;
196
- let l = 0;
197
- const s = function(d, u) {
198
- u === void 0 && (u = 1), l = Math.max(l, u), d.filter((f) => f.getIsVisible()).forEach((f) => {
199
- var p;
200
- (p = f.columns) != null && p.length && s(f.columns, u + 1);
201
- }, 0);
202
- };
203
- s(e);
204
- let g = [];
205
- const a = (d, u) => {
206
- const f = {
207
- depth: u,
208
- id: [n, `${u}`].filter(Boolean).join("_"),
209
- headers: []
210
- }, p = [];
211
- d.forEach((w) => {
212
- const R = [...p].reverse()[0], v = w.column.depth === f.depth;
213
- let _, V = !1;
214
- if (v && w.column.parent ? _ = w.column.parent : (_ = w.column, V = !0), R && (R == null ? void 0 : R.column) === _)
215
- R.subHeaders.push(w);
216
- else {
217
- const F = oe(t, _, {
218
- id: [n, u, _.id, w == null ? void 0 : w.id].filter(Boolean).join("_"),
219
- isPlaceholder: V,
220
- placeholderId: V ? `${p.filter((h) => h.column === _).length}` : void 0,
221
- depth: u,
222
- index: p.length
223
- });
224
- F.subHeaders.push(w), p.push(F);
225
- }
226
- f.headers.push(w), w.headerGroup = f;
227
- }), g.push(f), u > 0 && a(p, u - 1);
228
- }, c = o.map((d, u) => oe(t, d, {
229
- depth: l,
230
- index: u
231
- }));
232
- a(c, l - 1), g.reverse();
233
- const S = (d) => d.filter((f) => f.column.getIsVisible()).map((f) => {
234
- let p = 0, w = 0, R = [0];
235
- f.subHeaders && f.subHeaders.length ? (R = [], S(f.subHeaders).forEach((_) => {
236
- let {
237
- colSpan: V,
238
- rowSpan: F
239
- } = _;
240
- p += V, R.push(F);
241
- })) : p = 1;
242
- const v = Math.min(...R);
243
- return w = w + v, f.colSpan = p, f.rowSpan = w, {
244
- colSpan: p,
245
- rowSpan: w
246
- };
247
- });
248
- return S((i = (r = g[0]) == null ? void 0 : r.headers) != null ? i : []), g;
249
- }
250
- const T = (e, o, t, n, i, r, l) => {
251
- let s = {
252
- id: o,
253
- index: n,
254
- original: t,
255
- depth: i,
256
- parentId: l,
257
- _valuesCache: {},
258
- _uniqueValuesCache: {},
259
- getValue: (g) => {
260
- if (s._valuesCache.hasOwnProperty(g))
261
- return s._valuesCache[g];
262
- const a = e.getColumn(g);
263
- if (a != null && a.accessorFn)
264
- return s._valuesCache[g] = a.accessorFn(s.original, n), s._valuesCache[g];
265
- },
266
- getUniqueValues: (g) => {
267
- if (s._uniqueValuesCache.hasOwnProperty(g))
268
- return s._uniqueValuesCache[g];
269
- const a = e.getColumn(g);
270
- if (a != null && a.accessorFn)
271
- return a.columnDef.getUniqueValues ? (s._uniqueValuesCache[g] = a.columnDef.getUniqueValues(s.original, n), s._uniqueValuesCache[g]) : (s._uniqueValuesCache[g] = [s.getValue(g)], s._uniqueValuesCache[g]);
272
- },
273
- renderValue: (g) => {
274
- var a;
275
- return (a = s.getValue(g)) != null ? a : e.options.renderFallbackValue;
276
- },
277
- subRows: r ?? [],
278
- getLeafRows: () => re(s.subRows, (g) => g.subRows),
279
- getParentRow: () => s.parentId ? e.getRow(s.parentId, !0) : void 0,
280
- getParentRows: () => {
281
- let g = [], a = s;
282
- for (; ; ) {
283
- const c = a.getParentRow();
284
- if (!c) break;
285
- g.push(c), a = c;
286
- }
287
- return g.reverse();
288
- },
289
- getAllCells: m(() => [e.getAllLeafColumns()], (g) => g.map((a) => Re(e, s, a, a.id)), C(e.options, "debugRows")),
290
- _getAllCellsByColumnId: m(() => [s.getAllCells()], (g) => g.reduce((a, c) => (a[c.column.id] = c, a), {}), C(e.options, "debugRows"))
291
- };
292
- for (let g = 0; g < e._features.length; g++) {
293
- const a = e._features[g];
294
- a == null || a.createRow == null || a.createRow(s, e);
295
- }
296
- return s;
297
- }, he = {
298
- createColumn: (e, o) => {
299
- 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 = () => {
300
- if (e._getFacetedMinMaxValues)
301
- return e._getFacetedMinMaxValues();
302
- };
303
- }
304
- }, le = (e, o, t) => {
305
- var n, i;
306
- const r = t == null || (n = t.toString()) == null ? void 0 : n.toLowerCase();
307
- return !!(!((i = e.getValue(o)) == null || (i = i.toString()) == null || (i = i.toLowerCase()) == null) && i.includes(r));
308
- };
309
- le.autoRemove = (e) => P(e);
310
- const se = (e, o, t) => {
311
- var n;
312
- return !!(!((n = e.getValue(o)) == null || (n = n.toString()) == null) && n.includes(t));
313
- };
314
- se.autoRemove = (e) => P(e);
315
- const ue = (e, o, t) => {
316
- var n;
317
- return ((n = e.getValue(o)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === (t == null ? void 0 : t.toLowerCase());
318
- };
319
- ue.autoRemove = (e) => P(e);
320
- const ge = (e, o, t) => {
321
- var n;
322
- return (n = e.getValue(o)) == null ? void 0 : n.includes(t);
323
- };
324
- ge.autoRemove = (e) => P(e) || !(e != null && e.length);
325
- const ae = (e, o, t) => !t.some((n) => {
326
- var i;
327
- return !((i = e.getValue(o)) != null && i.includes(n));
328
- });
329
- ae.autoRemove = (e) => P(e) || !(e != null && e.length);
330
- const de = (e, o, t) => t.some((n) => {
331
- var i;
332
- return (i = e.getValue(o)) == null ? void 0 : i.includes(n);
333
- });
334
- de.autoRemove = (e) => P(e) || !(e != null && e.length);
335
- const fe = (e, o, t) => e.getValue(o) === t;
336
- fe.autoRemove = (e) => P(e);
337
- const ce = (e, o, t) => e.getValue(o) == t;
338
- ce.autoRemove = (e) => P(e);
339
- const b = (e, o, t) => {
340
- let [n, i] = t;
341
- const r = e.getValue(o);
342
- return r >= n && r <= i;
343
- };
344
- b.resolveFilterValue = (e) => {
345
- let [o, t] = e, n = typeof o != "number" ? parseFloat(o) : o, i = typeof t != "number" ? parseFloat(t) : t, r = o === null || Number.isNaN(n) ? -1 / 0 : n, l = t === null || Number.isNaN(i) ? 1 / 0 : i;
346
- if (r > l) {
347
- const s = r;
348
- r = l, l = s;
349
- }
350
- return [r, l];
351
- };
352
- b.autoRemove = (e) => P(e) || P(e[0]) && P(e[1]);
353
- const x = {
354
- includesString: le,
355
- includesStringSensitive: se,
356
- equalsString: ue,
357
- arrIncludes: ge,
358
- arrIncludesAll: ae,
359
- arrIncludesSome: de,
360
- equals: fe,
361
- weakEquals: ce,
362
- inNumberRange: b
363
- };
364
- function P(e) {
365
- return e == null || e === "";
366
- }
367
- const _e = {
368
- getDefaultColumnDef: () => ({
369
- filterFn: "auto"
370
- }),
371
- getInitialState: (e) => ({
372
- columnFilters: [],
373
- ...e
374
- }),
375
- getDefaultOptions: (e) => ({
376
- onColumnFiltersChange: M("columnFilters", e),
377
- filterFromLeafRows: !1,
378
- maxLeafRowFilterDepth: 100
379
- }),
380
- createColumn: (e, o) => {
381
- e.getAutoFilterFn = () => {
382
- const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
383
- return typeof n == "string" ? x.includesString : typeof n == "number" ? x.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? x.equals : Array.isArray(n) ? x.arrIncludes : x.weakEquals;
384
- }, e.getFilterFn = () => {
385
- var t, n;
386
- return B(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : (
387
- // @ts-ignore
388
- (t = (n = o.options.filterFns) == null ? void 0 : n[e.columnDef.filterFn]) != null ? t : x[e.columnDef.filterFn]
389
- );
390
- }, e.getCanFilter = () => {
391
- var t, n, i;
392
- return ((t = e.columnDef.enableColumnFilter) != null ? t : !0) && ((n = o.options.enableColumnFilters) != null ? n : !0) && ((i = o.options.enableFilters) != null ? i : !0) && !!e.accessorFn;
393
- }, e.getIsFiltered = () => e.getFilterIndex() > -1, e.getFilterValue = () => {
394
- var t;
395
- return (t = o.getState().columnFilters) == null || (t = t.find((n) => n.id === e.id)) == null ? void 0 : t.value;
396
- }, e.getFilterIndex = () => {
397
- var t, n;
398
- return (t = (n = o.getState().columnFilters) == null ? void 0 : n.findIndex((i) => i.id === e.id)) != null ? t : -1;
399
- }, e.setFilterValue = (t) => {
400
- o.setColumnFilters((n) => {
401
- const i = e.getFilterFn(), r = n == null ? void 0 : n.find((c) => c.id === e.id), l = I(t, r ? r.value : void 0);
402
- if (ie(i, l, e)) {
403
- var s;
404
- return (s = n == null ? void 0 : n.filter((c) => c.id !== e.id)) != null ? s : [];
405
- }
406
- const g = {
407
- id: e.id,
408
- value: l
409
- };
410
- if (r) {
411
- var a;
412
- return (a = n == null ? void 0 : n.map((c) => c.id === e.id ? g : c)) != null ? a : [];
413
- }
414
- return n != null && n.length ? [...n, g] : [g];
415
- });
416
- };
417
- },
418
- createRow: (e, o) => {
419
- e.columnFilters = {}, e.columnFiltersMeta = {};
420
- },
421
- createTable: (e) => {
422
- e.setColumnFilters = (o) => {
423
- const t = e.getAllLeafColumns(), n = (i) => {
424
- var r;
425
- return (r = I(o, i)) == null ? void 0 : r.filter((l) => {
426
- const s = t.find((g) => g.id === l.id);
427
- if (s) {
428
- const g = s.getFilterFn();
429
- if (ie(g, l.value, s))
430
- return !1;
431
- }
432
- return !0;
433
- });
434
- };
435
- e.options.onColumnFiltersChange == null || e.options.onColumnFiltersChange(n);
436
- }, e.resetColumnFilters = (o) => {
437
- var t, n;
438
- e.setColumnFilters(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.columnFilters) != null ? t : []);
439
- }, 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());
440
- }
441
- };
442
- function ie(e, o, t) {
443
- return (e && e.autoRemove ? e.autoRemove(o, t) : !1) || typeof o > "u" || typeof o == "string" && !o;
444
- }
445
- const Fe = (e, o, t) => t.reduce((n, i) => {
446
- const r = i.getValue(e);
447
- return n + (typeof r == "number" ? r : 0);
448
- }, 0), $e = (e, o, t) => {
449
- let n;
450
- return t.forEach((i) => {
451
- const r = i.getValue(e);
452
- r != null && (n > r || n === void 0 && r >= r) && (n = r);
453
- }), n;
454
- }, Ve = (e, o, t) => {
455
- let n;
456
- return t.forEach((i) => {
457
- const r = i.getValue(e);
458
- r != null && (n < r || n === void 0 && r >= r) && (n = r);
459
- }), n;
460
- }, Me = (e, o, t) => {
461
- let n, i;
462
- return t.forEach((r) => {
463
- const l = r.getValue(e);
464
- l != null && (n === void 0 ? l >= l && (n = i = l) : (n > l && (n = l), i < l && (i = l)));
465
- }), [n, i];
466
- }, Pe = (e, o) => {
467
- let t = 0, n = 0;
468
- if (o.forEach((i) => {
469
- let r = i.getValue(e);
470
- r != null && (r = +r) >= r && (++t, n += r);
471
- }), t) return n / t;
472
- }, xe = (e, o) => {
473
- if (!o.length)
474
- return;
475
- const t = o.map((r) => r.getValue(e));
476
- if (!Ce(t))
477
- return;
478
- if (t.length === 1)
479
- return t[0];
480
- const n = Math.floor(t.length / 2), i = t.sort((r, l) => r - l);
481
- return t.length % 2 !== 0 ? i[n] : (i[n - 1] + i[n]) / 2;
482
- }, Ie = (e, o) => Array.from(new Set(o.map((t) => t.getValue(e))).values()), ye = (e, o) => new Set(o.map((t) => t.getValue(e))).size, Ee = (e, o) => o.length, q = {
483
- sum: Fe,
484
- min: $e,
485
- max: Ve,
486
- extent: Me,
487
- mean: Pe,
488
- median: xe,
489
- unique: Ie,
490
- uniqueCount: ye,
491
- count: Ee
492
- }, De = {
493
- getDefaultColumnDef: () => ({
494
- aggregatedCell: (e) => {
495
- var o, t;
496
- return (o = (t = e.getValue()) == null || t.toString == null ? void 0 : t.toString()) != null ? o : null;
497
- },
498
- aggregationFn: "auto"
499
- }),
500
- getInitialState: (e) => ({
501
- grouping: [],
502
- ...e
503
- }),
504
- getDefaultOptions: (e) => ({
505
- onGroupingChange: M("grouping", e),
506
- groupedColumnMode: "reorder"
507
- }),
508
- createColumn: (e, o) => {
509
- e.toggleGrouping = () => {
510
- o.setGrouping((t) => t != null && t.includes(e.id) ? t.filter((n) => n !== e.id) : [...t ?? [], e.id]);
511
- }, e.getCanGroup = () => {
512
- var t, n;
513
- return ((t = e.columnDef.enableGrouping) != null ? t : !0) && ((n = o.options.enableGrouping) != null ? n : !0) && (!!e.accessorFn || !!e.columnDef.getGroupingValue);
514
- }, e.getIsGrouped = () => {
515
- var t;
516
- return (t = o.getState().grouping) == null ? void 0 : t.includes(e.id);
517
- }, e.getGroupedIndex = () => {
518
- var t;
519
- return (t = o.getState().grouping) == null ? void 0 : t.indexOf(e.id);
520
- }, e.getToggleGroupingHandler = () => {
521
- const t = e.getCanGroup();
522
- return () => {
523
- t && e.toggleGrouping();
524
- };
525
- }, e.getAutoAggregationFn = () => {
526
- const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
527
- if (typeof n == "number")
528
- return q.sum;
529
- if (Object.prototype.toString.call(n) === "[object Date]")
530
- return q.extent;
531
- }, e.getAggregationFn = () => {
532
- var t, n;
533
- if (!e)
534
- throw new Error();
535
- return B(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 : q[e.columnDef.aggregationFn];
536
- };
537
- },
538
- createTable: (e) => {
539
- e.setGrouping = (o) => e.options.onGroupingChange == null ? void 0 : e.options.onGroupingChange(o), e.resetGrouping = (o) => {
540
- var t, n;
541
- e.setGrouping(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.grouping) != null ? t : []);
542
- }, e.getPreGroupedRowModel = () => e.getFilteredRowModel(), e.getGroupedRowModel = () => (!e._getGroupedRowModel && e.options.getGroupedRowModel && (e._getGroupedRowModel = e.options.getGroupedRowModel(e)), e.options.manualGrouping || !e._getGroupedRowModel ? e.getPreGroupedRowModel() : e._getGroupedRowModel());
543
- },
544
- createRow: (e, o) => {
545
- e.getIsGrouped = () => !!e.groupingColumnId, e.getGroupingValue = (t) => {
546
- if (e._groupingValuesCache.hasOwnProperty(t))
547
- return e._groupingValuesCache[t];
548
- const n = o.getColumn(t);
549
- return n != null && n.columnDef.getGroupingValue ? (e._groupingValuesCache[t] = n.columnDef.getGroupingValue(e.original), e._groupingValuesCache[t]) : e.getValue(t);
550
- }, e._groupingValuesCache = {};
551
- },
552
- createCell: (e, o, t, n) => {
553
- e.getIsGrouped = () => o.getIsGrouped() && o.id === t.groupingColumnId, e.getIsPlaceholder = () => !e.getIsGrouped() && o.getIsGrouped(), e.getIsAggregated = () => {
554
- var i;
555
- return !e.getIsGrouped() && !e.getIsPlaceholder() && !!((i = t.subRows) != null && i.length);
556
- };
557
- }
558
- };
559
- function Ge(e, o, t) {
560
- if (!(o != null && o.length) || !t)
561
- return e;
562
- const n = e.filter((r) => !o.includes(r.id));
563
- return t === "remove" ? n : [...o.map((r) => e.find((l) => l.id === r)).filter(Boolean), ...n];
564
- }
565
- const He = {
566
- getInitialState: (e) => ({
567
- columnOrder: [],
568
- ...e
569
- }),
570
- getDefaultOptions: (e) => ({
571
- onColumnOrderChange: M("columnOrder", e)
572
- }),
573
- createColumn: (e, o) => {
574
- e.getIndex = m((t) => [H(o, t)], (t) => t.findIndex((n) => n.id === e.id), C(o.options, "debugColumns")), e.getIsFirstColumn = (t) => {
575
- var n;
576
- return ((n = H(o, t)[0]) == null ? void 0 : n.id) === e.id;
577
- }, e.getIsLastColumn = (t) => {
578
- var n;
579
- const i = H(o, t);
580
- return ((n = i[i.length - 1]) == null ? void 0 : n.id) === e.id;
581
- };
582
- },
583
- createTable: (e) => {
584
- e.setColumnOrder = (o) => e.options.onColumnOrderChange == null ? void 0 : e.options.onColumnOrderChange(o), e.resetColumnOrder = (o) => {
585
- var t;
586
- e.setColumnOrder(o ? [] : (t = e.initialState.columnOrder) != null ? t : []);
587
- }, e._getOrderColumnsFn = m(() => [e.getState().columnOrder, e.getState().grouping, e.options.groupedColumnMode], (o, t, n) => (i) => {
588
- let r = [];
589
- if (!(o != null && o.length))
590
- r = i;
591
- else {
592
- const l = [...o], s = [...i];
593
- for (; s.length && l.length; ) {
594
- const g = l.shift(), a = s.findIndex((c) => c.id === g);
595
- a > -1 && r.push(s.splice(a, 1)[0]);
596
- }
597
- r = [...r, ...s];
598
- }
599
- return Ge(r, t, n);
600
- }, C(e.options, "debugTable"));
601
- }
602
- }, k = () => ({
603
- left: [],
604
- right: []
605
- }), Ae = {
606
- getInitialState: (e) => ({
607
- columnPinning: k(),
608
- ...e
609
- }),
610
- getDefaultOptions: (e) => ({
611
- onColumnPinningChange: M("columnPinning", e)
612
- }),
613
- createColumn: (e, o) => {
614
- e.pin = (t) => {
615
- const n = e.getLeafColumns().map((i) => i.id).filter(Boolean);
616
- o.setColumnPinning((i) => {
617
- var r, l;
618
- if (t === "right") {
619
- var s, g;
620
- return {
621
- left: ((s = i == null ? void 0 : i.left) != null ? s : []).filter((S) => !(n != null && n.includes(S))),
622
- right: [...((g = i == null ? void 0 : i.right) != null ? g : []).filter((S) => !(n != null && n.includes(S))), ...n]
623
- };
624
- }
625
- if (t === "left") {
626
- var a, c;
627
- return {
628
- left: [...((a = i == null ? void 0 : i.left) != null ? a : []).filter((S) => !(n != null && n.includes(S))), ...n],
629
- right: ((c = i == null ? void 0 : i.right) != null ? c : []).filter((S) => !(n != null && n.includes(S)))
630
- };
631
- }
632
- return {
633
- left: ((r = i == null ? void 0 : i.left) != null ? r : []).filter((S) => !(n != null && n.includes(S))),
634
- right: ((l = i == null ? void 0 : i.right) != null ? l : []).filter((S) => !(n != null && n.includes(S)))
635
- };
636
- });
637
- }, e.getCanPin = () => e.getLeafColumns().some((n) => {
638
- var i, r, l;
639
- return ((i = n.columnDef.enablePinning) != null ? i : !0) && ((r = (l = o.options.enableColumnPinning) != null ? l : o.options.enablePinning) != null ? r : !0);
640
- }), e.getIsPinned = () => {
641
- const t = e.getLeafColumns().map((s) => s.id), {
642
- left: n,
643
- right: i
644
- } = o.getState().columnPinning, r = t.some((s) => n == null ? void 0 : n.includes(s)), l = t.some((s) => i == null ? void 0 : i.includes(s));
645
- return r ? "left" : l ? "right" : !1;
646
- }, e.getPinnedIndex = () => {
647
- var t, n;
648
- const i = e.getIsPinned();
649
- return i ? (t = (n = o.getState().columnPinning) == null || (n = n[i]) == null ? void 0 : n.indexOf(e.id)) != null ? t : -1 : 0;
650
- };
651
- },
652
- createRow: (e, o) => {
653
- e.getCenterVisibleCells = m(() => [e._getAllVisibleCells(), o.getState().columnPinning.left, o.getState().columnPinning.right], (t, n, i) => {
654
- const r = [...n ?? [], ...i ?? []];
655
- return t.filter((l) => !r.includes(l.column.id));
656
- }, C(o.options, "debugRows")), e.getLeftVisibleCells = m(() => [e._getAllVisibleCells(), o.getState().columnPinning.left], (t, n) => (n ?? []).map((r) => t.find((l) => l.column.id === r)).filter(Boolean).map((r) => ({
657
- ...r,
658
- position: "left"
659
- })), C(o.options, "debugRows")), e.getRightVisibleCells = m(() => [e._getAllVisibleCells(), o.getState().columnPinning.right], (t, n) => (n ?? []).map((r) => t.find((l) => l.column.id === r)).filter(Boolean).map((r) => ({
660
- ...r,
661
- position: "right"
662
- })), C(o.options, "debugRows"));
663
- },
664
- createTable: (e) => {
665
- e.setColumnPinning = (o) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(o), e.resetColumnPinning = (o) => {
666
- var t, n;
667
- return e.setColumnPinning(o ? k() : (t = (n = e.initialState) == null ? void 0 : n.columnPinning) != null ? t : k());
668
- }, e.getIsSomeColumnsPinned = (o) => {
669
- var t;
670
- const n = e.getState().columnPinning;
671
- if (!o) {
672
- var i, r;
673
- return !!((i = n.left) != null && i.length || (r = n.right) != null && r.length);
674
- }
675
- return !!((t = n[o]) != null && t.length);
676
- }, e.getLeftLeafColumns = m(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (o, t) => (t ?? []).map((n) => o.find((i) => i.id === n)).filter(Boolean), C(e.options, "debugColumns")), e.getRightLeafColumns = m(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (o, t) => (t ?? []).map((n) => o.find((i) => i.id === n)).filter(Boolean), C(e.options, "debugColumns")), e.getCenterLeafColumns = m(() => [e.getAllLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n) => {
677
- const i = [...t ?? [], ...n ?? []];
678
- return o.filter((r) => !i.includes(r.id));
679
- }, C(e.options, "debugColumns"));
680
- }
681
- }, z = {
682
- size: 150,
683
- minSize: 20,
684
- maxSize: Number.MAX_SAFE_INTEGER
685
- }, U = () => ({
686
- startOffset: null,
687
- startSize: null,
688
- deltaOffset: null,
689
- deltaPercentage: null,
690
- isResizingColumn: !1,
691
- columnSizingStart: []
692
- }), Le = {
693
- getDefaultColumnDef: () => z,
694
- getInitialState: (e) => ({
695
- columnSizing: {},
696
- columnSizingInfo: U(),
697
- ...e
698
- }),
699
- getDefaultOptions: (e) => ({
700
- columnResizeMode: "onEnd",
701
- columnResizeDirection: "ltr",
702
- onColumnSizingChange: M("columnSizing", e),
703
- onColumnSizingInfoChange: M("columnSizingInfo", e)
704
- }),
705
- createColumn: (e, o) => {
706
- e.getSize = () => {
707
- var t, n, i;
708
- const r = o.getState().columnSizing[e.id];
709
- return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : z.minSize, (n = r ?? e.columnDef.size) != null ? n : z.size), (i = e.columnDef.maxSize) != null ? i : z.maxSize);
710
- }, e.getStart = m((t) => [t, H(o, t), o.getState().columnSizing], (t, n) => n.slice(0, e.getIndex(t)).reduce((i, r) => i + r.getSize(), 0), C(o.options, "debugColumns")), e.getAfter = m((t) => [t, H(o, t), o.getState().columnSizing], (t, n) => n.slice(e.getIndex(t) + 1).reduce((i, r) => i + r.getSize(), 0), C(o.options, "debugColumns")), e.resetSize = () => {
711
- o.setColumnSizing((t) => {
712
- let {
713
- [e.id]: n,
714
- ...i
715
- } = t;
716
- return i;
717
- });
718
- }, e.getCanResize = () => {
719
- var t, n;
720
- return ((t = e.columnDef.enableResizing) != null ? t : !0) && ((n = o.options.enableColumnResizing) != null ? n : !0);
721
- }, e.getIsResizing = () => o.getState().columnSizingInfo.isResizingColumn === e.id;
722
- },
723
- createHeader: (e, o) => {
724
- e.getSize = () => {
725
- let t = 0;
726
- const n = (i) => {
727
- if (i.subHeaders.length)
728
- i.subHeaders.forEach(n);
729
- else {
730
- var r;
731
- t += (r = i.column.getSize()) != null ? r : 0;
732
- }
733
- };
734
- return n(e), t;
735
- }, e.getStart = () => {
736
- if (e.index > 0) {
737
- const t = e.headerGroup.headers[e.index - 1];
738
- return t.getStart() + t.getSize();
739
- }
740
- return 0;
741
- }, e.getResizeHandler = (t) => {
742
- const n = o.getColumn(e.column.id), i = n == null ? void 0 : n.getCanResize();
743
- return (r) => {
744
- if (!n || !i || (r.persist == null || r.persist(), j(r) && r.touches && r.touches.length > 1))
745
- return;
746
- const l = e.getSize(), s = e ? e.getLeafHeaders().map((R) => [R.column.id, R.column.getSize()]) : [[n.id, n.getSize()]], g = j(r) ? Math.round(r.touches[0].clientX) : r.clientX, a = {}, c = (R, v) => {
747
- typeof v == "number" && (o.setColumnSizingInfo((_) => {
748
- var V, F;
749
- const h = o.options.columnResizeDirection === "rtl" ? -1 : 1, E = (v - ((V = _ == null ? void 0 : _.startOffset) != null ? V : 0)) * h, D = Math.max(E / ((F = _ == null ? void 0 : _.startSize) != null ? F : 0), -0.999999);
750
- return _.columnSizingStart.forEach((A) => {
751
- let [me, ne] = A;
752
- a[me] = Math.round(Math.max(ne + ne * D, 0) * 100) / 100;
753
- }), {
754
- ..._,
755
- deltaOffset: E,
756
- deltaPercentage: D
757
- };
758
- }), (o.options.columnResizeMode === "onChange" || R === "end") && o.setColumnSizing((_) => ({
759
- ..._,
760
- ...a
761
- })));
762
- }, S = (R) => c("move", R), d = (R) => {
763
- c("end", R), o.setColumnSizingInfo((v) => ({
764
- ...v,
765
- isResizingColumn: !1,
766
- startOffset: null,
767
- startSize: null,
768
- deltaOffset: null,
769
- deltaPercentage: null,
770
- columnSizingStart: []
771
- }));
772
- }, u = t || typeof document < "u" ? document : null, f = {
773
- moveHandler: (R) => S(R.clientX),
774
- upHandler: (R) => {
775
- u == null || u.removeEventListener("mousemove", f.moveHandler), u == null || u.removeEventListener("mouseup", f.upHandler), d(R.clientX);
776
- }
777
- }, p = {
778
- moveHandler: (R) => (R.cancelable && (R.preventDefault(), R.stopPropagation()), S(R.touches[0].clientX), !1),
779
- upHandler: (R) => {
780
- var v;
781
- u == null || u.removeEventListener("touchmove", p.moveHandler), u == null || u.removeEventListener("touchend", p.upHandler), R.cancelable && (R.preventDefault(), R.stopPropagation()), d((v = R.touches[0]) == null ? void 0 : v.clientX);
782
- }
783
- }, w = ze() ? {
784
- passive: !1
785
- } : !1;
786
- j(r) ? (u == null || u.addEventListener("touchmove", p.moveHandler, w), u == null || u.addEventListener("touchend", p.upHandler, w)) : (u == null || u.addEventListener("mousemove", f.moveHandler, w), u == null || u.addEventListener("mouseup", f.upHandler, w)), o.setColumnSizingInfo((R) => ({
787
- ...R,
788
- startOffset: g,
789
- startSize: l,
790
- deltaOffset: 0,
791
- deltaPercentage: 0,
792
- columnSizingStart: s,
793
- isResizingColumn: n.id
794
- }));
795
- };
796
- };
797
- },
798
- createTable: (e) => {
799
- e.setColumnSizing = (o) => e.options.onColumnSizingChange == null ? void 0 : e.options.onColumnSizingChange(o), e.setColumnSizingInfo = (o) => e.options.onColumnSizingInfoChange == null ? void 0 : e.options.onColumnSizingInfoChange(o), e.resetColumnSizing = (o) => {
800
- var t;
801
- e.setColumnSizing(o ? {} : (t = e.initialState.columnSizing) != null ? t : {});
802
- }, e.resetHeaderSizeInfo = (o) => {
803
- var t;
804
- e.setColumnSizingInfo(o ? U() : (t = e.initialState.columnSizingInfo) != null ? t : U());
805
- }, e.getTotalSize = () => {
806
- var o, t;
807
- return (o = (t = e.getHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? o : 0;
808
- }, e.getLeftTotalSize = () => {
809
- var o, t;
810
- return (o = (t = e.getLeftHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? o : 0;
811
- }, e.getCenterTotalSize = () => {
812
- var o, t;
813
- return (o = (t = e.getCenterHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? o : 0;
814
- }, e.getRightTotalSize = () => {
815
- var o, t;
816
- return (o = (t = e.getRightHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? o : 0;
817
- };
818
- }
819
- };
820
- let O = null;
821
- function ze() {
822
- if (typeof O == "boolean") return O;
823
- let e = !1;
824
- try {
825
- const o = {
826
- get passive() {
827
- return e = !0, !1;
828
- }
829
- }, t = () => {
830
- };
831
- window.addEventListener("test", t, o), window.removeEventListener("test", t);
832
- } catch {
833
- e = !1;
834
- }
835
- return O = e, O;
836
- }
837
- function j(e) {
838
- return e.type === "touchstart";
839
- }
840
- const Oe = {
841
- getInitialState: (e) => ({
842
- columnVisibility: {},
843
- ...e
844
- }),
845
- getDefaultOptions: (e) => ({
846
- onColumnVisibilityChange: M("columnVisibility", e)
847
- }),
848
- createColumn: (e, o) => {
849
- e.toggleVisibility = (t) => {
850
- e.getCanHide() && o.setColumnVisibility((n) => ({
851
- ...n,
852
- [e.id]: t ?? !e.getIsVisible()
853
- }));
854
- }, e.getIsVisible = () => {
855
- var t, n;
856
- const i = e.columns;
857
- return (t = i.length ? i.some((r) => r.getIsVisible()) : (n = o.getState().columnVisibility) == null ? void 0 : n[e.id]) != null ? t : !0;
858
- }, e.getCanHide = () => {
859
- var t, n;
860
- return ((t = e.columnDef.enableHiding) != null ? t : !0) && ((n = o.options.enableHiding) != null ? n : !0);
861
- }, e.getToggleVisibilityHandler = () => (t) => {
862
- e.toggleVisibility == null || e.toggleVisibility(t.target.checked);
863
- };
864
- },
865
- createRow: (e, o) => {
866
- e._getAllVisibleCells = m(() => [e.getAllCells(), o.getState().columnVisibility], (t) => t.filter((n) => n.column.getIsVisible()), C(o.options, "debugRows")), e.getVisibleCells = m(() => [e.getLeftVisibleCells(), e.getCenterVisibleCells(), e.getRightVisibleCells()], (t, n, i) => [...t, ...n, ...i], C(o.options, "debugRows"));
867
- },
868
- createTable: (e) => {
869
- const o = (t, n) => m(() => [n(), n().filter((i) => i.getIsVisible()).map((i) => i.id).join("_")], (i) => i.filter((r) => r.getIsVisible == null ? void 0 : r.getIsVisible()), C(e.options, "debugColumns"));
870
- e.getVisibleFlatColumns = o("getVisibleFlatColumns", () => e.getAllFlatColumns()), e.getVisibleLeafColumns = o("getVisibleLeafColumns", () => e.getAllLeafColumns()), e.getLeftVisibleLeafColumns = o("getLeftVisibleLeafColumns", () => e.getLeftLeafColumns()), e.getRightVisibleLeafColumns = o("getRightVisibleLeafColumns", () => e.getRightLeafColumns()), e.getCenterVisibleLeafColumns = o("getCenterVisibleLeafColumns", () => e.getCenterLeafColumns()), e.setColumnVisibility = (t) => e.options.onColumnVisibilityChange == null ? void 0 : e.options.onColumnVisibilityChange(t), e.resetColumnVisibility = (t) => {
871
- var n;
872
- e.setColumnVisibility(t ? {} : (n = e.initialState.columnVisibility) != null ? n : {});
873
- }, e.toggleAllColumnsVisible = (t) => {
874
- var n;
875
- t = (n = t) != null ? n : !e.getIsAllColumnsVisible(), e.setColumnVisibility(e.getAllLeafColumns().reduce((i, r) => ({
876
- ...i,
877
- [r.id]: t || !(r.getCanHide != null && r.getCanHide())
878
- }), {}));
879
- }, e.getIsAllColumnsVisible = () => !e.getAllLeafColumns().some((t) => !(t.getIsVisible != null && t.getIsVisible())), e.getIsSomeColumnsVisible = () => e.getAllLeafColumns().some((t) => t.getIsVisible == null ? void 0 : t.getIsVisible()), e.getToggleAllColumnsVisibilityHandler = () => (t) => {
880
- var n;
881
- e.toggleAllColumnsVisible((n = t.target) == null ? void 0 : n.checked);
882
- };
883
- }
884
- };
885
- function H(e, o) {
886
- return o ? o === "center" ? e.getCenterVisibleLeafColumns() : o === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
887
- }
888
- const Be = {
889
- createTable: (e) => {
890
- 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 = () => {
891
- if (e._getGlobalFacetedMinMaxValues)
892
- return e._getGlobalFacetedMinMaxValues();
893
- };
894
- }
895
- }, Te = {
896
- getInitialState: (e) => ({
897
- globalFilter: void 0,
898
- ...e
899
- }),
900
- getDefaultOptions: (e) => ({
901
- onGlobalFilterChange: M("globalFilter", e),
902
- globalFilterFn: "auto",
903
- getColumnCanGlobalFilter: (o) => {
904
- var t;
905
- const n = (t = e.getCoreRowModel().flatRows[0]) == null || (t = t._getAllCellsByColumnId()[o.id]) == null ? void 0 : t.getValue();
906
- return typeof n == "string" || typeof n == "number";
907
- }
908
- }),
909
- createColumn: (e, o) => {
910
- e.getCanGlobalFilter = () => {
911
- var t, n, i, r;
912
- return ((t = e.columnDef.enableGlobalFilter) != null ? t : !0) && ((n = o.options.enableGlobalFilter) != null ? n : !0) && ((i = o.options.enableFilters) != null ? i : !0) && ((r = o.options.getColumnCanGlobalFilter == null ? void 0 : o.options.getColumnCanGlobalFilter(e)) != null ? r : !0) && !!e.accessorFn;
913
- };
914
- },
915
- createTable: (e) => {
916
- e.getGlobalAutoFilterFn = () => x.includesString, e.getGlobalFilterFn = () => {
917
- var o, t;
918
- const {
919
- globalFilterFn: n
920
- } = e.options;
921
- return B(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (o = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? o : x[n];
922
- }, e.setGlobalFilter = (o) => {
923
- e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(o);
924
- }, e.resetGlobalFilter = (o) => {
925
- e.setGlobalFilter(o ? void 0 : e.initialState.globalFilter);
926
- };
927
- }
928
- }, qe = {
929
- getInitialState: (e) => ({
930
- expanded: {},
931
- ...e
932
- }),
933
- getDefaultOptions: (e) => ({
934
- onExpandedChange: M("expanded", e),
935
- paginateExpandedRows: !0
936
- }),
937
- createTable: (e) => {
938
- let o = !1, t = !1;
939
- e._autoResetExpanded = () => {
940
- var n, i;
941
- if (!o) {
942
- e._queue(() => {
943
- o = !0;
944
- });
945
- return;
946
- }
947
- if ((n = (i = e.options.autoResetAll) != null ? i : e.options.autoResetExpanded) != null ? n : !e.options.manualExpanding) {
948
- if (t) return;
949
- t = !0, e._queue(() => {
950
- e.resetExpanded(), t = !1;
951
- });
952
- }
953
- }, e.setExpanded = (n) => e.options.onExpandedChange == null ? void 0 : e.options.onExpandedChange(n), e.toggleAllRowsExpanded = (n) => {
954
- n ?? !e.getIsAllRowsExpanded() ? e.setExpanded(!0) : e.setExpanded({});
955
- }, e.resetExpanded = (n) => {
956
- var i, r;
957
- e.setExpanded(n ? {} : (i = (r = e.initialState) == null ? void 0 : r.expanded) != null ? i : {});
958
- }, e.getCanSomeRowsExpand = () => e.getPrePaginationRowModel().flatRows.some((n) => n.getCanExpand()), e.getToggleAllRowsExpandedHandler = () => (n) => {
959
- n.persist == null || n.persist(), e.toggleAllRowsExpanded();
960
- }, e.getIsSomeRowsExpanded = () => {
961
- const n = e.getState().expanded;
962
- return n === !0 || Object.values(n).some(Boolean);
963
- }, e.getIsAllRowsExpanded = () => {
964
- const n = e.getState().expanded;
965
- return typeof n == "boolean" ? n === !0 : !(!Object.keys(n).length || e.getRowModel().flatRows.some((i) => !i.getIsExpanded()));
966
- }, e.getExpandedDepth = () => {
967
- let n = 0;
968
- return (e.getState().expanded === !0 ? Object.keys(e.getRowModel().rowsById) : Object.keys(e.getState().expanded)).forEach((r) => {
969
- const l = r.split(".");
970
- n = Math.max(n, l.length);
971
- }), n;
972
- }, e.getPreExpandedRowModel = () => e.getSortedRowModel(), e.getExpandedRowModel = () => (!e._getExpandedRowModel && e.options.getExpandedRowModel && (e._getExpandedRowModel = e.options.getExpandedRowModel(e)), e.options.manualExpanding || !e._getExpandedRowModel ? e.getPreExpandedRowModel() : e._getExpandedRowModel());
973
- },
974
- createRow: (e, o) => {
975
- e.toggleExpanded = (t) => {
976
- o.setExpanded((n) => {
977
- var i;
978
- const r = n === !0 ? !0 : !!(n != null && n[e.id]);
979
- let l = {};
980
- if (n === !0 ? Object.keys(o.getRowModel().rowsById).forEach((s) => {
981
- l[s] = !0;
982
- }) : l = n, t = (i = t) != null ? i : !r, !r && t)
983
- return {
984
- ...l,
985
- [e.id]: !0
986
- };
987
- if (r && !t) {
988
- const {
989
- [e.id]: s,
990
- ...g
991
- } = l;
992
- return g;
993
- }
994
- return n;
995
- });
996
- }, e.getIsExpanded = () => {
997
- var t;
998
- const n = o.getState().expanded;
999
- return !!((t = o.options.getIsRowExpanded == null ? void 0 : o.options.getIsRowExpanded(e)) != null ? t : n === !0 || n != null && n[e.id]);
1000
- }, e.getCanExpand = () => {
1001
- var t, n, i;
1002
- return (t = o.options.getRowCanExpand == null ? void 0 : o.options.getRowCanExpand(e)) != null ? t : ((n = o.options.enableExpanding) != null ? n : !0) && !!((i = e.subRows) != null && i.length);
1003
- }, e.getIsAllParentsExpanded = () => {
1004
- let t = !0, n = e;
1005
- for (; t && n.parentId; )
1006
- n = o.getRow(n.parentId, !0), t = n.getIsExpanded();
1007
- return t;
1008
- }, e.getToggleExpandedHandler = () => {
1009
- const t = e.getCanExpand();
1010
- return () => {
1011
- t && e.toggleExpanded();
1012
- };
1013
- };
1014
- }
1015
- }, J = 0, Q = 10, N = () => ({
1016
- pageIndex: J,
1017
- pageSize: Q
1018
- }), ke = {
1019
- getInitialState: (e) => ({
1020
- ...e,
1021
- pagination: {
1022
- ...N(),
1023
- ...e == null ? void 0 : e.pagination
1024
- }
1025
- }),
1026
- getDefaultOptions: (e) => ({
1027
- onPaginationChange: M("pagination", e)
1028
- }),
1029
- createTable: (e) => {
1030
- let o = !1, t = !1;
1031
- e._autoResetPageIndex = () => {
1032
- var n, i;
1033
- if (!o) {
1034
- e._queue(() => {
1035
- o = !0;
1036
- });
1037
- return;
1038
- }
1039
- if ((n = (i = e.options.autoResetAll) != null ? i : e.options.autoResetPageIndex) != null ? n : !e.options.manualPagination) {
1040
- if (t) return;
1041
- t = !0, e._queue(() => {
1042
- e.resetPageIndex(), t = !1;
1043
- });
1044
- }
1045
- }, e.setPagination = (n) => {
1046
- const i = (r) => I(n, r);
1047
- return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(i);
1048
- }, e.resetPagination = (n) => {
1049
- var i;
1050
- e.setPagination(n ? N() : (i = e.initialState.pagination) != null ? i : N());
1051
- }, e.setPageIndex = (n) => {
1052
- e.setPagination((i) => {
1053
- let r = I(n, i.pageIndex);
1054
- const l = typeof e.options.pageCount > "u" || e.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : e.options.pageCount - 1;
1055
- return r = Math.max(0, Math.min(r, l)), {
1056
- ...i,
1057
- pageIndex: r
1058
- };
1059
- });
1060
- }, e.resetPageIndex = (n) => {
1061
- var i, r;
1062
- e.setPageIndex(n ? J : (i = (r = e.initialState) == null || (r = r.pagination) == null ? void 0 : r.pageIndex) != null ? i : J);
1063
- }, e.resetPageSize = (n) => {
1064
- var i, r;
1065
- e.setPageSize(n ? Q : (i = (r = e.initialState) == null || (r = r.pagination) == null ? void 0 : r.pageSize) != null ? i : Q);
1066
- }, e.setPageSize = (n) => {
1067
- e.setPagination((i) => {
1068
- const r = Math.max(1, I(n, i.pageSize)), l = i.pageSize * i.pageIndex, s = Math.floor(l / r);
1069
- return {
1070
- ...i,
1071
- pageIndex: s,
1072
- pageSize: r
1073
- };
1074
- });
1075
- }, e.setPageCount = (n) => e.setPagination((i) => {
1076
- var r;
1077
- let l = I(n, (r = e.options.pageCount) != null ? r : -1);
1078
- return typeof l == "number" && (l = Math.max(-1, l)), {
1079
- ...i,
1080
- pageCount: l
1081
- };
1082
- }), e.getPageOptions = m(() => [e.getPageCount()], (n) => {
1083
- let i = [];
1084
- return n && n > 0 && (i = [...new Array(n)].fill(null).map((r, l) => l)), i;
1085
- }, C(e.options, "debugTable")), e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0, e.getCanNextPage = () => {
1086
- const {
1087
- pageIndex: n
1088
- } = e.getState().pagination, i = e.getPageCount();
1089
- return i === -1 ? !0 : i === 0 ? !1 : n < i - 1;
1090
- }, e.previousPage = () => e.setPageIndex((n) => n - 1), e.nextPage = () => e.setPageIndex((n) => n + 1), e.firstPage = () => e.setPageIndex(0), e.lastPage = () => e.setPageIndex(e.getPageCount() - 1), e.getPrePaginationRowModel = () => e.getExpandedRowModel(), e.getPaginationRowModel = () => (!e._getPaginationRowModel && e.options.getPaginationRowModel && (e._getPaginationRowModel = e.options.getPaginationRowModel(e)), e.options.manualPagination || !e._getPaginationRowModel ? e.getPrePaginationRowModel() : e._getPaginationRowModel()), e.getPageCount = () => {
1091
- var n;
1092
- return (n = e.options.pageCount) != null ? n : Math.ceil(e.getRowCount() / e.getState().pagination.pageSize);
1093
- }, e.getRowCount = () => {
1094
- var n;
1095
- return (n = e.options.rowCount) != null ? n : e.getPrePaginationRowModel().rows.length;
1096
- };
1097
- }
1098
- }, X = () => ({
1099
- top: [],
1100
- bottom: []
1101
- }), Ue = {
1102
- getInitialState: (e) => ({
1103
- rowPinning: X(),
1104
- ...e
1105
- }),
1106
- getDefaultOptions: (e) => ({
1107
- onRowPinningChange: M("rowPinning", e)
1108
- }),
1109
- createRow: (e, o) => {
1110
- e.pin = (t, n, i) => {
1111
- const r = n ? e.getLeafRows().map((g) => {
1112
- let {
1113
- id: a
1114
- } = g;
1115
- return a;
1116
- }) : [], l = i ? e.getParentRows().map((g) => {
1117
- let {
1118
- id: a
1119
- } = g;
1120
- return a;
1121
- }) : [], s = /* @__PURE__ */ new Set([...l, e.id, ...r]);
1122
- o.setRowPinning((g) => {
1123
- var a, c;
1124
- if (t === "bottom") {
1125
- var S, d;
1126
- return {
1127
- top: ((S = g == null ? void 0 : g.top) != null ? S : []).filter((p) => !(s != null && s.has(p))),
1128
- bottom: [...((d = g == null ? void 0 : g.bottom) != null ? d : []).filter((p) => !(s != null && s.has(p))), ...Array.from(s)]
1129
- };
1130
- }
1131
- if (t === "top") {
1132
- var u, f;
1133
- return {
1134
- top: [...((u = g == null ? void 0 : g.top) != null ? u : []).filter((p) => !(s != null && s.has(p))), ...Array.from(s)],
1135
- bottom: ((f = g == null ? void 0 : g.bottom) != null ? f : []).filter((p) => !(s != null && s.has(p)))
1136
- };
1137
- }
1138
- return {
1139
- top: ((a = g == null ? void 0 : g.top) != null ? a : []).filter((p) => !(s != null && s.has(p))),
1140
- bottom: ((c = g == null ? void 0 : g.bottom) != null ? c : []).filter((p) => !(s != null && s.has(p)))
1141
- };
1142
- });
1143
- }, e.getCanPin = () => {
1144
- var t;
1145
- const {
1146
- enableRowPinning: n,
1147
- enablePinning: i
1148
- } = o.options;
1149
- return typeof n == "function" ? n(e) : (t = n ?? i) != null ? t : !0;
1150
- }, e.getIsPinned = () => {
1151
- const t = [e.id], {
1152
- top: n,
1153
- bottom: i
1154
- } = o.getState().rowPinning, r = t.some((s) => n == null ? void 0 : n.includes(s)), l = t.some((s) => i == null ? void 0 : i.includes(s));
1155
- return r ? "top" : l ? "bottom" : !1;
1156
- }, e.getPinnedIndex = () => {
1157
- var t, n;
1158
- const i = e.getIsPinned();
1159
- if (!i) return -1;
1160
- const r = (t = i === "top" ? o.getTopRows() : o.getBottomRows()) == null ? void 0 : t.map((l) => {
1161
- let {
1162
- id: s
1163
- } = l;
1164
- return s;
1165
- });
1166
- return (n = r == null ? void 0 : r.indexOf(e.id)) != null ? n : -1;
1167
- };
1168
- },
1169
- createTable: (e) => {
1170
- e.setRowPinning = (o) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(o), e.resetRowPinning = (o) => {
1171
- var t, n;
1172
- return e.setRowPinning(o ? X() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : X());
1173
- }, e.getIsSomeRowsPinned = (o) => {
1174
- var t;
1175
- const n = e.getState().rowPinning;
1176
- if (!o) {
1177
- var i, r;
1178
- return !!((i = n.top) != null && i.length || (r = n.bottom) != null && r.length);
1179
- }
1180
- return !!((t = n[o]) != null && t.length);
1181
- }, e._getPinnedRows = (o, t, n) => {
1182
- var i;
1183
- return ((i = e.options.keepPinnedRows) == null || i ? (
1184
- //get all rows that are pinned even if they would not be otherwise visible
1185
- //account for expanded parent rows, but not pagination or filtering
1186
- (t ?? []).map((l) => {
1187
- const s = e.getRow(l, !0);
1188
- return s.getIsAllParentsExpanded() ? s : null;
1189
- })
1190
- ) : (
1191
- //else get only visible rows that are pinned
1192
- (t ?? []).map((l) => o.find((s) => s.id === l))
1193
- )).filter(Boolean).map((l) => ({
1194
- ...l,
1195
- position: n
1196
- }));
1197
- }, e.getTopRows = m(() => [e.getRowModel().rows, e.getState().rowPinning.top], (o, t) => e._getPinnedRows(o, t, "top"), C(e.options, "debugRows")), e.getBottomRows = m(() => [e.getRowModel().rows, e.getState().rowPinning.bottom], (o, t) => e._getPinnedRows(o, t, "bottom"), C(e.options, "debugRows")), e.getCenterRows = m(() => [e.getRowModel().rows, e.getState().rowPinning.top, e.getState().rowPinning.bottom], (o, t, n) => {
1198
- const i = /* @__PURE__ */ new Set([...t ?? [], ...n ?? []]);
1199
- return o.filter((r) => !i.has(r.id));
1200
- }, C(e.options, "debugRows"));
1201
- }
1202
- }, je = {
1203
- getInitialState: (e) => ({
1204
- rowSelection: {},
1205
- ...e
1206
- }),
1207
- getDefaultOptions: (e) => ({
1208
- onRowSelectionChange: M("rowSelection", e),
1209
- enableRowSelection: !0,
1210
- enableMultiRowSelection: !0,
1211
- enableSubRowSelection: !0
1212
- // enableGroupingRowSelection: false,
1213
- // isAdditiveSelectEvent: (e: unknown) => !!e.metaKey,
1214
- // isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey,
1215
- }),
1216
- createTable: (e) => {
1217
- e.setRowSelection = (o) => e.options.onRowSelectionChange == null ? void 0 : e.options.onRowSelectionChange(o), e.resetRowSelection = (o) => {
1218
- var t;
1219
- return e.setRowSelection(o ? {} : (t = e.initialState.rowSelection) != null ? t : {});
1220
- }, e.toggleAllRowsSelected = (o) => {
1221
- e.setRowSelection((t) => {
1222
- o = typeof o < "u" ? o : !e.getIsAllRowsSelected();
1223
- const n = {
1224
- ...t
1225
- }, i = e.getPreGroupedRowModel().flatRows;
1226
- return o ? i.forEach((r) => {
1227
- r.getCanSelect() && (n[r.id] = !0);
1228
- }) : i.forEach((r) => {
1229
- delete n[r.id];
1230
- }), n;
1231
- });
1232
- }, e.toggleAllPageRowsSelected = (o) => e.setRowSelection((t) => {
1233
- const n = typeof o < "u" ? o : !e.getIsAllPageRowsSelected(), i = {
1234
- ...t
1235
- };
1236
- return e.getRowModel().rows.forEach((r) => {
1237
- W(i, r.id, n, !0, e);
1238
- }), i;
1239
- }), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = m(() => [e.getState().rowSelection, e.getCoreRowModel()], (o, t) => Object.keys(o).length ? K(e, t) : {
1240
- rows: [],
1241
- flatRows: [],
1242
- rowsById: {}
1243
- }, C(e.options, "debugTable")), e.getFilteredSelectedRowModel = m(() => [e.getState().rowSelection, e.getFilteredRowModel()], (o, t) => Object.keys(o).length ? K(e, t) : {
1244
- rows: [],
1245
- flatRows: [],
1246
- rowsById: {}
1247
- }, C(e.options, "debugTable")), e.getGroupedSelectedRowModel = m(() => [e.getState().rowSelection, e.getSortedRowModel()], (o, t) => Object.keys(o).length ? K(e, t) : {
1248
- rows: [],
1249
- flatRows: [],
1250
- rowsById: {}
1251
- }, C(e.options, "debugTable")), e.getIsAllRowsSelected = () => {
1252
- const o = e.getFilteredRowModel().flatRows, {
1253
- rowSelection: t
1254
- } = e.getState();
1255
- let n = !!(o.length && Object.keys(t).length);
1256
- return n && o.some((i) => i.getCanSelect() && !t[i.id]) && (n = !1), n;
1257
- }, e.getIsAllPageRowsSelected = () => {
1258
- const o = e.getPaginationRowModel().flatRows.filter((i) => i.getCanSelect()), {
1259
- rowSelection: t
1260
- } = e.getState();
1261
- let n = !!o.length;
1262
- return n && o.some((i) => !t[i.id]) && (n = !1), n;
1263
- }, e.getIsSomeRowsSelected = () => {
1264
- var o;
1265
- const t = Object.keys((o = e.getState().rowSelection) != null ? o : {}).length;
1266
- return t > 0 && t < e.getFilteredRowModel().flatRows.length;
1267
- }, e.getIsSomePageRowsSelected = () => {
1268
- const o = e.getPaginationRowModel().flatRows;
1269
- return e.getIsAllPageRowsSelected() ? !1 : o.filter((t) => t.getCanSelect()).some((t) => t.getIsSelected() || t.getIsSomeSelected());
1270
- }, e.getToggleAllRowsSelectedHandler = () => (o) => {
1271
- e.toggleAllRowsSelected(o.target.checked);
1272
- }, e.getToggleAllPageRowsSelectedHandler = () => (o) => {
1273
- e.toggleAllPageRowsSelected(o.target.checked);
1274
- };
1275
- },
1276
- createRow: (e, o) => {
1277
- e.toggleSelected = (t, n) => {
1278
- const i = e.getIsSelected();
1279
- o.setRowSelection((r) => {
1280
- var l;
1281
- if (t = typeof t < "u" ? t : !i, e.getCanSelect() && i === t)
1282
- return r;
1283
- const s = {
1284
- ...r
1285
- };
1286
- return W(s, e.id, t, (l = n == null ? void 0 : n.selectChildren) != null ? l : !0, o), s;
1287
- });
1288
- }, e.getIsSelected = () => {
1289
- const {
1290
- rowSelection: t
1291
- } = o.getState();
1292
- return ee(e, t);
1293
- }, e.getIsSomeSelected = () => {
1294
- const {
1295
- rowSelection: t
1296
- } = o.getState();
1297
- return Y(e, t) === "some";
1298
- }, e.getIsAllSubRowsSelected = () => {
1299
- const {
1300
- rowSelection: t
1301
- } = o.getState();
1302
- return Y(e, t) === "all";
1303
- }, e.getCanSelect = () => {
1304
- var t;
1305
- return typeof o.options.enableRowSelection == "function" ? o.options.enableRowSelection(e) : (t = o.options.enableRowSelection) != null ? t : !0;
1306
- }, e.getCanSelectSubRows = () => {
1307
- var t;
1308
- return typeof o.options.enableSubRowSelection == "function" ? o.options.enableSubRowSelection(e) : (t = o.options.enableSubRowSelection) != null ? t : !0;
1309
- }, e.getCanMultiSelect = () => {
1310
- var t;
1311
- return typeof o.options.enableMultiRowSelection == "function" ? o.options.enableMultiRowSelection(e) : (t = o.options.enableMultiRowSelection) != null ? t : !0;
1312
- }, e.getToggleSelectedHandler = () => {
1313
- const t = e.getCanSelect();
1314
- return (n) => {
1315
- var i;
1316
- t && e.toggleSelected((i = n.target) == null ? void 0 : i.checked);
1317
- };
1318
- };
1319
- }
1320
- }, W = (e, o, t, n, i) => {
1321
- var r;
1322
- const l = i.getRow(o, !0);
1323
- t ? (l.getCanMultiSelect() || Object.keys(e).forEach((s) => delete e[s]), l.getCanSelect() && (e[o] = !0)) : delete e[o], n && (r = l.subRows) != null && r.length && l.getCanSelectSubRows() && l.subRows.forEach((s) => W(e, s.id, t, n, i));
1324
- };
1325
- function K(e, o) {
1326
- const t = e.getState().rowSelection, n = [], i = {}, r = function(l, s) {
1327
- return l.map((g) => {
1328
- var a;
1329
- const c = ee(g, t);
1330
- if (c && (n.push(g), i[g.id] = g), (a = g.subRows) != null && a.length && (g = {
1331
- ...g,
1332
- subRows: r(g.subRows)
1333
- }), c)
1334
- return g;
1335
- }).filter(Boolean);
1336
- };
1337
- return {
1338
- rows: r(o.rows),
1339
- flatRows: n,
1340
- rowsById: i
1341
- };
1342
- }
1343
- function ee(e, o) {
1344
- var t;
1345
- return (t = o[e.id]) != null ? t : !1;
1346
- }
1347
- function Y(e, o, t) {
1348
- var n;
1349
- if (!((n = e.subRows) != null && n.length)) return !1;
1350
- let i = !0, r = !1;
1351
- return e.subRows.forEach((l) => {
1352
- if (!(r && !i) && (l.getCanSelect() && (ee(l, o) ? r = !0 : i = !1), l.subRows && l.subRows.length)) {
1353
- const s = Y(l, o);
1354
- s === "all" ? r = !0 : (s === "some" && (r = !0), i = !1);
1355
- }
1356
- }), i ? "all" : r ? "some" : !1;
1357
- }
1358
- const Z = /([0-9]+)/gm, Ne = (e, o, t) => pe(y(e.getValue(t)).toLowerCase(), y(o.getValue(t)).toLowerCase()), Xe = (e, o, t) => pe(y(e.getValue(t)), y(o.getValue(t))), Ke = (e, o, t) => te(y(e.getValue(t)).toLowerCase(), y(o.getValue(t)).toLowerCase()), Je = (e, o, t) => te(y(e.getValue(t)), y(o.getValue(t))), Qe = (e, o, t) => {
1359
- const n = e.getValue(t), i = o.getValue(t);
1360
- return n > i ? 1 : n < i ? -1 : 0;
1361
- }, We = (e, o, t) => te(e.getValue(t), o.getValue(t));
1362
- function te(e, o) {
1363
- return e === o ? 0 : e > o ? 1 : -1;
1364
- }
1365
- function y(e) {
1366
- return typeof e == "number" ? isNaN(e) || e === 1 / 0 || e === -1 / 0 ? "" : String(e) : typeof e == "string" ? e : "";
1367
- }
1368
- function pe(e, o) {
1369
- const t = e.split(Z).filter(Boolean), n = o.split(Z).filter(Boolean);
1370
- for (; t.length && n.length; ) {
1371
- const i = t.shift(), r = n.shift(), l = parseInt(i, 10), s = parseInt(r, 10), g = [l, s].sort();
1372
- if (isNaN(g[0])) {
1373
- if (i > r)
1374
- return 1;
1375
- if (r > i)
1376
- return -1;
1377
- continue;
1378
- }
1379
- if (isNaN(g[1]))
1380
- return isNaN(l) ? -1 : 1;
1381
- if (l > s)
1382
- return 1;
1383
- if (s > l)
1384
- return -1;
1385
- }
1386
- return t.length - n.length;
1387
- }
1388
- const G = {
1389
- alphanumeric: Ne,
1390
- alphanumericCaseSensitive: Xe,
1391
- text: Ke,
1392
- textCaseSensitive: Je,
1393
- datetime: Qe,
1394
- basic: We
1395
- }, Ye = {
1396
- getInitialState: (e) => ({
1397
- sorting: [],
1398
- ...e
1399
- }),
1400
- getDefaultColumnDef: () => ({
1401
- sortingFn: "auto",
1402
- sortUndefined: 1
1403
- }),
1404
- getDefaultOptions: (e) => ({
1405
- onSortingChange: M("sorting", e),
1406
- isMultiSortEvent: (o) => o.shiftKey
1407
- }),
1408
- createColumn: (e, o) => {
1409
- e.getAutoSortingFn = () => {
1410
- const t = o.getFilteredRowModel().flatRows.slice(10);
1411
- let n = !1;
1412
- for (const i of t) {
1413
- const r = i == null ? void 0 : i.getValue(e.id);
1414
- if (Object.prototype.toString.call(r) === "[object Date]")
1415
- return G.datetime;
1416
- if (typeof r == "string" && (n = !0, r.split(Z).length > 1))
1417
- return G.alphanumeric;
1418
- }
1419
- return n ? G.text : G.basic;
1420
- }, e.getAutoSortDir = () => {
1421
- const t = o.getFilteredRowModel().flatRows[0];
1422
- return typeof (t == null ? void 0 : t.getValue(e.id)) == "string" ? "asc" : "desc";
1423
- }, e.getSortingFn = () => {
1424
- var t, n;
1425
- if (!e)
1426
- throw new Error();
1427
- return B(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 : G[e.columnDef.sortingFn];
1428
- }, e.toggleSorting = (t, n) => {
1429
- const i = e.getNextSortingOrder(), r = typeof t < "u" && t !== null;
1430
- o.setSorting((l) => {
1431
- const s = l == null ? void 0 : l.find((u) => u.id === e.id), g = l == null ? void 0 : l.findIndex((u) => u.id === e.id);
1432
- let a = [], c, S = r ? t : i === "desc";
1433
- if (l != null && l.length && e.getCanMultiSort() && n ? s ? c = "toggle" : c = "add" : l != null && l.length && g !== l.length - 1 ? c = "replace" : s ? c = "toggle" : c = "replace", c === "toggle" && (r || i || (c = "remove")), c === "add") {
1434
- var d;
1435
- a = [...l, {
1436
- id: e.id,
1437
- desc: S
1438
- }], a.splice(0, a.length - ((d = o.options.maxMultiSortColCount) != null ? d : Number.MAX_SAFE_INTEGER));
1439
- } else c === "toggle" ? a = l.map((u) => u.id === e.id ? {
1440
- ...u,
1441
- desc: S
1442
- } : u) : c === "remove" ? a = l.filter((u) => u.id !== e.id) : a = [{
1443
- id: e.id,
1444
- desc: S
1445
- }];
1446
- return a;
1447
- });
1448
- }, e.getFirstSortDir = () => {
1449
- var t, n;
1450
- return ((t = (n = e.columnDef.sortDescFirst) != null ? n : o.options.sortDescFirst) != null ? t : e.getAutoSortDir() === "desc") ? "desc" : "asc";
1451
- }, e.getNextSortingOrder = (t) => {
1452
- var n, i;
1453
- const r = e.getFirstSortDir(), l = e.getIsSorted();
1454
- return l ? l !== r && ((n = o.options.enableSortingRemoval) == null || n) && // If enableSortRemove, enable in general
1455
- (!(t && (i = o.options.enableMultiRemove) != null) || i) ? !1 : l === "desc" ? "asc" : "desc" : r;
1456
- }, e.getCanSort = () => {
1457
- var t, n;
1458
- return ((t = e.columnDef.enableSorting) != null ? t : !0) && ((n = o.options.enableSorting) != null ? n : !0) && !!e.accessorFn;
1459
- }, e.getCanMultiSort = () => {
1460
- var t, n;
1461
- return (t = (n = e.columnDef.enableMultiSort) != null ? n : o.options.enableMultiSort) != null ? t : !!e.accessorFn;
1462
- }, e.getIsSorted = () => {
1463
- var t;
1464
- const n = (t = o.getState().sorting) == null ? void 0 : t.find((i) => i.id === e.id);
1465
- return n ? n.desc ? "desc" : "asc" : !1;
1466
- }, e.getSortIndex = () => {
1467
- var t, n;
1468
- return (t = (n = o.getState().sorting) == null ? void 0 : n.findIndex((i) => i.id === e.id)) != null ? t : -1;
1469
- }, e.clearSorting = () => {
1470
- o.setSorting((t) => t != null && t.length ? t.filter((n) => n.id !== e.id) : []);
1471
- }, e.getToggleSortingHandler = () => {
1472
- const t = e.getCanSort();
1473
- return (n) => {
1474
- t && (n.persist == null || n.persist(), e.toggleSorting == null || e.toggleSorting(void 0, e.getCanMultiSort() ? o.options.isMultiSortEvent == null ? void 0 : o.options.isMultiSortEvent(n) : !1));
1475
- };
1476
- };
1477
- },
1478
- createTable: (e) => {
1479
- e.setSorting = (o) => e.options.onSortingChange == null ? void 0 : e.options.onSortingChange(o), e.resetSorting = (o) => {
1480
- var t, n;
1481
- e.setSorting(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.sorting) != null ? t : []);
1482
- }, 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());
1483
- }
1484
- }, Ze = [
1485
- ve,
1486
- Oe,
1487
- He,
1488
- Ae,
1489
- he,
1490
- _e,
1491
- Be,
1492
- //depends on ColumnFaceting
1493
- Te,
1494
- //depends on ColumnFiltering
1495
- Ye,
1496
- De,
1497
- //depends on RowSorting
1498
- qe,
1499
- ke,
1500
- Ue,
1501
- je,
1502
- Le
1503
- ];
1504
- function ot(e) {
1505
- var o, t;
1506
- const n = [...Ze, ...(o = e._features) != null ? o : []];
1507
- let i = {
1508
- _features: n
1509
- };
1510
- const r = i._features.reduce((d, u) => Object.assign(d, u.getDefaultOptions == null ? void 0 : u.getDefaultOptions(i)), {}), l = (d) => i.options.mergeOptions ? i.options.mergeOptions(r, d) : {
1511
- ...r,
1512
- ...d
1513
- };
1514
- let g = {
1515
- ...{},
1516
- ...(t = e.initialState) != null ? t : {}
1517
- };
1518
- i._features.forEach((d) => {
1519
- var u;
1520
- g = (u = d.getInitialState == null ? void 0 : d.getInitialState(g)) != null ? u : g;
1521
- });
1522
- const a = [];
1523
- let c = !1;
1524
- const S = {
1525
- _features: n,
1526
- options: {
1527
- ...r,
1528
- ...e
1529
- },
1530
- initialState: g,
1531
- _queue: (d) => {
1532
- a.push(d), c || (c = !0, Promise.resolve().then(() => {
1533
- for (; a.length; )
1534
- a.shift()();
1535
- c = !1;
1536
- }).catch((u) => setTimeout(() => {
1537
- throw u;
1538
- })));
1539
- },
1540
- reset: () => {
1541
- i.setState(i.initialState);
1542
- },
1543
- setOptions: (d) => {
1544
- const u = I(d, i.options);
1545
- i.options = l(u);
1546
- },
1547
- getState: () => i.options.state,
1548
- setState: (d) => {
1549
- i.options.onStateChange == null || i.options.onStateChange(d);
1550
- },
1551
- _getRowId: (d, u, f) => {
1552
- var p;
1553
- return (p = i.options.getRowId == null ? void 0 : i.options.getRowId(d, u, f)) != null ? p : `${f ? [f.id, u].join(".") : u}`;
1554
- },
1555
- getCoreRowModel: () => (i._getCoreRowModel || (i._getCoreRowModel = i.options.getCoreRowModel(i)), i._getCoreRowModel()),
1556
- // The final calls start at the bottom of the model,
1557
- // expanded rows, which then work their way up
1558
- getRowModel: () => i.getPaginationRowModel(),
1559
- //in next version, we should just pass in the row model as the optional 2nd arg
1560
- getRow: (d, u) => {
1561
- let f = (u ? i.getPrePaginationRowModel() : i.getRowModel()).rowsById[d];
1562
- if (!f && (f = i.getCoreRowModel().rowsById[d], !f))
1563
- throw new Error();
1564
- return f;
1565
- },
1566
- _getDefaultColumnDef: m(() => [i.options.defaultColumn], (d) => {
1567
- var u;
1568
- return d = (u = d) != null ? u : {}, {
1569
- header: (f) => {
1570
- const p = f.header.column.columnDef;
1571
- return p.accessorKey ? p.accessorKey : p.accessorFn ? p.id : null;
1572
- },
1573
- // footer: props => props.header.column.id,
1574
- cell: (f) => {
1575
- var p, w;
1576
- return (p = (w = f.renderValue()) == null || w.toString == null ? void 0 : w.toString()) != null ? p : null;
1577
- },
1578
- ...i._features.reduce((f, p) => Object.assign(f, p.getDefaultColumnDef == null ? void 0 : p.getDefaultColumnDef()), {}),
1579
- ...d
1580
- };
1581
- }, C(e, "debugColumns")),
1582
- _getColumnDefs: () => i.options.columns,
1583
- getAllColumns: m(() => [i._getColumnDefs()], (d) => {
1584
- const u = function(f, p, w) {
1585
- return w === void 0 && (w = 0), f.map((R) => {
1586
- const v = we(i, R, w, p), _ = R;
1587
- return v.columns = _.columns ? u(_.columns, v, w + 1) : [], v;
1588
- });
1589
- };
1590
- return u(d);
1591
- }, C(e, "debugColumns")),
1592
- getAllFlatColumns: m(() => [i.getAllColumns()], (d) => d.flatMap((u) => u.getFlatColumns()), C(e, "debugColumns")),
1593
- _getAllFlatColumnsById: m(() => [i.getAllFlatColumns()], (d) => d.reduce((u, f) => (u[f.id] = f, u), {}), C(e, "debugColumns")),
1594
- getAllLeafColumns: m(() => [i.getAllColumns(), i._getOrderColumnsFn()], (d, u) => {
1595
- let f = d.flatMap((p) => p.getLeafColumns());
1596
- return u(f);
1597
- }, C(e, "debugColumns")),
1598
- getColumn: (d) => i._getAllFlatColumnsById()[d]
1599
- };
1600
- Object.assign(i, S);
1601
- for (let d = 0; d < i._features.length; d++) {
1602
- const u = i._features[d];
1603
- u == null || u.createTable == null || u.createTable(i);
1604
- }
1605
- return i;
1606
- }
1607
- function it() {
1608
- return (e) => m(() => [e.options.data], (o) => {
1609
- const t = {
1610
- rows: [],
1611
- flatRows: [],
1612
- rowsById: {}
1613
- }, n = function(i, r, l) {
1614
- r === void 0 && (r = 0);
1615
- const s = [];
1616
- for (let a = 0; a < i.length; a++) {
1617
- const c = T(e, e._getRowId(i[a], a, l), i[a], a, r, void 0, l == null ? void 0 : l.id);
1618
- if (t.flatRows.push(c), t.rowsById[c.id] = c, s.push(c), e.options.getSubRows) {
1619
- var g;
1620
- c.originalSubRows = e.options.getSubRows(i[a], a), (g = c.originalSubRows) != null && g.length && (c.subRows = n(c.originalSubRows, r + 1, c));
1621
- }
1622
- }
1623
- return s;
1624
- };
1625
- return t.rows = n(o), t;
1626
- }, C(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
1627
- }
1628
- function rt() {
1629
- return (e) => m(() => [e.getState().expanded, e.getPreExpandedRowModel(), e.options.paginateExpandedRows], (o, t, n) => !t.rows.length || o !== !0 && !Object.keys(o ?? {}).length || !n ? t : be(t), C(e.options, "debugTable"));
1630
- }
1631
- function be(e) {
1632
- const o = [], t = (n) => {
1633
- var i;
1634
- o.push(n), (i = n.subRows) != null && i.length && n.getIsExpanded() && n.subRows.forEach(t);
1635
- };
1636
- return e.rows.forEach(t), {
1637
- rows: o,
1638
- flatRows: e.flatRows,
1639
- rowsById: e.rowsById
1640
- };
1641
- }
1642
- function Se(e, o, t) {
1643
- return t.options.filterFromLeafRows ? et(e, o, t) : tt(e, o, t);
1644
- }
1645
- function et(e, o, t) {
1646
- var n;
1647
- const i = [], r = {}, l = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, s = function(g, a) {
1648
- a === void 0 && (a = 0);
1649
- const c = [];
1650
- for (let d = 0; d < g.length; d++) {
1651
- var S;
1652
- let u = g[d];
1653
- const f = T(t, u.id, u.original, u.index, u.depth, void 0, u.parentId);
1654
- if (f.columnFilters = u.columnFilters, (S = u.subRows) != null && S.length && a < l) {
1655
- if (f.subRows = s(u.subRows, a + 1), u = f, o(u) && !f.subRows.length) {
1656
- c.push(u), r[u.id] = u, i.push(u);
1657
- continue;
1658
- }
1659
- if (o(u) || f.subRows.length) {
1660
- c.push(u), r[u.id] = u, i.push(u);
1661
- continue;
1662
- }
1663
- } else
1664
- u = f, o(u) && (c.push(u), r[u.id] = u, i.push(u));
1665
- }
1666
- return c;
1667
- };
1668
- return {
1669
- rows: s(e),
1670
- flatRows: i,
1671
- rowsById: r
1672
- };
1673
- }
1674
- function tt(e, o, t) {
1675
- var n;
1676
- const i = [], r = {}, l = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, s = function(g, a) {
1677
- a === void 0 && (a = 0);
1678
- const c = [];
1679
- for (let d = 0; d < g.length; d++) {
1680
- let u = g[d];
1681
- if (o(u)) {
1682
- var S;
1683
- if ((S = u.subRows) != null && S.length && a < l) {
1684
- const p = T(t, u.id, u.original, u.index, u.depth, void 0, u.parentId);
1685
- p.subRows = s(u.subRows, a + 1), u = p;
1686
- }
1687
- c.push(u), i.push(u), r[u.id] = u;
1688
- }
1689
- }
1690
- return c;
1691
- };
1692
- return {
1693
- rows: s(e),
1694
- flatRows: i,
1695
- rowsById: r
1696
- };
1697
- }
1698
- function lt() {
1699
- return (e, o) => m(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter, e.getFilteredRowModel()], (t, n, i) => {
1700
- if (!t.rows.length || !(n != null && n.length) && !i)
1701
- return t;
1702
- const r = [...n.map((s) => s.id).filter((s) => s !== o), i ? "__global__" : void 0].filter(Boolean), l = (s) => {
1703
- for (let g = 0; g < r.length; g++)
1704
- if (s.columnFilters[r[g]] === !1)
1705
- return !1;
1706
- return !0;
1707
- };
1708
- return Se(t.rows, l, e);
1709
- }, C(e.options, "debugTable"));
1710
- }
1711
- function st() {
1712
- return (e, o) => m(() => {
1713
- var t;
1714
- return [(t = e.getColumn(o)) == null ? void 0 : t.getFacetedRowModel()];
1715
- }, (t) => {
1716
- if (!t) return /* @__PURE__ */ new Map();
1717
- let n = /* @__PURE__ */ new Map();
1718
- for (let r = 0; r < t.flatRows.length; r++) {
1719
- const l = t.flatRows[r].getUniqueValues(o);
1720
- for (let s = 0; s < l.length; s++) {
1721
- const g = l[s];
1722
- if (n.has(g)) {
1723
- var i;
1724
- n.set(g, ((i = n.get(g)) != null ? i : 0) + 1);
1725
- } else
1726
- n.set(g, 1);
1727
- }
1728
- }
1729
- return n;
1730
- }, C(e.options, "debugTable"));
1731
- }
1732
- function ut() {
1733
- return (e) => m(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter], (o, t, n) => {
1734
- if (!o.rows.length || !(t != null && t.length) && !n) {
1735
- for (let d = 0; d < o.flatRows.length; d++)
1736
- o.flatRows[d].columnFilters = {}, o.flatRows[d].columnFiltersMeta = {};
1737
- return o;
1738
- }
1739
- const i = [], r = [];
1740
- (t ?? []).forEach((d) => {
1741
- var u;
1742
- const f = e.getColumn(d.id);
1743
- if (!f)
1744
- return;
1745
- const p = f.getFilterFn();
1746
- p && i.push({
1747
- id: d.id,
1748
- filterFn: p,
1749
- resolvedValue: (u = p.resolveFilterValue == null ? void 0 : p.resolveFilterValue(d.value)) != null ? u : d.value
1750
- });
1751
- });
1752
- const l = (t ?? []).map((d) => d.id), s = e.getGlobalFilterFn(), g = e.getAllLeafColumns().filter((d) => d.getCanGlobalFilter());
1753
- n && s && g.length && (l.push("__global__"), g.forEach((d) => {
1754
- var u;
1755
- r.push({
1756
- id: d.id,
1757
- filterFn: s,
1758
- resolvedValue: (u = s.resolveFilterValue == null ? void 0 : s.resolveFilterValue(n)) != null ? u : n
1759
- });
1760
- }));
1761
- let a, c;
1762
- for (let d = 0; d < o.flatRows.length; d++) {
1763
- const u = o.flatRows[d];
1764
- if (u.columnFilters = {}, i.length)
1765
- for (let f = 0; f < i.length; f++) {
1766
- a = i[f];
1767
- const p = a.id;
1768
- u.columnFilters[p] = a.filterFn(u, p, a.resolvedValue, (w) => {
1769
- u.columnFiltersMeta[p] = w;
1770
- });
1771
- }
1772
- if (r.length) {
1773
- for (let f = 0; f < r.length; f++) {
1774
- c = r[f];
1775
- const p = c.id;
1776
- if (c.filterFn(u, p, c.resolvedValue, (w) => {
1777
- u.columnFiltersMeta[p] = w;
1778
- })) {
1779
- u.columnFilters.__global__ = !0;
1780
- break;
1781
- }
1782
- }
1783
- u.columnFilters.__global__ !== !0 && (u.columnFilters.__global__ = !1);
1784
- }
1785
- }
1786
- const S = (d) => {
1787
- for (let u = 0; u < l.length; u++)
1788
- if (d.columnFilters[l[u]] === !1)
1789
- return !1;
1790
- return !0;
1791
- };
1792
- return Se(o.rows, S, e);
1793
- }, C(e.options, "debugTable", "getFilteredRowModel", () => e._autoResetPageIndex()));
1794
- }
1795
- function gt() {
1796
- return (e) => m(() => [e.getState().grouping, e.getPreGroupedRowModel()], (o, t) => {
1797
- if (!t.rows.length || !o.length)
1798
- return t.rows.forEach((g) => {
1799
- g.depth = 0, g.parentId = void 0;
1800
- }), t;
1801
- const n = o.filter((g) => e.getColumn(g)), i = [], r = {}, l = function(g, a, c) {
1802
- if (a === void 0 && (a = 0), a >= n.length)
1803
- return g.map((f) => (f.depth = a, i.push(f), r[f.id] = f, f.subRows && (f.subRows = l(f.subRows, a + 1, f.id)), f));
1804
- const S = n[a], d = nt(g, S);
1805
- return Array.from(d.entries()).map((f, p) => {
1806
- let [w, R] = f, v = `${S}:${w}`;
1807
- v = c ? `${c}>${v}` : v;
1808
- const _ = l(R, a + 1, v);
1809
- _.forEach((h) => {
1810
- h.parentId = v;
1811
- });
1812
- const V = a ? re(R, (h) => h.subRows) : R, F = T(e, v, V[0].original, p, a, void 0, c);
1813
- return Object.assign(F, {
1814
- groupingColumnId: S,
1815
- groupingValue: w,
1816
- subRows: _,
1817
- leafRows: V,
1818
- getValue: (h) => {
1819
- if (n.includes(h)) {
1820
- if (F._valuesCache.hasOwnProperty(h))
1821
- return F._valuesCache[h];
1822
- if (R[0]) {
1823
- var E;
1824
- F._valuesCache[h] = (E = R[0].getValue(h)) != null ? E : void 0;
1825
- }
1826
- return F._valuesCache[h];
1827
- }
1828
- if (F._groupingValuesCache.hasOwnProperty(h))
1829
- return F._groupingValuesCache[h];
1830
- const D = e.getColumn(h), A = D == null ? void 0 : D.getAggregationFn();
1831
- if (A)
1832
- return F._groupingValuesCache[h] = A(h, V, R), F._groupingValuesCache[h];
1833
- }
1834
- }), _.forEach((h) => {
1835
- i.push(h), r[h.id] = h;
1836
- }), F;
1837
- });
1838
- }, s = l(t.rows, 0);
1839
- return s.forEach((g) => {
1840
- i.push(g), r[g.id] = g;
1841
- }), {
1842
- rows: s,
1843
- flatRows: i,
1844
- rowsById: r
1845
- };
1846
- }, C(e.options, "debugTable", "getGroupedRowModel", () => {
1847
- e._queue(() => {
1848
- e._autoResetExpanded(), e._autoResetPageIndex();
1849
- });
1850
- }));
1851
- }
1852
- function nt(e, o) {
1853
- const t = /* @__PURE__ */ new Map();
1854
- return e.reduce((n, i) => {
1855
- const r = `${i.getGroupingValue(o)}`, l = n.get(r);
1856
- return l ? l.push(i) : n.set(r, [i]), n;
1857
- }, t);
1858
- }
1859
- function at() {
1860
- return (e) => m(() => [e.getState().sorting, e.getPreSortedRowModel()], (o, t) => {
1861
- if (!t.rows.length || !(o != null && o.length))
1862
- return t;
1863
- const n = e.getState().sorting, i = [], r = n.filter((g) => {
1864
- var a;
1865
- return (a = e.getColumn(g.id)) == null ? void 0 : a.getCanSort();
1866
- }), l = {};
1867
- r.forEach((g) => {
1868
- const a = e.getColumn(g.id);
1869
- a && (l[g.id] = {
1870
- sortUndefined: a.columnDef.sortUndefined,
1871
- invertSorting: a.columnDef.invertSorting,
1872
- sortingFn: a.getSortingFn()
1873
- });
1874
- });
1875
- const s = (g) => {
1876
- const a = g.map((c) => ({
1877
- ...c
1878
- }));
1879
- return a.sort((c, S) => {
1880
- for (let u = 0; u < r.length; u += 1) {
1881
- var d;
1882
- const f = r[u], p = l[f.id], w = p.sortUndefined, R = (d = f == null ? void 0 : f.desc) != null ? d : !1;
1883
- let v = 0;
1884
- if (w) {
1885
- const _ = c.getValue(f.id), V = S.getValue(f.id), F = _ === void 0, h = V === void 0;
1886
- if (F || h) {
1887
- if (w === "first") return F ? -1 : 1;
1888
- if (w === "last") return F ? 1 : -1;
1889
- v = F && h ? 0 : F ? w : -w;
1890
- }
1891
- }
1892
- if (v === 0 && (v = p.sortingFn(c, S, f.id)), v !== 0)
1893
- return R && (v *= -1), p.invertSorting && (v *= -1), v;
1894
- }
1895
- return c.index - S.index;
1896
- }), a.forEach((c) => {
1897
- var S;
1898
- i.push(c), (S = c.subRows) != null && S.length && (c.subRows = s(c.subRows));
1899
- }), a;
1900
- };
1901
- return {
1902
- rows: s(t.rows),
1903
- flatRows: i,
1904
- rowsById: t.rowsById
1905
- };
1906
- }, C(e.options, "debugTable", "getSortedRowModel", () => e._autoResetPageIndex()));
1907
- }
1908
- export {
1909
- he as ColumnFaceting,
1910
- _e as ColumnFiltering,
1911
- De as ColumnGrouping,
1912
- He as ColumnOrdering,
1913
- Ae as ColumnPinning,
1914
- Le as ColumnSizing,
1915
- Oe as ColumnVisibility,
1916
- Be as GlobalFaceting,
1917
- Te as GlobalFiltering,
1918
- ve as Headers,
1919
- qe as RowExpanding,
1920
- ke as RowPagination,
1921
- Ue as RowPinning,
1922
- je as RowSelection,
1923
- Ye as RowSorting,
1924
- H as _getVisibleLeafColumns,
1925
- q as aggregationFns,
1926
- L as buildHeaderGroups,
1927
- Re as createCell,
1928
- we as createColumn,
1929
- T as createRow,
1930
- ot as createTable,
1931
- z as defaultColumnSizing,
1932
- be as expandRows,
1933
- x as filterFns,
1934
- re as flattenBy,
1935
- I as functionalUpdate,
1936
- it as getCoreRowModel,
1937
- rt as getExpandedRowModel,
1938
- lt as getFacetedRowModel,
1939
- st as getFacetedUniqueValues,
1940
- ut as getFilteredRowModel,
1941
- gt as getGroupedRowModel,
1942
- C as getMemoOptions,
1943
- at as getSortedRowModel,
1944
- B as isFunction,
1945
- Ce as isNumberArray,
1946
- ee as isRowSelected,
1947
- Y as isSubRowSelected,
1948
- M as makeStateUpdater,
1949
- m as memo,
1950
- Ge as orderColumns,
1951
- ze as passiveEventSupported,
1952
- Z as reSplitAlphaNumeric,
1953
- K as selectRowsFn,
1954
- ie as shouldAutoRemoveFilter,
1955
- G as sortingFns
1956
- };