@obb871001/api-integration-sdk 1.0.86 → 1.0.88
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 +5 -5
- package/dist/index.js +223 -214
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ke, { createContext as Fa, useContext as Wa, useCallback as X, useMemo as Qe, useEffect as he, useRef as ya } from "react";
|
|
2
2
|
import { useQuery as oe, QueryClient as Ci, QueryClientProvider as vi, useQueries as Ja, useMutation as za } from "@tanstack/react-query";
|
|
3
3
|
import hi from "axios";
|
|
4
4
|
import { find as Ye, isEmpty as O, isObject as He, flatMap as qe, isArray as ee, map as we, get as Re } from "lodash";
|
|
@@ -6,26 +6,26 @@ import ki from "react-dom";
|
|
|
6
6
|
function Si(e) {
|
|
7
7
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
8
8
|
}
|
|
9
|
-
var Pe = { exports: {} },
|
|
9
|
+
var Pe = { exports: {} }, be = {};
|
|
10
10
|
var ba;
|
|
11
11
|
function Ni() {
|
|
12
|
-
if (ba) return
|
|
12
|
+
if (ba) return be;
|
|
13
13
|
ba = 1;
|
|
14
|
-
var e =
|
|
15
|
-
function U(_,
|
|
16
|
-
var
|
|
17
|
-
c !== void 0 && (g = "" + c),
|
|
18
|
-
for (
|
|
19
|
-
if (_ && _.defaultProps) for (
|
|
14
|
+
var e = ke, n = Symbol.for("react.element"), d = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, u = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
15
|
+
function U(_, m, c) {
|
|
16
|
+
var r, i = {}, g = null, l = null;
|
|
17
|
+
c !== void 0 && (g = "" + c), m.key !== void 0 && (g = "" + m.key), m.ref !== void 0 && (l = m.ref);
|
|
18
|
+
for (r in m) s.call(m, r) && !u.hasOwnProperty(r) && (i[r] = m[r]);
|
|
19
|
+
if (_ && _.defaultProps) for (r in m = _.defaultProps, m) i[r] === void 0 && (i[r] = m[r]);
|
|
20
20
|
return { $$typeof: n, type: _, key: g, ref: l, props: i, _owner: o.current };
|
|
21
21
|
}
|
|
22
|
-
return
|
|
22
|
+
return be.Fragment = d, be.jsx = U, be.jsxs = U, be;
|
|
23
23
|
}
|
|
24
|
-
var
|
|
24
|
+
var Te = {};
|
|
25
25
|
var Ta;
|
|
26
26
|
function Di() {
|
|
27
27
|
return Ta || (Ta = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
28
|
-
var e =
|
|
28
|
+
var e = ke, n = Symbol.for("react.element"), d = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), u = Symbol.for("react.profiler"), U = Symbol.for("react.provider"), _ = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), r = Symbol.for("react.suspense_list"), i = Symbol.for("react.memo"), g = Symbol.for("react.lazy"), l = Symbol.for("react.offscreen"), t = Symbol.iterator, y = "@@iterator";
|
|
29
29
|
function b(a) {
|
|
30
30
|
if (a === null || typeof a != "object")
|
|
31
31
|
return null;
|
|
@@ -50,14 +50,14 @@ function Di() {
|
|
|
50
50
|
G.unshift("Warning: " + f), Function.prototype.apply.call(console[a], console, G);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
var D = !1, h = !1, L = !1, M = !1,
|
|
54
|
-
|
|
53
|
+
var D = !1, h = !1, L = !1, M = !1, _e = !1, fe;
|
|
54
|
+
fe = Symbol.for("react.module.reference");
|
|
55
55
|
function Fe(a) {
|
|
56
|
-
return !!(typeof a == "string" || typeof a == "function" || a === s || a === u ||
|
|
56
|
+
return !!(typeof a == "string" || typeof a == "function" || a === s || a === u || _e || a === o || a === c || a === r || M || a === l || D || h || L || typeof a == "object" && a !== null && (a.$$typeof === g || a.$$typeof === i || a.$$typeof === U || a.$$typeof === _ || a.$$typeof === m || // 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.
|
|
60
|
-
a.$$typeof ===
|
|
60
|
+
a.$$typeof === fe || a.getModuleId !== void 0));
|
|
61
61
|
}
|
|
62
62
|
function Se(a, f, C) {
|
|
63
63
|
var v = a.displayName;
|
|
@@ -87,7 +87,7 @@ function Di() {
|
|
|
87
87
|
return "StrictMode";
|
|
88
88
|
case c:
|
|
89
89
|
return "Suspense";
|
|
90
|
-
case
|
|
90
|
+
case r:
|
|
91
91
|
return "SuspenseList";
|
|
92
92
|
}
|
|
93
93
|
if (typeof a == "object")
|
|
@@ -98,7 +98,7 @@ function Di() {
|
|
|
98
98
|
case U:
|
|
99
99
|
var C = a;
|
|
100
100
|
return V(C._context) + ".Provider";
|
|
101
|
-
case
|
|
101
|
+
case m:
|
|
102
102
|
return Se(a, a.render, "ForwardRef");
|
|
103
103
|
case i:
|
|
104
104
|
var v = a.displayName || null;
|
|
@@ -114,14 +114,14 @@ function Di() {
|
|
|
114
114
|
}
|
|
115
115
|
return null;
|
|
116
116
|
}
|
|
117
|
-
var Z = Object.assign, ae = 0, B, Ne, De, x, w, K,
|
|
117
|
+
var Z = Object.assign, ae = 0, B, Ne, De, x, w, K, Ue;
|
|
118
118
|
function ie() {
|
|
119
119
|
}
|
|
120
120
|
ie.__reactDisabledLog = !0;
|
|
121
121
|
function $() {
|
|
122
122
|
{
|
|
123
123
|
if (ae === 0) {
|
|
124
|
-
B = console.log, Ne = console.info, De = console.warn, x = console.error, w = console.group, K = console.groupCollapsed,
|
|
124
|
+
B = console.log, Ne = console.info, De = console.warn, x = console.error, w = console.group, K = console.groupCollapsed, Ue = console.groupEnd;
|
|
125
125
|
var a = {
|
|
126
126
|
configurable: !0,
|
|
127
127
|
enumerable: !0,
|
|
@@ -169,7 +169,7 @@ function Di() {
|
|
|
169
169
|
value: K
|
|
170
170
|
}),
|
|
171
171
|
groupEnd: Z({}, a, {
|
|
172
|
-
value:
|
|
172
|
+
value: Ue
|
|
173
173
|
})
|
|
174
174
|
});
|
|
175
175
|
}
|
|
@@ -283,12 +283,12 @@ function Di() {
|
|
|
283
283
|
switch (a) {
|
|
284
284
|
case c:
|
|
285
285
|
return ue("Suspense");
|
|
286
|
-
case
|
|
286
|
+
case r:
|
|
287
287
|
return ue("SuspenseList");
|
|
288
288
|
}
|
|
289
289
|
if (typeof a == "object")
|
|
290
290
|
switch (a.$$typeof) {
|
|
291
|
-
case
|
|
291
|
+
case m:
|
|
292
292
|
return qa(a.render);
|
|
293
293
|
case i:
|
|
294
294
|
return Ge(a.type, f, C);
|
|
@@ -302,7 +302,7 @@ function Di() {
|
|
|
302
302
|
}
|
|
303
303
|
return "";
|
|
304
304
|
}
|
|
305
|
-
var
|
|
305
|
+
var ye = Object.prototype.hasOwnProperty, ta = {}, na = p.ReactDebugCurrentFrame;
|
|
306
306
|
function Me(a) {
|
|
307
307
|
if (a) {
|
|
308
308
|
var f = a._owner, C = Ge(a.type, a._source, f ? f.type : null);
|
|
@@ -312,7 +312,7 @@ function Di() {
|
|
|
312
312
|
}
|
|
313
313
|
function $a(a, f, C, v, E) {
|
|
314
314
|
{
|
|
315
|
-
var G = Function.call.bind(
|
|
315
|
+
var G = Function.call.bind(ye);
|
|
316
316
|
for (var S in a)
|
|
317
317
|
if (G(a, S)) {
|
|
318
318
|
var k = void 0;
|
|
@@ -360,7 +360,7 @@ function Di() {
|
|
|
360
360
|
__source: !0
|
|
361
361
|
}, sa, ua;
|
|
362
362
|
function ti(a) {
|
|
363
|
-
if (
|
|
363
|
+
if (ye.call(a, "ref")) {
|
|
364
364
|
var f = Object.getOwnPropertyDescriptor(a, "ref").get;
|
|
365
365
|
if (f && f.isReactWarning)
|
|
366
366
|
return !1;
|
|
@@ -368,7 +368,7 @@ function Di() {
|
|
|
368
368
|
return a.ref !== void 0;
|
|
369
369
|
}
|
|
370
370
|
function ni(a) {
|
|
371
|
-
if (
|
|
371
|
+
if (ye.call(a, "key")) {
|
|
372
372
|
var f = Object.getOwnPropertyDescriptor(a, "key").get;
|
|
373
373
|
if (f && f.isReactWarning)
|
|
374
374
|
return !1;
|
|
@@ -434,7 +434,7 @@ function Di() {
|
|
|
434
434
|
var G, S = {}, k = null, F = null;
|
|
435
435
|
C !== void 0 && (ra(C), k = "" + C), ni(f) && (ra(f.key), k = "" + f.key), ti(f) && (F = f.ref, mi(f, E));
|
|
436
436
|
for (G in f)
|
|
437
|
-
|
|
437
|
+
ye.call(f, G) && !li.hasOwnProperty(G) && (S[G] = f[G]);
|
|
438
438
|
if (a && a.defaultProps) {
|
|
439
439
|
var R = a.defaultProps;
|
|
440
440
|
for (G in R)
|
|
@@ -528,7 +528,7 @@ Check the top-level render call using <` + C + ">.");
|
|
|
528
528
|
var C;
|
|
529
529
|
if (typeof f == "function")
|
|
530
530
|
C = f.propTypes;
|
|
531
|
-
else if (typeof f == "object" && (f.$$typeof ===
|
|
531
|
+
else if (typeof f == "object" && (f.$$typeof === m || // Note: Memo only checks outer props here.
|
|
532
532
|
// Inner props are checked in the reconciler.
|
|
533
533
|
f.$$typeof === i))
|
|
534
534
|
C = f.propTypes;
|
|
@@ -585,7 +585,7 @@ Check the top-level render call using <` + C + ">.");
|
|
|
585
585
|
else
|
|
586
586
|
_a(z, a);
|
|
587
587
|
}
|
|
588
|
-
if (
|
|
588
|
+
if (ye.call(f, "key")) {
|
|
589
589
|
var te = H(a), W = Object.keys(f).filter(function(Ti) {
|
|
590
590
|
return Ti !== "key";
|
|
591
591
|
}), Ve = W.length > 0 ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
@@ -609,15 +609,15 @@ React keys must be passed directly to JSX without using spread:
|
|
|
609
609
|
return Ua(a, f, C, !1);
|
|
610
610
|
}
|
|
611
611
|
var Ui = fi, yi = _i;
|
|
612
|
-
|
|
613
|
-
})()),
|
|
612
|
+
Te.Fragment = s, Te.jsx = Ui, Te.jsxs = yi;
|
|
613
|
+
})()), Te;
|
|
614
614
|
}
|
|
615
615
|
var Ca;
|
|
616
616
|
function Ei() {
|
|
617
617
|
return Ca || (Ca = 1, process.env.NODE_ENV === "production" ? Pe.exports = Ni() : Pe.exports = Di()), Pe.exports;
|
|
618
618
|
}
|
|
619
619
|
var Oe = Ei();
|
|
620
|
-
const Za = Fa(null),
|
|
620
|
+
const Za = Fa(null), de = () => {
|
|
621
621
|
const e = Wa(Za);
|
|
622
622
|
if (!e)
|
|
623
623
|
throw new Error("useApiContext must be used within ApiProvider");
|
|
@@ -641,8 +641,8 @@ function Li({
|
|
|
641
641
|
const c = await n();
|
|
642
642
|
c && (_.headers.Authorization = `Bearer ${c}`);
|
|
643
643
|
}
|
|
644
|
-
const
|
|
645
|
-
return _.headers.Currency =
|
|
644
|
+
const m = o?.getState()?.isWalletCurrency || o?.getState()?.currency?.currentCurrency || "TWD";
|
|
645
|
+
return _.headers.Currency = m, _.headers["currency-code"] = m, _.headers.lang = s, _;
|
|
646
646
|
}), U.interceptors.response.use(
|
|
647
647
|
(_) => _.data,
|
|
648
648
|
(_) => u ? u(_, { instance: U }) : Promise.reject(_)
|
|
@@ -664,12 +664,12 @@ const Va = Fa(null), pl = () => {
|
|
|
664
664
|
shouldRedirect: u,
|
|
665
665
|
onShowError: U,
|
|
666
666
|
onCleanup: _,
|
|
667
|
-
onRemoveToken:
|
|
667
|
+
onRemoveToken: m,
|
|
668
668
|
onRedirect: c,
|
|
669
|
-
onGoogleLogout:
|
|
669
|
+
onGoogleLogout: r
|
|
670
670
|
}) => {
|
|
671
671
|
const i = n(o);
|
|
672
|
-
e(s, i) && U?.(), _?.(),
|
|
672
|
+
e(s, i) && U?.(), _?.(), m?.(), u && c?.("/"), r?.();
|
|
673
673
|
},
|
|
674
674
|
shouldShowErrorNotice: e,
|
|
675
675
|
isMachineDomain: n
|
|
@@ -686,9 +686,9 @@ const Va = Fa(null), pl = () => {
|
|
|
686
686
|
}) => {
|
|
687
687
|
const u = Ia(s, e);
|
|
688
688
|
return u ? n.reduce((U, _) => {
|
|
689
|
-
const
|
|
690
|
-
m,
|
|
689
|
+
const m = Aa(o, _), c = Ba(o, _), r = d[u] || [], i = Ka(
|
|
691
690
|
r,
|
|
691
|
+
m,
|
|
692
692
|
c
|
|
693
693
|
);
|
|
694
694
|
return O(i) || (U[_] = i), U;
|
|
@@ -733,13 +733,13 @@ const Va = Fa(null), pl = () => {
|
|
|
733
733
|
} = {}) => !Array.isArray(e) || !Array.isArray(n) ? {} : e.reduce((u, U) => {
|
|
734
734
|
const _ = Ia(d, U);
|
|
735
735
|
if (!_) return u;
|
|
736
|
-
const
|
|
736
|
+
const m = o[_] || [], c = n.reduce((r, i) => {
|
|
737
737
|
const g = Ri({
|
|
738
738
|
platformName: i,
|
|
739
|
-
gamesOfType:
|
|
739
|
+
gamesOfType: m,
|
|
740
740
|
allPlatforms: s
|
|
741
741
|
});
|
|
742
|
-
return O(g) ?
|
|
742
|
+
return O(g) ? r : { ...r, [i]: g };
|
|
743
743
|
}, {});
|
|
744
744
|
return O(c) || (u[U] = c), u;
|
|
745
745
|
}, {}), Wi = (e = {}) => !He(e) || O(e) ? {} : Object.values(e).reduce((d, s) => (Object.entries(s).forEach(([o, u]) => {
|
|
@@ -764,11 +764,11 @@ const Va = Fa(null), pl = () => {
|
|
|
764
764
|
allTopGameList: u = [],
|
|
765
765
|
randomlySelectedGames: U = [],
|
|
766
766
|
userFavoriteGame: _ = {},
|
|
767
|
-
exclusiveBrandGames:
|
|
767
|
+
exclusiveBrandGames: m = [],
|
|
768
768
|
highlightGames: c = [],
|
|
769
|
-
originPlatform:
|
|
769
|
+
originPlatform: r = []
|
|
770
770
|
}) => {
|
|
771
|
-
const i = Pi(e), g = va(n), l = xi(d), t = Oi(s), y = va(
|
|
771
|
+
const i = Pi(e), g = va(n), l = xi(d), t = Oi(s), y = va(r), b = Hi(_), p = Fi({
|
|
772
772
|
gameTypes: l,
|
|
773
773
|
platforms: g,
|
|
774
774
|
gameList: e,
|
|
@@ -790,7 +790,7 @@ const Va = Fa(null), pl = () => {
|
|
|
790
790
|
top: u,
|
|
791
791
|
favorite: b,
|
|
792
792
|
highlight: c,
|
|
793
|
-
exclusiveBrand:
|
|
793
|
+
exclusiveBrand: m,
|
|
794
794
|
randomlySelected: U
|
|
795
795
|
},
|
|
796
796
|
categorized: {
|
|
@@ -826,23 +826,23 @@ const Va = Fa(null), pl = () => {
|
|
|
826
826
|
default:
|
|
827
827
|
return e;
|
|
828
828
|
}
|
|
829
|
-
},
|
|
830
|
-
const { client: e } =
|
|
831
|
-
async (
|
|
832
|
-
const { mac_address: c = "", app_version:
|
|
829
|
+
}, ce = () => {
|
|
830
|
+
const { client: e } = de(), n = X(
|
|
831
|
+
async (m) => {
|
|
832
|
+
const { mac_address: c = "", app_version: r = "", anydesk_id: i = "" } = m, { data: g } = await e.post("/cash-register/login", {
|
|
833
833
|
mac_address: c,
|
|
834
|
-
app_version:
|
|
834
|
+
app_version: r,
|
|
835
835
|
anydesk_id: i
|
|
836
836
|
});
|
|
837
837
|
return g;
|
|
838
838
|
},
|
|
839
839
|
[e]
|
|
840
840
|
), d = X(async () => e.get("/member/getMemberInfo"), [e]), s = X(async () => await e.get("member/getGameList"), [e]), o = X(async () => await e.get("/member/getNowCurrencyExchange"), [e]), u = X(async () => await e.get("member/getFavoriteGame"), [e]), U = X(
|
|
841
|
-
async (
|
|
842
|
-
const { account: c, password:
|
|
841
|
+
async (m) => {
|
|
842
|
+
const { account: c, password: r, trans_code: i } = m;
|
|
843
843
|
return await e.post("/login", {
|
|
844
844
|
memId: c,
|
|
845
|
-
passwd:
|
|
845
|
+
passwd: r,
|
|
846
846
|
trans_code: i
|
|
847
847
|
});
|
|
848
848
|
},
|
|
@@ -876,10 +876,15 @@ const Va = Fa(null), pl = () => {
|
|
|
876
876
|
},
|
|
877
877
|
user: { favorite: [] }
|
|
878
878
|
}, Ii = ({ enabled: e = !0 } = {}) => {
|
|
879
|
-
const {
|
|
879
|
+
const { getToken: n } = de(), { userFavoriteGameApi: d } = ce(), { data: s, isLoading: o, error: u, refetch: U } = oe({
|
|
880
880
|
queryKey: ["gamesInfo"],
|
|
881
881
|
queryFn: async () => {
|
|
882
|
-
|
|
882
|
+
let _ = {};
|
|
883
|
+
try {
|
|
884
|
+
await n?.() && (_ = await d());
|
|
885
|
+
} catch (m) {
|
|
886
|
+
console.warn("Failed to fetch favorite games:", m);
|
|
887
|
+
}
|
|
883
888
|
return zi({
|
|
884
889
|
allGameList: window.gameTypeGroup || {},
|
|
885
890
|
allGamePlatform: window.platforms || [],
|
|
@@ -887,7 +892,7 @@ const Va = Fa(null), pl = () => {
|
|
|
887
892
|
allGame_subtype: window.gameSubType || [],
|
|
888
893
|
allNewGameList: window.newGames || [],
|
|
889
894
|
allTopGameList: window.topGames || [],
|
|
890
|
-
userFavoriteGame:
|
|
895
|
+
userFavoriteGame: _ || {},
|
|
891
896
|
randomlySelectedGames: window.randomlySelectedGames || [],
|
|
892
897
|
exclusiveBrandGames: window.exclusiveBrandGames || [],
|
|
893
898
|
highlightGames: window.highlightGames || [],
|
|
@@ -903,13 +908,17 @@ const Va = Fa(null), pl = () => {
|
|
|
903
908
|
refetchOnWindowFocus: !1
|
|
904
909
|
});
|
|
905
910
|
return {
|
|
906
|
-
gamesInfo:
|
|
907
|
-
isLoading:
|
|
908
|
-
error:
|
|
909
|
-
refetch:
|
|
911
|
+
gamesInfo: s || Vi,
|
|
912
|
+
isLoading: o,
|
|
913
|
+
error: u,
|
|
914
|
+
refetch: U
|
|
910
915
|
};
|
|
911
916
|
}, Ai = (e = !1) => {
|
|
912
|
-
!e && window.gameTypeGroup
|
|
917
|
+
if (!e && window.gameTypeGroup) {
|
|
918
|
+
console.log("window.gameTypeGroup 已存在,跳過初始化 mock 資料");
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
(e || !window.gameTypeGroup) && (window.gameTypeGroup = window.gameTypeGroup || {
|
|
913
922
|
1: [
|
|
914
923
|
{
|
|
915
924
|
gameUid: 8499,
|
|
@@ -27436,7 +27445,7 @@ const Va = Fa(null), pl = () => {
|
|
|
27436
27445
|
autoFetch: n = !1,
|
|
27437
27446
|
mockData: d = !1
|
|
27438
27447
|
}) => {
|
|
27439
|
-
|
|
27448
|
+
he(() => {
|
|
27440
27449
|
d && Ai(!0);
|
|
27441
27450
|
}, [d]);
|
|
27442
27451
|
const s = Ii({ enabled: n });
|
|
@@ -27463,7 +27472,7 @@ function _l({
|
|
|
27463
27472
|
return /* @__PURE__ */ Oe.jsx(vi, { client: _, children: /* @__PURE__ */ Oe.jsx(Za.Provider, { value: { client: u, ...o }, children: /* @__PURE__ */ Oe.jsx(Bi, { autoFetch: n, mockData: d, children: e }) }) });
|
|
27464
27473
|
}
|
|
27465
27474
|
const fl = ({ otherQueryKey: e = [], options: n = {} } = {}) => {
|
|
27466
|
-
const { userCurrencyExchangeApi: d } =
|
|
27475
|
+
const { userCurrencyExchangeApi: d } = ce(), { getToken: s } = de(), { enabled: o, ...u } = n, U = !!s && (o ? o.every((_) => _) : !0);
|
|
27467
27476
|
return Ja({
|
|
27468
27477
|
queries: [
|
|
27469
27478
|
{
|
|
@@ -27481,7 +27490,7 @@ const fl = ({ otherQueryKey: e = [], options: n = {} } = {}) => {
|
|
|
27481
27490
|
trigger: n = [],
|
|
27482
27491
|
enabled: d = !0
|
|
27483
27492
|
} = {}) => {
|
|
27484
|
-
const { getToken: s } =
|
|
27493
|
+
const { getToken: s } = de(), { userInfoApi: o } = ce(), u = Ja({
|
|
27485
27494
|
queries: [
|
|
27486
27495
|
{
|
|
27487
27496
|
queryKey: ["getMemberInfo", ...n],
|
|
@@ -27490,15 +27499,15 @@ const fl = ({ otherQueryKey: e = [], options: n = {} } = {}) => {
|
|
|
27490
27499
|
enabled: !!s && d
|
|
27491
27500
|
}
|
|
27492
27501
|
]
|
|
27493
|
-
}), { data: U, isFetching: _, error:
|
|
27494
|
-
return { data: U, isFetching: _, error:
|
|
27502
|
+
}), { data: U, isFetching: _, error: m } = u[0] || {};
|
|
27503
|
+
return { data: U, isFetching: _, error: m };
|
|
27495
27504
|
}, yl = ({ enabled: e = !0 } = {}) => {
|
|
27496
27505
|
const {
|
|
27497
27506
|
userInfoApi: n,
|
|
27498
27507
|
userFavoriteGameApi: d,
|
|
27499
27508
|
userGameListApi: s,
|
|
27500
27509
|
userCurrencyExchangeApi: o
|
|
27501
|
-
} =
|
|
27510
|
+
} = ce(), u = oe({
|
|
27502
27511
|
queryKey: ["getMemInfo"],
|
|
27503
27512
|
queryFn: async () => n(),
|
|
27504
27513
|
enabled: e
|
|
@@ -27510,7 +27519,7 @@ const fl = ({ otherQueryKey: e = [], options: n = {} } = {}) => {
|
|
|
27510
27519
|
queryKey: ["getUserGameList"],
|
|
27511
27520
|
queryFn: async () => s(),
|
|
27512
27521
|
enabled: e && u.isSuccess && U.isSuccess
|
|
27513
|
-
}),
|
|
27522
|
+
}), m = oe({
|
|
27514
27523
|
queryKey: ["getUserCurrencyExchange"],
|
|
27515
27524
|
queryFn: async () => o(),
|
|
27516
27525
|
enabled: e && u.isSuccess && U.isSuccess && _.isSuccess
|
|
@@ -27519,7 +27528,7 @@ const fl = ({ otherQueryKey: e = [], options: n = {} } = {}) => {
|
|
|
27519
27528
|
u,
|
|
27520
27529
|
U,
|
|
27521
27530
|
_,
|
|
27522
|
-
|
|
27531
|
+
m
|
|
27523
27532
|
];
|
|
27524
27533
|
};
|
|
27525
27534
|
var Ie = {}, J = {}, Ae = {}, ha;
|
|
@@ -27549,7 +27558,7 @@ function A() {
|
|
|
27549
27558
|
e.isReactNative = typeof navigator < "u" && navigator.product === "ReactNative", e.isEventSourceSupported = !e.isReactNative && o();
|
|
27550
27559
|
})(Ae)), Ae;
|
|
27551
27560
|
}
|
|
27552
|
-
var
|
|
27561
|
+
var Ce = {}, Be = {}, ka;
|
|
27553
27562
|
function Xe() {
|
|
27554
27563
|
return ka || (ka = 1, (function(e) {
|
|
27555
27564
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.resetWebSockets = e.sharedWebSockets = void 0, e.sharedWebSockets = {};
|
|
@@ -27569,22 +27578,22 @@ function $e() {
|
|
|
27569
27578
|
Sa = 1, Object.defineProperty(Q, "__esModule", { value: !0 }), Q.setUpSocketIOPing = Q.appendQueryParams = Q.parseSocketIOUrl = void 0;
|
|
27570
27579
|
var e = A(), n = function(o) {
|
|
27571
27580
|
if (o) {
|
|
27572
|
-
var u = /^https|wss/.test(o), U = o.replace(/^(https?|wss?)(:\/\/)?/, ""), _ = U.replace(/\/$/, ""),
|
|
27573
|
-
return "".concat(
|
|
27581
|
+
var u = /^https|wss/.test(o), U = o.replace(/^(https?|wss?)(:\/\/)?/, ""), _ = U.replace(/\/$/, ""), m = u ? "wss" : "ws";
|
|
27582
|
+
return "".concat(m, "://").concat(_).concat(e.SOCKET_IO_PATH);
|
|
27574
27583
|
} else if (o === "") {
|
|
27575
|
-
var u = /^https/.test(window.location.protocol),
|
|
27576
|
-
return "".concat(
|
|
27584
|
+
var u = /^https/.test(window.location.protocol), m = u ? "wss" : "ws", c = window.location.port ? ":".concat(window.location.port) : "";
|
|
27585
|
+
return "".concat(m, "://").concat(window.location.hostname).concat(c).concat(e.SOCKET_IO_PATH);
|
|
27577
27586
|
}
|
|
27578
27587
|
return o;
|
|
27579
27588
|
};
|
|
27580
27589
|
Q.parseSocketIOUrl = n;
|
|
27581
27590
|
var d = function(o, u) {
|
|
27582
27591
|
u === void 0 && (u = {});
|
|
27583
|
-
var U = /\?([\w]+=[\w]+)/, _ = U.test(o),
|
|
27584
|
-
var i =
|
|
27592
|
+
var U = /\?([\w]+=[\w]+)/, _ = U.test(o), m = "".concat(Object.entries(u).reduce(function(c, r) {
|
|
27593
|
+
var i = r[0], g = r[1];
|
|
27585
27594
|
return c + "".concat(i, "=").concat(g, "&");
|
|
27586
27595
|
}, "").slice(0, -1));
|
|
27587
|
-
return "".concat(o).concat(_ ? "&" : "?").concat(
|
|
27596
|
+
return "".concat(o).concat(_ ? "&" : "?").concat(m);
|
|
27588
27597
|
};
|
|
27589
27598
|
Q.appendQueryParams = d;
|
|
27590
27599
|
var s = function(o, u) {
|
|
@@ -27607,11 +27616,11 @@ function ja() {
|
|
|
27607
27616
|
}).current : s.current;
|
|
27608
27617
|
}
|
|
27609
27618
|
function d(s, o, u) {
|
|
27610
|
-
var U = u || {}, _ = U.interval,
|
|
27619
|
+
var U = u || {}, _ = U.interval, m = _ === void 0 ? e.DEFAULT_HEARTBEAT.interval : _, c = U.timeout, r = c === void 0 ? e.DEFAULT_HEARTBEAT.timeout : c, i = U.message, g = i === void 0 ? e.DEFAULT_HEARTBEAT.message : i, l = Math.max(100, m / 10), t = Date.now(), y = setInterval(function() {
|
|
27611
27620
|
var b = Date.now(), p = n(o);
|
|
27612
|
-
if (p +
|
|
27621
|
+
if (p + r <= b)
|
|
27613
27622
|
console.warn("Heartbeat timed out, closing connection, last message received ".concat(b - p, "ms ago, last ping sent ").concat(b - t, "ms ago")), s.close();
|
|
27614
|
-
else if (p +
|
|
27623
|
+
else if (p + m <= b && t + m <= b)
|
|
27615
27624
|
try {
|
|
27616
27625
|
typeof g == "function" ? s.send(g()) : s.send(g), t = b;
|
|
27617
27626
|
} catch (T) {
|
|
@@ -27625,30 +27634,30 @@ function ja() {
|
|
|
27625
27634
|
}
|
|
27626
27635
|
return xe;
|
|
27627
27636
|
}
|
|
27628
|
-
var
|
|
27637
|
+
var ve = {}, Ke = {}, Da;
|
|
27629
27638
|
function ea() {
|
|
27630
27639
|
return Da || (Da = 1, (function(e) {
|
|
27631
27640
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.resetSubscribers = e.removeSubscriber = e.addSubscriber = e.hasSubscribers = e.getSubscribers = void 0;
|
|
27632
|
-
var n = {}, d = [], s = function(
|
|
27633
|
-
return (0, e.hasSubscribers)(
|
|
27641
|
+
var n = {}, d = [], s = function(m) {
|
|
27642
|
+
return (0, e.hasSubscribers)(m) ? Array.from(n[m]) : d;
|
|
27634
27643
|
};
|
|
27635
27644
|
e.getSubscribers = s;
|
|
27636
|
-
var o = function(
|
|
27645
|
+
var o = function(m) {
|
|
27637
27646
|
var c;
|
|
27638
|
-
return ((c = n[
|
|
27647
|
+
return ((c = n[m]) === null || c === void 0 ? void 0 : c.size) > 0;
|
|
27639
27648
|
};
|
|
27640
27649
|
e.hasSubscribers = o;
|
|
27641
|
-
var u = function(
|
|
27642
|
-
n[
|
|
27650
|
+
var u = function(m, c) {
|
|
27651
|
+
n[m] = n[m] || /* @__PURE__ */ new Set(), n[m].add(c);
|
|
27643
27652
|
};
|
|
27644
27653
|
e.addSubscriber = u;
|
|
27645
|
-
var U = function(
|
|
27646
|
-
n[
|
|
27654
|
+
var U = function(m, c) {
|
|
27655
|
+
n[m].delete(c);
|
|
27647
27656
|
};
|
|
27648
27657
|
e.removeSubscriber = U;
|
|
27649
|
-
var _ = function(
|
|
27650
|
-
if (
|
|
27651
|
-
delete n[
|
|
27658
|
+
var _ = function(m) {
|
|
27659
|
+
if (m && n.hasOwnProperty(m))
|
|
27660
|
+
delete n[m];
|
|
27652
27661
|
else
|
|
27653
27662
|
for (var c in n)
|
|
27654
27663
|
n.hasOwnProperty(c) && delete n[c];
|
|
@@ -27658,8 +27667,8 @@ function ea() {
|
|
|
27658
27667
|
}
|
|
27659
27668
|
var Ea;
|
|
27660
27669
|
function aa() {
|
|
27661
|
-
if (Ea) return
|
|
27662
|
-
Ea = 1, Object.defineProperty(
|
|
27670
|
+
if (Ea) return ve;
|
|
27671
|
+
Ea = 1, Object.defineProperty(ve, "__esModule", { value: !0 }), ve.assertIsWebSocket = d, ve.resetGlobalState = s;
|
|
27663
27672
|
var e = Xe(), n = ea();
|
|
27664
27673
|
function d(o, u) {
|
|
27665
27674
|
if (!u && !(o instanceof WebSocket))
|
|
@@ -27668,41 +27677,41 @@ function aa() {
|
|
|
27668
27677
|
function s(o) {
|
|
27669
27678
|
(0, n.resetSubscribers)(o), (0, e.resetWebSockets)(o);
|
|
27670
27679
|
}
|
|
27671
|
-
return
|
|
27680
|
+
return ve;
|
|
27672
27681
|
}
|
|
27673
27682
|
var La;
|
|
27674
27683
|
function Ki() {
|
|
27675
27684
|
if (La) return ne;
|
|
27676
27685
|
La = 1;
|
|
27677
27686
|
var e = ne && ne.__assign || function() {
|
|
27678
|
-
return e = Object.assign || function(
|
|
27687
|
+
return e = Object.assign || function(r) {
|
|
27679
27688
|
for (var i, g = 1, l = arguments.length; g < l; g++) {
|
|
27680
27689
|
i = arguments[g];
|
|
27681
|
-
for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && (
|
|
27690
|
+
for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && (r[t] = i[t]);
|
|
27682
27691
|
}
|
|
27683
|
-
return
|
|
27692
|
+
return r;
|
|
27684
27693
|
}, e.apply(this, arguments);
|
|
27685
27694
|
};
|
|
27686
27695
|
Object.defineProperty(ne, "__esModule", { value: !0 }), ne.attachListeners = void 0;
|
|
27687
|
-
var n = $e(), d = ja(), s = A(), o = aa(), u = function(
|
|
27688
|
-
|
|
27696
|
+
var n = $e(), d = ja(), s = A(), o = aa(), u = function(r, i, g, l) {
|
|
27697
|
+
r.onmessage = function(t) {
|
|
27689
27698
|
var y;
|
|
27690
27699
|
i.current.onMessage && i.current.onMessage(t), typeof l?.current == "number" && (l.current = Date.now()), !(typeof i.current.filter == "function" && i.current.filter(t) !== !0) && (i.current.heartbeat && typeof i.current.heartbeat != "boolean" && ((y = i.current.heartbeat) === null || y === void 0 ? void 0 : y.returnMessage) === t.data || g(t));
|
|
27691
27700
|
};
|
|
27692
|
-
}, U = function(
|
|
27693
|
-
|
|
27694
|
-
if (i.current.onOpen && i.current.onOpen(y), l.current = 0, g(s.ReadyState.OPEN), i.current.heartbeat &&
|
|
27701
|
+
}, U = function(r, i, g, l, t) {
|
|
27702
|
+
r.onopen = function(y) {
|
|
27703
|
+
if (i.current.onOpen && i.current.onOpen(y), l.current = 0, g(s.ReadyState.OPEN), i.current.heartbeat && r instanceof WebSocket) {
|
|
27695
27704
|
var b = typeof i.current.heartbeat == "boolean" ? void 0 : i.current.heartbeat;
|
|
27696
|
-
t.current = Date.now(), (0, d.heartbeat)(
|
|
27705
|
+
t.current = Date.now(), (0, d.heartbeat)(r, t, b);
|
|
27697
27706
|
}
|
|
27698
27707
|
};
|
|
27699
|
-
}, _ = function(
|
|
27700
|
-
if (s.isEventSourceSupported &&
|
|
27708
|
+
}, _ = function(r, i, g, l, t) {
|
|
27709
|
+
if (s.isEventSourceSupported && r instanceof EventSource)
|
|
27701
27710
|
return function() {
|
|
27702
27711
|
};
|
|
27703
|
-
(0, o.assertIsWebSocket)(
|
|
27712
|
+
(0, o.assertIsWebSocket)(r, i.current.skipAssert);
|
|
27704
27713
|
var y;
|
|
27705
|
-
return
|
|
27714
|
+
return r.onclose = function(b) {
|
|
27706
27715
|
var p;
|
|
27707
27716
|
if (i.current.onClose && i.current.onClose(b), g(s.ReadyState.CLOSED), i.current.shouldReconnect && i.current.shouldReconnect(b)) {
|
|
27708
27717
|
var T = (p = i.current.reconnectAttempts) !== null && p !== void 0 ? p : s.DEFAULT_RECONNECT_LIMIT;
|
|
@@ -27717,11 +27726,11 @@ function Ki() {
|
|
|
27717
27726
|
}, function() {
|
|
27718
27727
|
return y && window.clearTimeout(y);
|
|
27719
27728
|
};
|
|
27720
|
-
},
|
|
27729
|
+
}, m = function(r, i, g, l, t) {
|
|
27721
27730
|
var y;
|
|
27722
|
-
return
|
|
27731
|
+
return r.onerror = function(b) {
|
|
27723
27732
|
var p;
|
|
27724
|
-
if (i.current.onError && i.current.onError(b), s.isEventSourceSupported &&
|
|
27733
|
+
if (i.current.onError && i.current.onError(b), s.isEventSourceSupported && r instanceof EventSource && (i.current.onClose && i.current.onClose(e(e({}, b), { code: 1006, reason: "An error occurred with the EventSource: ".concat(b), wasClean: !1 })), g(s.ReadyState.CLOSED), r.close()), i.current.retryOnError)
|
|
27725
27734
|
if (t.current < ((p = i.current.reconnectAttempts) !== null && p !== void 0 ? p : s.DEFAULT_RECONNECT_LIMIT)) {
|
|
27726
27735
|
var T = typeof i.current.reconnectInterval == "function" ? i.current.reconnectInterval(t.current) : i.current.reconnectInterval;
|
|
27727
27736
|
y = window.setTimeout(function() {
|
|
@@ -27732,10 +27741,10 @@ function Ki() {
|
|
|
27732
27741
|
}, function() {
|
|
27733
27742
|
return y && window.clearTimeout(y);
|
|
27734
27743
|
};
|
|
27735
|
-
}, c = function(
|
|
27744
|
+
}, c = function(r, i, g, l, t, y, b) {
|
|
27736
27745
|
var p = i.setLastMessage, T = i.setReadyState, N, D, h;
|
|
27737
|
-
return g.current.fromSocketIO && (N = (0, n.setUpSocketIOPing)(b)), u(
|
|
27738
|
-
T(s.ReadyState.CLOSING), D(), h(),
|
|
27746
|
+
return g.current.fromSocketIO && (N = (0, n.setUpSocketIOPing)(b)), u(r, g, p, y), U(r, g, T, t, y), D = _(r, g, T, l, t), h = m(r, g, T, l, t), function() {
|
|
27747
|
+
T(s.ReadyState.CLOSING), D(), h(), r.close(), N && clearInterval(N);
|
|
27739
27748
|
};
|
|
27740
27749
|
};
|
|
27741
27750
|
return ne.attachListeners = c, ne;
|
|
@@ -27770,7 +27779,7 @@ function ji() {
|
|
|
27770
27779
|
return b.lastMessageTime;
|
|
27771
27780
|
}), typeof l == "boolean" ? void 0 : l);
|
|
27772
27781
|
};
|
|
27773
|
-
},
|
|
27782
|
+
}, m = function(i, g) {
|
|
27774
27783
|
i instanceof WebSocket && (i.onclose = function(l) {
|
|
27775
27784
|
(0, s.getSubscribers)(g).forEach(function(t) {
|
|
27776
27785
|
t.optionsRef.current.onClose && t.optionsRef.current.onClose(l), t.setReadyState(d.ReadyState.CLOSED);
|
|
@@ -27794,67 +27803,67 @@ function ji() {
|
|
|
27794
27803
|
t.optionsRef.current.onError && t.optionsRef.current.onError(l), d.isEventSourceSupported && i instanceof EventSource && (t.optionsRef.current.onClose && t.optionsRef.current.onClose(e(e({}, l), { code: 1006, reason: "An error occurred with the EventSource: ".concat(l), wasClean: !1 })), t.setReadyState(d.ReadyState.CLOSED));
|
|
27795
27804
|
}), d.isEventSourceSupported && i instanceof EventSource && i.close();
|
|
27796
27805
|
};
|
|
27797
|
-
},
|
|
27806
|
+
}, r = function(i, g, l, t) {
|
|
27798
27807
|
var y;
|
|
27799
|
-
return l.current.fromSocketIO && (y = (0, o.setUpSocketIOPing)(t)), U(i, g, l.current.heartbeat),
|
|
27808
|
+
return l.current.fromSocketIO && (y = (0, o.setUpSocketIOPing)(t)), U(i, g, l.current.heartbeat), m(i, g), _(i, g, l.current.heartbeat), c(i, g), function() {
|
|
27800
27809
|
y && clearInterval(y);
|
|
27801
27810
|
};
|
|
27802
27811
|
};
|
|
27803
|
-
return me.attachSharedListeners =
|
|
27812
|
+
return me.attachSharedListeners = r, me;
|
|
27804
27813
|
}
|
|
27805
27814
|
var Ma;
|
|
27806
27815
|
function Qi() {
|
|
27807
|
-
if (Ma) return
|
|
27808
|
-
Ma = 1, Object.defineProperty(
|
|
27809
|
-
var e = Xe(), n = A(), d = Ki(), s = ji(), o = ea(), u = function(_,
|
|
27816
|
+
if (Ma) return Ce;
|
|
27817
|
+
Ma = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.createOrJoinSocket = void 0;
|
|
27818
|
+
var e = Xe(), n = A(), d = Ki(), s = ji(), o = ea(), u = function(_, m, c, r, i) {
|
|
27810
27819
|
return function() {
|
|
27811
|
-
if ((0, o.removeSubscriber)(_,
|
|
27820
|
+
if ((0, o.removeSubscriber)(_, m), !(0, o.hasSubscribers)(_)) {
|
|
27812
27821
|
try {
|
|
27813
27822
|
var g = e.sharedWebSockets[_];
|
|
27814
27823
|
g instanceof WebSocket && (g.onclose = function(l) {
|
|
27815
|
-
c.current.onClose && c.current.onClose(l),
|
|
27824
|
+
c.current.onClose && c.current.onClose(l), r(n.ReadyState.CLOSED);
|
|
27816
27825
|
}), g.close();
|
|
27817
27826
|
} catch {
|
|
27818
27827
|
}
|
|
27819
27828
|
i && i(), delete e.sharedWebSockets[_];
|
|
27820
27829
|
}
|
|
27821
27830
|
};
|
|
27822
|
-
}, U = function(_,
|
|
27823
|
-
if (!n.isEventSourceSupported &&
|
|
27831
|
+
}, U = function(_, m, c, r, i, g, l, t, y) {
|
|
27832
|
+
if (!n.isEventSourceSupported && r.current.eventSourceOptions)
|
|
27824
27833
|
throw n.isReactNative ? new Error("EventSource is not supported in ReactNative") : new Error("EventSource is not supported");
|
|
27825
|
-
if (
|
|
27834
|
+
if (r.current.share) {
|
|
27826
27835
|
var b = null;
|
|
27827
|
-
e.sharedWebSockets[
|
|
27836
|
+
e.sharedWebSockets[m] === void 0 ? (e.sharedWebSockets[m] = r.current.eventSourceOptions ? new EventSource(m, r.current.eventSourceOptions) : new WebSocket(m, r.current.protocols), _.current = e.sharedWebSockets[m], c(n.ReadyState.CONNECTING), b = (0, s.attachSharedListeners)(e.sharedWebSockets[m], m, r, y)) : (_.current = e.sharedWebSockets[m], c(e.sharedWebSockets[m].readyState));
|
|
27828
27837
|
var p = {
|
|
27829
27838
|
setLastMessage: i,
|
|
27830
27839
|
setReadyState: c,
|
|
27831
|
-
optionsRef:
|
|
27840
|
+
optionsRef: r,
|
|
27832
27841
|
reconnectCount: l,
|
|
27833
27842
|
lastMessageTime: t,
|
|
27834
27843
|
reconnect: g
|
|
27835
27844
|
};
|
|
27836
|
-
return (0, o.addSubscriber)(
|
|
27845
|
+
return (0, o.addSubscriber)(m, p), u(m, p, r, c, b);
|
|
27837
27846
|
} else {
|
|
27838
|
-
if (_.current =
|
|
27847
|
+
if (_.current = r.current.eventSourceOptions ? new EventSource(m, r.current.eventSourceOptions) : new WebSocket(m, r.current.protocols), c(n.ReadyState.CONNECTING), !_.current)
|
|
27839
27848
|
throw new Error("WebSocket failed to be created");
|
|
27840
27849
|
return (0, d.attachListeners)(_.current, {
|
|
27841
27850
|
setLastMessage: i,
|
|
27842
27851
|
setReadyState: c
|
|
27843
|
-
},
|
|
27852
|
+
}, r, g.current, l, t, y);
|
|
27844
27853
|
}
|
|
27845
27854
|
};
|
|
27846
|
-
return
|
|
27855
|
+
return Ce.createOrJoinSocket = U, Ce;
|
|
27847
27856
|
}
|
|
27848
27857
|
var Y = {}, Ra;
|
|
27849
27858
|
function Yi() {
|
|
27850
27859
|
return Ra || (Ra = 1, (function(e) {
|
|
27851
|
-
var n = Y && Y.__awaiter || function(
|
|
27860
|
+
var n = Y && Y.__awaiter || function(m, c, r, i) {
|
|
27852
27861
|
function g(l) {
|
|
27853
|
-
return l instanceof
|
|
27862
|
+
return l instanceof r ? l : new r(function(t) {
|
|
27854
27863
|
t(l);
|
|
27855
27864
|
});
|
|
27856
27865
|
}
|
|
27857
|
-
return new (
|
|
27866
|
+
return new (r || (r = Promise))(function(l, t) {
|
|
27858
27867
|
function y(T) {
|
|
27859
27868
|
try {
|
|
27860
27869
|
p(i.next(T));
|
|
@@ -27872,10 +27881,10 @@ function Yi() {
|
|
|
27872
27881
|
function p(T) {
|
|
27873
27882
|
T.done ? l(T.value) : g(T.value).then(y, b);
|
|
27874
27883
|
}
|
|
27875
|
-
p((i = i.apply(
|
|
27884
|
+
p((i = i.apply(m, c || [])).next());
|
|
27876
27885
|
});
|
|
27877
|
-
}, d = Y && Y.__generator || function(
|
|
27878
|
-
var
|
|
27886
|
+
}, d = Y && Y.__generator || function(m, c) {
|
|
27887
|
+
var r = { label: 0, sent: function() {
|
|
27879
27888
|
if (l[0] & 1) throw l[1];
|
|
27880
27889
|
return l[1];
|
|
27881
27890
|
}, trys: [], ops: [] }, i, g, l, t = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
|
@@ -27889,7 +27898,7 @@ function Yi() {
|
|
|
27889
27898
|
}
|
|
27890
27899
|
function b(p) {
|
|
27891
27900
|
if (i) throw new TypeError("Generator is already executing.");
|
|
27892
|
-
for (; t && (t = 0, p[0] && (
|
|
27901
|
+
for (; t && (t = 0, p[0] && (r = 0)), r; ) try {
|
|
27893
27902
|
if (i = 1, g && (l = p[0] & 2 ? g.return : p[0] ? g.throw || ((l = g.return) && l.call(g), 0) : g.next) && !(l = l.call(g, p[1])).done) return l;
|
|
27894
27903
|
switch (g = 0, l && (p = [p[0] & 2, l.value]), p[0]) {
|
|
27895
27904
|
case 0:
|
|
@@ -27897,34 +27906,34 @@ function Yi() {
|
|
|
27897
27906
|
l = p;
|
|
27898
27907
|
break;
|
|
27899
27908
|
case 4:
|
|
27900
|
-
return
|
|
27909
|
+
return r.label++, { value: p[1], done: !1 };
|
|
27901
27910
|
case 5:
|
|
27902
|
-
|
|
27911
|
+
r.label++, g = p[1], p = [0];
|
|
27903
27912
|
continue;
|
|
27904
27913
|
case 7:
|
|
27905
|
-
p =
|
|
27914
|
+
p = r.ops.pop(), r.trys.pop();
|
|
27906
27915
|
continue;
|
|
27907
27916
|
default:
|
|
27908
|
-
if (l =
|
|
27909
|
-
|
|
27917
|
+
if (l = r.trys, !(l = l.length > 0 && l[l.length - 1]) && (p[0] === 6 || p[0] === 2)) {
|
|
27918
|
+
r = 0;
|
|
27910
27919
|
continue;
|
|
27911
27920
|
}
|
|
27912
27921
|
if (p[0] === 3 && (!l || p[1] > l[0] && p[1] < l[3])) {
|
|
27913
|
-
|
|
27922
|
+
r.label = p[1];
|
|
27914
27923
|
break;
|
|
27915
27924
|
}
|
|
27916
|
-
if (p[0] === 6 &&
|
|
27917
|
-
|
|
27925
|
+
if (p[0] === 6 && r.label < l[1]) {
|
|
27926
|
+
r.label = l[1], l = p;
|
|
27918
27927
|
break;
|
|
27919
27928
|
}
|
|
27920
|
-
if (l &&
|
|
27921
|
-
|
|
27929
|
+
if (l && r.label < l[2]) {
|
|
27930
|
+
r.label = l[2], r.ops.push(p);
|
|
27922
27931
|
break;
|
|
27923
27932
|
}
|
|
27924
|
-
l[2] &&
|
|
27933
|
+
l[2] && r.ops.pop(), r.trys.pop();
|
|
27925
27934
|
continue;
|
|
27926
27935
|
}
|
|
27927
|
-
p = c.call(
|
|
27936
|
+
p = c.call(m, r);
|
|
27928
27937
|
} catch (T) {
|
|
27929
27938
|
p = [6, T], g = 0;
|
|
27930
27939
|
} finally {
|
|
@@ -27933,20 +27942,20 @@ function Yi() {
|
|
|
27933
27942
|
if (p[0] & 5) throw p[1];
|
|
27934
27943
|
return { value: p[0] ? p[1] : void 0, done: !0 };
|
|
27935
27944
|
}
|
|
27936
|
-
}, s = Y && Y.__spreadArray || function(
|
|
27937
|
-
if (
|
|
27945
|
+
}, s = Y && Y.__spreadArray || function(m, c, r) {
|
|
27946
|
+
if (r || arguments.length === 2) for (var i = 0, g = c.length, l; i < g; i++)
|
|
27938
27947
|
(l || !(i in c)) && (l || (l = Array.prototype.slice.call(c, 0, i)), l[i] = c[i]);
|
|
27939
|
-
return
|
|
27948
|
+
return m.concat(l || Array.prototype.slice.call(c));
|
|
27940
27949
|
};
|
|
27941
27950
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.getUrl = void 0;
|
|
27942
|
-
var o = $e(), u = A(), U = function(
|
|
27951
|
+
var o = $e(), u = A(), U = function(m) {
|
|
27943
27952
|
return new Promise(function(c) {
|
|
27944
|
-
return window.setTimeout(c,
|
|
27953
|
+
return window.setTimeout(c, m);
|
|
27945
27954
|
});
|
|
27946
|
-
}, _ = function(
|
|
27947
|
-
for (var
|
|
27948
|
-
|
|
27949
|
-
return n(void 0, s([
|
|
27955
|
+
}, _ = function(m, c) {
|
|
27956
|
+
for (var r = [], i = 2; i < arguments.length; i++)
|
|
27957
|
+
r[i - 2] = arguments[i];
|
|
27958
|
+
return n(void 0, s([m, c], r, !0), void 0, function(g, l, t) {
|
|
27950
27959
|
var y, b, p, T, N, D, h, L;
|
|
27951
27960
|
return t === void 0 && (t = 0), d(this, function(M) {
|
|
27952
27961
|
switch (M.label) {
|
|
@@ -28102,7 +28111,7 @@ function ia() {
|
|
|
28102
28111
|
return g && g.__esModule ? g : { default: g };
|
|
28103
28112
|
};
|
|
28104
28113
|
Object.defineProperty(J, "__esModule", { value: !0 }), J.useWebSocket = void 0;
|
|
28105
|
-
var o =
|
|
28114
|
+
var o = ke, u = ki, U = A(), _ = Qi(), m = Yi(), c = s(qi()), r = aa(), i = function(g, l, t) {
|
|
28106
28115
|
l === void 0 && (l = U.DEFAULT_OPTIONS), t === void 0 && (t = !0);
|
|
28107
28116
|
var y = (0, o.useState)(null), b = y[0], p = y[1], T = (0, o.useState)({}), N = T[0], D = T[1], h = (0, o.useMemo)(function() {
|
|
28108
28117
|
if (!l.disableJson && b)
|
|
@@ -28112,8 +28121,8 @@ function ia() {
|
|
|
28112
28121
|
return U.UNPARSABLE_JSON_OBJECT;
|
|
28113
28122
|
}
|
|
28114
28123
|
return null;
|
|
28115
|
-
}, [b, l.disableJson]), L = (0, o.useRef)(null), M = (0, o.useRef)(null),
|
|
28116
|
-
}),
|
|
28124
|
+
}, [b, l.disableJson]), L = (0, o.useRef)(null), M = (0, o.useRef)(null), _e = (0, o.useRef)(function() {
|
|
28125
|
+
}), fe = (0, o.useRef)(0), Fe = (0, o.useRef)(Date.now()), Se = (0, o.useRef)([]), V = (0, o.useRef)(null), H = (0, o.useRef)(l);
|
|
28117
28126
|
H.current = l;
|
|
28118
28127
|
var Z = L.current && N[L.current] !== void 0 ? N[L.current] : g !== null && t === !0 ? U.ReadyState.CONNECTING : U.ReadyState.UNINSTANTIATED, ae = l.queryParams ? JSON.stringify(l.queryParams) : null, B = (0, o.useCallback)(function(x, w) {
|
|
28119
28128
|
var K;
|
|
@@ -28121,21 +28130,21 @@ function ia() {
|
|
|
28121
28130
|
console.warn("Unable to send a message from an eventSource");
|
|
28122
28131
|
return;
|
|
28123
28132
|
}
|
|
28124
|
-
((K = M.current) === null || K === void 0 ? void 0 : K.readyState) === U.ReadyState.OPEN ? ((0,
|
|
28133
|
+
((K = M.current) === null || K === void 0 ? void 0 : K.readyState) === U.ReadyState.OPEN ? ((0, r.assertIsWebSocket)(M.current, H.current.skipAssert), M.current.send(x)) : w && Se.current.push(x);
|
|
28125
28134
|
}, []), Ne = (0, o.useCallback)(function(x, w) {
|
|
28126
28135
|
w === void 0 && (w = !0), B(JSON.stringify(x), w);
|
|
28127
28136
|
}, [B]), De = (0, o.useCallback)(function() {
|
|
28128
|
-
return H.current.share !== !0 || U.isEventSourceSupported && M.current instanceof EventSource ? M.current : (V.current === null && M.current && ((0,
|
|
28137
|
+
return H.current.share !== !0 || U.isEventSourceSupported && M.current instanceof EventSource ? M.current : (V.current === null && M.current && ((0, r.assertIsWebSocket)(M.current, H.current.skipAssert), V.current = (0, c.default)(M.current, _e)), V.current);
|
|
28129
28138
|
}, []);
|
|
28130
28139
|
return (0, o.useEffect)(function() {
|
|
28131
28140
|
if (g !== null && t === !0) {
|
|
28132
|
-
var x, w = !1, K = !0,
|
|
28141
|
+
var x, w = !1, K = !0, Ue = function() {
|
|
28133
28142
|
return n(void 0, void 0, void 0, function() {
|
|
28134
28143
|
var ie, $, Ee;
|
|
28135
28144
|
return d(this, function(se) {
|
|
28136
28145
|
switch (se.label) {
|
|
28137
28146
|
case 0:
|
|
28138
|
-
return ie = L, [4, (0,
|
|
28147
|
+
return ie = L, [4, (0, m.getUrl)(g, H)];
|
|
28139
28148
|
case 1:
|
|
28140
28149
|
return ie.current = se.sent(), L.current === null ? (console.error("Failed to get a valid URL. WebSocket connection aborted."), L.current = "ABORTED", (0, u.flushSync)(function() {
|
|
28141
28150
|
return D(function(j) {
|
|
@@ -28155,7 +28164,7 @@ function ia() {
|
|
|
28155
28164
|
return e(e({}, ue), L.current && (le = {}, le[L.current] = j, le));
|
|
28156
28165
|
});
|
|
28157
28166
|
});
|
|
28158
|
-
}, K && (x = (0, _.createOrJoinSocket)(M, L.current, Ee, H, $,
|
|
28167
|
+
}, K && (x = (0, _.createOrJoinSocket)(M, L.current, Ee, H, $, _e, fe, Fe, B)), [
|
|
28159
28168
|
2
|
|
28160
28169
|
/*return*/
|
|
28161
28170
|
]);
|
|
@@ -28163,12 +28172,12 @@ function ia() {
|
|
|
28163
28172
|
});
|
|
28164
28173
|
});
|
|
28165
28174
|
};
|
|
28166
|
-
return
|
|
28167
|
-
w || (V.current && (V.current = null), x?.(),
|
|
28168
|
-
},
|
|
28175
|
+
return _e.current = function() {
|
|
28176
|
+
w || (V.current && (V.current = null), x?.(), Ue());
|
|
28177
|
+
}, Ue(), function() {
|
|
28169
28178
|
w = !0, K = !1, V.current && (V.current = null), x?.(), p(null);
|
|
28170
28179
|
};
|
|
28171
|
-
} else (g === null || t === !1) && (
|
|
28180
|
+
} else (g === null || t === !1) && (fe.current = 0, D(function(ie) {
|
|
28172
28181
|
var $;
|
|
28173
28182
|
return e(e({}, ie), L.current && ($ = {}, $[L.current] = U.ReadyState.CLOSED, $));
|
|
28174
28183
|
}));
|
|
@@ -28193,33 +28202,33 @@ function Xi() {
|
|
|
28193
28202
|
Oa = 1;
|
|
28194
28203
|
var e = re && re.__assign || function() {
|
|
28195
28204
|
return e = Object.assign || function(_) {
|
|
28196
|
-
for (var
|
|
28197
|
-
|
|
28198
|
-
for (var i in
|
|
28205
|
+
for (var m, c = 1, r = arguments.length; c < r; c++) {
|
|
28206
|
+
m = arguments[c];
|
|
28207
|
+
for (var i in m) Object.prototype.hasOwnProperty.call(m, i) && (_[i] = m[i]);
|
|
28199
28208
|
}
|
|
28200
28209
|
return _;
|
|
28201
28210
|
}, e.apply(this, arguments);
|
|
28202
28211
|
};
|
|
28203
28212
|
Object.defineProperty(re, "__esModule", { value: !0 }), re.useSocketIO = void 0;
|
|
28204
|
-
var n =
|
|
28213
|
+
var n = ke, d = ia(), s = A(), o = {
|
|
28205
28214
|
type: "empty",
|
|
28206
28215
|
payload: null
|
|
28207
28216
|
}, u = function(_) {
|
|
28208
28217
|
if (!_ || !_.data)
|
|
28209
28218
|
return o;
|
|
28210
|
-
var
|
|
28211
|
-
if (!
|
|
28219
|
+
var m = _.data.match(/\[.*]/);
|
|
28220
|
+
if (!m)
|
|
28212
28221
|
return o;
|
|
28213
|
-
var c = JSON.parse(
|
|
28222
|
+
var c = JSON.parse(m);
|
|
28214
28223
|
return !Array.isArray(c) || !c[1] ? o : {
|
|
28215
28224
|
type: c[0],
|
|
28216
28225
|
payload: c[1]
|
|
28217
28226
|
};
|
|
28218
|
-
}, U = function(_,
|
|
28219
|
-
|
|
28220
|
-
var
|
|
28221
|
-
return e(e({},
|
|
28222
|
-
}, []), i = (0, d.useWebSocket)(_,
|
|
28227
|
+
}, U = function(_, m, c) {
|
|
28228
|
+
m === void 0 && (m = s.DEFAULT_OPTIONS), c === void 0 && (c = !0);
|
|
28229
|
+
var r = (0, n.useMemo)(function() {
|
|
28230
|
+
return e(e({}, m), { fromSocketIO: !0 });
|
|
28231
|
+
}, []), i = (0, d.useWebSocket)(_, r, c), g = i.sendMessage, l = i.sendJsonMessage, t = i.lastMessage, y = i.readyState, b = i.getWebSocket, p = (0, n.useMemo)(function() {
|
|
28223
28232
|
return u(t);
|
|
28224
28233
|
}, [t]);
|
|
28225
28234
|
return {
|
|
@@ -28239,30 +28248,30 @@ function $i() {
|
|
|
28239
28248
|
Ha = 1;
|
|
28240
28249
|
var e = q && q.__assign || function() {
|
|
28241
28250
|
return e = Object.assign || function(U) {
|
|
28242
|
-
for (var _,
|
|
28243
|
-
_ = arguments[
|
|
28244
|
-
for (var
|
|
28251
|
+
for (var _, m = 1, c = arguments.length; m < c; m++) {
|
|
28252
|
+
_ = arguments[m];
|
|
28253
|
+
for (var r in _) Object.prototype.hasOwnProperty.call(_, r) && (U[r] = _[r]);
|
|
28245
28254
|
}
|
|
28246
28255
|
return U;
|
|
28247
28256
|
}, e.apply(this, arguments);
|
|
28248
28257
|
}, n = q && q.__rest || function(U, _) {
|
|
28249
|
-
var
|
|
28250
|
-
for (var c in U) Object.prototype.hasOwnProperty.call(U, c) && _.indexOf(c) < 0 && (
|
|
28258
|
+
var m = {};
|
|
28259
|
+
for (var c in U) Object.prototype.hasOwnProperty.call(U, c) && _.indexOf(c) < 0 && (m[c] = U[c]);
|
|
28251
28260
|
if (U != null && typeof Object.getOwnPropertySymbols == "function")
|
|
28252
|
-
for (var
|
|
28253
|
-
_.indexOf(c[
|
|
28254
|
-
return
|
|
28261
|
+
for (var r = 0, c = Object.getOwnPropertySymbols(U); r < c.length; r++)
|
|
28262
|
+
_.indexOf(c[r]) < 0 && Object.prototype.propertyIsEnumerable.call(U, c[r]) && (m[c[r]] = U[c[r]]);
|
|
28263
|
+
return m;
|
|
28255
28264
|
};
|
|
28256
28265
|
Object.defineProperty(q, "__esModule", { value: !0 }), q.useEventSource = void 0;
|
|
28257
|
-
var d =
|
|
28266
|
+
var d = ke, s = ia(), o = A(), u = function(U, _, m) {
|
|
28258
28267
|
_ === void 0 && (_ = o.DEFAULT_EVENT_SOURCE_OPTIONS);
|
|
28259
|
-
var c = _.withCredentials,
|
|
28260
|
-
|
|
28268
|
+
var c = _.withCredentials, r = _.events, i = n(_, ["withCredentials", "events"]);
|
|
28269
|
+
m === void 0 && (m = !0);
|
|
28261
28270
|
var g = e(e({}, i), { eventSourceOptions: {
|
|
28262
28271
|
withCredentials: c
|
|
28263
28272
|
} }), l = (0, d.useRef)(o.EMPTY_EVENT_HANDLERS);
|
|
28264
|
-
|
|
28265
|
-
var t = (0, s.useWebSocket)(U, g,
|
|
28273
|
+
r && (l.current = r);
|
|
28274
|
+
var t = (0, s.useWebSocket)(U, g, m), y = t.lastMessage, b = t.readyState, p = t.getWebSocket;
|
|
28266
28275
|
return (0, d.useEffect)(function() {
|
|
28267
28276
|
y?.type && Object.entries(l.current).forEach(function(T) {
|
|
28268
28277
|
var N = T[0], D = T[1];
|
|
@@ -28327,7 +28336,7 @@ const il = /* @__PURE__ */ Si(al), I = {
|
|
|
28327
28336
|
lastMessage: _,
|
|
28328
28337
|
// 最後接收到的訊息
|
|
28329
28338
|
// lastJsonMessage, // 最後接收到的 JSON 訊息
|
|
28330
|
-
readyState:
|
|
28339
|
+
readyState: m
|
|
28331
28340
|
// WebSocket 連線狀態
|
|
28332
28341
|
// getWebSocket, // 獲取 WebSocket 實例
|
|
28333
28342
|
} = il(e, {
|
|
@@ -28344,18 +28353,18 @@ const il = /* @__PURE__ */ Si(al), I = {
|
|
|
28344
28353
|
return null;
|
|
28345
28354
|
}
|
|
28346
28355
|
}, [_?.data]);
|
|
28347
|
-
return
|
|
28348
|
-
const
|
|
28356
|
+
return he(() => {
|
|
28357
|
+
const r = setInterval(
|
|
28349
28358
|
() => u("ping"),
|
|
28350
28359
|
ll
|
|
28351
28360
|
);
|
|
28352
|
-
return () => clearInterval(
|
|
28353
|
-
}, [u]),
|
|
28361
|
+
return () => clearInterval(r);
|
|
28362
|
+
}, [u]), he(() => {
|
|
28354
28363
|
o.current = n;
|
|
28355
|
-
}, [n]),
|
|
28364
|
+
}, [n]), he(() => {
|
|
28356
28365
|
if (!c) return;
|
|
28357
28366
|
const {
|
|
28358
|
-
onDeposit:
|
|
28367
|
+
onDeposit: r,
|
|
28359
28368
|
onTransCode: i,
|
|
28360
28369
|
onError: g,
|
|
28361
28370
|
onUpdateMember: l,
|
|
@@ -28371,7 +28380,7 @@ const il = /* @__PURE__ */ Si(al), I = {
|
|
|
28371
28380
|
};
|
|
28372
28381
|
switch (N) {
|
|
28373
28382
|
case I.DEPOSIT:
|
|
28374
|
-
|
|
28383
|
+
r?.(D);
|
|
28375
28384
|
break;
|
|
28376
28385
|
case I.TRANS_CODE:
|
|
28377
28386
|
i?.(D);
|
|
@@ -28402,14 +28411,14 @@ const il = /* @__PURE__ */ Si(al), I = {
|
|
|
28402
28411
|
console.warn("Unknown socket type:", N);
|
|
28403
28412
|
break;
|
|
28404
28413
|
}
|
|
28405
|
-
}, [c]),
|
|
28414
|
+
}, [c]), he(() => () => s.current = !0, []), {
|
|
28406
28415
|
sendMessage: u,
|
|
28407
28416
|
sendJsonMessage: U,
|
|
28408
|
-
readyState:
|
|
28417
|
+
readyState: m
|
|
28409
28418
|
// WebSocket 連線狀態
|
|
28410
28419
|
};
|
|
28411
28420
|
}, Qa = () => {
|
|
28412
|
-
const { client: e } =
|
|
28421
|
+
const { client: e } = de(), n = X(async () => {
|
|
28413
28422
|
const { data: s } = await e.get("/carousels");
|
|
28414
28423
|
return s;
|
|
28415
28424
|
}, [e]), d = X(async () => await e.get("/marquees"), [e]);
|
|
@@ -28421,7 +28430,7 @@ const il = /* @__PURE__ */ Si(al), I = {
|
|
|
28421
28430
|
queryFn: async () => await e()
|
|
28422
28431
|
});
|
|
28423
28432
|
}, Cl = () => {
|
|
28424
|
-
const { lng: e } =
|
|
28433
|
+
const { lng: e } = de(), { commonMarqueeApi: n } = Qa(), d = Zi(e);
|
|
28425
28434
|
return oe({
|
|
28426
28435
|
queryKey: ["getMarqueeList"],
|
|
28427
28436
|
queryFn: async () => n(),
|
|
@@ -28431,14 +28440,14 @@ const il = /* @__PURE__ */ Si(al), I = {
|
|
|
28431
28440
|
}
|
|
28432
28441
|
});
|
|
28433
28442
|
}, tl = ({ options: e } = {}) => {
|
|
28434
|
-
const { userLoginApi: n } =
|
|
28443
|
+
const { userLoginApi: n } = ce();
|
|
28435
28444
|
return za({
|
|
28436
28445
|
mutationKey: ["userLogin"],
|
|
28437
28446
|
mutationFn: async (d) => n(d),
|
|
28438
28447
|
...e
|
|
28439
28448
|
});
|
|
28440
28449
|
}, nl = ({ options: e } = {}) => {
|
|
28441
|
-
const { userLogoutApi: n } =
|
|
28450
|
+
const { userLogoutApi: n } = ce();
|
|
28442
28451
|
return za({
|
|
28443
28452
|
mutationKey: ["userLogout"],
|
|
28444
28453
|
mutationFn: async () => n(),
|
|
@@ -28479,7 +28488,7 @@ export {
|
|
|
28479
28488
|
Ai as initMockWindowData,
|
|
28480
28489
|
zi as processGameInfo,
|
|
28481
28490
|
cl as processPlatformData,
|
|
28482
|
-
|
|
28491
|
+
de as useApiContext,
|
|
28483
28492
|
fl as useBalanceGetter,
|
|
28484
28493
|
bl as useClientWebSocket,
|
|
28485
28494
|
pl as useGameInfoContext,
|