@pravinrd/awesome-grid 0.2.2 → 0.2.3

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-lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import Mt, { useRef as ae, useState as y, useDeferredValue as Pt, useTransition as It, useMemo as H, useEffect as $, useCallback as we, useLayoutEffect as ut } from "react";
2
- var Fe = { exports: {} }, Se = {};
1
+ import Mt, { useRef as ae, useState as y, useDeferredValue as Dt, useTransition as Pt, useMemo as H, useEffect as $, useCallback as _e, useLayoutEffect as ut } from "react";
2
+ var Be = { exports: {} }, Se = {};
3
3
  /**
4
4
  * @license React
5
5
  * react-jsx-runtime.production.js
@@ -10,22 +10,22 @@ var Fe = { exports: {} }, Se = {};
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
12
  var dt;
13
- function $t() {
13
+ function It() {
14
14
  if (dt) return Se;
15
15
  dt = 1;
16
- var u = Symbol.for("react.transitional.element"), x = Symbol.for("react.fragment");
17
- function v(O, j, N) {
16
+ var c = Symbol.for("react.transitional.element"), x = Symbol.for("react.fragment");
17
+ function v(O, k, N) {
18
18
  var z = null;
19
- if (N !== void 0 && (z = "" + N), j.key !== void 0 && (z = "" + j.key), "key" in j) {
19
+ if (N !== void 0 && (z = "" + N), k.key !== void 0 && (z = "" + k.key), "key" in k) {
20
20
  N = {};
21
- for (var Y in j)
22
- Y !== "key" && (N[Y] = j[Y]);
23
- } else N = j;
24
- return j = N.ref, {
25
- $$typeof: u,
21
+ for (var Y in k)
22
+ Y !== "key" && (N[Y] = k[Y]);
23
+ } else N = k;
24
+ return k = N.ref, {
25
+ $$typeof: c,
26
26
  type: O,
27
27
  key: z,
28
- ref: j !== void 0 ? j : null,
28
+ ref: k !== void 0 ? k : null,
29
29
  props: N
30
30
  };
31
31
  }
@@ -42,166 +42,166 @@ var Ce = {};
42
42
  * LICENSE file in the root directory of this source tree.
43
43
  */
44
44
  var ht;
