@warkypublic/oranguru 0.0.46 → 0.0.48

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.es.js CHANGED
@@ -1,21 +1,21 @@
1
1
  import * as ye from "react";
2
- import $, { forwardRef as Be, useMemo as yt, useRef as J, useCallback as oe, useEffect as I, useImperativeHandle as Ve, useState as se, createElement as ce, createContext as zt, useContext as $t } from "react";
3
- import { TextInput as Ge, Loader as Nt, ActionIcon as _e, Combobox as te, Checkbox as Lt, useVirtualizedCombobox as Bt, ScrollArea as Vt, rem as We, Group as we, Button as re, Paper as Gt, Text as Ke, Collapse as qt, Code as Ht, Switch as wt, Tooltip as Q, ScrollAreaAutosize as Wt, LoadingOverlay as Kt, Drawer as Ut, Modal as Jt, Popover as Re, VisuallyHidden as Yt, NativeSelect as Xt, PasswordInput as Qt, Textarea as Zt, Portal as en, Menu as U, Stack as bt, Select as tn, useMantineTheme as nn, useMantineColorScheme as rn, lighten as Ue, darken as on } from "@mantine/core";
2
+ import $, { forwardRef as Be, useMemo as yt, useRef as K, useCallback as oe, useEffect as R, useImperativeHandle as Ve, useState as se, createElement as ce, createContext as zt, useContext as $t } from "react";
3
+ import { TextInput as Ge, Loader as Nt, ActionIcon as Ce, Combobox as te, Checkbox as Lt, useVirtualizedCombobox as Bt, ScrollArea as Vt, rem as We, Group as we, Button as re, Paper as Gt, Text as Ke, Collapse as qt, Code as Ht, Switch as wt, Tooltip as Q, ScrollAreaAutosize as Wt, LoadingOverlay as Kt, Drawer as Ut, Modal as Jt, Popover as Re, VisuallyHidden as Yt, NativeSelect as Xt, PasswordInput as Qt, Textarea as Zt, Portal as en, Menu as W, Stack as bt, Select as tn, useMantineTheme as nn, useMantineColorScheme as rn, lighten as Ue, darken as on } from "@mantine/core";
4
4
  import { flushSync as sn } from "react-dom";
5
- import { createSyncStore as Ce } from "@warkypublic/zustandsyncstore";
6
- import { produce as W } from "immer";
5
+ import { createSyncStore as _e } from "@warkypublic/zustandsyncstore";
6
+ import { produce as q } from "immer";
7
7
  import { IconX as qe, IconExclamationCircle as an, IconDeviceFloppy as ln, IconGrid4x4 as Ie, IconSquarePlus as cn, IconEdit as Je, IconTrashX as Ye, IconExclamationMark as un, IconRefresh as dn, IconMenu2 as fn } from "@tabler/icons-react";
8
8
  import { useForm as hn, FormProvider as mn, Controller as he } from "react-hook-form";
9
9
  import { newUUID as gn, getUUID as xt } from "@warkypublic/artemis-kit";
10
10
  import { get as pn, set as Sn } from "idb-keyval";
11
11
  import { CompactSelection as ne, GridCellKind as ae, DataEditor as vn } from "@glideapps/glide-data-grid";
12
- import { useDebouncedValue as _t, useDebouncedCallback as yn, useElementSize as wn, useMergedRef as bn } from "@mantine/hooks";
12
+ import { useDebouncedValue as Ct, useDebouncedCallback as yn, useElementSize as wn, useMergedRef as bn } from "@mantine/hooks";
13
13
  function xn(r) {
14
14
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
15
15
  }
16
16
  var ge = { exports: {} }, ue = {};
17
17
  var Xe;
