xmirror-components 1.0.8 → 1.0.10

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