45
- function Lt() {
45
+ function $t() {
46
46
  return ht || (ht = 1, process.env.NODE_ENV !== "production" && (function() {
47
- function u(o) {
48
- if (o == null) return null;
49
- if (typeof o == "function")
50
- return o.$$typeof === S ? null : o.displayName || o.name || null;
51
- if (typeof o == "string") return o;
52
- switch (o) {
47
+ function c(n) {
48
+ if (n == null) return null;
49
+ if (typeof n == "function")
50
+ return n.$$typeof === j ? null : n.displayName || n.name || null;
51
+ if (typeof n == "string") return n;
52
+ switch (n) {
53
53
  case be:
54
54
  return "Fragment";
55
- case Ge:
55
+ case ze:
56
56
  return "Profiler";
57
- case g:
57
+ case p:
58
58
  return "StrictMode";
59
59
  case xe:
60
60
  return "Suspense";
61
61
  case X:
62
62
  return "SuspenseList";
63
- case Ve:
63
+ case Ge:
64
64
  return "Activity";
65
65
  }
66
- if (typeof o == "object")
67
- switch (typeof o.tag == "number" && console.error(
66
+ if (typeof n == "object")
67
+ switch (typeof n.tag == "number" && console.error(
68
68
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
69
- ), o.$$typeof) {
69
+ ), n.$$typeof) {
70
70
  case ie:
71
71
  return "Portal";
72
- case te:
73
- return o.displayName || "Context";
74
- case L:
75
- return (o._context.displayName || "Context") + ".Consumer";
72
+ case ee:
73
+ return n.displayName || "Context";
74
+ case F:
75
+ return (n._context.displayName || "Context") + ".Consumer";
76
76
  case ye:
77
- var c = o.render;
78
- return o = o.displayName, o || (o = c.displayName || c.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
77
+ var i = n.render;
78
+ return n = n.displayName, n || (n = i.displayName || i.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n;
79
79
  case G:
80
- return c = o.displayName || null, c !== null ? c : u(o.type) || "Memo";
81
- case re:
82
- c = o._payload, o = o._init;
80
+ return i = n.displayName || null, i !== null ? i : c(n.type) || "Memo";
81
+ case te:
82
+ i = n._payload, n = n._init;
83
83
  try {
84
- return u(o(c));
84
+ return c(n(i));
85
85
  } catch {
86
86
  }
87
87
  }
88
88
  return null;
89
89
  }
90
- function x(o) {
91
- return "" + o;
90
+ function x(n) {
91
+ return "" + n;
92
92
  }
93
- function v(o) {
93
+ function v(n) {
94
94
  try {
95
- x(o);
96
- var c = !1;
95
+ x(n);
96
+ var i = !1;
97
97
  } catch {
98
- c = !0;
98
+ i = !0;
99
99
  }
100
- if (c) {
101
- c = console;
102
- var f = c.error, _ = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
103
- return f.call(
104
- c,
100
+ if (i) {
101
+ i = console;
102
+ var g = i.error, _ = typeof Symbol == "function" && Symbol.toStringTag && n[Symbol.toStringTag] || n.constructor.name || "Object";
103
+ return g.call(
104
+ i,
105
105
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
106
106
  _
107
- ), x(o);
107
+ ), x(n);
108
108
  }
109
109
  }
110
- function O(o) {
111
- if (o === be) return "<>";
112
- if (typeof o == "object" && o !== null && o.$$typeof === re)
110
+ function O(n) {
111
+ if (n === be) return "<>";
112
+ if (typeof n == "object" && n !== null && n.$$typeof === te)
113
113
  return "<...>";
114
114
  try {
115
- var c = u(o);
116
- return c ? "<" + c + ">" : "<...>";
115
+ var i = c(n);
116
+ return i ? "<" + i + ">" : "<...>";
117
117
  } catch {
118
118
  return "<...>";
119
119
  }
120
120
  }
121
- function j() {
122
- var o = ve.A;
123
- return o === null ? null : o.getOwner();
121
+ function k() {
122
+ var n = ve.A;
123
+ return n === null ? null : n.getOwner();
124
124
  }
125
125
  function N() {
126
126
  return Error("react-stack-top-frame");
127
127
  }
128
- function z(o) {
129
- if (Oe.call(o, "key")) {
130
- var c = Object.getOwnPropertyDescriptor(o, "key").get;
131
- if (c && c.isReactWarning) return !1;
128
+ function z(n) {
129
+ if (Oe.call(n, "key")) {
130
+ var i = Object.getOwnPropertyDescriptor(n, "key").get;
131
+ if (i && i.isReactWarning) return !1;
132
132
  }
133
- return o.key !== void 0;
133
+ return n.key !== void 0;
134
134
  }
135
- function Y(o, c) {
136
- function f() {
137
- ne || (ne = !0, console.error(
135
+ function Y(n, i) {
136
+ function g() {
137
+ re || (re = !0, console.error(
138
138
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
139
- c
139
+ i
140
140
  ));
141
141
  }
142
- f.isReactWarning = !0, Object.defineProperty(o, "key", {
143
- get: f,
142
+ g.isReactWarning = !0, Object.defineProperty(n, "key", {
143
+ get: g,
144
144
  configurable: !0
145
145
  });
146
146
  }
147
- function _e() {
148
- var o = u(this.type);
149
- return ce[o] || (ce[o] = !0, console.error(
147
+ function we() {
148
+ var n = c(this.type);
149
+ return ce[n] || (ce[n] = !0, console.error(
150
150
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
151
- )), o = this.props.ref, o !== void 0 ? o : null;
151
+ )), n = this.props.ref, n !== void 0 ? n : null;
152
152
  }
153
- function se(o, c, f, _, B, de) {
154
- var b = f.ref;
155
- return o = {
153
+ function se(n, i, g, _, L, de) {
154
+ var w = g.ref;
155
+ return n = {
156
156
  $$typeof: Ee,
157
- type: o,
158
- key: c,
159
- props: f,
157
+ type: n,
158
+ key: i,
159
+ props: g,
160
160
  _owner: _
161
- }, (b !== void 0 ? b : null) !== null ? Object.defineProperty(o, "ref", {
161
+ }, (w !== void 0 ? w : null) !== null ? Object.defineProperty(n, "ref", {
162
162
  enumerable: !1,
163
- get: _e
164
- }) : Object.defineProperty(o, "ref", { enumerable: !1, value: null }), o._store = {}, Object.defineProperty(o._store, "validated", {
163
+ get: we
164
+ }) : Object.defineProperty(n, "ref", { enumerable: !1, value: null }), n._store = {}, Object.defineProperty(n._store, "validated", {
165
165
  configurable: !1,
166
166
  enumerable: !1,
167
167
  writable: !0,
168
168
  value: 0
169
- }), Object.defineProperty(o, "_debugInfo", {
169
+ }), Object.defineProperty(n, "_debugInfo", {
170
170
  configurable: !1,
171
171
  enumerable: !1,
172
172
  writable: !0,
173
173
  value: null
174
- }), Object.defineProperty(o, "_debugStack", {
174
+ }), Object.defineProperty(n, "_debugStack", {
175
175
  configurable: !1,
176
176
  enumerable: !1,
177
177
  writable: !0,
178
- value: B
179
- }), Object.defineProperty(o, "_debugTask", {
178
+ value: L
179
+ }), Object.defineProperty(n, "_debugTask", {
180
180
  configurable: !1,
181
181
  enumerable: !1,
182
182
  writable: !0,
183
183
  value: de
184
- }), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
184
+ }), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
185
185
  }
186
- function ee(o, c, f, _, B, de) {
187
- var b = c.children;
188
- if (b !== void 0)
186
+ function Q(n, i, g, _, L, de) {
187
+ var w = i.children;
188
+ if (w !== void 0)
189
189
  if (_)
190
- if (Ae(b)) {
191
- for (_ = 0; _ < b.length; _++)
192
- le(b[_]);
193
- Object.freeze && Object.freeze(b);
190
+ if (Ae(w)) {
191
+ for (_ = 0; _ < w.length; _++)
192
+ le(w[_]);
193
+ Object.freeze && Object.freeze(w);
194
194
  } else
195
195
  console.error(
196
196
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
197
197
  );
198
- else le(b);
199
- if (Oe.call(c, "key")) {
200
- b = u(o);
201
- var C = Object.keys(c).filter(function(U) {
198
+ else le(w);
199
+ if (Oe.call(i, "key")) {
200
+ w = c(n);
201
+ var S = Object.keys(i).filter(function(U) {
202
202
  return U !== "key";
203
203
  });
204
- _ = 0 < C.length ? "{key: someKey, " + C.join(": ..., ") + ": ...}" : "{key: someKey}", oe[b + _] || (C = 0 < C.length ? "{" + C.join(": ..., ") + ": ...}" : "{}", console.error(
204
+ _ = 0 < S.length ? "{key: someKey, " + S.join(": ..., ") + ": ...}" : "{key: someKey}", ne[w + _] || (S = 0 < S.length ? "{" + S.join(": ..., ") + ": ...}" : "{}", console.error(
205
205
  `A props object containing a "key" prop is being spread into JSX:
206
206
  let props = %s;
207
207
  <%s {...props} />
@@ -209,146 +209,145 @@ React keys must be passed directly to JSX without using spread:
209
209
  let props = %s;
210
210
  <%s key={someKey} {...props} />`,
211
211
  _,
212
- b,
213
- C,
214
- b
215
- ), oe[b + _] = !0);
212
+ w,
213
+ S,
214
+ w
215
+ ), ne[w + _] = !0);
216
216
  }
217
- if (b = null, f !== void 0 && (v(f), b = "" + f), z(c) && (v(c.key), b = "" + c.key), "key" in c) {
218
- f = {};
219
- for (var ke in c)
220
- ke !== "key" && (f[ke] = c[ke]);
221
- } else f = c;
222
- return b && Y(
223
- f,
224
- typeof o == "function" ? o.displayName || o.name || "Unknown" : o
217
+ if (w = null, g !== void 0 && (v(g), w = "" + g), z(i) && (v(i.key), w = "" + i.key), "key" in i) {
218
+ g = {};
219
+ for (var ke in i)
220
+ ke !== "key" && (g[ke] = i[ke]);
221
+ } else g = i;
222
+ return w && Y(
223
+ g,
224
+ typeof n == "function" ? n.displayName || n.name || "Unknown" : n
225
225
  ), se(
226
- o,
227
- b,
228
- f,
229
- j(),
230
- B,
226
+ n,
227
+ w,
228
+ g,
229
+ k(),
230
+ L,
231
231
  de
232
232
  );
233
233
  }
234
- function le(o) {
235
- Re(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === re && (o._payload.status === "fulfilled" ? Re(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
234
+ function le(n) {
235
+ Te(n) ? n._store && (n._store.validated = 1) : typeof n == "object" && n !== null && n.$$typeof === te && (n._payload.status === "fulfilled" ? Te(n._payload.value) && n._payload.value._store && (n._payload.value._store.validated = 1) : n._store && (n._store.validated = 1));
236
236
  }
237
- function Re(o) {
238
- return typeof o == "object" && o !== null && o.$$typeof === Ee;
237
+ function Te(n) {
238
+ return typeof n == "object" && n !== null && n.$$typeof === Ee;
239
239
  }
240
- var J = Mt, Ee = Symbol.for("react.transitional.element"), ie = Symbol.for("react.portal"), be = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), Ge = Symbol.for("react.profiler"), L = Symbol.for("react.consumer"), te = Symbol.for("react.context"), ye = Symbol.for("react.forward_ref"), xe = Symbol.for("react.suspense"), X = Symbol.for("react.suspense_list"), G = Symbol.for("react.memo"), re = Symbol.for("react.lazy"), Ve = Symbol.for("react.activity"), S = Symbol.for("react.client.reference"), ve = J.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Oe = Object.prototype.hasOwnProperty, Ae = Array.isArray, R = console.createTask ? console.createTask : function() {
240
+ var J = Mt, Ee = Symbol.for("react.transitional.element"), ie = Symbol.for("react.portal"), be = Symbol.for("react.fragment"), p = Symbol.for("react.strict_mode"), ze = Symbol.for("react.profiler"), F = Symbol.for("react.consumer"), ee = Symbol.for("react.context"), ye = Symbol.for("react.forward_ref"), xe = Symbol.for("react.suspense"), X = Symbol.for("react.suspense_list"), G = Symbol.for("react.memo"), te = Symbol.for("react.lazy"), Ge = Symbol.for("react.activity"), j = Symbol.for("react.client.reference"), ve = J.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Oe = Object.prototype.hasOwnProperty, Ae = Array.isArray, T = console.createTask ? console.createTask : function() {
241
241
  return null;
242
242
  };
243
243
  J = {
244
- react_stack_bottom_frame: function(o) {
245
- return o();
244
+ react_stack_bottom_frame: function(n) {
245
+ return n();
246
246
  }
247
247
  };
248
- var ne, ce = {}, ue = J.react_stack_bottom_frame.bind(
248
+ var re, ce = {}, ue = J.react_stack_bottom_frame.bind(
249
249
  J,
250
250
  N
251
- )(), V = R(O(N)), oe = {};
252
- Ce.Fragment = be, Ce.jsx = function(o, c, f) {
251
+ )(), V = T(O(N)), ne = {};
252
+ Ce.Fragment = be, Ce.jsx = function(n, i, g) {
253
253
  var _ = 1e4 > ve.recentlyCreatedOwnerStacks++;
254
- return ee(
255
- o,
256
- c,
257
- f,
254
+ return Q(
255
+ n,
256
+ i,
257
+ g,
258
258
  !1,
259
259
  _ ? Error("react-stack-top-frame") : ue,
260
- _ ? R(O(o)) : V
260
+ _ ? T(O(n)) : V
261
261
  );
262
- }, Ce.jsxs = function(o, c, f) {
262
+ }, Ce.jsxs = function(n, i, g) {
263
263
  var _ = 1e4 > ve.recentlyCreatedOwnerStacks++;
264
- return ee(
265
- o,
266
- c,
267
- f,
264
+ return Q(
265
+ n,
266
+ i,
267
+ g,
268
268
  !0,
269
269
  _ ? Error("react-stack-top-frame") : ue,
270
- _ ? R(O(o)) : V
270
+ _ ? T(O(n)) : V
271
271
  );
272
272
  };
273
273
  })()), Ce;
274
274
  }
275
275
  var mt;
276
- function Bt() {
277
- return mt || (mt = 1, process.env.NODE_ENV === "production" ? Fe.exports = $t() : Fe.exports = Lt()), Fe.exports;
276
+ function Lt() {
277
+ return mt || (mt = 1, process.env.NODE_ENV === "production" ? Be.exports = It() : Be.exports = $t()), Be.exports;
278
278
  }
279
- var r = Bt();
280
- const Ft = "_container_dihwe_1", Wt = "_themeLight_dihwe_10", zt = "_themeDark_dihwe_29", Gt = "_themePurple_dihwe_48", Vt = "_headerRow_dihwe_67", Ut = "_flexRow_dihwe_76", Ht = "_toolbarGroup_dihwe_82", Yt = "_dropdown_dihwe_86", Jt = "_buttonBase_dihwe_90", Xt = "_buttonPrimary_dihwe_101", qt = "_buttonDanger_dihwe_111", Kt = "_buttonMuted_dihwe_121", Zt = "_dropdownToggle_dihwe_142", Qt = "_dropdownMenu_dihwe_147", er = "_dropdownMenuOpen_dihwe_163", tr = "_menuItemButton_dihwe_167", rr = "_labelMuted_dihwe_185", nr = "_selectSmall_dihwe_190", or = "_selectAuto_dihwe_199", ar = "_switchRow_dihwe_203", sr = "_groupingSummary_dihwe_210", lr = "_relative_dihwe_217", ir = "_overlay_dihwe_221", cr = "_overlayInner_dihwe_229", ur = "_spinner_dihwe_236", dr = "_tableWrap_dihwe_252", hr = "_tableWrapAll_dihwe_256", mr = "_table_dihwe_252", pr = "_tableHead_dihwe_278", gr = "_thCellTop_dihwe_282", fr = "_thCellFilter_dihwe_290", wr = "_thInner_dihwe_297", _r = "_resizeHandle_dihwe_303", br = "_sortButton_dihwe_328", yr = "_iconMuted_dihwe_338", xr = "_inlineGroup_dihwe_342", vr = "_input_dihwe_350", kr = "_rowInteractive_dihwe_362", jr = "_groupRow_dihwe_375", Nr = "_groupRowAnimated_dihwe_382", Sr = "_groupChildRow_dihwe_386", Cr = "_groupToggle_dihwe_390", Tr = "_groupMeta_dihwe_430", Rr = "_checkbox_dihwe_438", Er = "_dangerText_dihwe_443", Or = "_tfoot_dihwe_447", Ar = "_textCenter_dihwe_455", Dr = "_paginationWrap_dihwe_459", Mr = "_pagination_dihwe_459", Pr = "_pageButton_dihwe_473", Ir = "_pageButtonActive_dihwe_488", $r = "_backdrop_dihwe_494", Lr = "_drawer_dihwe_500", Br = "_drawerTitle_dihwe_515", Fr = "_drawerSection_dihwe_521", Wr = "_drawerSubtitle_dihwe_527", zr = "_sectionToggle_dihwe_534", Gr = "_sectionBody_dihwe_547", Vr = "_drawerRow_dihwe_551", Ur = "_spacerAuto_dihwe_558", Hr = "_successText_dihwe_562", Yr = "_srOnly_dihwe_570", a = {
281
- container: Ft,
279
+ var r = Lt();
280
+ const Bt = "_container_dihwe_1", Wt = "_themeLight_dihwe_10", Ft = "_themeDark_dihwe_29", zt = "_themePurple_dihwe_48", Gt = "_headerRow_dihwe_67", Vt = "_flexRow_dihwe_76", Ut = "_toolbarGroup_dihwe_82", Ht = "_dropdown_dihwe_86", Yt = "_buttonBase_dihwe_90", Jt = "_buttonPrimary_dihwe_101", Xt = "_buttonDanger_dihwe_111", qt = "_buttonMuted_dihwe_121", Kt = "_dropdownToggle_dihwe_142", Zt = "_dropdownMenu_dihwe_147", Qt = "_dropdownMenuOpen_dihwe_163", er = "_menuItemButton_dihwe_167", tr = "_labelMuted_dihwe_185", rr = "_selectSmall_dihwe_190", nr = "_selectAuto_dihwe_199", or = "_switchRow_dihwe_203", ar = "_groupingSummary_dihwe_210", sr = "_relative_dihwe_217", lr = "_overlay_dihwe_221", ir = "_overlayInner_dihwe_229", cr = "_spinner_dihwe_236", ur = "_tableWrap_dihwe_252", dr = "_tableWrapAll_dihwe_256", hr = "_table_dihwe_252", mr = "_tableHead_dihwe_278", pr = "_thCellTop_dihwe_282", gr = "_thCellFilter_dihwe_290", fr = "_thInner_dihwe_297", _r = "_resizeHandle_dihwe_303", wr = "_sortButton_dihwe_328", br = "_iconMuted_dihwe_338", yr = "_inlineGroup_dihwe_342", xr = "_input_dihwe_350", vr = "_rowInteractive_dihwe_362", kr = "_groupRow_dihwe_375", Nr = "_groupRowAnimated_dihwe_382", jr = "_groupChildRow_dihwe_386", Sr = "_groupToggle_dihwe_390", Cr = "_groupMeta_dihwe_430", Rr = "_checkbox_dihwe_438", Tr = "_tfoot_dihwe_447", Er = "_textCenter_dihwe_455", Or = "_paginationWrap_dihwe_459", Ar = "_pagination_dihwe_459", Mr = "_pageButton_dihwe_473", Dr = "_pageButtonActive_dihwe_488", Pr = "_backdrop_dihwe_494", Ir = "_drawer_dihwe_500", $r = "_drawerTitle_dihwe_515", Lr = "_drawerSection_dihwe_521", Br = "_drawerSubtitle_dihwe_527", Wr = "_sectionToggle_dihwe_534", Fr = "_sectionBody_dihwe_547", zr = "_drawerRow_dihwe_551", Gr = "_spacerAuto_dihwe_558", Vr = "_successText_dihwe_562", Ur = "_srOnly_dihwe_570", a = {
281
+ container: Bt,
282
282
  themeLight: Wt,
283
- themeDark: zt,
284
- themePurple: Gt,
285
- headerRow: Vt,
286
- flexRow: Ut,
287
- toolbarGroup: Ht,
288
- dropdown: Yt,
289
- buttonBase: Jt,
290
- buttonPrimary: Xt,
291
- buttonDanger: qt,
292
- buttonMuted: Kt,
293
- dropdownToggle: Zt,
294
- dropdownMenu: Qt,
295
- dropdownMenuOpen: er,
296
- menuItemButton: tr,
297
- labelMuted: rr,
298
- selectSmall: nr,
299
- selectAuto: or,
300
- switchRow: ar,
301
- groupingSummary: sr,
302
- relative: lr,
303
- overlay: ir,
304
- overlayInner: cr,
305
- spinner: ur,
306
- tableWrap: dr,
307
- tableWrapAll: hr,
308
- table: mr,
309
- tableHead: pr,
310
- thCellTop: gr,
311
- thCellFilter: fr,
312
- thInner: wr,
283
+ themeDark: Ft,
284
+ themePurple: zt,
285
+ headerRow: Gt,
286
+ flexRow: Vt,
287
+ toolbarGroup: Ut,
288
+ dropdown: Ht,
289
+ buttonBase: Yt,
290
+ buttonPrimary: Jt,
291
+ buttonDanger: Xt,
292
+ buttonMuted: qt,
293
+ dropdownToggle: Kt,
294
+ dropdownMenu: Zt,
295
+ dropdownMenuOpen: Qt,
296
+ menuItemButton: er,
297
+ labelMuted: tr,
298
+ selectSmall: rr,
299
+ selectAuto: nr,
300
+ switchRow: or,
301
+ groupingSummary: ar,
302
+ relative: sr,
303
+ overlay: lr,
304
+ overlayInner: ir,
305
+ spinner: cr,
306
+ tableWrap: ur,
307
+ tableWrapAll: dr,
308
+ table: hr,
309
+ tableHead: mr,
310
+ thCellTop: pr,
311
+ thCellFilter: gr,
312
+ thInner: fr,
313
313
  resizeHandle: _r,
314
- sortButton: br,
315
- iconMuted: yr,
316
- inlineGroup: xr,
317
- input: vr,
318
- rowInteractive: kr,
319
- groupRow: jr,
314
+ sortButton: wr,
315
+ iconMuted: br,
316
+ inlineGroup: yr,
317
+ input: xr,
318
+ rowInteractive: vr,
319
+ groupRow: kr,
320
320
  groupRowAnimated: Nr,
321
- groupChildRow: Sr,
322
- groupToggle: Cr,
323
- groupMeta: Tr,
321
+ groupChildRow: jr,
322
+ groupToggle: Sr,
323
+ groupMeta: Cr,
324
324
  checkbox: Rr,
325
- dangerText: Er,
326
- tfoot: Or,
327
- textCenter: Ar,
328
- paginationWrap: Dr,
329
- pagination: Mr,
330
- pageButton: Pr,
331
- pageButtonActive: Ir,
332
- backdrop: $r,
333
- drawer: Lr,
334
- drawerTitle: Br,
335
- drawerSection: Fr,
336
- drawerSubtitle: Wr,
337
- sectionToggle: zr,
338
- sectionBody: Gr,
339
- drawerRow: Vr,
340
- spacerAuto: Ur,
341
- successText: Hr,
342
- srOnly: Yr
343
- }, E = (...u) => u.filter(Boolean).join(" ");
344
- function pt({ label: u, children: x }) {
345
- const [v, O] = y(!1), j = ae(null);
325
+ tfoot: Tr,
326
+ textCenter: Er,
327
+ paginationWrap: Or,
328
+ pagination: Ar,
329
+ pageButton: Mr,
330
+ pageButtonActive: Dr,
331
+ backdrop: Pr,
332
+ drawer: Ir,
333
+ drawerTitle: $r,
334
+ drawerSection: Lr,
335
+ drawerSubtitle: Br,
336
+ sectionToggle: Wr,
337
+ sectionBody: Fr,
338
+ drawerRow: zr,
339
+ spacerAuto: Gr,
340
+ successText: Vr,
341
+ srOnly: Ur
342
+ }, E = (...c) => c.filter(Boolean).join(" ");
343
+ function pt({ label: c, children: x }) {
344
+ const [v, O] = y(!1), k = ae(null);
346
345
  return $(() => {
347
346
  const N = (z) => {
348
- j.current && !j.current.contains(z.target) && O(!1);
347
+ k.current && !k.current.contains(z.target) && O(!1);
349
348
  };
350
349
  return document.addEventListener("mousedown", N), () => document.removeEventListener("mousedown", N);
351
- }, []), /* @__PURE__ */ r.jsxs("div", { className: a.dropdown, ref: j, children: [
350
+ }, []), /* @__PURE__ */ r.jsxs("div", { className: a.dropdown, ref: k, children: [
352
351
  /* @__PURE__ */ r.jsx(
353
352
  "button",
354
353
  {
@@ -361,7 +360,7 @@ function pt({ label: u, children: x }) {
361
360
  "aria-haspopup": "menu",
362
361
  "aria-expanded": v,
363
362
  onClick: () => O(!v),
364
- children: u
363
+ children: c
365
364
  }
366
365
  ),
367
366
  /* @__PURE__ */ r.jsx(
@@ -375,37 +374,37 @@ function pt({ label: u, children: x }) {
375
374
  )
376
375
  ] });
377
376
  }
378
- const Xe = (u, x = "14px system-ui") => {
379
- const O = (Xe.canvas || (Xe.canvas = document.createElement("canvas"))).getContext("2d");
380
- return O.font = x, O.measureText(u).width;
381
- }, Te = (u) => u.toLowerCase().replace(/[_\s]+(.)?/g, (x, v) => v ? v.toUpperCase() : "").replace(/^(.)/, (x) => x.toLowerCase()), Jr = (u) => {
382
- if (!u || typeof u != "object") return u;
377
+ const Je = (c, x = "14px system-ui") => {
378
+ const O = (Je.canvas || (Je.canvas = document.createElement("canvas"))).getContext("2d");
379
+ return O.font = x, O.measureText(c).width;
380
+ }, Re = (c) => c.toLowerCase().replace(/[_\s]+(.)?/g, (x, v) => v ? v.toUpperCase() : "").replace(/^(.)/, (x) => x.toLowerCase()), Hr = (c) => {
381
+ if (!c || typeof c != "object") return c;
383
382
  const x = {};
384
- return Object.keys(u).forEach((v) => {
385
- x[Te(v)] = u[v];
383
+ return Object.keys(c).forEach((v) => {
384
+ x[Re(v)] = c[v];
386
385
  }), x;
387
- }, Z = 0, We = 38, gt = 10, Xr = [], ze = 80;
388
- function Kr({
389
- apiEndpoint: u,
386
+ }, K = 0, We = 38, gt = 10, Yr = [], Fe = 80;
387
+ function Xr({
388
+ apiEndpoint: c,
390
389
  rowKey: x,
391
390
  theme: v = "light",
392
- computedColumns: O = Xr,
393
- currency: j = "INR",
391
+ computedColumns: O = Yr,
392
+ currency: k = "INR",
394
393
  dateFormat: N = {
395
394
  locale: "en-US",
396
395
  options: { year: "numeric", month: "2-digit", day: "2-digit" }
397
396
  },
398
397
  dateSeparator: z = "/",
399
398
  pageSizeOptions: Y = [50, 100, 500, 1e3, 0],
400
- defaultPageSize: _e
399
+ defaultPageSize: we
401
400
  }) {
402
- const se = ae(!1), ee = ae(!1), le = ae(!1), Re = 50, [J, Ee] = y(!0), [ie, be] = y([]), [g, Ge] = y([]), [L, te] = y([]), [ye, xe] = y(!1), [X, G] = y(1), re = Array.isArray(Y) && Y.length > 0 ? Y : [50, 100, 500, 1e3, 0], Ve = _e !== void 0 && re.includes(_e) ? _e : re[0] || 50, [S, ve] = y(Ve), [Oe, Ae] = y(!1), [R, ne] = y([]), [ce, ue] = y({}), [V, oe] = y([]), [o, c] = y(() => {
401
+ const se = ae(!1), Q = ae(!1), le = ae(!1), Te = 50, [J, Ee] = y(!0), [ie, be] = y([]), [p, ze] = y([]), [F, ee] = y([]), [ye, xe] = y(!1), [X, G] = y(1), te = Array.isArray(Y) && Y.length > 0 ? Y : [50, 100, 500, 1e3, 0], Ge = we !== void 0 && te.includes(we) ? we : te[0] || 50, [j, ve] = y(Ge), [Oe, Ae] = y(!1), [T, re] = y([]), [ce, ue] = y({}), [V, ne] = y([]), [n, i] = y(() => {
403
402
  const e = String(v || "light").toLowerCase();
404
403
  return e === "dark" || e === "purple" ? e : "light";
405
- }), [f, _] = y({
404
+ }), [g, _] = y({
406
405
  groupBy: !1,
407
406
  aggregates: !1
408
- }), [B, de] = y({}), b = Pt(B), [C, ke] = y({ key: null, direction: "asc" }), [U, je] = y([]), [De, Me] = y({}), [ft, I] = It(), qe = ae(null), [wt, _t] = y(0), Pe = ae(null), [Ke, Ze] = y(0), [Qe, bt] = y(0), he = ae(null), [yt, et] = y(() => typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia("(max-width: 767.98px)").matches), Ue = String(j || "INR").toUpperCase() === "USD" ? "USD" : "INR", tt = Ue === "USD" ? "en-US" : "en-IN", rt = N?.locale || "en-US", nt = H(
407
+ }), [L, de] = y({}), w = Dt(L), [S, ke] = y({ key: null, direction: "asc" }), [U, Ne] = y([]), [Me, De] = y({}), [ft, M] = Pt(), Xe = ae(null), [_t, wt] = y(0), Pe = ae(null), [qe, Ke] = y(0), [Ze, bt] = y(0), he = ae(null), [yt, Qe] = y(() => typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia("(max-width: 767.98px)").matches), Ve = String(k || "INR").toUpperCase() === "USD" ? "USD" : "INR", et = Ve === "USD" ? "en-US" : "en-IN", tt = N?.locale || "en-US", rt = H(
409
408
  () => N?.options || {
410
409
  year: "numeric",
411
410
  month: "2-digit",
@@ -414,489 +413,432 @@ function Kr({
414
413
  [N]
415
414
  );
416
415
  $(() => {
417
- S > 100 && xe(!0);
418
- }, [S]), $(() => {
416
+ j > 100 && xe(!0);
417
+ }, [j]), $(() => {
419
418
  let e = !0;
420
419
  const t = new AbortController();
421
420
  return (async () => {
422
421
  try {
423
422
  xe(!0);
424
- const n = new URLSearchParams({
423
+ const o = new URLSearchParams({
425
424
  page: String(X),
426
- pageSize: String(S)
427
- }), s = await fetch(`${u}?${n.toString()}`, {
425
+ pageSize: String(j)
426
+ }), s = await fetch(`${c}?${o.toString()}`, {
428
427
  signal: t.signal
429
428
  });
430
429
  if (!s.ok)
431
430
  throw new Error(`Request failed: ${s.status} ${s.statusText}`);
432
431
  const l = await s.json();
433
432
  if (!e) return;
434
- const i = (Array.isArray(l?.data) ? l.data : []).map((m) => Jr(m)), p = l?.columns || [], w = O.filter((m) => m && m.key && typeof m.formula == "function").map((m) => ({
435
- key: Te(m.key),
433
+ const d = (Array.isArray(l?.data) ? l.data : []).map((m) => Hr(m)), f = l?.columns || [], b = O.filter((m) => m && m.key && typeof m.formula == "function").map((m) => ({
434
+ key: Re(m.key),
436
435
  label: m.label || m.key,
437
436
  formula: m.formula
438
- })), h = p.map((m) => {
439
- const T = typeof m == "string" ? m : m.key;
437
+ })), h = f.map((m) => {
438
+ const R = typeof m == "string" ? m : m.key;
440
439
  return {
441
- key: Te(T),
442
- label: m.label || T.replace(/_/g, " ").replace(/\b\w/g, (W) => W.toUpperCase())
440
+ key: Re(R),
441
+ label: m.label || R.replace(/_/g, " ").replace(/\b\w/g, (W) => W.toUpperCase())
443
442
  };
444
- }), k = [
443
+ }), C = [
445
444
  ...h,
446
- ...w.filter((m) => !h.some((T) => T.key === m.key)).map(({ key: m, label: T }) => ({ key: m, label: T }))
447
- ], A = i.map((m) => {
448
- const T = { ...m };
449
- return w.forEach((W) => {
445
+ ...b.filter((m) => !h.some((R) => R.key === m.key)).map(({ key: m, label: R }) => ({ key: m, label: R }))
446
+ ], A = d.map((m) => {
447
+ const R = { ...m };
448
+ return b.forEach((W) => {
450
449
  try {
451
- T[W.key] = W.formula(m);
450
+ R[W.key] = W.formula(m);
452
451
  } catch (fe) {
453
- T[W.key] = "", console.error(`Failed computed column formula for '${W.key}'`, fe);
452
+ R[W.key] = "", console.error(`Failed computed column formula for '${W.key}'`, fe);
454
453
  }
455
- }), T;
454
+ }), R;
456
455
  });
457
- if (be(A), Ge(k), !se.current) {
458
- const m = k.map((T) => T.key);
459
- te(m), je(m), se.current = !0;
456
+ if (be(A), ze(C), !se.current) {
457
+ const m = C.map((R) => R.key);
458
+ ee(m), Ne(m), se.current = !0;
460
459
  }
461
- } catch (n) {
462
- if (n?.name === "AbortError") return;
463
- console.error("Failed to load grid data", n);
460
+ } catch (o) {
461
+ if (o?.name === "AbortError") return;
462
+ console.error("Failed to load grid data", o);
464
463
  } finally {
465
464
  e && xe(!1);
466
465
  }
467
466
  })(), () => {
468
467
  e = !1, t.abort();
469
468
  };
470
- }, [u, X, S, O]), $(() => {
471
- if (g.length > 0 && L.length === 0) {
472
- const e = g.map((t) => t.key);
473
- te(e), je(e), se.current = !0;
469
+ }, [c, X, j, O]), $(() => {
470
+ if (p.length > 0 && F.length === 0) {
471
+ const e = p.map((t) => t.key);
472
+ ee(e), Ne(e), se.current = !0;
474
473
  }
475
- }, [g, L]), $(() => {
476
- if (!g.length) return;
477
- const e = g.map((t) => t.key);
478
- je((t) => {
479
- const n = t.filter((l) => e.includes(l)), s = e.filter((l) => !n.includes(l));
480
- return [...n, ...s];
481
- }), te((t) => {
474
+ }, [p, F]), $(() => {
475
+ if (!p.length) return;
476
+ const e = p.map((t) => t.key);
477
+ Ne((t) => {
478
+ const o = t.filter((l) => e.includes(l)), s = e.filter((l) => !o.includes(l));
479
+ return [...o, ...s];
480
+ }), ee((t) => {
482
481
  if (!t.length) return e;
483
- const n = t.filter((l) => e.includes(l)), s = e.filter((l) => !n.includes(l));
484
- return [...n, ...s];
482
+ const o = t.filter((l) => e.includes(l)), s = e.filter((l) => !o.includes(l));
483
+ return [...o, ...s];
485
484
  });
486
- }, [g]), $(() => {
487
- if (!g.length) return;
488
- const e = new Set(g.map((t) => t.key));
489
- ne((t) => t.filter((n) => e.has(n)));
490
- }, [g]), $(() => {
485
+ }, [p]), $(() => {
486
+ if (!p.length) return;
487
+ const e = new Set(p.map((t) => t.key));
488
+ re((t) => t.filter((o) => e.has(o)));
489
+ }, [p]), $(() => {
491
490
  const e = () => G(1);
492
491
  return window.addEventListener("refreshTable", e), () => window.removeEventListener("refreshTable", e);
493
492
  }, []), $(() => {
494
- if (!u) return;
495
- ee.current = !1, le.current = !1;
496
- const e = localStorage.getItem(`columnOrder_${u}`), t = localStorage.getItem(`visibleColumns_${u}`), n = localStorage.getItem(`groupByColumns_${u}`), s = localStorage.getItem(`totalColumns_${u}`), l = localStorage.getItem(`theme_${u}`), d = localStorage.getItem(`columnWidths_${u}`);
497
- if (e && (je(JSON.parse(e)), se.current = !0), t && te(JSON.parse(t)), n && ne(JSON.parse(n)), s && (oe(JSON.parse(s)), ee.current = !0), d && Me(JSON.parse(d)), l === "light" || l === "dark" || l === "purple")
498
- c(l);
493
+ if (!c) return;
494
+ Q.current = !1, le.current = !1;
495
+ const e = localStorage.getItem(`columnOrder_${c}`), t = localStorage.getItem(`visibleColumns_${c}`), o = localStorage.getItem(`groupByColumns_${c}`), s = localStorage.getItem(`totalColumns_${c}`), l = localStorage.getItem(`theme_${c}`), u = localStorage.getItem(`columnWidths_${c}`);
496
+ if (e && (Ne(JSON.parse(e)), se.current = !0), t && ee(JSON.parse(t)), o && re(JSON.parse(o)), s && (ne(JSON.parse(s)), Q.current = !0), u && De(JSON.parse(u)), l === "light" || l === "dark" || l === "purple")
497
+ i(l);
499
498
  else {
500
- const i = String(v || "light").toLowerCase();
501
- c(
502
- i === "dark" || i === "purple" ? i : "light"
499
+ const d = String(v || "light").toLowerCase();
500
+ i(
501
+ d === "dark" || d === "purple" ? d : "light"
503
502
  );
504
503
  }
505
504
  le.current = !0;
506
- }, [u, v]), $(() => {
507
- u && le.current && (U.length > 0 && localStorage.setItem(
508
- `columnOrder_${u}`,
505
+ }, [c, v]), $(() => {
506
+ c && le.current && (U.length > 0 && localStorage.setItem(
507
+ `columnOrder_${c}`,
509
508
  JSON.stringify(U)
510
- ), L.length > 0 && localStorage.setItem(
511
- `visibleColumns_${u}`,
512
- JSON.stringify(L)
509
+ ), F.length > 0 && localStorage.setItem(
510
+ `visibleColumns_${c}`,
511
+ JSON.stringify(F)
513
512
  ), localStorage.setItem(
514
- `groupByColumns_${u}`,
515
- JSON.stringify(R)
513
+ `groupByColumns_${c}`,
514
+ JSON.stringify(T)
516
515
  ), localStorage.setItem(
517
- `totalColumns_${u}`,
516
+ `totalColumns_${c}`,
518
517
  JSON.stringify(V)
519
- ), localStorage.setItem(`theme_${u}`, o), localStorage.setItem(
520
- `columnWidths_${u}`,
521
- JSON.stringify(De)
518
+ ), localStorage.setItem(`theme_${c}`, n), localStorage.setItem(
519
+ `columnWidths_${c}`,
520
+ JSON.stringify(Me)
522
521
  ));
523
522
  }, [
524
- u,
523
+ c,
525
524
  U,
526
- L,
527
- R,
525
+ F,
526
+ T,
528
527
  V,
529
- o,
530
- De
528
+ n,
529
+ Me
531
530
  ]);
532
- const q = (e, t) => e[t] ?? "", me = we(
531
+ const oe = (e, t) => e[t] ?? "", me = _e(
533
532
  (e) => {
534
533
  const t = Number(e);
535
- return Number.isNaN(t) ? "" : new Intl.NumberFormat(tt, {
534
+ return Number.isNaN(t) ? "" : new Intl.NumberFormat(et, {
536
535
  style: "currency",
537
- currency: Ue,
536
+ currency: Ve,
538
537
  maximumFractionDigits: 2
539
538
  }).format(t);
540
539
  },
541
- [tt, Ue]
542
- ), xt = we(
540
+ [et, Ve]
541
+ ), xt = _e(
543
542
  (e) => {
544
543
  const t = new Date(e);
545
- return Number.isNaN(t.getTime()) ? e ?? "" : new Intl.DateTimeFormat(rt, nt).formatToParts(t).filter((s) => s.type === "year" || s.type === "month" || s.type === "day").map((s) => s.value).join(z);
544
+ return Number.isNaN(t.getTime()) ? e ?? "" : new Intl.DateTimeFormat(tt, rt).formatToParts(t).filter((s) => s.type === "year" || s.type === "month" || s.type === "day").map((s) => s.value).join(z);
546
545
  },
547
- [rt, nt, z]
548
- ), K = we(
546
+ [tt, rt, z]
547
+ ), q = _e(
549
548
  (e) => {
550
549
  const t = ie[0]?.[e];
551
550
  return t == null ? "text" : isNaN(Number(t)) ? isNaN(Date.parse(t)) ? "text" : "date" : "number";
552
551
  },
553
552
  [ie]
554
- ), ot = (e) => {
553
+ ), nt = (e) => {
555
554
  const t = new Date(e);
556
555
  return Number.isNaN(t.getTime()) ? null : `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(
557
556
  t.getDate()
558
557
  ).padStart(2, "0")}`;
559
- }, Ie = H(() => g.filter((e) => K(e.key) === "number"), [g, K]);
558
+ }, Ie = H(() => p.filter((e) => q(e.key) === "number"), [p, q]);
560
559
  $(() => {
561
- if (!g.length) return;
560
+ if (!p.length) return;
562
561
  const e = Ie.map((t) => t.key);
563
562
  if (!e.length) {
564
- oe([]);
563
+ ne([]);
565
564
  return;
566
565
  }
567
- oe((t) => {
568
- const n = new Set(e);
569
- return ee.current ? t.filter((s) => n.has(s)) : (ee.current = !0, e);
566
+ ne((t) => {
567
+ const o = new Set(e);
568
+ return Q.current ? t.filter((s) => o.has(s)) : (Q.current = !0, e);
570
569
  });
571
- }, [g.length, Ie]);
572
- const Ne = (e, t) => {
573
- I(() => {
574
- de((n) => ({
575
- ...n,
576
- [e]: { ...n[e], ...t }
570
+ }, [p.length, Ie]);
571
+ const je = (e, t) => {
572
+ M(() => {
573
+ de((o) => ({
574
+ ...o,
575
+ [e]: { ...o[e], ...t }
577
576
  })), G(1);
578
577
  });
579
578
  }, vt = () => {
580
- I(() => {
579
+ M(() => {
581
580
  de({}), G(1);
582
581
  });
583
- }, He = H(() => ie.filter(
584
- (e) => Object.entries(b).every(([t, n]) => {
585
- if (!(n?.value !== void 0 && n?.value !== null && String(n.value).trim() !== "")) return !0;
586
- const l = q(e, t);
587
- if (n.type === "number") {
588
- const d = Number(l), i = Number(n.value), p = n.op || "=";
589
- return Number.isNaN(d) || Number.isNaN(i) ? !0 : p === "=" ? d === i : p === ">" ? d > i : p === "<" ? d < i : p === "!=" ? d !== i : !0;
582
+ }, Ue = H(() => ie.filter(
583
+ (e) => Object.entries(w).every(([t, o]) => {
584
+ if (!(o?.value !== void 0 && o?.value !== null && String(o.value).trim() !== "")) return !0;
585
+ const l = oe(e, t);
586
+ if (o.type === "number") {
587
+ const u = Number(l), d = Number(o.value), f = o.op || "=";
588
+ return Number.isNaN(u) || Number.isNaN(d) ? !0 : f === "=" ? u === d : f === ">" ? u > d : f === "<" ? u < d : f === "!=" ? u !== d : !0;
590
589
  }
591
- if (n.type === "date") {
592
- const d = ot(l), i = ot(n.value), p = n.op || "=";
593
- return !d || !i ? !0 : p === "=" ? d === i : p === ">" ? d > i : p === "<" ? d < i : p === "!=" ? d !== i : !0;
590
+ if (o.type === "date") {
591
+ const u = nt(l), d = nt(o.value), f = o.op || "=";
592
+ return !u || !d ? !0 : f === "=" ? u === d : f === ">" ? u > d : f === "<" ? u < d : f === "!=" ? u !== d : !0;
594
593
  }
595
- return String(l).toLowerCase().includes(String(n.value).toLowerCase());
594
+ return String(l).toLowerCase().includes(String(o.value).toLowerCase());
596
595
  })
597
- ), [ie, b]), kt = (e) => {
598
- I(() => {
596
+ ), [ie, w]), kt = (e) => {
597
+ M(() => {
599
598
  ke((t) => ({
600
599
  key: e,
601
600
  direction: t.key === e && t.direction === "asc" ? "desc" : "asc"
602
601
  }));
603
602
  });
604
603
  }, D = H(() => {
605
- if (!C.key) return He;
606
- const e = K(C.key);
607
- return [...He].sort((t, n) => {
608
- const s = q(t, C.key), l = q(n, C.key), d = e === "date" ? new Date(s).getTime() : isNaN(Number(s)) ? s : Number(s), i = e === "date" ? new Date(l).getTime() : isNaN(Number(l)) ? l : Number(l);
609
- return d < i ? C.direction === "asc" ? -1 : 1 : d > i ? C.direction === "asc" ? 1 : -1 : 0;
604
+ if (!S.key) return Ue;
605
+ const e = q(S.key);
606
+ return [...Ue].sort((t, o) => {
607
+ const s = oe(t, S.key), l = oe(o, S.key), u = e === "date" ? new Date(s).getTime() : isNaN(Number(s)) ? s : Number(s), d = e === "date" ? new Date(l).getTime() : isNaN(Number(l)) ? l : Number(l);
608
+ return u < d ? S.direction === "asc" ? -1 : 1 : u > d ? S.direction === "asc" ? 1 : -1 : 0;
610
609
  });
611
- }, [He, C, K]), $e = H(() => {
610
+ }, [Ue, S, q]), $e = H(() => {
612
611
  if (!J) return null;
613
612
  const e = {};
614
- return g.forEach((t) => {
615
- K(t.key) === "number" && V.includes(t.key) && (e[t.key] = D.reduce(
616
- (n, s) => n + Number(s[t.key] || 0),
613
+ return p.forEach((t) => {
614
+ q(t.key) === "number" && V.includes(t.key) && (e[t.key] = D.reduce(
615
+ (o, s) => o + Number(s[t.key] || 0),
617
616
  0
618
617
  ));
619
618
  }), e;
620
- }, [J, D, g, K, V]), Le = S === Z ? D.length : Math.min(S, Re), Ye = S === Z ? 1 : Math.ceil(D.length / Le), Q = H(() => {
621
- if (S === Z) return D;
619
+ }, [J, D, p, q, V]), Le = j === K ? D.length : Math.min(j, Te), He = j === K ? 1 : Math.ceil(D.length / Le), Z = H(() => {
620
+ if (j === K) return D;
622
621
  const e = (X - 1) * Le;
623
622
  return D.slice(e, e + Le);
624
- }, [D, X, S, Le]), M = R.length > 0, F = !M && S === Z && !yt, jt = (e) => {
625
- I(() => {
626
- ne(
627
- (t) => t.includes(e) ? t.filter((n) => n !== e) : [...t, e]
623
+ }, [D, X, j, Le]), P = T.length > 0, B = !P && j === K && !yt, Nt = (e) => {
624
+ M(() => {
625
+ re(
626
+ (t) => t.includes(e) ? t.filter((o) => o !== e) : [...t, e]
628
627
  ), ue({}), G(1);
629
628
  });
630
- }, Nt = (e) => {
629
+ }, jt = (e) => {
631
630
  ue((t) => ({
632
631
  ...t,
633
632
  [e]: !t[e]
634
633
  }));
635
634
  }, St = (e) => {
636
- I(() => {
637
- oe(
638
- (t) => t.includes(e) ? t.filter((n) => n !== e) : [...t, e]
635
+ M(() => {
636
+ ne(
637
+ (t) => t.includes(e) ? t.filter((o) => o !== e) : [...t, e]
639
638
  );
640
639
  });
641
- }, at = we(
640
+ }, ot = _e(
642
641
  (e) => {
643
642
  const t = {};
644
- return V.forEach((n) => {
645
- const s = e.map((w) => Number(w[n])).filter((w) => !Number.isNaN(w));
643
+ return V.forEach((o) => {
644
+ const s = e.map((b) => Number(b[o])).filter((b) => !Number.isNaN(b));
646
645
  if (!s.length) return;
647
- const l = s.reduce((w, h) => w + h, 0), d = Math.min(...s), i = Math.max(...s), p = l / s.length;
648
- t[n] = {
646
+ const l = s.reduce((b, h) => b + h, 0), u = Math.min(...s), d = Math.max(...s), f = l / s.length;
647
+ t[o] = {
649
648
  count: s.length,
650
649
  sum: l,
651
- avg: p,
652
- min: d,
653
- max: i
650
+ avg: f,
651
+ min: u,
652
+ max: d
654
653
  };
655
654
  }), t;
656
655
  },
657
656
  [V]
658
- ), Be = H(() => {
659
- if (!M) return [];
660
- const e = [], t = D, n = (s, l, d) => {
661
- const i = R[l], p = /* @__PURE__ */ new Map();
662
- s.forEach((w) => {
663
- const h = q(w, i), k = h == null || h === "" ? "(Blank)" : String(h);
664
- p.has(k) || p.set(k, []), p.get(k).push(w);
665
- }), Array.from(p.entries()).forEach(([w, h], k) => {
666
- const A = `${d}${i}:${w}:${k}`;
657
+ ), Ye = H(() => {
658
+ if (!P) return [];
659
+ const e = [], t = D, o = (s, l, u) => {
660
+ const d = T[l], f = /* @__PURE__ */ new Map();
661
+ s.forEach((b) => {
662
+ const h = oe(b, d), C = h == null || h === "" ? "(Blank)" : String(h);
663
+ f.has(C) || f.set(C, []), f.get(C).push(b);
664
+ }), Array.from(f.entries()).forEach(([b, h], C) => {
665
+ const A = `${u}${d}:${b}:${C}`;
667
666
  if (e.push({
668
667
  type: "group",
669
668
  id: A,
670
- groupKey: i,
671
- groupValue: w,
669
+ groupKey: d,
670
+ groupValue: b,
672
671
  level: l,
673
672
  count: h.length,
674
- aggregates: at(h)
673
+ aggregates: ot(h)
675
674
  }), !ce[A]) {
676
- if (l < R.length - 1) {
677
- n(h, l + 1, `${A}|`);
675
+ if (l < T.length - 1) {
676
+ o(h, l + 1, `${A}|`);
678
677
  return;
679
678
  }
680
- h.forEach((m, T) => {
681
- const W = m[Te(x)] ?? m[x] ?? T;
679
+ h.forEach((m, R) => {
680
+ const W = m[Re(x)] ?? m[x] ?? R;
682
681
  e.push({
683
682
  type: "row",
684
- id: `${A}|row:${W}:${T}`,
683
+ id: `${A}|row:${W}:${R}`,
685
684
  row: m
686
685
  });
687
686
  });
688
687
  }
689
688
  });
690
689
  };
691
- return n(t, 0, ""), e;
690
+ return o(t, 0, ""), e;
692
691
  }, [
693
- M,
692
+ P,
694
693
  D,
695
- R,
694
+ T,
696
695
  ce,
697
- at,
696
+ ot,
698
697
  x
699
- ]), Ct = we(
698
+ ]), Ct = _e(
700
699
  (e) => {
701
- F && Ze(e.currentTarget.scrollTop);
700
+ B && Ke(e.currentTarget.scrollTop);
702
701
  },
703
- [F]
702
+ [B]
704
703
  );
705
704
  ut(() => {
706
- if (!F) return;
705
+ if (!B) return;
707
706
  const e = Pe.current;
708
707
  if (!e) return;
709
708
  const t = () => bt(e.clientHeight || 0);
710
709
  return t(), window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
711
- }, [F]), $(() => {
712
- Ze(0), Pe.current && (Pe.current.scrollTop = 0);
713
- }, [F, D.length]);
710
+ }, [B]), $(() => {
711
+ Ke(0), Pe.current && (Pe.current.scrollTop = 0);
712
+ }, [B, D.length]);
714
713
  const pe = H(() => {
715
- if (!F)
714
+ if (!B)
716
715
  return {
717
716
  start: 0,
718
- end: Q.length,
719
- rows: Q,
717
+ end: Z.length,
718
+ rows: Z,
720
719
  topSpacer: 0,
721
720
  bottomSpacer: 0
722
721
  };
723
- const e = Q.length, t = Math.ceil((Qe || 1) / We), n = Math.max(
722
+ const e = Z.length, t = Math.ceil((Ze || 1) / We), o = Math.max(
724
723
  0,
725
- Math.floor(Ke / We) - gt
724
+ Math.floor(qe / We) - gt
726
725
  ), s = Math.min(
727
726
  e,
728
- n + t + gt * 2
727
+ o + t + gt * 2
729
728
  );
730
729
  return {
731
- start: n,
730
+ start: o,
732
731
  end: s,
733
- rows: Q.slice(n, s),
734
- topSpacer: n * We,
732
+ rows: Z.slice(o, s),
733
+ topSpacer: o * We,
735
734
  bottomSpacer: Math.max(0, (e - s) * We)
736
735
  };
737
- }, [F, Q, Ke, Qe]), Je = we(
738
- (e) => Object.entries(e || {}).map(([t, n]) => `${g.find((l) => l.key === t)?.label || t}: Σ ${me(n.sum)} | Avg ${me(n.avg)} | Min ${me(n.min)} | Max ${me(n.max)}`),
739
- [g, me]
740
- ), Tt = () => {
736
+ }, [B, Z, qe, Ze]), at = _e(
737
+ (e) => Object.entries(e || {}).map(([t, o]) => `${p.find((l) => l.key === t)?.label || t}: Σ ${me(o.sum)} | Avg ${me(o.avg)} | Min ${me(o.min)} | Max ${me(o.max)}`),
738
+ [p, me]
739
+ ), Rt = () => {
741
740
  try {
742
- const e = P.filter(
743
- (h) => L.includes(h.key)
741
+ const e = I.filter(
742
+ (h) => F.includes(h.key)
744
743
  ), t = (h) => {
745
744
  const A = String(h ?? "").replace(/"/g, '""');
746
745
  return /[",\n\r]/.test(A) ? `"${A}"` : A;
747
- }, n = M ? Be.map((h) => {
746
+ }, o = P ? Ye.map((h) => {
748
747
  if (h.type === "group") {
749
- const m = g.find((fe) => fe.key === h.groupKey)?.label || h.groupKey, T = Je(h.aggregates).join(" || "), W = {};
748
+ const m = p.find((fe) => fe.key === h.groupKey)?.label || h.groupKey, R = at(h.aggregates).join(" || "), W = {};
750
749
  return e.forEach((fe, ct) => {
751
750
  if (ct === 0) {
752
751
  W[fe.key] = `GROUP ${m}: ${h.groupValue} (${h.count})`;
753
752
  return;
754
753
  }
755
- W[fe.key] = ct === 1 ? T : "";
754
+ W[fe.key] = ct === 1 ? R : "";
756
755
  }), W;
757
756
  }
758
- const k = {}, A = h.row;
757
+ const C = {}, A = h.row;
759
758
  return e.forEach((m) => {
760
- k[m.key] = q(A, m.key);
761
- }), k;
759
+ C[m.key] = oe(A, m.key);
760
+ }), C;
762
761
  }) : D.map((h) => {
763
- const k = {};
762
+ const C = {};
764
763
  return e.forEach((A) => {
765
- k[A.key] = q(h, A.key);
766
- }), k;
767
- }), s = e.map((h) => t(h.label)).join(","), l = n.map(
768
- (h) => e.map((k) => t(h[k.key])).join(",")
764
+ C[A.key] = oe(h, A.key);
765
+ }), C;
766
+ }), s = e.map((h) => t(h.label)).join(","), l = o.map(
767
+ (h) => e.map((C) => t(h[C.key])).join(",")
769
768
  ).join(`\r
770
- `), d = `\uFEFF${s}\r
771
- ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObjectURL(i), w = document.createElement("a");
772
- w.href = p, w.download = "TableData.csv", document.body.appendChild(w), w.click(), document.body.removeChild(w), URL.revokeObjectURL(p);
769
+ `), u = `\uFEFF${s}\r
770
+ ${l}`, d = new Blob([u], { type: "text/csv;charset=utf-8;" }), f = URL.createObjectURL(d), b = document.createElement("a");
771
+ b.href = f, b.download = "TableData.csv", document.body.appendChild(b), b.click(), document.body.removeChild(b), URL.revokeObjectURL(f);
773
772
  } catch (e) {
774
773
  console.error("Failed to export CSV", e);
775
774
  }
776
- }, Rt = () => {
777
- (async () => {
778
- const [{ default: e }, { default: t }] = await Promise.all([
779
- import("./jspdf.es.min-DVZuwoNv.js").then((i) => i.j),
780
- import("./jspdf.plugin.autotable-D7eVZU2H.js")
781
- ]), n = new e({
782
- orientation: "landscape",
783
- // better for wide tables
784
- unit: "pt",
785
- format: "A4"
786
- }), s = P.filter((i) => L.includes(i.key)), l = [s.map((i) => i.label)], d = M ? Be.map((i) => {
787
- if (i.type === "group") {
788
- const p = g.find((k) => k.key === i.groupKey)?.label || i.groupKey, w = Je(i.aggregates);
789
- return [
790
- {
791
- content: [
792
- `GROUP ${p}: ${i.groupValue} (${i.count})`,
793
- ...w
794
- ].join(`
795
- `),
796
- colSpan: Math.max(1, s.length),
797
- styles: {
798
- fontStyle: "bold",
799
- fillColor: [235, 240, 250],
800
- textColor: [20, 40, 80],
801
- overflow: "linebreak",
802
- cellWidth: "wrap"
803
- }
804
- }
805
- ];
806
- }
807
- return s.map((p) => String(q(i.row, p.key) ?? ""));
808
- }) : D.map(
809
- (i) => s.map((p) => String(q(i, p.key) ?? ""))
810
- );
811
- t(n, {
812
- head: l,
813
- body: d,
814
- styles: {
815
- fontSize: 9,
816
- cellPadding: 4,
817
- halign: "left",
818
- valign: "middle"
819
- },
820
- headStyles: {
821
- fillColor: [22, 160, 133],
822
- textColor: [255, 255, 255],
823
- fontStyle: "bold"
824
- },
825
- margin: { top: 40 },
826
- didDrawPage: (i) => {
827
- n.setFontSize(12), n.text("Table Data Export", i.settings.margin.left, 30);
828
- }
829
- }), n.save("TableData.pdf");
830
- })().catch((e) => {
831
- console.error("Failed to export PDF", e);
832
- });
833
775
  }, st = (e, t) => {
834
776
  e.dataTransfer.setData("colKey", t);
835
777
  }, lt = (e, t) => {
836
- const n = e.dataTransfer.getData("colKey");
837
- !n || n === t || I(() => {
838
- je((s) => {
839
- const l = [...s], d = l.indexOf(n), i = l.indexOf(t);
840
- return l.splice(d, 1), l.splice(i, 0, n), l;
778
+ const o = e.dataTransfer.getData("colKey");
779
+ !o || o === t || M(() => {
780
+ Ne((s) => {
781
+ const l = [...s], u = l.indexOf(o), d = l.indexOf(t);
782
+ return l.splice(u, 1), l.splice(d, 0, o), l;
841
783
  });
842
784
  });
843
- }, it = (e) => e.preventDefault(), P = H(() => U.map((e) => g.find((t) => t.key === e)).filter((e) => e && L.includes(e.key)), [g, U, L]), ge = H(() => {
785
+ }, it = (e) => e.preventDefault(), I = H(() => U.map((e) => p.find((t) => t.key === e)).filter((e) => e && F.includes(e.key)), [p, U, F]), ge = H(() => {
844
786
  const s = "14px system-ui", l = {};
845
- return P.forEach((d) => {
846
- const i = Xe(d.label, s), p = Math.min(
787
+ return I.forEach((u) => {
788
+ const d = Je(u.label, s), f = Math.min(
847
789
  320,
848
- Math.max(ze, i + 32 + 48)
790
+ Math.max(Fe, d + 32 + 48)
849
791
  );
850
- l[d.key] = Math.max(
851
- ze,
852
- De[d.key] ?? p
792
+ l[u.key] = Math.max(
793
+ Fe,
794
+ Me[u.key] ?? f
853
795
  );
854
796
  }), l;
855
- }, [P, De]);
797
+ }, [I, Me]);
856
798
  $(() => {
857
- if (!g.length) return;
858
- const e = new Set(g.map((t) => t.key));
859
- Me((t) => {
860
- const n = {};
799
+ if (!p.length) return;
800
+ const e = new Set(p.map((t) => t.key));
801
+ De((t) => {
802
+ const o = {};
861
803
  return Object.entries(t).forEach(([s, l]) => {
862
- e.has(s) && (n[s] = l);
863
- }), n;
804
+ e.has(s) && (o[s] = l);
805
+ }), o;
864
806
  });
865
- }, [g]);
866
- const Et = (e, t) => {
807
+ }, [p]);
808
+ const Tt = (e, t) => {
867
809
  if (e.preventDefault(), e.stopPropagation(), e.button !== void 0 && e.button !== 0) return;
868
- const n = e.clientX, s = ge[t] || ze;
869
- he.current = { key: t, startX: n, startWidth: s }, document.body.style.cursor = "col-resize";
870
- const l = (i) => {
810
+ const o = e.clientX, s = ge[t] || Fe;
811
+ he.current = { key: t, startX: o, startWidth: s }, document.body.style.cursor = "col-resize";
812
+ const l = (d) => {
871
813
  if (!he.current) return;
872
- const p = i.clientX - he.current.startX, w = Math.max(
873
- ze,
874
- he.current.startWidth + p
814
+ const f = d.clientX - he.current.startX, b = Math.max(
815
+ Fe,
816
+ he.current.startWidth + f
875
817
  );
876
- Me((h) => ({
818
+ De((h) => ({
877
819
  ...h,
878
- [he.current.key]: w
820
+ [he.current.key]: b
879
821
  }));
880
- }, d = () => {
881
- he.current = null, document.body.style.cursor = "", window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", d);
822
+ }, u = () => {
823
+ he.current = null, document.body.style.cursor = "", window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", u);
882
824
  };
883
- window.addEventListener("pointermove", l), window.addEventListener("pointerup", d);
884
- }, Ot = (e, t) => {
885
- e.preventDefault(), e.stopPropagation(), Me((n) => {
886
- const s = { ...n };
825
+ window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
826
+ }, Et = (e, t) => {
827
+ e.preventDefault(), e.stopPropagation(), De((o) => {
828
+ const s = { ...o };
887
829
  return delete s[t], s;
888
830
  });
889
- }, At = ye || ft, Dt = o === "dark" ? a.themeDark : o === "purple" ? a.themePurple : a.themeLight;
831
+ }, Ot = ye || ft, At = n === "dark" ? a.themeDark : n === "purple" ? a.themePurple : a.themeLight;
890
832
  return ut(() => {
891
833
  const e = () => {
892
- _t(qe.current?.offsetHeight || 0);
834
+ wt(Xe.current?.offsetHeight || 0);
893
835
  };
894
836
  return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
895
- }, [P.length]), $(() => {
837
+ }, [I.length]), $(() => {
896
838
  if (typeof window > "u" || typeof window.matchMedia != "function") return;
897
- const e = window.matchMedia("(max-width: 767.98px)"), t = (n) => et(n.matches);
898
- return et(e.matches), e.addEventListener("change", t), () => e.removeEventListener("change", t);
899
- }, []), /* @__PURE__ */ r.jsxs("div", { className: E(a.container, Dt), children: [
839
+ const e = window.matchMedia("(max-width: 767.98px)"), t = (o) => Qe(o.matches);
840
+ return Qe(e.matches), e.addEventListener("change", t), () => e.removeEventListener("change", t);
841
+ }, []), /* @__PURE__ */ r.jsxs("div", { className: E(a.container, At), children: [
900
842
  /* @__PURE__ */ r.jsxs("div", { className: a.headerRow, children: [
901
843
  /* @__PURE__ */ r.jsxs("div", { className: E(a.flexRow, a.toolbarGroup), children: [
902
844
  /* @__PURE__ */ r.jsx("label", { className: a.labelMuted, children: "Rows:" }),
@@ -904,11 +846,11 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
904
846
  "select",
905
847
  {
906
848
  className: E(a.selectSmall, a.selectAuto),
907
- value: S,
908
- onChange: (e) => I(() => {
849
+ value: j,
850
+ onChange: (e) => M(() => {
909
851
  ve(Number(e.target.value)), G(1);
910
852
  }),
911
- children: re.map((e) => /* @__PURE__ */ r.jsx("option", { value: e, children: e === Z ? "All" : e }, e))
853
+ children: te.map((e) => /* @__PURE__ */ r.jsx("option", { value: e, children: e === K ? "All" : e }, e))
912
854
  }
913
855
  ),
914
856
  /* @__PURE__ */ r.jsxs("div", { className: a.switchRow, children: [
@@ -918,7 +860,7 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
918
860
  className: a.checkbox,
919
861
  type: "checkbox",
920
862
  checked: J,
921
- onChange: (e) => I(() => Ee(e.target.checked))
863
+ onChange: (e) => M(() => Ee(e.target.checked))
922
864
  }
923
865
  ),
924
866
  /* @__PURE__ */ r.jsx("label", { className: a.labelMuted, children: "Show Totals" })
@@ -927,15 +869,15 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
927
869
  /* @__PURE__ */ r.jsxs("span", { className: a.labelMuted, children: [
928
870
  "Group By:",
929
871
  " ",
930
- R.length ? R.map((e) => g.find((t) => t.key === e)?.label || e).join(" > ") : "None"
872
+ T.length ? T.map((e) => p.find((t) => t.key === e)?.label || e).join(" > ") : "None"
931
873
  ] }),
932
- R.length > 0 && /* @__PURE__ */ r.jsx(
874
+ T.length > 0 && /* @__PURE__ */ r.jsx(
933
875
  "button",
934
876
  {
935
877
  className: E(a.buttonBase, a.buttonMuted),
936
878
  onClick: () => {
937
- I(() => {
938
- ne([]), ue({});
879
+ M(() => {
880
+ re([]), ue({});
939
881
  });
940
882
  },
941
883
  children: "Clear Groups"
@@ -948,7 +890,7 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
948
890
  "button",
949
891
  {
950
892
  className: E(a.buttonBase, a.buttonDanger),
951
- disabled: !Object.values(B).some((e) => e?.value),
893
+ disabled: !Object.values(L).some((e) => e?.value),
952
894
  onClick: vt,
953
895
  children: [
954
896
  "✕",
@@ -957,24 +899,17 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
957
899
  ]
958
900
  }
959
901
  ),
960
- /* @__PURE__ */ r.jsxs(
902
+ /* @__PURE__ */ r.jsx(
961
903
  pt,
962
904
  {
963
905
  label: /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
964
906
  "⬇",
965
907
  " Export"
966
908
  ] }),
967
- children: [
968
- /* @__PURE__ */ r.jsx("li", { children: /* @__PURE__ */ r.jsxs("button", { className: a.menuItemButton, onClick: Tt, children: [
969
- /* @__PURE__ */ r.jsx("span", { className: a.successText, children: "CSV" }),
970
- " Export to CSV"
971
- ] }) }),
972
- /* @__PURE__ */ r.jsx("li", { children: /* @__PURE__ */ r.jsxs("button", { className: a.menuItemButton, onClick: Rt, children: [
973
- /* @__PURE__ */ r.jsx("span", { className: a.dangerText, children: "PDF" }),
974
- " ",
975
- "Export to PDF"
976
- ] }) })
977
- ]
909
+ children: /* @__PURE__ */ r.jsx("li", { children: /* @__PURE__ */ r.jsxs("button", { className: a.menuItemButton, onClick: Rt, children: [
910
+ /* @__PURE__ */ r.jsx("span", { className: a.successText, children: "CSV" }),
911
+ " Export to CSV"
912
+ ] }) })
978
913
  }
979
914
  ),
980
915
  /* @__PURE__ */ r.jsxs(
@@ -1001,7 +936,7 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1001
936
  "button",
1002
937
  {
1003
938
  className: a.menuItemButton,
1004
- onClick: () => c("light"),
939
+ onClick: () => i("light"),
1005
940
  children: "Light"
1006
941
  }
1007
942
  ) }),
@@ -1009,7 +944,7 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1009
944
  "button",
1010
945
  {
1011
946
  className: a.menuItemButton,
1012
- onClick: () => c("dark"),
947
+ onClick: () => i("dark"),
1013
948
  children: "Dark"
1014
949
  }
1015
950
  ) }),
@@ -1017,7 +952,7 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1017
952
  "button",
1018
953
  {
1019
954
  className: a.menuItemButton,
1020
- onClick: () => c("purple"),
955
+ onClick: () => i("purple"),
1021
956
  children: "Purple"
1022
957
  }
1023
958
  ) })
@@ -1028,7 +963,7 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1028
963
  ] }),
1029
964
  /* @__PURE__ */ r.jsxs("div", { className: a.relative, children: [
1030
965
  /* @__PURE__ */ r.jsx("div", { className: a.srOnly, "aria-live": "polite", children: ye ? "Loading table data" : "Table updated" }),
1031
- At && /* @__PURE__ */ r.jsx("div", { className: a.overlay, children: /* @__PURE__ */ r.jsxs(
966
+ Ot && /* @__PURE__ */ r.jsx("div", { className: a.overlay, children: /* @__PURE__ */ r.jsxs(
1032
967
  "div",
1033
968
  {
1034
969
  className: a.overlayInner,
@@ -1044,10 +979,10 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1044
979
  {
1045
980
  className: E(
1046
981
  a.tableWrap,
1047
- S === Z && a.tableWrapAll
982
+ j === K && a.tableWrapAll
1048
983
  ),
1049
984
  ref: Pe,
1050
- style: S === Z ? { maxHeight: "70vh", overflowY: "auto" } : {},
985
+ style: j === K ? { maxHeight: "70vh", overflowY: "auto" } : {},
1051
986
  onScroll: Ct,
1052
987
  children: /* @__PURE__ */ r.jsxs(
1053
988
  "table",
@@ -1055,17 +990,17 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1055
990
  className: a.table,
1056
991
  style: { tableLayout: "fixed" },
1057
992
  role: "grid",
1058
- "aria-rowcount": M ? Be.length : Q.length,
1059
- "aria-colcount": P.length,
993
+ "aria-rowcount": P ? Ye.length : Z.length,
994
+ "aria-colcount": I.length,
1060
995
  children: [
1061
996
  /* @__PURE__ */ r.jsxs("thead", { className: a.tableHead, children: [
1062
- /* @__PURE__ */ r.jsx("tr", { ref: qe, children: P.map((e) => {
1063
- const t = C.key === e.key, n = t ? C.direction === "asc" ? "↑" : "↓" : "⇅";
997
+ /* @__PURE__ */ r.jsx("tr", { ref: Xe, children: I.map((e) => {
998
+ const t = S.key === e.key, o = t ? S.direction === "asc" ? "↑" : "↓" : "⇅";
1064
999
  return /* @__PURE__ */ r.jsxs(
1065
1000
  "th",
1066
1001
  {
1067
1002
  scope: "col",
1068
- "aria-sort": t ? C.direction === "asc" ? "ascending" : "descending" : "none",
1003
+ "aria-sort": t ? S.direction === "asc" ? "ascending" : "descending" : "none",
1069
1004
  draggable: !0,
1070
1005
  onDragStart: (s) => st(s, e.key),
1071
1006
  onDragOver: it,
@@ -1086,7 +1021,7 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1086
1021
  e.label,
1087
1022
  /* @__PURE__ */ r.jsxs("span", { className: a.iconMuted, children: [
1088
1023
  " ",
1089
- n
1024
+ o
1090
1025
  ] })
1091
1026
  ]
1092
1027
  }
@@ -1099,8 +1034,8 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1099
1034
  "aria-orientation": "vertical",
1100
1035
  "aria-label": `Resize ${e.label} column`,
1101
1036
  tabIndex: 0,
1102
- onPointerDown: (s) => Et(s, e.key),
1103
- onDoubleClick: (s) => Ot(s, e.key)
1037
+ onPointerDown: (s) => Tt(s, e.key),
1038
+ onDoubleClick: (s) => Et(s, e.key)
1104
1039
  }
1105
1040
  )
1106
1041
  ]
@@ -1108,20 +1043,20 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1108
1043
  e.key
1109
1044
  );
1110
1045
  }) }),
1111
- /* @__PURE__ */ r.jsx("tr", { children: P.map((e) => /* @__PURE__ */ r.jsx(
1046
+ /* @__PURE__ */ r.jsx("tr", { children: I.map((e) => /* @__PURE__ */ r.jsx(
1112
1047
  "th",
1113
1048
  {
1114
1049
  style: {
1115
- top: wt
1050
+ top: _t
1116
1051
  },
1117
1052
  className: a.thCellFilter,
1118
- children: K(e.key) === "number" ? /* @__PURE__ */ r.jsxs("div", { className: a.inlineGroup, children: [
1053
+ children: q(e.key) === "number" ? /* @__PURE__ */ r.jsxs("div", { className: a.inlineGroup, children: [
1119
1054
  /* @__PURE__ */ r.jsxs(
1120
1055
  "select",
1121
1056
  {
1122
1057
  className: E(a.selectSmall, a.selectAuto),
1123
- value: B[e.key]?.op || "=",
1124
- onChange: (t) => Ne(e.key, {
1058
+ value: L[e.key]?.op || "=",
1059
+ onChange: (t) => je(e.key, {
1125
1060
  type: "number",
1126
1061
  op: t.target.value
1127
1062
  }),
@@ -1138,20 +1073,20 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1138
1073
  {
1139
1074
  type: "number",
1140
1075
  className: a.input,
1141
- value: B[e.key]?.value || "",
1142
- onChange: (t) => Ne(e.key, {
1076
+ value: L[e.key]?.value || "",
1077
+ onChange: (t) => je(e.key, {
1143
1078
  type: "number",
1144
1079
  value: t.target.value
1145
1080
  })
1146
1081
  }
1147
1082
  )
1148
- ] }) : K(e.key) === "date" ? /* @__PURE__ */ r.jsxs("div", { className: a.inlineGroup, children: [
1083
+ ] }) : q(e.key) === "date" ? /* @__PURE__ */ r.jsxs("div", { className: a.inlineGroup, children: [
1149
1084
  /* @__PURE__ */ r.jsxs(
1150
1085
  "select",
1151
1086
  {
1152
1087
  className: E(a.selectSmall, a.selectAuto),
1153
- value: B[e.key]?.op || "=",
1154
- onChange: (t) => Ne(e.key, {
1088
+ value: L[e.key]?.op || "=",
1089
+ onChange: (t) => je(e.key, {
1155
1090
  type: "date",
1156
1091
  op: t.target.value
1157
1092
  }),
@@ -1168,8 +1103,8 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1168
1103
  {
1169
1104
  type: "date",
1170
1105
  className: a.input,
1171
- value: B[e.key]?.value || "",
1172
- onChange: (t) => Ne(e.key, {
1106
+ value: L[e.key]?.value || "",
1107
+ onChange: (t) => je(e.key, {
1173
1108
  type: "date",
1174
1109
  value: t.target.value
1175
1110
  })
@@ -1181,8 +1116,8 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1181
1116
  type: "text",
1182
1117
  className: a.input,
1183
1118
  placeholder: "Filter...",
1184
- value: B[e.key]?.value || "",
1185
- onChange: (t) => Ne(e.key, {
1119
+ value: L[e.key]?.value || "",
1120
+ onChange: (t) => je(e.key, {
1186
1121
  type: "text",
1187
1122
  value: t.target.value
1188
1123
  })
@@ -1193,27 +1128,27 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1193
1128
  )) })
1194
1129
  ] }),
1195
1130
  /* @__PURE__ */ r.jsxs("tbody", { children: [
1196
- F && pe.topSpacer > 0 && /* @__PURE__ */ r.jsx("tr", { "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(
1131
+ B && pe.topSpacer > 0 && /* @__PURE__ */ r.jsx("tr", { "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(
1197
1132
  "td",
1198
1133
  {
1199
- colSpan: P.length,
1134
+ colSpan: I.length,
1200
1135
  style: { height: `${pe.topSpacer}px`, padding: 0 }
1201
1136
  }
1202
1137
  ) }),
1203
- (M ? Be : F ? pe.rows : Q).map((e) => {
1204
- if (M && e.type === "group") {
1205
- const n = g.find((d) => d.key === e.groupKey)?.label || e.groupKey, s = !!ce[e.id], l = Je(e.aggregates).join(" || ");
1206
- return /* @__PURE__ */ r.jsx("tr", { className: E(a.groupRow, a.groupRowAnimated), children: /* @__PURE__ */ r.jsx("td", { colSpan: P.length, children: /* @__PURE__ */ r.jsxs(
1138
+ (P ? Ye : B ? pe.rows : Z).map((e) => {
1139
+ if (P && e.type === "group") {
1140
+ const o = p.find((u) => u.key === e.groupKey)?.label || e.groupKey, s = !!ce[e.id], l = at(e.aggregates).join(" || ");
1141
+ return /* @__PURE__ */ r.jsx("tr", { className: E(a.groupRow, a.groupRowAnimated), children: /* @__PURE__ */ r.jsx("td", { colSpan: I.length, children: /* @__PURE__ */ r.jsxs(
1207
1142
  "button",
1208
1143
  {
1209
1144
  type: "button",
1210
1145
  className: a.groupToggle,
1211
- onClick: () => Nt(e.id),
1146
+ onClick: () => jt(e.id),
1212
1147
  children: [
1213
1148
  /* @__PURE__ */ r.jsxs("span", { style: { paddingLeft: `${e.level * 18}px` }, children: [
1214
1149
  s ? "▶" : "▼",
1215
1150
  " ",
1216
- n,
1151
+ o,
1217
1152
  ": ",
1218
1153
  e.groupValue,
1219
1154
  " (",
@@ -1228,22 +1163,22 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1228
1163
  }
1229
1164
  ) }) }, e.id);
1230
1165
  }
1231
- const t = M ? e.row : e;
1166
+ const t = P ? e.row : e;
1232
1167
  return /* @__PURE__ */ r.jsx(
1233
1168
  "tr",
1234
1169
  {
1235
1170
  className: E(
1236
1171
  a.rowInteractive,
1237
- M && a.groupChildRow
1172
+ P && a.groupChildRow
1238
1173
  ),
1239
1174
  tabIndex: 0,
1240
- children: P.map((n) => {
1241
- const s = q(t, n.key);
1175
+ children: I.map((o) => {
1176
+ const s = oe(t, o.key);
1242
1177
  return typeof s == "boolean" ? /* @__PURE__ */ r.jsx(
1243
1178
  "td",
1244
1179
  {
1245
- "data-label": n.label,
1246
- style: { width: ge[n.key] },
1180
+ "data-label": o.label,
1181
+ style: { width: ge[o.key] },
1247
1182
  children: /* @__PURE__ */ r.jsx(
1248
1183
  "input",
1249
1184
  {
@@ -1254,40 +1189,40 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1254
1189
  }
1255
1190
  )
1256
1191
  },
1257
- n.key
1258
- ) : K(n.key) === "date" ? /* @__PURE__ */ r.jsx(
1192
+ o.key
1193
+ ) : q(o.key) === "date" ? /* @__PURE__ */ r.jsx(
1259
1194
  "td",
1260
1195
  {
1261
- "data-label": n.label,
1262
- style: { width: ge[n.key] },
1196
+ "data-label": o.label,
1197
+ style: { width: ge[o.key] },
1263
1198
  children: xt(s)
1264
1199
  },
1265
- n.key
1200
+ o.key
1266
1201
  ) : /* @__PURE__ */ r.jsx(
1267
1202
  "td",
1268
1203
  {
1269
- "data-label": n.label,
1270
- style: { width: ge[n.key] },
1204
+ "data-label": o.label,
1205
+ style: { width: ge[o.key] },
1271
1206
  children: s
1272
1207
  },
1273
- n.key
1208
+ o.key
1274
1209
  );
1275
1210
  })
1276
1211
  },
1277
- M ? e.id : t[Te(x)] ?? t[x]
1212
+ P ? e.id : t[Re(x)] ?? t[x]
1278
1213
  );
1279
1214
  }),
1280
- F && pe.bottomSpacer > 0 && /* @__PURE__ */ r.jsx("tr", { "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(
1215
+ B && pe.bottomSpacer > 0 && /* @__PURE__ */ r.jsx("tr", { "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(
1281
1216
  "td",
1282
1217
  {
1283
- colSpan: P.length,
1218
+ colSpan: I.length,
1284
1219
  style: { height: `${pe.bottomSpacer}px`, padding: 0 }
1285
1220
  }
1286
1221
  ) })
1287
1222
  ] }),
1288
1223
  J && $e && Object.keys($e).length > 0 && /* @__PURE__ */ r.jsxs("tfoot", { className: a.tfoot, children: [
1289
- /* @__PURE__ */ r.jsx("tr", { children: /* @__PURE__ */ r.jsx("td", { colSpan: P.length, className: a.textCenter, children: "Totals" }) }),
1290
- /* @__PURE__ */ r.jsx("tr", { children: P.map((e) => /* @__PURE__ */ r.jsx(
1224
+ /* @__PURE__ */ r.jsx("tr", { children: /* @__PURE__ */ r.jsx("td", { colSpan: I.length, className: a.textCenter, children: "Totals" }) }),
1225
+ /* @__PURE__ */ r.jsx("tr", { children: I.map((e) => /* @__PURE__ */ r.jsx(
1291
1226
  "td",
1292
1227
  {
1293
1228
  "data-label": e.label,
@@ -1303,24 +1238,24 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1303
1238
  }
1304
1239
  )
1305
1240
  ] }),
1306
- !M && S !== Z && Ye > 1 && /* @__PURE__ */ r.jsx("div", { className: a.paginationWrap, children: /* @__PURE__ */ r.jsxs("ul", { className: a.pagination, children: [
1241
+ !P && j !== K && He > 1 && /* @__PURE__ */ r.jsx("div", { className: a.paginationWrap, children: /* @__PURE__ */ r.jsxs("ul", { className: a.pagination, children: [
1307
1242
  /* @__PURE__ */ r.jsx("li", { children: /* @__PURE__ */ r.jsx(
1308
1243
  "button",
1309
1244
  {
1310
1245
  className: a.pageButton,
1311
1246
  disabled: X === 1,
1312
- onClick: () => I(() => G((e) => e - 1)),
1247
+ onClick: () => M(() => G((e) => e - 1)),
1313
1248
  children: "Prev"
1314
1249
  }
1315
1250
  ) }),
1316
- Array.from({ length: Ye }, (e, t) => /* @__PURE__ */ r.jsx("li", { children: /* @__PURE__ */ r.jsx(
1251
+ Array.from({ length: He }, (e, t) => /* @__PURE__ */ r.jsx("li", { children: /* @__PURE__ */ r.jsx(
1317
1252
  "button",
1318
1253
  {
1319
1254
  className: E(
1320
1255
  a.pageButton,
1321
1256
  X === t + 1 && a.pageButtonActive
1322
1257
  ),
1323
- onClick: () => I(() => G(t + 1)),
1258
+ onClick: () => M(() => G(t + 1)),
1324
1259
  children: t + 1
1325
1260
  }
1326
1261
  ) }, t)),
@@ -1328,30 +1263,30 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1328
1263
  "button",
1329
1264
  {
1330
1265
  className: a.pageButton,
1331
- disabled: X === Ye,
1332
- onClick: () => I(() => G((e) => e + 1)),
1266
+ disabled: X === He,
1267
+ onClick: () => M(() => G((e) => e + 1)),
1333
1268
  children: "Next"
1334
1269
  }
1335
1270
  ) })
1336
1271
  ] }) }),
1337
- !M && S === Z && /* @__PURE__ */ r.jsxs("div", { className: a.labelMuted, children: [
1272
+ !P && j === K && /* @__PURE__ */ r.jsxs("div", { className: a.labelMuted, children: [
1338
1273
  "Showing",
1339
1274
  " ",
1340
- (F ? pe.end : Q.length).toLocaleString(),
1275
+ (B ? pe.end : Z.length).toLocaleString(),
1341
1276
  " of",
1342
1277
  " ",
1343
1278
  D.length.toLocaleString(),
1344
1279
  " rows",
1345
- F ? " (virtualized)" : ""
1280
+ B ? " (virtualized)" : ""
1346
1281
  ] }),
1347
- M && /* @__PURE__ */ r.jsxs("div", { className: a.labelMuted, children: [
1282
+ P && /* @__PURE__ */ r.jsxs("div", { className: a.labelMuted, children: [
1348
1283
  "Grouped view: ",
1349
1284
  D.length.toLocaleString(),
1350
1285
  " rows across",
1351
1286
  " ",
1352
- R.length,
1287
+ T.length,
1353
1288
  " level",
1354
- R.length > 1 ? "s" : ""
1289
+ T.length > 1 ? "s" : ""
1355
1290
  ] }),
1356
1291
  Oe && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1357
1292
  /* @__PURE__ */ r.jsx("div", { className: a.backdrop, onClick: () => Ae(!1) }),
@@ -1359,25 +1294,25 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1359
1294
  /* @__PURE__ */ r.jsx("h6", { className: a.drawerTitle, children: "Column Settings" }),
1360
1295
  /* @__PURE__ */ r.jsx("h6", { className: a.drawerSubtitle, children: "Visible Columns" }),
1361
1296
  U.map((e) => {
1362
- const t = g.find((n) => n.key === e);
1297
+ const t = p.find((o) => o.key === e);
1363
1298
  return t ? /* @__PURE__ */ r.jsxs(
1364
1299
  "div",
1365
1300
  {
1366
1301
  className: a.drawerRow,
1367
1302
  draggable: !0,
1368
- onDragStart: (n) => st(n, t.key),
1303
+ onDragStart: (o) => st(o, t.key),
1369
1304
  onDragOver: it,
1370
- onDrop: (n) => lt(n, t.key),
1305
+ onDrop: (o) => lt(o, t.key),
1371
1306
  children: [
1372
1307
  /* @__PURE__ */ r.jsx(
1373
1308
  "input",
1374
1309
  {
1375
1310
  type: "checkbox",
1376
1311
  className: a.checkbox,
1377
- checked: L.includes(t.key),
1378
- onChange: () => I(
1379
- () => te(
1380
- (n) => n.includes(t.key) ? n.filter((s) => s !== t.key) : [...n, t.key]
1312
+ checked: F.includes(t.key),
1313
+ onChange: () => M(
1314
+ () => ee(
1315
+ (o) => o.includes(t.key) ? o.filter((s) => s !== t.key) : [...o, t.key]
1381
1316
  )
1382
1317
  )
1383
1318
  }
@@ -1395,27 +1330,27 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1395
1330
  {
1396
1331
  type: "button",
1397
1332
  className: a.sectionToggle,
1398
- "aria-expanded": f.groupBy,
1333
+ "aria-expanded": g.groupBy,
1399
1334
  onClick: () => _((e) => ({
1400
1335
  ...e,
1401
1336
  groupBy: !e.groupBy
1402
1337
  })),
1403
1338
  children: [
1404
1339
  /* @__PURE__ */ r.jsx("span", { children: "Group By Columns" }),
1405
- /* @__PURE__ */ r.jsx("span", { className: a.iconMuted, children: f.groupBy ? "▲" : "▼" })
1340
+ /* @__PURE__ */ r.jsx("span", { className: a.iconMuted, children: g.groupBy ? "▲" : "▼" })
1406
1341
  ]
1407
1342
  }
1408
1343
  ),
1409
- f.groupBy && /* @__PURE__ */ r.jsx("div", { className: a.sectionBody, children: U.map((e) => {
1410
- const t = g.find((n) => n.key === e);
1344
+ g.groupBy && /* @__PURE__ */ r.jsx("div", { className: a.sectionBody, children: U.map((e) => {
1345
+ const t = p.find((o) => o.key === e);
1411
1346
  return t ? /* @__PURE__ */ r.jsxs("div", { className: a.drawerRow, children: [
1412
1347
  /* @__PURE__ */ r.jsx(
1413
1348
  "input",
1414
1349
  {
1415
1350
  type: "checkbox",
1416
1351
  className: a.checkbox,
1417
- checked: R.includes(t.key),
1418
- onChange: () => jt(t.key)
1352
+ checked: T.includes(t.key),
1353
+ onChange: () => Nt(t.key)
1419
1354
  }
1420
1355
  ),
1421
1356
  /* @__PURE__ */ r.jsx("label", { children: t.label })
@@ -1428,21 +1363,21 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1428
1363
  {
1429
1364
  type: "button",
1430
1365
  className: a.sectionToggle,
1431
- "aria-expanded": f.aggregates,
1366
+ "aria-expanded": g.aggregates,
1432
1367
  onClick: () => _((e) => ({
1433
1368
  ...e,
1434
1369
  aggregates: !e.aggregates
1435
1370
  })),
1436
1371
  children: [
1437
1372
  /* @__PURE__ */ r.jsx("span", { children: "Show Total/Aggregate For" }),
1438
- /* @__PURE__ */ r.jsx("span", { className: a.iconMuted, children: f.aggregates ? "▲" : "▼" })
1373
+ /* @__PURE__ */ r.jsx("span", { className: a.iconMuted, children: g.aggregates ? "▲" : "▼" })
1439
1374
  ]
1440
1375
  }
1441
1376
  ),
1442
- f.aggregates && /* @__PURE__ */ r.jsxs("div", { className: a.sectionBody, children: [
1377
+ g.aggregates && /* @__PURE__ */ r.jsxs("div", { className: a.sectionBody, children: [
1443
1378
  Ie.length === 0 && /* @__PURE__ */ r.jsx("div", { className: a.labelMuted, children: "No numeric columns available." }),
1444
1379
  U.map((e) => {
1445
- const t = Ie.find((n) => n.key === e);
1380
+ const t = Ie.find((o) => o.key === e);
1446
1381
  return t ? /* @__PURE__ */ r.jsxs("div", { className: a.drawerRow, children: [
1447
1382
  /* @__PURE__ */ r.jsx(
1448
1383
  "input",
@@ -1463,5 +1398,5 @@ ${l}`, i = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = URL.createObj
1463
1398
  ] });
1464
1399
  }
1465
1400
  export {
1466
- Kr as AwesomeGrid
1401
+ Xr as AwesomeGrid
1467
1402
  };