18
- function _n() {
18
+ function Cn() {
19
19
  if (Xe) return ue;
20
20
  Xe = 1;
21
21
  var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), o = /* @__PURE__ */ Symbol.for("react.fragment");
@@ -38,25 +38,25 @@ function _n() {
38
38
  }
39
39
  var de = {};
40
40
  var Qe;
41
- function Cn() {
41
+ function _n() {
42
42
  return Qe || (Qe = 1, process.env.NODE_ENV !== "production" && (function() {
43
43
  function r(h) {
44
44
  if (h == null) return null;
45
45
  if (typeof h == "function")
46
- return h.$$typeof === T ? null : h.displayName || h.name || null;
46
+ return h.$$typeof === D ? null : h.displayName || h.name || null;
47
47
  if (typeof h == "string") return h;
48
48
  switch (h) {
49
- case _:
49
+ case C:
50
50
  return "Fragment";
51
51
  case x:
52
52
  return "Profiler";
53
- case C:
53
+ case _:
54
54
  return "StrictMode";
55
55
  case w:
56
56
  return "Suspense";
57
57
  case S:
58
58
  return "SuspenseList";
59
- case B:
59
+ case L:
60
60
  return "Activity";
61
61
  }
62
62
  if (typeof h == "object")
@@ -65,7 +65,7 @@ function Cn() {
65
65
  ), h.$$typeof) {
66
66
  case y:
67
67
  return "Portal";
68
- case R:
68
+ case I:
69
69
  return h.displayName || "Context";
70
70
  case O:
71
71
  return (h._context.displayName || "Context") + ".Consumer";
@@ -74,7 +74,7 @@ function Cn() {
74
74
  return h = h.displayName, h || (h = b.displayName || b.name || "", h = h !== "" ? "ForwardRef(" + h + ")" : "ForwardRef"), h;
75
75
  case E:
76
76
  return b = h.displayName || null, b !== null ? b : r(h.type) || "Memo";
77
- case D:
77
+ case M:
78
78
  b = h._payload, h = h._init;
79
79
  try {
80
80
  return r(h(b));
@@ -104,8 +104,8 @@ function Cn() {
104
104
  }
105
105
  }
106
106
  function t(h) {
107
- if (h === _) return "<>";
108
- if (typeof h == "object" && h !== null && h.$$typeof === D)
107
+ if (h === C) return "<>";
108
+ if (typeof h == "object" && h !== null && h.$$typeof === M)
109
109
  return "<...>";
110
110
  try {
111
111
  var b = r(h);
@@ -115,14 +115,14 @@ function Cn() {
115
115
  }
116
116
  }
117
117
  function n() {
118
- var h = M.A;
118
+ var h = P.A;
119
119
  return h === null ? null : h.getOwner();
120
120
  }
121
121
  function s() {
122
122
  return Error("react-stack-top-frame");
123
123
  }
124
124
  function i(h) {
125
- if (j.call(h, "key")) {
125
+ if (F.call(h, "key")) {
126
126
  var b = Object.getOwnPropertyDescriptor(h, "key").get;
127
127
  if (b && b.isReactWarning) return !1;
128
128
  }
@@ -130,7 +130,7 @@ function Cn() {
130
130
  }
131
131
  function a(h, b) {
132
132
  function k() {
133
- A || (A = !0, console.error(
133
+ j || (j = !0, console.error(
134
134
  "%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)",
135
135
  b
136
136
  ));
@@ -142,19 +142,19 @@ function Cn() {
142
142
  }
143
143
  function l() {
144
144
  var h = r(this.type);
145
- return q[h] || (q[h] = !0, console.error(
145
+ return J[h] || (J[h] = !0, console.error(
146
146
  "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."
147
147
  )), h = this.props.ref, h !== void 0 ? h : null;
148
148
  }
149
- function f(h, b, k, v, z, P) {
150
- var F = k.ref;
149
+ function f(h, b, k, v, z, T) {
150
+ var A = k.ref;
151
151
  return h = {
152
152
  $$typeof: p,
153
153
  type: h,
154
154
  key: b,
155
155
  props: k,
156
156
  _owner: v
157
- }, (F !== void 0 ? F : null) !== null ? Object.defineProperty(h, "ref", {
157
+ }, (A !== void 0 ? A : null) !== null ? Object.defineProperty(h, "ref", {
158
158
  enumerable: !1,
159
159
  get: l
160
160
  }) : Object.defineProperty(h, "ref", { enumerable: !1, value: null }), h._store = {}, Object.defineProperty(h._store, "validated", {
@@ -176,28 +176,28 @@ function Cn() {
176
176
  configurable: !1,
177
177
  enumerable: !1,
178
178
  writable: !0,
179
- value: P
179
+ value: T
180
180
  }), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
181
181
  }
182
- function u(h, b, k, v, z, P) {
183
- var F = b.children;
184
- if (F !== void 0)
182
+ function u(h, b, k, v, z, T) {
183
+ var A = b.children;
184
+ if (A !== void 0)
185
185
  if (v)
186
- if (G(F)) {
187
- for (v = 0; v < F.length; v++)
188
- c(F[v]);
189
- Object.freeze && Object.freeze(F);
186
+ if (U(A)) {
187
+ for (v = 0; v < A.length; v++)
188
+ c(A[v]);
189
+ Object.freeze && Object.freeze(A);
190
190
  } else
191
191
  console.error(
192
192
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
193
193
  );
194
- else c(F);
195
- if (j.call(b, "key")) {
196
- F = r(h);
194
+ else c(A);
195
+ if (F.call(b, "key")) {
196
+ A = r(h);
197
197
  var ee = Object.keys(b).filter(function(Ee) {
198
198
  return Ee !== "key";
199
199
  });
200
- v = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", H[F + v] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
200
+ v = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", G[A + v] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
201
201
  `A props object containing a "key" prop is being spread into JSX:
202
202
  let props = %s;
203
203
  <%s {...props} />
@@ -205,35 +205,35 @@ React keys must be passed directly to JSX without using spread:
205
205
  let props = %s;
206
206
  <%s key={someKey} {...props} />`,
207
207
  v,
208
- F,
208
+ A,
209
209
  ee,
210
- F
211
- ), H[F + v] = !0);
210
+ A
211
+ ), G[A + v] = !0);
212
212
  }
213
- if (F = null, k !== void 0 && (e(k), F = "" + k), i(b) && (e(b.key), F = "" + b.key), "key" in b) {
213
+ if (A = null, k !== void 0 && (e(k), A = "" + k), i(b) && (e(b.key), A = "" + b.key), "key" in b) {
214
214
  k = {};
215
215
  for (var ie in b)
216
216
  ie !== "key" && (k[ie] = b[ie]);
217
217
  } else k = b;
218
- return F && a(
218
+ return A && a(
219
219
  k,
220
220
  typeof h == "function" ? h.displayName || h.name || "Unknown" : h
221
221
  ), f(
222
222
  h,
223
- F,
223
+ A,
224
224
  k,
225
225
  n(),
226
226
  z,
227
- P
227
+ T
228
228
  );
229
229
  }
230
230
  function c(h) {
231
- m(h) ? h._store && (h._store.validated = 1) : typeof h == "object" && h !== null && h.$$typeof === D && (h._payload.status === "fulfilled" ? m(h._payload.value) && h._payload.value._store && (h._payload.value._store.validated = 1) : h._store && (h._store.validated = 1));
231
+ m(h) ? h._store && (h._store.validated = 1) : typeof h == "object" && h !== null && h.$$typeof === M && (h._payload.status === "fulfilled" ? m(h._payload.value) && h._payload.value._store && (h._payload.value._store.validated = 1) : h._store && (h._store.validated = 1));
232
232
  }
233
233
  function m(h) {
234
234
  return typeof h == "object" && h !== null && h.$$typeof === p;
235
235
  }
236
- var g = $, p = /* @__PURE__ */ Symbol.for("react.transitional.element"), y = /* @__PURE__ */ Symbol.for("react.portal"), _ = /* @__PURE__ */ Symbol.for("react.fragment"), C = /* @__PURE__ */ Symbol.for("react.strict_mode"), x = /* @__PURE__ */ Symbol.for("react.profiler"), O = /* @__PURE__ */ Symbol.for("react.consumer"), R = /* @__PURE__ */ Symbol.for("react.context"), N = /* @__PURE__ */ Symbol.for("react.forward_ref"), w = /* @__PURE__ */ Symbol.for("react.suspense"), S = /* @__PURE__ */ Symbol.for("react.suspense_list"), E = /* @__PURE__ */ Symbol.for("react.memo"), D = /* @__PURE__ */ Symbol.for("react.lazy"), B = /* @__PURE__ */ Symbol.for("react.activity"), T = /* @__PURE__ */ Symbol.for("react.client.reference"), M = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, j = Object.prototype.hasOwnProperty, G = Array.isArray, L = console.createTask ? console.createTask : function() {
236
+ var g = $, p = /* @__PURE__ */ Symbol.for("react.transitional.element"), y = /* @__PURE__ */ Symbol.for("react.portal"), C = /* @__PURE__ */ Symbol.for("react.fragment"), _ = /* @__PURE__ */ Symbol.for("react.strict_mode"), x = /* @__PURE__ */ Symbol.for("react.profiler"), O = /* @__PURE__ */ Symbol.for("react.consumer"), I = /* @__PURE__ */ Symbol.for("react.context"), N = /* @__PURE__ */ Symbol.for("react.forward_ref"), w = /* @__PURE__ */ Symbol.for("react.suspense"), S = /* @__PURE__ */ Symbol.for("react.suspense_list"), E = /* @__PURE__ */ Symbol.for("react.memo"), M = /* @__PURE__ */ Symbol.for("react.lazy"), L = /* @__PURE__ */ Symbol.for("react.activity"), D = /* @__PURE__ */ Symbol.for("react.client.reference"), P = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, U = Array.isArray, V = console.createTask ? console.createTask : function() {
237
237
  return null;
238
238
  };
239
239
  g = {
@@ -241,36 +241,36 @@ React keys must be passed directly to JSX without using spread:
241
241
  return h();
242
242
  }
243
243
  };
244
- var A, q = {}, Y = g.react_stack_bottom_frame.bind(
244
+ var j, J = {}, Y = g.react_stack_bottom_frame.bind(
245
245
  g,
246
246
  s
247
- )(), Z = L(t(s)), H = {};
248
- de.Fragment = _, de.jsx = function(h, b, k) {
249
- var v = 1e4 > M.recentlyCreatedOwnerStacks++;
247
+ )(), Z = V(t(s)), G = {};
248
+ de.Fragment = C, de.jsx = function(h, b, k) {
249
+ var v = 1e4 > P.recentlyCreatedOwnerStacks++;
250
250
  return u(
251
251
  h,
252
252
  b,
253
253
  k,
254
254
  !1,
255
255
  v ? Error("react-stack-top-frame") : Y,
256
- v ? L(t(h)) : Z
256
+ v ? V(t(h)) : Z
257
257
  );
258
258
  }, de.jsxs = function(h, b, k) {
259
- var v = 1e4 > M.recentlyCreatedOwnerStacks++;
259
+ var v = 1e4 > P.recentlyCreatedOwnerStacks++;
260
260
  return u(
261
261
  h,
262
262
  b,
263
263
  k,
264
264
  !0,
265
265
  v ? Error("react-stack-top-frame") : Y,
266
- v ? L(t(h)) : Z
266
+ v ? V(t(h)) : Z
267
267
  );
268
268
  };
269
269
  })()), de;
270
270
  }
271
271
  var Ze;
272
272
  function En() {
273
- return Ze || (Ze = 1, process.env.NODE_ENV === "production" ? ge.exports = _n() : ge.exports = Cn()), ge.exports;
273
+ return Ze || (Ze = 1, process.env.NODE_ENV === "production" ? ge.exports = Cn() : ge.exports = _n()), ge.exports;
274
274
  }
275
275
  var d = En();
276
276
  function le(r, o, e) {
@@ -285,19 +285,19 @@ function le(r, o, e) {
285
285
  t = c;
286
286
  let g;
287
287
  if (e.key && ((l = e.debug) != null && l.call(e)) && (g = Date.now()), n = o(...c), e.key && ((f = e.debug) != null && f.call(e))) {
288
- const p = Math.round((Date.now() - u) * 100) / 100, y = Math.round((Date.now() - g) * 100) / 100, _ = y / 16, C = (x, O) => {
288
+ const p = Math.round((Date.now() - u) * 100) / 100, y = Math.round((Date.now() - g) * 100) / 100, C = y / 16, _ = (x, O) => {
289
289
  for (x = String(x); x.length < O; )
290
290
  x = " " + x;
291
291
  return x;
292
292
  };
293
293
  console.info(
294
- `%c⏱ ${C(y, 5)} /${C(p, 5)} ms`,
294
+ `%c⏱ ${_(y, 5)} /${_(p, 5)} ms`,
295
295
  `
296
296
  font-size: .6rem;
297
297
  font-weight: bold;
298
298
  color: hsl(${Math.max(
299
299
  0,
300
- Math.min(120 - 120 * _, 120)
300
+ Math.min(120 - 120 * C, 120)
301
301
  )}deg 100% 31%);`,
302
302
  e?.key
303
303
  );
@@ -562,19 +562,19 @@ class Mn {
562
562
  }
563
563
  for (let m = f; m < e; m++) {
564
564
  const g = s(m), p = this.laneAssignments.get(m);
565
- let y, _;
565
+ let y, C;
566
566
  if (p !== void 0 && this.options.lanes > 1) {
567
567
  y = p;
568
- const R = c[y], N = R !== void 0 ? u[R] : void 0;
569
- _ = N ? N.end + this.options.gap : t + n;
568
+ const I = c[y], N = I !== void 0 ? u[I] : void 0;
569
+ C = N ? N.end + this.options.gap : t + n;
570
570
  } else {
571
- const R = this.options.lanes === 1 ? u[m - 1] : this.getFurthestMeasurement(u, m);
572
- _ = R ? R.end + this.options.gap : t + n, y = R ? R.lane : m % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(m, y);
571
+ const I = this.options.lanes === 1 ? u[m - 1] : this.getFurthestMeasurement(u, m);
572
+ C = I ? I.end + this.options.gap : t + n, y = I ? I.lane : m % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(m, y);
573
573
  }
574
- const C = l.get(g), x = typeof C == "number" ? C : this.options.estimateSize(m), O = _ + x;
574
+ const _ = l.get(g), x = typeof _ == "number" ? _ : this.options.estimateSize(m), O = C + x;
575
575
  u[m] = {
576
576
  index: m,
577
- start: _,
577
+ start: C,
578
578
  size: x,
579
579
  end: O,
580
580
  key: g,
@@ -672,7 +672,7 @@ class Mn {
672
672
  const t = this.getMeasurements();
673
673
  if (t.length !== 0)
674
674
  return et(
675
- t[Ct(
675
+ t[_t(
676
676
  0,
677
677
  t.length - 1,
678
678
  (n) => et(t[n]).start,
@@ -789,7 +789,7 @@ class Mn {
789
789
  }, this.setOptions(o);
790
790
  }
791
791
  }
792
- const Ct = (r, o, e, t) => {
792
+ const _t = (r, o, e, t) => {
793
793
  for (; r <= o; ) {
794
794
  const n = (r + o) / 2 | 0, s = e(n);
795
795
  if (s < t)
@@ -813,7 +813,7 @@ function Pn({
813
813
  startIndex: 0,
814
814
  endIndex: n
815
815
  };
816
- let i = Ct(
816
+ let i = _t(
817
817
  0,
818
818
  n,
819
819
  s,
@@ -861,7 +861,7 @@ function zn(r) {
861
861
  ...r
862
862
  });
863
863
  }
864
- const { Provider: $n, useStore: Nn } = Ce(
864
+ const { Provider: $n, useStore: Nn } = _e(
865
865
  (r, o) => ({
866
866
  boxerData: [],
867
867
  // Data Actions
@@ -888,7 +888,7 @@ const { Provider: $n, useStore: Nn } = Ce(
888
888
  search: e
889
889
  });
890
890
  r(
891
- W((a) => {
891
+ q((a) => {
892
892
  t ? (a.boxerData = i.data, a.page = 0) : a.boxerData = [...a.boxerData ?? [], ...i.data], a.total = i.total, a.hasMore = a.boxerData.length < i.total, a.isFetching = !1;
893
893
  })
894
894
  );
@@ -910,7 +910,7 @@ const { Provider: $n, useStore: Nn } = Ce(
910
910
  loadMore: async () => {
911
911
  const e = o();
912
912
  !e.hasMore || e.isFetching || (r(
913
- W((t) => {
913
+ q((t) => {
914
914
  t.page = t.page + 1;
915
915
  })
916
916
  ), await e.fetchData(e.search));
@@ -936,7 +936,7 @@ const { Provider: $n, useStore: Nn } = Ce(
936
936
  },
937
937
  setState: (e, t) => {
938
938
  r(
939
- W((n) => {
939
+ q((n) => {
940
940
  n[e] = t;
941
941
  })
942
942
  );
@@ -973,7 +973,7 @@ const { Provider: $n, useStore: Nn } = Ce(
973
973
  placeholder: m,
974
974
  search: g
975
975
  } = r, p = i ? /* @__PURE__ */ d.jsx(Nt, { size: "xs" }) : g && e ? /* @__PURE__ */ d.jsx(
976
- _e,
976
+ Ce,
977
977
  {
978
978
  onClick: (y) => {
979
979
  y.stopPropagation(), u();
@@ -1024,7 +1024,7 @@ const Ln = (r) => {
1024
1024
  );
1025
1025
  }), [o, n, e, t]) };
1026
1026
  }, Ot = $.forwardRef((r, o) => {
1027
- const e = J(null), t = J(null), n = J(null), s = J(null), {
1027
+ const e = K(null), t = K(null), n = K(null), s = K(null), {
1028
1028
  boxerData: i,
1029
1029
  clearable: a,
1030
1030
  comboBoxProps: l,
@@ -1035,23 +1035,23 @@ const Ln = (r) => {
1035
1035
  input: g,
1036
1036
  isFetching: p,
1037
1037
  label: y,
1038
- mah: _,
1039
- multiSelect: C,
1038
+ mah: C,
1039
+ multiSelect: _,
1040
1040
  onBufferChange: x,
1041
1041
  onChange: O,
1042
- opened: R,
1042
+ opened: I,
1043
1043
  openOnClear: N,
1044
1044
  placeholder: w,
1045
1045
  scrollAreaProps: S,
1046
1046
  search: E,
1047
- selectedOptionIndex: D,
1048
- selectFirst: B,
1049
- setInput: T,
1050
- setOpened: M,
1051
- setSearch: j,
1052
- setSelectedOptionIndex: G,
1053
- showAll: L,
1054
- value: A
1047
+ selectedOptionIndex: M,
1048
+ selectFirst: L,
1049
+ setInput: D,
1050
+ setOpened: P,
1051
+ setSearch: F,
1052
+ setSelectedOptionIndex: U,
1053
+ showAll: V,
1054
+ value: j
1055
1055
  } = Nn((v) => ({
1056
1056
  boxerData: v.boxerData,
1057
1057
  clearable: v.clearable,
@@ -1080,83 +1080,83 @@ const Ln = (r) => {
1080
1080
  setSelectedOptionIndex: v.setSelectedOptionIndex,
1081
1081
  showAll: v.showAll,
1082
1082
  value: v.value
1083
- })), q = i.length, Y = zn({
1084
- count: q,
1083
+ })), J = i.length, Y = zn({
1084
+ count: J,
1085
1085
  estimateSize: () => 36,
1086
1086
  getScrollElement: () => e.current
1087
- }), Z = Y.getVirtualItems(), H = oe(
1087
+ }), Z = Y.getVirtualItems(), G = oe(
1088
1088
  (v) => {
1089
- const z = typeof v == "string" ? parseInt(v, 10) : v, P = i[z];
1090
- if (P)
1091
- if (C) {
1092
- const F = Array.isArray(A) ? A : [], ie = F.includes(P.value) ? F.filter((Oe) => Oe !== P.value) : [...F, P.value];
1089
+ const z = typeof v == "string" ? parseInt(v, 10) : v, T = i[z];
1090
+ if (T)
1091
+ if (_) {
1092
+ const A = Array.isArray(j) ? j : [], ie = A.includes(T.value) ? A.filter((Oe) => Oe !== T.value) : [...A, T.value];
1093
1093
  O?.(ie);
1094
1094
  const Ee = i.filter((Oe) => ie.includes(Oe.value));
1095
1095
  x?.(Ee);
1096
1096
  } else
1097
- O?.(P.value), j(""), T(P.label), n.current = P.value, M(!1);
1097
+ O?.(T.value), F(""), D(T.label), n.current = T.value, P(!1);
1098
1098
  },
1099
- [i, C, A, O, x, j, T, M]
1099
+ [i, _, j, O, x, F, D, P]
1100
1100
  ), h = oe(() => {
1101
- L && B ? H(0) : (O?.(C ? [] : null), j(""), T(""), t.current?.focus()), N && M(!0);
1102
- }, [L, B, C, O, j, T, N, M, H]), b = Bt({
1101
+ V && L ? G(0) : (O?.(_ ? [] : null), F(""), D(""), t.current?.focus()), N && P(!0);
1102
+ }, [V, L, _, O, F, D, N, P, G]), b = Bt({
1103
1103
  getOptionId: (v) => String(v),
1104
1104
  onDropdownClose: () => {
1105
- M(!1);
1105
+ P(!1);
1106
1106
  },
1107
1107
  onDropdownOpen: () => {
1108
- (!A || C && (!Array.isArray(A) || A.length === 0)) && (j(""), T("")), b.selectFirstOption();
1108
+ (!j || _ && (!Array.isArray(j) || j.length === 0)) && (F(""), D("")), b.selectFirstOption();
1109
1109
  },
1110
- onSelectedOptionSubmit: H,
1111
- opened: R,
1112
- selectedOptionIndex: D,
1110
+ onSelectedOptionSubmit: G,
1111
+ opened: I,
1112
+ selectedOptionIndex: M,
1113
1113
  setSelectedOptionIndex: (v) => {
1114
- G(v), v !== -1 && Y.scrollToIndex(v);
1114
+ U(v), v !== -1 && Y.scrollToIndex(v);
1115
1115
  },
1116
1116
  totalOptionsCount: i.length
1117
1117
  }), { options: k } = Ln({
1118
1118
  boxerData: i,
1119
- multiSelect: C,
1120
- onOptionSubmit: H,
1121
- value: A
1119
+ multiSelect: _,
1120
+ onOptionSubmit: G,
1121
+ value: j
1122
1122
  });
1123
- return I(() => {
1123
+ return R(() => {
1124
1124
  c("", !0);
1125
- }, []), I(() => {
1125
+ }, []), R(() => {
1126
1126
  const v = setTimeout(() => {
1127
- E !== void 0 && R && c(E, !0);
1127
+ E !== void 0 && I && c(E, !0);
1128
1128
  }, 300);
1129
1129
  return () => clearTimeout(v);
1130
- }, [E, R]), I(() => {
1131
- if (C) {
1132
- const v = i.filter((z) => Array.isArray(A) && A.includes(z.value)).map((z) => z.label).join(", ");
1133
- !R && g !== v && (T(v), j(""));
1130
+ }, [E, I]), R(() => {
1131
+ if (_) {
1132
+ const v = i.filter((z) => Array.isArray(j) && j.includes(z.value)).map((z) => z.label).join(", ");
1133
+ !I && g !== v && (D(v), F(""));
1134
1134
  } else {
1135
- const v = i.find((z) => z.value === A)?.label;
1136
- g !== v && (E ?? "") === "" && n.current !== A && A ? T(v ?? "") : !A && !n.current && (E ?? "") === "" && (j(""), T(""));
1135
+ const v = i.find((z) => z.value === j)?.label;
1136
+ g !== v && (E ?? "") === "" && n.current !== j && j ? D(v ?? "") : !j && !n.current && (E ?? "") === "" && (F(""), D(""));
1137
1137
  }
1138
- if (C) {
1139
- const v = i.filter((z) => Array.isArray(A) && A.includes(z.value)) ?? [];
1138
+ if (_) {
1139
+ const v = i.filter((z) => Array.isArray(j) && j.includes(z.value)) ?? [];
1140
1140
  JSON.stringify(s.current) !== JSON.stringify(v) && (x?.(v), s.current = v);
1141
1141
  } else {
1142
- const v = i?.find((z) => z.value === A) ?? null;
1142
+ const v = i?.find((z) => z.value === j) ?? null;
1143
1143
  s.current?.value !== v?.value && (x?.(v), s.current = v);
1144
1144
  }
1145
- }, [A, i, g, E, C, R, x, T, j]), I(() => {
1146
- B && (i?.length ?? 0) > 0 && !C && (A || H?.(0));
1147
- }, [B, i, C]), Ve(o, () => ({
1145
+ }, [j, i, g, E, _, I, x, D, F]), R(() => {
1146
+ L && (i?.length ?? 0) > 0 && !_ && (j || G?.(0));
1147
+ }, [L, i, _]), Ve(o, () => ({
1148
1148
  clear: () => {
1149
1149
  h();
1150
1150
  },
1151
1151
  close: () => {
1152
- M(!1), b.closeDropdown();
1152
+ P(!1), b.closeDropdown();
1153
1153
  },
1154
1154
  focus: () => {
1155
1155
  t.current?.focus();
1156
1156
  },
1157
- getValue: () => A,
1157
+ getValue: () => j,
1158
1158
  open: () => {
1159
- M(!0), b.openDropdown();
1159
+ P(!0), b.openDropdown();
1160
1160
  },
1161
1161
  setValue: (v) => {
1162
1162
  O?.(v);
@@ -1178,11 +1178,11 @@ const Ln = (r) => {
1178
1178
  isFetching: p,
1179
1179
  label: y,
1180
1180
  onBlur: () => {
1181
- !A && !C && (j(""), T(""), b.closeDropdown(), M(!1));
1181
+ !j && !_ && (F(""), D(""), b.closeDropdown(), P(!1));
1182
1182
  },
1183
1183
  onClear: h,
1184
1184
  onSearch: (v) => {
1185
- j(v.currentTarget.value), T(v.currentTarget.value), M(!0);
1185
+ F(v.currentTarget.value), D(v.currentTarget.value), P(!0);
1186
1186
  },
1187
1187
  placeholder: w,
1188
1188
  ref: t,
@@ -1197,11 +1197,11 @@ const Ln = (r) => {
1197
1197
  },
1198
1198
  p: 2,
1199
1199
  ...f,
1200
- children: R && k.length > 0 ? /* @__PURE__ */ d.jsx(te.Options, { children: /* @__PURE__ */ d.jsx(
1200
+ children: I && k.length > 0 ? /* @__PURE__ */ d.jsx(te.Options, { children: /* @__PURE__ */ d.jsx(
1201
1201
  Vt.Autosize,
1202
1202
  {
1203
1203
  ...S,
1204
- mah: _ ?? 200,
1204
+ mah: C ?? 200,
1205
1205
  viewportProps: {
1206
1206
  ...S?.viewportProps,
1207
1207
  onScroll: (v) => {
@@ -1595,7 +1595,7 @@ class so extends $.Component {
1595
1595
  }), this.forceUpdate();
1596
1596
  }
1597
1597
  }
1598
- const { Provider: qn, useStore: me } = Ce(
1598
+ const { Provider: qn, useStore: me } = _e(
1599
1599
  (r, o) => ({
1600
1600
  getAllState: () => o(),
1601
1601
  getState: (e) => o()?.[e],
@@ -1680,14 +1680,14 @@ const { Provider: qn, useStore: me } = Ce(
1680
1680
  },
1681
1681
  setState: (e, t) => {
1682
1682
  r(
1683
- W((n) => {
1683
+ q((n) => {
1684
1684
  n[e] = t;
1685
1685
  })
1686
1686
  );
1687
1687
  },
1688
1688
  setStateFN: (e, t) => new Promise((s, i) => {
1689
1689
  r(
1690
- W((a) => {
1690
+ q((a) => {
1691
1691
  if (typeof t == "function")
1692
1692
  a[e] = t(a[e]);
1693
1693
  else
@@ -1866,7 +1866,7 @@ const { Provider: qn, useStore: me } = Ce(
1866
1866
  save: m.save,
1867
1867
  scrollAreaProps: m.scrollAreaProps
1868
1868
  }));
1869
- return I(() => {
1869
+ return R(() => {
1870
1870
  e && e() && l !== "insert" && n(!0);
1871
1871
  }, [e, l, a]), /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
1872
1872
  /* @__PURE__ */ d.jsx(Wn, {}),
@@ -1930,7 +1930,7 @@ const { Provider: qn, useStore: me } = Ce(
1930
1930
  useFormProps: g,
1931
1931
  validate: p,
1932
1932
  values: y,
1933
- wrapper: _
1933
+ wrapper: C
1934
1934
  } = me((x) => ({
1935
1935
  getAllState: x.getAllState,
1936
1936
  getState: x.getState,
@@ -1946,7 +1946,7 @@ const { Provider: qn, useStore: me } = Ce(
1946
1946
  validate: x.validate,
1947
1947
  values: x.values,
1948
1948
  wrapper: x.wrapper
1949
- })), C = hn({
1949
+ })), _ = hn({
1950
1950
  defaultValues: f,
1951
1951
  mode: "all",
1952
1952
  shouldUseNativeValidation: !0,
@@ -1973,14 +1973,14 @@ const { Provider: qn, useStore: me } = Ce(
1973
1973
  validate: async () => await p()
1974
1974
  }),
1975
1975
  [n, t, s, p, c, u, m, i, a]
1976
- ), I(() => {
1977
- m("getFormMethods", () => C), C && C.subscribe({
1976
+ ), R(() => {
1977
+ m("getFormMethods", () => _), _ && _.subscribe({
1978
1978
  callback: ({ isDirty: x }) => {
1979
1979
  m("dirty", x);
1980
1980
  },
1981
1981
  formState: { isDirty: !0 }
1982
1982
  });
1983
- }, [C]), /* @__PURE__ */ d.jsx(mn, { ...C, children: typeof _ == "function" ? _(
1983
+ }, [_]), /* @__PURE__ */ d.jsx(mn, { ..._, children: typeof C == "function" ? C(
1984
1984
  /* @__PURE__ */ d.jsx(st, { children: o.children }),
1985
1985
  l ?? !1,
1986
1986
  i ?? (() => {
@@ -2167,7 +2167,7 @@ const lo = (r) => {
2167
2167
  }, mo = (r) => {
2168
2168
  const [o, e] = se(!1);
2169
2169
  return /* @__PURE__ */ d.jsx(Q, { label: r.tooltip ?? "", withArrow: !0, children: /* @__PURE__ */ d.jsxs(
2170
- _e,
2170
+ Ce,
2171
2171
  {
2172
2172
  loaderProps: {
2173
2173
  type: "bars"
@@ -2328,16 +2328,16 @@ function Yn() {
2328
2328
  }
2329
2329
  var e = typeof Object.is == "function" ? Object.is : o, t = r.useState, n = r.useEffect, s = r.useLayoutEffect, i = r.useDebugValue;
2330
2330
  function a(c, m) {
2331
- var g = m(), p = t({ inst: { value: g, getSnapshot: m } }), y = p[0].inst, _ = p[1];
2331
+ var g = m(), p = t({ inst: { value: g, getSnapshot: m } }), y = p[0].inst, C = p[1];
2332
2332
  return s(
2333
2333
  function() {
2334
- y.value = g, y.getSnapshot = m, l(y) && _({ inst: y });
2334
+ y.value = g, y.getSnapshot = m, l(y) && C({ inst: y });
2335
2335
  },
2336
2336
  [c, g, m]
2337
2337
  ), n(
2338
2338
  function() {
2339
- return l(y) && _({ inst: y }), c(function() {
2340
- l(y) && _({ inst: y });
2339
+ return l(y) && C({ inst: y }), c(function() {
2340
+ l(y) && C({ inst: y });
2341
2341
  });
2342
2342
  },
2343
2343
  [c]
@@ -2372,24 +2372,24 @@ function Xn() {
2372
2372
  ));
2373
2373
  var y = p();
2374
2374
  if (!c) {
2375
- var _ = p();
2376
- s(y, _) || (console.error(
2375
+ var C = p();
2376
+ s(y, C) || (console.error(
2377
2377
  "The result of getSnapshot should be cached to avoid an infinite loop"
2378
2378
  ), c = !0);
2379
2379
  }
2380
- _ = i({
2380
+ C = i({
2381
2381
  inst: { value: y, getSnapshot: p }
2382
2382
  });
2383
- var C = _[0].inst, x = _[1];
2383
+ var _ = C[0].inst, x = C[1];
2384
2384
  return l(
2385
2385
  function() {
2386
- C.value = y, C.getSnapshot = p, e(C) && x({ inst: C });
2386
+ _.value = y, _.getSnapshot = p, e(_) && x({ inst: _ });
2387
2387
  },
2388
2388
  [g, y, p]
2389
2389
  ), a(
2390
2390
  function() {
2391
- return e(C) && x({ inst: C }), g(function() {
2392
- e(C) && x({ inst: C });
2391
+ return e(_) && x({ inst: _ }), g(function() {
2392
+ e(_) && x({ inst: _ });
2393
2393
  });
2394
2394
  },
2395
2395
  [g]
@@ -2434,38 +2434,38 @@ function Qn() {
2434
2434
  } else y = p.current;
2435
2435
  p = a(
2436
2436
  function() {
2437
- function C(w) {
2437
+ function _(w) {
2438
2438
  if (!x) {
2439
2439
  if (x = !0, O = w, w = m(w), g !== void 0 && y.hasValue) {
2440
2440
  var S = y.value;
2441
2441
  if (g(S, w))
2442
- return R = S;
2442
+ return I = S;
2443
2443
  }
2444
- return R = w;
2444
+ return I = w;
2445
2445
  }
2446
- if (S = R, t(O, w)) return S;
2446
+ if (S = I, t(O, w)) return S;
2447
2447
  var E = m(w);
2448
- return g !== void 0 && g(S, E) ? (O = w, S) : (O = w, R = E);
2448
+ return g !== void 0 && g(S, E) ? (O = w, S) : (O = w, I = E);
2449
2449
  }
2450
- var x = !1, O, R, N = c === void 0 ? null : c;
2450
+ var x = !1, O, I, N = c === void 0 ? null : c;
2451
2451
  return [
2452
2452
  function() {
2453
- return C(u());
2453
+ return _(u());
2454
2454
  },
2455
2455
  N === null ? void 0 : function() {
2456
- return C(N());
2456
+ return _(N());
2457
2457
  }
2458
2458
  ];
2459
2459
  },
2460
2460
  [u, c, m, g]
2461
2461
  );
2462
- var _ = n(f, p[0], p[1]);
2462
+ var C = n(f, p[0], p[1]);
2463
2463
  return i(
2464
2464
  function() {
2465
- y.hasValue = !0, y.value = _;
2465
+ y.hasValue = !0, y.value = C;
2466
2466
  },
2467
- [_]
2468
- ), l(_), _;
2467
+ [C]
2468
+ ), l(C), C;
2469
2469
  }, je;
2470
2470
  }
2471
2471
  var Te = {};
@@ -2485,39 +2485,39 @@ function Zn() {
2485
2485
  } else y = p.current;
2486
2486
  p = a(
2487
2487
  function() {
2488
- function C(w) {
2488
+ function _(w) {
2489
2489
  if (!x) {
2490
2490
  if (x = !0, O = w, w = m(w), g !== void 0 && y.hasValue) {
2491
2491
  var S = y.value;
2492
2492
  if (g(S, w))
2493
- return R = S;
2493
+ return I = S;
2494
2494
  }
2495
- return R = w;
2495
+ return I = w;
2496
2496
  }
2497
- if (S = R, t(O, w))
2497
+ if (S = I, t(O, w))
2498
2498
  return S;
2499
2499
  var E = m(w);
2500
- return g !== void 0 && g(S, E) ? (O = w, S) : (O = w, R = E);
2500
+ return g !== void 0 && g(S, E) ? (O = w, S) : (O = w, I = E);
2501
2501
  }
2502
- var x = !1, O, R, N = c === void 0 ? null : c;
2502
+ var x = !1, O, I, N = c === void 0 ? null : c;
2503
2503
  return [
2504
2504
  function() {
2505
- return C(u());
2505
+ return _(u());
2506
2506
  },
2507
2507
  N === null ? void 0 : function() {
2508
- return C(N());
2508
+ return _(N());
2509
2509
  }
2510
2510
  ];
2511
2511
  },
2512
2512
  [u, c, m, g]
2513
2513
  );
2514
- var _ = n(f, p[0], p[1]);
2514
+ var C = n(f, p[0], p[1]);
2515
2515
  return i(
2516
2516
  function() {
2517
- y.hasValue = !0, y.value = _;
2517
+ y.hasValue = !0, y.value = C;
2518
2518
  },
2519
- [_]
2520
- ), l(_), _;
2519
+ [C]
2520
+ ), l(C), C;
2521
2521
  }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
2522
2522
  })()), Te;
2523
2523
  }
@@ -2862,7 +2862,7 @@ const Me = async () => {
2862
2862
  } finally {
2863
2863
  e();
2864
2864
  }
2865
- }, V = rr((r, o) => ({
2865
+ }, B = rr((r, o) => ({
2866
2866
  ...$e,
2867
2867
  ...dr(r),
2868
2868
  ...fr(r),
@@ -2873,7 +2873,7 @@ const Me = async () => {
2873
2873
  ...Sr(r, o)
2874
2874
  }));
2875
2875
  xe = cr().then((r) => {
2876
- V.setState(
2876
+ B.setState(
2877
2877
  (o) => ({
2878
2878
  ...o,
2879
2879
  ...r,
@@ -2889,20 +2889,20 @@ xe = cr().then((r) => {
2889
2889
  // Replace state completely to avoid triggering subscription during init
2890
2890
  );
2891
2891
  }).catch((r) => {
2892
- console.error("Error loading storage:", r), V.setState({ initialized: !0 });
2892
+ console.error("Error loading storage:", r), B.setState({ initialized: !0 });
2893
2893
  }).finally(() => {
2894
2894
  kt = !0, xe = null;
2895
2895
  });
2896
- V.subscribe((r) => {
2896
+ B.subscribe((r) => {
2897
2897
  kt && ur(r).catch((o) => {
2898
2898
  console.error("Error saving storage:", o);
2899
2899
  });
2900
2900
  });
2901
- const vr = ((r) => (o) => ir(r, o, Jn)), wo = vr(V), bo = (r) => {
2902
- V.getState().setApiURL(r);
2903
- }, xo = () => V.getState().session.apiURL ?? "", _o = () => V.getState().session.authToken ?? "", Co = () => V.getState().isLoggedIn(), Eo = (r) => {
2904
- V.getState().setAuthToken(r);
2905
- }, yr = () => V.getState(), jt = zt(null);
2901
+ const vr = ((r) => (o) => ir(r, o, Jn)), wo = vr(B), bo = (r) => {
2902
+ B.getState().setApiURL(r);
2903
+ }, xo = () => B.getState().session.apiURL ?? "", Co = () => B.getState().session.authToken ?? "", _o = () => B.getState().isLoggedIn(), Eo = (r) => {
2904
+ B.getState().setAuthToken(r);
2905
+ }, yr = () => B.getState(), jt = zt(null);
2906
2906
  function Oo({
2907
2907
  apiURL: r,
2908
2908
  autoFetch: o = !0,
@@ -2914,12 +2914,12 @@ function Oo({
2914
2914
  program: a,
2915
2915
  throttleMs: l = 0
2916
2916
  }) {
2917
- const f = J(0), u = J(!1), c = J(!1), m = oe(
2917
+ const f = K(0), u = K(!1), c = K(!1), m = oe(
2918
2918
  async (y) => {
2919
- const _ = Date.now(), C = _ - f.current;
2920
- if (!u.current && !(l > 0 && C < l))
2919
+ const C = Date.now(), _ = C - f.current;
2920
+ if (!u.current && !(l > 0 && _ < l))
2921
2921
  try {
2922
- u.current = !0, f.current = _, await V.getState().fetchData(y);
2922
+ u.current = !0, f.current = C, await B.getState().fetchData(y);
2923
2923
  } finally {
2924
2924
  u.current = !1;
2925
2925
  }
@@ -2928,17 +2928,17 @@ function Oo({
2928
2928
  ), g = oe(async () => {
2929
2929
  await m();
2930
2930
  }, [m]);
2931
- I(() => {
2932
- r && V.getState().setApiURL(r);
2933
- }, [r]), I(() => {
2934
- a && V.getState().setProgram(a);
2935
- }, [a]), I(() => {
2936
- n && V.setState({ onFetchSession: n });
2937
- }, [n]), I(() => {
2938
- s && V.setState({ onLogin: s });
2939
- }, [s]), I(() => {
2940
- i && V.setState({ onLogout: i });
2941
- }, [i]), I(() => {
2931
+ R(() => {
2932
+ r && B.getState().setApiURL(r);
2933
+ }, [r]), R(() => {
2934
+ a && B.getState().setProgram(a);
2935
+ }, [a]), R(() => {
2936
+ n && B.setState({ onFetchSession: n });
2937
+ }, [n]), R(() => {
2938
+ s && B.setState({ onLogin: s });
2939
+ }, [s]), R(() => {
2940
+ i && B.setState({ onLogout: i });
2941
+ }, [i]), R(() => {
2942
2942
  c.current || (c.current = !0, o && t && m(r).catch((y) => {
2943
2943
  console.error("Failed to fetch on mount:", y);
2944
2944
  }));
@@ -3010,7 +3010,7 @@ const wr = "gridler_golang_restapi_v2_token", br = (r, o) => {
3010
3010
  }
3011
3011
  }
3012
3012
  }, St = () => xr?.getAuthToken?.();
3013
- function _r(r, o) {
3013
+ function Cr(r, o) {
3014
3014
  if (!r || !o || r.includes("..") || r.includes("[]") || /\[\s*\]/.test(r))
3015
3015
  return;
3016
3016
  const e = r.replace(/\[(\w+)\]/g, ".$1").split(".").filter(Boolean);
@@ -3020,7 +3020,7 @@ function _r(r, o) {
3020
3020
  return t[n];
3021
3021
  }, o);
3022
3022
  }
3023
- const { Provider: Cr, useStore: At } = Ce(
3023
+ const { Provider: _r, useStore: At } = _e(
3024
3024
  (r, o) => ({
3025
3025
  hide: (e) => {
3026
3026
  o().setInstanceState(e, "visible", !1);
@@ -3028,7 +3028,7 @@ const { Provider: Cr, useStore: At } = Ce(
3028
3028
  menus: [],
3029
3029
  setInstanceState: (e, t, n) => {
3030
3030
  r(
3031
- W((s) => {
3031
+ q((s) => {
3032
3032
  const i = s?.menus?.findIndex((a) => a.id === e);
3033
3033
  i >= 0 && (s.menus[i][t] = n);
3034
3034
  })
@@ -3036,7 +3036,7 @@ const { Provider: Cr, useStore: At } = Ce(
3036
3036
  },
3037
3037
  setState: (e, t) => {
3038
3038
  r(
3039
- W((n) => {
3039
+ q((n) => {
3040
3040
  n[e] = t;
3041
3041
  })
3042
3042
  );
@@ -3044,7 +3044,7 @@ const { Provider: Cr, useStore: At } = Ce(
3044
3044
  show: (e, t) => {
3045
3045
  const n = o(), s = n.menus.findIndex((a) => a.id === e), i = n.menus[s] ? { ...n.menus[s] } : {};
3046
3046
  Object.assign(i, t), i.id = i.id ?? e, i.visible = !(i.visible ?? !1), s < 0 ? n.setState("menus", [...n.menus, i]) : r(
3047
- W((a) => {
3047
+ q((a) => {
3048
3048
  a.menus || (a.menus = []), a.menus[s] = { ...a.menus[s], ...i };
3049
3049
  })
3050
3050
  );
@@ -3064,7 +3064,7 @@ function Er() {
3064
3064
  }));
3065
3065
  return /* @__PURE__ */ d.jsx(en, { id: `bmm_portal_${o}`, children: $.Children.toArray(
3066
3066
  r?.map((n, s) => /* @__PURE__ */ ce(
3067
- U,
3067
+ W,
3068
3068
  {
3069
3069
  shadow: "md",
3070
3070
  width: t ?? "300",
@@ -3075,14 +3075,14 @@ function Er() {
3075
3075
  },
3076
3076
  opened: n.visible
3077
3077
  },
3078
- /* @__PURE__ */ d.jsx(U.Target, { children: /* @__PURE__ */ d.jsx(
3078
+ /* @__PURE__ */ d.jsx(W.Target, { children: /* @__PURE__ */ d.jsx(
3079
3079
  "div",
3080
3080
  {
3081
3081
  id: `bmm_${o}_${s}_target`,
3082
3082
  style: { left: n.x, position: "fixed", top: n.y, visibility: "hidden" }
3083
3083
  }
3084
3084
  ) }),
3085
- /* @__PURE__ */ d.jsx(U.Dropdown, { children: n.renderer ? n.renderer : $.Children.toArray(
3085
+ /* @__PURE__ */ d.jsx(W.Dropdown, { children: n.renderer ? n.renderer : $.Children.toArray(
3086
3086
  n.items?.map((i, a) => /* @__PURE__ */ d.jsx(
3087
3087
  Ft,
3088
3088
  {
@@ -3096,9 +3096,9 @@ function Er() {
3096
3096
  }
3097
3097
  const Ft = ({ children: r, label: o, ...e }) => {
3098
3098
  const [t, n] = se(!1);
3099
- return typeof e.renderer == "function" ? e.renderer({ ...e, loading: t, renderer: void 0, setLoading: n }) : typeof e.renderer == "object" ? e.renderer : e.isDivider ? /* @__PURE__ */ d.jsx(U.Divider, {}) : e.items && e.items.length > 0 ? /* @__PURE__ */ d.jsxs(U.Sub, { children: [
3100
- /* @__PURE__ */ d.jsx(U.Sub.Target, { children: /* @__PURE__ */ d.jsx(
3101
- U.Sub.Item,
3099
+ return typeof e.renderer == "function" ? e.renderer({ ...e, loading: t, renderer: void 0, setLoading: n }) : typeof e.renderer == "object" ? e.renderer : e.isDivider ? /* @__PURE__ */ d.jsx(W.Divider, {}) : e.items && e.items.length > 0 ? /* @__PURE__ */ d.jsxs(W.Sub, { children: [
3100
+ /* @__PURE__ */ d.jsx(W.Sub.Target, { children: /* @__PURE__ */ d.jsx(
3101
+ W.Sub.Item,
3102
3102
  {
3103
3103
  ...e,
3104
3104
  disabled: t,
@@ -3115,7 +3115,7 @@ const Ft = ({ children: r, label: o, ...e }) => {
3115
3115
  children: r ?? o
3116
3116
  }
3117
3117
  ) }),
3118
- /* @__PURE__ */ d.jsx(U.Sub.Dropdown, { children: $.Children.toArray(
3118
+ /* @__PURE__ */ d.jsx(W.Sub.Dropdown, { children: $.Children.toArray(
3119
3119
  e.items.map((s, i) => /* @__PURE__ */ d.jsx(
3120
3120
  Ft,
3121
3121
  {
@@ -3124,11 +3124,11 @@ const Ft = ({ children: r, label: o, ...e }) => {
3124
3124
  `bmm_subitem_${s?.id ?? ""}${i}`
3125
3125
  ))
3126
3126
  ) })
3127
- ] }) : !e.onClick && !e.onClickAsync ? /* @__PURE__ */ d.jsxs(U.Label, { ...e, children: [
3127
+ ] }) : !e.onClick && !e.onClickAsync ? /* @__PURE__ */ d.jsxs(W.Label, { ...e, children: [
3128
3128
  " ",
3129
3129
  r ?? o
3130
3130
  ] }) : /* @__PURE__ */ d.jsx(
3131
- U.Item,
3131
+ W.Item,
3132
3132
  {
3133
3133
  ...e,
3134
3134
  disabled: t,
@@ -3147,7 +3147,7 @@ const Ft = ({ children: r, label: o, ...e }) => {
3147
3147
  );
3148
3148
  };
3149
3149
  function Or(r) {
3150
- return /* @__PURE__ */ d.jsxs(Cr, { ...r, children: [
3150
+ return /* @__PURE__ */ d.jsxs(_r, { ...r, children: [
3151
3151
  /* @__PURE__ */ d.jsx(Er, {}),
3152
3152
  r.children
3153
3153
  ] });
@@ -3161,8 +3161,8 @@ const Rr = [
3161
3161
  { label: "Less Than", value: "lt" },
3162
3162
  { label: "Less Than or Equal", value: "lte" }
3163
3163
  ], Ir = (r) => {
3164
- const o = r.storeState?.colFilters?.findIndex((i) => i.id === r.column.id) ?? -1, e = r.storeState?.colFilters?.[o] ?? { id: r.column.id, value: "" }, [t, n] = se(e?.value ?? ""), [s] = _t(t, 900);
3165
- return I(() => {
3164
+ const o = r.storeState?.colFilters?.findIndex((i) => i.id === r.column.id) ?? -1, e = r.storeState?.colFilters?.[o] ?? { id: r.column.id, value: "" }, [t, n] = se(e?.value ?? ""), [s] = Ct(t, 900);
3165
+ return R(() => {
3166
3166
  r.storeState.setStateFN("colFilters", (i) => {
3167
3167
  const a = i?.findIndex((f) => f.id === r.column.id) ?? -1, l = i ?? [];
3168
3168
  return a >= 0 ? l[a] = {
@@ -3181,7 +3181,7 @@ const Rr = [
3181
3181
  Ge,
3182
3182
  {
3183
3183
  onChange: (i) => n(i.target.value),
3184
- rightSection: /* @__PURE__ */ d.jsx(_e, { color: "gray", onClick: () => n(""), variant: "filled", children: /* @__PURE__ */ d.jsx(qe, { color: "red" }) }),
3184
+ rightSection: /* @__PURE__ */ d.jsx(Ce, { color: "gray", onClick: () => n(""), variant: "filled", children: /* @__PURE__ */ d.jsx(qe, { color: "red" }) }),
3185
3185
  value: t ?? e?.value
3186
3186
  }
3187
3187
  );
@@ -3191,8 +3191,8 @@ const Rr = [
3191
3191
  operator: "contains"
3192
3192
  }, [t, n] = se(
3193
3193
  e?.operator ?? "contains"
3194
- ), [s] = _t(t, 900);
3195
- return I(() => {
3194
+ ), [s] = Ct(t, 900);
3195
+ return R(() => {
3196
3196
  r.storeState.setStateFN("colFilters", (i) => {
3197
3197
  const a = i?.findIndex((f) => f.id === r.column.id) ?? -1, l = i ?? [];
3198
3198
  return a >= 0 ? l[a] = {
@@ -3235,7 +3235,7 @@ const Rr = [
3235
3235
  d="M15 17.5a.5.5 0 0 1-1 0V3.707l-2.146 2.147a.5.5 0 0 1-.708-.708l3-3a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L15 3.707zM2.5 16a.5.5 0 0 1 0-1h9a.5.5 0 0 1 0 1zM5 12.5a.5.5 0 0 0 .5.5h6a.5.5 0 0 0 0-1h-6a.5.5 0 0 0-.5.5M8.5 10a.5.5 0 0 1 0-1h3a.5.5 0 0 1 0 1z"
3236
3236
  ></path>
3237
3237
  </svg>
3238
- `, ve = (r) => /* @__PURE__ */ d.jsx("img", { alt: r.alt ?? "Sprite Image", src: `data:image/svg+xml;utf8,${r.sprite({ ...r, sprite: void 0 })}` }), { Provider: jr, useStore: K } = Ce(
3238
+ `, ve = (r) => /* @__PURE__ */ d.jsx("img", { alt: r.alt ?? "Sprite Image", src: `data:image/svg+xml;utf8,${r.sprite({ ...r, sprite: void 0 })}` }), { Provider: jr, useStore: H } = _e(
3239
3239
  (r, o) => ({
3240
3240
  _events: new EventTarget(),
3241
3241
  _loadingList: ne.empty(),
@@ -3249,7 +3249,7 @@ const Rr = [
3249
3249
  addError: (e, ...t) => {
3250
3250
  const n = o();
3251
3251
  console.log("Gridler Error", n.uniqueid, e, t), r(
3252
- W((s) => {
3252
+ q((s) => {
3253
3253
  s.errors = [...s.errors, e];
3254
3254
  })
3255
3255
  );
@@ -3318,14 +3318,14 @@ const Rr = [
3318
3318
  for (const f in s[l]) {
3319
3319
  const u = Number(l) * i + Number(f);
3320
3320
  if (String(s[l][f]?.[a]) === String(e)) {
3321
- n = s[l][f]?._rownumber > 0 ? s[l][f]?._rownumber : u > 0 ? u : -1;
3321
+ n = s[l][f]?._rownumber > 0 ? s[l][f]?._rownumber : u >= 0 ? u : -1;
3322
3322
  break;
3323
3323
  }
3324
3324
  }
3325
- if (n > 0)
3325
+ if (n >= 0)
3326
3326
  return n;
3327
3327
  }
3328
- if (n > 0)
3328
+ if (n >= 0)
3329
3329
  return n;
3330
3330
  if (typeof t.askAPIRowNumber == "function") {
3331
3331
  const l = await t.askAPIRowNumber(String(e));
@@ -3636,14 +3636,14 @@ const Rr = [
3636
3636
  },
3637
3637
  setState: (e, t) => {
3638
3638
  r(
3639
- W((n) => {
3639
+ q((n) => {
3640
3640
  n[e] = t;
3641
3641
  })
3642
3642
  );
3643
3643
  },
3644
3644
  setStateFN: (e, t) => new Promise((s, i) => {
3645
3645
  r(
3646
- W((a) => {
3646
+ q((a) => {
3647
3647
  if (typeof t == "function")
3648
3648
  a[e] = t(a[e]);
3649
3649
  else
@@ -3659,7 +3659,7 @@ const Rr = [
3659
3659
  kind: ae.Loading
3660
3660
  };
3661
3661
  try {
3662
- const l = String(a).includes(".") ? _r(a, e) ?? "" : e?.[a];
3662
+ const l = String(a).includes(".") ? Cr(a, e) ?? "" : e?.[a];
3663
3663
  return i?.Cell ? { kind: ae.Text, ...i?.Cell(e, t, a, l, n) } : n.RenderCell ? n.RenderCell(e, t, a, l, n) : {
3664
3664
  allowOverlay: !0,
3665
3665
  data: l ?? "",
@@ -3679,7 +3679,7 @@ const Rr = [
3679
3679
  }),
3680
3680
  (r) => {
3681
3681
  const [o, e] = r.useStore((n) => [n.setState, n.getState]), t = At();
3682
- return I(() => {
3682
+ return R(() => {
3683
3683
  const n = e("onMounted");
3684
3684
  if (typeof n == "function" && n(e, o), o("mounted", !0), window && window.document && !window.document.getElementById("portal")) {
3685
3685
  const i = window.document.createElement("div");
@@ -3710,7 +3710,7 @@ const Rr = [
3710
3710
  }
3711
3711
  );
3712
3712
  function Ar(r) {
3713
- const [o, e, t, n, s] = K((l) => [
3713
+ const [o, e, t, n, s] = H((l) => [
3714
3714
  l.setStateFN,
3715
3715
  l.setState,
3716
3716
  l.getState,
@@ -3718,12 +3718,12 @@ function Ar(r) {
3718
3718
  l.mounted
3719
3719
  ]), i = oe(
3720
3720
  async (l) => {
3721
- const f = t("columns"), u = t("colSort"), c = t("pageSize"), m = t("colFilters"), g = t("searchStr"), p = t("searchFields"), y = t("_active_requests"), _ = t("keyField");
3721
+ const f = t("columns"), u = t("colSort"), c = t("pageSize"), m = t("colFilters"), g = t("searchStr"), p = t("searchFields"), y = t("_active_requests"), C = t("keyField");
3722
3722
  e("loadingData", !0);
3723
3723
  try {
3724
3724
  if (r && r.url) {
3725
- const C = new Headers();
3726
- C.set("Authorization", `Token ${r.authtoken}`);
3725
+ const _ = new Headers();
3726
+ _.set("Authorization", `Token ${r.authtoken}`);
3727
3727
  const x = [
3728
3728
  { type: "limit", value: String(c ?? 50) },
3729
3729
  { type: "offset", value: String((c ?? 50) * l) }
@@ -3753,18 +3753,18 @@ function Ar(r) {
3753
3753
  value: r.filter
3754
3754
  }), (r.options ?? []).length > 0 && x.push(...r.options ?? []);
3755
3755
  const O = f?.filter((S) => !S.virtual)?.map((S) => S.id) ?? [];
3756
- if (r.hotfields && r.hotfields.length > 0 && O?.push(r.hotfields.join(",")), _ && (O.includes(_) || O.push(_)), O && O.length > 0 && x.push({
3756
+ if (r.hotfields && r.hotfields.length > 0 && O?.push(r.hotfields.join(",")), C && (O.includes(C) || O.push(C)), O && O.length > 0 && x.push({
3757
3757
  type: "select-fields",
3758
3758
  value: O.join(",")
3759
3759
  }), x && x.length > 0) {
3760
3760
  const S = fe(x);
3761
3761
  for (const E in fe(x))
3762
- C.set(E, S[E]);
3762
+ _.set(E, S[E]);
3763
3763
  }
3764
- const R = y?.findIndex((S) => S.page === l) ?? -1;
3764
+ const I = y?.findIndex((S) => S.page === l) ?? -1;
3765
3765
  if (y?.forEach((S) => {
3766
3766
  (S.page >= 0 && S.page < l - 2 || l >= 0 && S.page > l + 2) && S.controller?.abort?.();
3767
- }), y && R >= 0 && y[R]) {
3767
+ }), y && I >= 0 && y[I]) {
3768
3768
  e("loadingData", !1);
3769
3769
  return;
3770
3770
  }
@@ -3776,7 +3776,7 @@ function Ar(r) {
3776
3776
  const w = await fetch(
3777
3777
  `${r.url}?x-limit=${String(c ?? 50)}&x-offset=${String((c ?? 50) * l)}`,
3778
3778
  {
3779
- headers: C,
3779
+ headers: _,
3780
3780
  method: "GET",
3781
3781
  signal: N?.signal
3782
3782
  }
@@ -3844,9 +3844,9 @@ function Ar(r) {
3844
3844
  }
3845
3845
  return [];
3846
3846
  },
3847
- [r.url, r.authtoken, r.filter, r.options, t, n]
3847
+ [r.url, r.authtoken, r.filter, JSON.stringify(r.options), t, n]
3848
3848
  );
3849
- return I(() => {
3849
+ return R(() => {
3850
3850
  e("useAPIQuery", i), e("askAPIRowNumber", a);
3851
3851
  const l = t("isValuesInPages"), f = t("_refresh");
3852
3852
  l || e("values", []), f?.().then(() => {
@@ -3861,13 +3861,13 @@ function Ar(r) {
3861
3861
  const Fr = $.memo(Ar);
3862
3862
  Fr.displayName = "Gridler-GlidlerAPIAdaptorForGoLangv2";
3863
3863
  function Tr(r) {
3864
- const [o, e, t, n] = K((i) => [
3864
+ const [o, e, t, n] = H((i) => [
3865
3865
  i.getState,
3866
3866
  i.mounted,
3867
3867
  i.setState,
3868
3868
  i._events
3869
3869
  ]);
3870
- I(() => {
3870
+ R(() => {
3871
3871
  if (e && r.changeOnActiveClick) {
3872
3872
  const i = (a) => {
3873
3873
  const { row: l, state: f } = a.detail, u = f.getRowBuffer;
@@ -3891,8 +3891,8 @@ function Tr(r) {
3891
3891
  c.push(...u);
3892
3892
  const m = o("_gridSelection")?.rows.toArray() ?? [], g = m.length > 1;
3893
3893
  if (!l) {
3894
- const _ = m[0];
3895
- _ !== void 0 && (l = a.getRowBuffer(_));
3894
+ const C = m[0];
3895
+ C !== void 0 && (l = a.getRowBuffer(C));
3896
3896
  }
3897
3897
  const p = typeof r.descriptionField == "string" ? l?.[r.descriptionField] : typeof r.descriptionField == "function" && l ? r.descriptionField(l) : void 0;
3898
3898
  (i === "other" || i === "cell" && !l) && c.push({
@@ -3915,7 +3915,7 @@ function Tr(r) {
3915
3915
  onClick: () => {
3916
3916
  r.onRequestForm(
3917
3917
  "change",
3918
- m.map((_) => a.getRowBuffer(_))
3918
+ m.map((C) => a.getRowBuffer(C))
3919
3919
  );
3920
3920
  }
3921
3921
  }), c.push({
@@ -3925,7 +3925,7 @@ function Tr(r) {
3925
3925
  onClick: () => {
3926
3926
  r.onRequestForm(
3927
3927
  "delete",
3928
- m.map((_) => a.getRowBuffer(_))
3928
+ m.map((C) => a.getRowBuffer(C))
3929
3929
  );
3930
3930
  }
3931
3931
  })) : (c.push({
@@ -3961,11 +3961,11 @@ function Tr(r) {
3961
3961
  },
3962
3962
  [r.onRequestForm, o]
3963
3963
  );
3964
- return I(() => (e && typeof t == "function" && o("getMenuItems") !== s && t("getMenuItems", s), () => {
3964
+ return R(() => (e && typeof t == "function" && o("getMenuItems") !== s && t("getMenuItems", s), () => {
3965
3965
  }), [r.getMenuItems, e]), /* @__PURE__ */ d.jsx(d.Fragment, {});
3966
3966
  }
3967
3967
  function Mr(r) {
3968
- const [o, e, t] = K((u) => [u.setState, u.getState, u.mounted]), { colFilters: n, colSort: s, columns: i, searchStr: a } = K((u) => ({
3968
+ const [o, e, t] = H((u) => [u.setState, u.getState, u.mounted]), { colFilters: n, colSort: s, columns: i, searchStr: a } = H((u) => ({
3969
3969
  colFilters: u.colFilters,
3970
3970
  colOrder: u.colOrder,
3971
3971
  colSize: u.colSize,
@@ -3980,19 +3980,19 @@ function Mr(r) {
3980
3980
  const c = e("pageSize");
3981
3981
  return r.data && Array.isArray(r.data) ? (o("total_rows", r.data.length), r.data.slice(u * (c ?? 50), (u + 1) * (c ?? 50))) : [];
3982
3982
  };
3983
- return I(() => {
3983
+ return R(() => {
3984
3984
  o("useAPIQuery", f);
3985
- }, [t, o]), I(() => {
3985
+ }, [t, o]), R(() => {
3986
3986
  if (r.onColumnSort && s !== l?.current?.colSort) {
3987
3987
  const u = r.onColumnSort(s, i, r.data);
3988
3988
  o("total_rows", u.length), o("data", u), l.current.colSort = s, e("refreshCells")?.();
3989
3989
  }
3990
- }, [s, r.onColumnSort]), I(() => {
3990
+ }, [s, r.onColumnSort]), R(() => {
3991
3991
  if (r.onColumnFilter && n !== l?.current?.colFilters) {
3992
3992
  const u = r.onColumnFilter(n, i, r.data);
3993
3993
  o("total_rows", u.length), o("data", u), l.current.colFilters = n, e("refreshCells")?.();
3994
3994
  }
3995
- }, [n, r.onColumnFilter]), I(() => {
3995
+ }, [n, r.onColumnFilter]), R(() => {
3996
3996
  if (r.onSearch && a !== l?.current?.searchStr) {
3997
3997
  const u = r.onSearch(a, i, r.data);
3998
3998
  o("total_rows", u.length), o("data", u), l.current.colFilters = n, e("refreshCells")?.();
@@ -4002,12 +4002,12 @@ function Mr(r) {
4002
4002
  const Tt = $.memo(Mr);
4003
4003
  Tt.displayName = "Gridler-GlidlerLocalDataAdaptor";
4004
4004
  function Pr() {
4005
- const { loadingData: r, onContextClick: o } = K((e) => ({
4005
+ const { loadingData: r, onContextClick: o } = H((e) => ({
4006
4006
  loadingData: e.loadingData,
4007
4007
  onContextClick: e.onContextClick
4008
4008
  }));
4009
4009
  return /* @__PURE__ */ d.jsx(
4010
- _e,
4010
+ Ce,
4011
4011
  {
4012
4012
  loading: r,
4013
4013
  mr: "xs",
@@ -4019,7 +4019,7 @@ function Pr() {
4019
4019
  );
4020
4020
  }
4021
4021
  function Dr(r, o) {
4022
- const [e, t] = K((n) => [n.setStateFN, n.getState]);
4022
+ const [e, t] = H((n) => [n.setStateFN, n.getState]);
4023
4023
  return Ve(o, () => ({
4024
4024
  getGlideRef: () => t("_glideref"),
4025
4025
  getState: t,
@@ -4051,14 +4051,14 @@ function Dr(r, o) {
4051
4051
  }
4052
4052
  const zr = $.forwardRef(Dr);
4053
4053
  function $r() {
4054
- const { _activeTooltip: r, tooltipBarProps: o } = K((e) => ({
4054
+ const { _activeTooltip: r, tooltipBarProps: o } = H((e) => ({
4055
4055
  _activeTooltip: e._activeTooltip,
4056
4056
  tooltipBarProps: e.tooltipBarProps
4057
4057
  }));
4058
4058
  return /* @__PURE__ */ d.jsx("div", { "data-tooltip-bar": !0, style: { minHeight: "24px" }, ...o, children: r });
4059
4059
  }
4060
4060
  const Mt = $.memo(() => {
4061
- const r = J(0), o = J(""), e = J(null), {
4061
+ const r = K(0), o = K(""), e = K(null), {
4062
4062
  _glideref: t,
4063
4063
  _gridSelectionRows: n,
4064
4064
  colFilters: s,
@@ -4072,12 +4072,12 @@ const Mt = $.memo(() => {
4072
4072
  ready: g,
4073
4073
  scrollToRowKey: p,
4074
4074
  searchStr: y,
4075
- selectedRowKey: _,
4076
- selectFirstRowOnMount: C,
4075
+ selectedRowKey: C,
4076
+ selectFirstRowOnMount: _,
4077
4077
  setState: x,
4078
4078
  setStateFN: O,
4079
- values: R
4080
- } = K((w) => ({
4079
+ values: I
4080
+ } = H((w) => ({
4081
4081
  _glideref: w._glideref,
4082
4082
  _gridSelectionRows: w._gridSelectionRows,
4083
4083
  colFilters: w.colFilters,
@@ -4112,54 +4112,36 @@ const Mt = $.memo(() => {
4112
4112
  leading: !1
4113
4113
  }
4114
4114
  );
4115
- return I(() => {
4116
- R && (async (S) => {
4117
- const E = c("_page_data"), D = c("pageSize"), B = c("keyField") ?? "id", T = [];
4118
- for (const M in S) {
4119
- let j = -1;
4120
- const G = String(
4121
- typeof S?.[M] == "object" ? S?.[M]?.[B] : typeof S?.[M] == "string" ? S?.[M] : void 0
4115
+ return R(() => {
4116
+ I && (async (S) => {
4117
+ const E = c("keyField") ?? "id", M = [];
4118
+ for (const L in S) {
4119
+ const D = String(
4120
+ typeof S?.[L] == "object" ? S?.[L]?.[E] : typeof S?.[L] == "string" ? S?.[L] : void 0
4122
4121
  );
4123
- if (G) {
4124
- for (const L in E) {
4125
- for (const A in E[L]) {
4126
- const q = Number(L) * D + Number(A);
4127
- if (String(E[L][A]?.[B]) === G) {
4128
- j = q;
4129
- break;
4130
- }
4131
- }
4132
- if (j >= 0) {
4133
- T.push(j);
4134
- break;
4135
- }
4136
- }
4137
- if (j >= 0)
4138
- T.push(j);
4139
- else {
4140
- const L = await u(G);
4141
- L !== null && T.push(L);
4142
- }
4143
- }
4122
+ if (!D)
4123
+ continue;
4124
+ const P = await u(D);
4125
+ P != null && M.push(P);
4144
4126
  }
4145
- return T;
4146
- })(R).then((S) => {
4127
+ return M;
4128
+ })(I).then((S) => {
4147
4129
  let E = ne.empty();
4148
- S.forEach((D) => {
4149
- D !== void 0 && (E = E.add(D));
4150
- }), O("_gridSelectionRows", () => E), O("_gridSelection", (D) => ({
4151
- columns: D?.columns ?? ne.empty(),
4152
- ...D,
4130
+ S.forEach((M) => {
4131
+ M !== void 0 && (E = E.add(M));
4132
+ }), O("_gridSelectionRows", () => E), O("_gridSelection", (M) => ({
4133
+ columns: M?.columns ?? ne.empty(),
4134
+ ...M,
4153
4135
  rows: E
4154
4136
  }));
4155
4137
  });
4156
- }, [R]), I(() => {
4138
+ }, [I]), R(() => {
4157
4139
  const w = c("onChange");
4158
4140
  if (w && typeof w == "function") {
4159
- const E = c("getGridSelectedRows")(), D = c("values");
4160
- JSON.stringify(D) !== JSON.stringify(E) && w(E);
4141
+ const E = c("getGridSelectedRows")(), M = c("values");
4142
+ JSON.stringify(M) !== JSON.stringify(E) && w(E);
4161
4143
  }
4162
- }, [n, n?.length, c]), I(() => {
4144
+ }, [n, n?.length, c]), R(() => {
4163
4145
  x(
4164
4146
  "renderColumns",
4165
4147
  f?.map((w) => ({
@@ -4168,13 +4150,13 @@ const Mt = $.memo(() => {
4168
4150
  icon: "sort"
4169
4151
  }))
4170
4152
  );
4171
- }, [f]), I(() => {
4153
+ }, [f]), R(() => {
4172
4154
  if (y == null) {
4173
4155
  o.current = "";
4174
4156
  return;
4175
4157
  }
4176
4158
  o.current !== y && (N(y), o.current = y);
4177
- }, [y]), I(() => {
4159
+ }, [y]), R(() => {
4178
4160
  l && (x("_gridSelection", {
4179
4161
  columns: ne.empty(),
4180
4162
  current: void 0,
@@ -4191,7 +4173,7 @@ const Mt = $.memo(() => {
4191
4173
  );
4192
4174
  });
4193
4175
  }));
4194
- }, [l]), I(() => {
4176
+ }, [l]), R(() => {
4195
4177
  s && JSON.stringify(e.current) !== JSON.stringify(s) && (m(0, "all").then(() => {
4196
4178
  c("refreshCells")?.(), c("_events")?.dispatchEvent?.(
4197
4179
  new CustomEvent("onColumnFiltered", {
@@ -4199,60 +4181,66 @@ const Mt = $.memo(() => {
4199
4181
  })
4200
4182
  );
4201
4183
  }), e.current = s);
4202
- }, [s]), I(() => {
4184
+ }, [s]), R(() => {
4203
4185
  a && O("renderColumns", (w) => w?.map((S) => ({
4204
4186
  ...S,
4205
4187
  width: S.id && a?.[S.id] ? a?.[S.id] : S.width
4206
4188
  }))).then(() => {
4207
4189
  c("refreshCells")?.();
4208
4190
  });
4209
- }, [a]), I(() => {
4210
- i && O("renderColumns", (w) => w?.sort((E, D) => i[E.id] > i[D.id] ? 1 : -1)).then(() => {
4191
+ }, [a]), R(() => {
4192
+ i && O("renderColumns", (w) => w?.sort((E, M) => i[E.id] > i[M.id] ? 1 : -1)).then(() => {
4211
4193
  c("refreshCells")?.();
4212
4194
  });
4213
- }, [i]), I(() => {
4214
- t && (r.current > 0 || (r.current = 1, m(0).then(() => {
4215
- c("refreshCells")?.();
4216
- })));
4217
- }, [g, m]), I(() => {
4195
+ }, [i]), R(() => {
4196
+ if (t) {
4197
+ if (r.current > 0) {
4198
+ c("refreshCells")?.();
4199
+ return;
4200
+ }
4201
+ r.current = 1, m(0).then(() => {
4202
+ c("refreshCells")?.();
4203
+ });
4204
+ }
4205
+ }, [g, m]), R(() => {
4218
4206
  const w = c("_events"), S = () => {
4219
4207
  const E = c("selectFirstRowOnMount");
4220
4208
  if (c("ready") && E) {
4221
- const B = c("scrollToRowKey");
4222
- if (B && B >= 0)
4209
+ const L = c("scrollToRowKey");
4210
+ if (L && L >= 0)
4223
4211
  return;
4224
- const T = c("keyField") ?? "id", j = c("_page_data")?.[0]?.[0], G = j?.[T] ?? -1, L = c("values") ?? [];
4225
- if (!j)
4212
+ const D = c("keyField") ?? "id", F = c("_page_data")?.[0]?.[0], U = F?.[D] ?? -1, V = c("values") ?? [];
4213
+ if (!F)
4226
4214
  return;
4227
- if (G && G > 0 && (L.length ?? 0) === 0) {
4228
- const A = [j], q = c("onChange");
4229
- q ? q(A) : x("values", A), x("scrollToRowKey", G);
4215
+ if (U && U > 0 && (V.length ?? 0) === 0) {
4216
+ const j = [F], J = c("onChange");
4217
+ J ? J(j) : x("values", j), x("scrollToRowKey", U);
4230
4218
  }
4231
4219
  }
4232
4220
  };
4233
4221
  return w?.addEventListener("loadPage", S), () => {
4234
4222
  w?.removeEventListener("loadPage", S);
4235
4223
  };
4236
- }, [g, C, R]), I(() => {
4237
- const w = c("ready"), S = c("_glideref"), E = c("getRowIndexByKey"), D = _ ?? p;
4238
- D && S && w && E?.(D).then((B) => {
4239
- if (B !== void 0) {
4240
- if (_) {
4241
- const T = c("onChange"), M = [{ [c("keyField") ?? "id"]: _ }];
4242
- JSON.stringify(c("values")) !== JSON.stringify(M) && (T ? T(M) : x("values", M));
4224
+ }, [g, _, I]), R(() => {
4225
+ const w = c("ready"), S = c("_glideref"), E = c("getRowIndexByKey"), M = C ?? p;
4226
+ M && S && w && E?.(M).then((L) => {
4227
+ if (L !== void 0) {
4228
+ if (C) {
4229
+ const D = c("onChange"), P = [{ [c("keyField") ?? "id"]: C }];
4230
+ JSON.stringify(c("values")) !== JSON.stringify(P) && (D ? D(P) : x("values", P));
4243
4231
  }
4244
- S.scrollTo(0, B), c("_events").dispatchEvent(
4232
+ S.scrollTo(0, L), c("_events").dispatchEvent(
4245
4233
  new CustomEvent("scrollToRowKeyFound", {
4246
4234
  detail: {
4247
- rowNumber: B,
4235
+ rowNumber: L,
4248
4236
  scrollToRowKey: p,
4249
- selectedRowKey: _
4237
+ selectedRowKey: C
4250
4238
  }
4251
4239
  })
4252
4240
  );
4253
4241
  }
4254
4242
  });
4255
- }, [p, _]), /* @__PURE__ */ d.jsx(d.Fragment, {});
4243
+ }, [p, C]), /* @__PURE__ */ d.jsx(d.Fragment, {});
4256
4244
  });
4257
4245
  Mt.displayName = "Gridler-Computer";
4258
4246
  function Nr(r, o, e = 1) {
@@ -4279,7 +4267,7 @@ const Pt = $.memo(() => {
4279
4267
  s,
4280
4268
  i,
4281
4269
  a
4282
- ] = K((l) => [
4270
+ ] = H((l) => [
4283
4271
  l.setState,
4284
4272
  l.getState,
4285
4273
  l._glideref,
@@ -4290,9 +4278,9 @@ const Pt = $.memo(() => {
4290
4278
  l._loadingList,
4291
4279
  l.hasLocalData
4292
4280
  ]);
4293
- return I(() => {
4281
+ return R(() => {
4294
4282
  e && r("mounted", !0);
4295
- }, [r]), I(() => {
4283
+ }, [r]), R(() => {
4296
4284
  if (!e)
4297
4285
  return;
4298
4286
  const l = Math.max(0, Math.floor(t.y / n)), f = Math.floor((t.y + t.height) / n);
@@ -4314,7 +4302,7 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4314
4302
  }, Gr = (r) => (o) => o % 2 === 0 ? void 0 : {
4315
4303
  bgCell: r === "dark" ? "#303030" : "#e1effc"
4316
4304
  }, qr = () => {
4317
- const r = nn(), { colorScheme: o } = rn(), { enableOddEvenRowColor: e, focused: t } = K((c) => ({
4305
+ const r = nn(), { colorScheme: o } = rn(), { enableOddEvenRowColor: e, focused: t } = H((c) => ({
4318
4306
  enableOddEvenRowColor: c.enableOddEvenRowColor,
4319
4307
  focused: c.focused
4320
4308
  })), n = {
@@ -4351,7 +4339,7 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4351
4339
  bgCell: n,
4352
4340
  textGroupHeader: "#2c5491"
4353
4341
  }, [l, f] = se(a);
4354
- return I(() => {
4342
+ return R(() => {
4355
4343
  f(a);
4356
4344
  }, [o, t]), { getRowThemeOverride: (c) => e ? Gr(o)(c) : void 0, gridTheme: l };
4357
4345
  }, Hr = () => {
@@ -4367,26 +4355,26 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4367
4355
  headerHeight: g,
4368
4356
  heightProp: p,
4369
4357
  mounted: y,
4370
- onCellActivated: _,
4371
- onCellClicked: C,
4358
+ onCellActivated: C,
4359
+ onCellClicked: _,
4372
4360
  onCellEdited: x,
4373
4361
  onColumnMoved: O,
4374
- onColumnProposeMove: R,
4362
+ onColumnProposeMove: I,
4375
4363
  onColumnResize: N,
4376
4364
  onContextClick: w,
4377
4365
  onHeaderClicked: S,
4378
4366
  onHeaderMenuClick: E,
4379
- onItemHovered: D,
4380
- onVisibleRegionChanged: B,
4381
- renderColumns: T,
4382
- rowHeight: M,
4383
- sections: j,
4384
- selectMode: G,
4385
- setState: L,
4386
- setStateFN: A,
4387
- total_rows: q,
4367
+ onItemHovered: M,
4368
+ onVisibleRegionChanged: L,
4369
+ renderColumns: D,
4370
+ rowHeight: P,
4371
+ sections: F,
4372
+ selectMode: U,
4373
+ setState: V,
4374
+ setStateFN: j,
4375
+ total_rows: J,
4388
4376
  widthProp: Y
4389
- } = K((h) => ({
4377
+ } = H((h) => ({
4390
4378
  _gridSelection: h._gridSelection,
4391
4379
  allowMultiSelect: h.allowMultiSelect,
4392
4380
  focused: h.focused,
@@ -4418,10 +4406,12 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4418
4406
  total_rows: h.total_rows,
4419
4407
  widthProp: h.width
4420
4408
  })), Z = bn(r, (h) => {
4421
- A("_glideref", () => h ?? void 0);
4422
- const b = u("ready"), k = !!(h && y);
4423
- b !== k && L("ready", k);
4424
- }), H = qr();
4409
+ j("_glideref", () => h ?? void 0);
4410
+ });
4411
+ R(() => {
4412
+ r.current && y ? u("ready") || V("ready", !0) : u("ready") && V("ready", !1);
4413
+ }, [y, u, V]);
4414
+ const G = qr();
4425
4415
  return /* @__PURE__ */ d.jsxs(
4426
4416
  bt,
4427
4417
  {
@@ -4431,7 +4421,7 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4431
4421
  justify: "stretch",
4432
4422
  w: Y ?? "100%",
4433
4423
  children: [
4434
- j?.top,
4424
+ F?.top,
4435
4425
  /* @__PURE__ */ d.jsxs(
4436
4426
  "div",
4437
4427
  {
@@ -4451,15 +4441,15 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4451
4441
  width: "100%"
4452
4442
  },
4453
4443
  children: [
4454
- j?.left,
4444
+ F?.left,
4455
4445
  n && n > 0 && e && e > 0 && /* @__PURE__ */ d.jsx(
4456
4446
  vn,
4457
4447
  {
4458
4448
  cellActivationBehavior: "double-click",
4459
- columns: T ?? [],
4449
+ columns: D ?? [],
4460
4450
  columnSelect: "none",
4461
4451
  drawFocusRing: !0,
4462
- height: e ?? 400,
4452
+ height: e || 400,
4463
4453
  overscrollX: 16,
4464
4454
  overscrollY: 32,
4465
4455
  rangeSelect: i ? "multi-rect" : "cell",
@@ -4477,12 +4467,12 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4477
4467
  ...c,
4478
4468
  getCellContent: l,
4479
4469
  getCellsForSelection: f,
4480
- getRowThemeOverride: H.getRowThemeOverride,
4470
+ getRowThemeOverride: G.getRowThemeOverride,
4481
4471
  gridSelection: s,
4482
4472
  headerHeight: g ?? 32,
4483
4473
  headerIcons: { sort: Lr, sortdown: Ne, sortup: Le },
4484
- onCellActivated: _,
4485
- onCellClicked: C,
4474
+ onCellActivated: C,
4475
+ onCellClicked: _,
4486
4476
  onCellContextMenu: (h, b) => {
4487
4477
  b.preventDefault(), c?.onCellContextMenu?.(h, b), o.current || (o.current = !0, w("cell", b, h[0], h[1]), setTimeout(() => {
4488
4478
  o.current = !1;
@@ -4490,20 +4480,20 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4490
4480
  },
4491
4481
  onCellEdited: x,
4492
4482
  onColumnMoved: O,
4493
- onColumnProposeMove: R,
4483
+ onColumnProposeMove: I,
4494
4484
  onColumnResize: N,
4495
4485
  onGridSelectionChange: (h) => {
4496
4486
  let b = ne.empty();
4497
4487
  const k = u("_gridSelection"), v = u("keyField") ?? "id", z = u("getRowBuffer");
4498
- for (const P of h.rows)
4499
- z && z(P)?.[v] && (b = b.hasIndex(P) ? b : b.add(P));
4500
- if (G === "row" && h.current?.range)
4501
- for (let P = h.current.range.y; P < h.current.range.y + h.current.range.height; P++)
4502
- z && z(P)?.[v] && (b = b.hasIndex(P) ? b : b.add(P));
4488
+ for (const T of h.rows)
4489
+ z && z(T)?.[v] && (b = b.hasIndex(T) ? b : b.add(T));
4490
+ if (U === "row" && h.current?.range)
4491
+ for (let T = h.current.range.y; T < h.current.range.y + h.current.range.height; T++)
4492
+ z && z(T)?.[v] && (b = b.hasIndex(T) ? b : b.add(T));
4503
4493
  if (b.length === 0)
4504
- for (const P of k?.rows ?? [])
4505
- z && z(P)?.[v] && (b = b.hasIndex(P) ? b : b.add(P));
4506
- (JSON.stringify(k?.columns) !== JSON.stringify(h.columns) || JSON.stringify(k?.rows) !== JSON.stringify(b) || JSON.stringify(k?.current) !== JSON.stringify(h.current)) && (L("_gridSelection", { ...h, rows: b }), L("_gridSelectionRows", b));
4494
+ for (const T of k?.rows ?? [])
4495
+ z && z(T)?.[v] && (b = b.hasIndex(T) ? b : b.add(T));
4496
+ (JSON.stringify(k?.columns) !== JSON.stringify(h.columns) || JSON.stringify(k?.rows) !== JSON.stringify(b) || JSON.stringify(k?.current) !== JSON.stringify(h.current)) && (V("_gridSelection", { ...h, rows: b }), V("_gridSelectionRows", b));
4507
4497
  },
4508
4498
  onHeaderClicked: S,
4509
4499
  onHeaderContextMenu: (h, b) => {
@@ -4512,29 +4502,29 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4512
4502
  }, 100));
4513
4503
  },
4514
4504
  onHeaderMenuClick: E,
4515
- onItemHovered: D,
4516
- onVisibleRegionChanged: B,
4505
+ onItemHovered: M,
4506
+ onVisibleRegionChanged: L,
4517
4507
  ref: Z,
4518
- rightElement: j?.rightElementDisabled ? void 0 : /* @__PURE__ */ d.jsxs(we, { children: [
4519
- j?.rightElementStart,
4508
+ rightElement: F?.rightElementDisabled ? void 0 : /* @__PURE__ */ d.jsxs(we, { children: [
4509
+ F?.rightElementStart,
4520
4510
  /* @__PURE__ */ d.jsx(Pr, {}),
4521
- j?.rightElementEnd
4511
+ F?.rightElementEnd
4522
4512
  ] }),
4523
- rowHeight: M ?? 22,
4524
- rows: q ?? 0,
4525
- theme: H.gridTheme,
4526
- width: n ?? 200
4513
+ rowHeight: P ?? 22,
4514
+ rows: J ?? 0,
4515
+ theme: G.gridTheme,
4516
+ width: n || 200
4527
4517
  }
4528
4518
  ),
4529
4519
  /* @__PURE__ */ d.jsx(Mt, {}),
4530
4520
  !m && /* @__PURE__ */ d.jsx(Pt, {}),
4531
- j?.right
4521
+ F?.right
4532
4522
  ]
4533
4523
  }
4534
4524
  ),
4535
4525
  /* @__PURE__ */ d.jsxs("div", { style: { flexGrow: 0 }, children: [
4536
4526
  /* @__PURE__ */ d.jsx($r, {}),
4537
- j?.bottom
4527
+ F?.bottom
4538
4528
  ] })
4539
4529
  ]
4540
4530
  }
@@ -4576,7 +4566,7 @@ export {
4576
4566
  Fr as GlidlerAPIAdaptorForGoLangv2,
4577
4567
  Tr as GlidlerFormAdaptor,
4578
4568
  Tt as GlidlerLocalDataAdaptor,
4579
- V as GlobalStateStore,
4569
+ B as GlobalStateStore,
4580
4570
  Oo as GlobalStateStoreProvider,
4581
4571
  fe as GoAPIHeaders,
4582
4572
  Dt as Gridler,
@@ -4592,15 +4582,15 @@ export {
4592
4582
  yo as TextInputCtrl,
4593
4583
  De as errorManager,
4594
4584
  xo as getApiURL,
4595
- _o as getAuthToken,
4596
- Co as isLoggedIn,
4585
+ Co as getAuthToken,
4586
+ _o as isLoggedIn,
4597
4587
  bo as setApiURL,
4598
4588
  Eo as setAuthToken,
4599
4589
  Nn as useBoxerStore,
4600
4590
  fo as useFormerState,
4601
4591
  wo as useGlobalStateStore,
4602
4592
  Ro as useGlobalStateStoreContext,
4603
- K as useGridlerStore,
4593
+ H as useGridlerStore,
4604
4594
  At as useMantineBetterMenus
4605
4595
  };
4606
4596
  //# sourceMappingURL=lib.es.js.map