@espresso-lab/mantine-data-table 2.3.4 → 2.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -6,65 +6,24 @@ import { DateInput as ve } from "@mantine/dates";
6
6
  import { useForm as ye } from "@mantine/form";
7
7
  import { IconCaretDownFilled as be, IconChevronRight as xe, IconDotsVertical as Se, IconFilter as Ce, IconInfoCircle as we, IconPencil as Te, IconRefresh as Ee, IconSortAscending as De, IconSortDescending as Oe, IconTrash as ke } from "@tabler/icons-react";
8
8
  import { useClickOutside as Ae, useDisclosure as je, useLocalStorage as Me, useMediaQuery as Ne, useMergedRef as Pe, useTimeout as Fe } from "@mantine/hooks";
9
- //#region node_modules/@tanstack/query-core/build/modern/subscribable.js
10
- var Ie = class {
11
- constructor() {
12
- this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
13
- }
14
- subscribe(e) {
15
- return this.listeners.add(e), this.onSubscribe(), () => {
16
- this.listeners.delete(e), this.onUnsubscribe();
17
- };
18
- }
19
- hasListeners() {
20
- return this.listeners.size > 0;
21
- }
22
- onSubscribe() {}
23
- onUnsubscribe() {}
24
- }, Le = new class extends Ie {
25
- #e;
26
- #t;
27
- #n;
28
- constructor() {
29
- super(), this.#n = (e) => {
30
- if (typeof window < "u" && window.addEventListener) {
31
- let t = () => e();
32
- return window.addEventListener("visibilitychange", t, !1), () => {
33
- window.removeEventListener("visibilitychange", t);
34
- };
35
- }
36
- };
37
- }
38
- onSubscribe() {
39
- this.#t || this.setEventListener(this.#n);
40
- }
41
- onUnsubscribe() {
42
- this.hasListeners() || (this.#t?.(), this.#t = void 0);
43
- }
44
- setEventListener(e) {
45
- this.#n = e, this.#t?.(), this.#t = e((e) => {
46
- typeof e == "boolean" ? this.setFocused(e) : this.onFocus();
47
- });
48
- }
49
- setFocused(e) {
50
- this.#e !== e && (this.#e = e, this.onFocus());
51
- }
52
- onFocus() {
53
- let e = this.isFocused();
54
- this.listeners.forEach((t) => {
55
- t(e);
56
- });
57
- }
58
- isFocused() {
59
- return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
60
- }
61
- }(), Re = {
9
+ //#region node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js
10
+ var Ie = e.createContext(void 0), Le = (t) => {
11
+ let n = e.useContext(Ie);
12
+ if (t) return t;
13
+ if (!n) throw Error("No QueryClient set, use QueryClientProvider to set one");
14
+ return n;
15
+ }, Re = ({ client: t, children: n }) => (e.useEffect(() => (t.mount(), () => {
16
+ t.unmount();
17
+ }), [t]), /* @__PURE__ */ p(Ie.Provider, {
18
+ value: t,
19
+ children: n
20
+ })), ze = {
62
21
  setTimeout: (e, t) => setTimeout(e, t),
63
22
  clearTimeout: (e) => clearTimeout(e),
64
23
  setInterval: (e, t) => setInterval(e, t),
65
24
  clearInterval: (e) => clearInterval(e)
66
- }, H = new class {
67
- #e = Re;
25
+ }, Be = new class {
26
+ #e = ze;
68
27
  #t = !1;
69
28
  setTimeoutProvider(e) {
70
29
  process.env.NODE_ENV !== "production" && this.#t && e !== this.#e && console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.", {
@@ -85,127 +44,140 @@ var Ie = class {
85
44
  this.#e.clearInterval(e);
86
45
  }
87
46
  }();
88
- function ze(e) {
47
+ function Ve(e) {
89
48
  setTimeout(e, 0);
90
49
  }
91
50
  //#endregion
92
51
  //#region node_modules/@tanstack/query-core/build/modern/utils.js
93
- var Be = typeof window > "u" || "Deno" in globalThis;
94
- function U() {}
95
- function Ve(e) {
52
+ var H = typeof window > "u" || "Deno" in globalThis;
53
+ function He() {}
54
+ function Ue(e) {
96
55
  return typeof e == "number" && e >= 0 && e !== Infinity;
97
56
  }
98
- function He(e, t) {
57
+ function We(e, t) {
99
58
  return Math.max(e + (t || 0) - Date.now(), 0);
100
59
  }
101
- function Ue(e, t) {
102
- return typeof e == "function" ? e(t) : e;
103
- }
104
- function W(e, t) {
60
+ function U(e, t) {
105
61
  return typeof e == "function" ? e(t) : e;
106
62
  }
107
- function We(e) {
108
- return JSON.stringify(e, (e, t) => Ye(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
63
+ function Ge(e) {
64
+ return JSON.stringify(e, (e, t) => Xe(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
109
65
  }
110
- var Ge = Object.prototype.hasOwnProperty;
111
- function Ke(e, t, n = 0) {
66
+ var Ke = Object.prototype.hasOwnProperty;
67
+ function qe(e, t, n = 0) {
112
68
  if (e === t) return e;
113
69
  if (n > 500) return t;
114
- let r = Je(e) && Je(t);
115
- if (!r && !(Ye(e) && Ye(t))) return t;
70
+ let r = Ye(e) && Ye(t);
71
+ if (!r && !(Xe(e) && Xe(t))) return t;
116
72
  let i = (r ? e : Object.keys(e)).length, a = r ? t : Object.keys(t), o = a.length, s = r ? Array(o) : {}, c = 0;
117
73
  for (let l = 0; l < o; l++) {
118
74
  let o = r ? l : a[l], u = e[o], d = t[o];
119
75
  if (u === d) {
120
- s[o] = u, (r ? l < i : Ge.call(e, o)) && c++;
76
+ s[o] = u, (r ? l < i : Ke.call(e, o)) && c++;
121
77
  continue;
122
78
  }
123
79
  if (u === null || d === null || typeof u != "object" || typeof d != "object") {
124
80
  s[o] = d;
125
81
  continue;
126
82
  }
127
- let f = Ke(u, d, n + 1);
83
+ let f = qe(u, d, n + 1);
128
84
  s[o] = f, f === u && c++;
129
85
  }
130
86
  return i === o && c === i ? e : s;
131
87
  }
132
- function qe(e, t) {
88
+ function Je(e, t) {
133
89
  if (!t || Object.keys(e).length !== Object.keys(t).length) return !1;
134
90
  for (let n in e) if (e[n] !== t[n]) return !1;
135
91
  return !0;
136
92
  }
137
- function Je(e) {
93
+ function Ye(e) {
138
94
  return Array.isArray(e) && e.length === Object.keys(e).length;
139
95
  }
140
- function Ye(e) {
141
- if (!Xe(e)) return !1;
96
+ function Xe(e) {
97
+ if (!Ze(e)) return !1;
142
98
  let t = e.constructor;
143
99
  if (t === void 0) return !0;
144
100
  let n = t.prototype;
145
- return !(!Xe(n) || !n.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
101
+ return !(!Ze(n) || !n.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
146
102
  }
147
- function Xe(e) {
103
+ function Ze(e) {
148
104
  return Object.prototype.toString.call(e) === "[object Object]";
149
105
  }
150
- function Ze(e, t, n) {
106
+ function Qe(e, t, n) {
151
107
  if (typeof n.structuralSharing == "function") return n.structuralSharing(e, t);
152
108
  if (n.structuralSharing !== !1) {
153
109
  if (process.env.NODE_ENV !== "production") try {
154
- return Ke(e, t);
110
+ return qe(e, t);
155
111
  } catch (e) {
156
112
  throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${e}`), e;
157
113
  }
158
- return Ke(e, t);
114
+ return qe(e, t);
159
115
  }
160
116
  return t;
161
117
  }
162
- function Qe(e, t) {
118
+ function $e(e, t) {
163
119
  return typeof e == "function" ? e(...t) : !!e;
164
120
  }
165
121
  //#endregion
166
122
  //#region node_modules/@tanstack/query-core/build/modern/environmentManager.js
167
- var $e = /* @__PURE__ */ (() => {
168
- let e = () => Be;
169
- return {
170
- isServer() {
171
- return e();
172
- },
173
- setIsServer(t) {
174
- e = t;
175
- }
176
- };
177
- })();
178
- //#endregion
179
- //#region node_modules/@tanstack/query-core/build/modern/thenable.js
180
- function et() {
181
- let e, t, n = new Promise((n, r) => {
182
- e = n, t = r;
183
- });
184
- n.status = "pending", n.catch(() => {});
185
- function r(e) {
186
- Object.assign(n, e), delete n.resolve, delete n.reject;
187
- }
188
- return n.resolve = (t) => {
189
- r({
190
- status: "fulfilled",
191
- value: t
192
- }), e(t);
193
- }, n.reject = (e) => {
194
- r({
195
- status: "rejected",
196
- reason: e
197
- }), t(e);
198
- }, n;
199
- }
200
- //#endregion
201
- //#region node_modules/@tanstack/query-core/build/modern/notifyManager.js
202
- var G = ze;
203
- function K() {
123
+ var et = () => H, tt = () => et(), W = class {
124
+ constructor() {
125
+ this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
126
+ }
127
+ subscribe(e) {
128
+ return this.listeners.add(e), this.onSubscribe(), () => {
129
+ this.listeners.delete(e), this.onUnsubscribe();
130
+ };
131
+ }
132
+ hasListeners() {
133
+ return this.listeners.size > 0;
134
+ }
135
+ onSubscribe() {}
136
+ onUnsubscribe() {}
137
+ }, G = new class extends W {
138
+ #e;
139
+ #t;
140
+ #n;
141
+ constructor() {
142
+ super(), this.#n = (e) => {
143
+ if (typeof window < "u" && window.addEventListener) {
144
+ let t = () => e();
145
+ return window.addEventListener("visibilitychange", t, !1), () => {
146
+ window.removeEventListener("visibilitychange", t);
147
+ };
148
+ }
149
+ };
150
+ }
151
+ onSubscribe() {
152
+ this.#t || this.setEventListener(this.#n);
153
+ }
154
+ onUnsubscribe() {
155
+ this.hasListeners() || (this.#t?.(), this.#t = void 0);
156
+ }
157
+ setEventListener(e) {
158
+ this.#n = e, this.#t?.(), this.#t = e((e) => {
159
+ typeof e == "boolean" ? this.setFocused(e) : this.onFocus();
160
+ });
161
+ }
162
+ setFocused(e) {
163
+ this.#e !== e && (this.#e = e, this.onFocus());
164
+ }
165
+ onFocus() {
166
+ let e = this.isFocused();
167
+ this.listeners.forEach((t) => {
168
+ t(e);
169
+ });
170
+ }
171
+ isFocused() {
172
+ return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
173
+ }
174
+ }(), nt = Ve;
175
+ function rt() {
204
176
  let e = [], t = 0, n = (e) => {
205
177
  e();
206
178
  }, r = (e) => {
207
179
  e();
208
- }, i = G, a = (r) => {
180
+ }, i = nt, a = (r) => {
209
181
  t ? e.push(r) : i(() => {
210
182
  n(r);
211
183
  });
@@ -247,7 +219,7 @@ function K() {
247
219
  }
248
220
  };
249
221
  }
250
- var tt = K(), nt = new class extends Ie {
222
+ var it = rt(), K = new class extends W {
251
223
  #e = !0;
252
224
  #t;
253
225
  #n;
@@ -281,8 +253,8 @@ var tt = K(), nt = new class extends Ie {
281
253
  }();
282
254
  //#endregion
283
255
  //#region node_modules/@tanstack/query-core/build/modern/retryer.js
284
- function rt(e) {
285
- return (e ?? "online") !== "online" || nt.isOnline();
256
+ function at(e) {
257
+ return (e ?? "online") !== "online" || K.isOnline();
286
258
  }
287
259
  //#endregion
288
260
  //#region node_modules/@tanstack/query-core/build/modern/query.js
@@ -290,7 +262,7 @@ function q(e, t) {
290
262
  return {
291
263
  fetchFailureCount: 0,
292
264
  fetchFailureReason: null,
293
- fetchStatus: rt(t.networkMode) ? "fetching" : "paused",
265
+ fetchStatus: at(t.networkMode) ? "fetching" : "paused",
294
266
  ...e === void 0 && {
295
267
  error: null,
296
268
  status: "pending"
@@ -299,10 +271,7 @@ function q(e, t) {
299
271
  }
300
272
  //#endregion
301
273
  //#region node_modules/@tanstack/query-core/build/modern/queryObserver.js
302
- var it = class extends Ie {
303
- constructor(e, t) {
304
- super(), this.options = t, this.#e = e, this.#s = null, this.#o = et(), this.bindMethods(), this.setOptions(t);
305
- }
274
+ var ot = class extends W {
306
275
  #e;
307
276
  #t = void 0;
308
277
  #n = void 0;
@@ -316,51 +285,53 @@ var it = class extends Ie {
316
285
  #u;
317
286
  #d;
318
287
  #f;
319
- #p;
320
- #m = /* @__PURE__ */ new Set();
288
+ #p = /* @__PURE__ */ new Set();
289
+ constructor(e, t) {
290
+ super(), this.options = t, this.#e = e, this.#o = null, this.bindMethods(), this.setOptions(t);
291
+ }
321
292
  bindMethods() {
322
293
  this.refetch = this.refetch.bind(this);
323
294
  }
324
295
  onSubscribe() {
325
- this.listeners.size === 1 && (this.#t.addObserver(this), at(this.#t, this.options) ? this.#h() : this.updateResult(), this.#y());
296
+ this.listeners.size === 1 && (this.#t.addObserver(this), ct(this.#t, this.options) ? this.#m() : this.updateResult(), this.#y());
326
297
  }
327
298
  onUnsubscribe() {
328
299
  this.hasListeners() || this.destroy();
329
300
  }
330
301
  shouldFetchOnReconnect() {
331
- return ot(this.#t, this.options, this.options.refetchOnReconnect);
302
+ return lt(this.#t, this.options, this.options.refetchOnReconnect);
332
303
  }
333
304
  shouldFetchOnWindowFocus() {
334
- return ot(this.#t, this.options, this.options.refetchOnWindowFocus);
305
+ return lt(this.#t, this.options, this.options.refetchOnWindowFocus);
335
306
  }
336
307
  destroy() {
337
308
  this.listeners = /* @__PURE__ */ new Set(), this.#b(), this.#x(), this.#t.removeObserver(this);
338
309
  }
339
310
  setOptions(e) {
340
311
  let t = this.options, n = this.#t;
341
- if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof W(this.options.enabled, this.#t) != "boolean") throw Error("Expected enabled to be a boolean or a callback that returns a boolean");
342
- this.#S(), this.#t.setOptions(this.options), t._defaulted && !qe(this.options, t) && this.#e.getQueryCache().notify({
312
+ if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof U(this.options.enabled, this.#t) != "boolean") throw Error("Expected enabled to be a boolean or a callback that returns a boolean");
313
+ this.#S(), this.#t.setOptions(this.options), t._defaulted && !Je(this.options, t) && this.#e.getQueryCache().notify({
343
314
  type: "observerOptionsUpdated",
344
315
  query: this.#t,
345
316
  observer: this
346
317
  });
347
318
  let r = this.hasListeners();
348
- r && st(this.#t, n, this.options, t) && this.#h(), this.updateResult(), r && (this.#t !== n || W(this.options.enabled, this.#t) !== W(t.enabled, this.#t) || Ue(this.options.staleTime, this.#t) !== Ue(t.staleTime, this.#t)) && this.#g();
319
+ r && J(this.#t, n, this.options, t) && this.#m(), this.updateResult(), r && (this.#t !== n || U(this.options.enabled, this.#t) !== U(t.enabled, this.#t) || U(this.options.staleTime, this.#t) !== U(t.staleTime, this.#t)) && this.#g();
349
320
  let i = this.#_();
350
- r && (this.#t !== n || W(this.options.enabled, this.#t) !== W(t.enabled, this.#t) || i !== this.#p) && this.#v(i);
321
+ r && (this.#t !== n || U(this.options.enabled, this.#t) !== U(t.enabled, this.#t) || i !== this.#f) && this.#v(i);
351
322
  }
352
323
  getOptimisticResult(e) {
353
324
  let t = this.#e.getQueryCache().build(this.#e, e), n = this.createResult(t, e);
354
- return Y(this, n) && (this.#r = n, this.#a = this.options, this.#i = this.#t.state), n;
325
+ return Je(this.getCurrentResult(), n) || (this.#r = n, this.#a = this.options, this.#i = this.#t.state), n;
355
326
  }
356
327
  getCurrentResult() {
357
328
  return this.#r;
358
329
  }
359
330
  trackResult(e, t) {
360
- return new Proxy(e, { get: (e, n) => (this.trackProp(n), t?.(n), n === "promise" && (this.trackProp("data"), !this.options.experimental_prefetchInRender && this.#o.status === "pending" && this.#o.reject(/* @__PURE__ */ Error("experimental_prefetchInRender feature flag is not enabled"))), Reflect.get(e, n)) });
331
+ return new Proxy(e, { get: (e, n) => (this.trackProp(n), t?.(n), Reflect.get(e, n)) });
361
332
  }
362
333
  trackProp(e) {
363
- this.#m.add(e);
334
+ this.#p.add(e);
364
335
  }
365
336
  getCurrentQuery() {
366
337
  return this.#t;
@@ -369,26 +340,38 @@ var it = class extends Ie {
369
340
  return this.fetch({ ...e });
370
341
  }
371
342
  fetchOptimistic(e) {
372
- let t = this.#e.defaultQueryOptions(e), n = this.#e.getQueryCache().build(this.#e, t);
373
- return n.fetch().then(() => this.createResult(n, t));
343
+ let t = this.#e.defaultQueryOptions(e), n = this.#e.getQueryCache().build(this.#e, t), r = () => {}, i, a = new Promise((e) => {
344
+ i = e, r = this.#e.getQueryCache().subscribe((i) => {
345
+ i.type === "updated" && i.query.queryHash === n.queryHash && n.state.data !== void 0 && (r(), e(this.createResult(n, t)));
346
+ });
347
+ });
348
+ return Promise.race([n.fetch().then(() => {
349
+ let e = this.createResult(n, t);
350
+ return i?.(e), e;
351
+ }).finally(() => {
352
+ r();
353
+ }), a]);
374
354
  }
375
355
  fetch(e) {
376
- return this.#h({
356
+ return this.#m({
377
357
  ...e,
378
358
  cancelRefetch: e.cancelRefetch ?? !0
379
359
  }).then(() => (this.updateResult(), this.#r));
380
360
  }
381
- #h(e) {
361
+ #m(e) {
382
362
  this.#S();
383
363
  let t = this.#t.fetch(this.options, e);
384
- return e?.throwOnError || (t = t.catch(U)), t;
364
+ return e?.throwOnError || (t = t.catch(He)), t;
365
+ }
366
+ #h(e) {
367
+ return !tt() && U(this.options.enabled, this.#t) !== !1 && Ue(e);
385
368
  }
386
369
  #g() {
387
370
  this.#b();
388
- let e = Ue(this.options.staleTime, this.#t);
389
- if ($e.isServer() || this.#r.isStale || !Ve(e)) return;
390
- let t = He(this.#r.dataUpdatedAt, e) + 1;
391
- this.#d = H.setTimeout(() => {
371
+ let e = U(this.options.staleTime, this.#t);
372
+ if (this.#r.isStale || !this.#h(e)) return;
373
+ let t = We(this.#r.dataUpdatedAt, e) + 1;
374
+ this.#u = Be.setTimeout(() => {
392
375
  this.#r.isStale || this.updateResult();
393
376
  }, t);
394
377
  }
@@ -396,23 +379,23 @@ var it = class extends Ie {
396
379
  return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
397
380
  }
398
381
  #v(e) {
399
- this.#x(), this.#p = e, !($e.isServer() || W(this.options.enabled, this.#t) === !1 || !Ve(this.#p) || this.#p === 0) && (this.#f = H.setInterval(() => {
400
- (this.options.refetchIntervalInBackground || Le.isFocused()) && this.#h();
401
- }, this.#p));
382
+ this.#x(), this.#f = e, this.#f !== 0 && this.#h(this.#f) && (this.#d = Be.setInterval(() => {
383
+ (this.options.refetchIntervalInBackground || G.isFocused()) && this.#m();
384
+ }, this.#f));
402
385
  }
403
386
  #y() {
404
387
  this.#g(), this.#v(this.#_());
405
388
  }
406
389
  #b() {
407
- this.#d !== void 0 && (H.clearTimeout(this.#d), this.#d = void 0);
390
+ this.#u !== void 0 && (Be.clearTimeout(this.#u), this.#u = void 0);
408
391
  }
409
392
  #x() {
410
- this.#f !== void 0 && (H.clearInterval(this.#f), this.#f = void 0);
393
+ this.#d !== void 0 && (Be.clearInterval(this.#d), this.#d = void 0);
411
394
  }
412
395
  createResult(e, t) {
413
396
  let n = this.#t, r = this.options, i = this.#r, a = this.#i, o = this.#a, s = e === n ? this.#n : e.state, { state: c } = e, l = { ...c }, u = !1, d;
414
397
  if (t._optimisticResults) {
415
- let i = this.hasListeners(), a = !i && at(e, t), o = i && st(e, n, t, r);
398
+ let i = this.hasListeners(), a = !i && ct(e, t), o = i && J(e, n, t, r);
416
399
  (a || o) && (l = {
417
400
  ...l,
418
401
  ...q(c.data, e.options)
@@ -423,16 +406,19 @@ var it = class extends Ie {
423
406
  let h = !1;
424
407
  if (t.placeholderData !== void 0 && d === void 0 && m === "pending") {
425
408
  let e;
426
- i?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (e = i.data, h = !0) : e = typeof t.placeholderData == "function" ? t.placeholderData(this.#u?.state.data, this.#u) : t.placeholderData, e !== void 0 && (m = "success", d = Ze(i?.data, e, t), u = !0);
409
+ i?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (e = i.data, h = !0) : e = typeof t.placeholderData == "function" ? t.placeholderData(this.#l?.state.data, this.#l) : t.placeholderData, e !== void 0 && (m = "success", d = Qe(i?.data, e, t), u = !0);
427
410
  }
428
- if (t.select && d !== void 0 && !h) if (i && d === a?.data && t.select === this.#c) d = this.#l;
429
- else try {
430
- this.#c = t.select, d = t.select(d), d = Ze(i?.data, d, t), this.#l = d, this.#s = null;
431
- } catch (e) {
432
- this.#s = e;
433
- }
434
- this.#s && (f = this.#s, d = this.#l, p = Date.now(), m = "error");
435
- let g = l.fetchStatus === "fetching", _ = m === "pending", v = m === "error", y = _ && g, b = d !== void 0, x = {
411
+ if (t.select && d !== void 0 && !h) {
412
+ if (i && d === a?.data && t.select === this.#s) d = this.#c;
413
+ else try {
414
+ this.#s = t.select, d = t.select(d), d = Qe(i?.data, d, t), this.#c = d, this.#o = null;
415
+ } catch (e) {
416
+ this.#o = e;
417
+ }
418
+ } else d === void 0 && (this.#o = null);
419
+ this.#o && (f = this.#o, d = this.#c, p = Date.now(), m = "error", u = !1);
420
+ let g = l.fetchStatus === "fetching", _ = m === "pending", v = m === "error", y = _ && g, b = d !== void 0;
421
+ return {
436
422
  status: m,
437
423
  fetchStatus: l.fetchStatus,
438
424
  isPending: _,
@@ -455,44 +441,33 @@ var it = class extends Ie {
455
441
  isPaused: l.fetchStatus === "paused",
456
442
  isPlaceholderData: u,
457
443
  isRefetchError: v && b,
458
- isStale: ct(e, t),
444
+ isStale: ut(e, t),
459
445
  refetch: this.refetch,
460
- promise: this.#o,
461
- isEnabled: W(t.enabled, e) !== !1
446
+ isEnabled: U(t.enabled, e) !== !1
462
447
  };
463
- if (this.options.experimental_prefetchInRender) {
464
- let t = x.data !== void 0, r = x.status === "error" && !t, i = (e) => {
465
- r ? e.reject(x.error) : t && e.resolve(x.data);
466
- }, a = () => {
467
- let e = this.#o = x.promise = et();
468
- i(e);
469
- }, o = this.#o;
470
- switch (o.status) {
471
- case "pending":
472
- e.queryHash === n.queryHash && i(o);
473
- break;
474
- case "fulfilled":
475
- (r || x.data !== o.value) && a();
476
- break;
477
- case "rejected":
478
- (!r || x.error !== o.reason) && a();
479
- break;
480
- }
481
- }
482
- return x;
483
448
  }
484
449
  updateResult() {
485
450
  let e = this.#r, t = this.createResult(this.#t, this.options);
486
- this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#u = this.#t), !qe(t, e) && (this.#r = t, this.#C({ listeners: (() => {
451
+ if (this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#l = this.#t), Je(t, e)) return;
452
+ this.#r = t;
453
+ let n = (() => {
487
454
  if (!e) return !0;
488
455
  let { notifyOnChangeProps: t } = this.options, n = typeof t == "function" ? t() : t;
489
- if (n === "all" || !n && !this.#m.size) return !0;
490
- let r = new Set(n ?? this.#m);
456
+ if (n === "all" || !n && !this.#p.size) return !0;
457
+ let r = new Set(n ?? this.#p);
491
458
  return this.options.throwOnError && r.add("error"), Object.keys(this.#r).some((t) => {
492
459
  let n = t;
493
460
  return this.#r[n] !== e[n] && r.has(n);
494
461
  });
495
- })() }));
462
+ })();
463
+ it.batch(() => {
464
+ n && this.listeners.forEach((e) => {
465
+ e(this.#r);
466
+ }), this.#e.getQueryCache().notify({
467
+ query: this.#t,
468
+ type: "observerResultsUpdated"
469
+ });
470
+ });
496
471
  }
497
472
  #S() {
498
473
  let e = this.#e.getQueryCache().build(this.#e, this.options);
@@ -503,42 +478,29 @@ var it = class extends Ie {
503
478
  onQueryUpdate() {
504
479
  this.updateResult(), this.hasListeners() && this.#y();
505
480
  }
506
- #C(e) {
507
- tt.batch(() => {
508
- e.listeners && this.listeners.forEach((e) => {
509
- e(this.#r);
510
- }), this.#e.getQueryCache().notify({
511
- query: this.#t,
512
- type: "observerResultsUpdated"
513
- });
514
- });
515
- }
516
481
  };
517
- function J(e, t) {
518
- return W(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && W(t.retryOnMount, e) === !1);
482
+ function st(e, t) {
483
+ return U(t.enabled, e) !== !1 && e.state.data === void 0 && (e.state.status !== "error" || U(t.retryOnMount, e) !== !1);
519
484
  }
520
- function at(e, t) {
521
- return J(e, t) || e.state.data !== void 0 && ot(e, t, t.refetchOnMount);
485
+ function ct(e, t) {
486
+ return st(e, t) || e.state.data !== void 0 && lt(e, t, t.refetchOnMount);
522
487
  }
523
- function ot(e, t, n) {
524
- if (W(t.enabled, e) !== !1 && Ue(t.staleTime, e) !== "static") {
488
+ function lt(e, t, n) {
489
+ if (U(t.enabled, e) !== !1 && U(t.staleTime, e) !== "static") {
525
490
  let r = typeof n == "function" ? n(e) : n;
526
- return r === "always" || r !== !1 && ct(e, t);
491
+ return r === "always" || r !== !1 && ut(e, t);
527
492
  }
528
493
  return !1;
529
494
  }
530
- function st(e, t, n, r) {
531
- return (e !== t || W(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") && ct(e, n);
532
- }
533
- function ct(e, t) {
534
- return W(t.enabled, e) !== !1 && e.isStaleByTime(Ue(t.staleTime, e));
495
+ function J(e, t, n, r) {
496
+ return (e !== t || U(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") && ut(e, n);
535
497
  }
536
- function Y(e, t) {
537
- return !qe(e.getCurrentResult(), t);
498
+ function ut(e, t) {
499
+ return U(t.enabled, e) !== !1 && e.isStaleByTime(U(t.staleTime, e));
538
500
  }
539
501
  //#endregion
540
502
  //#region node_modules/@tanstack/query-core/build/modern/mutation.js
541
- function lt() {
503
+ function Y() {
542
504
  return {
543
505
  context: void 0,
544
506
  data: void 0,
@@ -553,7 +515,7 @@ function lt() {
553
515
  }
554
516
  //#endregion
555
517
  //#region node_modules/@tanstack/query-core/build/modern/mutationObserver.js
556
- var ut = class extends Ie {
518
+ var dt = class extends W {
557
519
  #e;
558
520
  #t = void 0;
559
521
  #n;
@@ -566,11 +528,14 @@ var ut = class extends Ie {
566
528
  }
567
529
  setOptions(e) {
568
530
  let t = this.options;
569
- this.options = this.#e.defaultMutationOptions(e), qe(this.options, t) || this.#e.getMutationCache().notify({
531
+ this.options = this.#e.defaultMutationOptions(e), Je(this.options, t) || this.#e.getMutationCache().notify({
570
532
  type: "observerOptionsUpdated",
571
533
  mutation: this.#n,
572
534
  observer: this
573
- }), t?.mutationKey && this.options.mutationKey && We(t.mutationKey) !== We(this.options.mutationKey) ? this.reset() : this.#n?.state.status === "pending" && this.#n.setOptions(this.options);
535
+ }), t?.mutationKey && this.options.mutationKey && Ge(t.mutationKey) !== Ge(this.options.mutationKey) ? this.reset() : this.#n?.state.status === "pending" && this.#n.setOptions(this.options);
536
+ }
537
+ onSubscribe() {
538
+ this.listeners.size === 1 && this.#n && (this.#n.addObserver(this), this.#i());
574
539
  }
575
540
  onUnsubscribe() {
576
541
  this.hasListeners() || this.#n?.removeObserver(this);
@@ -588,7 +553,7 @@ var ut = class extends Ie {
588
553
  return this.#r = t, this.#n?.removeObserver(this), this.#n = this.#e.getMutationCache().build(this.#e, this.options), this.#n.addObserver(this), this.#n.execute(e);
589
554
  }
590
555
  #i() {
591
- let e = this.#n?.state ?? lt();
556
+ let e = this.#n?.state ?? Y();
592
557
  this.#t = {
593
558
  ...e,
594
559
  isPending: e.status === "pending",
@@ -600,7 +565,7 @@ var ut = class extends Ie {
600
565
  };
601
566
  }
602
567
  #a(e) {
603
- tt.batch(() => {
568
+ it.batch(() => {
604
569
  if (this.#r && this.hasListeners()) {
605
570
  let t = this.#t.variables, n = this.#t.context, r = {
606
571
  client: this.#e,
@@ -636,21 +601,11 @@ var ut = class extends Ie {
636
601
  });
637
602
  });
638
603
  }
639
- }, dt = e.createContext(void 0), ft = (t) => {
640
- let n = e.useContext(dt);
641
- if (t) return t;
642
- if (!n) throw Error("No QueryClient set, use QueryClientProvider to set one");
643
- return n;
644
- }, pt = ({ client: t, children: n }) => (e.useEffect(() => (t.mount(), () => {
645
- t.unmount();
646
- }), [t]), /* @__PURE__ */ p(dt.Provider, {
647
- value: t,
648
- children: n
649
- })), mt = e.createContext(!1), ht = () => e.useContext(mt);
650
- mt.Provider;
604
+ }, ft = e.createContext(!1), pt = () => e.useContext(ft);
605
+ ft.Provider;
651
606
  //#endregion
652
607
  //#region node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js
653
- function gt() {
608
+ function mt() {
654
609
  let e = !1;
655
610
  return {
656
611
  clearReset: () => {
@@ -662,65 +617,61 @@ function gt() {
662
617
  isReset: () => e
663
618
  };
664
619
  }
665
- var _t = e.createContext(gt()), vt = () => e.useContext(_t), yt = (e, t, n) => {
666
- let r = n?.state.error && typeof e.throwOnError == "function" ? Qe(e.throwOnError, [n.state.error, n]) : e.throwOnError;
667
- (e.suspense || e.experimental_prefetchInRender || r) && (t.isReset() || (e.retryOnMount = !1));
668
- }, bt = (t) => {
620
+ var ht = e.createContext(mt()), gt = () => e.useContext(ht), _t = (e, t, n) => {
621
+ let r = n?.state.error && typeof e.throwOnError == "function" ? $e(e.throwOnError, [n.state.error, n]) : e.throwOnError;
622
+ (e.suspense || r) && (t.isReset() || (e.retryOnMount = !1));
623
+ }, vt = (t) => {
669
624
  e.useEffect(() => {
670
625
  t.clearReset();
671
626
  }, [t]);
672
- }, xt = ({ result: e, errorResetBoundary: t, throwOnError: n, query: r, suspense: i }) => e.isError && !t.isReset() && !e.isFetching && r && (i && e.data === void 0 || Qe(n, [e.error, r])), St = (e) => {
627
+ }, yt = ({ result: e, errorResetBoundary: t, throwOnError: n, query: r, suspense: i }) => e.isError && !t.isReset() && !e.isFetching && r && (i && e.data === void 0 || $e(n, [e.error, r])), bt = (e) => {
673
628
  if (e.suspense) {
674
629
  let t = 1e3, n = (e) => e === "static" ? e : Math.max(e ?? t, t), r = e.staleTime;
675
630
  e.staleTime = typeof r == "function" ? (...e) => n(r(...e)) : n(r), typeof e.gcTime == "number" && (e.gcTime = Math.max(e.gcTime, t));
676
631
  }
677
- }, Ct = (e, t) => e.isLoading && e.isFetching && !t, wt = (e, t) => e?.suspense && t.isPending, Tt = (e, t, n) => t.fetchOptimistic(e).catch(() => {
632
+ }, xt = (e, t) => e?.suspense && t.isPending, St = (e, t, n) => t.fetchOptimistic(e).catch(() => {
678
633
  n.clearReset();
679
634
  });
680
635
  //#endregion
681
636
  //#region node_modules/@tanstack/react-query/build/modern/useBaseQuery.js
682
- function Et(t, n, r) {
637
+ function Ct(t, n, r) {
683
638
  if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t))) throw Error("Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object");
684
- let i = ht(), a = vt(), o = ft(r), s = o.defaultQueryOptions(t);
685
- o.getDefaultOptions().queries?._experimental_beforeQuery?.(s);
686
- let c = o.getQueryCache().get(s.queryHash);
639
+ let i = pt(), a = gt(), o = Le(r), s = o.defaultQueryOptions(t), c = o.getQueryCache().get(s.queryHash);
687
640
  process.env.NODE_ENV !== "production" && (s.queryFn || console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`));
688
641
  let l = t.subscribed !== !1;
689
- s._optimisticResults = i ? "isRestoring" : l ? "optimistic" : void 0, St(s), yt(s, a, c), bt(a);
690
- let u = !o.getQueryCache().get(s.queryHash), [d] = e.useState(() => new n(o, s)), f = d.getOptimisticResult(s), p = !i && l;
642
+ s._optimisticResults = i ? "isRestoring" : l ? "optimistic" : void 0, bt(s), _t(s, a, c), vt(a);
643
+ let [u] = e.useState(() => new n(o, s)), d = u.getOptimisticResult(s), f = !i && l;
691
644
  if (e.useSyncExternalStore(e.useCallback((e) => {
692
- let t = p ? d.subscribe(tt.batchCalls(e)) : U;
693
- return d.updateResult(), t;
694
- }, [d, p]), () => d.getCurrentResult(), () => d.getCurrentResult()), e.useEffect(() => {
695
- d.setOptions(s);
696
- }, [s, d]), wt(s, f)) throw Tt(s, d, a);
697
- if (xt({
698
- result: f,
645
+ let t = f ? u.subscribe(it.batchCalls(e)) : He;
646
+ return u.updateResult(), t;
647
+ }, [u, f]), () => u.getCurrentResult(), () => u.getCurrentResult()), e.useEffect(() => {
648
+ u.setOptions(s);
649
+ }, [s, u]), xt(s, d)) throw St(s, u, a);
650
+ if (yt({
651
+ result: d,
699
652
  errorResetBoundary: a,
700
653
  throwOnError: s.throwOnError,
701
654
  query: c,
702
655
  suspense: s.suspense
703
- })) throw f.error;
704
- return o.getDefaultOptions().queries?._experimental_afterQuery?.(s, f), s.experimental_prefetchInRender && !$e.isServer() && Ct(f, i) && (u ? Tt(s, d, a) : c?.promise)?.catch(U).finally(() => {
705
- d.updateResult();
706
- }), s.notifyOnChangeProps ? f : d.trackResult(f);
656
+ })) throw d.error;
657
+ return s.notifyOnChangeProps ? d : u.trackResult(d);
707
658
  }
708
659
  //#endregion
709
660
  //#region node_modules/@tanstack/react-query/build/modern/useQuery.js
710
- function Dt(e, t) {
711
- return Et(e, it, t);
661
+ function wt(e, t) {
662
+ return Ct(e, ot, t);
712
663
  }
713
664
  //#endregion
714
665
  //#region node_modules/@tanstack/react-query/build/modern/useMutation.js
715
- function Ot(t, n) {
716
- let r = ft(n), [i] = e.useState(() => new ut(r, t));
666
+ function Tt(t, n) {
667
+ let r = Le(n), [i] = e.useState(() => new dt(r, t));
717
668
  e.useEffect(() => {
718
669
  i.setOptions(t);
719
670
  }, [i, t]);
720
- let a = e.useSyncExternalStore(e.useCallback((e) => i.subscribe(tt.batchCalls(e)), [i]), () => i.getCurrentResult(), () => i.getCurrentResult()), o = e.useCallback((e, t) => {
721
- i.mutate(e, t).catch(U);
671
+ let a = e.useSyncExternalStore(e.useCallback((e) => i.subscribe(it.batchCalls(e)), [i]), () => i.getCurrentResult(), () => i.getCurrentResult()), o = e.useCallback((...e) => {
672
+ i.mutate(e[0], e[1]).catch(He);
722
673
  }, [i]);
723
- if (a.error && Qe(i.options.throwOnError, [a.error])) throw a.error;
674
+ if (a.error && $e(i.options.throwOnError, [a.error])) throw a.error;
724
675
  return {
725
676
  ...a,
726
677
  mutate: o,
@@ -729,15 +680,15 @@ function Ot(t, n) {
729
680
  }
730
681
  //#endregion
731
682
  //#region src/Context/DataTableContext.tsx
732
- var kt = r(void 0), At = async () => ({ "Content-Type": "application/json" });
733
- function jt({ children: e, baseUrl: t, queryClient: n, getHeaders: r = At }) {
734
- return /* @__PURE__ */ p(kt.Provider, {
683
+ var Et = r(void 0), Dt = async () => ({ "Content-Type": "application/json" });
684
+ function Ot({ children: e, baseUrl: t, queryClient: n, getHeaders: r = Dt }) {
685
+ return /* @__PURE__ */ p(Et.Provider, {
735
686
  value: {
736
687
  baseUrl: t,
737
688
  queryClient: n,
738
689
  getHeaders: r
739
690
  },
740
- children: /* @__PURE__ */ p(pt, {
691
+ children: /* @__PURE__ */ p(Re, {
741
692
  client: n,
742
693
  children: e
743
694
  })
@@ -745,176 +696,176 @@ function jt({ children: e, baseUrl: t, queryClient: n, getHeaders: r = At }) {
745
696
  }
746
697
  //#endregion
747
698
  //#region src/Hooks/useDataTable.ts
748
- function Mt() {
749
- let e = o(kt);
699
+ function kt() {
700
+ let e = o(Et);
750
701
  if (!e) throw Error("useDataTable must be used within a DataTableProvider");
751
702
  return e;
752
703
  }
753
704
  //#endregion
754
705
  //#region src/Hooks/useApi.ts
755
- var Nt = class extends Error {
706
+ var At = class extends Error {
756
707
  status;
757
708
  violations;
758
709
  constructor(e, t, n) {
759
710
  super(e), this.name = "ApiError", this.status = t, this.violations = n;
760
711
  }
761
712
  };
762
- function Pt(e) {
763
- return e instanceof Nt ? e.violations : void 0;
713
+ function jt(e) {
714
+ return e instanceof At ? e.violations : void 0;
764
715
  }
765
- async function Ft(e, t) {
716
+ async function Mt(e, t) {
766
717
  let n = await fetch(e, t);
767
718
  if (n.status >= 400) {
768
719
  let e = await n.text();
769
- if (!e) throw new Nt(`HTTP ${n.status}: ${n.statusText}`, n.status);
720
+ if (!e) throw new At(`HTTP ${n.status}: ${n.statusText}`, n.status);
770
721
  let t = null;
771
722
  try {
772
723
  t = JSON.parse(e);
773
724
  } catch {
774
- throw new Nt(e, n.status);
725
+ throw new At(e, n.status);
775
726
  }
776
727
  let r = Array.isArray(t?.violations) ? t.violations.filter((e) => e?.field && e?.message).map((e) => ({
777
728
  field: String(e.field),
778
729
  message: String(e.message)
779
730
  })) : void 0;
780
- throw new Nt(t?.message ?? t?.error ?? t?.title ?? e, n.status, r);
731
+ throw new At(t?.message ?? t?.error ?? t?.title ?? e, n.status, r);
781
732
  }
782
733
  return n;
783
734
  }
784
- var It = (e) => e.map((e) => e.toString());
785
- async function Lt(e, t) {
786
- return (await Ft(e, {
735
+ var Nt = (e) => e.map((e) => e.toString());
736
+ async function Pt(e, t) {
737
+ return (await Mt(e, {
787
738
  method: "GET",
788
739
  headers: await t()
789
740
  })).json();
790
741
  }
791
- async function Rt(e, t, n) {
792
- return (await Ft(`${e}/${t}`, {
742
+ async function Ft(e, t, n) {
743
+ return (await Mt(`${e}/${t}`, {
793
744
  method: "GET",
794
745
  headers: await n()
795
746
  })).json();
796
747
  }
797
- async function zt(e, t, n) {
798
- await Ft(`${e}/${t}`, {
748
+ async function It(e, t, n) {
749
+ await Mt(`${e}/${t}`, {
799
750
  method: "DELETE",
800
751
  headers: await n()
801
752
  });
802
753
  }
803
- async function Bt(e, t, n) {
804
- let r = await Ft(e, {
754
+ async function Lt(e, t, n) {
755
+ let r = await Mt(e, {
805
756
  method: "POST",
806
757
  headers: await n(),
807
758
  body: JSON.stringify(t)
808
759
  });
809
760
  return r.status === 204 ? t : r.json();
810
761
  }
811
- async function Vt(e, t, n, r) {
812
- let i = await Ft(t, {
762
+ async function Rt(e, t, n, r) {
763
+ let i = await Mt(t, {
813
764
  method: e,
814
765
  headers: await n(),
815
766
  body: r ? JSON.stringify(r) : void 0
816
767
  });
817
768
  if (i.status !== 204) return i.json();
818
769
  }
819
- async function Ht(e, t, n) {
820
- let r = await Ft(`${e}/${t.id}`, {
770
+ async function zt(e, t, n) {
771
+ let r = await Mt(`${e}/${t.id}`, {
821
772
  method: "PUT",
822
773
  headers: await n(),
823
774
  body: JSON.stringify(t)
824
775
  });
825
776
  return r.status === 204 ? t : r.json();
826
777
  }
827
- function Ut(e, t, n) {
828
- let { baseUrl: r, getHeaders: i } = Mt();
829
- return Dt({
830
- queryKey: [...It(t), String(n?.toString())],
831
- queryFn: () => Rt(`${r}${e}`, n, i),
778
+ function Bt(e, t, n) {
779
+ let { baseUrl: r, getHeaders: i } = kt();
780
+ return wt({
781
+ queryKey: [...Nt(t), String(n?.toString())],
782
+ queryFn: () => Ft(`${r}${e}`, n, i),
832
783
  enabled: !!n
833
784
  });
834
785
  }
835
- function Wt(e, t, n = !0) {
836
- let { baseUrl: r, getHeaders: i } = Mt();
837
- return Dt({
838
- queryKey: It(t),
839
- queryFn: () => Lt(`${r}${e}`, i),
786
+ function Vt(e, t, n = !0) {
787
+ let { baseUrl: r, getHeaders: i } = kt();
788
+ return wt({
789
+ queryKey: Nt(t),
790
+ queryFn: () => Pt(`${r}${e}`, i),
840
791
  enabled: n
841
792
  });
842
793
  }
843
- function Gt(e, t, n) {
844
- return Promise.all([e.invalidateQueries({ queryKey: It(t) }), ...(n ?? []).map((t) => e.invalidateQueries({ queryKey: t }))]);
845
- }
846
- function Kt(e, t, n) {
847
- let { baseUrl: r, queryClient: i, getHeaders: a } = Mt();
848
- return Ot({
849
- mutationKey: It(t),
850
- mutationFn: (t) => Bt(`${r}${e}`, t, a),
851
- onSettled: () => Gt(i, t, n)
852
- });
794
+ function Ht(e, t, n) {
795
+ return Promise.all([e.invalidateQueries({ queryKey: Nt(t) }), ...(n ?? []).map((t) => e.invalidateQueries({ queryKey: t }))]);
853
796
  }
854
- function qt(e, t, n) {
855
- let { baseUrl: r, queryClient: i, getHeaders: a } = Mt();
856
- return Ot({
857
- mutationKey: It(t),
858
- mutationFn: (t) => Ht(`${r}${e}`, t, a),
859
- onSettled: () => Gt(i, t, n)
797
+ function Ut(e, t, n) {
798
+ let { baseUrl: r, queryClient: i, getHeaders: a } = kt();
799
+ return Tt({
800
+ mutationKey: Nt(t),
801
+ mutationFn: (t) => Lt(`${r}${e}`, t, a),
802
+ onSettled: () => Ht(i, t, n)
860
803
  });
861
804
  }
862
- function Jt(e, t, n) {
863
- let { baseUrl: r, queryClient: i, getHeaders: a } = Mt();
864
- return Ot({
865
- mutationKey: It(t),
805
+ function Wt(e, t, n) {
806
+ let { baseUrl: r, queryClient: i, getHeaders: a } = kt();
807
+ return Tt({
808
+ mutationKey: Nt(t),
866
809
  mutationFn: (t) => zt(`${r}${e}`, t, a),
867
- onSettled: () => Gt(i, t, n)
810
+ onSettled: () => Ht(i, t, n)
811
+ });
812
+ }
813
+ function Gt(e, t, n) {
814
+ let { baseUrl: r, queryClient: i, getHeaders: a } = kt();
815
+ return Tt({
816
+ mutationKey: Nt(t),
817
+ mutationFn: (t) => It(`${r}${e}`, t, a),
818
+ onSettled: () => Ht(i, t, n)
868
819
  });
869
820
  }
870
821
  //#endregion
871
822
  //#region src/DataTable/EntityForm.tsx
872
- function Yt(e, t) {
823
+ function Kt(e, t) {
873
824
  return typeof e.required == "function" ? e.required(t) : !!e.required;
874
825
  }
875
- function Xt(e) {
826
+ function qt(e) {
876
827
  return e.reduce((e, t) => (e[t.id] = t.type === "boolean" ? t.defaultValue ?? !1 : t.defaultValue ?? "", e), {});
877
828
  }
878
- function Zt(e) {
879
- return e.filter((e) => e.required).reduce((e, t) => (e[t.id] = (e, n) => t.conditional && !t.conditional(n) || !Yt(t, n) || e ? null : "Pflichtfeld", e), {});
829
+ function Jt(e) {
830
+ return e.filter((e) => e.required).reduce((e, t) => (e[t.id] = (e, n) => t.conditional && !t.conditional(n) || !Kt(t, n) || e ? null : "Pflichtfeld", e), {});
880
831
  }
881
- function Qt(e) {
832
+ function Yt(e) {
882
833
  return Object.fromEntries(Object.entries(e).map(([e, t]) => [e, t === "" ? void 0 : t]));
883
834
  }
884
- function $t(e, t) {
835
+ function Xt(e, t) {
885
836
  let n = { ...e };
886
837
  return t.forEach((e) => {
887
838
  let t = e.id;
888
839
  e.type === "boolean" && n[t] === null ? n[t] = !1 : e.type === "date" && n[t] ? n[t] = new Date(n[t]) : n[t] === null && (n[t] = "");
889
840
  }), n;
890
841
  }
891
- var en = (e) => e.split(".").pop() ?? e;
892
- function tn(e, t) {
893
- return Object.fromEntries((Pt(e) ?? []).filter((e) => t.has(en(e.field))).map((e) => [en(e.field), e.message]));
842
+ var Zt = (e) => e.split(".").pop() ?? e;
843
+ function Qt(e, t) {
844
+ return Object.fromEntries((jt(e) ?? []).filter((e) => t.has(Zt(e.field))).map((e) => [Zt(e.field), e.message]));
894
845
  }
895
- function nn(e, t) {
896
- let n = Pt(e);
846
+ function $t(e, t) {
847
+ let n = jt(e);
897
848
  if (!n) return e?.message;
898
- let r = n.filter((e) => !t.has(en(e.field)));
849
+ let r = n.filter((e) => !t.has(Zt(e.field)));
899
850
  return r.length > 0 ? r.map((e) => e.message).join(", ") : void 0;
900
851
  }
901
- function rn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error: o, onPersist: c, onClose: l }) {
852
+ function en({ fields: e, steps: t, record: r, recordId: i, submitting: a, error: o, onPersist: c, onClose: l }) {
902
853
  let [u, h] = d(0), [g, v] = d(!1), b = ye({
903
854
  mode: "uncontrolled",
904
- initialValues: Xt(e),
905
- validate: Zt(e)
855
+ initialValues: qt(e),
856
+ validate: Jt(e)
906
857
  });
907
858
  s(() => {
908
859
  if (r) {
909
- let t = $t(r, e);
860
+ let t = Xt(r, e);
910
861
  b.initialize(t), b.setValues(t);
911
862
  }
912
863
  }, [r]);
913
- let S = new Set(e.map((e) => String(e.id))), C = nn(o, S), w = [...new Set(e.filter((e) => typeof e.step == "number").map((e) => e.step))], E = w.length > 0, D = u === w.length - 1;
864
+ let S = new Set(e.map((e) => String(e.id))), C = $t(o, S), w = [...new Set(e.filter((e) => typeof e.step == "number").map((e) => e.step))], E = w.length > 0, D = u === w.length - 1;
914
865
  function O(e) {
915
866
  let t = b.getValues();
916
867
  if (e.conditional && !e.conditional(t)) return null;
917
- let n = Yt(e, t), r = b.getInputProps(e.id);
868
+ let n = Kt(e, t), r = b.getInputProps(e.id);
918
869
  switch (e.type) {
919
870
  case "number": return /* @__PURE__ */ p(P, {
920
871
  decimalSeparator: ",",
@@ -971,11 +922,11 @@ function rn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
971
922
  children: C
972
923
  }), /* @__PURE__ */ m("form", {
973
924
  onSubmit: b.onSubmit(async (e) => {
974
- let t = Qt(e);
925
+ let t = Yt(e);
975
926
  try {
976
927
  await c(t);
977
928
  } catch (e) {
978
- let t = tn(e, S);
929
+ let t = Qt(e, S);
979
930
  Object.keys(t).length > 0 && b.setErrors(t);
980
931
  return;
981
932
  }
@@ -1005,9 +956,9 @@ function rn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
1005
956
  }
1006
957
  //#endregion
1007
958
  //#region src/DataTable/CreateModal.tsx
1008
- function an({ fields: e, onClose: t, queryKey: n, connectedQueryKeys: r, apiPath: i, steps: a, onCreated: o }) {
1009
- let [s, c] = d(), { mutateAsync: l, isPending: u, error: f } = Kt(i, n, r), { mutateAsync: m, isPending: h, error: g } = qt(i, n, r);
1010
- return /* @__PURE__ */ p(rn, {
959
+ function tn({ fields: e, onClose: t, queryKey: n, connectedQueryKeys: r, apiPath: i, steps: a, onCreated: o }) {
960
+ let [s, c] = d(), { mutateAsync: l, isPending: u, error: f } = Ut(i, n, r), { mutateAsync: m, isPending: h, error: g } = Wt(i, n, r);
961
+ return /* @__PURE__ */ p(en, {
1011
962
  fields: e,
1012
963
  steps: a,
1013
964
  recordId: s,
@@ -1028,17 +979,19 @@ function an({ fields: e, onClose: t, queryKey: n, connectedQueryKeys: r, apiPath
1028
979
  }
1029
980
  //#endregion
1030
981
  //#region node_modules/clsx/dist/clsx.mjs
1031
- function on(e) {
982
+ function nn(e) {
1032
983
  var t, n, r = "";
1033
984
  if (typeof e == "string" || typeof e == "number") r += e;
1034
- else if (typeof e == "object") if (Array.isArray(e)) {
1035
- var i = e.length;
1036
- for (t = 0; t < i; t++) e[t] && (n = on(e[t])) && (r && (r += " "), r += n);
1037
- } else for (n in e) e[n] && (r && (r += " "), r += n);
985
+ else if (typeof e == "object") {
986
+ if (Array.isArray(e)) {
987
+ var i = e.length;
988
+ for (t = 0; t < i; t++) e[t] && (n = nn(e[t])) && (r && (r += " "), r += n);
989
+ } else for (n in e) e[n] && (r && (r += " "), r += n);
990
+ }
1038
991
  return r;
1039
992
  }
1040
993
  function X() {
1041
- for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = on(e)) && (r && (r += " "), r += t);
994
+ for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = nn(e)) && (r && (r += " "), r += t);
1042
995
  return r;
1043
996
  }
1044
997
  //#endregion
@@ -1049,7 +1002,7 @@ function Z(e, t, n) {
1049
1002
  theme: t
1050
1003
  }).value : void 0;
1051
1004
  }
1052
- function sn({ theme: e, c: t, backgroundColor: n, borderColor: r, rowBorderColor: i, stripedColor: a, highlightOnHoverColor: o }) {
1005
+ function rn({ theme: e, c: t, backgroundColor: n, borderColor: r, rowBorderColor: i, stripedColor: a, highlightOnHoverColor: o }) {
1053
1006
  return {
1054
1007
  "--mantine-datatable-color-light": Z(t, e, "light"),
1055
1008
  "--mantine-datatable-color-dark": Z(t, e, "dark"),
@@ -1065,7 +1018,7 @@ function sn({ theme: e, c: t, backgroundColor: n, borderColor: r, rowBorderColor
1065
1018
  "--mantine-datatable-highlight-on-hover-color-dark": Z(o, e, "dark")
1066
1019
  };
1067
1020
  }
1068
- function cn({ theme: e, paginationActiveTextColor: t, paginationActiveBackgroundColor: n }) {
1021
+ function an({ theme: e, paginationActiveTextColor: t, paginationActiveBackgroundColor: n }) {
1069
1022
  return {
1070
1023
  "--mantine-datatable-pagination-active-text-color-light": Z(t, e, "light"),
1071
1024
  "--mantine-datatable-pagination-active-text-color-dark": Z(t, e, "dark"),
@@ -1073,7 +1026,7 @@ function cn({ theme: e, paginationActiveTextColor: t, paginationActiveBackground
1073
1026
  "--mantine-datatable-pagination-active-background-color-dark": Z(n, e, "dark")
1074
1027
  };
1075
1028
  }
1076
- function ln({ theme: e, color: t, backgroundColor: n }) {
1029
+ function on({ theme: e, color: t, backgroundColor: n }) {
1077
1030
  return {
1078
1031
  "--mantine-datatable-row-color-light": Z(t, e, "light"),
1079
1032
  "--mantine-datatable-row-color-dark": Z(t, e, "dark"),
@@ -1081,9 +1034,9 @@ function ln({ theme: e, color: t, backgroundColor: n }) {
1081
1034
  "--mantine-datatable-row-background-color-dark": Z(n, e, "dark")
1082
1035
  };
1083
1036
  }
1084
- var [un, dn] = pe("useDataTableColumnsContext must be used within DataTableColumnProvider"), fn = (e) => {
1037
+ var [sn, cn] = pe("useDataTableColumnsContext must be used within DataTableColumnProvider"), ln = (e) => {
1085
1038
  let { children: t, columnsOrder: n, setColumnsOrder: r, columnsToggle: i, setColumnsToggle: a, columnsPinning: o, setColumnsPinning: s, resetColumnsOrder: c, resetColumnsToggle: l, resetColumnsPinning: u, setColumnWidth: f, setMultipleColumnWidths: m, resetColumnsWidth: h, beginResize: g, endResize: _, pinnedMap: v } = e, [y, b] = d(""), [x, S] = d("");
1086
- return p(un, {
1039
+ return p(sn, {
1087
1040
  value: {
1088
1041
  sourceColumn: y,
1089
1042
  setSourceColumn: b,
@@ -1115,13 +1068,13 @@ var [un, dn] = pe("useDataTableColumnsContext must be used within DataTableColum
1115
1068
  children: t
1116
1069
  });
1117
1070
  };
1118
- function pn() {
1071
+ function un() {
1119
1072
  return p("tr", {
1120
1073
  className: "mantine-datatable-empty-row",
1121
1074
  children: p("td", {})
1122
1075
  });
1123
1076
  }
1124
- function mn() {
1077
+ function dn() {
1125
1078
  return m("svg", {
1126
1079
  width: "24",
1127
1080
  height: "24",
@@ -1144,13 +1097,13 @@ function mn() {
1144
1097
  ]
1145
1098
  });
1146
1099
  }
1147
- function hn({ icon: e, text: t, active: n, children: r }) {
1100
+ function fn({ icon: e, text: t, active: n, children: r }) {
1148
1101
  return p(b, {
1149
1102
  className: "mantine-datatable-empty-state",
1150
1103
  "data-active": n || void 0,
1151
1104
  children: r || m(f, { children: [e || p("div", {
1152
1105
  className: "mantine-datatable-empty-state-icon",
1153
- children: p(mn, {})
1106
+ children: p(dn, {})
1154
1107
  }), p(V, {
1155
1108
  component: "div",
1156
1109
  size: "sm",
@@ -1159,49 +1112,49 @@ function hn({ icon: e, text: t, active: n, children: r }) {
1159
1112
  })] })
1160
1113
  });
1161
1114
  }
1162
- function gn(e) {
1115
+ function pn(e) {
1163
1116
  let t = e.replace(/([a-z\d])([A-Z]+)/g, "$1 $2").replace(/\W|_/g, " ").trim().toLowerCase();
1164
1117
  return `${t.charAt(0).toUpperCase()}${t.slice(1)}`;
1165
1118
  }
1166
- function _n(e, t, n) {
1119
+ function mn(e, t, n) {
1167
1120
  return !Array.isArray(e) || n && !e.every(n) ? t : e;
1168
1121
  }
1169
- function vn(e) {
1122
+ function hn(e) {
1170
1123
  return typeof e == "object" && !!e && typeof e.accessor == "string";
1171
1124
  }
1172
- function yn(e, t, n) {
1125
+ function gn(e, t, n) {
1173
1126
  return e.filter((e) => !t.map(n).includes(n(e)));
1174
1127
  }
1175
- function bn(e, t) {
1128
+ function _n(e, t) {
1176
1129
  return e.filter((e, n, r) => n === r.findIndex((n) => t(e) === t(n)));
1177
1130
  }
1178
- function xn(e, t) {
1131
+ function vn(e, t) {
1179
1132
  return t ? t.match(/([^[.\]])+/g).reduce((e, t) => e && e[t], e) : void 0;
1180
1133
  }
1181
1134
  function Q(e, t) {
1182
- return typeof t == "string" ? xn(e, t) : t(e);
1135
+ return typeof t == "string" ? vn(e, t) : t(e);
1183
1136
  }
1184
- function Sn(e) {
1185
- return !e || e.length === 0 ? 0 : Math.max(...e.map((e) => e.groups && e.groups.length > 0 ? 1 + Sn(e.groups) : 1));
1137
+ function yn(e) {
1138
+ return !e || e.length === 0 ? 0 : Math.max(...e.map((e) => e.groups && e.groups.length > 0 ? 1 + yn(e.groups) : 1));
1186
1139
  }
1187
- function Cn(e) {
1140
+ function bn(e) {
1188
1141
  let t = [];
1189
- for (let n of e) n.columns && n.columns.length > 0 ? t.push(...n.columns.filter((e) => e != null)) : n.groups && n.groups.length > 0 && t.push(...Cn(n.groups));
1142
+ for (let n of e) n.columns && n.columns.length > 0 ? t.push(...n.columns.filter((e) => e != null)) : n.groups && n.groups.length > 0 && t.push(...bn(n.groups));
1190
1143
  return t.filter((e) => e != null);
1191
1144
  }
1192
- function wn(e, t) {
1193
- return e.columns && e.columns.length > 0 ? e.columns.filter((e, n) => e.hidden ? !1 : !t || t[n] !== !1).length : e.groups && e.groups.length > 0 ? e.groups.reduce((e, n) => e + wn(n, t), 0) : 0;
1145
+ function xn(e, t) {
1146
+ return e.columns && e.columns.length > 0 ? e.columns.filter((e, n) => e.hidden ? !1 : !t || t[n] !== !1).length : e.groups && e.groups.length > 0 ? e.groups.reduce((e, n) => e + xn(n, t), 0) : 0;
1194
1147
  }
1195
- function Tn(e, t, n = 0) {
1148
+ function Sn(e, t, n = 0) {
1196
1149
  if (n === t) return [...e];
1197
1150
  let r = [];
1198
- for (let i of e) i.groups && i.groups.length > 0 && r.push(...Tn(i.groups, t, n + 1));
1151
+ for (let i of e) i.groups && i.groups.length > 0 && r.push(...Sn(i.groups, t, n + 1));
1199
1152
  return r;
1200
1153
  }
1201
- function En(e, t, n) {
1154
+ function Cn(e, t, n) {
1202
1155
  return n ? !e || t : !1;
1203
1156
  }
1204
- function Dn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
1157
+ function wn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
1205
1158
  let r = l(() => t.map((e) => ({
1206
1159
  accessor: e.accessor,
1207
1160
  defaultPinned: e.pinned,
@@ -1211,7 +1164,7 @@ function Dn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
1211
1164
  key: e ? `${e}-columns-pinning` : "",
1212
1165
  defaultValue: e ? r : void 0,
1213
1166
  getInitialValueInEffect: n
1214
- }), o = _n(i, r, vn);
1167
+ }), o = mn(i, r, hn);
1215
1168
  function c(t) {
1216
1169
  e && a(typeof t == "function" ? (e) => t(e ?? r) : t);
1217
1170
  }
@@ -1254,12 +1207,12 @@ function Dn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
1254
1207
  resetColumnsPinning: d
1255
1208
  };
1256
1209
  }
1257
- function On({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
1210
+ function Tn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
1258
1211
  let r = l(() => t ? t.map((e) => e.accessor) : [], [t]), [i, a] = Me({
1259
1212
  key: e ? `${e}-columns-order` : "",
1260
1213
  defaultValue: e ? r : void 0,
1261
1214
  getInitialValueInEffect: n
1262
- }), o = _n(i, r, (e) => typeof e == "string");
1215
+ }), o = mn(i, r, (e) => typeof e == "string");
1263
1216
  function c(t) {
1264
1217
  e && a(t);
1265
1218
  }
@@ -1297,12 +1250,12 @@ function On({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
1297
1250
  resetColumnsOrder: d
1298
1251
  };
1299
1252
  }
1300
- function kn({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r }) {
1253
+ function En({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r }) {
1301
1254
  let i = l(() => t.some((e) => e.resizable && !e.hidden && e.accessor !== "__selection__"), [t]), o = a(() => t.filter((e) => e.accessor !== "__selection__").map((e) => ({ [e.accessor]: e.width ?? "auto" })), [t]), [c, f] = Me({
1302
1255
  key: e ? `${e}-columns-width` : "",
1303
1256
  defaultValue: e ? o() : void 0,
1304
1257
  getInitialValueInEffect: n
1305
- }), p = _n(c, [], (e) => typeof e == "object" && !!e), [m, h] = d(() => e && p.length > 0 ? p : o()), [g, _] = d(!1), v = u(!1);
1258
+ }), p = mn(c, [], (e) => typeof e == "object" && !!e), [m, h] = d(() => e && p.length > 0 ? p : o()), [g, _] = d(!1), v = u(!1);
1306
1259
  s(() => {
1307
1260
  e && (!p || p.length === 0 || h(p));
1308
1261
  }, [e, p]), s(() => {
@@ -1386,7 +1339,7 @@ function kn({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRe
1386
1339
  endResize: C
1387
1340
  };
1388
1341
  }
1389
- function An({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
1342
+ function Dn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
1390
1343
  let r = l(() => t?.map((e) => ({
1391
1344
  accessor: e.accessor,
1392
1345
  defaultToggle: e.defaultToggle || !0,
@@ -1396,7 +1349,7 @@ function An({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
1396
1349
  key: e ? `${e}-columns-toggle` : "",
1397
1350
  defaultValue: e ? r : void 0,
1398
1351
  getInitialValueInEffect: n
1399
- }), o = _n(i, r, vn);
1352
+ }), o = mn(i, r, hn);
1400
1353
  function c(t) {
1401
1354
  e && a(t);
1402
1355
  }
@@ -1439,20 +1392,20 @@ function An({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
1439
1392
  resetColumnsToggle: d
1440
1393
  };
1441
1394
  }
1442
- var jn = ({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r, scrollViewportRef: i }) => {
1443
- let { columnsOrder: a, setColumnsOrder: o, resetColumnsOrder: s } = On({
1395
+ var On = ({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r, scrollViewportRef: i }) => {
1396
+ let { columnsOrder: a, setColumnsOrder: o, resetColumnsOrder: s } = Tn({
1444
1397
  key: e,
1445
1398
  columns: t,
1446
1399
  getInitialValueInEffect: n
1447
- }), { columnsToggle: c, setColumnsToggle: u, resetColumnsToggle: d } = An({
1400
+ }), { columnsToggle: c, setColumnsToggle: u, resetColumnsToggle: d } = Dn({
1448
1401
  key: e,
1449
1402
  columns: t,
1450
1403
  getInitialValueInEffect: n
1451
- }), { columnsPinning: f, setColumnsPinning: p, resetColumnsPinning: m } = Dn({
1404
+ }), { columnsPinning: f, setColumnsPinning: p, resetColumnsPinning: m } = wn({
1452
1405
  key: e,
1453
1406
  columns: t,
1454
1407
  getInitialValueInEffect: n
1455
- }), { columnsWidth: h, setColumnsWidth: g, setColumnWidth: _, setMultipleColumnWidths: v, resetColumnsWidth: y, hasResizableColumns: b, allResizableWidthsInitial: x, measureAndSetColumnWidths: S, isResizing: C, beginResize: w, endResize: T } = kn({
1408
+ }), { columnsWidth: h, setColumnsWidth: g, setColumnWidth: _, setMultipleColumnWidths: v, resetColumnsWidth: y, hasResizableColumns: b, allResizableWidthsInitial: x, measureAndSetColumnWidths: S, isResizing: C, beginResize: w, endResize: T } = En({
1456
1409
  key: e,
1457
1410
  columns: t,
1458
1411
  getInitialValueInEffect: n,
@@ -1529,16 +1482,16 @@ var jn = ({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef:
1529
1482
  beginResize: w,
1530
1483
  endResize: T
1531
1484
  };
1532
- }, Mn = typeof window < "u" ? c : s;
1533
- function Nn(e) {
1485
+ }, kn = typeof window < "u" ? c : s;
1486
+ function An(e) {
1534
1487
  let t = u(e);
1535
1488
  return t.current = e, t;
1536
1489
  }
1537
- var Pn = "--mantine-datatable-header-height", Fn = "--mantine-datatable-footer-height", In = "--mantine-datatable-selection-column-width", Ln = "--mantine-datatable-last-row-border-bottom";
1490
+ var jn = "--mantine-datatable-header-height", Mn = "--mantine-datatable-footer-height", Nn = "--mantine-datatable-selection-column-width", Pn = "--mantine-datatable-last-row-border-bottom";
1538
1491
  function $(e, t, n) {
1539
1492
  e?.style.setProperty(t, n);
1540
1493
  }
1541
- function Rn(e) {
1494
+ function Fn(e) {
1542
1495
  let t = e.borderBoxSize?.[0] || e.contentBoxSize?.[0];
1543
1496
  return t ? {
1544
1497
  width: t.inlineSize,
@@ -1548,18 +1501,18 @@ function Rn(e) {
1548
1501
  height: e.contentRect.height
1549
1502
  };
1550
1503
  }
1551
- function zn(e, t, n) {
1504
+ function In(e, t, n) {
1552
1505
  if (e) {
1553
1506
  let r = new ResizeObserver((e) => {
1554
1507
  let n = e[0];
1555
- n && t(Rn(n));
1508
+ n && t(Fn(n));
1556
1509
  });
1557
1510
  return r.observe(e), () => {
1558
1511
  r.disconnect(), n();
1559
1512
  };
1560
1513
  }
1561
1514
  }
1562
- function Bn({ scrollCallbacks: e, withRowBorders: t }) {
1515
+ function Ln({ scrollCallbacks: e, withRowBorders: t }) {
1563
1516
  let n = {
1564
1517
  root: u(null),
1565
1518
  table: u(null),
@@ -1567,16 +1520,16 @@ function Bn({ scrollCallbacks: e, withRowBorders: t }) {
1567
1520
  header: u(null),
1568
1521
  footer: u(null),
1569
1522
  selectionColumnHeader: u(null)
1570
- }, { root: r, table: i, scrollViewport: o, header: c, footer: l, selectionColumnHeader: d } = n, f = Nn({ withRowBorders: t }), p = Nn(e), m = u(() => {}), h = u(() => {}), g = a((e) => {
1523
+ }, { root: r, table: i, scrollViewport: o, header: c, footer: l, selectionColumnHeader: d } = n, f = An({ withRowBorders: t }), p = An(e), m = u(() => {}), h = u(() => {}), g = a((e) => {
1571
1524
  p.current.onScroll?.(e), m.current();
1572
1525
  }, []);
1573
- return s(() => zn(c.current, (e) => {
1574
- $(r.current, Pn, `${e.height}px`);
1575
- }, () => $(r.current, Pn, "0")), [c.current]), s(() => zn(l.current, (e) => {
1576
- $(r.current, Fn, `${e.height}px`);
1577
- }, () => $(r.current, Fn, "0")), [l.current]), s(() => zn(d.current, (e) => {
1578
- $(r.current, In, `${e.width}px`);
1579
- }, () => $(r.current, In, "0")), [d.current]), Mn(() => {
1526
+ return s(() => In(c.current, (e) => {
1527
+ $(r.current, jn, `${e.height}px`);
1528
+ }, () => $(r.current, jn, "0")), [c.current]), s(() => In(l.current, (e) => {
1529
+ $(r.current, Mn, `${e.height}px`);
1530
+ }, () => $(r.current, Mn, "0")), [l.current]), s(() => In(d.current, (e) => {
1531
+ $(r.current, Nn, `${e.width}px`);
1532
+ }, () => $(r.current, Nn, "0")), [d.current]), kn(() => {
1580
1533
  if (typeof window > "u") return;
1581
1534
  let e = {
1582
1535
  top: !0,
@@ -1599,7 +1552,7 @@ function Bn({ scrollCallbacks: e, withRowBorders: t }) {
1599
1552
  $(r.current, "--mantine-datatable-footer-position", i ? "relative" : "sticky"), $(r.current, "--mantine-datatable-footer-bottom", i ? `${e}px` : "0");
1600
1553
  }
1601
1554
  function c() {
1602
- f.current.withRowBorders && t.height < n.height ? $(r.current, Ln, `${he("1px")} solid var(--mantine-datatable-border-color)`) : $(r.current, Ln, "unset");
1555
+ f.current.withRowBorders && t.height < n.height ? $(r.current, Pn, `${he("1px")} solid var(--mantine-datatable-border-color)`) : $(r.current, Pn, "unset");
1603
1556
  }
1604
1557
  h.current = c;
1605
1558
  function l() {
@@ -1617,25 +1570,23 @@ function Bn({ scrollCallbacks: e, withRowBorders: t }) {
1617
1570
  let u = new ResizeObserver((e) => {
1618
1571
  for (let r of e) switch (r.target.tagName) {
1619
1572
  case "TABLE":
1620
- t = Rn(r);
1621
- break;
1622
- case "DIV":
1623
- n = Rn(r);
1573
+ t = Fn(r);
1624
1574
  break;
1575
+ case "DIV": n = Fn(r);
1625
1576
  }
1626
1577
  l(), s(), c();
1627
1578
  });
1628
1579
  return u.observe(i.current), u.observe(o.current), () => {
1629
1580
  u.disconnect();
1630
1581
  };
1631
- }, []), Mn(() => {
1582
+ }, []), kn(() => {
1632
1583
  h.current();
1633
1584
  }, [t]), {
1634
1585
  refs: n,
1635
1586
  onScroll: g
1636
1587
  };
1637
1588
  }
1638
- function Vn({ columns: e, theadRef: t, tbodyRef: n, selectionColumnHeaderRef: r, selectionVisible: i, pinFirstColumn: o, pinLastColumn: c }) {
1589
+ function Rn({ columns: e, theadRef: t, tbodyRef: n, selectionColumnHeaderRef: r, selectionVisible: i, pinFirstColumn: o, pinLastColumn: c }) {
1639
1590
  let [l, u] = d(/* @__PURE__ */ new Map()), f = a(() => {
1640
1591
  if (!o && !c && !e.some((e) => e.pinned)) return;
1641
1592
  let a = t.current ?? n.current;
@@ -1717,22 +1668,22 @@ function Vn({ columns: e, theadRef: t, tbodyRef: n, selectionColumnHeaderRef: r,
1717
1668
  t,
1718
1669
  n,
1719
1670
  f
1720
- ]), Mn(f, [f]), {
1671
+ ]), kn(f, [f]), {
1721
1672
  pinnedMap: l,
1722
1673
  hasLeftPinned: [...l.values()].some((e) => e.logicalSide === "left"),
1723
1674
  hasRightPinned: [...l.values()].some((e) => e.logicalSide === "right")
1724
1675
  };
1725
1676
  }
1726
- function Hn(e) {
1727
- let [t, n] = d(null);
1677
+ function zn(e) {
1678
+ let [t, n] = d(null), r = e?.join(":") || "";
1728
1679
  return s(() => {
1729
1680
  n(null);
1730
- }, [e?.join(":") || ""]), {
1681
+ }, [r]), {
1731
1682
  lastSelectionChangeIndex: t,
1732
1683
  setLastSelectionChangeIndex: n
1733
1684
  };
1734
1685
  }
1735
- function Un(e, t) {
1686
+ function Bn(e, t) {
1736
1687
  let n = () => {
1737
1688
  t(e.map((e) => e.matches));
1738
1689
  }, r = e.map((e) => {
@@ -1748,26 +1699,26 @@ function Un(e, t) {
1748
1699
  });
1749
1700
  };
1750
1701
  }
1751
- function Wn(e, t) {
1702
+ function Vn(e, t) {
1752
1703
  return t || (typeof window < "u" && "matchMedia" in window ? e.map((e) => window.matchMedia(e).matches) : e.map(() => !1));
1753
1704
  }
1754
- function Gn(e, t, { getInitialValueInEffect: n } = { getInitialValueInEffect: !0 }) {
1755
- let [r, i] = d(n ? t : Wn(e, t)), a = u(null);
1705
+ function Hn(e, t, { getInitialValueInEffect: n } = { getInitialValueInEffect: !0 }) {
1706
+ let [r, i] = d(n ? t : Vn(e, t)), a = u(null);
1756
1707
  return s(() => {
1757
- if ("matchMedia" in window) return a.current = e.map((e) => window.matchMedia(e)), i(a.current.map((e) => e.matches)), Un(a.current, (e) => {
1708
+ if ("matchMedia" in window) return a.current = e.map((e) => window.matchMedia(e)), i(a.current.map((e) => e.matches)), Bn(a.current, (e) => {
1758
1709
  i(e);
1759
1710
  });
1760
1711
  }, [e]), r;
1761
1712
  }
1762
- function Kn(e) {
1713
+ function Un(e) {
1763
1714
  let t = _e();
1764
- return Gn(l(() => e.map((e) => (typeof e == "function" ? e(t) : e) ?? ""), [e, t]), l(() => e.map(() => !0), [e]));
1715
+ return Hn(l(() => e.map((e) => (typeof e == "function" ? e(t) : e) ?? ""), [e, t]), l(() => e.map(() => !0), [e]));
1765
1716
  }
1766
- function qn(e) {
1767
- let t = _e();
1768
- return Ne((typeof e == "function" ? e(t) : e) || "", !0);
1717
+ function Wn(e) {
1718
+ let t = _e(), n = typeof e == "function" ? e(t) : e;
1719
+ return Ne(n || "", !0);
1769
1720
  }
1770
- function Jn({ rowExpansion: e, records: t, idAccessor: n }) {
1721
+ function Gn({ rowExpansion: e, records: t, idAccessor: n }) {
1771
1722
  let r = [];
1772
1723
  if (e && t) {
1773
1724
  let { trigger: i, allowMultiple: a, initiallyExpanded: o } = e;
@@ -1802,7 +1753,7 @@ function Jn({ rowExpansion: e, records: t, idAccessor: n }) {
1802
1753
  };
1803
1754
  }
1804
1755
  }
1805
- function Yn(e, t) {
1756
+ function Kn(e, t) {
1806
1757
  let [n, r] = d(e), [i, a] = d(e), o = Fe(() => r(!0), 0), c = Fe(() => a(!1), t || 200);
1807
1758
  return s(() => {
1808
1759
  e ? (c.clear(), a(!0), o.start()) : (o.clear(), r(!1), c.start());
@@ -1815,17 +1766,17 @@ function Yn(e, t) {
1815
1766
  visible: i
1816
1767
  };
1817
1768
  }
1818
- var Xn = "mantine-datatable-nowrap", Zn = "mantine-datatable-ellipsis", Qn = "mantine-datatable-pointer-cursor", $n = "mantine-datatable-context-menu-cursor", er = "mantine-datatable-text-selection-disabled", tr = "mantine-datatable-text-align-left", nr = "mantine-datatable-text-align-center", rr = "mantine-datatable-text-align-right";
1819
- function ir({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title: i, noWrap: a, ellipsis: o, textAlign: s, width: c }) {
1820
- return qn(r) ? p(se, {
1769
+ var qn = "mantine-datatable-nowrap", Jn = "mantine-datatable-ellipsis", Yn = "mantine-datatable-pointer-cursor", Xn = "mantine-datatable-context-menu-cursor", Zn = "mantine-datatable-text-selection-disabled", Qn = "mantine-datatable-text-align-left", $n = "mantine-datatable-text-align-center", er = "mantine-datatable-text-align-right";
1770
+ function tr({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title: i, noWrap: a, ellipsis: o, textAlign: s, width: c }) {
1771
+ return Wn(r) ? p(se, {
1821
1772
  "data-pinned": n?.position,
1822
1773
  "data-pinned-shadow": n?.isBoundary ? n.position : void 0,
1823
1774
  className: X({
1824
- [Xn]: a || o,
1825
- [Zn]: o,
1826
- [tr]: s === "left",
1827
- [nr]: s === "center",
1828
- [rr]: s === "right"
1775
+ [qn]: a || o,
1776
+ [Jn]: o,
1777
+ [Qn]: s === "left",
1778
+ [$n]: s === "center",
1779
+ [er]: s === "right"
1829
1780
  }, e),
1830
1781
  style: [
1831
1782
  {
@@ -1843,24 +1794,24 @@ function ir({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title
1843
1794
  children: i
1844
1795
  }) : null;
1845
1796
  }
1846
- function ar({ shadowVisible: e }) {
1797
+ function nr({ shadowVisible: e }) {
1847
1798
  return p(se, {
1848
1799
  className: "mantine-datatable-footer-selector-placeholder-cell",
1849
1800
  "data-shadow-visible": e || void 0
1850
1801
  });
1851
1802
  }
1852
- function or({ className: e, style: t, columns: n, defaultColumnProps: r, pinnedMap: i, selectionVisible: a, selectorCellShadowVisible: o, ref: s }) {
1803
+ function rr({ className: e, style: t, columns: n, defaultColumnProps: r, pinnedMap: i, selectionVisible: a, selectorCellShadowVisible: o, ref: s }) {
1853
1804
  return p(oe, {
1854
1805
  ref: s,
1855
1806
  className: X("mantine-datatable-footer", e),
1856
1807
  style: t,
1857
- children: m(B, { children: [a && p(ar, { shadowVisible: o }), n.map(({ hidden: e, ...t }) => {
1808
+ children: m(B, { children: [a && p(nr, { shadowVisible: o }), n.map(({ hidden: e, ...t }) => {
1858
1809
  if (e) return null;
1859
1810
  let { accessor: n, visibleMediaQuery: a, textAlign: o, width: s, footer: c, footerClassName: l, footerStyle: u, noWrap: d, ellipsis: f } = {
1860
1811
  ...r,
1861
1812
  ...t
1862
1813
  };
1863
- return p(ir, {
1814
+ return p(tr, {
1864
1815
  pinnedInfo: i.get(String(n)),
1865
1816
  className: l,
1866
1817
  style: u,
@@ -1874,8 +1825,8 @@ function or({ className: e, style: t, columns: n, defaultColumnProps: r, pinnedM
1874
1825
  })] })
1875
1826
  });
1876
1827
  }
1877
- function sr({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, className: a, style: o }, pinnedInfo: s, maxDepth: c, currentDepth: u, previousGroups: d, isLastGroup: f, withColumnBorders: m = !1, totalTableColumns: h }) {
1878
- let g = l(() => t && t.length > 0 ? t : n && n.length > 0 ? Cn([{
1828
+ function ir({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, className: a, style: o }, pinnedInfo: s, maxDepth: c, currentDepth: u, previousGroups: d, isLastGroup: f, withColumnBorders: m = !1, totalTableColumns: h }) {
1829
+ let g = l(() => t && t.length > 0 ? t : n && n.length > 0 ? bn([{
1879
1830
  id: e,
1880
1831
  columns: t,
1881
1832
  groups: n
@@ -1883,7 +1834,7 @@ function sr({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
1883
1834
  t,
1884
1835
  n,
1885
1836
  e
1886
- ]), _ = Kn(l(() => g.map(({ visibleMediaQuery: e }) => e), [g])), v = l(() => wn({
1837
+ ]), _ = Un(l(() => g.map(({ visibleMediaQuery: e }) => e), [g])), v = l(() => xn({
1887
1838
  id: e,
1888
1839
  columns: t,
1889
1840
  groups: n
@@ -1892,16 +1843,16 @@ function sr({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
1892
1843
  t,
1893
1844
  n,
1894
1845
  _
1895
- ]), y = l(() => d.reduce((e, t) => e + wn(t, _), 0), [d, _]), b = n && n.length > 0 ? 1 : c - u, x = En(f, y + v < h, m);
1846
+ ]), y = l(() => d.reduce((e, t) => e + xn(t, _), 0), [d, _]), b = n && n.length > 0 ? 1 : c - u, x = Cn(f, y + v < h, m);
1896
1847
  return v > 0 ? p(se, {
1897
1848
  colSpan: v,
1898
1849
  rowSpan: b > 1 ? b : void 0,
1899
1850
  "data-pinned": s?.position,
1900
1851
  "data-pinned-shadow": s?.isBoundary ? s.position : void 0,
1901
1852
  className: X("mantine-datatable-column-group-header-cell", {
1902
- [tr]: i === "left",
1903
- [nr]: i === "center",
1904
- [rr]: i === "right",
1853
+ [Qn]: i === "left",
1854
+ [$n]: i === "center",
1855
+ [er]: i === "right",
1905
1856
  "mantine-datatable-column-group-header-cell--needs-border": x
1906
1857
  }, a),
1907
1858
  style: [o, s && {
@@ -1909,10 +1860,10 @@ function sr({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
1909
1860
  [s.position]: s.offset,
1910
1861
  overflow: "visible"
1911
1862
  }],
1912
- children: r ?? gn(e)
1863
+ children: r ?? pn(e)
1913
1864
  }) : null;
1914
1865
  }
1915
- function cr() {
1866
+ function ar() {
1916
1867
  return m("svg", {
1917
1868
  width: "14",
1918
1869
  height: "14",
@@ -1929,7 +1880,7 @@ function cr() {
1929
1880
  }), p("path", { d: "M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z" })]
1930
1881
  });
1931
1882
  }
1932
- function lr() {
1883
+ function or() {
1933
1884
  return m("svg", {
1934
1885
  width: "14",
1935
1886
  height: "14",
@@ -1950,8 +1901,8 @@ function lr() {
1950
1901
  })]
1951
1902
  });
1952
1903
  }
1953
- function ur({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisableClickOutside: r }) {
1954
- let [i, { close: a, toggle: o }] = je(!1), s = t ? lr : cr, c = Ae(a);
1904
+ function sr({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisableClickOutside: r }) {
1905
+ let [i, { close: a, toggle: o }] = je(!1), s = t ? or : ar, c = Ae(a);
1955
1906
  return r && (c = void 0), m(F, {
1956
1907
  withArrow: !0,
1957
1908
  shadow: "md",
@@ -1978,7 +1929,7 @@ function ur({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisa
1978
1929
  })]
1979
1930
  });
1980
1931
  }
1981
- function dr() {
1932
+ function cr() {
1982
1933
  return m("svg", {
1983
1934
  width: "14",
1984
1935
  height: "14",
@@ -2000,7 +1951,7 @@ function dr() {
2000
1951
  ]
2001
1952
  });
2002
1953
  }
2003
- function fr() {
1954
+ function lr() {
2004
1955
  return m("svg", {
2005
1956
  width: "14",
2006
1957
  height: "14",
@@ -2022,7 +1973,7 @@ function fr() {
2022
1973
  ]
2023
1974
  });
2024
1975
  }
2025
- function pr() {
1976
+ function ur() {
2026
1977
  return m("svg", {
2027
1978
  width: "14",
2028
1979
  height: "14",
@@ -2044,7 +1995,7 @@ function pr() {
2044
1995
  ]
2045
1996
  });
2046
1997
  }
2047
- function mr() {
1998
+ function dr() {
2048
1999
  return m("svg", {
2049
2000
  width: "14",
2050
2001
  height: "14",
@@ -2065,14 +2016,14 @@ function mr() {
2065
2016
  ]
2066
2017
  });
2067
2018
  }
2068
- function hr({ currentPinned: e, onPinChange: t }) {
2019
+ function fr({ currentPinned: e, onPinChange: t }) {
2069
2020
  let [n, r] = d(!1), i = u(null), [o, c] = d(!1), l = a(() => {
2070
2021
  if (i.current) {
2071
2022
  let e = getComputedStyle(i.current).direction;
2072
2023
  c(e === "rtl");
2073
2024
  }
2074
2025
  }, []);
2075
- Mn(() => {
2026
+ kn(() => {
2076
2027
  l();
2077
2028
  }, [l]), s(() => {
2078
2029
  n && l();
@@ -2095,7 +2046,7 @@ function hr({ currentPinned: e, onPinChange: t }) {
2095
2046
  size: "xs",
2096
2047
  variant: "light",
2097
2048
  onClick: (e) => e.stopPropagation(),
2098
- children: p(pr, {})
2049
+ children: p(ur, {})
2099
2050
  })
2100
2051
  }) }), p(F.Dropdown, {
2101
2052
  onClick: (e) => e.stopPropagation(),
@@ -2110,14 +2061,14 @@ function hr({ currentPinned: e, onPinChange: t }) {
2110
2061
  variant: _ ? "filled" : "light",
2111
2062
  onClick: () => t(_ ? void 0 : f),
2112
2063
  "aria-label": "Pin left",
2113
- children: p(dr, {})
2064
+ children: p(cr, {})
2114
2065
  }),
2115
2066
  p(g, {
2116
2067
  size: "sm",
2117
2068
  variant: v ? "filled" : "light",
2118
2069
  onClick: () => t(v ? void 0 : h),
2119
2070
  "aria-label": "Pin right",
2120
- children: p(fr, {})
2071
+ children: p(lr, {})
2121
2072
  }),
2122
2073
  e && p(g, {
2123
2074
  size: "sm",
@@ -2125,18 +2076,18 @@ function hr({ currentPinned: e, onPinChange: t }) {
2125
2076
  color: "red",
2126
2077
  onClick: () => t(void 0),
2127
2078
  "aria-label": "Unpin",
2128
- children: p(mr, {})
2079
+ children: p(dr, {})
2129
2080
  })
2130
2081
  ]
2131
2082
  })
2132
2083
  })]
2133
2084
  });
2134
2085
  }
2135
- var gr = 50, _r = (e) => {
2086
+ var pr = 50, mr = (e) => {
2136
2087
  let { accessor: t, columnRef: n } = e, [r, i] = d(!1), o = u(0), s = u({
2137
2088
  current: 0,
2138
2089
  next: 0
2139
- }), { dir: c } = ge(), l = c === "rtl", { setMultipleColumnWidths: f, beginResize: m, endResize: h } = dn(), g = a((e) => {
2090
+ }), { dir: c } = ge(), l = c === "rtl", { setMultipleColumnWidths: f, beginResize: m, endResize: h } = cn(), g = a((e) => {
2140
2091
  if (e.preventDefault(), e.stopPropagation(), !n.current) return;
2141
2092
  let r = n.current, a = r.nextElementSibling;
2142
2093
  for (; a;) {
@@ -2155,7 +2106,7 @@ var gr = 50, _r = (e) => {
2155
2106
  let p = (e) => {
2156
2107
  let n = e.clientX - o.current;
2157
2108
  l && (n = -n);
2158
- let r = s.current.current - gr, i = s.current.next - gr, a = Math.max(-r, Math.min(n, i)), u = s.current.current + a, d = s.current.next - a;
2109
+ let r = s.current.current - pr, i = s.current.next - pr, a = Math.max(-r, Math.min(n, i)), u = s.current.current + a, d = s.current.next - a;
2159
2110
  f([{
2160
2111
  accessor: t,
2161
2112
  width: `${u}px`
@@ -2202,7 +2153,7 @@ var gr = 50, _r = (e) => {
2202
2153
  title: "Drag to resize column, double-click to reset"
2203
2154
  });
2204
2155
  };
2205
- function vr() {
2156
+ function hr() {
2206
2157
  return m("svg", {
2207
2158
  width: "14",
2208
2159
  height: "14",
@@ -2224,7 +2175,7 @@ function vr() {
2224
2175
  ]
2225
2176
  });
2226
2177
  }
2227
- function yr() {
2178
+ function gr() {
2228
2179
  return m("svg", {
2229
2180
  width: "14",
2230
2181
  height: "14",
@@ -2246,7 +2197,7 @@ function yr() {
2246
2197
  ]
2247
2198
  });
2248
2199
  }
2249
- function br() {
2200
+ function _r() {
2250
2201
  return m("svg", {
2251
2202
  width: "14",
2252
2203
  height: "14",
@@ -2271,10 +2222,10 @@ function br() {
2271
2222
  ]
2272
2223
  });
2273
2224
  }
2274
- function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQuery: i, title: a, sortable: o, draggable: s, toggleable: c, pinnable: l, resizable: f, sortIcons: h, textAlign: _, width: y, sortStatus: x, onSortStatusChange: S, filter: C, filterPopoverProps: E, filterPopoverDisableClickOutside: D, filtering: O, sortKey: k }) {
2275
- let { setSourceColumn: A, setTargetColumn: j, swapColumns: M, columnsToggle: N, setColumnsToggle: P, columnsPinning: ee, setColumnsPinning: F } = dn(), [te, I] = d(!1), L = u(null), ne = ee?.find((e) => e.accessor === r)?.pinned;
2276
- if (!qn(i)) return null;
2277
- let R = a ?? gn(r), re = typeof R == "string" ? R : void 0, ie = o && S ? (e) => {
2225
+ function vr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQuery: i, title: a, sortable: o, draggable: s, toggleable: c, pinnable: l, resizable: f, sortIcons: h, textAlign: _, width: y, sortStatus: x, onSortStatusChange: S, filter: C, filterPopoverProps: E, filterPopoverDisableClickOutside: D, filtering: O, sortKey: k }) {
2226
+ let { setSourceColumn: A, setTargetColumn: j, swapColumns: M, columnsToggle: N, setColumnsToggle: P, columnsPinning: ee, setColumnsPinning: F } = cn(), [te, I] = d(!1), L = u(null), ne = ee?.find((e) => e.accessor === r)?.pinned;
2227
+ if (!Wn(i)) return null;
2228
+ let R = a ?? pn(r), re = typeof R == "string" ? R : void 0, ie = o && S ? (e) => {
2278
2229
  e?.defaultPrevented || S({
2279
2230
  sortKey: k,
2280
2231
  columnAccessor: r,
@@ -2359,19 +2310,19 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
2359
2310
  onClick: (e) => {
2360
2311
  e.stopPropagation();
2361
2312
  },
2362
- children: p(br, {})
2313
+ children: p(_r, {})
2363
2314
  })
2364
2315
  }) : null, p(v, {
2365
2316
  className: X("mantine-datatable-header-cell-sortable-text", {
2366
- [tr]: _ === "left",
2367
- [nr]: _ === "center",
2368
- [rr]: _ === "right"
2369
- }, Xn, Zn),
2317
+ [Qn]: _ === "left",
2318
+ [$n]: _ === "center",
2319
+ [er]: _ === "right"
2320
+ }, qn, Jn),
2370
2321
  title: re,
2371
2322
  children: R
2372
2323
  })]
2373
2324
  }),
2374
- l ? p(hr, {
2325
+ l ? p(fr, {
2375
2326
  currentPinned: ne,
2376
2327
  onPinChange: V
2377
2328
  }) : null,
@@ -2383,45 +2334,45 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
2383
2334
  size: "xs",
2384
2335
  variant: "light",
2385
2336
  onClick: le,
2386
- children: p(mr, {})
2337
+ children: p(dr, {})
2387
2338
  })
2388
2339
  }) : null,
2389
2340
  o || x?.columnAccessor === r ? x?.columnAccessor === r ? p(b, {
2390
2341
  className: X("mantine-datatable-header-cell-sortable-icon", { "mantine-datatable-header-cell-sortable-icon-reversed": x.direction === "desc" }),
2391
2342
  role: "img",
2392
2343
  "aria-label": `Sorted ${x.direction === "desc" ? "descending" : "ascending"}`,
2393
- children: h?.sorted || p(yr, {})
2344
+ children: h?.sorted || p(gr, {})
2394
2345
  }) : p(b, {
2395
2346
  className: "mantine-datatable-header-cell-sortable-unsorted-icon",
2396
2347
  role: "img",
2397
2348
  "aria-label": "Not sorted",
2398
- children: h?.unsorted || p(vr, {})
2349
+ children: h?.unsorted || p(hr, {})
2399
2350
  }) : null,
2400
- C ? p(ur, {
2351
+ C ? p(sr, {
2401
2352
  filterPopoverProps: E,
2402
2353
  isActive: !!O,
2403
2354
  filterPopoverDisableClickOutside: D,
2404
2355
  children: C
2405
2356
  }) : null
2406
2357
  ]
2407
- }), f && r !== "__selection__" ? p(_r, {
2358
+ }), f && r !== "__selection__" ? p(mr, {
2408
2359
  accessor: r,
2409
2360
  columnRef: L
2410
2361
  }) : null]
2411
2362
  });
2412
2363
  }
2413
- function Sr({ className: e, style: t, trigger: n, shadowVisible: r, checked: i, indeterminate: a, checkboxProps: o, onChange: s, rowSpan: c, ref: l }) {
2364
+ function yr({ className: e, style: t, trigger: n, shadowVisible: r, checked: i, indeterminate: a, checkboxProps: o, onChange: s, rowSpan: c, ref: l }) {
2414
2365
  let u = !o.disabled;
2415
2366
  return p(se, {
2416
2367
  ref: l,
2417
- className: X("mantine-datatable-header-selector-cell", { [Qn]: n === "cell" && u }, e),
2368
+ className: X("mantine-datatable-header-selector-cell", { [Yn]: n === "cell" && u }, e),
2418
2369
  style: t,
2419
2370
  rowSpan: c,
2420
2371
  "data-shadow-visible": r || void 0,
2421
2372
  "data-accessor": "__selection__",
2422
2373
  onClick: n === "cell" && u ? s : void 0,
2423
2374
  children: p(x, {
2424
- classNames: u ? { input: Qn } : void 0,
2375
+ classNames: u ? { input: Yn } : void 0,
2425
2376
  checked: i,
2426
2377
  indeterminate: a,
2427
2378
  onChange: s,
@@ -2430,7 +2381,7 @@ function Sr({ className: e, style: t, trigger: n, shadowVisible: r, checked: i,
2430
2381
  })
2431
2382
  });
2432
2383
  }
2433
- function Cr(e, t) {
2384
+ function br(e, t) {
2434
2385
  let n = (e.columns ?? []).filter((e) => !e.hidden).map((e) => String(e.accessor)), r = n.map((e) => t.get(e)).filter(Boolean);
2435
2386
  if (r.length === 0 || r.length !== n.length) return;
2436
2387
  let i = new Set(r.map((e) => e.logicalSide));
@@ -2443,8 +2394,8 @@ function Cr(e, t) {
2443
2394
  isBoundary: l?.isBoundary ?? !1
2444
2395
  };
2445
2396
  }
2446
- function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r, sortIcons: i, onSortStatusChange: a, columns: o, defaultColumnProps: s, groups: c, pinnedMap: l, selectionTrigger: u, selectionVisible: f, selectionChecked: h, selectionIndeterminate: g, onSelectionChange: _, selectionCheckboxProps: v, selectorCellShadowVisible: y, selectionColumnClassName: b, selectionColumnStyle: S, withColumnBorders: C = !1, ref: w }) {
2447
- let E = c ? Sn(c) : 0, D = E > 0 ? E + 1 : 1, O = f ? p(Sr, {
2397
+ function xr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r, sortIcons: i, onSortStatusChange: a, columns: o, defaultColumnProps: s, groups: c, pinnedMap: l, selectionTrigger: u, selectionVisible: f, selectionChecked: h, selectionIndeterminate: g, onSelectionChange: _, selectionCheckboxProps: v, selectorCellShadowVisible: y, selectionColumnClassName: b, selectionColumnStyle: S, withColumnBorders: C = !1, ref: w }) {
2398
+ let E = c ? yn(c) : 0, D = E > 0 ? E + 1 : 1, O = f ? p(yr, {
2448
2399
  ref: e,
2449
2400
  className: b,
2450
2401
  style: S,
@@ -2455,7 +2406,7 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
2455
2406
  checkboxProps: v,
2456
2407
  onChange: _,
2457
2408
  rowSpan: c ? D : void 0
2458
- }) : null, { columnsToggle: k, setColumnsToggle: A } = dn(), [j, M] = d(!1), N = o.some((e) => e.toggleable), P = N ? Object.fromEntries(o.map(({ accessor: e, title: t }) => [e, t ?? gn(String(e))])) : void 0, ee = m(ce, {
2409
+ }) : null, { columnsToggle: k, setColumnsToggle: A } = cn(), [j, M] = d(!1), N = o.some((e) => e.toggleable), P = N ? Object.fromEntries(o.map(({ accessor: e, title: t }) => [e, t ?? pn(String(e))])) : void 0, ee = m(ce, {
2459
2410
  className: X("mantine-datatable-header", t),
2460
2411
  style: n,
2461
2412
  ref: w,
@@ -2463,10 +2414,10 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
2463
2414
  e.preventDefault(), M((e) => !e);
2464
2415
  } : void 0,
2465
2416
  children: [c && Array.from({ length: E }, (e, t) => {
2466
- let n = Tn(c, t);
2467
- return m(B, { children: [t === 0 && O, n.map((e, r) => p(sr, {
2417
+ let n = Sn(c, t);
2418
+ return m(B, { children: [t === 0 && O, n.map((e, r) => p(ir, {
2468
2419
  group: e,
2469
- pinnedInfo: Cr(e, l),
2420
+ pinnedInfo: br(e, l),
2470
2421
  maxDepth: E,
2471
2422
  currentDepth: t,
2472
2423
  previousGroups: n.slice(0, r),
@@ -2480,7 +2431,7 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
2480
2431
  ...s,
2481
2432
  ...t
2482
2433
  };
2483
- return p(xr, {
2434
+ return p(vr, {
2484
2435
  accessor: c,
2485
2436
  pinnedInfo: l.get(String(c)),
2486
2437
  className: b,
@@ -2525,7 +2476,7 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
2525
2476
  }) }, e.accessor)) }) })]
2526
2477
  }) : ee;
2527
2478
  }
2528
- function Tr({ fetching: e, customContent: t, backgroundBlur: n, size: r, type: i, color: a }) {
2479
+ function Sr({ fetching: e, customContent: t, backgroundBlur: n, size: r, type: i, color: a }) {
2529
2480
  return p(b, {
2530
2481
  className: X("mantine-datatable-loader", { "mantine-datatable-loader-fetching": e }),
2531
2482
  style: [{ backdropFilter: n ? `blur(${n}px)` : void 0 }],
@@ -2536,7 +2487,7 @@ function Tr({ fetching: e, customContent: t, backgroundBlur: n, size: r, type: i
2536
2487
  }))
2537
2488
  });
2538
2489
  }
2539
- function Er() {
2490
+ function Cr() {
2540
2491
  return m("svg", {
2541
2492
  width: "14",
2542
2493
  height: "14",
@@ -2557,14 +2508,14 @@ function Er() {
2557
2508
  ]
2558
2509
  });
2559
2510
  }
2560
- var Dr = {
2511
+ var wr = {
2561
2512
  xs: he(22),
2562
2513
  sm: he(26),
2563
2514
  md: he(32),
2564
2515
  lg: he(38),
2565
2516
  xl: he(44)
2566
2517
  };
2567
- function Or({ size: e, label: t, values: n, value: r, activeTextColor: i, activeBackgroundColor: a, onChange: o }) {
2518
+ function Tr({ size: e, label: t, values: n, value: r, activeTextColor: i, activeBackgroundColor: a, onChange: o }) {
2568
2519
  return m(T, {
2569
2520
  gap: "xs",
2570
2521
  children: [p(V, {
@@ -2580,9 +2531,9 @@ function Or({ size: e, label: t, values: n, value: r, activeTextColor: i, active
2580
2531
  size: e,
2581
2532
  variant: "default",
2582
2533
  classNames: { section: "mantine-datatable-page-size-selector-button-icon" },
2583
- rightSection: p(Er, {}),
2534
+ rightSection: p(Cr, {}),
2584
2535
  style: [{ fontWeight: "normal" }, (t) => ({
2585
- height: Dr[e],
2536
+ height: wr[e],
2586
2537
  paddingLeft: t.spacing[e],
2587
2538
  paddingRight: t.spacing[e]
2588
2539
  })],
@@ -2591,7 +2542,7 @@ function Or({ size: e, label: t, values: n, value: r, activeTextColor: i, active
2591
2542
  let n = t === r;
2592
2543
  return p(j, {
2593
2544
  className: X({ "mantine-datatable-page-size-selector-active": n }),
2594
- style: [{ height: Dr[e] }, n && (i || a) ? (e) => cn({
2545
+ style: [{ height: wr[e] }, n && (i || a) ? (e) => an({
2595
2546
  theme: e,
2596
2547
  paginationActiveTextColor: i,
2597
2548
  paginationActiveBackgroundColor: a
@@ -2608,7 +2559,7 @@ function Or({ size: e, label: t, values: n, value: r, activeTextColor: i, active
2608
2559
  })]
2609
2560
  });
2610
2561
  }
2611
- function kr({ className: e, style: t, fetching: n, page: r, onPageChange: i, paginationWithEdges: a, paginationWithControls: o, paginationActiveTextColor: s, paginationActiveBackgroundColor: c, paginationSize: l, loadingText: u, noRecordsText: d, paginationText: h, totalRecords: g, recordsPerPage: _, onRecordsPerPageChange: y, recordsPerPageLabel: b, recordsPerPageOptions: x, recordsLength: S, horizontalSpacing: C, paginationWrapBreakpoint: w, getPaginationControlProps: T, getPaginationItemProps: E, renderPagination: D }) {
2562
+ function Er({ className: e, style: t, fetching: n, page: r, onPageChange: i, paginationWithEdges: a, paginationWithControls: o, paginationActiveTextColor: s, paginationActiveBackgroundColor: c, paginationSize: l, loadingText: u, noRecordsText: d, paginationText: h, totalRecords: g, recordsPerPage: _, onRecordsPerPageChange: y, recordsPerPageLabel: b, recordsPerPageOptions: x, recordsLength: S, horizontalSpacing: C, paginationWrapBreakpoint: w, getPaginationControlProps: T, getPaginationItemProps: E, renderPagination: D }) {
2612
2563
  let O;
2613
2564
  if (g) {
2614
2565
  let e = (r - 1) * _ + 1;
@@ -2618,7 +2569,7 @@ function kr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
2618
2569
  totalRecords: g
2619
2570
  });
2620
2571
  } else O = n ? u : d;
2621
- let k = g && _ ? Math.max(1, Math.ceil(g / _)) : 1, A = g ? (r - 1) * (_ ?? 0) + 1 : void 0, j = g ? (A ?? 1) + (S ?? 0) - 1 : void 0, M = !qn(({ breakpoints: e }) => `(min-width: ${typeof w == "number" ? `${he(w)}rem` : e[w] || w})`), N = {
2572
+ let k = g && _ ? Math.max(1, Math.ceil(g / _)) : 1, A = g ? (r - 1) * (_ ?? 0) + 1 : void 0, j = g ? (A ?? 1) + (S ?? 0) - 1 : void 0, M = !Wn(({ breakpoints: e }) => `(min-width: ${typeof w == "number" ? `${he(w)}rem` : e[w] || w})`), N = {
2622
2573
  Text: (e) => p(V, {
2623
2574
  component: "div",
2624
2575
  className: "mantine-datatable-pagination-text",
@@ -2626,7 +2577,7 @@ function kr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
2626
2577
  ...e,
2627
2578
  children: O
2628
2579
  }),
2629
- PageSizeSelector: (e) => x ? p(Or, {
2580
+ PageSizeSelector: (e) => x ? p(Tr, {
2630
2581
  activeTextColor: s,
2631
2582
  activeBackgroundColor: c,
2632
2583
  size: l,
@@ -2641,7 +2592,7 @@ function kr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
2641
2592
  root: X("mantine-datatable-pagination-pages", { "mantine-datatable-pagination-pages-fetching": n || !S }),
2642
2593
  control: "mantine-datatable-pagination-pages-control"
2643
2594
  },
2644
- style: s || c ? (e) => cn({
2595
+ style: s || c ? (e) => an({
2645
2596
  theme: e,
2646
2597
  paginationActiveTextColor: s,
2647
2598
  paginationActiveBackgroundColor: c
@@ -2687,18 +2638,18 @@ function kr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
2687
2638
  ] })
2688
2639
  });
2689
2640
  }
2690
- function Ar({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, record: i, index: a, onClick: o, onDoubleClick: s, onContextMenu: c, noWrap: l, ellipsis: u, textAlign: d, width: f, accessor: m, render: h, defaultRender: g, customCellAttributes: _ }) {
2691
- return qn(r) ? p(z, {
2641
+ function Dr({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, record: i, index: a, onClick: o, onDoubleClick: s, onContextMenu: c, noWrap: l, ellipsis: u, textAlign: d, width: f, accessor: m, render: h, defaultRender: g, customCellAttributes: _ }) {
2642
+ return Wn(r) ? p(z, {
2692
2643
  "data-pinned": n?.position,
2693
2644
  "data-pinned-shadow": n?.isBoundary ? n.position : void 0,
2694
2645
  className: X({
2695
- [Xn]: l || u,
2696
- [Zn]: u,
2697
- [Qn]: o || s,
2698
- [$n]: c,
2699
- [tr]: d === "left",
2700
- [nr]: d === "center",
2701
- [rr]: d === "right"
2646
+ [qn]: l || u,
2647
+ [Jn]: u,
2648
+ [Yn]: o || s,
2649
+ [Xn]: c,
2650
+ [Qn]: d === "left",
2651
+ [$n]: d === "center",
2652
+ [er]: d === "right"
2702
2653
  }, e),
2703
2654
  style: [
2704
2655
  {
@@ -2717,11 +2668,11 @@ function Ar({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, recor
2717
2668
  onDoubleClick: s,
2718
2669
  onContextMenu: c,
2719
2670
  ..._?.(i, a),
2720
- children: h ? h(i, a) : g ? g(i, a, m) : xn(i, m)
2671
+ children: h ? h(i, a) : g ? g(i, a, m) : vn(i, m)
2721
2672
  }) : null;
2722
2673
  }
2723
- function jr({ open: e, colSpan: t, content: n, collapseProps: r }) {
2724
- let { expanded: i, visible: a } = Yn(e, r?.transitionDuration);
2674
+ function Or({ open: e, colSpan: t, content: n, collapseProps: r }) {
2675
+ let { expanded: i, visible: a } = Kn(e, r?.transitionDuration);
2725
2676
  return a ? m(f, { children: [p(B, {}), p(B, { children: p(z, {
2726
2677
  className: "mantine-datatable-row-expansion-cell",
2727
2678
  colSpan: t,
@@ -2735,7 +2686,7 @@ function jr({ open: e, colSpan: t, content: n, collapseProps: r }) {
2735
2686
  })
2736
2687
  }) })] }) : null;
2737
2688
  }
2738
- function Mr({ className: e, style: t, record: n, index: r, trigger: i, onChange: a, withRightShadow: o, checkboxProps: s, getCheckboxProps: c, ...l }) {
2689
+ function kr({ className: e, style: t, record: n, index: r, trigger: i, onChange: a, withRightShadow: o, checkboxProps: s, getCheckboxProps: c, ...l }) {
2739
2690
  let u = {
2740
2691
  ...s,
2741
2692
  ...c(n, r)
@@ -2743,20 +2694,20 @@ function Mr({ className: e, style: t, record: n, index: r, trigger: i, onChange:
2743
2694
  e.stopPropagation(), i === "cell" && d && a?.(e);
2744
2695
  };
2745
2696
  return p(z, {
2746
- className: X("mantine-datatable-row-selector-cell", { [Qn]: i === "cell" && d }, e),
2697
+ className: X("mantine-datatable-row-selector-cell", { [Yn]: i === "cell" && d }, e),
2747
2698
  style: t,
2748
2699
  "data-shadow-visible": o || void 0,
2749
2700
  onClick: f,
2750
2701
  children: p(x, {
2751
- classNames: d ? { input: Qn } : void 0,
2702
+ classNames: d ? { input: Yn } : void 0,
2752
2703
  onChange: a,
2753
2704
  ...l,
2754
2705
  ...u
2755
2706
  })
2756
2707
  });
2757
2708
  }
2758
- function Nr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap: i, defaultColumnRender: a, selectionTrigger: o, selectionVisible: s, selectionChecked: c, onSelectionChange: l, isRecordSelectable: u, selectionCheckboxProps: d, getSelectionCheckboxProps: h, onClick: g, onDoubleClick: _, onContextMenu: v, onCellClick: y, onCellDoubleClick: b, onCellContextMenu: x, expansion: S, customAttributes: C, color: w, backgroundColor: T, className: E, style: D, selectorCellShadowVisible: O, selectionColumnClassName: k, selectionColumnStyle: A, rowFactory: j }) {
2759
- let M = m(f, { children: [s && p(Mr, {
2709
+ function Ar({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap: i, defaultColumnRender: a, selectionTrigger: o, selectionVisible: s, selectionChecked: c, onSelectionChange: l, isRecordSelectable: u, selectionCheckboxProps: d, getSelectionCheckboxProps: h, onClick: g, onDoubleClick: _, onContextMenu: v, onCellClick: y, onCellDoubleClick: b, onCellContextMenu: x, expansion: S, customAttributes: C, color: w, backgroundColor: T, className: E, style: D, selectorCellShadowVisible: O, selectionColumnClassName: k, selectionColumnStyle: A, rowFactory: j }) {
2710
+ let M = m(f, { children: [s && p(kr, {
2760
2711
  className: k,
2761
2712
  style: A,
2762
2713
  record: e,
@@ -2774,7 +2725,7 @@ function Nr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
2774
2725
  ...r,
2775
2726
  ...s
2776
2727
  };
2777
- return p(Ar, {
2728
+ return p(Dr, {
2778
2729
  pinnedInfo: i.get(String(l)),
2779
2730
  className: typeof _ == "function" ? _(e, t) : _,
2780
2731
  style: v?.(e, t),
@@ -2811,7 +2762,7 @@ function Nr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
2811
2762
  defaultRender: a,
2812
2763
  customCellAttributes: S
2813
2764
  }, l);
2814
- })] }), N = S && p(jr, {
2765
+ })] }), N = S && p(Or, {
2815
2766
  colSpan: n.filter(({ hidden: e }) => !e).length + +!!s,
2816
2767
  open: S.isRowExpanded(e),
2817
2768
  content: S.content({
@@ -2819,7 +2770,7 @@ function Nr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
2819
2770
  index: t
2820
2771
  }),
2821
2772
  collapseProps: S.collapseProps
2822
- }), P = Pr({
2773
+ }), P = jr({
2823
2774
  record: e,
2824
2775
  index: t,
2825
2776
  selectionChecked: c,
@@ -2844,12 +2795,12 @@ function Nr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
2844
2795
  children: M
2845
2796
  }), N] });
2846
2797
  }
2847
- function Pr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClick: i, onContextMenu: a, expansion: o, customAttributes: s, color: c, backgroundColor: l, className: u, style: d }) {
2798
+ function jr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClick: i, onContextMenu: a, expansion: o, customAttributes: s, color: c, backgroundColor: l, className: u, style: d }) {
2848
2799
  return {
2849
- className: X("mantine-datatable-row", { [Qn]: r || i || o?.isExpandable({
2800
+ className: X("mantine-datatable-row", { [Yn]: r || i || o?.isExpandable({
2850
2801
  record: e,
2851
2802
  index: t
2852
- }) && o?.expandOnClick }, { [$n]: a }, typeof u == "function" ? u(e, t) : u),
2803
+ }) && o?.expandOnClick }, { [Xn]: a }, typeof u == "function" ? u(e, t) : u),
2853
2804
  "data-selected": n || void 0,
2854
2805
  onClick: (n) => {
2855
2806
  if (o) {
@@ -2877,7 +2828,7 @@ function Pr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClic
2877
2828
  }) : void 0,
2878
2829
  style: [c || l ? (n) => {
2879
2830
  let r = c?.(e, t), i = l?.(e, t);
2880
- return ln({
2831
+ return on({
2881
2832
  theme: n,
2882
2833
  color: r,
2883
2834
  backgroundColor: i
@@ -2886,7 +2837,7 @@ function Pr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClic
2886
2837
  ...s?.(e, t) ?? {}
2887
2838
  };
2888
2839
  }
2889
- function Fr({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange: n, children: r, viewportRef: i, scrollAreaProps: a }) {
2840
+ function Mr({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange: n, children: r, viewportRef: i, scrollAreaProps: a }) {
2890
2841
  return m(L, {
2891
2842
  ...a,
2892
2843
  viewportRef: i,
@@ -2906,8 +2857,8 @@ function Fr({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange:
2906
2857
  ]
2907
2858
  });
2908
2859
  }
2909
- function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, height: r = "100%", minHeight: i, maxHeight: o, shadow: d, verticalAlign: f = "center", fetching: h, columns: g, storeColumnsKey: _, groups: y, pinFirstColumn: b, pinLastColumn: x, defaultColumnProps: S, defaultColumnRender: C, idAccessor: w = "id", records: T, selectionTrigger: E = "checkbox", selectedRecords: D, onSelectedRecordsChange: O, selectionColumnClassName: k, selectionColumnStyle: A, isRecordSelectable: j, selectionCheckboxProps: M, allRecordsSelectionCheckboxProps: N = { "aria-label": "Select all records" }, getRecordSelectionCheckboxProps: P = (e, t) => ({ "aria-label": `Select record ${t + 1}` }), sortStatus: ee, sortIcons: F, onSortStatusChange: te, horizontalSpacing: I, page: L, onPageChange: ne, totalRecords: R, recordsPerPage: re, onRecordsPerPageChange: ie, recordsPerPageOptions: z, recordsPerPageLabel: oe = "Records per page", paginationWithEdges: se, paginationWithControls: ce, paginationActiveTextColor: B, paginationActiveBackgroundColor: le, paginationSize: V = "sm", paginationText: ue = ({ from: e, to: t, totalRecords: n }) => `${e} - ${t} / ${n}`, paginationWrapBreakpoint: de = "sm", getPaginationControlProps: fe = (e) => e === "previous" ? { "aria-label": "Previous page" } : e === "next" ? { "aria-label": "Next page" } : {}, getPaginationItemProps: pe, renderPagination: me, loaderBackgroundBlur: he, customLoader: ge, loaderSize: _e, loaderType: ve, loaderColor: ye, loadingText: be = "...", emptyState: xe, noRecordsText: Se = "No records", noRecordsIcon: Ce, highlightOnHover: we, striped: Te, noHeader: Ee, onRowClick: De, onRowDoubleClick: Oe, onRowContextMenu: ke, onCellClick: Ae, onCellDoubleClick: je, onCellContextMenu: Me, onScroll: Ne, onScrollToTop: Fe, onScrollToBottom: Ie, onScrollToLeft: Le, onScrollToRight: Re, c: H, backgroundColor: ze, borderColor: Be, rowBorderColor: U, stripedColor: Ve, highlightOnHoverColor: He, rowColor: Ue, rowBackgroundColor: W, rowExpansion: We, rowClassName: Ge, rowStyle: Ke, customRowAttributes: qe, scrollViewportRef: Je, scrollAreaProps: Ye, tableRef: Xe, bodyRef: Ze, m: Qe, my: $e, mx: et, mt: G, mb: K, ml: tt, mr: nt, className: rt, classNames: q, style: it, styles: J, rowFactory: at, tableWrapper: ot, ...st }) {
2910
- let ct = l(() => y ? Cn(y) : g, [g, y]), { refs: Y, onScroll: lt } = Bn({
2860
+ function Nr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, height: r = "100%", minHeight: i, maxHeight: o, shadow: d, verticalAlign: f = "center", fetching: h, columns: g, storeColumnsKey: _, groups: y, pinFirstColumn: b, pinLastColumn: x, defaultColumnProps: S, defaultColumnRender: C, idAccessor: w = "id", records: T, selectionTrigger: E = "checkbox", selectedRecords: D, onSelectedRecordsChange: O, selectionColumnClassName: k, selectionColumnStyle: A, isRecordSelectable: j, selectionCheckboxProps: M, allRecordsSelectionCheckboxProps: N = { "aria-label": "Select all records" }, getRecordSelectionCheckboxProps: P = (e, t) => ({ "aria-label": `Select record ${t + 1}` }), sortStatus: ee, sortIcons: F, onSortStatusChange: te, horizontalSpacing: I, page: L, onPageChange: ne, totalRecords: R, recordsPerPage: re, onRecordsPerPageChange: ie, recordsPerPageOptions: z, recordsPerPageLabel: oe = "Records per page", paginationWithEdges: se, paginationWithControls: ce, paginationActiveTextColor: B, paginationActiveBackgroundColor: le, paginationSize: V = "sm", paginationText: ue = ({ from: e, to: t, totalRecords: n }) => `${e} - ${t} / ${n}`, paginationWrapBreakpoint: de = "sm", getPaginationControlProps: fe = (e) => e === "previous" ? { "aria-label": "Previous page" } : e === "next" ? { "aria-label": "Next page" } : {}, getPaginationItemProps: pe, renderPagination: me, loaderBackgroundBlur: he, customLoader: ge, loaderSize: _e, loaderType: ve, loaderColor: ye, loadingText: be = "...", emptyState: xe, noRecordsText: Se = "No records", noRecordsIcon: Ce, highlightOnHover: we, striped: Te, noHeader: Ee, onRowClick: De, onRowDoubleClick: Oe, onRowContextMenu: ke, onCellClick: Ae, onCellDoubleClick: je, onCellContextMenu: Me, onScroll: Ne, onScrollToTop: Fe, onScrollToBottom: Ie, onScrollToLeft: Le, onScrollToRight: Re, c: ze, backgroundColor: Be, borderColor: Ve, rowBorderColor: H, stripedColor: He, highlightOnHoverColor: Ue, rowColor: We, rowBackgroundColor: U, rowExpansion: Ge, rowClassName: Ke, rowStyle: qe, customRowAttributes: Je, scrollViewportRef: Ye, scrollAreaProps: Xe, tableRef: Ze, bodyRef: Qe, m: $e, my: et, mx: tt, mt: W, mb: G, ml: nt, mr: rt, className: it, classNames: K, style: at, styles: q, rowFactory: ot, tableWrapper: st, ...ct }) {
2861
+ let lt = l(() => y ? bn(y) : g, [g, y]), { refs: J, onScroll: ut } = Ln({
2911
2862
  scrollCallbacks: {
2912
2863
  onScroll: Ne,
2913
2864
  onScrollToTop: Fe,
@@ -2915,21 +2866,21 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
2915
2866
  onScrollToLeft: Le,
2916
2867
  onScrollToRight: Re
2917
2868
  },
2918
- withRowBorders: st.withRowBorders
2919
- }), ut = jn({
2869
+ withRowBorders: ct.withRowBorders
2870
+ }), Y = On({
2920
2871
  key: _,
2921
- columns: ct,
2922
- headerRef: Y.header,
2923
- scrollViewportRef: Y.scrollViewport
2924
- }), dt = ut.effectiveColumns, ft = Pe(Y.table, Xe), pt = Pe(Y.scrollViewport, Je), mt = u(null), ht = Pe(mt, Ze), gt = Jn({
2925
- rowExpansion: We,
2872
+ columns: lt,
2873
+ headerRef: J.header,
2874
+ scrollViewportRef: J.scrollViewport
2875
+ }), dt = Y.effectiveColumns, ft = Pe(J.table, Ze), pt = Pe(J.scrollViewport, Ye), mt = u(null), ht = Pe(mt, Qe), gt = Gn({
2876
+ rowExpansion: Ge,
2926
2877
  records: T,
2927
2878
  idAccessor: w
2928
- }), { pinnedMap: _t, hasLeftPinned: vt, hasRightPinned: yt } = Vn({
2879
+ }), { pinnedMap: _t, hasLeftPinned: vt, hasRightPinned: yt } = Rn({
2929
2880
  columns: dt,
2930
- theadRef: Y.header,
2881
+ theadRef: J.header,
2931
2882
  tbodyRef: mt,
2932
- selectionColumnHeaderRef: Y.selectionColumnHeader,
2883
+ selectionColumnHeaderRef: J.selectionColumnHeader,
2933
2884
  selectionVisible: !!D,
2934
2885
  pinFirstColumn: b,
2935
2886
  pinLastColumn: x
@@ -2942,7 +2893,7 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
2942
2893
  let wt = T?.length;
2943
2894
  c(() => {
2944
2895
  if (!bt.current || h || T === St.current) return;
2945
- let e = Y.scrollViewport.current;
2896
+ let e = J.scrollViewport.current;
2946
2897
  if (!e) return;
2947
2898
  let t = requestAnimationFrame(() => {
2948
2899
  e.scrollTo({
@@ -2954,10 +2905,10 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
2954
2905
  }, [
2955
2906
  h,
2956
2907
  T,
2957
- Y.scrollViewport
2908
+ J.scrollViewport
2958
2909
  ]);
2959
2910
  let Tt = T?.map((e) => Q(e, w)), Et = !!D, Dt = D?.map((e) => Q(e, w)), Ot = Tt !== void 0 && Dt !== void 0 && Dt.length > 0, kt = j ? T?.filter(j) : T, At = kt?.map((e) => Q(e, w)), jt = Ot && At.every((e) => Dt.includes(e)), Mt = Ot && At.some((e) => Dt.includes(e)), Nt = a(() => {
2960
- D && O && O(jt ? D.filter((e) => !At.includes(Q(e, w))) : bn([...D, ...kt], (e) => Q(e, w)));
2911
+ D && O && O(jt ? D.filter((e) => !At.includes(Q(e, w))) : _n([...D, ...kt], (e) => Q(e, w)));
2961
2912
  }, [
2962
2913
  jt,
2963
2914
  w,
@@ -2965,32 +2916,32 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
2965
2916
  At,
2966
2917
  kt,
2967
2918
  D
2968
- ]), { lastSelectionChangeIndex: Pt, setLastSelectionChangeIndex: Ft } = Hn(Tt), It = Et && !vt, Lt = {
2969
- m: Qe,
2970
- my: $e,
2971
- mx: et,
2972
- mt: G,
2973
- mb: K,
2974
- ml: tt,
2975
- mr: nt
2976
- }, Rt = a(({ children: e }) => ot ? ot({ children: e }) : e, [ot]);
2977
- return p(fn, {
2978
- ...ut,
2919
+ ]), { lastSelectionChangeIndex: Pt, setLastSelectionChangeIndex: Ft } = zn(Tt), It = Et && !vt, Lt = {
2920
+ m: $e,
2921
+ my: et,
2922
+ mx: tt,
2923
+ mt: W,
2924
+ mb: G,
2925
+ ml: nt,
2926
+ mr: rt
2927
+ }, Rt = a(({ children: e }) => st ? st({ children: e }) : e, [st]);
2928
+ return p(ln, {
2929
+ ...Y,
2979
2930
  pinnedMap: _t,
2980
2931
  children: m(v, {
2981
- ref: Y.root,
2932
+ ref: J.root,
2982
2933
  ...Lt,
2983
- className: X("mantine-datatable", { "mantine-datatable-with-border": e }, rt, q?.root),
2934
+ className: X("mantine-datatable", { "mantine-datatable-with-border": e }, it, K?.root),
2984
2935
  style: [
2985
2936
  (e) => ({
2986
- ...sn({
2937
+ ...rn({
2987
2938
  theme: e,
2988
- c: H,
2989
- backgroundColor: ze,
2990
- borderColor: Be,
2991
- rowBorderColor: U,
2992
- stripedColor: Ve,
2993
- highlightOnHoverColor: He
2939
+ c: ze,
2940
+ backgroundColor: Be,
2941
+ borderColor: Ve,
2942
+ rowBorderColor: H,
2943
+ stripedColor: He,
2944
+ highlightOnHoverColor: Ue
2994
2945
  }),
2995
2946
  borderRadius: e.radius[t] || t,
2996
2947
  boxShadow: e.shadows[d] || d,
@@ -2998,46 +2949,46 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
2998
2949
  minHeight: i,
2999
2950
  maxHeight: o
3000
2951
  }),
3001
- it,
3002
- J?.root,
2952
+ at,
2953
+ q?.root,
3003
2954
  { position: "relative" }
3004
2955
  ],
3005
2956
  children: [
3006
- p(Fr, {
2957
+ p(Mr, {
3007
2958
  viewportRef: pt,
3008
2959
  leftShadowBehind: Et || vt,
3009
2960
  rightShadowBehind: yt,
3010
- onScrollPositionChange: lt,
3011
- scrollAreaProps: Ye,
2961
+ onScrollPositionChange: ut,
2962
+ scrollAreaProps: Xe,
3012
2963
  children: p(Rt, { children: m(ae, {
3013
2964
  ref: ft,
3014
2965
  horizontalSpacing: I,
3015
2966
  className: X("mantine-datatable-table", {
3016
- [er]: n,
2967
+ [Zn]: n,
3017
2968
  "mantine-datatable-vertical-align-top": f === "top",
3018
2969
  "mantine-datatable-vertical-align-bottom": f === "bottom",
3019
2970
  "mantine-datatable-selection-column-visible": Et,
3020
- "mantine-datatable-resizable-columns": ut.hasResizableColumns,
3021
- "mantine-datatable-resize-locked": ut.isLocked,
3022
- "mantine-datatable-resizing": ut.isResizing
3023
- }, q?.table),
2971
+ "mantine-datatable-resizable-columns": Y.hasResizableColumns,
2972
+ "mantine-datatable-resize-locked": Y.isLocked,
2973
+ "mantine-datatable-resizing": Y.isResizing
2974
+ }, K?.table),
3024
2975
  style: {
3025
- ...J?.table,
3026
- ...ut.isLocked ? { tableLayout: "fixed" } : null,
3027
- ...ut.tableWidth == null ? null : { width: `${ut.tableWidth}px` }
2976
+ ...q?.table,
2977
+ ...Y.isLocked ? { tableLayout: "fixed" } : null,
2978
+ ...Y.tableWidth == null ? null : { width: `${Y.tableWidth}px` }
3028
2979
  },
3029
2980
  "data-striped": wt && Te || void 0,
3030
2981
  "data-highlight-on-hover": we || void 0,
3031
- ...st,
2982
+ ...ct,
3032
2983
  children: [
3033
- Ee ? null : p(fn, {
3034
- ...ut,
2984
+ Ee ? null : p(ln, {
2985
+ ...Y,
3035
2986
  pinnedMap: _t,
3036
- children: p(wr, {
3037
- ref: Y.header,
3038
- selectionColumnHeaderRef: Y.selectionColumnHeader,
3039
- className: q?.header,
3040
- style: J?.header,
2987
+ children: p(xr, {
2988
+ ref: J.header,
2989
+ selectionColumnHeaderRef: J.selectionColumnHeader,
2990
+ className: K?.header,
2991
+ style: q?.header,
3041
2992
  columns: dt,
3042
2993
  defaultColumnProps: S,
3043
2994
  groups: y,
@@ -3057,7 +3008,7 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
3057
3008
  selectorCellShadowVisible: It,
3058
3009
  selectionColumnClassName: k,
3059
3010
  selectionColumnStyle: A,
3060
- withColumnBorders: st.withColumnBorders
3011
+ withColumnBorders: ct.withColumnBorders
3061
3012
  })
3062
3013
  }),
3063
3014
  p("tbody", {
@@ -3067,10 +3018,10 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
3067
3018
  return O && D && (i = (i) => {
3068
3019
  if (i.nativeEvent.shiftKey && Pt !== null) {
3069
3020
  let e = T.filter(t > Pt ? (e, n) => n >= Pt && n <= t && (!j || j(e, n)) : (e, n) => n >= t && n <= Pt && (!j || j(e, n)));
3070
- O(r ? yn(D, e, (e) => Q(e, w)) : bn([...D, ...e], (e) => Q(e, w)));
3071
- } else O(r ? D.filter((e) => Q(e, w) !== n) : bn([...D, e], (e) => Q(e, w)));
3021
+ O(r ? gn(D, e, (e) => Q(e, w)) : _n([...D, ...e], (e) => Q(e, w)));
3022
+ } else O(r ? D.filter((e) => Q(e, w) !== n) : _n([...D, e], (e) => Q(e, w)));
3072
3023
  Ft(t);
3073
- }), p(Nr, {
3024
+ }), p(Ar, {
3074
3025
  record: e,
3075
3026
  index: t,
3076
3027
  columns: dt,
@@ -3091,23 +3042,23 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
3091
3042
  onContextMenu: ke,
3092
3043
  onCellContextMenu: Me,
3093
3044
  expansion: gt,
3094
- color: Ue,
3095
- backgroundColor: W,
3096
- className: Ge,
3097
- style: Ke,
3098
- customAttributes: qe,
3045
+ color: We,
3046
+ backgroundColor: U,
3047
+ className: Ke,
3048
+ style: qe,
3049
+ customAttributes: Je,
3099
3050
  selectorCellShadowVisible: It,
3100
3051
  selectionColumnClassName: k,
3101
3052
  selectionColumnStyle: A,
3102
3053
  idAccessor: w,
3103
- rowFactory: at
3054
+ rowFactory: ot
3104
3055
  }, n);
3105
- }) : p(pn, {})
3056
+ }) : p(un, {})
3106
3057
  }),
3107
- dt.some(({ footer: e }) => e) && p(or, {
3108
- ref: Y.footer,
3109
- className: q?.footer,
3110
- style: J?.footer,
3058
+ dt.some(({ footer: e }) => e) && p(rr, {
3059
+ ref: J.footer,
3060
+ className: K?.footer,
3061
+ style: q?.footer,
3111
3062
  columns: dt,
3112
3063
  defaultColumnProps: S,
3113
3064
  pinnedMap: _t,
@@ -3117,9 +3068,9 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
3117
3068
  ]
3118
3069
  }) })
3119
3070
  }),
3120
- !!(L && wt) && p(kr, {
3121
- className: q?.pagination,
3122
- style: J?.pagination,
3071
+ !!(L && wt) && p(Er, {
3072
+ className: K?.pagination,
3073
+ style: q?.pagination,
3123
3074
  horizontalSpacing: I,
3124
3075
  fetching: h,
3125
3076
  page: L,
@@ -3143,7 +3094,7 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
3143
3094
  recordsLength: wt,
3144
3095
  renderPagination: me
3145
3096
  }),
3146
- p(Tr, {
3097
+ p(Sr, {
3147
3098
  fetching: h,
3148
3099
  backgroundBlur: he,
3149
3100
  customContent: ge,
@@ -3151,7 +3102,7 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
3151
3102
  type: ve,
3152
3103
  color: ye
3153
3104
  }),
3154
- p(hn, {
3105
+ p(fn, {
3155
3106
  icon: Ce,
3156
3107
  text: Se,
3157
3108
  active: !h && !wt,
@@ -3163,8 +3114,8 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
3163
3114
  }
3164
3115
  //#endregion
3165
3116
  //#region src/DataTable/UpdateModal.tsx
3166
- function Lr({ fields: e, onClose: t, queryKey: n, connectedQueryKeys: r, apiPath: i, id: a, steps: o }) {
3167
- let { data: s, isLoading: c } = Ut(i, n, a), { mutateAsync: l, isPending: u, error: d } = qt(i, n, r);
3117
+ function Pr({ fields: e, onClose: t, queryKey: n, connectedQueryKeys: r, apiPath: i, id: a, steps: o }) {
3118
+ let { data: s, isLoading: c } = Bt(i, n, a), { mutateAsync: l, isPending: u, error: d } = Wt(i, n, r);
3168
3119
  return c || !s ? /* @__PURE__ */ m(re, {
3169
3120
  gap: "md",
3170
3121
  children: [
@@ -3182,7 +3133,7 @@ function Lr({ fields: e, onClose: t, queryKey: n, connectedQueryKeys: r, apiPath
3182
3133
  })]
3183
3134
  })
3184
3135
  ]
3185
- }) : /* @__PURE__ */ p(rn, {
3136
+ }) : /* @__PURE__ */ p(en, {
3186
3137
  fields: e,
3187
3138
  steps: o,
3188
3139
  record: s,
@@ -3200,8 +3151,8 @@ function Lr({ fields: e, onClose: t, queryKey: n, connectedQueryKeys: r, apiPath
3200
3151
  }
3201
3152
  //#endregion
3202
3153
  //#region src/DataTable/DeleteModal.tsx
3203
- function Rr({ queryKey: e, connectedQueryKeys: t, apiPath: n, onClose: r, selectedRecords: i, confirmMessage: a }) {
3204
- let { mutateAsync: o, isError: c, error: l, isPending: u } = Jt(n, e, t), [h, g] = d(i), [v, b] = d(!1), x = v || u;
3154
+ function Fr({ queryKey: e, connectedQueryKeys: t, apiPath: n, onClose: r, selectedRecords: i, confirmMessage: a }) {
3155
+ let { mutateAsync: o, isError: c, error: l, isPending: u } = Gt(n, e, t), [h, g] = d(i), [v, b] = d(!1), x = v || u;
3205
3156
  return s(() => {
3206
3157
  h.length || r();
3207
3158
  }, [r, h]), h.length ? /* @__PURE__ */ m(f, { children: [
@@ -3238,7 +3189,7 @@ function Rr({ queryKey: e, connectedQueryKeys: t, apiPath: n, onClose: r, select
3238
3189
  }
3239
3190
  //#endregion
3240
3191
  //#region src/Hooks/usePersistentState.ts
3241
- function zr(e, t) {
3192
+ function Ir(e, t) {
3242
3193
  let n = `use_persistent_storage_${t}`, [r, i] = d(() => {
3243
3194
  try {
3244
3195
  let t = localStorage.getItem(n);
@@ -3256,12 +3207,12 @@ function zr(e, t) {
3256
3207
  }
3257
3208
  //#endregion
3258
3209
  //#region src/utils/sort.ts
3259
- var Br = [
3210
+ var Lr = [
3260
3211
  /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,
3261
3212
  /^\d{4}-\d{2}-\d{2}$/,
3262
3213
  /^\d{1,2}\/\d{1,2}\/\d{4}$/,
3263
3214
  /^\d{1,2}\.\d{1,2}\.\d{4}$/
3264
- ], Vr = (e, t) => {
3215
+ ], Rr = (e, t) => {
3265
3216
  let n = e.map((e) => e[t]).filter((e) => e != null && e !== "");
3266
3217
  if (n.length === 0) return "string";
3267
3218
  let r = n.slice(0, 100), i = {
@@ -3277,7 +3228,7 @@ var Br = [
3277
3228
  i.number++;
3278
3229
  return;
3279
3230
  }
3280
- if (Br.some((e) => e.test(t))) {
3231
+ if (Lr.some((e) => e.test(t))) {
3281
3232
  let e = new Date(t);
3282
3233
  if (!isNaN(e.getTime())) {
3283
3234
  i.date++;
@@ -3290,7 +3241,7 @@ var Br = [
3290
3241
  let a = i.string + i.number + i.date;
3291
3242
  return i.date / a >= .6 ? "date" : i.number / a >= .6 ? "number" : i.string / a >= .6 ? "string" : "mixed";
3292
3243
  };
3293
- function Hr(e, t) {
3244
+ function zr(e, t) {
3294
3245
  switch (t) {
3295
3246
  case "date":
3296
3247
  if (typeof e == "string") {
@@ -3306,54 +3257,54 @@ function Hr(e, t) {
3306
3257
  default: return String(e).toLowerCase().trim();
3307
3258
  }
3308
3259
  }
3309
- var Ur = (e, t, n = "asc") => {
3260
+ var Br = (e, t, n = "asc") => {
3310
3261
  if (!e || e.length === 0) return [];
3311
- let r = Vr(e, t);
3262
+ let r = Rr(e, t);
3312
3263
  return [...e].sort((e, i) => {
3313
3264
  let a = e[t], o = i[t], s = a == null || a === "", c = o == null || o === "";
3314
3265
  if (s && c) return 0;
3315
3266
  if (s) return n === "asc" ? -1 : 1;
3316
3267
  if (c) return n === "asc" ? 1 : -1;
3317
- let l = Hr(a, r), u = Hr(o, r);
3268
+ let l = zr(a, r), u = zr(o, r);
3318
3269
  return l === null && u === null ? 0 : l === null ? n === "asc" ? 1 : -1 : u === null || l < u ? n === "asc" ? -1 : 1 : l > u ? n === "asc" ? 1 : -1 : 0;
3319
3270
  });
3320
3271
  };
3321
3272
  //#endregion
3322
3273
  //#region src/utils/filter.ts
3323
- function Wr(e) {
3274
+ function Vr(e) {
3324
3275
  return !!e && typeof e == "object" && "id" in e;
3325
3276
  }
3326
- function Gr(e, t) {
3277
+ function Hr(e, t) {
3327
3278
  if (typeof e == "string" || typeof e == "number") return t.includes(String(e));
3328
3279
  if (e && typeof e == "object") {
3329
3280
  let n = e;
3330
- return Wr(n) && t.includes(n.id) ? !0 : Object.values(n).some((e) => typeof e == "string" && t.includes(e) || Wr(e) && t.includes(e.id));
3281
+ return Vr(n) && t.includes(n.id) ? !0 : Object.values(n).some((e) => typeof e == "string" && t.includes(e) || Vr(e) && t.includes(e.id));
3331
3282
  }
3332
3283
  return !1;
3333
3284
  }
3334
- function Kr(e, t) {
3335
- return Array.isArray(t) ? Array.isArray(e) ? e.some((e) => Gr(e, t)) : Wr(e) ? t.includes(e.id) : !1 : typeof e == "string" && e.includes(t);
3285
+ function Ur(e, t) {
3286
+ return Array.isArray(t) ? Array.isArray(e) ? e.some((e) => Hr(e, t)) : Vr(e) ? t.includes(e.id) : !1 : typeof e == "string" && e.includes(t);
3336
3287
  }
3337
- function qr(e, [t, n]) {
3288
+ function Wr(e, [t, n]) {
3338
3289
  if (!t && !n || typeof e != "string") return !0;
3339
3290
  let r = e.split(" ")[0];
3340
3291
  return t && n ? r >= t && r <= n : t ? r >= t : r <= n;
3341
3292
  }
3342
- function Jr(e, t) {
3293
+ function Gr(e, t) {
3343
3294
  if (t.value === void 0) return !0;
3344
3295
  let n = e[t.id];
3345
3296
  switch (t.type) {
3346
- case "query": return Kr(n, t.value);
3347
- case "date": return qr(n, t.value);
3297
+ case "query": return Ur(n, t.value);
3298
+ case "date": return Wr(n, t.value);
3348
3299
  case "boolean": return n === t.value;
3349
3300
  }
3350
3301
  }
3351
- function Yr(e, t) {
3352
- return !t || t.length === 0 ? e : e.filter((e) => t.every((t) => Jr(e, t)));
3302
+ function Kr(e, t) {
3303
+ return !t || t.length === 0 ? e : e.filter((e) => t.every((t) => Gr(e, t)));
3353
3304
  }
3354
3305
  //#endregion
3355
3306
  //#region src/DataTable/FieldCard.tsx
3356
- function Xr({ rows: e }) {
3307
+ function qr({ rows: e }) {
3357
3308
  return /* @__PURE__ */ p(f, { children: e.map((e, t) => /* @__PURE__ */ m(v, { children: [t > 0 && /* @__PURE__ */ p(C, {}), /* @__PURE__ */ m(T, {
3358
3309
  wrap: "nowrap",
3359
3310
  justify: "space-between",
@@ -3374,27 +3325,27 @@ function Xr({ rows: e }) {
3374
3325
  })]
3375
3326
  })] }, typeof e.label == "string" ? e.label : t)) });
3376
3327
  }
3377
- function Zr({ rows: e }) {
3328
+ function Jr({ rows: e }) {
3378
3329
  return /* @__PURE__ */ p(v, {
3379
3330
  bg: "var(--mantine-color-gray-light)",
3380
3331
  style: {
3381
3332
  borderRadius: "var(--mantine-radius-md)",
3382
3333
  overflow: "hidden"
3383
3334
  },
3384
- children: /* @__PURE__ */ p(Xr, { rows: e })
3335
+ children: /* @__PURE__ */ p(qr, { rows: e })
3385
3336
  });
3386
3337
  }
3387
3338
  //#endregion
3388
3339
  //#region src/DataTable/MobileCardList.tsx
3389
- function Qr(e, t) {
3340
+ function Yr(e, t) {
3390
3341
  return t.split(".").reduce((e, t) => {
3391
3342
  if (e && typeof e == "object" && t in e) return e[t];
3392
3343
  }, e);
3393
3344
  }
3394
- function $r(e, t) {
3345
+ function Xr(e, t) {
3395
3346
  let n = t.column;
3396
3347
  if (n.render) return n.render(e, 0);
3397
- let r = Qr(e, n.accessor ?? t.id);
3348
+ let r = Yr(e, n.accessor ?? t.id);
3398
3349
  return r == null ? /* @__PURE__ */ p(V, {
3399
3350
  c: "dimmed",
3400
3351
  children: "–"
@@ -3406,7 +3357,7 @@ function $r(e, t) {
3406
3357
  children: String(r)
3407
3358
  });
3408
3359
  }
3409
- function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, canDelete: o, pagination: s, sort: c, rowExpansion: l }) {
3360
+ function Zr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, canDelete: o, pagination: s, sort: c, rowExpansion: l }) {
3410
3361
  let [u, _] = d(/* @__PURE__ */ new Set()), y = l?.expanded, b = (e) => y ? y.recordIds.includes(e) : u.has(e), x = (e) => {
3411
3362
  if (y) {
3412
3363
  let { recordIds: t, onRecordIdsChange: n } = y;
@@ -3540,9 +3491,9 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
3540
3491
  }, `card_action_${n}`)) })]
3541
3492
  });
3542
3493
  })()
3543
- }), /* @__PURE__ */ p(Xr, { rows: w.map((t) => ({
3494
+ }), /* @__PURE__ */ p(qr, { rows: w.map((t) => ({
3544
3495
  label: t.column.title ?? t.id,
3545
- value: $r(e, t)
3496
+ value: Xr(e, t)
3546
3497
  })) })]
3547
3498
  }), c && /* @__PURE__ */ m(S, {
3548
3499
  expanded: u,
@@ -3590,20 +3541,20 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
3590
3541
  }
3591
3542
  //#endregion
3592
3543
  //#region src/DataTable/DataTable.tsx
3593
- var ti = [
3544
+ var Qr = [
3594
3545
  10,
3595
3546
  15,
3596
3547
  50,
3597
3548
  100,
3598
3549
  500
3599
3550
  ];
3600
- function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPath: a, mutationApiPath: o, buttons: c, topContent: l, fields: h, selection: b, pagination: x, filters: S, actions: C, steps: D, defaultSort: O, onSortChange: A, createButtonText: j, queryParams: M, tabs: P, defaultTab: ee, activeTab: F, onActiveTabChange: te, canUpdate: I, canDelete: L, showRefresh: ne = !0, onRefresh: ie, autoPoll: ae, rowExpansion: z, onRowClick: oe, mobileCards: se = !1, deleteConfirmMessage: ce, editRecordId: B, onEditRecordIdChange: ue }) {
3551
+ function $r({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPath: a, mutationApiPath: o, buttons: c, topContent: l, fields: h, selection: b, pagination: x, filters: S, actions: C, steps: D, defaultSort: O, onSortChange: A, createButtonText: j, queryParams: M, tabs: P, defaultTab: ee, activeTab: F, onActiveTabChange: te, canUpdate: I, canDelete: L, showRefresh: ne = !0, onRefresh: ie, autoPoll: ae, rowExpansion: z, onRowClick: oe, mobileCards: se = !1, deleteConfirmMessage: ce, editRecordId: B, onEditRecordIdChange: ue }) {
3601
3552
  let [de, pe] = d(ee || (P && P.length > 0 ? P[0].value : null)), me = F === void 0 ? de : F, he = (e) => {
3602
3553
  F === void 0 && pe(e), te && te(e);
3603
3554
  }, ge = P?.find((e) => e.value === me), _e = ge?.queryParams || {}, ve = ge?.apiPath ?? a, ye = ge?.mutationApiPath ?? o ?? ve, Se = {
3604
3555
  ...M,
3605
3556
  ..._e
3606
- }, Ce = Se ? "?" + Object.entries(Se).filter(([, e]) => e != null).map(([e, t]) => `${e}=${encodeURIComponent(t ?? "")}`).join("&") : "", De = me ? [...n, me] : n, { data: Oe, isLoading: Ae, isError: je, isRefetching: Me, refetch: Ne } = Wt(ve + Ce, De), Pe = Yr(Array.isArray(Oe) ? Oe : [], S), [Fe, Ie] = d(!1), Le = u(() => {});
3557
+ }, Ce = Se ? "?" + Object.entries(Se).filter(([, e]) => e != null).map(([e, t]) => `${e}=${encodeURIComponent(t ?? "")}`).join("&") : "", De = me ? [...n, me] : n, { data: Oe, isLoading: Ae, isError: je, isRefetching: Me, refetch: Ne } = Vt(ve + Ce, De), Pe = Kr(Array.isArray(Oe) ? Oe : [], S), [Fe, Ie] = d(!1), Le = u(() => {});
3607
3558
  s(() => {
3608
3559
  Le.current = ie ?? (() => Ne());
3609
3560
  });
@@ -3615,78 +3566,81 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
3615
3566
  }, Re);
3616
3567
  return () => clearInterval(e);
3617
3568
  }, [Re]);
3618
- let [H, ze] = d({
3569
+ let [ze, Be] = d({
3619
3570
  columnAccessor: O?.field ?? h[0].id,
3620
3571
  direction: O?.direction ?? "desc"
3621
- }), Be = (e) => {
3622
- ze(e), A && A(String(e.columnAccessor), e.direction);
3623
- }, U = Ur(Pe, H.columnAccessor, H.direction), [Ve, He] = zr(ti[1], "mantine-table-page-size"), [Ue, W] = d(1), We = Math.max(1, Math.ceil(U.length / Ve)), Ge = Math.min(Ue, We), Ke = (e) => {
3624
- He(e), W(1);
3625
- }, qe = x ? U.slice((Ge - 1) * Ve, Ge * Ve) : U, [Je, Ye] = d([]), Xe = z?.expanded?.recordIds ?? Je, Ze = z?.expanded?.onRecordIdsChange ?? Ye, Qe = (e) => {
3626
- Xe.includes(e) ? Ze(Xe.filter((t) => t !== e)) : Ze(z?.allowMultiple ? [...Xe, e] : [e]);
3627
- }, $e = h.findIndex((e) => e.list && e.column && !e.column.hidden), et = z && $e >= 0 ? h.map((e, t) => {
3628
- if (t !== $e) return e;
3572
+ }), Ve = (e) => {
3573
+ Be(e), A && A(String(e.columnAccessor), e.direction);
3574
+ }, H = Br(Pe, ze.columnAccessor, ze.direction), [He, Ue] = Ir(Qr[1], "mantine-table-page-size"), [We, U] = d(1), Ge = Math.max(1, Math.ceil(H.length / He)), Ke = Math.min(We, Ge), qe = (e) => {
3575
+ Ue(e), U(1);
3576
+ }, Je = x ? H.slice((Ke - 1) * He, Ke * He) : H, [Ye, Xe] = d([]), Ze = z?.expanded?.recordIds ?? Ye, Qe = z?.expanded?.onRecordIdsChange ?? Xe, $e = (e) => {
3577
+ Ze.includes(e) ? Qe(Ze.filter((t) => t !== e)) : Qe(z?.allowMultiple ? [...Ze, e] : [e]);
3578
+ }, et = h.findIndex((e) => e.list && e.column && !e.column.hidden), tt = z && et >= 0 ? h.map((e, t) => {
3579
+ if (t !== et) return e;
3629
3580
  let n = e.column.render;
3630
3581
  return {
3631
3582
  ...e,
3632
3583
  column: {
3633
3584
  ...e.column,
3634
- render: (t, r) => /* @__PURE__ */ m(T, {
3635
- gap: "xs",
3636
- wrap: "nowrap",
3637
- align: "center",
3638
- children: [!z.expandable || z.expandable(t) ? /* @__PURE__ */ p(v, {
3639
- component: "span",
3640
- "aria-label": "Aufklappen",
3641
- onClick: (e) => {
3642
- e.stopPropagation(), Qe(t.id);
3643
- },
3644
- style: {
3645
- display: "inline-flex",
3646
- flexShrink: 0,
3647
- cursor: "pointer"
3648
- },
3649
- children: /* @__PURE__ */ p(xe, {
3650
- size: 16,
3585
+ render: (t, r) => {
3586
+ let i = !z.expandable || z.expandable(t);
3587
+ return /* @__PURE__ */ m(T, {
3588
+ gap: "xs",
3589
+ wrap: "nowrap",
3590
+ align: "center",
3591
+ children: [i ? /* @__PURE__ */ p(v, {
3592
+ component: "span",
3593
+ "aria-label": "Aufklappen",
3594
+ onClick: (e) => {
3595
+ e.stopPropagation(), $e(t.id);
3596
+ },
3651
3597
  style: {
3652
- color: "var(--mantine-primary-color-filled)",
3653
- transform: Xe.includes(t.id) ? "rotate(90deg)" : void 0,
3654
- transition: "transform 200ms ease"
3655
- }
3656
- })
3657
- }) : /* @__PURE__ */ p(v, {
3658
- w: 16,
3659
- style: { flexShrink: 0 }
3660
- }), n ? n(t, r) : String(xn(t, e.column.accessor) ?? "")]
3661
- })
3598
+ display: "inline-flex",
3599
+ flexShrink: 0,
3600
+ cursor: "pointer"
3601
+ },
3602
+ children: /* @__PURE__ */ p(xe, {
3603
+ size: 16,
3604
+ style: {
3605
+ color: "var(--mantine-primary-color-filled)",
3606
+ transform: Ze.includes(t.id) ? "rotate(90deg)" : void 0,
3607
+ transition: "transform 200ms ease"
3608
+ }
3609
+ })
3610
+ }) : /* @__PURE__ */ p(v, {
3611
+ w: 16,
3612
+ style: { flexShrink: 0 }
3613
+ }), n ? n(t, r) : String(vn(t, e.column.accessor) ?? "")]
3614
+ });
3615
+ }
3662
3616
  }
3663
3617
  };
3664
- }) : h, [G, K] = d([]);
3618
+ }) : h, [W, G] = d([]);
3665
3619
  s(() => {
3666
- K([]);
3620
+ G([]);
3667
3621
  }, [me]);
3668
- let [tt, nt] = d(!1), [rt, q] = d(!1), [it, J] = d(!1), at = u(null);
3622
+ let [nt, rt] = d(!1), [it, K] = d(!1), [at, q] = d(!1), ot = u(null);
3669
3623
  s(() => {
3670
3624
  if (!B) {
3671
- at.current = null;
3625
+ ot.current = null;
3672
3626
  return;
3673
3627
  }
3674
- if (at.current === B) return;
3675
- let e = U.find((e) => e.id === B);
3676
- e && (at.current = B, K([e]), q(!0), ue?.(null));
3677
- }, [B, U]);
3678
- let ot = h.some((e) => e.update), st = h.some((e) => e.delete), ct = [];
3679
- return ot && ct.push({
3628
+ if (ot.current === B) return;
3629
+ let e = H.find((e) => e.id === B);
3630
+ e && (ot.current = B, G([e]), K(!0), ue?.(null));
3631
+ }, [B, H]);
3632
+ let st = h.some((e) => e.update), ct = h.some((e) => e.delete), lt = [];
3633
+ return st && lt.push({
3680
3634
  icon: /* @__PURE__ */ p(Te, { size: 14 }),
3681
3635
  label: "Bearbeiten",
3682
3636
  onClick: (e) => {
3683
- K(e), q(!0);
3637
+ G(e), K(!0);
3684
3638
  }
3685
- }), C && ct.push(...C), st && ct.push({
3639
+ }), C && lt.push(...C), ct && lt.push({
3686
3640
  icon: /* @__PURE__ */ p(ke, { size: 14 }),
3687
3641
  label: "Löschen",
3688
3642
  onClick: (e) => {
3689
- K(e), J(!0);
3643
+ G(e), q(!0);
3690
3644
  }
3691
3645
  }), /* @__PURE__ */ m(f, { children: [
3692
3646
  /* @__PURE__ */ m(w, {
@@ -3766,7 +3720,7 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
3766
3720
  children: /* @__PURE__ */ p(Ee, {})
3767
3721
  }),
3768
3722
  (h.some((e) => e.update) || b) && (() => {
3769
- let e = h.find((e) => e.update) && (!I || G.length > 0 && I(G[0])), t = h.find((e) => e.delete) && (!L || G.length > 0 && L(G[0])), n = (C ?? []).length > 0, r = e || t || n;
3723
+ let e = h.find((e) => e.update) && (!I || W.length > 0 && I(W[0])), t = h.find((e) => e.delete) && (!L || W.length > 0 && L(W[0])), n = (C ?? []).length > 0, r = e || t || n;
3770
3724
  return /* @__PURE__ */ p(v, {
3771
3725
  ...se ? { visibleFrom: "sm" } : {},
3772
3726
  children: /* @__PURE__ */ m(k, {
@@ -3774,24 +3728,24 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
3774
3728
  children: [/* @__PURE__ */ p(k.Target, { children: /* @__PURE__ */ p(y, {
3775
3729
  variant: "outline",
3776
3730
  rightSection: /* @__PURE__ */ p(be, { size: 14 }),
3777
- disabled: !G.length || !r,
3731
+ disabled: !W.length || !r,
3778
3732
  children: "Aktionen"
3779
3733
  }) }), /* @__PURE__ */ m(k.Dropdown, { children: [
3780
3734
  e && /* @__PURE__ */ p(k.Item, {
3781
3735
  leftSection: /* @__PURE__ */ p(Te, { size: 14 }),
3782
- onClick: () => q(!0),
3783
- disabled: G.length !== 1,
3736
+ onClick: () => K(!0),
3737
+ disabled: W.length !== 1,
3784
3738
  children: "Bearbeiten"
3785
3739
  }),
3786
3740
  (C ?? []).map((e, t) => /* @__PURE__ */ i(k.Item, {
3787
3741
  ...e.icon && { leftSection: e.icon },
3788
3742
  key: `custom_action_${t}`,
3789
- onClick: () => e.onClick(G),
3790
- disabled: e.disabled?.(G) ?? !1
3743
+ onClick: () => e.onClick(W),
3744
+ disabled: e.disabled?.(W) ?? !1
3791
3745
  }, e.label)),
3792
3746
  t && /* @__PURE__ */ p(k.Item, {
3793
3747
  leftSection: /* @__PURE__ */ p(ke, { size: 14 }),
3794
- onClick: () => J(!0),
3748
+ onClick: () => q(!0),
3795
3749
  color: "red",
3796
3750
  children: "Löschen"
3797
3751
  })
@@ -3800,7 +3754,7 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
3800
3754
  });
3801
3755
  })(),
3802
3756
  h.find((e) => e.create) && /* @__PURE__ */ p(y, {
3803
- onClick: () => nt(!0),
3757
+ onClick: () => rt(!0),
3804
3758
  disabled: Ae,
3805
3759
  children: j ?? "Erstellen"
3806
3760
  }),
@@ -3839,7 +3793,7 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
3839
3793
  }),
3840
3794
  !Ae && !Me && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(v, {
3841
3795
  ...se ? { visibleFrom: "sm" } : {},
3842
- children: /* @__PURE__ */ p(Ir, {
3796
+ children: /* @__PURE__ */ p(Nr, {
3843
3797
  my: "md",
3844
3798
  withTableBorder: !0,
3845
3799
  borderRadius: "md",
@@ -3848,20 +3802,20 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
3848
3802
  horizontalSpacing: "md",
3849
3803
  minHeight: 150,
3850
3804
  fetching: je,
3851
- records: qe,
3852
- sortStatus: H,
3853
- onSortStatusChange: Be,
3805
+ records: Je,
3806
+ sortStatus: ze,
3807
+ onSortStatusChange: Ve,
3854
3808
  ...b && {
3855
- selectedRecords: G,
3856
- onSelectedRecordsChange: K
3809
+ selectedRecords: W,
3810
+ onSelectedRecordsChange: G
3857
3811
  },
3858
- ...x && U.length && {
3859
- totalRecords: U.length,
3860
- recordsPerPage: Ve,
3861
- onPageChange: W,
3862
- page: Ge,
3863
- recordsPerPageOptions: ti,
3864
- onRecordsPerPageChange: Ke,
3812
+ ...x && H.length && {
3813
+ totalRecords: H.length,
3814
+ recordsPerPage: He,
3815
+ onPageChange: U,
3816
+ page: Ke,
3817
+ recordsPerPageOptions: Qr,
3818
+ onRecordsPerPageChange: qe,
3865
3819
  recordsPerPageLabel: "Einträge pro Seite"
3866
3820
  },
3867
3821
  ...z && { rowExpansion: {
@@ -3872,102 +3826,102 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
3872
3826
  children: z.content(e, !1)
3873
3827
  }),
3874
3828
  expanded: {
3875
- recordIds: Xe,
3876
- onRecordIdsChange: Ze
3829
+ recordIds: Ze,
3830
+ onRecordIdsChange: Qe
3877
3831
  },
3878
3832
  ...z.expandable && { expandable: ({ record: e }) => z.expandable(e) }
3879
3833
  } },
3880
- columns: et.map((e) => e.column),
3834
+ columns: tt.map((e) => e.column),
3881
3835
  noRecordsText: "Keine Einträge gefunden",
3882
3836
  onRowClick: oe,
3883
3837
  ...oe && { style: { cursor: "pointer" } }
3884
3838
  })
3885
3839
  }), se && /* @__PURE__ */ p(v, {
3886
3840
  hiddenFrom: "sm",
3887
- children: /* @__PURE__ */ p(ei, {
3888
- records: qe,
3889
- fields: et,
3841
+ children: /* @__PURE__ */ p(Zr, {
3842
+ records: Je,
3843
+ fields: tt,
3890
3844
  onRowClick: oe,
3891
3845
  sort: {
3892
- field: String(H.columnAccessor),
3893
- direction: H.direction,
3846
+ field: String(ze.columnAccessor),
3847
+ direction: ze.direction,
3894
3848
  onSortChange: (e, t) => {
3895
- Be({
3849
+ Ve({
3896
3850
  columnAccessor: e,
3897
3851
  direction: t
3898
3852
  });
3899
3853
  }
3900
3854
  },
3901
- ...x && U.length && { pagination: {
3902
- totalRecords: U.length,
3903
- recordsPerPage: Ve,
3904
- page: Ge,
3905
- onPageChange: W,
3906
- recordsPerPageOptions: ti,
3907
- onRecordsPerPageChange: Ke
3855
+ ...x && H.length && { pagination: {
3856
+ totalRecords: H.length,
3857
+ recordsPerPage: He,
3858
+ page: Ke,
3859
+ onPageChange: U,
3860
+ recordsPerPageOptions: Qr,
3861
+ onRecordsPerPageChange: qe
3908
3862
  } },
3909
3863
  ...z && { rowExpansion: {
3910
3864
  content: z.content,
3911
3865
  expanded: {
3912
- recordIds: Xe,
3913
- onRecordIdsChange: Ze
3866
+ recordIds: Ze,
3867
+ onRecordIdsChange: Qe
3914
3868
  },
3915
3869
  ...z.expandable && { expandable: z.expandable }
3916
3870
  } },
3917
- ...ct.length > 0 && {
3918
- actions: ct,
3871
+ ...lt.length > 0 && {
3872
+ actions: lt,
3919
3873
  canUpdate: I,
3920
3874
  canDelete: L
3921
3875
  }
3922
3876
  })
3923
3877
  })] }),
3924
3878
  /* @__PURE__ */ p(N, {
3925
- opened: rt,
3879
+ opened: it,
3926
3880
  onClose: () => {
3927
- q(!1), K([]);
3881
+ K(!1), G([]);
3928
3882
  },
3929
3883
  title: e ?? "Bearbeiten",
3930
- children: G.length > 0 && /* @__PURE__ */ p(Lr, {
3884
+ children: W.length > 0 && /* @__PURE__ */ p(Pr, {
3931
3885
  fields: h.filter((e) => e.update),
3932
3886
  queryKey: n,
3933
3887
  connectedQueryKeys: r,
3934
3888
  apiPath: ye,
3935
- id: G[0].id,
3889
+ id: W[0].id,
3936
3890
  onClose: () => {
3937
- q(!1), K([]);
3891
+ K(!1), G([]);
3938
3892
  },
3939
3893
  steps: D
3940
3894
  })
3941
3895
  }),
3942
- G.length > 0 && /* @__PURE__ */ p(N, {
3943
- opened: it,
3896
+ W.length > 0 && /* @__PURE__ */ p(N, {
3897
+ opened: at,
3944
3898
  onClose: () => {
3945
- J(!1), K([]);
3899
+ q(!1), G([]);
3946
3900
  },
3947
3901
  title: e ?? "Löschen",
3948
- children: /* @__PURE__ */ p(Rr, {
3902
+ children: /* @__PURE__ */ p(Fr, {
3949
3903
  onClose: () => {
3950
- J(!1), K([]);
3904
+ q(!1), G([]);
3951
3905
  },
3952
3906
  queryKey: n,
3953
3907
  connectedQueryKeys: r,
3954
3908
  apiPath: ye,
3955
- selectedRecords: G,
3909
+ selectedRecords: W,
3956
3910
  confirmMessage: ce
3957
3911
  })
3958
3912
  }),
3959
3913
  /* @__PURE__ */ p(N, {
3960
- opened: tt,
3914
+ opened: nt,
3961
3915
  onClose: () => {
3962
- nt(!1);
3916
+ rt(!1);
3963
3917
  },
3964
3918
  title: e ?? "Anlegen",
3965
- children: /* @__PURE__ */ p(an, {
3919
+ children: /* @__PURE__ */ p(tn, {
3966
3920
  queryKey: n,
3967
3921
  connectedQueryKeys: r,
3968
3922
  apiPath: ye,
3969
3923
  onClose: () => {
3970
- nt(!1);
3924
+ rt(!1);
3971
3925
  },
3972
3926
  fields: h.filter((e) => e.create),
3973
3927
  steps: D
@@ -3977,24 +3931,28 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
3977
3931
  }
3978
3932
  //#endregion
3979
3933
  //#region src/DataTable/SubTable.tsx
3980
- function ri({ mobile: e, columns: t, ...n }) {
3981
- return e ? /* @__PURE__ */ p(re, {
3982
- gap: "sm",
3983
- style: { fontVariantNumeric: "tabular-nums" },
3984
- children: (n.records ?? []).map((e, r) => {
3985
- let i = t.filter((t) => !t.hidden && !t.hideOnMobile?.(e)).map((t) => ({
3986
- label: t.title ?? gn(String(t.accessor)),
3987
- value: t.render ? t.render(e, r) : xn(e, t.accessor)
3988
- })), a = n.idAccessor ? Q(e, n.idAccessor) : r;
3989
- return /* @__PURE__ */ p(Zr, { rows: i }, a);
3990
- })
3991
- }) : /* @__PURE__ */ p(Ir, {
3934
+ function ei({ mobile: e, columns: t, ...n }) {
3935
+ if (e) {
3936
+ let e = n.records ?? [];
3937
+ return /* @__PURE__ */ p(re, {
3938
+ gap: "sm",
3939
+ style: { fontVariantNumeric: "tabular-nums" },
3940
+ children: e.map((e, r) => {
3941
+ let i = t.filter((t) => !t.hidden && !t.hideOnMobile?.(e)).map((t) => ({
3942
+ label: t.title ?? pn(String(t.accessor)),
3943
+ value: t.render ? t.render(e, r) : vn(e, t.accessor)
3944
+ })), a = n.idAccessor ? Q(e, n.idAccessor) : r;
3945
+ return /* @__PURE__ */ p(Jr, { rows: i }, a);
3946
+ })
3947
+ });
3948
+ }
3949
+ return /* @__PURE__ */ p(Nr, {
3992
3950
  backgroundColor: "transparent",
3993
3951
  columns: t,
3994
3952
  ...n
3995
3953
  });
3996
3954
  }
3997
3955
  //#endregion
3998
- export { an as CreateModal, ni as DataTable, jt as DataTableProvider, Rr as DeleteModal, Zr as FieldCard, ei as MobileCardList, ri as SubTable, Lr as UpdateModal, Vt as api, Bt as createOne, zt as deleteOne, Lt as getAll, Rt as getOne, Ur as sortData, Ht as updateOne, Kt as useAddOne, Mt as useDataTable, Jt as useDeleteOne, Wt as useGetAll, Ut as useGetOne, zr as usePersistentState, qt as useUpdateOne };
3956
+ export { tn as CreateModal, $r as DataTable, Ot as DataTableProvider, Fr as DeleteModal, Jr as FieldCard, Zr as MobileCardList, ei as SubTable, Pr as UpdateModal, Rt as api, Lt as createOne, It as deleteOne, Pt as getAll, Ft as getOne, Br as sortData, zt as updateOne, Ut as useAddOne, kt as useDataTable, Gt as useDeleteOne, Vt as useGetAll, Bt as useGetOne, Ir as usePersistentState, Wt as useUpdateOne };
3999
3957
 
4000
3958
  //# sourceMappingURL=index.es.js.map