@obb871001/api-integration-sdk 1.0.47 → 1.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +7 -7
- package/dist/index.js +417 -470
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import ye, { createContext as at, useContext as ot, useMemo as Ge, useCallback as
|
|
2
|
-
import { QueryClient as ut, QueryClientProvider as ct, useQueries as
|
|
1
|
+
import ye, { createContext as at, useContext as ot, useMemo as Ge, useCallback as de, useRef as sr, useEffect as Ce } from "react";
|
|
2
|
+
import { QueryClient as ut, QueryClientProvider as ct, useQueries as Pr } from "@tanstack/react-query";
|
|
3
3
|
import it from "axios";
|
|
4
4
|
import { get as we } from "lodash";
|
|
5
5
|
import st from "react-dom";
|
|
@@ -11,28 +11,28 @@ var lr;
|
|
|
11
11
|
function ft() {
|
|
12
12
|
if (lr) return Ee;
|
|
13
13
|
lr = 1;
|
|
14
|
-
var r = ye,
|
|
15
|
-
function S(
|
|
14
|
+
var r = ye, y = Symbol.for("react.element"), O = Symbol.for("react.fragment"), E = Object.prototype.hasOwnProperty, f = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, _ = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
15
|
+
function S(d, c, s) {
|
|
16
16
|
var o, a = {}, i = null, t = null;
|
|
17
|
-
s !== void 0 && (i = "" + s),
|
|
18
|
-
for (o in
|
|
19
|
-
if (
|
|
20
|
-
return { $$typeof:
|
|
17
|
+
s !== void 0 && (i = "" + s), c.key !== void 0 && (i = "" + c.key), c.ref !== void 0 && (t = c.ref);
|
|
18
|
+
for (o in c) E.call(c, o) && !_.hasOwnProperty(o) && (a[o] = c[o]);
|
|
19
|
+
if (d && d.defaultProps) for (o in c = d.defaultProps, c) a[o] === void 0 && (a[o] = c[o]);
|
|
20
|
+
return { $$typeof: y, type: d, key: i, ref: t, props: a, _owner: f.current };
|
|
21
21
|
}
|
|
22
22
|
return Ee.Fragment = O, Ee.jsx = S, Ee.jsxs = S, Ee;
|
|
23
23
|
}
|
|
24
24
|
var _e = {};
|
|
25
25
|
var fr;
|
|
26
|
-
function
|
|
26
|
+
function vt() {
|
|
27
27
|
return fr || (fr = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
28
|
-
var r = ye,
|
|
29
|
-
function
|
|
28
|
+
var r = ye, y = Symbol.for("react.element"), O = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), S = Symbol.for("react.provider"), d = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), s = Symbol.for("react.suspense"), o = Symbol.for("react.suspense_list"), a = Symbol.for("react.memo"), i = Symbol.for("react.lazy"), t = Symbol.for("react.offscreen"), n = Symbol.iterator, v = "@@iterator";
|
|
29
|
+
function h(e) {
|
|
30
30
|
if (e === null || typeof e != "object")
|
|
31
31
|
return null;
|
|
32
|
-
var l = n && e[n] || e[
|
|
32
|
+
var l = n && e[n] || e[v];
|
|
33
33
|
return typeof l == "function" ? l : null;
|
|
34
34
|
}
|
|
35
|
-
var
|
|
35
|
+
var u = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
36
36
|
function b(e) {
|
|
37
37
|
{
|
|
38
38
|
for (var l = arguments.length, g = new Array(l > 1 ? l - 1 : 0), p = 1; p < l; p++)
|
|
@@ -42,18 +42,18 @@ function dt() {
|
|
|
42
42
|
}
|
|
43
43
|
function C(e, l, g) {
|
|
44
44
|
{
|
|
45
|
-
var p =
|
|
45
|
+
var p = u.ReactDebugCurrentFrame, w = p.getStackAddendum();
|
|
46
46
|
w !== "" && (l += "%s", g = g.concat([w]));
|
|
47
|
-
var
|
|
47
|
+
var k = g.map(function(R) {
|
|
48
48
|
return String(R);
|
|
49
49
|
});
|
|
50
|
-
|
|
50
|
+
k.unshift("Warning: " + l), Function.prototype.apply.call(console[e], console, k);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
var
|
|
53
|
+
var P = !1, m = !1, A = !1, I = !1, se = !1, le;
|
|
54
54
|
le = Symbol.for("react.module.reference");
|
|
55
|
-
function
|
|
56
|
-
return !!(typeof e == "string" || typeof e == "function" || e === E || e === _ || se || e === f || e === s || e === o || I || e === t ||
|
|
55
|
+
function ke(e) {
|
|
56
|
+
return !!(typeof e == "string" || typeof e == "function" || e === E || e === _ || se || e === f || e === s || e === o || I || e === t || P || m || A || typeof e == "object" && e !== null && (e.$$typeof === i || e.$$typeof === a || e.$$typeof === S || e.$$typeof === d || e.$$typeof === c || // This needs to include all possible module reference object
|
|
57
57
|
// types supported by any Flight configuration anywhere since
|
|
58
58
|
// we don't know which Flight build this will end up being used
|
|
59
59
|
// with.
|
|
@@ -92,21 +92,21 @@ function dt() {
|
|
|
92
92
|
}
|
|
93
93
|
if (typeof e == "object")
|
|
94
94
|
switch (e.$$typeof) {
|
|
95
|
-
case
|
|
95
|
+
case d:
|
|
96
96
|
var l = e;
|
|
97
97
|
return J(l) + ".Consumer";
|
|
98
98
|
case S:
|
|
99
99
|
var g = e;
|
|
100
100
|
return J(g._context) + ".Provider";
|
|
101
|
-
case
|
|
101
|
+
case c:
|
|
102
102
|
return be(e, e.render, "ForwardRef");
|
|
103
103
|
case a:
|
|
104
104
|
var p = e.displayName || null;
|
|
105
105
|
return p !== null ? p : L(e.type) || "Memo";
|
|
106
106
|
case i: {
|
|
107
|
-
var w = e,
|
|
107
|
+
var w = e, k = w._payload, R = w._init;
|
|
108
108
|
try {
|
|
109
|
-
return L(R(
|
|
109
|
+
return L(R(k));
|
|
110
110
|
} catch {
|
|
111
111
|
return null;
|
|
112
112
|
}
|
|
@@ -176,7 +176,7 @@ function dt() {
|
|
|
176
176
|
X < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
var oe =
|
|
179
|
+
var oe = u.ReactCurrentDispatcher, Y;
|
|
180
180
|
function ue(e, l, g) {
|
|
181
181
|
{
|
|
182
182
|
if (Y === void 0)
|
|
@@ -190,16 +190,16 @@ function dt() {
|
|
|
190
190
|
` + Y + e;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
var ee = !1,
|
|
193
|
+
var ee = !1, me;
|
|
194
194
|
{
|
|
195
195
|
var Mr = typeof WeakMap == "function" ? WeakMap : Map;
|
|
196
|
-
|
|
196
|
+
me = new Mr();
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function Ke(e, l) {
|
|
199
199
|
if (!e || ee)
|
|
200
200
|
return "";
|
|
201
201
|
{
|
|
202
|
-
var g =
|
|
202
|
+
var g = me.get(e);
|
|
203
203
|
if (g !== void 0)
|
|
204
204
|
return g;
|
|
205
205
|
}
|
|
@@ -207,8 +207,8 @@ function dt() {
|
|
|
207
207
|
ee = !0;
|
|
208
208
|
var w = Error.prepareStackTrace;
|
|
209
209
|
Error.prepareStackTrace = void 0;
|
|
210
|
-
var
|
|
211
|
-
|
|
210
|
+
var k;
|
|
211
|
+
k = oe.current, oe.current = null, z();
|
|
212
212
|
try {
|
|
213
213
|
if (l) {
|
|
214
214
|
var R = function() {
|
|
@@ -243,41 +243,41 @@ function dt() {
|
|
|
243
243
|
}
|
|
244
244
|
} catch (W) {
|
|
245
245
|
if (W && p && typeof W.stack == "string") {
|
|
246
|
-
for (var
|
|
246
|
+
for (var T = W.stack.split(`
|
|
247
247
|
`), U = p.stack.split(`
|
|
248
|
-
`), N =
|
|
248
|
+
`), N = T.length - 1, M = U.length - 1; N >= 1 && M >= 0 && T[N] !== U[M]; )
|
|
249
249
|
M--;
|
|
250
250
|
for (; N >= 1 && M >= 0; N--, M--)
|
|
251
|
-
if (
|
|
251
|
+
if (T[N] !== U[M]) {
|
|
252
252
|
if (N !== 1 || M !== 1)
|
|
253
253
|
do
|
|
254
|
-
if (N--, M--, M < 0 ||
|
|
254
|
+
if (N--, M--, M < 0 || T[N] !== U[M]) {
|
|
255
255
|
var q = `
|
|
256
|
-
` +
|
|
257
|
-
return e.displayName && q.includes("<anonymous>") && (q = q.replace("<anonymous>", e.displayName)), typeof e == "function" &&
|
|
256
|
+
` + T[N].replace(" at new ", " at ");
|
|
257
|
+
return e.displayName && q.includes("<anonymous>") && (q = q.replace("<anonymous>", e.displayName)), typeof e == "function" && me.set(e, q), q;
|
|
258
258
|
}
|
|
259
259
|
while (N >= 1 && M >= 0);
|
|
260
260
|
break;
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
} finally {
|
|
264
|
-
ee = !1, oe.current =
|
|
264
|
+
ee = !1, oe.current = k, pe(), Error.prepareStackTrace = w;
|
|
265
265
|
}
|
|
266
266
|
var ie = e ? e.displayName || e.name : "", re = ie ? ue(ie) : "";
|
|
267
|
-
return typeof e == "function" &&
|
|
267
|
+
return typeof e == "function" && me.set(e, re), re;
|
|
268
268
|
}
|
|
269
269
|
function Dr(e, l, g) {
|
|
270
|
-
return
|
|
270
|
+
return Ke(e, !1);
|
|
271
271
|
}
|
|
272
272
|
function Lr(e) {
|
|
273
273
|
var l = e.prototype;
|
|
274
274
|
return !!(l && l.isReactComponent);
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function Te(e, l, g) {
|
|
277
277
|
if (e == null)
|
|
278
278
|
return "";
|
|
279
279
|
if (typeof e == "function")
|
|
280
|
-
return
|
|
280
|
+
return Ke(e, Lr(e));
|
|
281
281
|
if (typeof e == "string")
|
|
282
282
|
return ue(e);
|
|
283
283
|
switch (e) {
|
|
@@ -288,44 +288,44 @@ function dt() {
|
|
|
288
288
|
}
|
|
289
289
|
if (typeof e == "object")
|
|
290
290
|
switch (e.$$typeof) {
|
|
291
|
-
case
|
|
291
|
+
case c:
|
|
292
292
|
return Dr(e.render);
|
|
293
293
|
case a:
|
|
294
|
-
return
|
|
294
|
+
return Te(e.type, l, g);
|
|
295
295
|
case i: {
|
|
296
|
-
var p = e, w = p._payload,
|
|
296
|
+
var p = e, w = p._payload, k = p._init;
|
|
297
297
|
try {
|
|
298
|
-
return
|
|
298
|
+
return Te(k(w), l, g);
|
|
299
299
|
} catch {
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
return "";
|
|
304
304
|
}
|
|
305
|
-
var
|
|
305
|
+
var ve = Object.prototype.hasOwnProperty, xe = {}, Qe = u.ReactDebugCurrentFrame;
|
|
306
306
|
function Re(e) {
|
|
307
307
|
if (e) {
|
|
308
|
-
var l = e._owner, g =
|
|
308
|
+
var l = e._owner, g = Te(e.type, e._source, l ? l.type : null);
|
|
309
309
|
Qe.setExtraStackFrame(g);
|
|
310
310
|
} else
|
|
311
311
|
Qe.setExtraStackFrame(null);
|
|
312
312
|
}
|
|
313
313
|
function jr(e, l, g, p, w) {
|
|
314
314
|
{
|
|
315
|
-
var
|
|
315
|
+
var k = Function.call.bind(ve);
|
|
316
316
|
for (var R in e)
|
|
317
|
-
if (
|
|
318
|
-
var
|
|
317
|
+
if (k(e, R)) {
|
|
318
|
+
var T = void 0;
|
|
319
319
|
try {
|
|
320
320
|
if (typeof e[R] != "function") {
|
|
321
321
|
var U = Error((p || "React class") + ": " + g + " type `" + R + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[R] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
322
322
|
throw U.name = "Invariant Violation", U;
|
|
323
323
|
}
|
|
324
|
-
|
|
324
|
+
T = e[R](l, R, p, g, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
325
325
|
} catch (N) {
|
|
326
|
-
|
|
326
|
+
T = N;
|
|
327
327
|
}
|
|
328
|
-
|
|
328
|
+
T && !(T instanceof Error) && (Re(w), b("%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).", p || "React class", g, R, typeof T), Re(null)), T instanceof Error && !(T.message in xe) && (xe[T.message] = !0, Re(w), b("Failed %s type: %s", g, T.message), Re(null));
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
}
|
|
@@ -353,14 +353,14 @@ function dt() {
|
|
|
353
353
|
if (Fr(e))
|
|
354
354
|
return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Wr(e)), ze(e);
|
|
355
355
|
}
|
|
356
|
-
var Ze =
|
|
356
|
+
var Ze = u.ReactCurrentOwner, qr = {
|
|
357
357
|
key: !0,
|
|
358
358
|
ref: !0,
|
|
359
359
|
__self: !0,
|
|
360
360
|
__source: !0
|
|
361
361
|
}, er, rr;
|
|
362
362
|
function Gr(e) {
|
|
363
|
-
if (
|
|
363
|
+
if (ve.call(e, "ref")) {
|
|
364
364
|
var l = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
365
365
|
if (l && l.isReactWarning)
|
|
366
366
|
return !1;
|
|
@@ -368,7 +368,7 @@ function dt() {
|
|
|
368
368
|
return e.ref !== void 0;
|
|
369
369
|
}
|
|
370
370
|
function Jr(e) {
|
|
371
|
-
if (
|
|
371
|
+
if (ve.call(e, "key")) {
|
|
372
372
|
var l = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
373
373
|
if (l && l.isReactWarning)
|
|
374
374
|
return !1;
|
|
@@ -400,57 +400,57 @@ function dt() {
|
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
-
var Br = function(e, l, g, p, w,
|
|
404
|
-
var
|
|
403
|
+
var Br = function(e, l, g, p, w, k, R) {
|
|
404
|
+
var T = {
|
|
405
405
|
// This tag allows us to uniquely identify this as a React Element
|
|
406
|
-
$$typeof:
|
|
406
|
+
$$typeof: y,
|
|
407
407
|
// Built-in properties that belong on the element
|
|
408
408
|
type: e,
|
|
409
409
|
key: l,
|
|
410
410
|
ref: g,
|
|
411
411
|
props: R,
|
|
412
412
|
// Record the component responsible for creating this element.
|
|
413
|
-
_owner:
|
|
413
|
+
_owner: k
|
|
414
414
|
};
|
|
415
|
-
return
|
|
415
|
+
return T._store = {}, Object.defineProperty(T._store, "validated", {
|
|
416
416
|
configurable: !1,
|
|
417
417
|
enumerable: !1,
|
|
418
418
|
writable: !0,
|
|
419
419
|
value: !1
|
|
420
|
-
}), Object.defineProperty(
|
|
420
|
+
}), Object.defineProperty(T, "_self", {
|
|
421
421
|
configurable: !1,
|
|
422
422
|
enumerable: !1,
|
|
423
423
|
writable: !1,
|
|
424
424
|
value: p
|
|
425
|
-
}), Object.defineProperty(
|
|
425
|
+
}), Object.defineProperty(T, "_source", {
|
|
426
426
|
configurable: !1,
|
|
427
427
|
enumerable: !1,
|
|
428
428
|
writable: !1,
|
|
429
429
|
value: w
|
|
430
|
-
}), Object.freeze && (Object.freeze(
|
|
430
|
+
}), Object.freeze && (Object.freeze(T.props), Object.freeze(T)), T;
|
|
431
431
|
};
|
|
432
432
|
function Yr(e, l, g, p, w) {
|
|
433
433
|
{
|
|
434
|
-
var
|
|
435
|
-
g !== void 0 && (Xe(g),
|
|
436
|
-
for (
|
|
437
|
-
|
|
434
|
+
var k, R = {}, T = null, U = null;
|
|
435
|
+
g !== void 0 && (Xe(g), T = "" + g), Jr(l) && (Xe(l.key), T = "" + l.key), Gr(l) && (U = l.ref, Hr(l, w));
|
|
436
|
+
for (k in l)
|
|
437
|
+
ve.call(l, k) && !qr.hasOwnProperty(k) && (R[k] = l[k]);
|
|
438
438
|
if (e && e.defaultProps) {
|
|
439
439
|
var N = e.defaultProps;
|
|
440
|
-
for (
|
|
441
|
-
R[
|
|
440
|
+
for (k in N)
|
|
441
|
+
R[k] === void 0 && (R[k] = N[k]);
|
|
442
442
|
}
|
|
443
|
-
if (
|
|
443
|
+
if (T || U) {
|
|
444
444
|
var M = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
445
|
-
|
|
445
|
+
T && Vr(R, M), U && $r(R, M);
|
|
446
446
|
}
|
|
447
|
-
return Br(e,
|
|
447
|
+
return Br(e, T, U, w, p, Ze.current, R);
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
-
var Ne =
|
|
450
|
+
var Ne = u.ReactCurrentOwner, tr = u.ReactDebugCurrentFrame;
|
|
451
451
|
function ce(e) {
|
|
452
452
|
if (e) {
|
|
453
|
-
var l = e._owner, g =
|
|
453
|
+
var l = e._owner, g = Te(e.type, e._source, l ? l.type : null);
|
|
454
454
|
tr.setExtraStackFrame(g);
|
|
455
455
|
} else
|
|
456
456
|
tr.setExtraStackFrame(null);
|
|
@@ -458,7 +458,7 @@ function dt() {
|
|
|
458
458
|
var Me;
|
|
459
459
|
Me = !1;
|
|
460
460
|
function De(e) {
|
|
461
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
461
|
+
return typeof e == "object" && e !== null && e.$$typeof === y;
|
|
462
462
|
}
|
|
463
463
|
function nr() {
|
|
464
464
|
{
|
|
@@ -472,11 +472,11 @@ Check the render method of \`` + e + "`.";
|
|
|
472
472
|
return "";
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function Kr(e) {
|
|
476
476
|
return "";
|
|
477
477
|
}
|
|
478
478
|
var ar = {};
|
|
479
|
-
function
|
|
479
|
+
function xr(e) {
|
|
480
480
|
{
|
|
481
481
|
var l = nr();
|
|
482
482
|
if (!l) {
|
|
@@ -493,7 +493,7 @@ Check the top-level render call using <` + g + ">.");
|
|
|
493
493
|
if (!e._store || e._store.validated || e.key != null)
|
|
494
494
|
return;
|
|
495
495
|
e._store.validated = !0;
|
|
496
|
-
var g =
|
|
496
|
+
var g = xr(l);
|
|
497
497
|
if (ar[g])
|
|
498
498
|
return;
|
|
499
499
|
ar[g] = !0;
|
|
@@ -513,9 +513,9 @@ Check the top-level render call using <` + g + ">.");
|
|
|
513
513
|
else if (De(e))
|
|
514
514
|
e._store && (e._store.validated = !0);
|
|
515
515
|
else if (e) {
|
|
516
|
-
var w =
|
|
516
|
+
var w = h(e);
|
|
517
517
|
if (typeof w == "function" && w !== e.entries)
|
|
518
|
-
for (var
|
|
518
|
+
for (var k = w.call(e), R; !(R = k.next()).done; )
|
|
519
519
|
De(R.value) && or(R.value, l);
|
|
520
520
|
}
|
|
521
521
|
}
|
|
@@ -528,7 +528,7 @@ Check the top-level render call using <` + g + ">.");
|
|
|
528
528
|
var g;
|
|
529
529
|
if (typeof l == "function")
|
|
530
530
|
g = l.propTypes;
|
|
531
|
-
else if (typeof l == "object" && (l.$$typeof ===
|
|
531
|
+
else if (typeof l == "object" && (l.$$typeof === c || // Note: Memo only checks outer props here.
|
|
532
532
|
// Inner props are checked in the reconciler.
|
|
533
533
|
l.$$typeof === a))
|
|
534
534
|
g = l.propTypes;
|
|
@@ -558,18 +558,18 @@ Check the top-level render call using <` + g + ">.");
|
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
var cr = {};
|
|
561
|
-
function ir(e, l, g, p, w,
|
|
561
|
+
function ir(e, l, g, p, w, k) {
|
|
562
562
|
{
|
|
563
|
-
var R =
|
|
563
|
+
var R = ke(e);
|
|
564
564
|
if (!R) {
|
|
565
|
-
var
|
|
566
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
567
|
-
var U =
|
|
568
|
-
U ?
|
|
565
|
+
var T = "";
|
|
566
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (T += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
567
|
+
var U = Kr();
|
|
568
|
+
U ? T += U : T += nr();
|
|
569
569
|
var N;
|
|
570
|
-
e === null ? N = "null" : Ie(e) ? N = "array" : e !== void 0 && e.$$typeof ===
|
|
570
|
+
e === null ? N = "null" : Ie(e) ? N = "array" : e !== void 0 && e.$$typeof === y ? (N = "<" + (L(e.type) || "Unknown") + " />", T = " Did you accidentally export a JSX literal instead of a component?") : N = typeof e, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", N, T);
|
|
571
571
|
}
|
|
572
|
-
var M = Yr(e, l, g, w,
|
|
572
|
+
var M = Yr(e, l, g, w, k);
|
|
573
573
|
if (M == null)
|
|
574
574
|
return M;
|
|
575
575
|
if (R) {
|
|
@@ -585,7 +585,7 @@ Check the top-level render call using <` + g + ">.");
|
|
|
585
585
|
else
|
|
586
586
|
ur(q, e);
|
|
587
587
|
}
|
|
588
|
-
if (
|
|
588
|
+
if (ve.call(l, "key")) {
|
|
589
589
|
var re = L(e), W = Object.keys(l).filter(function(nt) {
|
|
590
590
|
return nt !== "key";
|
|
591
591
|
}), Le = W.length > 0 ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
@@ -612,97 +612,44 @@ React keys must be passed directly to JSX without using spread:
|
|
|
612
612
|
_e.Fragment = E, _e.jsx = et, _e.jsxs = rt;
|
|
613
613
|
})()), _e;
|
|
614
614
|
}
|
|
615
|
-
var
|
|
616
|
-
function
|
|
617
|
-
return
|
|
615
|
+
var vr;
|
|
616
|
+
function dt() {
|
|
617
|
+
return vr || (vr = 1, process.env.NODE_ENV === "production" ? Ae.exports = ft() : Ae.exports = vt()), Ae.exports;
|
|
618
618
|
}
|
|
619
|
-
var
|
|
620
|
-
const
|
|
621
|
-
const r = ot(
|
|
619
|
+
var dr = dt();
|
|
620
|
+
const kr = at(null), Je = () => {
|
|
621
|
+
const r = ot(kr);
|
|
622
622
|
if (!r)
|
|
623
623
|
throw new Error("useApiContext must be used within ApiProvider");
|
|
624
624
|
return r;
|
|
625
625
|
};
|
|
626
626
|
function Et({
|
|
627
627
|
baseURL: r,
|
|
628
|
-
getToken:
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
628
|
+
getToken: y,
|
|
629
|
+
timeoutMs: O = 15e3,
|
|
630
|
+
lng: E = "tw",
|
|
631
|
+
store: f,
|
|
632
632
|
onError: _
|
|
633
633
|
} = {}) {
|
|
634
634
|
const S = it.create({
|
|
635
635
|
baseURL: r,
|
|
636
|
-
timeout:
|
|
636
|
+
timeout: O,
|
|
637
637
|
headers: { "Content-Type": "application/json" }
|
|
638
638
|
});
|
|
639
|
-
return S.interceptors.request.use(async (
|
|
640
|
-
if (
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
}
|
|
647
|
-
if (O)
|
|
648
|
-
try {
|
|
649
|
-
const u = await O();
|
|
650
|
-
u && (v.headers.Currency = u, v.headers["currency-code"] = u);
|
|
651
|
-
} catch (u) {
|
|
652
|
-
console.warn("[Axios] Failed to get currency:", u);
|
|
653
|
-
}
|
|
654
|
-
if (E)
|
|
655
|
-
try {
|
|
656
|
-
const u = await E();
|
|
657
|
-
u && (v.headers.lang = u);
|
|
658
|
-
} catch (u) {
|
|
659
|
-
console.warn("[Axios] Failed to get language:", u);
|
|
660
|
-
}
|
|
661
|
-
return v;
|
|
639
|
+
return S.interceptors.request.use(async (d) => {
|
|
640
|
+
if (d.headers = d.headers || {}, y) {
|
|
641
|
+
const s = await y();
|
|
642
|
+
s && (d.headers.Authorization = `Bearer ${s}`);
|
|
643
|
+
}
|
|
644
|
+
const c = f?.getState()?.isWalletCurrency;
|
|
645
|
+
return d.headers.Currency = c, d.headers["currency-code"] = c, d.headers.lang = E, d;
|
|
662
646
|
}), S.interceptors.response.use(
|
|
663
|
-
(
|
|
664
|
-
(
|
|
647
|
+
(d) => d.data,
|
|
648
|
+
(d) => _ ? _(d, { instance: S }) : Promise.reject(d)
|
|
665
649
|
), S;
|
|
666
650
|
}
|
|
667
|
-
function It({
|
|
668
|
-
|
|
669
|
-
store: h,
|
|
670
|
-
storeSelector: O,
|
|
671
|
-
...E
|
|
672
|
-
}) {
|
|
673
|
-
const f = Ge(() => {
|
|
674
|
-
if (!h) throw new Error("ApiProvider: store is required");
|
|
675
|
-
const u = { ...{
|
|
676
|
-
token: (o) => typeof window < "u" && window.Cookies ? window.Cookies.get("token") : o?.auth?.token || o?.token,
|
|
677
|
-
currency: (o) => o?.isWalletCurrency || "TWD",
|
|
678
|
-
language: (o) => typeof window < "u" && window.i18next ? window.i18next.language : o?.language || o?.i18n?.language || "tw"
|
|
679
|
-
}, ...O }, s = {
|
|
680
|
-
...E,
|
|
681
|
-
getToken: () => {
|
|
682
|
-
try {
|
|
683
|
-
return u.token(h.getState());
|
|
684
|
-
} catch (o) {
|
|
685
|
-
console.warn("[ApiProvider] Failed to get token:", o);
|
|
686
|
-
return;
|
|
687
|
-
}
|
|
688
|
-
},
|
|
689
|
-
getCurrency: () => {
|
|
690
|
-
try {
|
|
691
|
-
return u.currency(h.getState());
|
|
692
|
-
} catch (o) {
|
|
693
|
-
return console.warn("[ApiProvider] Failed to get currency:", o), "TWD";
|
|
694
|
-
}
|
|
695
|
-
},
|
|
696
|
-
getLng: () => {
|
|
697
|
-
try {
|
|
698
|
-
return u.language(h.getState());
|
|
699
|
-
} catch (o) {
|
|
700
|
-
return console.warn("[ApiProvider] Failed to get language:", o), "tw";
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
};
|
|
704
|
-
return Et(s);
|
|
705
|
-
}, [E, h, O]), S = Ge(
|
|
651
|
+
function It({ children: r, ...y }) {
|
|
652
|
+
const O = Ge(() => Et(y), [y]), f = Ge(
|
|
706
653
|
() => new ut({
|
|
707
654
|
defaultOptions: {
|
|
708
655
|
queries: {
|
|
@@ -713,55 +660,55 @@ function It({
|
|
|
713
660
|
}),
|
|
714
661
|
[]
|
|
715
662
|
);
|
|
716
|
-
return /* @__PURE__ */
|
|
663
|
+
return /* @__PURE__ */ dr.jsx(ct, { client: f, children: /* @__PURE__ */ dr.jsx(kr.Provider, { value: { client: O, ...y }, children: r }) });
|
|
717
664
|
}
|
|
718
665
|
const Nt = () => {
|
|
719
|
-
const r = (E, f) => !E && !f,
|
|
666
|
+
const r = (E, f) => !E && !f, y = (E) => E.startsWith("pc.");
|
|
720
667
|
return {
|
|
721
668
|
executeLogout: ({
|
|
722
669
|
isCallBackInvalid: E = !1,
|
|
723
670
|
hostname: f = "",
|
|
724
671
|
shouldRedirect: _,
|
|
725
672
|
onShowError: S,
|
|
726
|
-
onCleanup:
|
|
727
|
-
onRemoveToken:
|
|
673
|
+
onCleanup: d,
|
|
674
|
+
onRemoveToken: c,
|
|
728
675
|
onRedirect: s,
|
|
729
676
|
onGoogleLogout: o
|
|
730
677
|
}) => {
|
|
731
|
-
const a =
|
|
732
|
-
r(E, a) && S?.(),
|
|
678
|
+
const a = y(f);
|
|
679
|
+
r(E, a) && S?.(), d?.(), c?.(), _ && s?.("/"), o?.();
|
|
733
680
|
},
|
|
734
681
|
shouldShowErrorNotice: r,
|
|
735
|
-
isMachineDomain:
|
|
682
|
+
isMachineDomain: y
|
|
736
683
|
};
|
|
737
684
|
}, Ir = () => {
|
|
738
|
-
const { client: r } = Je(),
|
|
685
|
+
const { client: r } = Je(), y = de(
|
|
739
686
|
async (S) => {
|
|
740
|
-
const { mac_address:
|
|
741
|
-
mac_address:
|
|
742
|
-
app_version:
|
|
687
|
+
const { mac_address: d = "", app_version: c = "", anydesk_id: s = "" } = S, { data: o } = await r.post("/cash-register/login", {
|
|
688
|
+
mac_address: d,
|
|
689
|
+
app_version: c,
|
|
743
690
|
anydesk_id: s
|
|
744
691
|
});
|
|
745
692
|
return o;
|
|
746
693
|
},
|
|
747
694
|
[r]
|
|
748
|
-
), O =
|
|
695
|
+
), O = de(async () => r.get("/member/getMemberInfo"), [r]), E = de(async () => {
|
|
749
696
|
const { data: S } = await r.get("/getGameList");
|
|
750
697
|
return S;
|
|
751
|
-
}, [r]), f =
|
|
698
|
+
}, [r]), f = de(async () => await r.get("/member/getNowCurrencyExchange"), [r]), _ = de(async () => {
|
|
752
699
|
const { data: S } = await r.get("/getFavoriteGame");
|
|
753
700
|
return S;
|
|
754
701
|
}, [r]);
|
|
755
702
|
return {
|
|
756
|
-
machineLoginApi:
|
|
703
|
+
machineLoginApi: y,
|
|
757
704
|
userInfoApi: O,
|
|
758
705
|
userGameListApi: E,
|
|
759
706
|
userFavoriteGameApi: _,
|
|
760
707
|
userCurrencyExchangeApi: f
|
|
761
708
|
};
|
|
762
|
-
}, Mt = ({ otherQueryKey: r = [], options:
|
|
763
|
-
const { userCurrencyExchangeApi: O } = Ir(), { getToken: E } = Je(), { enabled: f, ..._ } =
|
|
764
|
-
return
|
|
709
|
+
}, Mt = ({ otherQueryKey: r = [], options: y = {} } = {}) => {
|
|
710
|
+
const { userCurrencyExchangeApi: O } = Ir(), { getToken: E } = Je(), { enabled: f, ..._ } = y, S = !!E && (f ? f.every((d) => d) : !0);
|
|
711
|
+
return Pr({
|
|
765
712
|
queries: [
|
|
766
713
|
{
|
|
767
714
|
queryKey: ["userCurrencyExchange", ...r],
|
|
@@ -778,7 +725,7 @@ var je = {}, F = {}, Ue = {}, Er;
|
|
|
778
725
|
function V() {
|
|
779
726
|
return Er || (Er = 1, (function(r) {
|
|
780
727
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.isEventSourceSupported = r.isReactNative = r.ReadyState = r.DEFAULT_HEARTBEAT = r.UNPARSABLE_JSON_OBJECT = r.DEFAULT_RECONNECT_INTERVAL_MS = r.DEFAULT_RECONNECT_LIMIT = r.SOCKET_IO_PING_CODE = r.SOCKET_IO_PATH = r.SOCKET_IO_PING_INTERVAL = r.DEFAULT_EVENT_SOURCE_OPTIONS = r.EMPTY_EVENT_HANDLERS = r.DEFAULT_OPTIONS = void 0;
|
|
781
|
-
var
|
|
728
|
+
var y = 1, O = 1e3 * y;
|
|
782
729
|
r.DEFAULT_OPTIONS = {}, r.EMPTY_EVENT_HANDLERS = {}, r.DEFAULT_EVENT_SOURCE_OPTIONS = {
|
|
783
730
|
withCredentials: !1,
|
|
784
731
|
events: r.EMPTY_EVENT_HANDLERS
|
|
@@ -805,40 +752,40 @@ var Se = {}, We = {}, _r;
|
|
|
805
752
|
function He() {
|
|
806
753
|
return _r || (_r = 1, (function(r) {
|
|
807
754
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.resetWebSockets = r.sharedWebSockets = void 0, r.sharedWebSockets = {};
|
|
808
|
-
var
|
|
755
|
+
var y = function(O) {
|
|
809
756
|
if (O && r.sharedWebSockets.hasOwnProperty(O))
|
|
810
757
|
delete r.sharedWebSockets[O];
|
|
811
758
|
else
|
|
812
759
|
for (var E in r.sharedWebSockets)
|
|
813
760
|
r.sharedWebSockets.hasOwnProperty(E) && delete r.sharedWebSockets[E];
|
|
814
761
|
};
|
|
815
|
-
r.resetWebSockets =
|
|
762
|
+
r.resetWebSockets = y;
|
|
816
763
|
})(We)), We;
|
|
817
764
|
}
|
|
818
|
-
var te = {},
|
|
765
|
+
var te = {}, K = {}, Sr;
|
|
819
766
|
function Ve() {
|
|
820
|
-
if (Sr) return
|
|
821
|
-
Sr = 1, Object.defineProperty(
|
|
822
|
-
var r = V(),
|
|
767
|
+
if (Sr) return K;
|
|
768
|
+
Sr = 1, Object.defineProperty(K, "__esModule", { value: !0 }), K.setUpSocketIOPing = K.appendQueryParams = K.parseSocketIOUrl = void 0;
|
|
769
|
+
var r = V(), y = function(f) {
|
|
823
770
|
if (f) {
|
|
824
|
-
var _ = /^https|wss/.test(f), S = f.replace(/^(https?|wss?)(:\/\/)?/, ""),
|
|
825
|
-
return "".concat(
|
|
771
|
+
var _ = /^https|wss/.test(f), S = f.replace(/^(https?|wss?)(:\/\/)?/, ""), d = S.replace(/\/$/, ""), c = _ ? "wss" : "ws";
|
|
772
|
+
return "".concat(c, "://").concat(d).concat(r.SOCKET_IO_PATH);
|
|
826
773
|
} else if (f === "") {
|
|
827
|
-
var _ = /^https/.test(window.location.protocol),
|
|
828
|
-
return "".concat(
|
|
774
|
+
var _ = /^https/.test(window.location.protocol), c = _ ? "wss" : "ws", s = window.location.port ? ":".concat(window.location.port) : "";
|
|
775
|
+
return "".concat(c, "://").concat(window.location.hostname).concat(s).concat(r.SOCKET_IO_PATH);
|
|
829
776
|
}
|
|
830
777
|
return f;
|
|
831
778
|
};
|
|
832
|
-
|
|
779
|
+
K.parseSocketIOUrl = y;
|
|
833
780
|
var O = function(f, _) {
|
|
834
781
|
_ === void 0 && (_ = {});
|
|
835
|
-
var S = /\?([\w]+=[\w]+)/,
|
|
782
|
+
var S = /\?([\w]+=[\w]+)/, d = S.test(f), c = "".concat(Object.entries(_).reduce(function(s, o) {
|
|
836
783
|
var a = o[0], i = o[1];
|
|
837
784
|
return s + "".concat(a, "=").concat(i, "&");
|
|
838
785
|
}, "").slice(0, -1));
|
|
839
|
-
return "".concat(f).concat(
|
|
786
|
+
return "".concat(f).concat(d ? "&" : "?").concat(c);
|
|
840
787
|
};
|
|
841
|
-
|
|
788
|
+
K.appendQueryParams = O;
|
|
842
789
|
var E = function(f, _) {
|
|
843
790
|
_ === void 0 && (_ = r.SOCKET_IO_PING_INTERVAL);
|
|
844
791
|
var S = function() {
|
|
@@ -846,79 +793,79 @@ function Ve() {
|
|
|
846
793
|
};
|
|
847
794
|
return window.setInterval(S, _);
|
|
848
795
|
};
|
|
849
|
-
return
|
|
796
|
+
return K.setUpSocketIOPing = E, K;
|
|
850
797
|
}
|
|
851
|
-
var
|
|
798
|
+
var Pe = {}, hr;
|
|
852
799
|
function Nr() {
|
|
853
|
-
if (hr) return
|
|
854
|
-
hr = 1, Object.defineProperty(
|
|
800
|
+
if (hr) return Pe;
|
|
801
|
+
hr = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.heartbeat = O;
|
|
855
802
|
var r = V();
|
|
856
|
-
function
|
|
803
|
+
function y(E) {
|
|
857
804
|
return Array.isArray(E) ? E.reduce(function(f, _) {
|
|
858
805
|
return f.current > _.current ? f : _;
|
|
859
806
|
}).current : E.current;
|
|
860
807
|
}
|
|
861
808
|
function O(E, f, _) {
|
|
862
|
-
var S = _ || {},
|
|
863
|
-
var
|
|
864
|
-
if (
|
|
865
|
-
console.warn("Heartbeat timed out, closing connection, last message received ".concat(
|
|
866
|
-
else if (
|
|
809
|
+
var S = _ || {}, d = S.interval, c = d === void 0 ? r.DEFAULT_HEARTBEAT.interval : d, s = S.timeout, o = s === void 0 ? r.DEFAULT_HEARTBEAT.timeout : s, a = S.message, i = a === void 0 ? r.DEFAULT_HEARTBEAT.message : a, t = Math.max(100, c / 10), n = Date.now(), v = setInterval(function() {
|
|
810
|
+
var h = Date.now(), u = y(f);
|
|
811
|
+
if (u + o <= h)
|
|
812
|
+
console.warn("Heartbeat timed out, closing connection, last message received ".concat(h - u, "ms ago, last ping sent ").concat(h - n, "ms ago")), E.close();
|
|
813
|
+
else if (u + c <= h && n + c <= h)
|
|
867
814
|
try {
|
|
868
|
-
typeof i == "function" ? E.send(i()) : E.send(i), n =
|
|
815
|
+
typeof i == "function" ? E.send(i()) : E.send(i), n = h;
|
|
869
816
|
} catch (b) {
|
|
870
817
|
console.error("Heartbeat failed, closing connection", b instanceof Error ? b.message : b), E.close();
|
|
871
818
|
}
|
|
872
819
|
}, t);
|
|
873
820
|
return E.addEventListener("close", function() {
|
|
874
|
-
clearInterval(
|
|
821
|
+
clearInterval(v);
|
|
875
822
|
}), function() {
|
|
876
823
|
};
|
|
877
824
|
}
|
|
878
|
-
return
|
|
825
|
+
return Pe;
|
|
879
826
|
}
|
|
880
827
|
var he = {}, Fe = {}, yr;
|
|
881
828
|
function $e() {
|
|
882
829
|
return yr || (yr = 1, (function(r) {
|
|
883
830
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.resetSubscribers = r.removeSubscriber = r.addSubscriber = r.hasSubscribers = r.getSubscribers = void 0;
|
|
884
|
-
var
|
|
885
|
-
return (0, r.hasSubscribers)(
|
|
831
|
+
var y = {}, O = [], E = function(c) {
|
|
832
|
+
return (0, r.hasSubscribers)(c) ? Array.from(y[c]) : O;
|
|
886
833
|
};
|
|
887
834
|
r.getSubscribers = E;
|
|
888
|
-
var f = function(
|
|
835
|
+
var f = function(c) {
|
|
889
836
|
var s;
|
|
890
|
-
return ((s =
|
|
837
|
+
return ((s = y[c]) === null || s === void 0 ? void 0 : s.size) > 0;
|
|
891
838
|
};
|
|
892
839
|
r.hasSubscribers = f;
|
|
893
|
-
var _ = function(
|
|
894
|
-
|
|
840
|
+
var _ = function(c, s) {
|
|
841
|
+
y[c] = y[c] || /* @__PURE__ */ new Set(), y[c].add(s);
|
|
895
842
|
};
|
|
896
843
|
r.addSubscriber = _;
|
|
897
|
-
var S = function(
|
|
898
|
-
|
|
844
|
+
var S = function(c, s) {
|
|
845
|
+
y[c].delete(s);
|
|
899
846
|
};
|
|
900
847
|
r.removeSubscriber = S;
|
|
901
|
-
var
|
|
902
|
-
if (
|
|
903
|
-
delete
|
|
848
|
+
var d = function(c) {
|
|
849
|
+
if (c && y.hasOwnProperty(c))
|
|
850
|
+
delete y[c];
|
|
904
851
|
else
|
|
905
|
-
for (var s in
|
|
906
|
-
|
|
852
|
+
for (var s in y)
|
|
853
|
+
y.hasOwnProperty(s) && delete y[s];
|
|
907
854
|
};
|
|
908
|
-
r.resetSubscribers =
|
|
855
|
+
r.resetSubscribers = d;
|
|
909
856
|
})(Fe)), Fe;
|
|
910
857
|
}
|
|
911
858
|
var br;
|
|
912
859
|
function Be() {
|
|
913
860
|
if (br) return he;
|
|
914
861
|
br = 1, Object.defineProperty(he, "__esModule", { value: !0 }), he.assertIsWebSocket = O, he.resetGlobalState = E;
|
|
915
|
-
var r = He(),
|
|
862
|
+
var r = He(), y = $e();
|
|
916
863
|
function O(f, _) {
|
|
917
864
|
if (!_ && !(f instanceof WebSocket))
|
|
918
865
|
throw new Error("");
|
|
919
866
|
}
|
|
920
867
|
function E(f) {
|
|
921
|
-
(0,
|
|
868
|
+
(0, y.resetSubscribers)(f), (0, r.resetWebSockets)(f);
|
|
922
869
|
}
|
|
923
870
|
return he;
|
|
924
871
|
}
|
|
@@ -936,58 +883,58 @@ function _t() {
|
|
|
936
883
|
}, r.apply(this, arguments);
|
|
937
884
|
};
|
|
938
885
|
Object.defineProperty(te, "__esModule", { value: !0 }), te.attachListeners = void 0;
|
|
939
|
-
var
|
|
886
|
+
var y = Ve(), O = Nr(), E = V(), f = Be(), _ = function(o, a, i, t) {
|
|
940
887
|
o.onmessage = function(n) {
|
|
941
|
-
var
|
|
942
|
-
a.current.onMessage && a.current.onMessage(n), typeof t?.current == "number" && (t.current = Date.now()), !(typeof a.current.filter == "function" && a.current.filter(n) !== !0) && (a.current.heartbeat && typeof a.current.heartbeat != "boolean" && ((
|
|
888
|
+
var v;
|
|
889
|
+
a.current.onMessage && a.current.onMessage(n), typeof t?.current == "number" && (t.current = Date.now()), !(typeof a.current.filter == "function" && a.current.filter(n) !== !0) && (a.current.heartbeat && typeof a.current.heartbeat != "boolean" && ((v = a.current.heartbeat) === null || v === void 0 ? void 0 : v.returnMessage) === n.data || i(n));
|
|
943
890
|
};
|
|
944
891
|
}, S = function(o, a, i, t, n) {
|
|
945
|
-
o.onopen = function(
|
|
946
|
-
if (a.current.onOpen && a.current.onOpen(
|
|
947
|
-
var
|
|
948
|
-
n.current = Date.now(), (0, O.heartbeat)(o, n,
|
|
892
|
+
o.onopen = function(v) {
|
|
893
|
+
if (a.current.onOpen && a.current.onOpen(v), t.current = 0, i(E.ReadyState.OPEN), a.current.heartbeat && o instanceof WebSocket) {
|
|
894
|
+
var h = typeof a.current.heartbeat == "boolean" ? void 0 : a.current.heartbeat;
|
|
895
|
+
n.current = Date.now(), (0, O.heartbeat)(o, n, h);
|
|
949
896
|
}
|
|
950
897
|
};
|
|
951
|
-
},
|
|
898
|
+
}, d = function(o, a, i, t, n) {
|
|
952
899
|
if (E.isEventSourceSupported && o instanceof EventSource)
|
|
953
900
|
return function() {
|
|
954
901
|
};
|
|
955
902
|
(0, f.assertIsWebSocket)(o, a.current.skipAssert);
|
|
956
|
-
var
|
|
957
|
-
return o.onclose = function(
|
|
958
|
-
var
|
|
959
|
-
if (a.current.onClose && a.current.onClose(
|
|
960
|
-
var b = (
|
|
903
|
+
var v;
|
|
904
|
+
return o.onclose = function(h) {
|
|
905
|
+
var u;
|
|
906
|
+
if (a.current.onClose && a.current.onClose(h), i(E.ReadyState.CLOSED), a.current.shouldReconnect && a.current.shouldReconnect(h)) {
|
|
907
|
+
var b = (u = a.current.reconnectAttempts) !== null && u !== void 0 ? u : E.DEFAULT_RECONNECT_LIMIT;
|
|
961
908
|
if (n.current < b) {
|
|
962
909
|
var C = typeof a.current.reconnectInterval == "function" ? a.current.reconnectInterval(n.current) : a.current.reconnectInterval;
|
|
963
|
-
|
|
910
|
+
v = window.setTimeout(function() {
|
|
964
911
|
n.current++, t();
|
|
965
912
|
}, C ?? E.DEFAULT_RECONNECT_INTERVAL_MS);
|
|
966
913
|
} else
|
|
967
914
|
a.current.onReconnectStop && a.current.onReconnectStop(b), console.warn("Max reconnect attempts of ".concat(b, " exceeded"));
|
|
968
915
|
}
|
|
969
916
|
}, function() {
|
|
970
|
-
return
|
|
917
|
+
return v && window.clearTimeout(v);
|
|
971
918
|
};
|
|
972
|
-
},
|
|
973
|
-
var
|
|
974
|
-
return o.onerror = function(
|
|
975
|
-
var
|
|
976
|
-
if (a.current.onError && a.current.onError(
|
|
977
|
-
if (n.current < ((
|
|
919
|
+
}, c = function(o, a, i, t, n) {
|
|
920
|
+
var v;
|
|
921
|
+
return o.onerror = function(h) {
|
|
922
|
+
var u;
|
|
923
|
+
if (a.current.onError && a.current.onError(h), E.isEventSourceSupported && o instanceof EventSource && (a.current.onClose && a.current.onClose(r(r({}, h), { code: 1006, reason: "An error occurred with the EventSource: ".concat(h), wasClean: !1 })), i(E.ReadyState.CLOSED), o.close()), a.current.retryOnError)
|
|
924
|
+
if (n.current < ((u = a.current.reconnectAttempts) !== null && u !== void 0 ? u : E.DEFAULT_RECONNECT_LIMIT)) {
|
|
978
925
|
var b = typeof a.current.reconnectInterval == "function" ? a.current.reconnectInterval(n.current) : a.current.reconnectInterval;
|
|
979
|
-
|
|
926
|
+
v = window.setTimeout(function() {
|
|
980
927
|
n.current++, t();
|
|
981
928
|
}, b ?? E.DEFAULT_RECONNECT_INTERVAL_MS);
|
|
982
929
|
} else
|
|
983
930
|
a.current.onReconnectStop && a.current.onReconnectStop(a.current.reconnectAttempts), console.warn("Max reconnect attempts of ".concat(a.current.reconnectAttempts, " exceeded"));
|
|
984
931
|
}, function() {
|
|
985
|
-
return
|
|
932
|
+
return v && window.clearTimeout(v);
|
|
986
933
|
};
|
|
987
|
-
}, s = function(o, a, i, t, n,
|
|
988
|
-
var
|
|
989
|
-
return i.current.fromSocketIO && (C = (0,
|
|
990
|
-
b(E.ReadyState.CLOSING),
|
|
934
|
+
}, s = function(o, a, i, t, n, v, h) {
|
|
935
|
+
var u = a.setLastMessage, b = a.setReadyState, C, P, m;
|
|
936
|
+
return i.current.fromSocketIO && (C = (0, y.setUpSocketIOPing)(h)), _(o, i, u, v), S(o, i, b, n, v), P = d(o, i, b, t, n), m = c(o, i, b, t, n), function() {
|
|
937
|
+
b(E.ReadyState.CLOSING), P(), m(), o.close(), C && clearInterval(C);
|
|
991
938
|
};
|
|
992
939
|
};
|
|
993
940
|
return te.attachListeners = s, te;
|
|
@@ -1000,43 +947,43 @@ function St() {
|
|
|
1000
947
|
return r = Object.assign || function(a) {
|
|
1001
948
|
for (var i, t = 1, n = arguments.length; t < n; t++) {
|
|
1002
949
|
i = arguments[t];
|
|
1003
|
-
for (var
|
|
950
|
+
for (var v in i) Object.prototype.hasOwnProperty.call(i, v) && (a[v] = i[v]);
|
|
1004
951
|
}
|
|
1005
952
|
return a;
|
|
1006
953
|
}, r.apply(this, arguments);
|
|
1007
954
|
};
|
|
1008
955
|
Object.defineProperty(ne, "__esModule", { value: !0 }), ne.attachSharedListeners = void 0;
|
|
1009
|
-
var
|
|
956
|
+
var y = He(), O = V(), E = $e(), f = Ve(), _ = Nr(), S = function(a, i, t) {
|
|
1010
957
|
a.onmessage = function(n) {
|
|
1011
|
-
(0, E.getSubscribers)(i).forEach(function(
|
|
1012
|
-
var
|
|
1013
|
-
|
|
958
|
+
(0, E.getSubscribers)(i).forEach(function(v) {
|
|
959
|
+
var h;
|
|
960
|
+
v.optionsRef.current.onMessage && v.optionsRef.current.onMessage(n), typeof ((h = v?.lastMessageTime) === null || h === void 0 ? void 0 : h.current) == "number" && (v.lastMessageTime.current = Date.now()), !(typeof v.optionsRef.current.filter == "function" && v.optionsRef.current.filter(n) !== !0) && (t && typeof t != "boolean" && t?.returnMessage === n.data || v.setLastMessage(n));
|
|
1014
961
|
});
|
|
1015
962
|
};
|
|
1016
|
-
},
|
|
963
|
+
}, d = function(a, i, t) {
|
|
1017
964
|
a.onopen = function(n) {
|
|
1018
|
-
var
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
}), t && a instanceof WebSocket && (0, _.heartbeat)(a,
|
|
1022
|
-
return
|
|
965
|
+
var v = (0, E.getSubscribers)(i);
|
|
966
|
+
v.forEach(function(h) {
|
|
967
|
+
h.reconnectCount.current = 0, h.optionsRef.current.onOpen && h.optionsRef.current.onOpen(n), h.setReadyState(O.ReadyState.OPEN), t && a instanceof WebSocket && (h.lastMessageTime.current = Date.now());
|
|
968
|
+
}), t && a instanceof WebSocket && (0, _.heartbeat)(a, v.map(function(h) {
|
|
969
|
+
return h.lastMessageTime;
|
|
1023
970
|
}), typeof t == "boolean" ? void 0 : t);
|
|
1024
971
|
};
|
|
1025
|
-
},
|
|
972
|
+
}, c = function(a, i) {
|
|
1026
973
|
a instanceof WebSocket && (a.onclose = function(t) {
|
|
1027
974
|
(0, E.getSubscribers)(i).forEach(function(n) {
|
|
1028
975
|
n.optionsRef.current.onClose && n.optionsRef.current.onClose(t), n.setReadyState(O.ReadyState.CLOSED);
|
|
1029
|
-
}), delete
|
|
1030
|
-
var
|
|
976
|
+
}), delete y.sharedWebSockets[i], (0, E.getSubscribers)(i).forEach(function(n) {
|
|
977
|
+
var v;
|
|
1031
978
|
if (n.optionsRef.current.shouldReconnect && n.optionsRef.current.shouldReconnect(t)) {
|
|
1032
|
-
var
|
|
1033
|
-
if (n.reconnectCount.current <
|
|
1034
|
-
var
|
|
979
|
+
var h = (v = n.optionsRef.current.reconnectAttempts) !== null && v !== void 0 ? v : O.DEFAULT_RECONNECT_LIMIT;
|
|
980
|
+
if (n.reconnectCount.current < h) {
|
|
981
|
+
var u = typeof n.optionsRef.current.reconnectInterval == "function" ? n.optionsRef.current.reconnectInterval(n.reconnectCount.current) : n.optionsRef.current.reconnectInterval;
|
|
1035
982
|
setTimeout(function() {
|
|
1036
983
|
n.reconnectCount.current++, n.reconnect.current();
|
|
1037
|
-
},
|
|
984
|
+
}, u ?? O.DEFAULT_RECONNECT_INTERVAL_MS);
|
|
1038
985
|
} else
|
|
1039
|
-
n.optionsRef.current.onReconnectStop && n.optionsRef.current.onReconnectStop(n.optionsRef.current.reconnectAttempts), console.warn("Max reconnect attempts of ".concat(
|
|
986
|
+
n.optionsRef.current.onReconnectStop && n.optionsRef.current.onReconnectStop(n.optionsRef.current.reconnectAttempts), console.warn("Max reconnect attempts of ".concat(h, " exceeded"));
|
|
1040
987
|
}
|
|
1041
988
|
});
|
|
1042
989
|
});
|
|
@@ -1047,9 +994,9 @@ function St() {
|
|
|
1047
994
|
}), O.isEventSourceSupported && a instanceof EventSource && a.close();
|
|
1048
995
|
};
|
|
1049
996
|
}, o = function(a, i, t, n) {
|
|
1050
|
-
var
|
|
1051
|
-
return t.current.fromSocketIO && (
|
|
1052
|
-
|
|
997
|
+
var v;
|
|
998
|
+
return t.current.fromSocketIO && (v = (0, f.setUpSocketIOPing)(n)), S(a, i, t.current.heartbeat), c(a, i), d(a, i, t.current.heartbeat), s(a, i), function() {
|
|
999
|
+
v && clearInterval(v);
|
|
1053
1000
|
};
|
|
1054
1001
|
};
|
|
1055
1002
|
return ne.attachSharedListeners = o, ne;
|
|
@@ -1058,26 +1005,26 @@ var pr;
|
|
|
1058
1005
|
function ht() {
|
|
1059
1006
|
if (pr) return Se;
|
|
1060
1007
|
pr = 1, Object.defineProperty(Se, "__esModule", { value: !0 }), Se.createOrJoinSocket = void 0;
|
|
1061
|
-
var r = He(),
|
|
1008
|
+
var r = He(), y = V(), O = _t(), E = St(), f = $e(), _ = function(d, c, s, o, a) {
|
|
1062
1009
|
return function() {
|
|
1063
|
-
if ((0, f.removeSubscriber)(
|
|
1010
|
+
if ((0, f.removeSubscriber)(d, c), !(0, f.hasSubscribers)(d)) {
|
|
1064
1011
|
try {
|
|
1065
|
-
var i = r.sharedWebSockets[
|
|
1012
|
+
var i = r.sharedWebSockets[d];
|
|
1066
1013
|
i instanceof WebSocket && (i.onclose = function(t) {
|
|
1067
|
-
s.current.onClose && s.current.onClose(t), o(
|
|
1014
|
+
s.current.onClose && s.current.onClose(t), o(y.ReadyState.CLOSED);
|
|
1068
1015
|
}), i.close();
|
|
1069
1016
|
} catch {
|
|
1070
1017
|
}
|
|
1071
|
-
a && a(), delete r.sharedWebSockets[
|
|
1018
|
+
a && a(), delete r.sharedWebSockets[d];
|
|
1072
1019
|
}
|
|
1073
1020
|
};
|
|
1074
|
-
}, S = function(
|
|
1075
|
-
if (!
|
|
1076
|
-
throw
|
|
1021
|
+
}, S = function(d, c, s, o, a, i, t, n, v) {
|
|
1022
|
+
if (!y.isEventSourceSupported && o.current.eventSourceOptions)
|
|
1023
|
+
throw y.isReactNative ? new Error("EventSource is not supported in ReactNative") : new Error("EventSource is not supported");
|
|
1077
1024
|
if (o.current.share) {
|
|
1078
|
-
var
|
|
1079
|
-
r.sharedWebSockets[
|
|
1080
|
-
var
|
|
1025
|
+
var h = null;
|
|
1026
|
+
r.sharedWebSockets[c] === void 0 ? (r.sharedWebSockets[c] = o.current.eventSourceOptions ? new EventSource(c, o.current.eventSourceOptions) : new WebSocket(c, o.current.protocols), d.current = r.sharedWebSockets[c], s(y.ReadyState.CONNECTING), h = (0, E.attachSharedListeners)(r.sharedWebSockets[c], c, o, v)) : (d.current = r.sharedWebSockets[c], s(r.sharedWebSockets[c].readyState));
|
|
1027
|
+
var u = {
|
|
1081
1028
|
setLastMessage: a,
|
|
1082
1029
|
setReadyState: s,
|
|
1083
1030
|
optionsRef: o,
|
|
@@ -1085,121 +1032,121 @@ function ht() {
|
|
|
1085
1032
|
lastMessageTime: n,
|
|
1086
1033
|
reconnect: i
|
|
1087
1034
|
};
|
|
1088
|
-
return (0, f.addSubscriber)(
|
|
1035
|
+
return (0, f.addSubscriber)(c, u), _(c, u, o, s, h);
|
|
1089
1036
|
} else {
|
|
1090
|
-
if (
|
|
1037
|
+
if (d.current = o.current.eventSourceOptions ? new EventSource(c, o.current.eventSourceOptions) : new WebSocket(c, o.current.protocols), s(y.ReadyState.CONNECTING), !d.current)
|
|
1091
1038
|
throw new Error("WebSocket failed to be created");
|
|
1092
|
-
return (0, O.attachListeners)(
|
|
1039
|
+
return (0, O.attachListeners)(d.current, {
|
|
1093
1040
|
setLastMessage: a,
|
|
1094
1041
|
setReadyState: s
|
|
1095
|
-
}, o, i.current, t, n,
|
|
1042
|
+
}, o, i.current, t, n, v);
|
|
1096
1043
|
}
|
|
1097
1044
|
};
|
|
1098
1045
|
return Se.createOrJoinSocket = S, Se;
|
|
1099
1046
|
}
|
|
1100
|
-
var
|
|
1047
|
+
var x = {}, mr;
|
|
1101
1048
|
function yt() {
|
|
1102
|
-
return
|
|
1103
|
-
var
|
|
1049
|
+
return mr || (mr = 1, (function(r) {
|
|
1050
|
+
var y = x && x.__awaiter || function(c, s, o, a) {
|
|
1104
1051
|
function i(t) {
|
|
1105
1052
|
return t instanceof o ? t : new o(function(n) {
|
|
1106
1053
|
n(t);
|
|
1107
1054
|
});
|
|
1108
1055
|
}
|
|
1109
1056
|
return new (o || (o = Promise))(function(t, n) {
|
|
1110
|
-
function
|
|
1057
|
+
function v(b) {
|
|
1111
1058
|
try {
|
|
1112
|
-
|
|
1059
|
+
u(a.next(b));
|
|
1113
1060
|
} catch (C) {
|
|
1114
1061
|
n(C);
|
|
1115
1062
|
}
|
|
1116
1063
|
}
|
|
1117
|
-
function
|
|
1064
|
+
function h(b) {
|
|
1118
1065
|
try {
|
|
1119
|
-
|
|
1066
|
+
u(a.throw(b));
|
|
1120
1067
|
} catch (C) {
|
|
1121
1068
|
n(C);
|
|
1122
1069
|
}
|
|
1123
1070
|
}
|
|
1124
|
-
function
|
|
1125
|
-
b.done ? t(b.value) : i(b.value).then(
|
|
1071
|
+
function u(b) {
|
|
1072
|
+
b.done ? t(b.value) : i(b.value).then(v, h);
|
|
1126
1073
|
}
|
|
1127
|
-
|
|
1074
|
+
u((a = a.apply(c, s || [])).next());
|
|
1128
1075
|
});
|
|
1129
|
-
}, O =
|
|
1076
|
+
}, O = x && x.__generator || function(c, s) {
|
|
1130
1077
|
var o = { label: 0, sent: function() {
|
|
1131
1078
|
if (t[0] & 1) throw t[1];
|
|
1132
1079
|
return t[1];
|
|
1133
1080
|
}, trys: [], ops: [] }, a, i, t, n = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
|
1134
|
-
return n.next =
|
|
1081
|
+
return n.next = v(0), n.throw = v(1), n.return = v(2), typeof Symbol == "function" && (n[Symbol.iterator] = function() {
|
|
1135
1082
|
return this;
|
|
1136
1083
|
}), n;
|
|
1137
|
-
function
|
|
1084
|
+
function v(u) {
|
|
1138
1085
|
return function(b) {
|
|
1139
|
-
return
|
|
1086
|
+
return h([u, b]);
|
|
1140
1087
|
};
|
|
1141
1088
|
}
|
|
1142
|
-
function
|
|
1089
|
+
function h(u) {
|
|
1143
1090
|
if (a) throw new TypeError("Generator is already executing.");
|
|
1144
|
-
for (; n && (n = 0,
|
|
1145
|
-
if (a = 1, i && (t =
|
|
1146
|
-
switch (i = 0, t && (
|
|
1091
|
+
for (; n && (n = 0, u[0] && (o = 0)), o; ) try {
|
|
1092
|
+
if (a = 1, i && (t = u[0] & 2 ? i.return : u[0] ? i.throw || ((t = i.return) && t.call(i), 0) : i.next) && !(t = t.call(i, u[1])).done) return t;
|
|
1093
|
+
switch (i = 0, t && (u = [u[0] & 2, t.value]), u[0]) {
|
|
1147
1094
|
case 0:
|
|
1148
1095
|
case 1:
|
|
1149
|
-
t =
|
|
1096
|
+
t = u;
|
|
1150
1097
|
break;
|
|
1151
1098
|
case 4:
|
|
1152
|
-
return o.label++, { value:
|
|
1099
|
+
return o.label++, { value: u[1], done: !1 };
|
|
1153
1100
|
case 5:
|
|
1154
|
-
o.label++, i =
|
|
1101
|
+
o.label++, i = u[1], u = [0];
|
|
1155
1102
|
continue;
|
|
1156
1103
|
case 7:
|
|
1157
|
-
|
|
1104
|
+
u = o.ops.pop(), o.trys.pop();
|
|
1158
1105
|
continue;
|
|
1159
1106
|
default:
|
|
1160
|
-
if (t = o.trys, !(t = t.length > 0 && t[t.length - 1]) && (
|
|
1107
|
+
if (t = o.trys, !(t = t.length > 0 && t[t.length - 1]) && (u[0] === 6 || u[0] === 2)) {
|
|
1161
1108
|
o = 0;
|
|
1162
1109
|
continue;
|
|
1163
1110
|
}
|
|
1164
|
-
if (
|
|
1165
|
-
o.label =
|
|
1111
|
+
if (u[0] === 3 && (!t || u[1] > t[0] && u[1] < t[3])) {
|
|
1112
|
+
o.label = u[1];
|
|
1166
1113
|
break;
|
|
1167
1114
|
}
|
|
1168
|
-
if (
|
|
1169
|
-
o.label = t[1], t =
|
|
1115
|
+
if (u[0] === 6 && o.label < t[1]) {
|
|
1116
|
+
o.label = t[1], t = u;
|
|
1170
1117
|
break;
|
|
1171
1118
|
}
|
|
1172
1119
|
if (t && o.label < t[2]) {
|
|
1173
|
-
o.label = t[2], o.ops.push(
|
|
1120
|
+
o.label = t[2], o.ops.push(u);
|
|
1174
1121
|
break;
|
|
1175
1122
|
}
|
|
1176
1123
|
t[2] && o.ops.pop(), o.trys.pop();
|
|
1177
1124
|
continue;
|
|
1178
1125
|
}
|
|
1179
|
-
|
|
1126
|
+
u = s.call(c, o);
|
|
1180
1127
|
} catch (b) {
|
|
1181
|
-
|
|
1128
|
+
u = [6, b], i = 0;
|
|
1182
1129
|
} finally {
|
|
1183
1130
|
a = t = 0;
|
|
1184
1131
|
}
|
|
1185
|
-
if (
|
|
1186
|
-
return { value:
|
|
1132
|
+
if (u[0] & 5) throw u[1];
|
|
1133
|
+
return { value: u[0] ? u[1] : void 0, done: !0 };
|
|
1187
1134
|
}
|
|
1188
|
-
}, E =
|
|
1135
|
+
}, E = x && x.__spreadArray || function(c, s, o) {
|
|
1189
1136
|
if (o || arguments.length === 2) for (var a = 0, i = s.length, t; a < i; a++)
|
|
1190
1137
|
(t || !(a in s)) && (t || (t = Array.prototype.slice.call(s, 0, a)), t[a] = s[a]);
|
|
1191
|
-
return
|
|
1138
|
+
return c.concat(t || Array.prototype.slice.call(s));
|
|
1192
1139
|
};
|
|
1193
1140
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.getUrl = void 0;
|
|
1194
|
-
var f = Ve(), _ = V(), S = function(
|
|
1141
|
+
var f = Ve(), _ = V(), S = function(c) {
|
|
1195
1142
|
return new Promise(function(s) {
|
|
1196
|
-
return window.setTimeout(s,
|
|
1143
|
+
return window.setTimeout(s, c);
|
|
1197
1144
|
});
|
|
1198
|
-
},
|
|
1145
|
+
}, d = function(c, s) {
|
|
1199
1146
|
for (var o = [], a = 2; a < arguments.length; a++)
|
|
1200
1147
|
o[a - 2] = arguments[a];
|
|
1201
|
-
return
|
|
1202
|
-
var
|
|
1148
|
+
return y(void 0, E([c, s], o, !0), void 0, function(i, t, n) {
|
|
1149
|
+
var v, h, u, b, C, P, m, A;
|
|
1203
1150
|
return n === void 0 && (n = 0), O(this, function(I) {
|
|
1204
1151
|
switch (I.label) {
|
|
1205
1152
|
case 0:
|
|
@@ -1208,13 +1155,13 @@ function yt() {
|
|
|
1208
1155
|
case 1:
|
|
1209
1156
|
return I.trys.push([1, 3, , 9]), [4, i()];
|
|
1210
1157
|
case 2:
|
|
1211
|
-
return
|
|
1158
|
+
return v = I.sent(), [3, 9];
|
|
1212
1159
|
case 3:
|
|
1213
|
-
return I.sent(), t.current.retryOnError ? (
|
|
1160
|
+
return I.sent(), t.current.retryOnError ? (h = (P = t.current.reconnectAttempts) !== null && P !== void 0 ? P : _.DEFAULT_RECONNECT_LIMIT, n < h ? (u = typeof t.current.reconnectInterval == "function" ? t.current.reconnectInterval(n) : t.current.reconnectInterval, [4, S(u ?? _.DEFAULT_RECONNECT_INTERVAL_MS)]) : [3, 5]) : [3, 7];
|
|
1214
1161
|
case 4:
|
|
1215
1162
|
return I.sent(), [2, (0, r.getUrl)(i, t, n + 1)];
|
|
1216
1163
|
case 5:
|
|
1217
|
-
return (A = (
|
|
1164
|
+
return (A = (m = t.current).onReconnectStop) === null || A === void 0 || A.call(m, n), [2, null];
|
|
1218
1165
|
case 6:
|
|
1219
1166
|
return [3, 8];
|
|
1220
1167
|
case 7:
|
|
@@ -1224,21 +1171,21 @@ function yt() {
|
|
|
1224
1171
|
case 9:
|
|
1225
1172
|
return [3, 11];
|
|
1226
1173
|
case 10:
|
|
1227
|
-
|
|
1174
|
+
v = i, I.label = 11;
|
|
1228
1175
|
case 11:
|
|
1229
|
-
return b = t.current.fromSocketIO ? (0, f.parseSocketIOUrl)(
|
|
1176
|
+
return b = t.current.fromSocketIO ? (0, f.parseSocketIOUrl)(v) : v, C = t.current.queryParams ? (0, f.appendQueryParams)(b, t.current.queryParams) : b, [2, C];
|
|
1230
1177
|
}
|
|
1231
1178
|
});
|
|
1232
1179
|
});
|
|
1233
1180
|
};
|
|
1234
|
-
r.getUrl =
|
|
1235
|
-
})(
|
|
1181
|
+
r.getUrl = d;
|
|
1182
|
+
})(x)), x;
|
|
1236
1183
|
}
|
|
1237
|
-
var qe = {},
|
|
1184
|
+
var qe = {}, Tr;
|
|
1238
1185
|
function bt() {
|
|
1239
|
-
return
|
|
1186
|
+
return Tr || (Tr = 1, (function(r) {
|
|
1240
1187
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.websocketWrapper = void 0;
|
|
1241
|
-
var
|
|
1188
|
+
var y = function(O, E) {
|
|
1242
1189
|
return new Proxy(O, {
|
|
1243
1190
|
get: function(f, _) {
|
|
1244
1191
|
var S = f[_];
|
|
@@ -1250,7 +1197,7 @@ function bt() {
|
|
|
1250
1197
|
}
|
|
1251
1198
|
});
|
|
1252
1199
|
};
|
|
1253
|
-
r.websocketWrapper =
|
|
1200
|
+
r.websocketWrapper = y, r.default = r.websocketWrapper;
|
|
1254
1201
|
})(qe)), qe;
|
|
1255
1202
|
}
|
|
1256
1203
|
var Rr;
|
|
@@ -1259,113 +1206,113 @@ function Ye() {
|
|
|
1259
1206
|
Rr = 1;
|
|
1260
1207
|
var r = F && F.__assign || function() {
|
|
1261
1208
|
return r = Object.assign || function(i) {
|
|
1262
|
-
for (var t, n = 1,
|
|
1209
|
+
for (var t, n = 1, v = arguments.length; n < v; n++) {
|
|
1263
1210
|
t = arguments[n];
|
|
1264
|
-
for (var
|
|
1211
|
+
for (var h in t) Object.prototype.hasOwnProperty.call(t, h) && (i[h] = t[h]);
|
|
1265
1212
|
}
|
|
1266
1213
|
return i;
|
|
1267
1214
|
}, r.apply(this, arguments);
|
|
1268
|
-
},
|
|
1269
|
-
function
|
|
1270
|
-
return
|
|
1271
|
-
b(
|
|
1215
|
+
}, y = F && F.__awaiter || function(i, t, n, v) {
|
|
1216
|
+
function h(u) {
|
|
1217
|
+
return u instanceof n ? u : new n(function(b) {
|
|
1218
|
+
b(u);
|
|
1272
1219
|
});
|
|
1273
1220
|
}
|
|
1274
|
-
return new (n || (n = Promise))(function(
|
|
1221
|
+
return new (n || (n = Promise))(function(u, b) {
|
|
1275
1222
|
function C(A) {
|
|
1276
1223
|
try {
|
|
1277
|
-
|
|
1224
|
+
m(v.next(A));
|
|
1278
1225
|
} catch (I) {
|
|
1279
1226
|
b(I);
|
|
1280
1227
|
}
|
|
1281
1228
|
}
|
|
1282
|
-
function
|
|
1229
|
+
function P(A) {
|
|
1283
1230
|
try {
|
|
1284
|
-
|
|
1231
|
+
m(v.throw(A));
|
|
1285
1232
|
} catch (I) {
|
|
1286
1233
|
b(I);
|
|
1287
1234
|
}
|
|
1288
1235
|
}
|
|
1289
|
-
function
|
|
1290
|
-
A.done ?
|
|
1236
|
+
function m(A) {
|
|
1237
|
+
A.done ? u(A.value) : h(A.value).then(C, P);
|
|
1291
1238
|
}
|
|
1292
|
-
|
|
1239
|
+
m((v = v.apply(i, t || [])).next());
|
|
1293
1240
|
});
|
|
1294
1241
|
}, O = F && F.__generator || function(i, t) {
|
|
1295
1242
|
var n = { label: 0, sent: function() {
|
|
1296
|
-
if (
|
|
1297
|
-
return
|
|
1298
|
-
}, trys: [], ops: [] },
|
|
1243
|
+
if (u[0] & 1) throw u[1];
|
|
1244
|
+
return u[1];
|
|
1245
|
+
}, trys: [], ops: [] }, v, h, u, b = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
|
1299
1246
|
return b.next = C(0), b.throw = C(1), b.return = C(2), typeof Symbol == "function" && (b[Symbol.iterator] = function() {
|
|
1300
1247
|
return this;
|
|
1301
1248
|
}), b;
|
|
1302
|
-
function C(
|
|
1249
|
+
function C(m) {
|
|
1303
1250
|
return function(A) {
|
|
1304
|
-
return
|
|
1251
|
+
return P([m, A]);
|
|
1305
1252
|
};
|
|
1306
1253
|
}
|
|
1307
|
-
function
|
|
1308
|
-
if (
|
|
1309
|
-
for (; b && (b = 0,
|
|
1310
|
-
if (
|
|
1311
|
-
switch (
|
|
1254
|
+
function P(m) {
|
|
1255
|
+
if (v) throw new TypeError("Generator is already executing.");
|
|
1256
|
+
for (; b && (b = 0, m[0] && (n = 0)), n; ) try {
|
|
1257
|
+
if (v = 1, h && (u = m[0] & 2 ? h.return : m[0] ? h.throw || ((u = h.return) && u.call(h), 0) : h.next) && !(u = u.call(h, m[1])).done) return u;
|
|
1258
|
+
switch (h = 0, u && (m = [m[0] & 2, u.value]), m[0]) {
|
|
1312
1259
|
case 0:
|
|
1313
1260
|
case 1:
|
|
1314
|
-
|
|
1261
|
+
u = m;
|
|
1315
1262
|
break;
|
|
1316
1263
|
case 4:
|
|
1317
|
-
return n.label++, { value:
|
|
1264
|
+
return n.label++, { value: m[1], done: !1 };
|
|
1318
1265
|
case 5:
|
|
1319
|
-
n.label++,
|
|
1266
|
+
n.label++, h = m[1], m = [0];
|
|
1320
1267
|
continue;
|
|
1321
1268
|
case 7:
|
|
1322
|
-
|
|
1269
|
+
m = n.ops.pop(), n.trys.pop();
|
|
1323
1270
|
continue;
|
|
1324
1271
|
default:
|
|
1325
|
-
if (
|
|
1272
|
+
if (u = n.trys, !(u = u.length > 0 && u[u.length - 1]) && (m[0] === 6 || m[0] === 2)) {
|
|
1326
1273
|
n = 0;
|
|
1327
1274
|
continue;
|
|
1328
1275
|
}
|
|
1329
|
-
if (
|
|
1330
|
-
n.label =
|
|
1276
|
+
if (m[0] === 3 && (!u || m[1] > u[0] && m[1] < u[3])) {
|
|
1277
|
+
n.label = m[1];
|
|
1331
1278
|
break;
|
|
1332
1279
|
}
|
|
1333
|
-
if (
|
|
1334
|
-
n.label =
|
|
1280
|
+
if (m[0] === 6 && n.label < u[1]) {
|
|
1281
|
+
n.label = u[1], u = m;
|
|
1335
1282
|
break;
|
|
1336
1283
|
}
|
|
1337
|
-
if (
|
|
1338
|
-
n.label =
|
|
1284
|
+
if (u && n.label < u[2]) {
|
|
1285
|
+
n.label = u[2], n.ops.push(m);
|
|
1339
1286
|
break;
|
|
1340
1287
|
}
|
|
1341
|
-
|
|
1288
|
+
u[2] && n.ops.pop(), n.trys.pop();
|
|
1342
1289
|
continue;
|
|
1343
1290
|
}
|
|
1344
|
-
|
|
1291
|
+
m = t.call(i, n);
|
|
1345
1292
|
} catch (A) {
|
|
1346
|
-
|
|
1293
|
+
m = [6, A], h = 0;
|
|
1347
1294
|
} finally {
|
|
1348
|
-
|
|
1295
|
+
v = u = 0;
|
|
1349
1296
|
}
|
|
1350
|
-
if (
|
|
1351
|
-
return { value:
|
|
1297
|
+
if (m[0] & 5) throw m[1];
|
|
1298
|
+
return { value: m[0] ? m[1] : void 0, done: !0 };
|
|
1352
1299
|
}
|
|
1353
1300
|
}, E = F && F.__importDefault || function(i) {
|
|
1354
1301
|
return i && i.__esModule ? i : { default: i };
|
|
1355
1302
|
};
|
|
1356
1303
|
Object.defineProperty(F, "__esModule", { value: !0 }), F.useWebSocket = void 0;
|
|
1357
|
-
var f = ye, _ = st, S = V(),
|
|
1304
|
+
var f = ye, _ = st, S = V(), d = ht(), c = yt(), s = E(bt()), o = Be(), a = function(i, t, n) {
|
|
1358
1305
|
t === void 0 && (t = S.DEFAULT_OPTIONS), n === void 0 && (n = !0);
|
|
1359
|
-
var
|
|
1360
|
-
if (!t.disableJson &&
|
|
1306
|
+
var v = (0, f.useState)(null), h = v[0], u = v[1], b = (0, f.useState)({}), C = b[0], P = b[1], m = (0, f.useMemo)(function() {
|
|
1307
|
+
if (!t.disableJson && h)
|
|
1361
1308
|
try {
|
|
1362
|
-
return JSON.parse(
|
|
1309
|
+
return JSON.parse(h.data);
|
|
1363
1310
|
} catch {
|
|
1364
1311
|
return S.UNPARSABLE_JSON_OBJECT;
|
|
1365
1312
|
}
|
|
1366
1313
|
return null;
|
|
1367
|
-
}, [
|
|
1368
|
-
}), le = (0, f.useRef)(0),
|
|
1314
|
+
}, [h, t.disableJson]), A = (0, f.useRef)(null), I = (0, f.useRef)(null), se = (0, f.useRef)(function() {
|
|
1315
|
+
}), le = (0, f.useRef)(0), ke = (0, f.useRef)(Date.now()), be = (0, f.useRef)([]), J = (0, f.useRef)(null), L = (0, f.useRef)(t);
|
|
1369
1316
|
L.current = t;
|
|
1370
1317
|
var G = A.current && C[A.current] !== void 0 ? C[A.current] : i !== null && n === !0 ? S.ReadyState.CONNECTING : S.ReadyState.UNINSTANTIATED, X = t.queryParams ? JSON.stringify(t.queryParams) : null, $ = (0, f.useCallback)(function(D, j) {
|
|
1371
1318
|
var B;
|
|
@@ -1382,15 +1329,15 @@ function Ye() {
|
|
|
1382
1329
|
return (0, f.useEffect)(function() {
|
|
1383
1330
|
if (i !== null && n === !0) {
|
|
1384
1331
|
var D, j = !1, B = !0, fe = function() {
|
|
1385
|
-
return
|
|
1332
|
+
return y(void 0, void 0, void 0, function() {
|
|
1386
1333
|
var Z, z, pe;
|
|
1387
1334
|
return O(this, function(oe) {
|
|
1388
1335
|
switch (oe.label) {
|
|
1389
1336
|
case 0:
|
|
1390
|
-
return Z = A, [4, (0,
|
|
1337
|
+
return Z = A, [4, (0, c.getUrl)(i, L)];
|
|
1391
1338
|
case 1:
|
|
1392
1339
|
return Z.current = oe.sent(), A.current === null ? (console.error("Failed to get a valid URL. WebSocket connection aborted."), A.current = "ABORTED", (0, _.flushSync)(function() {
|
|
1393
|
-
return
|
|
1340
|
+
return P(function(Y) {
|
|
1394
1341
|
return r(r({}, Y), { ABORTED: S.ReadyState.CLOSED });
|
|
1395
1342
|
});
|
|
1396
1343
|
}), [
|
|
@@ -1398,16 +1345,16 @@ function Ye() {
|
|
|
1398
1345
|
/*return*/
|
|
1399
1346
|
]) : (z = function(Y) {
|
|
1400
1347
|
j || (0, _.flushSync)(function() {
|
|
1401
|
-
return
|
|
1348
|
+
return u(Y);
|
|
1402
1349
|
});
|
|
1403
1350
|
}, pe = function(Y) {
|
|
1404
1351
|
j || (0, _.flushSync)(function() {
|
|
1405
|
-
return
|
|
1352
|
+
return P(function(ue) {
|
|
1406
1353
|
var ee;
|
|
1407
1354
|
return r(r({}, ue), A.current && (ee = {}, ee[A.current] = Y, ee));
|
|
1408
1355
|
});
|
|
1409
1356
|
});
|
|
1410
|
-
}, B && (D = (0,
|
|
1357
|
+
}, B && (D = (0, d.createOrJoinSocket)(I, A.current, pe, L, z, se, le, ke, $)), [
|
|
1411
1358
|
2
|
|
1412
1359
|
/*return*/
|
|
1413
1360
|
]);
|
|
@@ -1418,9 +1365,9 @@ function Ye() {
|
|
|
1418
1365
|
return se.current = function() {
|
|
1419
1366
|
j || (J.current && (J.current = null), D?.(), fe());
|
|
1420
1367
|
}, fe(), function() {
|
|
1421
|
-
j = !0, B = !1, J.current && (J.current = null), D?.(),
|
|
1368
|
+
j = !0, B = !1, J.current && (J.current = null), D?.(), u(null);
|
|
1422
1369
|
};
|
|
1423
|
-
} else (i === null || n === !1) && (le.current = 0,
|
|
1370
|
+
} else (i === null || n === !1) && (le.current = 0, P(function(Z) {
|
|
1424
1371
|
var z;
|
|
1425
1372
|
return r(r({}, Z), A.current && (z = {}, z[A.current] = S.ReadyState.CLOSED, z));
|
|
1426
1373
|
}));
|
|
@@ -1431,8 +1378,8 @@ function Ye() {
|
|
|
1431
1378
|
}, [G]), {
|
|
1432
1379
|
sendMessage: $,
|
|
1433
1380
|
sendJsonMessage: ge,
|
|
1434
|
-
lastMessage:
|
|
1435
|
-
lastJsonMessage:
|
|
1381
|
+
lastMessage: h,
|
|
1382
|
+
lastJsonMessage: m,
|
|
1436
1383
|
readyState: G,
|
|
1437
1384
|
getWebSocket: Oe
|
|
1438
1385
|
};
|
|
@@ -1444,43 +1391,43 @@ function gt() {
|
|
|
1444
1391
|
if (Cr) return ae;
|
|
1445
1392
|
Cr = 1;
|
|
1446
1393
|
var r = ae && ae.__assign || function() {
|
|
1447
|
-
return r = Object.assign || function(
|
|
1448
|
-
for (var
|
|
1449
|
-
|
|
1450
|
-
for (var a in
|
|
1394
|
+
return r = Object.assign || function(d) {
|
|
1395
|
+
for (var c, s = 1, o = arguments.length; s < o; s++) {
|
|
1396
|
+
c = arguments[s];
|
|
1397
|
+
for (var a in c) Object.prototype.hasOwnProperty.call(c, a) && (d[a] = c[a]);
|
|
1451
1398
|
}
|
|
1452
|
-
return
|
|
1399
|
+
return d;
|
|
1453
1400
|
}, r.apply(this, arguments);
|
|
1454
1401
|
};
|
|
1455
1402
|
Object.defineProperty(ae, "__esModule", { value: !0 }), ae.useSocketIO = void 0;
|
|
1456
|
-
var
|
|
1403
|
+
var y = ye, O = Ye(), E = V(), f = {
|
|
1457
1404
|
type: "empty",
|
|
1458
1405
|
payload: null
|
|
1459
|
-
}, _ = function(
|
|
1460
|
-
if (!
|
|
1406
|
+
}, _ = function(d) {
|
|
1407
|
+
if (!d || !d.data)
|
|
1461
1408
|
return f;
|
|
1462
|
-
var
|
|
1463
|
-
if (!
|
|
1409
|
+
var c = d.data.match(/\[.*]/);
|
|
1410
|
+
if (!c)
|
|
1464
1411
|
return f;
|
|
1465
|
-
var s = JSON.parse(
|
|
1412
|
+
var s = JSON.parse(c);
|
|
1466
1413
|
return !Array.isArray(s) || !s[1] ? f : {
|
|
1467
1414
|
type: s[0],
|
|
1468
1415
|
payload: s[1]
|
|
1469
1416
|
};
|
|
1470
|
-
}, S = function(
|
|
1471
|
-
|
|
1472
|
-
var o = (0,
|
|
1473
|
-
return r(r({},
|
|
1474
|
-
}, []), a = (0, O.useWebSocket)(
|
|
1417
|
+
}, S = function(d, c, s) {
|
|
1418
|
+
c === void 0 && (c = E.DEFAULT_OPTIONS), s === void 0 && (s = !0);
|
|
1419
|
+
var o = (0, y.useMemo)(function() {
|
|
1420
|
+
return r(r({}, c), { fromSocketIO: !0 });
|
|
1421
|
+
}, []), a = (0, O.useWebSocket)(d, o, s), i = a.sendMessage, t = a.sendJsonMessage, n = a.lastMessage, v = a.readyState, h = a.getWebSocket, u = (0, y.useMemo)(function() {
|
|
1475
1422
|
return _(n);
|
|
1476
1423
|
}, [n]);
|
|
1477
1424
|
return {
|
|
1478
1425
|
sendMessage: i,
|
|
1479
1426
|
sendJsonMessage: t,
|
|
1480
|
-
lastMessage:
|
|
1481
|
-
lastJsonMessage:
|
|
1482
|
-
readyState:
|
|
1483
|
-
getWebSocket:
|
|
1427
|
+
lastMessage: u,
|
|
1428
|
+
lastJsonMessage: u,
|
|
1429
|
+
readyState: v,
|
|
1430
|
+
getWebSocket: h
|
|
1484
1431
|
};
|
|
1485
1432
|
};
|
|
1486
1433
|
return ae.useSocketIO = S, ae;
|
|
@@ -1491,39 +1438,39 @@ function Ot() {
|
|
|
1491
1438
|
wr = 1;
|
|
1492
1439
|
var r = Q && Q.__assign || function() {
|
|
1493
1440
|
return r = Object.assign || function(S) {
|
|
1494
|
-
for (var
|
|
1495
|
-
|
|
1496
|
-
for (var o in
|
|
1441
|
+
for (var d, c = 1, s = arguments.length; c < s; c++) {
|
|
1442
|
+
d = arguments[c];
|
|
1443
|
+
for (var o in d) Object.prototype.hasOwnProperty.call(d, o) && (S[o] = d[o]);
|
|
1497
1444
|
}
|
|
1498
1445
|
return S;
|
|
1499
1446
|
}, r.apply(this, arguments);
|
|
1500
|
-
},
|
|
1501
|
-
var
|
|
1502
|
-
for (var s in S) Object.prototype.hasOwnProperty.call(S, s) &&
|
|
1447
|
+
}, y = Q && Q.__rest || function(S, d) {
|
|
1448
|
+
var c = {};
|
|
1449
|
+
for (var s in S) Object.prototype.hasOwnProperty.call(S, s) && d.indexOf(s) < 0 && (c[s] = S[s]);
|
|
1503
1450
|
if (S != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1504
1451
|
for (var o = 0, s = Object.getOwnPropertySymbols(S); o < s.length; o++)
|
|
1505
|
-
|
|
1506
|
-
return
|
|
1452
|
+
d.indexOf(s[o]) < 0 && Object.prototype.propertyIsEnumerable.call(S, s[o]) && (c[s[o]] = S[s[o]]);
|
|
1453
|
+
return c;
|
|
1507
1454
|
};
|
|
1508
1455
|
Object.defineProperty(Q, "__esModule", { value: !0 }), Q.useEventSource = void 0;
|
|
1509
|
-
var O = ye, E = Ye(), f = V(), _ = function(S,
|
|
1510
|
-
|
|
1511
|
-
var s =
|
|
1512
|
-
|
|
1456
|
+
var O = ye, E = Ye(), f = V(), _ = function(S, d, c) {
|
|
1457
|
+
d === void 0 && (d = f.DEFAULT_EVENT_SOURCE_OPTIONS);
|
|
1458
|
+
var s = d.withCredentials, o = d.events, a = y(d, ["withCredentials", "events"]);
|
|
1459
|
+
c === void 0 && (c = !0);
|
|
1513
1460
|
var i = r(r({}, a), { eventSourceOptions: {
|
|
1514
1461
|
withCredentials: s
|
|
1515
1462
|
} }), t = (0, O.useRef)(f.EMPTY_EVENT_HANDLERS);
|
|
1516
1463
|
o && (t.current = o);
|
|
1517
|
-
var n = (0, E.useWebSocket)(S, i,
|
|
1464
|
+
var n = (0, E.useWebSocket)(S, i, c), v = n.lastMessage, h = n.readyState, u = n.getWebSocket;
|
|
1518
1465
|
return (0, O.useEffect)(function() {
|
|
1519
|
-
|
|
1520
|
-
var C = b[0],
|
|
1521
|
-
C ===
|
|
1466
|
+
v?.type && Object.entries(t.current).forEach(function(b) {
|
|
1467
|
+
var C = b[0], P = b[1];
|
|
1468
|
+
C === v.type && P(v);
|
|
1522
1469
|
});
|
|
1523
|
-
}, [
|
|
1524
|
-
lastEvent:
|
|
1525
|
-
readyState:
|
|
1526
|
-
getEventSource:
|
|
1470
|
+
}, [v]), {
|
|
1471
|
+
lastEvent: v,
|
|
1472
|
+
readyState: h,
|
|
1473
|
+
getEventSource: u
|
|
1527
1474
|
};
|
|
1528
1475
|
};
|
|
1529
1476
|
return Q.useEventSource = _, Q;
|
|
@@ -1532,9 +1479,9 @@ var Ar;
|
|
|
1532
1479
|
function pt() {
|
|
1533
1480
|
return Ar || (Ar = 1, (function(r) {
|
|
1534
1481
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.resetGlobalState = r.useEventSource = r.ReadyState = r.useSocketIO = r.default = void 0;
|
|
1535
|
-
var
|
|
1482
|
+
var y = Ye();
|
|
1536
1483
|
Object.defineProperty(r, "default", { enumerable: !0, get: function() {
|
|
1537
|
-
return
|
|
1484
|
+
return y.useWebSocket;
|
|
1538
1485
|
} });
|
|
1539
1486
|
var O = gt();
|
|
1540
1487
|
Object.defineProperty(r, "useSocketIO", { enumerable: !0, get: function() {
|
|
@@ -1554,8 +1501,8 @@ function pt() {
|
|
|
1554
1501
|
} });
|
|
1555
1502
|
})(je)), je;
|
|
1556
1503
|
}
|
|
1557
|
-
var
|
|
1558
|
-
const
|
|
1504
|
+
var mt = pt();
|
|
1505
|
+
const Tt = /* @__PURE__ */ lt(mt), H = {
|
|
1559
1506
|
DEPOSIT: "deposit",
|
|
1560
1507
|
TRANS_CODE: "transCode",
|
|
1561
1508
|
ERROR: "error",
|
|
@@ -1568,21 +1515,21 @@ const mt = /* @__PURE__ */ lt(Tt), H = {
|
|
|
1568
1515
|
CASH_REGISTER_LIMIT: "cash_register_limit"
|
|
1569
1516
|
}, Rt = 3e4, Dt = ({
|
|
1570
1517
|
socketUrl: r,
|
|
1571
|
-
socketHandlers:
|
|
1518
|
+
socketHandlers: y = {},
|
|
1572
1519
|
options: O = {}
|
|
1573
1520
|
}) => {
|
|
1574
|
-
const E = sr(!1), f = sr(
|
|
1521
|
+
const E = sr(!1), f = sr(y), {
|
|
1575
1522
|
sendMessage: _,
|
|
1576
1523
|
// 發送普通訊息
|
|
1577
1524
|
sendJsonMessage: S,
|
|
1578
1525
|
// 發送 JSON 訊息
|
|
1579
|
-
lastMessage:
|
|
1526
|
+
lastMessage: d,
|
|
1580
1527
|
// 最後接收到的訊息
|
|
1581
1528
|
// lastJsonMessage, // 最後接收到的 JSON 訊息
|
|
1582
|
-
readyState:
|
|
1529
|
+
readyState: c
|
|
1583
1530
|
// WebSocket 連線狀態
|
|
1584
1531
|
// getWebSocket, // 獲取 WebSocket 實例
|
|
1585
|
-
} =
|
|
1532
|
+
} = Tt(r, {
|
|
1586
1533
|
queryParams: { key: "wsky" },
|
|
1587
1534
|
onOpen: () => console.log("連線成功"),
|
|
1588
1535
|
shouldReconnect: () => E.current === !1,
|
|
@@ -1591,11 +1538,11 @@ const mt = /* @__PURE__ */ lt(Tt), H = {
|
|
|
1591
1538
|
...O
|
|
1592
1539
|
}), s = Ge(() => {
|
|
1593
1540
|
try {
|
|
1594
|
-
return JSON.parse(
|
|
1541
|
+
return JSON.parse(d?.data);
|
|
1595
1542
|
} catch {
|
|
1596
1543
|
return null;
|
|
1597
1544
|
}
|
|
1598
|
-
}, [
|
|
1545
|
+
}, [d?.data]);
|
|
1599
1546
|
return Ce(() => {
|
|
1600
1547
|
const o = setInterval(
|
|
1601
1548
|
() => _("ping"),
|
|
@@ -1603,8 +1550,8 @@ const mt = /* @__PURE__ */ lt(Tt), H = {
|
|
|
1603
1550
|
);
|
|
1604
1551
|
return () => clearInterval(o);
|
|
1605
1552
|
}, [_]), Ce(() => {
|
|
1606
|
-
f.current =
|
|
1607
|
-
}, [
|
|
1553
|
+
f.current = y;
|
|
1554
|
+
}, [y]), Ce(() => {
|
|
1608
1555
|
if (!s) return;
|
|
1609
1556
|
const {
|
|
1610
1557
|
onDeposit: o,
|
|
@@ -1612,43 +1559,43 @@ const mt = /* @__PURE__ */ lt(Tt), H = {
|
|
|
1612
1559
|
onError: i,
|
|
1613
1560
|
onUpdateMember: t,
|
|
1614
1561
|
onMaintainNotice: n,
|
|
1615
|
-
onMaintainNoticeMember:
|
|
1616
|
-
onReload:
|
|
1617
|
-
onTransferInGame:
|
|
1562
|
+
onMaintainNoticeMember: v,
|
|
1563
|
+
onReload: h,
|
|
1564
|
+
onTransferInGame: u,
|
|
1618
1565
|
onCashRegisterLimit: b
|
|
1619
|
-
} = f.current, C = we(s, "type", ""),
|
|
1566
|
+
} = f.current, C = we(s, "type", ""), P = {
|
|
1620
1567
|
memberInfoUid: we(s, "member_info_uid", null),
|
|
1621
1568
|
data: we(s, "data", null),
|
|
1622
1569
|
memo: we(s, "memo", null)
|
|
1623
1570
|
};
|
|
1624
1571
|
switch (C) {
|
|
1625
1572
|
case H.DEPOSIT:
|
|
1626
|
-
o?.(
|
|
1573
|
+
o?.(P);
|
|
1627
1574
|
break;
|
|
1628
1575
|
case H.TRANS_CODE:
|
|
1629
|
-
a?.(
|
|
1576
|
+
a?.(P);
|
|
1630
1577
|
break;
|
|
1631
1578
|
case H.ERROR:
|
|
1632
|
-
i?.(
|
|
1579
|
+
i?.(P);
|
|
1633
1580
|
break;
|
|
1634
1581
|
case H.UPDATE_MEMBER:
|
|
1635
|
-
t?.(
|
|
1582
|
+
t?.(P);
|
|
1636
1583
|
break;
|
|
1637
1584
|
case H.MAINTAIN_NOTICE:
|
|
1638
|
-
n?.(
|
|
1585
|
+
n?.(P);
|
|
1639
1586
|
break;
|
|
1640
1587
|
case H.MAINTAIN_NOTICE_MEMBER:
|
|
1641
|
-
|
|
1588
|
+
v?.(P);
|
|
1642
1589
|
break;
|
|
1643
1590
|
case H.RELOAD:
|
|
1644
|
-
|
|
1591
|
+
h?.(P);
|
|
1645
1592
|
break;
|
|
1646
1593
|
case H.TRANSFER_IN_GAME:
|
|
1647
1594
|
case H.CHECK_REQUEST:
|
|
1648
|
-
|
|
1595
|
+
u?.(P);
|
|
1649
1596
|
break;
|
|
1650
1597
|
case H.CASH_REGISTER_LIMIT:
|
|
1651
|
-
b?.(
|
|
1598
|
+
b?.(P);
|
|
1652
1599
|
break;
|
|
1653
1600
|
default:
|
|
1654
1601
|
console.warn("Unknown socket type:", C);
|
|
@@ -1657,28 +1604,28 @@ const mt = /* @__PURE__ */ lt(Tt), H = {
|
|
|
1657
1604
|
}, [s]), Ce(() => () => E.current = !0, []), {
|
|
1658
1605
|
sendMessage: _,
|
|
1659
1606
|
sendJsonMessage: S,
|
|
1660
|
-
readyState:
|
|
1607
|
+
readyState: c
|
|
1661
1608
|
// WebSocket 連線狀態
|
|
1662
1609
|
};
|
|
1663
1610
|
}, Lt = ({
|
|
1664
1611
|
refetchInterval: r = 5e4,
|
|
1665
|
-
trigger:
|
|
1612
|
+
trigger: y = [],
|
|
1666
1613
|
enabled: O = !0
|
|
1667
1614
|
} = {}) => {
|
|
1668
|
-
const { getToken: E } = Je(), { userInfoApi: f } = Ir(), _ =
|
|
1615
|
+
const { getToken: E } = Je(), { userInfoApi: f } = Ir(), _ = Pr({
|
|
1669
1616
|
queries: [
|
|
1670
1617
|
{
|
|
1671
|
-
queryKey: ["getMemberInfo", ...
|
|
1618
|
+
queryKey: ["getMemberInfo", ...y],
|
|
1672
1619
|
queryFn: async () => await f(),
|
|
1673
1620
|
refetchInterval: r,
|
|
1674
1621
|
enabled: !!E && O
|
|
1675
1622
|
}
|
|
1676
1623
|
]
|
|
1677
|
-
}), { data: S, isFetching:
|
|
1678
|
-
return { data: S, isFetching:
|
|
1624
|
+
}), { data: S, isFetching: d, error: c } = _[0] || {};
|
|
1625
|
+
return { data: S, isFetching: d, error: c };
|
|
1679
1626
|
};
|
|
1680
1627
|
export {
|
|
1681
|
-
|
|
1628
|
+
kr as ApiCtx,
|
|
1682
1629
|
It as ApiProvider,
|
|
1683
1630
|
Nt as createLogoutHandler,
|
|
1684
1631
|
Je as useApiContext,
|