@sg-front-core/store-v1 1.0.0

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.
@@ -0,0 +1,1728 @@
1
+ import Yr, { useRef as j, useSyncExternalStore as Vr, createContext as Sr, memo as he, useContext as Tr, useState as z, useEffect as K, useMemo as H, isValidElement as xt, cloneElement as Ct } from "react";
2
+ var me = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
3
+ function Hr(e) {
4
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
5
+ }
6
+ var pe = { exports: {} }, se = {};
7
+ var _r;
8
+ function At() {
9
+ if (_r) return se;
10
+ _r = 1;
11
+ var e = Yr, t = /* @__PURE__ */ Symbol.for("react.element"), n = /* @__PURE__ */ Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, u = { key: !0, ref: !0, __self: !0, __source: !0 };
12
+ function c(v, d, i) {
13
+ var s, l = {}, h = null, b = null;
14
+ i !== void 0 && (h = "" + i), d.key !== void 0 && (h = "" + d.key), d.ref !== void 0 && (b = d.ref);
15
+ for (s in d) a.call(d, s) && !u.hasOwnProperty(s) && (l[s] = d[s]);
16
+ if (v && v.defaultProps) for (s in d = v.defaultProps, d) l[s] === void 0 && (l[s] = d[s]);
17
+ return { $$typeof: t, type: v, key: h, ref: b, props: l, _owner: o.current };
18
+ }
19
+ return se.Fragment = n, se.jsx = c, se.jsxs = c, se;
20
+ }
21
+ var ce = {};
22
+ var wr;
23
+ function kt() {
24
+ return wr || (wr = 1, process.env.NODE_ENV !== "production" && (function() {
25
+ var e = Yr, t = /* @__PURE__ */ Symbol.for("react.element"), n = /* @__PURE__ */ Symbol.for("react.portal"), a = /* @__PURE__ */ Symbol.for("react.fragment"), o = /* @__PURE__ */ Symbol.for("react.strict_mode"), u = /* @__PURE__ */ Symbol.for("react.profiler"), c = /* @__PURE__ */ Symbol.for("react.provider"), v = /* @__PURE__ */ Symbol.for("react.context"), d = /* @__PURE__ */ Symbol.for("react.forward_ref"), i = /* @__PURE__ */ Symbol.for("react.suspense"), s = /* @__PURE__ */ Symbol.for("react.suspense_list"), l = /* @__PURE__ */ Symbol.for("react.memo"), h = /* @__PURE__ */ Symbol.for("react.lazy"), b = /* @__PURE__ */ Symbol.for("react.offscreen"), p = Symbol.iterator, E = "@@iterator";
26
+ function F(r) {
27
+ if (r === null || typeof r != "object")
28
+ return null;
29
+ var f = p && r[p] || r[E];
30
+ return typeof f == "function" ? f : null;
31
+ }
32
+ var I = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
33
+ function w(r) {
34
+ {
35
+ for (var f = arguments.length, m = new Array(f > 1 ? f - 1 : 0), g = 1; g < f; g++)
36
+ m[g - 1] = arguments[g];
37
+ N("error", r, m);
38
+ }
39
+ }
40
+ function N(r, f, m) {
41
+ {
42
+ var g = I.ReactDebugCurrentFrame, S = g.getStackAddendum();
43
+ S !== "" && (f += "%s", m = m.concat([S]));
44
+ var _ = m.map(function(R) {
45
+ return String(R);
46
+ });
47
+ _.unshift("Warning: " + f), Function.prototype.apply.call(console[r], console, _);
48
+ }
49
+ }
50
+ var W = !1, $ = !1, Y = !1, U = !1, q = !1, X;
51
+ X = /* @__PURE__ */ Symbol.for("react.module.reference");
52
+ function ae(r) {
53
+ return !!(typeof r == "string" || typeof r == "function" || r === a || r === u || q || r === o || r === i || r === s || U || r === b || W || $ || Y || typeof r == "object" && r !== null && (r.$$typeof === h || r.$$typeof === l || r.$$typeof === c || r.$$typeof === v || r.$$typeof === d || // This needs to include all possible module reference object
54
+ // types supported by any Flight configuration anywhere since
55
+ // we don't know which Flight build this will end up being used
56
+ // with.
57
+ r.$$typeof === X || r.getModuleId !== void 0));
58
+ }
59
+ function ie(r, f, m) {
60
+ var g = r.displayName;
61
+ if (g)
62
+ return g;
63
+ var S = f.displayName || f.name || "";
64
+ return S !== "" ? m + "(" + S + ")" : m;
65
+ }
66
+ function J(r) {
67
+ return r.displayName || "Context";
68
+ }
69
+ function T(r) {
70
+ if (r == null)
71
+ return null;
72
+ if (typeof r.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
73
+ return r.displayName || r.name || null;
74
+ if (typeof r == "string")
75
+ return r;
76
+ switch (r) {
77
+ case a:
78
+ return "Fragment";
79
+ case n:
80
+ return "Portal";
81
+ case u:
82
+ return "Profiler";
83
+ case o:
84
+ return "StrictMode";
85
+ case i:
86
+ return "Suspense";
87
+ case s:
88
+ return "SuspenseList";
89
+ }
90
+ if (typeof r == "object")
91
+ switch (r.$$typeof) {
92
+ case v:
93
+ var f = r;
94
+ return J(f) + ".Consumer";
95
+ case c:
96
+ var m = r;
97
+ return J(m._context) + ".Provider";
98
+ case d:
99
+ return ie(r, r.render, "ForwardRef");
100
+ case l:
101
+ var g = r.displayName || null;
102
+ return g !== null ? g : T(r.type) || "Memo";
103
+ case h: {
104
+ var S = r, _ = S._payload, R = S._init;
105
+ try {
106
+ return T(R(_));
107
+ } catch {
108
+ return null;
109
+ }
110
+ }
111
+ }
112
+ return null;
113
+ }
114
+ var C = Object.assign, O = 0, G, oe, re, tr, nr, ar, ir;
115
+ function or() {
116
+ }
117
+ or.__reactDisabledLog = !0;
118
+ function tt() {
119
+ {
120
+ if (O === 0) {
121
+ G = console.log, oe = console.info, re = console.warn, tr = console.error, nr = console.group, ar = console.groupCollapsed, ir = console.groupEnd;
122
+ var r = {
123
+ configurable: !0,
124
+ enumerable: !0,
125
+ value: or,
126
+ writable: !0
127
+ };
128
+ Object.defineProperties(console, {
129
+ info: r,
130
+ log: r,
131
+ warn: r,
132
+ error: r,
133
+ group: r,
134
+ groupCollapsed: r,
135
+ groupEnd: r
136
+ });
137
+ }
138
+ O++;
139
+ }
140
+ }
141
+ function nt() {
142
+ {
143
+ if (O--, O === 0) {
144
+ var r = {
145
+ configurable: !0,
146
+ enumerable: !0,
147
+ writable: !0
148
+ };
149
+ Object.defineProperties(console, {
150
+ log: C({}, r, {
151
+ value: G
152
+ }),
153
+ info: C({}, r, {
154
+ value: oe
155
+ }),
156
+ warn: C({}, r, {
157
+ value: re
158
+ }),
159
+ error: C({}, r, {
160
+ value: tr
161
+ }),
162
+ group: C({}, r, {
163
+ value: nr
164
+ }),
165
+ groupCollapsed: C({}, r, {
166
+ value: ar
167
+ }),
168
+ groupEnd: C({}, r, {
169
+ value: ir
170
+ })
171
+ });
172
+ }
173
+ O < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
174
+ }
175
+ }
176
+ var _e = I.ReactCurrentDispatcher, we;
177
+ function fe(r, f, m) {
178
+ {
179
+ if (we === void 0)
180
+ try {
181
+ throw Error();
182
+ } catch (S) {
183
+ var g = S.stack.trim().match(/\n( *(at )?)/);
184
+ we = g && g[1] || "";
185
+ }
186
+ return `
187
+ ` + we + r;
188
+ }
189
+ }
190
+ var Oe = !1, le;
191
+ {
192
+ var at = typeof WeakMap == "function" ? WeakMap : Map;
193
+ le = new at();
194
+ }
195
+ function ur(r, f) {
196
+ if (!r || Oe)
197
+ return "";
198
+ {
199
+ var m = le.get(r);
200
+ if (m !== void 0)
201
+ return m;
202
+ }
203
+ var g;
204
+ Oe = !0;
205
+ var S = Error.prepareStackTrace;
206
+ Error.prepareStackTrace = void 0;
207
+ var _;
208
+ _ = _e.current, _e.current = null, tt();
209
+ try {
210
+ if (f) {
211
+ var R = function() {
212
+ throw Error();
213
+ };
214
+ if (Object.defineProperty(R.prototype, "props", {
215
+ set: function() {
216
+ throw Error();
217
+ }
218
+ }), typeof Reflect == "object" && Reflect.construct) {
219
+ try {
220
+ Reflect.construct(R, []);
221
+ } catch (L) {
222
+ g = L;
223
+ }
224
+ Reflect.construct(r, [], R);
225
+ } else {
226
+ try {
227
+ R.call();
228
+ } catch (L) {
229
+ g = L;
230
+ }
231
+ r.call(R.prototype);
232
+ }
233
+ } else {
234
+ try {
235
+ throw Error();
236
+ } catch (L) {
237
+ g = L;
238
+ }
239
+ r();
240
+ }
241
+ } catch (L) {
242
+ if (L && g && typeof L.stack == "string") {
243
+ for (var y = L.stack.split(`
244
+ `), D = g.stack.split(`
245
+ `), P = y.length - 1, x = D.length - 1; P >= 1 && x >= 0 && y[P] !== D[x]; )
246
+ x--;
247
+ for (; P >= 1 && x >= 0; P--, x--)
248
+ if (y[P] !== D[x]) {
249
+ if (P !== 1 || x !== 1)
250
+ do
251
+ if (P--, x--, x < 0 || y[P] !== D[x]) {
252
+ var M = `
253
+ ` + y[P].replace(" at new ", " at ");
254
+ return r.displayName && M.includes("<anonymous>") && (M = M.replace("<anonymous>", r.displayName)), typeof r == "function" && le.set(r, M), M;
255
+ }
256
+ while (P >= 1 && x >= 0);
257
+ break;
258
+ }
259
+ }
260
+ } finally {
261
+ Oe = !1, _e.current = _, nt(), Error.prepareStackTrace = S;
262
+ }
263
+ var ne = r ? r.displayName || r.name : "", Z = ne ? fe(ne) : "";
264
+ return typeof r == "function" && le.set(r, Z), Z;
265
+ }
266
+ function it(r, f, m) {
267
+ return ur(r, !1);
268
+ }
269
+ function ot(r) {
270
+ var f = r.prototype;
271
+ return !!(f && f.isReactComponent);
272
+ }
273
+ function de(r, f, m) {
274
+ if (r == null)
275
+ return "";
276
+ if (typeof r == "function")
277
+ return ur(r, ot(r));
278
+ if (typeof r == "string")
279
+ return fe(r);
280
+ switch (r) {
281
+ case i:
282
+ return fe("Suspense");
283
+ case s:
284
+ return fe("SuspenseList");
285
+ }
286
+ if (typeof r == "object")
287
+ switch (r.$$typeof) {
288
+ case d:
289
+ return it(r.render);
290
+ case l:
291
+ return de(r.type, f, m);
292
+ case h: {
293
+ var g = r, S = g._payload, _ = g._init;
294
+ try {
295
+ return de(_(S), f, m);
296
+ } catch {
297
+ }
298
+ }
299
+ }
300
+ return "";
301
+ }
302
+ var ue = Object.prototype.hasOwnProperty, sr = {}, cr = I.ReactDebugCurrentFrame;
303
+ function ve(r) {
304
+ if (r) {
305
+ var f = r._owner, m = de(r.type, r._source, f ? f.type : null);
306
+ cr.setExtraStackFrame(m);
307
+ } else
308
+ cr.setExtraStackFrame(null);
309
+ }
310
+ function ut(r, f, m, g, S) {
311
+ {
312
+ var _ = Function.call.bind(ue);
313
+ for (var R in r)
314
+ if (_(r, R)) {
315
+ var y = void 0;
316
+ try {
317
+ if (typeof r[R] != "function") {
318
+ var D = Error((g || "React class") + ": " + m + " type `" + R + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[R] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
319
+ throw D.name = "Invariant Violation", D;
320
+ }
321
+ y = r[R](f, R, g, m, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
322
+ } catch (P) {
323
+ y = P;
324
+ }
325
+ y && !(y instanceof Error) && (ve(S), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", g || "React class", m, R, typeof y), ve(null)), y instanceof Error && !(y.message in sr) && (sr[y.message] = !0, ve(S), w("Failed %s type: %s", m, y.message), ve(null));
326
+ }
327
+ }
328
+ }
329
+ var st = Array.isArray;
330
+ function Pe(r) {
331
+ return st(r);
332
+ }
333
+ function ct(r) {
334
+ {
335
+ var f = typeof Symbol == "function" && Symbol.toStringTag, m = f && r[Symbol.toStringTag] || r.constructor.name || "Object";
336
+ return m;
337
+ }
338
+ }
339
+ function ft(r) {
340
+ try {
341
+ return fr(r), !1;
342
+ } catch {
343
+ return !0;
344
+ }
345
+ }
346
+ function fr(r) {
347
+ return "" + r;
348
+ }
349
+ function lr(r) {
350
+ if (ft(r))
351
+ return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ct(r)), fr(r);
352
+ }
353
+ var dr = I.ReactCurrentOwner, lt = {
354
+ key: !0,
355
+ ref: !0,
356
+ __self: !0,
357
+ __source: !0
358
+ }, vr, mr;
359
+ function dt(r) {
360
+ if (ue.call(r, "ref")) {
361
+ var f = Object.getOwnPropertyDescriptor(r, "ref").get;
362
+ if (f && f.isReactWarning)
363
+ return !1;
364
+ }
365
+ return r.ref !== void 0;
366
+ }
367
+ function vt(r) {
368
+ if (ue.call(r, "key")) {
369
+ var f = Object.getOwnPropertyDescriptor(r, "key").get;
370
+ if (f && f.isReactWarning)
371
+ return !1;
372
+ }
373
+ return r.key !== void 0;
374
+ }
375
+ function mt(r, f) {
376
+ typeof r.ref == "string" && dr.current;
377
+ }
378
+ function pt(r, f) {
379
+ {
380
+ var m = function() {
381
+ vr || (vr = !0, w("%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://reactjs.org/link/special-props)", f));
382
+ };
383
+ m.isReactWarning = !0, Object.defineProperty(r, "key", {
384
+ get: m,
385
+ configurable: !0
386
+ });
387
+ }
388
+ }
389
+ function ht(r, f) {
390
+ {
391
+ var m = function() {
392
+ mr || (mr = !0, w("%s: `ref` 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://reactjs.org/link/special-props)", f));
393
+ };
394
+ m.isReactWarning = !0, Object.defineProperty(r, "ref", {
395
+ get: m,
396
+ configurable: !0
397
+ });
398
+ }
399
+ }
400
+ var bt = function(r, f, m, g, S, _, R) {
401
+ var y = {
402
+ // This tag allows us to uniquely identify this as a React Element
403
+ $$typeof: t,
404
+ // Built-in properties that belong on the element
405
+ type: r,
406
+ key: f,
407
+ ref: m,
408
+ props: R,
409
+ // Record the component responsible for creating this element.
410
+ _owner: _
411
+ };
412
+ return y._store = {}, Object.defineProperty(y._store, "validated", {
413
+ configurable: !1,
414
+ enumerable: !1,
415
+ writable: !0,
416
+ value: !1
417
+ }), Object.defineProperty(y, "_self", {
418
+ configurable: !1,
419
+ enumerable: !1,
420
+ writable: !1,
421
+ value: g
422
+ }), Object.defineProperty(y, "_source", {
423
+ configurable: !1,
424
+ enumerable: !1,
425
+ writable: !1,
426
+ value: S
427
+ }), Object.freeze && (Object.freeze(y.props), Object.freeze(y)), y;
428
+ };
429
+ function gt(r, f, m, g, S) {
430
+ {
431
+ var _, R = {}, y = null, D = null;
432
+ m !== void 0 && (lr(m), y = "" + m), vt(f) && (lr(f.key), y = "" + f.key), dt(f) && (D = f.ref, mt(f, S));
433
+ for (_ in f)
434
+ ue.call(f, _) && !lt.hasOwnProperty(_) && (R[_] = f[_]);
435
+ if (r && r.defaultProps) {
436
+ var P = r.defaultProps;
437
+ for (_ in P)
438
+ R[_] === void 0 && (R[_] = P[_]);
439
+ }
440
+ if (y || D) {
441
+ var x = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
442
+ y && pt(R, x), D && ht(R, x);
443
+ }
444
+ return bt(r, y, D, S, g, dr.current, R);
445
+ }
446
+ }
447
+ var je = I.ReactCurrentOwner, pr = I.ReactDebugCurrentFrame;
448
+ function te(r) {
449
+ if (r) {
450
+ var f = r._owner, m = de(r.type, r._source, f ? f.type : null);
451
+ pr.setExtraStackFrame(m);
452
+ } else
453
+ pr.setExtraStackFrame(null);
454
+ }
455
+ var xe;
456
+ xe = !1;
457
+ function Ce(r) {
458
+ return typeof r == "object" && r !== null && r.$$typeof === t;
459
+ }
460
+ function hr() {
461
+ {
462
+ if (je.current) {
463
+ var r = T(je.current.type);
464
+ if (r)
465
+ return `
466
+
467
+ Check the render method of \`` + r + "`.";
468
+ }
469
+ return "";
470
+ }
471
+ }
472
+ function yt(r) {
473
+ return "";
474
+ }
475
+ var br = {};
476
+ function Rt(r) {
477
+ {
478
+ var f = hr();
479
+ if (!f) {
480
+ var m = typeof r == "string" ? r : r.displayName || r.name;
481
+ m && (f = `
482
+
483
+ Check the top-level render call using <` + m + ">.");
484
+ }
485
+ return f;
486
+ }
487
+ }
488
+ function gr(r, f) {
489
+ {
490
+ if (!r._store || r._store.validated || r.key != null)
491
+ return;
492
+ r._store.validated = !0;
493
+ var m = Rt(f);
494
+ if (br[m])
495
+ return;
496
+ br[m] = !0;
497
+ var g = "";
498
+ r && r._owner && r._owner !== je.current && (g = " It was passed a child from " + T(r._owner.type) + "."), te(r), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', m, g), te(null);
499
+ }
500
+ }
501
+ function yr(r, f) {
502
+ {
503
+ if (typeof r != "object")
504
+ return;
505
+ if (Pe(r))
506
+ for (var m = 0; m < r.length; m++) {
507
+ var g = r[m];
508
+ Ce(g) && gr(g, f);
509
+ }
510
+ else if (Ce(r))
511
+ r._store && (r._store.validated = !0);
512
+ else if (r) {
513
+ var S = F(r);
514
+ if (typeof S == "function" && S !== r.entries)
515
+ for (var _ = S.call(r), R; !(R = _.next()).done; )
516
+ Ce(R.value) && gr(R.value, f);
517
+ }
518
+ }
519
+ }
520
+ function Et(r) {
521
+ {
522
+ var f = r.type;
523
+ if (f == null || typeof f == "string")
524
+ return;
525
+ var m;
526
+ if (typeof f == "function")
527
+ m = f.propTypes;
528
+ else if (typeof f == "object" && (f.$$typeof === d || // Note: Memo only checks outer props here.
529
+ // Inner props are checked in the reconciler.
530
+ f.$$typeof === l))
531
+ m = f.propTypes;
532
+ else
533
+ return;
534
+ if (m) {
535
+ var g = T(f);
536
+ ut(m, r.props, "prop", g, r);
537
+ } else if (f.PropTypes !== void 0 && !xe) {
538
+ xe = !0;
539
+ var S = T(f);
540
+ w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", S || "Unknown");
541
+ }
542
+ typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
543
+ }
544
+ }
545
+ function St(r) {
546
+ {
547
+ for (var f = Object.keys(r.props), m = 0; m < f.length; m++) {
548
+ var g = f[m];
549
+ if (g !== "children" && g !== "key") {
550
+ te(r), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", g), te(null);
551
+ break;
552
+ }
553
+ }
554
+ r.ref !== null && (te(r), w("Invalid attribute `ref` supplied to `React.Fragment`."), te(null));
555
+ }
556
+ }
557
+ var Rr = {};
558
+ function Er(r, f, m, g, S, _) {
559
+ {
560
+ var R = ae(r);
561
+ if (!R) {
562
+ var y = "";
563
+ (r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (y += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
564
+ var D = yt();
565
+ D ? y += D : y += hr();
566
+ var P;
567
+ r === null ? P = "null" : Pe(r) ? P = "array" : r !== void 0 && r.$$typeof === t ? (P = "<" + (T(r.type) || "Unknown") + " />", y = " Did you accidentally export a JSX literal instead of a component?") : P = typeof r, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", P, y);
568
+ }
569
+ var x = gt(r, f, m, S, _);
570
+ if (x == null)
571
+ return x;
572
+ if (R) {
573
+ var M = f.children;
574
+ if (M !== void 0)
575
+ if (g)
576
+ if (Pe(M)) {
577
+ for (var ne = 0; ne < M.length; ne++)
578
+ yr(M[ne], r);
579
+ Object.freeze && Object.freeze(M);
580
+ } else
581
+ w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
582
+ else
583
+ yr(M, r);
584
+ }
585
+ if (ue.call(f, "key")) {
586
+ var Z = T(r), L = Object.keys(f).filter(function(jt) {
587
+ return jt !== "key";
588
+ }), Ae = L.length > 0 ? "{key: someKey, " + L.join(": ..., ") + ": ...}" : "{key: someKey}";
589
+ if (!Rr[Z + Ae]) {
590
+ var Pt = L.length > 0 ? "{" + L.join(": ..., ") + ": ...}" : "{}";
591
+ w(`A props object containing a "key" prop is being spread into JSX:
592
+ let props = %s;
593
+ <%s {...props} />
594
+ React keys must be passed directly to JSX without using spread:
595
+ let props = %s;
596
+ <%s key={someKey} {...props} />`, Ae, Z, Pt, Z), Rr[Z + Ae] = !0;
597
+ }
598
+ }
599
+ return r === a ? St(x) : Et(x), x;
600
+ }
601
+ }
602
+ function Tt(r, f, m) {
603
+ return Er(r, f, m, !0);
604
+ }
605
+ function _t(r, f, m) {
606
+ return Er(r, f, m, !1);
607
+ }
608
+ var wt = _t, Ot = Tt;
609
+ ce.Fragment = a, ce.jsx = wt, ce.jsxs = Ot;
610
+ })()), ce;
611
+ }
612
+ var Or;
613
+ function Ft() {
614
+ return Or || (Or = 1, process.env.NODE_ENV === "production" ? pe.exports = At() : pe.exports = kt()), pe.exports;
615
+ }
616
+ var V = Ft();
617
+ class Ze {
618
+ constructor(t) {
619
+ this.hook = t;
620
+ }
621
+ hook;
622
+ subscribers = /* @__PURE__ */ new Set();
623
+ data;
624
+ notify() {
625
+ for (const t of this.subscribers)
626
+ t(this.data);
627
+ }
628
+ }
629
+ function zr(e, t) {
630
+ const n = j(t);
631
+ n.current = t;
632
+ const a = j(n.current?.(e.data) || []);
633
+ return Vr(
634
+ (o) => {
635
+ function u() {
636
+ if (!n.current)
637
+ o();
638
+ else {
639
+ const c = a.current, v = n.current(e.data);
640
+ It(c, v) && o(), a.current = v;
641
+ }
642
+ }
643
+ return e.subscribers.add(u), () => {
644
+ e.subscribers.delete(u);
645
+ };
646
+ },
647
+ () => e.data
648
+ );
649
+ }
650
+ function It(e, t) {
651
+ if (e.length !== t.length) return !0;
652
+ for (const n in t)
653
+ if (e[n] !== t[n]) return !0;
654
+ return !1;
655
+ }
656
+ const Pr = new Ze(() => {
657
+ });
658
+ function Cn(e, t) {
659
+ const n = t?.memo ?? !0, a = Sr(Pr), o = Sr({}), u = (s) => /* @__PURE__ */ V.jsx(o.Provider, { value: {}, children: s.children }), c = he((s) => (Tr(o), /* @__PURE__ */ V.jsx(V.Fragment, { children: s.children }))), v = he((s) => {
660
+ const { children: l, ...h } = s, [b] = z(() => new Ze(e));
661
+ return b.data = e(h), K(() => {
662
+ b.notify();
663
+ }), /* @__PURE__ */ V.jsx(a.Provider, { value: b, children: l });
664
+ }), d = (s) => /* @__PURE__ */ V.jsx(u, { children: /* @__PURE__ */ V.jsx(v, { ...s, children: /* @__PURE__ */ V.jsx(c, { children: s.children }) }) });
665
+ function i(s) {
666
+ const l = Tr(a);
667
+ return l === Pr && console.error(
668
+ "Failed to retrieve the store data from context. Seems like you didn't render a StoreProvider."
669
+ ), zr(l, s);
670
+ }
671
+ return [i, n ? he(d) : d];
672
+ }
673
+ let ze = [];
674
+ const Je = /* @__PURE__ */ new Set();
675
+ function Dt(e) {
676
+ ze = [...ze, e], Je.forEach((t) => t());
677
+ }
678
+ const qt = (e) => {
679
+ const t = Vr(
680
+ (n) => (Je.add(n), () => {
681
+ Je.delete(n);
682
+ }),
683
+ () => ze
684
+ );
685
+ return /* @__PURE__ */ V.jsxs(V.Fragment, { children: [
686
+ t.map((n, a) => /* @__PURE__ */ V.jsx(n, {}, a)),
687
+ e.children
688
+ ] });
689
+ };
690
+ function Lt(e) {
691
+ let t = null;
692
+ function n() {
693
+ if (!t)
694
+ throw new Error(
695
+ "Failed to retrieve data from global container. Please make sure you have rendered HoxRoot."
696
+ );
697
+ return t;
698
+ }
699
+ const a = he(() => {
700
+ const [c] = z(() => new Ze(e));
701
+ return t = c, c.data = e(), K(() => {
702
+ c.notify();
703
+ }), null;
704
+ });
705
+ Dt(a);
706
+ function o(c) {
707
+ return zr(n(), c);
708
+ }
709
+ function u() {
710
+ return n().data;
711
+ }
712
+ return [o, u];
713
+ }
714
+ function Nt() {
715
+ const e = j([]), [t, n] = z(
716
+ {}
717
+ ), a = (...u) => u.some((c) => t[c]), o = H(
718
+ () => (u) => new Proxy(u, {
719
+ get(c, v) {
720
+ const d = v;
721
+ return d in t || (e.current.push(d), queueMicrotask(() => {
722
+ const i = e.current;
723
+ e.current = [], i.length && n((s) => {
724
+ const l = { ...s };
725
+ for (const h of i) l[h] = !0;
726
+ return l;
727
+ });
728
+ })), c[v];
729
+ }
730
+ }),
731
+ [t]
732
+ );
733
+ return { ready: a, proxy: o };
734
+ }
735
+ var Wt = function(e) {
736
+ return function(t, n) {
737
+ var a = j(!1);
738
+ e(function() {
739
+ return function() {
740
+ a.current = !1;
741
+ };
742
+ }, []), e(function() {
743
+ if (!a.current)
744
+ a.current = !0;
745
+ else
746
+ return t();
747
+ }, n);
748
+ };
749
+ }, B = function() {
750
+ return B = Object.assign || function(t) {
751
+ for (var n, a = 1, o = arguments.length; a < o; a++) {
752
+ n = arguments[a];
753
+ for (var u in n) Object.prototype.hasOwnProperty.call(n, u) && (t[u] = n[u]);
754
+ }
755
+ return t;
756
+ }, B.apply(this, arguments);
757
+ };
758
+ function Jr(e, t) {
759
+ var n = {};
760
+ for (var a in e) Object.prototype.hasOwnProperty.call(e, a) && t.indexOf(a) < 0 && (n[a] = e[a]);
761
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
762
+ for (var o = 0, a = Object.getOwnPropertySymbols(e); o < a.length; o++)
763
+ t.indexOf(a[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, a[o]) && (n[a[o]] = e[a[o]]);
764
+ return n;
765
+ }
766
+ function Mt(e, t, n, a) {
767
+ function o(u) {
768
+ return u instanceof n ? u : new n(function(c) {
769
+ c(u);
770
+ });
771
+ }
772
+ return new (n || (n = Promise))(function(u, c) {
773
+ function v(s) {
774
+ try {
775
+ i(a.next(s));
776
+ } catch (l) {
777
+ c(l);
778
+ }
779
+ }
780
+ function d(s) {
781
+ try {
782
+ i(a.throw(s));
783
+ } catch (l) {
784
+ c(l);
785
+ }
786
+ }
787
+ function i(s) {
788
+ s.done ? u(s.value) : o(s.value).then(v, d);
789
+ }
790
+ i((a = a.apply(e, t || [])).next());
791
+ });
792
+ }
793
+ function $t(e, t) {
794
+ var n = { label: 0, sent: function() {
795
+ if (u[0] & 1) throw u[1];
796
+ return u[1];
797
+ }, trys: [], ops: [] }, a, o, u, c = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
798
+ return c.next = v(0), c.throw = v(1), c.return = v(2), typeof Symbol == "function" && (c[Symbol.iterator] = function() {
799
+ return this;
800
+ }), c;
801
+ function v(i) {
802
+ return function(s) {
803
+ return d([i, s]);
804
+ };
805
+ }
806
+ function d(i) {
807
+ if (a) throw new TypeError("Generator is already executing.");
808
+ for (; c && (c = 0, i[0] && (n = 0)), n; ) try {
809
+ if (a = 1, o && (u = i[0] & 2 ? o.return : i[0] ? o.throw || ((u = o.return) && u.call(o), 0) : o.next) && !(u = u.call(o, i[1])).done) return u;
810
+ switch (o = 0, u && (i = [i[0] & 2, u.value]), i[0]) {
811
+ case 0:
812
+ case 1:
813
+ u = i;
814
+ break;
815
+ case 4:
816
+ return n.label++, { value: i[1], done: !1 };
817
+ case 5:
818
+ n.label++, o = i[1], i = [0];
819
+ continue;
820
+ case 7:
821
+ i = n.ops.pop(), n.trys.pop();
822
+ continue;
823
+ default:
824
+ if (u = n.trys, !(u = u.length > 0 && u[u.length - 1]) && (i[0] === 6 || i[0] === 2)) {
825
+ n = 0;
826
+ continue;
827
+ }
828
+ if (i[0] === 3 && (!u || i[1] > u[0] && i[1] < u[3])) {
829
+ n.label = i[1];
830
+ break;
831
+ }
832
+ if (i[0] === 6 && n.label < u[1]) {
833
+ n.label = u[1], u = i;
834
+ break;
835
+ }
836
+ if (u && n.label < u[2]) {
837
+ n.label = u[2], n.ops.push(i);
838
+ break;
839
+ }
840
+ u[2] && n.ops.pop(), n.trys.pop();
841
+ continue;
842
+ }
843
+ i = t.call(e, n);
844
+ } catch (s) {
845
+ i = [6, s], o = 0;
846
+ } finally {
847
+ a = u = 0;
848
+ }
849
+ if (i[0] & 5) throw i[1];
850
+ return { value: i[0] ? i[1] : void 0, done: !0 };
851
+ }
852
+ }
853
+ function A(e, t) {
854
+ var n = typeof Symbol == "function" && e[Symbol.iterator];
855
+ if (!n) return e;
856
+ var a = n.call(e), o, u = [], c;
857
+ try {
858
+ for (; (t === void 0 || t-- > 0) && !(o = a.next()).done; ) u.push(o.value);
859
+ } catch (v) {
860
+ c = { error: v };
861
+ } finally {
862
+ try {
863
+ o && !o.done && (n = a.return) && n.call(a);
864
+ } finally {
865
+ if (c) throw c.error;
866
+ }
867
+ }
868
+ return u;
869
+ }
870
+ function k(e, t, n) {
871
+ if (n || arguments.length === 2) for (var a = 0, o = t.length, u; a < o; a++)
872
+ (u || !(a in t)) && (u || (u = Array.prototype.slice.call(t, 0, a)), u[a] = t[a]);
873
+ return e.concat(u || Array.prototype.slice.call(t));
874
+ }
875
+ var Ee = function(e) {
876
+ return typeof e == "function";
877
+ }, Se = process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test", Q = function(e) {
878
+ Se && (Ee(e) || console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof e)));
879
+ var t = j(e);
880
+ t.current = H(function() {
881
+ return e;
882
+ }, [e]);
883
+ var n = j(void 0);
884
+ return n.current || (n.current = function() {
885
+ for (var a = [], o = 0; o < arguments.length; o++)
886
+ a[o] = arguments[o];
887
+ return t.current.apply(this, a);
888
+ }), n.current;
889
+ };
890
+ const Ke = Wt(K);
891
+ var Kr = function(e, t) {
892
+ var n = t.manual, a = t.ready, o = a === void 0 ? !0 : a, u = t.defaultParams, c = u === void 0 ? [] : u, v = t.refreshDeps, d = v === void 0 ? [] : v, i = t.refreshDepsAction, s = j(!1);
893
+ return s.current = !1, Ke(function() {
894
+ !n && o && (s.current = !0, e.run.apply(e, k([], A(c), !1)));
895
+ }, [o]), Ke(function() {
896
+ s.current || n || (s.current = !0, i ? i() : e.refresh());
897
+ }, k([], A(d), !1)), {
898
+ onBefore: function() {
899
+ if (!o)
900
+ return {
901
+ stopNow: !0
902
+ };
903
+ }
904
+ };
905
+ };
906
+ Kr.onInit = function(e) {
907
+ var t = e.ready, n = t === void 0 ? !0 : t, a = e.manual;
908
+ return {
909
+ loading: !a && n
910
+ };
911
+ };
912
+ function Ut(e, t) {
913
+ if (e === t)
914
+ return !0;
915
+ for (var n = 0; n < e.length; n++)
916
+ if (!Object.is(e[n], t[n]))
917
+ return !1;
918
+ return !0;
919
+ }
920
+ var Xr = function(e, t) {
921
+ var n = j({
922
+ deps: t,
923
+ obj: void 0,
924
+ initialized: !1
925
+ }).current;
926
+ return (n.initialized === !1 || !Ut(n.deps, t)) && (n.deps = t, n.obj = e(), n.initialized = !0), n.obj;
927
+ };
928
+ function Zr(e) {
929
+ var t = j(e);
930
+ return t.current = e, t;
931
+ }
932
+ var Qe = function(e) {
933
+ Se && (Ee(e) || console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));
934
+ var t = Zr(e);
935
+ K(function() {
936
+ return function() {
937
+ t.current();
938
+ };
939
+ }, []);
940
+ }, be = /* @__PURE__ */ new Map(), Gt = function(e, t, n) {
941
+ var a = be.get(e);
942
+ a?.timer && clearTimeout(a.timer);
943
+ var o = void 0;
944
+ t > -1 && (o = setTimeout(function() {
945
+ be.delete(e);
946
+ }, t)), be.set(e, B(B({}, n), { timer: o }));
947
+ }, Bt = function(e) {
948
+ return be.get(e);
949
+ }, ge = /* @__PURE__ */ new Map(), Yt = function(e) {
950
+ return ge.get(e);
951
+ }, Vt = function(e, t) {
952
+ ge.set(e, t), t.then(function(n) {
953
+ return ge.delete(e), n;
954
+ }).catch(function() {
955
+ ge.delete(e);
956
+ });
957
+ }, ee = {}, Ht = function(e, t) {
958
+ ee[e] && ee[e].forEach(function(n) {
959
+ return n(t);
960
+ });
961
+ }, ke = function(e, t) {
962
+ return ee[e] || (ee[e] = []), ee[e].push(t), function() {
963
+ var a = ee[e].indexOf(t);
964
+ ee[e].splice(a, 1);
965
+ };
966
+ }, zt = function(e, t) {
967
+ var n = t.cacheKey, a = t.cacheTime, o = a === void 0 ? 300 * 1e3 : a, u = t.staleTime, c = u === void 0 ? 0 : u, v = t.setCache, d = t.getCache, i = j(void 0), s = j(void 0), l = function(b, p) {
968
+ v ? v(p) : Gt(b, o, p), Ht(b, p.data);
969
+ }, h = function(b, p) {
970
+ return p === void 0 && (p = []), d ? d(p) : Bt(b);
971
+ };
972
+ return Xr(function() {
973
+ if (n) {
974
+ var b = h(n);
975
+ b && Object.hasOwnProperty.call(b, "data") && (e.state.data = b.data, e.state.params = b.params, (c === -1 || Date.now() - b.time <= c) && (e.state.loading = !1)), i.current = ke(n, function(p) {
976
+ e.setState({ data: p });
977
+ });
978
+ }
979
+ }, []), Qe(function() {
980
+ var b;
981
+ (b = i.current) === null || b === void 0 || b.call(i);
982
+ }), n ? {
983
+ onBefore: function(b) {
984
+ var p = h(n, b);
985
+ return !p || !Object.hasOwnProperty.call(p, "data") ? {} : c === -1 || Date.now() - p.time <= c ? {
986
+ loading: !1,
987
+ data: p?.data,
988
+ error: void 0,
989
+ returnNow: !0
990
+ } : {
991
+ data: p?.data,
992
+ error: void 0
993
+ };
994
+ },
995
+ onRequest: function(b, p) {
996
+ var E = Yt(n);
997
+ return E && E !== s.current ? { servicePromise: E } : (E = b.apply(void 0, k([], A(p), !1)), s.current = E, Vt(n, E), { servicePromise: E });
998
+ },
999
+ onSuccess: function(b, p) {
1000
+ var E;
1001
+ n && ((E = i.current) === null || E === void 0 || E.call(i), l(n, {
1002
+ data: b,
1003
+ params: p,
1004
+ time: Date.now()
1005
+ }), i.current = ke(n, function(F) {
1006
+ e.setState({ data: F });
1007
+ }));
1008
+ },
1009
+ onMutate: function(b) {
1010
+ var p;
1011
+ n && ((p = i.current) === null || p === void 0 || p.call(i), l(n, {
1012
+ data: b,
1013
+ params: e.state.params,
1014
+ time: Date.now()
1015
+ }), i.current = ke(n, function(E) {
1016
+ e.setState({ data: E });
1017
+ }));
1018
+ }
1019
+ } : {};
1020
+ }, Fe, jr;
1021
+ function er() {
1022
+ if (jr) return Fe;
1023
+ jr = 1;
1024
+ function e(t) {
1025
+ var n = typeof t;
1026
+ return t != null && (n == "object" || n == "function");
1027
+ }
1028
+ return Fe = e, Fe;
1029
+ }
1030
+ var Ie, xr;
1031
+ function Jt() {
1032
+ if (xr) return Ie;
1033
+ xr = 1;
1034
+ var e = typeof me == "object" && me && me.Object === Object && me;
1035
+ return Ie = e, Ie;
1036
+ }
1037
+ var De, Cr;
1038
+ function Qr() {
1039
+ if (Cr) return De;
1040
+ Cr = 1;
1041
+ var e = Jt(), t = typeof self == "object" && self && self.Object === Object && self, n = e || t || Function("return this")();
1042
+ return De = n, De;
1043
+ }
1044
+ var qe, Ar;
1045
+ function Kt() {
1046
+ if (Ar) return qe;
1047
+ Ar = 1;
1048
+ var e = Qr(), t = function() {
1049
+ return e.Date.now();
1050
+ };
1051
+ return qe = t, qe;
1052
+ }
1053
+ var Le, kr;
1054
+ function Xt() {
1055
+ if (kr) return Le;
1056
+ kr = 1;
1057
+ var e = /\s/;
1058
+ function t(n) {
1059
+ for (var a = n.length; a-- && e.test(n.charAt(a)); )
1060
+ ;
1061
+ return a;
1062
+ }
1063
+ return Le = t, Le;
1064
+ }
1065
+ var Ne, Fr;
1066
+ function Zt() {
1067
+ if (Fr) return Ne;
1068
+ Fr = 1;
1069
+ var e = Xt(), t = /^\s+/;
1070
+ function n(a) {
1071
+ return a && a.slice(0, e(a) + 1).replace(t, "");
1072
+ }
1073
+ return Ne = n, Ne;
1074
+ }
1075
+ var We, Ir;
1076
+ function et() {
1077
+ if (Ir) return We;
1078
+ Ir = 1;
1079
+ var e = Qr(), t = e.Symbol;
1080
+ return We = t, We;
1081
+ }
1082
+ var Me, Dr;
1083
+ function Qt() {
1084
+ if (Dr) return Me;
1085
+ Dr = 1;
1086
+ var e = et(), t = Object.prototype, n = t.hasOwnProperty, a = t.toString, o = e ? e.toStringTag : void 0;
1087
+ function u(c) {
1088
+ var v = n.call(c, o), d = c[o];
1089
+ try {
1090
+ c[o] = void 0;
1091
+ var i = !0;
1092
+ } catch {
1093
+ }
1094
+ var s = a.call(c);
1095
+ return i && (v ? c[o] = d : delete c[o]), s;
1096
+ }
1097
+ return Me = u, Me;
1098
+ }
1099
+ var $e, qr;
1100
+ function en() {
1101
+ if (qr) return $e;
1102
+ qr = 1;
1103
+ var e = Object.prototype, t = e.toString;
1104
+ function n(a) {
1105
+ return t.call(a);
1106
+ }
1107
+ return $e = n, $e;
1108
+ }
1109
+ var Ue, Lr;
1110
+ function rn() {
1111
+ if (Lr) return Ue;
1112
+ Lr = 1;
1113
+ var e = et(), t = Qt(), n = en(), a = "[object Null]", o = "[object Undefined]", u = e ? e.toStringTag : void 0;
1114
+ function c(v) {
1115
+ return v == null ? v === void 0 ? o : a : u && u in Object(v) ? t(v) : n(v);
1116
+ }
1117
+ return Ue = c, Ue;
1118
+ }
1119
+ var Ge, Nr;
1120
+ function tn() {
1121
+ if (Nr) return Ge;
1122
+ Nr = 1;
1123
+ function e(t) {
1124
+ return t != null && typeof t == "object";
1125
+ }
1126
+ return Ge = e, Ge;
1127
+ }
1128
+ var Be, Wr;
1129
+ function nn() {
1130
+ if (Wr) return Be;
1131
+ Wr = 1;
1132
+ var e = rn(), t = tn(), n = "[object Symbol]";
1133
+ function a(o) {
1134
+ return typeof o == "symbol" || t(o) && e(o) == n;
1135
+ }
1136
+ return Be = a, Be;
1137
+ }
1138
+ var Ye, Mr;
1139
+ function an() {
1140
+ if (Mr) return Ye;
1141
+ Mr = 1;
1142
+ var e = Zt(), t = er(), n = nn(), a = NaN, o = /^[-+]0x[0-9a-f]+$/i, u = /^0b[01]+$/i, c = /^0o[0-7]+$/i, v = parseInt;
1143
+ function d(i) {
1144
+ if (typeof i == "number")
1145
+ return i;
1146
+ if (n(i))
1147
+ return a;
1148
+ if (t(i)) {
1149
+ var s = typeof i.valueOf == "function" ? i.valueOf() : i;
1150
+ i = t(s) ? s + "" : s;
1151
+ }
1152
+ if (typeof i != "string")
1153
+ return i === 0 ? i : +i;
1154
+ i = e(i);
1155
+ var l = u.test(i);
1156
+ return l || c.test(i) ? v(i.slice(2), l ? 2 : 8) : o.test(i) ? a : +i;
1157
+ }
1158
+ return Ye = d, Ye;
1159
+ }
1160
+ var Ve, $r;
1161
+ function rt() {
1162
+ if ($r) return Ve;
1163
+ $r = 1;
1164
+ var e = er(), t = Kt(), n = an(), a = "Expected a function", o = Math.max, u = Math.min;
1165
+ function c(v, d, i) {
1166
+ var s, l, h, b, p, E, F = 0, I = !1, w = !1, N = !0;
1167
+ if (typeof v != "function")
1168
+ throw new TypeError(a);
1169
+ d = n(d) || 0, e(i) && (I = !!i.leading, w = "maxWait" in i, h = w ? o(n(i.maxWait) || 0, d) : h, N = "trailing" in i ? !!i.trailing : N);
1170
+ function W(T) {
1171
+ var C = s, O = l;
1172
+ return s = l = void 0, F = T, b = v.apply(O, C), b;
1173
+ }
1174
+ function $(T) {
1175
+ return F = T, p = setTimeout(q, d), I ? W(T) : b;
1176
+ }
1177
+ function Y(T) {
1178
+ var C = T - E, O = T - F, G = d - C;
1179
+ return w ? u(G, h - O) : G;
1180
+ }
1181
+ function U(T) {
1182
+ var C = T - E, O = T - F;
1183
+ return E === void 0 || C >= d || C < 0 || w && O >= h;
1184
+ }
1185
+ function q() {
1186
+ var T = t();
1187
+ if (U(T))
1188
+ return X(T);
1189
+ p = setTimeout(q, Y(T));
1190
+ }
1191
+ function X(T) {
1192
+ return p = void 0, N && s ? W(T) : (s = l = void 0, b);
1193
+ }
1194
+ function ae() {
1195
+ p !== void 0 && clearTimeout(p), F = 0, s = E = l = p = void 0;
1196
+ }
1197
+ function ie() {
1198
+ return p === void 0 ? b : X(t());
1199
+ }
1200
+ function J() {
1201
+ var T = t(), C = U(T);
1202
+ if (s = arguments, l = this, E = T, C) {
1203
+ if (p === void 0)
1204
+ return $(E);
1205
+ if (w)
1206
+ return clearTimeout(p), p = setTimeout(q, d), W(E);
1207
+ }
1208
+ return p === void 0 && (p = setTimeout(q, d)), b;
1209
+ }
1210
+ return J.cancel = ae, J.flush = ie, J;
1211
+ }
1212
+ return Ve = c, Ve;
1213
+ }
1214
+ var on = rt();
1215
+ const un = /* @__PURE__ */ Hr(on);
1216
+ var sn = function(e, t) {
1217
+ var n = t.debounceWait, a = t.debounceLeading, o = t.debounceTrailing, u = t.debounceMaxWait, c = j(void 0), v = H(function() {
1218
+ var d = {};
1219
+ return a !== void 0 && (d.leading = a), o !== void 0 && (d.trailing = o), u !== void 0 && (d.maxWait = u), d;
1220
+ }, [a, o, u]);
1221
+ return K(function() {
1222
+ if (n) {
1223
+ var d = e.runAsync.bind(e);
1224
+ return c.current = un(function(i) {
1225
+ i();
1226
+ }, n, v), e.runAsync = function() {
1227
+ for (var i = [], s = 0; s < arguments.length; s++)
1228
+ i[s] = arguments[s];
1229
+ return new Promise(function(l, h) {
1230
+ var b;
1231
+ (b = c.current) === null || b === void 0 || b.call(c, function() {
1232
+ d.apply(void 0, k([], A(i), !1)).then(l).catch(h);
1233
+ });
1234
+ });
1235
+ }, function() {
1236
+ var i;
1237
+ (i = c.current) === null || i === void 0 || i.cancel(), e.runAsync = d;
1238
+ };
1239
+ }
1240
+ }, [n, v]), n ? {
1241
+ onCancel: function() {
1242
+ var d;
1243
+ (d = c.current) === null || d === void 0 || d.cancel();
1244
+ }
1245
+ } : {};
1246
+ }, cn = function(e, t) {
1247
+ var n = t.loadingDelay, a = t.ready, o = j(void 0);
1248
+ if (!n)
1249
+ return {};
1250
+ var u = function() {
1251
+ o.current && clearTimeout(o.current);
1252
+ };
1253
+ return {
1254
+ onBefore: function() {
1255
+ return u(), a !== !1 && (o.current = setTimeout(function() {
1256
+ e.setState({
1257
+ loading: !0
1258
+ });
1259
+ }, n)), {
1260
+ loading: !1
1261
+ };
1262
+ },
1263
+ onFinally: function() {
1264
+ u();
1265
+ },
1266
+ onCancel: function() {
1267
+ u();
1268
+ }
1269
+ };
1270
+ }, Te = !!(typeof window < "u" && window.document && window.document.createElement);
1271
+ function rr() {
1272
+ return Te ? document.visibilityState !== "hidden" : !0;
1273
+ }
1274
+ var ye = /* @__PURE__ */ new Set();
1275
+ function fn(e) {
1276
+ return ye.add(e), function() {
1277
+ ye.has(e) && ye.delete(e);
1278
+ };
1279
+ }
1280
+ if (Te) {
1281
+ var ln = function() {
1282
+ rr() && ye.forEach(function(e) {
1283
+ return e();
1284
+ });
1285
+ };
1286
+ window.addEventListener("visibilitychange", ln, !1);
1287
+ }
1288
+ var dn = function(e, t) {
1289
+ var n = t.pollingInterval, a = t.pollingWhenHidden, o = a === void 0 ? !0 : a, u = t.pollingErrorRetryCount, c = u === void 0 ? -1 : u, v = j(void 0), d = j(void 0), i = j(0), s = function() {
1290
+ var l;
1291
+ v.current && clearTimeout(v.current), (l = d.current) === null || l === void 0 || l.call(d);
1292
+ };
1293
+ return Ke(function() {
1294
+ n || s();
1295
+ }, [n]), n ? {
1296
+ onBefore: function() {
1297
+ s();
1298
+ },
1299
+ onError: function() {
1300
+ i.current += 1;
1301
+ },
1302
+ onSuccess: function() {
1303
+ i.current = 0;
1304
+ },
1305
+ onFinally: function() {
1306
+ c === -1 || // When an error occurs, the request is not repeated after pollingErrorRetryCount retries
1307
+ c !== -1 && i.current <= c ? v.current = setTimeout(function() {
1308
+ !o && !rr() ? d.current = fn(function() {
1309
+ e.refresh();
1310
+ }) : e.refresh();
1311
+ }, n) : i.current = 0;
1312
+ },
1313
+ onCancel: function() {
1314
+ s();
1315
+ }
1316
+ } : {};
1317
+ };
1318
+ function vn(e, t) {
1319
+ var n = !1;
1320
+ return function() {
1321
+ for (var a = [], o = 0; o < arguments.length; o++)
1322
+ a[o] = arguments[o];
1323
+ n || (n = !0, e.apply(void 0, k([], A(a), !1)), setTimeout(function() {
1324
+ n = !1;
1325
+ }, t));
1326
+ };
1327
+ }
1328
+ var mn = function() {
1329
+ return Te && typeof navigator.onLine < "u" ? navigator.onLine : !0;
1330
+ }, Re = /* @__PURE__ */ new Set();
1331
+ function pn(e) {
1332
+ return Re.add(e), function() {
1333
+ Re.has(e) && Re.delete(e);
1334
+ };
1335
+ }
1336
+ if (Te) {
1337
+ var Ur = function() {
1338
+ !rr() || !mn() || Re.forEach(function(e) {
1339
+ return e();
1340
+ });
1341
+ };
1342
+ window.addEventListener("visibilitychange", Ur, !1), window.addEventListener("focus", Ur, !1);
1343
+ }
1344
+ var hn = function(e, t) {
1345
+ var n = t.refreshOnWindowFocus, a = t.focusTimespan, o = a === void 0 ? 5e3 : a, u = j(void 0), c = function() {
1346
+ var v;
1347
+ (v = u.current) === null || v === void 0 || v.call(u);
1348
+ };
1349
+ return K(function() {
1350
+ if (n) {
1351
+ var v = vn(e.refresh.bind(e), o);
1352
+ u.current = pn(function() {
1353
+ v();
1354
+ });
1355
+ }
1356
+ return function() {
1357
+ c();
1358
+ };
1359
+ }, [n, o]), Qe(function() {
1360
+ c();
1361
+ }), {};
1362
+ }, bn = function(e, t) {
1363
+ var n = t.retryInterval, a = t.retryCount, o = j(void 0), u = j(0), c = j(!1);
1364
+ return a ? {
1365
+ onBefore: function() {
1366
+ c.current || (u.current = 0), c.current = !1, o.current && clearTimeout(o.current);
1367
+ },
1368
+ onSuccess: function() {
1369
+ u.current = 0;
1370
+ },
1371
+ onError: function() {
1372
+ if (u.current += 1, a === -1 || u.current <= a) {
1373
+ var v = n ?? Math.min(1e3 * Math.pow(2, u.current), 3e4);
1374
+ o.current = setTimeout(function() {
1375
+ c.current = !0, e.refresh();
1376
+ }, v);
1377
+ } else
1378
+ u.current = 0;
1379
+ },
1380
+ onCancel: function() {
1381
+ u.current = 0, o.current && clearTimeout(o.current);
1382
+ }
1383
+ } : {};
1384
+ }, He, Gr;
1385
+ function gn() {
1386
+ if (Gr) return He;
1387
+ Gr = 1;
1388
+ var e = rt(), t = er(), n = "Expected a function";
1389
+ function a(o, u, c) {
1390
+ var v = !0, d = !0;
1391
+ if (typeof o != "function")
1392
+ throw new TypeError(n);
1393
+ return t(c) && (v = "leading" in c ? !!c.leading : v, d = "trailing" in c ? !!c.trailing : d), e(o, u, {
1394
+ leading: v,
1395
+ maxWait: u,
1396
+ trailing: d
1397
+ });
1398
+ }
1399
+ return He = a, He;
1400
+ }
1401
+ var yn = gn();
1402
+ const Rn = /* @__PURE__ */ Hr(yn);
1403
+ var En = function(e, t) {
1404
+ var n = t.throttleWait, a = t.throttleLeading, o = t.throttleTrailing, u = j(void 0), c = {};
1405
+ return a !== void 0 && (c.leading = a), o !== void 0 && (c.trailing = o), K(function() {
1406
+ if (n) {
1407
+ var v = e.runAsync.bind(e);
1408
+ return u.current = Rn(function(d) {
1409
+ d();
1410
+ }, n, c), e.runAsync = function() {
1411
+ for (var d = [], i = 0; i < arguments.length; i++)
1412
+ d[i] = arguments[i];
1413
+ return new Promise(function(s, l) {
1414
+ var h;
1415
+ (h = u.current) === null || h === void 0 || h.call(u, function() {
1416
+ v.apply(void 0, k([], A(d), !1)).then(s).catch(l);
1417
+ });
1418
+ });
1419
+ }, function() {
1420
+ var d;
1421
+ e.runAsync = v, (d = u.current) === null || d === void 0 || d.cancel();
1422
+ };
1423
+ }
1424
+ }, [n, a, o]), n ? {
1425
+ onCancel: function() {
1426
+ var v;
1427
+ (v = u.current) === null || v === void 0 || v.cancel();
1428
+ }
1429
+ } : {};
1430
+ }, Sn = function(e) {
1431
+ Se && (Ee(e) || console.error('useMount: parameter `fn` expected to be a function, but got "'.concat(typeof e, '".'))), K(function() {
1432
+ var t = e?.();
1433
+ if (!(t && typeof t == "object" && typeof t.then == "function"))
1434
+ return t;
1435
+ }, []);
1436
+ }, Tn = function() {
1437
+ var e = A(z({}), 2), t = e[1];
1438
+ return Q(function() {
1439
+ return t({});
1440
+ });
1441
+ }, _n = (
1442
+ /** @class */
1443
+ (function() {
1444
+ function e(t, n, a, o) {
1445
+ o === void 0 && (o = {}), this.serviceRef = t, this.options = n, this.subscribe = a, this.initState = o, this.pluginImpls = [], this.count = 0, this.state = {
1446
+ loading: !1,
1447
+ params: void 0,
1448
+ data: void 0,
1449
+ error: void 0
1450
+ }, this.state = B(B(B({}, this.state), { loading: !n.manual }), o);
1451
+ }
1452
+ return e.prototype.setState = function(t) {
1453
+ t === void 0 && (t = {}), this.state = B(B({}, this.state), t), this.subscribe();
1454
+ }, e.prototype.runPluginHandler = function(t) {
1455
+ for (var n = [], a = 1; a < arguments.length; a++)
1456
+ n[a - 1] = arguments[a];
1457
+ var o = this.pluginImpls.map(function(u) {
1458
+ var c;
1459
+ return (c = u[t]) === null || c === void 0 ? void 0 : c.call.apply(c, k([u], A(n), !1));
1460
+ }).filter(Boolean);
1461
+ return Object.assign.apply(Object, k([{}], A(o), !1));
1462
+ }, e.prototype.runAsync = function() {
1463
+ for (var t = [], n = 0; n < arguments.length; n++)
1464
+ t[n] = arguments[n];
1465
+ return Mt(this, void 0, void 0, function() {
1466
+ var a, o, u, c, v, d, i, s, l, h, b, p, E, F, I, w, N, W, $, Y, U;
1467
+ return $t(this, function(q) {
1468
+ switch (q.label) {
1469
+ case 0:
1470
+ if (this.count += 1, a = this.count, o = this.runPluginHandler("onBefore", t), u = o.stopNow, c = u === void 0 ? !1 : u, v = o.returnNow, d = v === void 0 ? !1 : v, i = Jr(o, ["stopNow", "returnNow"]), c)
1471
+ return [2, Promise.resolve(i.data)];
1472
+ if (this.setState(B({ loading: !0, params: t }, i)), d)
1473
+ return [2, Promise.resolve(i.data)];
1474
+ (E = (p = this.options).onBefore) === null || E === void 0 || E.call(p, t), q.label = 1;
1475
+ case 1:
1476
+ return q.trys.push([1, 3, , 4]), s = this.runPluginHandler("onRequest", this.serviceRef.current, t).servicePromise, s || (s = (b = this.serviceRef).current.apply(b, k([], A(t), !1))), [4, s];
1477
+ case 2:
1478
+ return l = q.sent(), a !== this.count ? [2, new Promise(function() {
1479
+ })] : (this.setState({
1480
+ data: l,
1481
+ error: void 0,
1482
+ loading: !1
1483
+ }), (I = (F = this.options).onSuccess) === null || I === void 0 || I.call(F, l, t), this.runPluginHandler("onSuccess", l, t), (N = (w = this.options).onFinally) === null || N === void 0 || N.call(w, t, l, void 0), a === this.count && this.runPluginHandler("onFinally", t, l, void 0), [2, l]);
1484
+ case 3:
1485
+ if (h = q.sent(), a !== this.count)
1486
+ return [2, new Promise(function() {
1487
+ })];
1488
+ throw this.setState({
1489
+ error: h,
1490
+ loading: !1
1491
+ }), ($ = (W = this.options).onError) === null || $ === void 0 || $.call(W, h, t), this.runPluginHandler("onError", h, t), (U = (Y = this.options).onFinally) === null || U === void 0 || U.call(Y, t, void 0, h), a === this.count && this.runPluginHandler("onFinally", t, void 0, h), h;
1492
+ case 4:
1493
+ return [
1494
+ 2
1495
+ /*return*/
1496
+ ];
1497
+ }
1498
+ });
1499
+ });
1500
+ }, e.prototype.run = function() {
1501
+ for (var t = this, n = [], a = 0; a < arguments.length; a++)
1502
+ n[a] = arguments[a];
1503
+ this.runAsync.apply(this, k([], A(n), !1)).catch(function(o) {
1504
+ t.options.onError || console.error(o);
1505
+ });
1506
+ }, e.prototype.cancel = function() {
1507
+ this.count += 1, this.setState({
1508
+ loading: !1
1509
+ }), this.runPluginHandler("onCancel");
1510
+ }, e.prototype.refresh = function() {
1511
+ this.run.apply(this, k([], A(this.state.params || []), !1));
1512
+ }, e.prototype.refreshAsync = function() {
1513
+ return this.runAsync.apply(this, k([], A(this.state.params || []), !1));
1514
+ }, e.prototype.mutate = function(t) {
1515
+ var n = Ee(t) ? t(this.state.data) : t;
1516
+ this.runPluginHandler("onMutate", n), this.setState({
1517
+ data: n
1518
+ });
1519
+ }, e;
1520
+ })()
1521
+ );
1522
+ function wn(e, t, n) {
1523
+ t === void 0 && (t = {}), n === void 0 && (n = []);
1524
+ var a = t.manual, o = a === void 0 ? !1 : a, u = t.ready, c = u === void 0 ? !0 : u, v = Jr(t, ["manual", "ready"]);
1525
+ Se && t.defaultParams && !Array.isArray(t.defaultParams) && console.warn("expected defaultParams is array, got ".concat(typeof t.defaultParams));
1526
+ var d = B({ manual: o, ready: c }, v), i = Zr(e), s = Tn(), l = Xr(function() {
1527
+ var h = n.map(function(b) {
1528
+ var p;
1529
+ return (p = b?.onInit) === null || p === void 0 ? void 0 : p.call(b, d);
1530
+ }).filter(Boolean);
1531
+ return new _n(i, d, s, Object.assign.apply(Object, k([{}], A(h), !1)));
1532
+ }, []);
1533
+ return l.options = d, l.pluginImpls = n.map(function(h) {
1534
+ return h(l, d);
1535
+ }), Sn(function() {
1536
+ if (!o && c) {
1537
+ var h = l.state.params || t.defaultParams || [];
1538
+ l.run.apply(l, k([], A(h), !1));
1539
+ }
1540
+ }), Qe(function() {
1541
+ l.cancel();
1542
+ }), {
1543
+ loading: l.state.loading,
1544
+ data: l.state.data,
1545
+ error: l.state.error,
1546
+ params: l.state.params || [],
1547
+ cancel: Q(l.cancel.bind(l)),
1548
+ refresh: Q(l.refresh.bind(l)),
1549
+ refreshAsync: Q(l.refreshAsync.bind(l)),
1550
+ run: Q(l.run.bind(l)),
1551
+ runAsync: Q(l.runAsync.bind(l)),
1552
+ mutate: Q(l.mutate.bind(l))
1553
+ };
1554
+ }
1555
+ function Br(e, t, n) {
1556
+ return wn(e, t, k(k([], A([]), !1), [
1557
+ sn,
1558
+ cn,
1559
+ dn,
1560
+ hn,
1561
+ En,
1562
+ Kr,
1563
+ zt,
1564
+ bn
1565
+ ], !1));
1566
+ }
1567
+ var On = /* @__PURE__ */ ((e) => (e[e.userReq = 1] = "userReq", e[e.menuReq = 2] = "menuReq", e))(On || {});
1568
+ const Pn = [
1569
+ {
1570
+ path: "userinfo",
1571
+ component: "userinfo/index",
1572
+ meta: { title: "个人信息" },
1573
+ menuType: "C"
1574
+ },
1575
+ {
1576
+ path: "404",
1577
+ component: "404/index",
1578
+ meta: { title: "404" },
1579
+ menuType: "C"
1580
+ },
1581
+ {
1582
+ path: "lowcode/flow",
1583
+ component: "lowcode/flow/index",
1584
+ meta: { title: "工作流" }
1585
+ },
1586
+ {
1587
+ path: "home",
1588
+ component: "home/index",
1589
+ meta: { title: "首页" },
1590
+ menuType: "C"
1591
+ }
1592
+ ], jn = {
1593
+ userId: "",
1594
+ userName: "",
1595
+ deptId: "",
1596
+ deptName: "",
1597
+ phone: "",
1598
+ roles: "",
1599
+ rolePermis: []
1600
+ }, Xe = (e) => {
1601
+ if (xt(e)) return Ct(e);
1602
+ if (Array.isArray(e)) return e.map(Xe);
1603
+ if (!e || typeof e != "object") return e;
1604
+ const t = {};
1605
+ for (const n of Object.keys(e)) t[n] = Xe(e[n]);
1606
+ return t;
1607
+ };
1608
+ function An(e) {
1609
+ const t = () => {
1610
+ const i = e.routesConfig ?? [], s = i.findIndex((l) => l?.path === "/");
1611
+ return s >= 0 ? i[s] : void 0;
1612
+ }, n = () => {
1613
+ const i = t(), s = i?.children;
1614
+ !i || !Array.isArray(s) || (i.children = s.filter(
1615
+ (l) => l?.path === "userinfo" || l?.path === "home" || l?.path === "*"
1616
+ ));
1617
+ }, a = (i) => {
1618
+ const s = t();
1619
+ if (!s) return;
1620
+ const l = Array.isArray(i) ? [...i].reverse() : i;
1621
+ e.transConfig(l, s);
1622
+ }, o = () => {
1623
+ const s = t()?.children;
1624
+ return Array.isArray(s) ? (e.transMenu(Xe(s)) ?? []).filter((h) => h).filter((h) => h?.key !== "*") : [];
1625
+ }, u = (i) => {
1626
+ const s = i?.data, l = s?.user;
1627
+ l && e.userLocal.set({
1628
+ userId: l.userName,
1629
+ userName: l.nickName,
1630
+ deptId: l.dept?.id,
1631
+ deptName: l.dept?.deptName,
1632
+ phone: l.phonenumber,
1633
+ permissions: s.permissions,
1634
+ roles: s.roleNames,
1635
+ rolePermis: JSON.stringify(s.rolePermis)
1636
+ });
1637
+ }, [c, v] = Lt(() => {
1638
+ const { proxy: i } = Nt(), s = Br(
1639
+ () => e.request({
1640
+ url: "v1/system/login/getInfo",
1641
+ method: "get"
1642
+ }),
1643
+ {
1644
+ manual: !0,
1645
+ debounceWait: 200
1646
+ }
1647
+ ), l = H(() => s.data?.code === 200 ? (u(s.data), e.userLocal.get()) : e.userLocal.get() || jn, [s.data]), h = Br(
1648
+ () => e.request({
1649
+ url: "v1/system/login/getPzptRouters",
1650
+ method: "get"
1651
+ }),
1652
+ {
1653
+ manual: !0,
1654
+ debounceWait: 200
1655
+ }
1656
+ ), b = H(() => (h.data?.code === 200 && a(h.data.data), e.routesConfig), [h.data]), p = H(() => h.data?.code === 200 ? o() : [], [h.data]), [E, F] = z(""), [I, w] = z(e.menuStyle), [N, W] = z(e.initPane), [$, Y] = z("home"), [U, q] = z([]), X = H(
1657
+ () => p.map((O) => ({ label: O.label, key: O.key })),
1658
+ [p]
1659
+ ), ae = H(() => p.length ? p.find(
1660
+ (G) => G?.key === E
1661
+ )?.children || [] : [], [E, p]), ie = (O) => q((G) => [...G, O]), J = H(() => {
1662
+ if (h.data?.code === 200) {
1663
+ const O = Array.isArray(h.data.data) ? h.data.data : [];
1664
+ return e.flattenRoutesFormat([
1665
+ ...O,
1666
+ ...Pn,
1667
+ ...U
1668
+ ]);
1669
+ }
1670
+ return [];
1671
+ }, [h.data, U]);
1672
+ return i({
1673
+ 1: s,
1674
+ 2: h,
1675
+ userReq: s,
1676
+ menuReq: h,
1677
+ Routes: b,
1678
+ menus: p,
1679
+ user: l,
1680
+ activeTopLabel: E,
1681
+ setActiveTopLabel: F,
1682
+ dynamicFlatternRouteScale: ie,
1683
+ layoutStyle: I,
1684
+ setLayoutStyle: w,
1685
+ topRootMenus: X,
1686
+ activeLeftMenuChildren: ae,
1687
+ flattenRoutes: J,
1688
+ panes: N,
1689
+ setPanes: W,
1690
+ resetTabs: () => {
1691
+ F("home"), Y("home"), W(e.initPane);
1692
+ },
1693
+ activeKey: $,
1694
+ setActiveKey: Y,
1695
+ closeTab: () => {
1696
+ const O = N;
1697
+ if (O?.length >= 2) {
1698
+ const G = O.findIndex((re) => re.key === $), oe = O.filter((re) => re.key !== $);
1699
+ W(oe), Y(oe[Math.max(0, G - 1)]?.key ?? "home");
1700
+ }
1701
+ },
1702
+ recoverConfig: n
1703
+ });
1704
+ }), d = () => {
1705
+ };
1706
+ return {
1707
+ StoreProvider: qt,
1708
+ useSystemStore: c,
1709
+ getSystemStore: v,
1710
+ useLazilyStore: c,
1711
+ getLazilyStore: v,
1712
+ useAppDispatch: d,
1713
+ useAppSelector: d,
1714
+ injectReducer: d,
1715
+ removeReducer: d,
1716
+ registerPersistSlice: d,
1717
+ unregisterPersistSlice: d
1718
+ };
1719
+ }
1720
+ export {
1721
+ qt as HoxRoot,
1722
+ On as LazilyKey,
1723
+ Lt as createGlobalStore,
1724
+ An as createSgTemplateSystemStore,
1725
+ Cn as createStore,
1726
+ Nt as useLazily
1727
+ };
1728
+ //# sourceMappingURL=core-store.js.map