@obb871001/api-integration-sdk 1.0.34 → 1.0.36

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.js CHANGED
@@ -1,10 +1,10 @@
1
- import { useQueries as rt, QueryClient as tt, QueryClientProvider as nt } from "@tanstack/react-query";
2
- import ye, { createContext as at, useContext as ut, useCallback as de, useRef as ot, useMemo as Je, useEffect as je } from "react";
1
+ import { useQueries as tt, QueryClient as nt, QueryClientProvider as at } from "@tanstack/react-query";
2
+ import ye, { createContext as ut, useContext as ot, useCallback as de, useRef as ir, useMemo as Je, useEffect as Ce } from "react";
3
3
  import ct from "axios";
4
- import { get as Ce } from "lodash";
4
+ import { get as we } from "lodash";
5
5
  import it from "react-dom";
6
- const wr = at(null), Ar = () => {
7
- const r = ut(wr);
6
+ const Ar = ut(null), Pr = () => {
7
+ const r = ot(Ar);
8
8
  if (!r)
9
9
  throw new Error("useApiContext must be used within ApiProvider");
10
10
  return r;
@@ -13,56 +13,56 @@ function st({
13
13
  baseURL: r,
14
14
  getToken: g,
15
15
  timeoutMs: O = 15e3,
16
- currency: y = "TWD",
16
+ currency: h = "TWD",
17
17
  lng: v = "tw",
18
- onError: h
18
+ onError: _
19
19
  } = {}) {
20
- const E = ct.create({
20
+ const S = ct.create({
21
21
  baseURL: r,
22
22
  timeout: O,
23
23
  headers: { "Content-Type": "application/json" }
24
24
  });
25
- return E.interceptors.request.use(async (_) => {
26
- if (_.headers = _.headers || {}, g) {
25
+ return S.interceptors.request.use(async (d) => {
26
+ if (d.headers = d.headers || {}, g) {
27
27
  const c = await g();
28
- c && (_.headers.Authorization = `Bearer ${c}`);
28
+ c && (d.headers.Authorization = `Bearer ${c}`);
29
29
  }
30
- return _.headers.Currency = y, _.headers["currency-code"] = y, _.headers.lang = v, _;
31
- }), E.interceptors.response.use(
32
- (_) => _.data,
33
- (_) => h ? h(_, { instance: E }) : Promise.reject(_)
34
- ), E;
30
+ return d.headers.Currency = h, d.headers["currency-code"] = h, d.headers.lang = v, d;
31
+ }), S.interceptors.response.use(
32
+ (d) => d.data,
33
+ (d) => _ ? _(d, { instance: S }) : Promise.reject(d)
34
+ ), S;
35
35
  }
36
36
  const lt = () => {
37
- const { client: r } = Ar(), g = de(
38
- async (E) => {
39
- const { mac_address: _ = "", app_version: c = "", anydesk_id: l = "" } = E, { data: o } = await r.post("/cash-register/login", {
40
- mac_address: _,
37
+ const { client: r } = Pr(), g = de(
38
+ async (S) => {
39
+ const { mac_address: d = "", app_version: c = "", anydesk_id: l = "" } = S, { data: u } = await r.post("/cash-register/login", {
40
+ mac_address: d,
41
41
  app_version: c,
42
42
  anydesk_id: l
43
43
  });
44
- return o;
44
+ return u;
45
45
  },
46
46
  [r]
47
- ), O = de(async () => r.get("/member/getMemberInfo"), [r]), y = de(async () => {
48
- const { data: E } = await r.get("/getGameList");
49
- return E;
47
+ ), O = de(async () => r.get("/member/getMemberInfo"), [r]), h = de(async () => {
48
+ const { data: S } = await r.get("/getGameList");
49
+ return S;
50
50
  }, [r]), v = de(async () => {
51
- const { data: E } = await r.get("/getNowCurrencyExchange");
52
- return E;
53
- }, [r]), h = de(async () => {
54
- const { data: E } = await r.get("/getFavoriteGame");
55
- return E;
51
+ const { data: S } = await r.get("/getNowCurrencyExchange");
52
+ return S;
53
+ }, [r]), _ = de(async () => {
54
+ const { data: S } = await r.get("/getFavoriteGame");
55
+ return S;
56
56
  }, [r]);
57
57
  return {
58
58
  machineLoginApi: g,
59
59
  userInfoApi: O,
60
- userGameListApi: y,
61
- userFavoriteGameApi: h,
60
+ userGameListApi: h,
61
+ userFavoriteGameApi: _,
62
62
  userCurrencyExchangeApi: v
63
63
  };
64
64
  }, Nt = () => {
65
- const { getToken: r } = Ar(), { userInfoApi: g } = lt(), O = rt({
65
+ const { getToken: r } = Pr(), { userInfoApi: g } = lt(), O = tt({
66
66
  queries: [
67
67
  {
68
68
  queryKey: ["getMemberInfo"],
@@ -71,15 +71,15 @@ const lt = () => {
71
71
  }
72
72
  ],
73
73
  enabled: !!r
74
- }), { data: y, isFetching: v, error: h } = O[0] || {};
75
- return { data: y, isFetching: v, error: h };
74
+ }), { data: h, isFetching: v, error: _ } = O[0] || {};
75
+ return { data: h, isFetching: v, error: _ };
76
76
  };
77
77
  function ft(r) {
78
78
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
79
79
  }
80
- var Le = {}, F = {}, Ue = {}, ir;
80
+ var Le = {}, F = {}, Ue = {}, sr;
81
81
  function V() {
82
- return ir || (ir = 1, (function(r) {
82
+ return sr || (sr = 1, (function(r) {
83
83
  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;
84
84
  var g = 1, O = 1e3 * g;
85
85
  r.DEFAULT_OPTIONS = {}, r.EMPTY_EVENT_HANDLERS = {}, r.DEFAULT_EVENT_SOURCE_OPTIONS = {
@@ -90,10 +90,10 @@ function V() {
90
90
  timeout: 6e4,
91
91
  interval: 25e3
92
92
  };
93
- var y;
94
- (function(h) {
95
- h[h.UNINSTANTIATED = -1] = "UNINSTANTIATED", h[h.CONNECTING = 0] = "CONNECTING", h[h.OPEN = 1] = "OPEN", h[h.CLOSING = 2] = "CLOSING", h[h.CLOSED = 3] = "CLOSED";
96
- })(y || (r.ReadyState = y = {}));
93
+ var h;
94
+ (function(_) {
95
+ _[_.UNINSTANTIATED = -1] = "UNINSTANTIATED", _[_.CONNECTING = 0] = "CONNECTING", _[_.OPEN = 1] = "OPEN", _[_.CLOSING = 2] = "CLOSING", _[_.CLOSED = 3] = "CLOSED";
96
+ })(h || (r.ReadyState = h = {}));
97
97
  var v = function() {
98
98
  try {
99
99
  return "EventSource" in globalThis;
@@ -104,201 +104,201 @@ function V() {
104
104
  r.isReactNative = typeof navigator < "u" && navigator.product === "ReactNative", r.isEventSourceSupported = !r.isReactNative && v();
105
105
  })(Ue)), Ue;
106
106
  }
107
- var _e = {}, We = {}, sr;
107
+ var _e = {}, We = {}, lr;
108
108
  function Ge() {
109
- return sr || (sr = 1, (function(r) {
109
+ return lr || (lr = 1, (function(r) {
110
110
  Object.defineProperty(r, "__esModule", { value: !0 }), r.resetWebSockets = r.sharedWebSockets = void 0, r.sharedWebSockets = {};
111
111
  var g = function(O) {
112
112
  if (O && r.sharedWebSockets.hasOwnProperty(O))
113
113
  delete r.sharedWebSockets[O];
114
114
  else
115
- for (var y in r.sharedWebSockets)
116
- r.sharedWebSockets.hasOwnProperty(y) && delete r.sharedWebSockets[y];
115
+ for (var h in r.sharedWebSockets)
116
+ r.sharedWebSockets.hasOwnProperty(h) && delete r.sharedWebSockets[h];
117
117
  };
118
118
  r.resetWebSockets = g;
119
119
  })(We)), We;
120
120
  }
121
- var te = {}, B = {}, lr;
121
+ var te = {}, B = {}, fr;
122
122
  function Ve() {
123
- if (lr) return B;
124
- lr = 1, Object.defineProperty(B, "__esModule", { value: !0 }), B.setUpSocketIOPing = B.appendQueryParams = B.parseSocketIOUrl = void 0;
123
+ if (fr) return B;
124
+ fr = 1, Object.defineProperty(B, "__esModule", { value: !0 }), B.setUpSocketIOPing = B.appendQueryParams = B.parseSocketIOUrl = void 0;
125
125
  var r = V(), g = function(v) {
126
126
  if (v) {
127
- var h = /^https|wss/.test(v), E = v.replace(/^(https?|wss?)(:\/\/)?/, ""), _ = E.replace(/\/$/, ""), c = h ? "wss" : "ws";
128
- return "".concat(c, "://").concat(_).concat(r.SOCKET_IO_PATH);
127
+ var _ = /^https|wss/.test(v), S = v.replace(/^(https?|wss?)(:\/\/)?/, ""), d = S.replace(/\/$/, ""), c = _ ? "wss" : "ws";
128
+ return "".concat(c, "://").concat(d).concat(r.SOCKET_IO_PATH);
129
129
  } else if (v === "") {
130
- var h = /^https/.test(window.location.protocol), c = h ? "wss" : "ws", l = window.location.port ? ":".concat(window.location.port) : "";
130
+ var _ = /^https/.test(window.location.protocol), c = _ ? "wss" : "ws", l = window.location.port ? ":".concat(window.location.port) : "";
131
131
  return "".concat(c, "://").concat(window.location.hostname).concat(l).concat(r.SOCKET_IO_PATH);
132
132
  }
133
133
  return v;
134
134
  };
135
135
  B.parseSocketIOUrl = g;
136
- var O = function(v, h) {
137
- h === void 0 && (h = {});
138
- var E = /\?([\w]+=[\w]+)/, _ = E.test(v), c = "".concat(Object.entries(h).reduce(function(l, o) {
139
- var a = o[0], i = o[1];
136
+ var O = function(v, _) {
137
+ _ === void 0 && (_ = {});
138
+ var S = /\?([\w]+=[\w]+)/, d = S.test(v), c = "".concat(Object.entries(_).reduce(function(l, u) {
139
+ var a = u[0], i = u[1];
140
140
  return l + "".concat(a, "=").concat(i, "&");
141
141
  }, "").slice(0, -1));
142
- return "".concat(v).concat(_ ? "&" : "?").concat(c);
142
+ return "".concat(v).concat(d ? "&" : "?").concat(c);
143
143
  };
144
144
  B.appendQueryParams = O;
145
- var y = function(v, h) {
146
- h === void 0 && (h = r.SOCKET_IO_PING_INTERVAL);
147
- var E = function() {
145
+ var h = function(v, _) {
146
+ _ === void 0 && (_ = r.SOCKET_IO_PING_INTERVAL);
147
+ var S = function() {
148
148
  return v(r.SOCKET_IO_PING_CODE);
149
149
  };
150
- return window.setInterval(E, h);
150
+ return window.setInterval(S, _);
151
151
  };
152
- return B.setUpSocketIOPing = y, B;
152
+ return B.setUpSocketIOPing = h, B;
153
153
  }
154
- var we = {}, fr;
155
- function Pr() {
156
- if (fr) return we;
157
- fr = 1, Object.defineProperty(we, "__esModule", { value: !0 }), we.heartbeat = O;
154
+ var Ae = {}, vr;
155
+ function kr() {
156
+ if (vr) return Ae;
157
+ vr = 1, Object.defineProperty(Ae, "__esModule", { value: !0 }), Ae.heartbeat = O;
158
158
  var r = V();
159
- function g(y) {
160
- return Array.isArray(y) ? y.reduce(function(v, h) {
161
- return v.current > h.current ? v : h;
162
- }).current : y.current;
159
+ function g(h) {
160
+ return Array.isArray(h) ? h.reduce(function(v, _) {
161
+ return v.current > _.current ? v : _;
162
+ }).current : h.current;
163
163
  }
164
- function O(y, v, h) {
165
- var E = h || {}, _ = E.interval, c = _ === void 0 ? r.DEFAULT_HEARTBEAT.interval : _, l = E.timeout, o = l === void 0 ? r.DEFAULT_HEARTBEAT.timeout : l, a = E.message, i = a === void 0 ? r.DEFAULT_HEARTBEAT.message : a, t = Math.max(100, c / 10), n = Date.now(), f = setInterval(function() {
166
- var S = Date.now(), u = g(v);
167
- if (u + o <= S)
168
- console.warn("Heartbeat timed out, closing connection, last message received ".concat(S - u, "ms ago, last ping sent ").concat(S - n, "ms ago")), y.close();
169
- else if (u + c <= S && n + c <= S)
164
+ function O(h, v, _) {
165
+ var S = _ || {}, d = S.interval, c = d === void 0 ? r.DEFAULT_HEARTBEAT.interval : d, l = S.timeout, u = l === void 0 ? r.DEFAULT_HEARTBEAT.timeout : l, a = S.message, i = a === void 0 ? r.DEFAULT_HEARTBEAT.message : a, t = Math.max(100, c / 10), n = Date.now(), f = setInterval(function() {
166
+ var E = Date.now(), o = g(v);
167
+ if (o + u <= E)
168
+ console.warn("Heartbeat timed out, closing connection, last message received ".concat(E - o, "ms ago, last ping sent ").concat(E - n, "ms ago")), h.close();
169
+ else if (o + c <= E && n + c <= E)
170
170
  try {
171
- typeof i == "function" ? y.send(i()) : y.send(i), n = S;
172
- } catch (d) {
173
- console.error("Heartbeat failed, closing connection", d instanceof Error ? d.message : d), y.close();
171
+ typeof i == "function" ? h.send(i()) : h.send(i), n = E;
172
+ } catch (y) {
173
+ console.error("Heartbeat failed, closing connection", y instanceof Error ? y.message : y), h.close();
174
174
  }
175
175
  }, t);
176
- return y.addEventListener("close", function() {
176
+ return h.addEventListener("close", function() {
177
177
  clearInterval(f);
178
178
  }), function() {
179
179
  };
180
180
  }
181
- return we;
181
+ return Ae;
182
182
  }
183
- var Ee = {}, Fe = {}, vr;
183
+ var Ee = {}, Fe = {}, dr;
184
184
  function $e() {
185
- return vr || (vr = 1, (function(r) {
185
+ return dr || (dr = 1, (function(r) {
186
186
  Object.defineProperty(r, "__esModule", { value: !0 }), r.resetSubscribers = r.removeSubscriber = r.addSubscriber = r.hasSubscribers = r.getSubscribers = void 0;
187
- var g = {}, O = [], y = function(c) {
187
+ var g = {}, O = [], h = function(c) {
188
188
  return (0, r.hasSubscribers)(c) ? Array.from(g[c]) : O;
189
189
  };
190
- r.getSubscribers = y;
190
+ r.getSubscribers = h;
191
191
  var v = function(c) {
192
192
  var l;
193
193
  return ((l = g[c]) === null || l === void 0 ? void 0 : l.size) > 0;
194
194
  };
195
195
  r.hasSubscribers = v;
196
- var h = function(c, l) {
196
+ var _ = function(c, l) {
197
197
  g[c] = g[c] || /* @__PURE__ */ new Set(), g[c].add(l);
198
198
  };
199
- r.addSubscriber = h;
200
- var E = function(c, l) {
199
+ r.addSubscriber = _;
200
+ var S = function(c, l) {
201
201
  g[c].delete(l);
202
202
  };
203
- r.removeSubscriber = E;
204
- var _ = function(c) {
203
+ r.removeSubscriber = S;
204
+ var d = function(c) {
205
205
  if (c && g.hasOwnProperty(c))
206
206
  delete g[c];
207
207
  else
208
208
  for (var l in g)
209
209
  g.hasOwnProperty(l) && delete g[l];
210
210
  };
211
- r.resetSubscribers = _;
211
+ r.resetSubscribers = d;
212
212
  })(Fe)), Fe;
213
213
  }
214
- var dr;
214
+ var _r;
215
215
  function He() {
216
- if (dr) return Ee;
217
- dr = 1, Object.defineProperty(Ee, "__esModule", { value: !0 }), Ee.assertIsWebSocket = O, Ee.resetGlobalState = y;
216
+ if (_r) return Ee;
217
+ _r = 1, Object.defineProperty(Ee, "__esModule", { value: !0 }), Ee.assertIsWebSocket = O, Ee.resetGlobalState = h;
218
218
  var r = Ge(), g = $e();
219
- function O(v, h) {
220
- if (!h && !(v instanceof WebSocket))
219
+ function O(v, _) {
220
+ if (!_ && !(v instanceof WebSocket))
221
221
  throw new Error("");
222
222
  }
223
- function y(v) {
223
+ function h(v) {
224
224
  (0, g.resetSubscribers)(v), (0, r.resetWebSockets)(v);
225
225
  }
226
226
  return Ee;
227
227
  }
228
- var _r;
228
+ var Er;
229
229
  function vt() {
230
- if (_r) return te;
231
- _r = 1;
230
+ if (Er) return te;
231
+ Er = 1;
232
232
  var r = te && te.__assign || function() {
233
- return r = Object.assign || function(o) {
233
+ return r = Object.assign || function(u) {
234
234
  for (var a, i = 1, t = arguments.length; i < t; i++) {
235
235
  a = arguments[i];
236
- for (var n in a) Object.prototype.hasOwnProperty.call(a, n) && (o[n] = a[n]);
236
+ for (var n in a) Object.prototype.hasOwnProperty.call(a, n) && (u[n] = a[n]);
237
237
  }
238
- return o;
238
+ return u;
239
239
  }, r.apply(this, arguments);
240
240
  };
241
241
  Object.defineProperty(te, "__esModule", { value: !0 }), te.attachListeners = void 0;
242
- var g = Ve(), O = Pr(), y = V(), v = He(), h = function(o, a, i, t) {
243
- o.onmessage = function(n) {
242
+ var g = Ve(), O = kr(), h = V(), v = He(), _ = function(u, a, i, t) {
243
+ u.onmessage = function(n) {
244
244
  var f;
245
245
  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" && ((f = a.current.heartbeat) === null || f === void 0 ? void 0 : f.returnMessage) === n.data || i(n));
246
246
  };
247
- }, E = function(o, a, i, t, n) {
248
- o.onopen = function(f) {
249
- if (a.current.onOpen && a.current.onOpen(f), t.current = 0, i(y.ReadyState.OPEN), a.current.heartbeat && o instanceof WebSocket) {
250
- var S = typeof a.current.heartbeat == "boolean" ? void 0 : a.current.heartbeat;
251
- n.current = Date.now(), (0, O.heartbeat)(o, n, S);
247
+ }, S = function(u, a, i, t, n) {
248
+ u.onopen = function(f) {
249
+ if (a.current.onOpen && a.current.onOpen(f), t.current = 0, i(h.ReadyState.OPEN), a.current.heartbeat && u instanceof WebSocket) {
250
+ var E = typeof a.current.heartbeat == "boolean" ? void 0 : a.current.heartbeat;
251
+ n.current = Date.now(), (0, O.heartbeat)(u, n, E);
252
252
  }
253
253
  };
254
- }, _ = function(o, a, i, t, n) {
255
- if (y.isEventSourceSupported && o instanceof EventSource)
254
+ }, d = function(u, a, i, t, n) {
255
+ if (h.isEventSourceSupported && u instanceof EventSource)
256
256
  return function() {
257
257
  };
258
- (0, v.assertIsWebSocket)(o, a.current.skipAssert);
258
+ (0, v.assertIsWebSocket)(u, a.current.skipAssert);
259
259
  var f;
260
- return o.onclose = function(S) {
261
- var u;
262
- if (a.current.onClose && a.current.onClose(S), i(y.ReadyState.CLOSED), a.current.shouldReconnect && a.current.shouldReconnect(S)) {
263
- var d = (u = a.current.reconnectAttempts) !== null && u !== void 0 ? u : y.DEFAULT_RECONNECT_LIMIT;
264
- if (n.current < d) {
265
- var A = typeof a.current.reconnectInterval == "function" ? a.current.reconnectInterval(n.current) : a.current.reconnectInterval;
260
+ return u.onclose = function(E) {
261
+ var o;
262
+ if (a.current.onClose && a.current.onClose(E), i(h.ReadyState.CLOSED), a.current.shouldReconnect && a.current.shouldReconnect(E)) {
263
+ var y = (o = a.current.reconnectAttempts) !== null && o !== void 0 ? o : h.DEFAULT_RECONNECT_LIMIT;
264
+ if (n.current < y) {
265
+ var m = typeof a.current.reconnectInterval == "function" ? a.current.reconnectInterval(n.current) : a.current.reconnectInterval;
266
266
  f = window.setTimeout(function() {
267
267
  n.current++, t();
268
- }, A ?? y.DEFAULT_RECONNECT_INTERVAL_MS);
268
+ }, m ?? h.DEFAULT_RECONNECT_INTERVAL_MS);
269
269
  } else
270
- a.current.onReconnectStop && a.current.onReconnectStop(d), console.warn("Max reconnect attempts of ".concat(d, " exceeded"));
270
+ a.current.onReconnectStop && a.current.onReconnectStop(y), console.warn("Max reconnect attempts of ".concat(y, " exceeded"));
271
271
  }
272
272
  }, function() {
273
273
  return f && window.clearTimeout(f);
274
274
  };
275
- }, c = function(o, a, i, t, n) {
275
+ }, c = function(u, a, i, t, n) {
276
276
  var f;
277
- return o.onerror = function(S) {
278
- var u;
279
- if (a.current.onError && a.current.onError(S), y.isEventSourceSupported && o instanceof EventSource && (a.current.onClose && a.current.onClose(r(r({}, S), { code: 1006, reason: "An error occurred with the EventSource: ".concat(S), wasClean: !1 })), i(y.ReadyState.CLOSED), o.close()), a.current.retryOnError)
280
- if (n.current < ((u = a.current.reconnectAttempts) !== null && u !== void 0 ? u : y.DEFAULT_RECONNECT_LIMIT)) {
281
- var d = typeof a.current.reconnectInterval == "function" ? a.current.reconnectInterval(n.current) : a.current.reconnectInterval;
277
+ return u.onerror = function(E) {
278
+ var o;
279
+ if (a.current.onError && a.current.onError(E), h.isEventSourceSupported && u instanceof EventSource && (a.current.onClose && a.current.onClose(r(r({}, E), { code: 1006, reason: "An error occurred with the EventSource: ".concat(E), wasClean: !1 })), i(h.ReadyState.CLOSED), u.close()), a.current.retryOnError)
280
+ if (n.current < ((o = a.current.reconnectAttempts) !== null && o !== void 0 ? o : h.DEFAULT_RECONNECT_LIMIT)) {
281
+ var y = typeof a.current.reconnectInterval == "function" ? a.current.reconnectInterval(n.current) : a.current.reconnectInterval;
282
282
  f = window.setTimeout(function() {
283
283
  n.current++, t();
284
- }, d ?? y.DEFAULT_RECONNECT_INTERVAL_MS);
284
+ }, y ?? h.DEFAULT_RECONNECT_INTERVAL_MS);
285
285
  } else
286
286
  a.current.onReconnectStop && a.current.onReconnectStop(a.current.reconnectAttempts), console.warn("Max reconnect attempts of ".concat(a.current.reconnectAttempts, " exceeded"));
287
287
  }, function() {
288
288
  return f && window.clearTimeout(f);
289
289
  };
290
- }, l = function(o, a, i, t, n, f, S) {
291
- var u = a.setLastMessage, d = a.setReadyState, A, M, T;
292
- return i.current.fromSocketIO && (A = (0, g.setUpSocketIOPing)(S)), h(o, i, u, f), E(o, i, d, n, f), M = _(o, i, d, t, n), T = c(o, i, d, t, n), function() {
293
- d(y.ReadyState.CLOSING), M(), T(), o.close(), A && clearInterval(A);
290
+ }, l = function(u, a, i, t, n, f, E) {
291
+ var o = a.setLastMessage, y = a.setReadyState, m, M, T;
292
+ return i.current.fromSocketIO && (m = (0, g.setUpSocketIOPing)(E)), _(u, i, o, f), S(u, i, y, n, f), M = d(u, i, y, t, n), T = c(u, i, y, t, n), function() {
293
+ y(h.ReadyState.CLOSING), M(), T(), u.close(), m && clearInterval(m);
294
294
  };
295
295
  };
296
296
  return te.attachListeners = l, te;
297
297
  }
298
- var ne = {}, Er;
298
+ var ne = {}, Sr;
299
299
  function dt() {
300
- if (Er) return ne;
301
- Er = 1;
300
+ if (Sr) return ne;
301
+ Sr = 1;
302
302
  var r = ne && ne.__assign || function() {
303
303
  return r = Object.assign || function(a) {
304
304
  for (var i, t = 1, n = arguments.length; t < n; t++) {
@@ -309,200 +309,200 @@ function dt() {
309
309
  }, r.apply(this, arguments);
310
310
  };
311
311
  Object.defineProperty(ne, "__esModule", { value: !0 }), ne.attachSharedListeners = void 0;
312
- var g = Ge(), O = V(), y = $e(), v = Ve(), h = Pr(), E = function(a, i, t) {
312
+ var g = Ge(), O = V(), h = $e(), v = Ve(), _ = kr(), S = function(a, i, t) {
313
313
  a.onmessage = function(n) {
314
- (0, y.getSubscribers)(i).forEach(function(f) {
315
- var S;
316
- f.optionsRef.current.onMessage && f.optionsRef.current.onMessage(n), typeof ((S = f?.lastMessageTime) === null || S === void 0 ? void 0 : S.current) == "number" && (f.lastMessageTime.current = Date.now()), !(typeof f.optionsRef.current.filter == "function" && f.optionsRef.current.filter(n) !== !0) && (t && typeof t != "boolean" && t?.returnMessage === n.data || f.setLastMessage(n));
314
+ (0, h.getSubscribers)(i).forEach(function(f) {
315
+ var E;
316
+ f.optionsRef.current.onMessage && f.optionsRef.current.onMessage(n), typeof ((E = f?.lastMessageTime) === null || E === void 0 ? void 0 : E.current) == "number" && (f.lastMessageTime.current = Date.now()), !(typeof f.optionsRef.current.filter == "function" && f.optionsRef.current.filter(n) !== !0) && (t && typeof t != "boolean" && t?.returnMessage === n.data || f.setLastMessage(n));
317
317
  });
318
318
  };
319
- }, _ = function(a, i, t) {
319
+ }, d = function(a, i, t) {
320
320
  a.onopen = function(n) {
321
- var f = (0, y.getSubscribers)(i);
322
- f.forEach(function(S) {
323
- S.reconnectCount.current = 0, S.optionsRef.current.onOpen && S.optionsRef.current.onOpen(n), S.setReadyState(O.ReadyState.OPEN), t && a instanceof WebSocket && (S.lastMessageTime.current = Date.now());
324
- }), t && a instanceof WebSocket && (0, h.heartbeat)(a, f.map(function(S) {
325
- return S.lastMessageTime;
321
+ var f = (0, h.getSubscribers)(i);
322
+ f.forEach(function(E) {
323
+ E.reconnectCount.current = 0, E.optionsRef.current.onOpen && E.optionsRef.current.onOpen(n), E.setReadyState(O.ReadyState.OPEN), t && a instanceof WebSocket && (E.lastMessageTime.current = Date.now());
324
+ }), t && a instanceof WebSocket && (0, _.heartbeat)(a, f.map(function(E) {
325
+ return E.lastMessageTime;
326
326
  }), typeof t == "boolean" ? void 0 : t);
327
327
  };
328
328
  }, c = function(a, i) {
329
329
  a instanceof WebSocket && (a.onclose = function(t) {
330
- (0, y.getSubscribers)(i).forEach(function(n) {
330
+ (0, h.getSubscribers)(i).forEach(function(n) {
331
331
  n.optionsRef.current.onClose && n.optionsRef.current.onClose(t), n.setReadyState(O.ReadyState.CLOSED);
332
- }), delete g.sharedWebSockets[i], (0, y.getSubscribers)(i).forEach(function(n) {
332
+ }), delete g.sharedWebSockets[i], (0, h.getSubscribers)(i).forEach(function(n) {
333
333
  var f;
334
334
  if (n.optionsRef.current.shouldReconnect && n.optionsRef.current.shouldReconnect(t)) {
335
- var S = (f = n.optionsRef.current.reconnectAttempts) !== null && f !== void 0 ? f : O.DEFAULT_RECONNECT_LIMIT;
336
- if (n.reconnectCount.current < S) {
337
- var u = typeof n.optionsRef.current.reconnectInterval == "function" ? n.optionsRef.current.reconnectInterval(n.reconnectCount.current) : n.optionsRef.current.reconnectInterval;
335
+ var E = (f = n.optionsRef.current.reconnectAttempts) !== null && f !== void 0 ? f : O.DEFAULT_RECONNECT_LIMIT;
336
+ if (n.reconnectCount.current < E) {
337
+ var o = typeof n.optionsRef.current.reconnectInterval == "function" ? n.optionsRef.current.reconnectInterval(n.reconnectCount.current) : n.optionsRef.current.reconnectInterval;
338
338
  setTimeout(function() {
339
339
  n.reconnectCount.current++, n.reconnect.current();
340
- }, u ?? O.DEFAULT_RECONNECT_INTERVAL_MS);
340
+ }, o ?? O.DEFAULT_RECONNECT_INTERVAL_MS);
341
341
  } else
342
- n.optionsRef.current.onReconnectStop && n.optionsRef.current.onReconnectStop(n.optionsRef.current.reconnectAttempts), console.warn("Max reconnect attempts of ".concat(S, " exceeded"));
342
+ n.optionsRef.current.onReconnectStop && n.optionsRef.current.onReconnectStop(n.optionsRef.current.reconnectAttempts), console.warn("Max reconnect attempts of ".concat(E, " exceeded"));
343
343
  }
344
344
  });
345
345
  });
346
346
  }, l = function(a, i) {
347
347
  a.onerror = function(t) {
348
- (0, y.getSubscribers)(i).forEach(function(n) {
348
+ (0, h.getSubscribers)(i).forEach(function(n) {
349
349
  n.optionsRef.current.onError && n.optionsRef.current.onError(t), O.isEventSourceSupported && a instanceof EventSource && (n.optionsRef.current.onClose && n.optionsRef.current.onClose(r(r({}, t), { code: 1006, reason: "An error occurred with the EventSource: ".concat(t), wasClean: !1 })), n.setReadyState(O.ReadyState.CLOSED));
350
350
  }), O.isEventSourceSupported && a instanceof EventSource && a.close();
351
351
  };
352
- }, o = function(a, i, t, n) {
352
+ }, u = function(a, i, t, n) {
353
353
  var f;
354
- return t.current.fromSocketIO && (f = (0, v.setUpSocketIOPing)(n)), E(a, i, t.current.heartbeat), c(a, i), _(a, i, t.current.heartbeat), l(a, i), function() {
354
+ return t.current.fromSocketIO && (f = (0, v.setUpSocketIOPing)(n)), S(a, i, t.current.heartbeat), c(a, i), d(a, i, t.current.heartbeat), l(a, i), function() {
355
355
  f && clearInterval(f);
356
356
  };
357
357
  };
358
- return ne.attachSharedListeners = o, ne;
358
+ return ne.attachSharedListeners = u, ne;
359
359
  }
360
- var Sr;
360
+ var hr;
361
361
  function _t() {
362
- if (Sr) return _e;
363
- Sr = 1, Object.defineProperty(_e, "__esModule", { value: !0 }), _e.createOrJoinSocket = void 0;
364
- var r = Ge(), g = V(), O = vt(), y = dt(), v = $e(), h = function(_, c, l, o, a) {
362
+ if (hr) return _e;
363
+ hr = 1, Object.defineProperty(_e, "__esModule", { value: !0 }), _e.createOrJoinSocket = void 0;
364
+ var r = Ge(), g = V(), O = vt(), h = dt(), v = $e(), _ = function(d, c, l, u, a) {
365
365
  return function() {
366
- if ((0, v.removeSubscriber)(_, c), !(0, v.hasSubscribers)(_)) {
366
+ if ((0, v.removeSubscriber)(d, c), !(0, v.hasSubscribers)(d)) {
367
367
  try {
368
- var i = r.sharedWebSockets[_];
368
+ var i = r.sharedWebSockets[d];
369
369
  i instanceof WebSocket && (i.onclose = function(t) {
370
- l.current.onClose && l.current.onClose(t), o(g.ReadyState.CLOSED);
370
+ l.current.onClose && l.current.onClose(t), u(g.ReadyState.CLOSED);
371
371
  }), i.close();
372
372
  } catch {
373
373
  }
374
- a && a(), delete r.sharedWebSockets[_];
374
+ a && a(), delete r.sharedWebSockets[d];
375
375
  }
376
376
  };
377
- }, E = function(_, c, l, o, a, i, t, n, f) {
378
- if (!g.isEventSourceSupported && o.current.eventSourceOptions)
377
+ }, S = function(d, c, l, u, a, i, t, n, f) {
378
+ if (!g.isEventSourceSupported && u.current.eventSourceOptions)
379
379
  throw g.isReactNative ? new Error("EventSource is not supported in ReactNative") : new Error("EventSource is not supported");
380
- if (o.current.share) {
381
- var S = null;
382
- r.sharedWebSockets[c] === void 0 ? (r.sharedWebSockets[c] = o.current.eventSourceOptions ? new EventSource(c, o.current.eventSourceOptions) : new WebSocket(c, o.current.protocols), _.current = r.sharedWebSockets[c], l(g.ReadyState.CONNECTING), S = (0, y.attachSharedListeners)(r.sharedWebSockets[c], c, o, f)) : (_.current = r.sharedWebSockets[c], l(r.sharedWebSockets[c].readyState));
383
- var u = {
380
+ if (u.current.share) {
381
+ var E = null;
382
+ r.sharedWebSockets[c] === void 0 ? (r.sharedWebSockets[c] = u.current.eventSourceOptions ? new EventSource(c, u.current.eventSourceOptions) : new WebSocket(c, u.current.protocols), d.current = r.sharedWebSockets[c], l(g.ReadyState.CONNECTING), E = (0, h.attachSharedListeners)(r.sharedWebSockets[c], c, u, f)) : (d.current = r.sharedWebSockets[c], l(r.sharedWebSockets[c].readyState));
383
+ var o = {
384
384
  setLastMessage: a,
385
385
  setReadyState: l,
386
- optionsRef: o,
386
+ optionsRef: u,
387
387
  reconnectCount: t,
388
388
  lastMessageTime: n,
389
389
  reconnect: i
390
390
  };
391
- return (0, v.addSubscriber)(c, u), h(c, u, o, l, S);
391
+ return (0, v.addSubscriber)(c, o), _(c, o, u, l, E);
392
392
  } else {
393
- if (_.current = o.current.eventSourceOptions ? new EventSource(c, o.current.eventSourceOptions) : new WebSocket(c, o.current.protocols), l(g.ReadyState.CONNECTING), !_.current)
393
+ if (d.current = u.current.eventSourceOptions ? new EventSource(c, u.current.eventSourceOptions) : new WebSocket(c, u.current.protocols), l(g.ReadyState.CONNECTING), !d.current)
394
394
  throw new Error("WebSocket failed to be created");
395
- return (0, O.attachListeners)(_.current, {
395
+ return (0, O.attachListeners)(d.current, {
396
396
  setLastMessage: a,
397
397
  setReadyState: l
398
- }, o, i.current, t, n, f);
398
+ }, u, i.current, t, n, f);
399
399
  }
400
400
  };
401
- return _e.createOrJoinSocket = E, _e;
401
+ return _e.createOrJoinSocket = S, _e;
402
402
  }
403
- var K = {}, hr;
403
+ var K = {}, yr;
404
404
  function Et() {
405
- return hr || (hr = 1, (function(r) {
406
- var g = K && K.__awaiter || function(c, l, o, a) {
405
+ return yr || (yr = 1, (function(r) {
406
+ var g = K && K.__awaiter || function(c, l, u, a) {
407
407
  function i(t) {
408
- return t instanceof o ? t : new o(function(n) {
408
+ return t instanceof u ? t : new u(function(n) {
409
409
  n(t);
410
410
  });
411
411
  }
412
- return new (o || (o = Promise))(function(t, n) {
413
- function f(d) {
412
+ return new (u || (u = Promise))(function(t, n) {
413
+ function f(y) {
414
414
  try {
415
- u(a.next(d));
416
- } catch (A) {
417
- n(A);
415
+ o(a.next(y));
416
+ } catch (m) {
417
+ n(m);
418
418
  }
419
419
  }
420
- function S(d) {
420
+ function E(y) {
421
421
  try {
422
- u(a.throw(d));
423
- } catch (A) {
424
- n(A);
422
+ o(a.throw(y));
423
+ } catch (m) {
424
+ n(m);
425
425
  }
426
426
  }
427
- function u(d) {
428
- d.done ? t(d.value) : i(d.value).then(f, S);
427
+ function o(y) {
428
+ y.done ? t(y.value) : i(y.value).then(f, E);
429
429
  }
430
- u((a = a.apply(c, l || [])).next());
430
+ o((a = a.apply(c, l || [])).next());
431
431
  });
432
432
  }, O = K && K.__generator || function(c, l) {
433
- var o = { label: 0, sent: function() {
433
+ var u = { label: 0, sent: function() {
434
434
  if (t[0] & 1) throw t[1];
435
435
  return t[1];
436
436
  }, trys: [], ops: [] }, a, i, t, n = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
437
437
  return n.next = f(0), n.throw = f(1), n.return = f(2), typeof Symbol == "function" && (n[Symbol.iterator] = function() {
438
438
  return this;
439
439
  }), n;
440
- function f(u) {
441
- return function(d) {
442
- return S([u, d]);
440
+ function f(o) {
441
+ return function(y) {
442
+ return E([o, y]);
443
443
  };
444
444
  }
445
- function S(u) {
445
+ function E(o) {
446
446
  if (a) throw new TypeError("Generator is already executing.");
447
- for (; n && (n = 0, u[0] && (o = 0)), o; ) try {
448
- 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;
449
- switch (i = 0, t && (u = [u[0] & 2, t.value]), u[0]) {
447
+ for (; n && (n = 0, o[0] && (u = 0)), u; ) try {
448
+ if (a = 1, i && (t = o[0] & 2 ? i.return : o[0] ? i.throw || ((t = i.return) && t.call(i), 0) : i.next) && !(t = t.call(i, o[1])).done) return t;
449
+ switch (i = 0, t && (o = [o[0] & 2, t.value]), o[0]) {
450
450
  case 0:
451
451
  case 1:
452
- t = u;
452
+ t = o;
453
453
  break;
454
454
  case 4:
455
- return o.label++, { value: u[1], done: !1 };
455
+ return u.label++, { value: o[1], done: !1 };
456
456
  case 5:
457
- o.label++, i = u[1], u = [0];
457
+ u.label++, i = o[1], o = [0];
458
458
  continue;
459
459
  case 7:
460
- u = o.ops.pop(), o.trys.pop();
460
+ o = u.ops.pop(), u.trys.pop();
461
461
  continue;
462
462
  default:
463
- if (t = o.trys, !(t = t.length > 0 && t[t.length - 1]) && (u[0] === 6 || u[0] === 2)) {
464
- o = 0;
463
+ if (t = u.trys, !(t = t.length > 0 && t[t.length - 1]) && (o[0] === 6 || o[0] === 2)) {
464
+ u = 0;
465
465
  continue;
466
466
  }
467
- if (u[0] === 3 && (!t || u[1] > t[0] && u[1] < t[3])) {
468
- o.label = u[1];
467
+ if (o[0] === 3 && (!t || o[1] > t[0] && o[1] < t[3])) {
468
+ u.label = o[1];
469
469
  break;
470
470
  }
471
- if (u[0] === 6 && o.label < t[1]) {
472
- o.label = t[1], t = u;
471
+ if (o[0] === 6 && u.label < t[1]) {
472
+ u.label = t[1], t = o;
473
473
  break;
474
474
  }
475
- if (t && o.label < t[2]) {
476
- o.label = t[2], o.ops.push(u);
475
+ if (t && u.label < t[2]) {
476
+ u.label = t[2], u.ops.push(o);
477
477
  break;
478
478
  }
479
- t[2] && o.ops.pop(), o.trys.pop();
479
+ t[2] && u.ops.pop(), u.trys.pop();
480
480
  continue;
481
481
  }
482
- u = l.call(c, o);
483
- } catch (d) {
484
- u = [6, d], i = 0;
482
+ o = l.call(c, u);
483
+ } catch (y) {
484
+ o = [6, y], i = 0;
485
485
  } finally {
486
486
  a = t = 0;
487
487
  }
488
- if (u[0] & 5) throw u[1];
489
- return { value: u[0] ? u[1] : void 0, done: !0 };
488
+ if (o[0] & 5) throw o[1];
489
+ return { value: o[0] ? o[1] : void 0, done: !0 };
490
490
  }
491
- }, y = K && K.__spreadArray || function(c, l, o) {
492
- if (o || arguments.length === 2) for (var a = 0, i = l.length, t; a < i; a++)
491
+ }, h = K && K.__spreadArray || function(c, l, u) {
492
+ if (u || arguments.length === 2) for (var a = 0, i = l.length, t; a < i; a++)
493
493
  (t || !(a in l)) && (t || (t = Array.prototype.slice.call(l, 0, a)), t[a] = l[a]);
494
494
  return c.concat(t || Array.prototype.slice.call(l));
495
495
  };
496
496
  Object.defineProperty(r, "__esModule", { value: !0 }), r.getUrl = void 0;
497
- var v = Ve(), h = V(), E = function(c) {
497
+ var v = Ve(), _ = V(), S = function(c) {
498
498
  return new Promise(function(l) {
499
499
  return window.setTimeout(l, c);
500
500
  });
501
- }, _ = function(c, l) {
502
- for (var o = [], a = 2; a < arguments.length; a++)
503
- o[a - 2] = arguments[a];
504
- return g(void 0, y([c, l], o, !0), void 0, function(i, t, n) {
505
- var f, S, u, d, A, M, T, w;
501
+ }, d = function(c, l) {
502
+ for (var u = [], a = 2; a < arguments.length; a++)
503
+ u[a - 2] = arguments[a];
504
+ return g(void 0, h([c, l], u, !0), void 0, function(i, t, n) {
505
+ var f, E, o, y, m, M, T, A;
506
506
  return n === void 0 && (n = 0), O(this, function(k) {
507
507
  switch (k.label) {
508
508
  case 0:
@@ -513,11 +513,11 @@ function Et() {
513
513
  case 2:
514
514
  return f = k.sent(), [3, 9];
515
515
  case 3:
516
- return k.sent(), t.current.retryOnError ? (S = (M = t.current.reconnectAttempts) !== null && M !== void 0 ? M : h.DEFAULT_RECONNECT_LIMIT, n < S ? (u = typeof t.current.reconnectInterval == "function" ? t.current.reconnectInterval(n) : t.current.reconnectInterval, [4, E(u ?? h.DEFAULT_RECONNECT_INTERVAL_MS)]) : [3, 5]) : [3, 7];
516
+ return k.sent(), t.current.retryOnError ? (E = (M = t.current.reconnectAttempts) !== null && M !== void 0 ? M : _.DEFAULT_RECONNECT_LIMIT, n < E ? (o = typeof t.current.reconnectInterval == "function" ? t.current.reconnectInterval(n) : t.current.reconnectInterval, [4, S(o ?? _.DEFAULT_RECONNECT_INTERVAL_MS)]) : [3, 5]) : [3, 7];
517
517
  case 4:
518
518
  return k.sent(), [2, (0, r.getUrl)(i, t, n + 1)];
519
519
  case 5:
520
- return (w = (T = t.current).onReconnectStop) === null || w === void 0 || w.call(T, n), [2, null];
520
+ return (A = (T = t.current).onReconnectStop) === null || A === void 0 || A.call(T, n), [2, null];
521
521
  case 6:
522
522
  return [3, 8];
523
523
  case 7:
@@ -529,158 +529,158 @@ function Et() {
529
529
  case 10:
530
530
  f = i, k.label = 11;
531
531
  case 11:
532
- return d = t.current.fromSocketIO ? (0, v.parseSocketIOUrl)(f) : f, A = t.current.queryParams ? (0, v.appendQueryParams)(d, t.current.queryParams) : d, [2, A];
532
+ return y = t.current.fromSocketIO ? (0, v.parseSocketIOUrl)(f) : f, m = t.current.queryParams ? (0, v.appendQueryParams)(y, t.current.queryParams) : y, [2, m];
533
533
  }
534
534
  });
535
535
  });
536
536
  };
537
- r.getUrl = _;
537
+ r.getUrl = d;
538
538
  })(K)), K;
539
539
  }
540
- var qe = {}, yr;
540
+ var qe = {}, br;
541
541
  function St() {
542
- return yr || (yr = 1, (function(r) {
542
+ return br || (br = 1, (function(r) {
543
543
  Object.defineProperty(r, "__esModule", { value: !0 }), r.websocketWrapper = void 0;
544
- var g = function(O, y) {
544
+ var g = function(O, h) {
545
545
  return new Proxy(O, {
546
- get: function(v, h) {
547
- var E = v[h];
548
- return h === "reconnect" ? y : typeof E == "function" ? (console.error("Calling methods directly on the websocket is not supported at this moment. You must use the methods returned by useWebSocket."), function() {
549
- }) : E;
546
+ get: function(v, _) {
547
+ var S = v[_];
548
+ return _ === "reconnect" ? h : typeof S == "function" ? (console.error("Calling methods directly on the websocket is not supported at this moment. You must use the methods returned by useWebSocket."), function() {
549
+ }) : S;
550
550
  },
551
- set: function(v, h, E) {
552
- return /^on/.test(h) ? (console.warn("The websocket's event handlers should be defined through the options object passed into useWebSocket."), !1) : (v[h] = E, !0);
551
+ set: function(v, _, S) {
552
+ return /^on/.test(_) ? (console.warn("The websocket's event handlers should be defined through the options object passed into useWebSocket."), !1) : (v[_] = S, !0);
553
553
  }
554
554
  });
555
555
  };
556
556
  r.websocketWrapper = g, r.default = r.websocketWrapper;
557
557
  })(qe)), qe;
558
558
  }
559
- var br;
559
+ var gr;
560
560
  function Ye() {
561
- if (br) return F;
562
- br = 1;
561
+ if (gr) return F;
562
+ gr = 1;
563
563
  var r = F && F.__assign || function() {
564
564
  return r = Object.assign || function(i) {
565
565
  for (var t, n = 1, f = arguments.length; n < f; n++) {
566
566
  t = arguments[n];
567
- for (var S in t) Object.prototype.hasOwnProperty.call(t, S) && (i[S] = t[S]);
567
+ for (var E in t) Object.prototype.hasOwnProperty.call(t, E) && (i[E] = t[E]);
568
568
  }
569
569
  return i;
570
570
  }, r.apply(this, arguments);
571
571
  }, g = F && F.__awaiter || function(i, t, n, f) {
572
- function S(u) {
573
- return u instanceof n ? u : new n(function(d) {
574
- d(u);
572
+ function E(o) {
573
+ return o instanceof n ? o : new n(function(y) {
574
+ y(o);
575
575
  });
576
576
  }
577
- return new (n || (n = Promise))(function(u, d) {
578
- function A(w) {
577
+ return new (n || (n = Promise))(function(o, y) {
578
+ function m(A) {
579
579
  try {
580
- T(f.next(w));
580
+ T(f.next(A));
581
581
  } catch (k) {
582
- d(k);
582
+ y(k);
583
583
  }
584
584
  }
585
- function M(w) {
585
+ function M(A) {
586
586
  try {
587
- T(f.throw(w));
587
+ T(f.throw(A));
588
588
  } catch (k) {
589
- d(k);
589
+ y(k);
590
590
  }
591
591
  }
592
- function T(w) {
593
- w.done ? u(w.value) : S(w.value).then(A, M);
592
+ function T(A) {
593
+ A.done ? o(A.value) : E(A.value).then(m, M);
594
594
  }
595
595
  T((f = f.apply(i, t || [])).next());
596
596
  });
597
597
  }, O = F && F.__generator || function(i, t) {
598
598
  var n = { label: 0, sent: function() {
599
- if (u[0] & 1) throw u[1];
600
- return u[1];
601
- }, trys: [], ops: [] }, f, S, u, d = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
602
- return d.next = A(0), d.throw = A(1), d.return = A(2), typeof Symbol == "function" && (d[Symbol.iterator] = function() {
599
+ if (o[0] & 1) throw o[1];
600
+ return o[1];
601
+ }, trys: [], ops: [] }, f, E, o, y = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
602
+ return y.next = m(0), y.throw = m(1), y.return = m(2), typeof Symbol == "function" && (y[Symbol.iterator] = function() {
603
603
  return this;
604
- }), d;
605
- function A(T) {
606
- return function(w) {
607
- return M([T, w]);
604
+ }), y;
605
+ function m(T) {
606
+ return function(A) {
607
+ return M([T, A]);
608
608
  };
609
609
  }
610
610
  function M(T) {
611
611
  if (f) throw new TypeError("Generator is already executing.");
612
- for (; d && (d = 0, T[0] && (n = 0)), n; ) try {
613
- if (f = 1, S && (u = T[0] & 2 ? S.return : T[0] ? S.throw || ((u = S.return) && u.call(S), 0) : S.next) && !(u = u.call(S, T[1])).done) return u;
614
- switch (S = 0, u && (T = [T[0] & 2, u.value]), T[0]) {
612
+ for (; y && (y = 0, T[0] && (n = 0)), n; ) try {
613
+ if (f = 1, E && (o = T[0] & 2 ? E.return : T[0] ? E.throw || ((o = E.return) && o.call(E), 0) : E.next) && !(o = o.call(E, T[1])).done) return o;
614
+ switch (E = 0, o && (T = [T[0] & 2, o.value]), T[0]) {
615
615
  case 0:
616
616
  case 1:
617
- u = T;
617
+ o = T;
618
618
  break;
619
619
  case 4:
620
620
  return n.label++, { value: T[1], done: !1 };
621
621
  case 5:
622
- n.label++, S = T[1], T = [0];
622
+ n.label++, E = T[1], T = [0];
623
623
  continue;
624
624
  case 7:
625
625
  T = n.ops.pop(), n.trys.pop();
626
626
  continue;
627
627
  default:
628
- if (u = n.trys, !(u = u.length > 0 && u[u.length - 1]) && (T[0] === 6 || T[0] === 2)) {
628
+ if (o = n.trys, !(o = o.length > 0 && o[o.length - 1]) && (T[0] === 6 || T[0] === 2)) {
629
629
  n = 0;
630
630
  continue;
631
631
  }
632
- if (T[0] === 3 && (!u || T[1] > u[0] && T[1] < u[3])) {
632
+ if (T[0] === 3 && (!o || T[1] > o[0] && T[1] < o[3])) {
633
633
  n.label = T[1];
634
634
  break;
635
635
  }
636
- if (T[0] === 6 && n.label < u[1]) {
637
- n.label = u[1], u = T;
636
+ if (T[0] === 6 && n.label < o[1]) {
637
+ n.label = o[1], o = T;
638
638
  break;
639
639
  }
640
- if (u && n.label < u[2]) {
641
- n.label = u[2], n.ops.push(T);
640
+ if (o && n.label < o[2]) {
641
+ n.label = o[2], n.ops.push(T);
642
642
  break;
643
643
  }
644
- u[2] && n.ops.pop(), n.trys.pop();
644
+ o[2] && n.ops.pop(), n.trys.pop();
645
645
  continue;
646
646
  }
647
647
  T = t.call(i, n);
648
- } catch (w) {
649
- T = [6, w], S = 0;
648
+ } catch (A) {
649
+ T = [6, A], E = 0;
650
650
  } finally {
651
- f = u = 0;
651
+ f = o = 0;
652
652
  }
653
653
  if (T[0] & 5) throw T[1];
654
654
  return { value: T[0] ? T[1] : void 0, done: !0 };
655
655
  }
656
- }, y = F && F.__importDefault || function(i) {
656
+ }, h = F && F.__importDefault || function(i) {
657
657
  return i && i.__esModule ? i : { default: i };
658
658
  };
659
659
  Object.defineProperty(F, "__esModule", { value: !0 }), F.useWebSocket = void 0;
660
- var v = ye, h = it, E = V(), _ = _t(), c = Et(), l = y(St()), o = He(), a = function(i, t, n) {
661
- t === void 0 && (t = E.DEFAULT_OPTIONS), n === void 0 && (n = !0);
662
- var f = (0, v.useState)(null), S = f[0], u = f[1], d = (0, v.useState)({}), A = d[0], M = d[1], T = (0, v.useMemo)(function() {
663
- if (!t.disableJson && S)
660
+ var v = ye, _ = it, S = V(), d = _t(), c = Et(), l = h(St()), u = He(), a = function(i, t, n) {
661
+ t === void 0 && (t = S.DEFAULT_OPTIONS), n === void 0 && (n = !0);
662
+ var f = (0, v.useState)(null), E = f[0], o = f[1], y = (0, v.useState)({}), m = y[0], M = y[1], T = (0, v.useMemo)(function() {
663
+ if (!t.disableJson && E)
664
664
  try {
665
- return JSON.parse(S.data);
665
+ return JSON.parse(E.data);
666
666
  } catch {
667
- return E.UNPARSABLE_JSON_OBJECT;
667
+ return S.UNPARSABLE_JSON_OBJECT;
668
668
  }
669
669
  return null;
670
- }, [S, t.disableJson]), w = (0, v.useRef)(null), k = (0, v.useRef)(null), se = (0, v.useRef)(function() {
671
- }), le = (0, v.useRef)(0), Pe = (0, v.useRef)(Date.now()), be = (0, v.useRef)([]), G = (0, v.useRef)(null), j = (0, v.useRef)(t);
670
+ }, [E, t.disableJson]), A = (0, v.useRef)(null), k = (0, v.useRef)(null), se = (0, v.useRef)(function() {
671
+ }), le = (0, v.useRef)(0), ke = (0, v.useRef)(Date.now()), be = (0, v.useRef)([]), G = (0, v.useRef)(null), j = (0, v.useRef)(t);
672
672
  j.current = t;
673
- var J = w.current && A[w.current] !== void 0 ? A[w.current] : i !== null && n === !0 ? E.ReadyState.CONNECTING : E.ReadyState.UNINSTANTIATED, X = t.queryParams ? JSON.stringify(t.queryParams) : null, $ = (0, v.useCallback)(function(D, L) {
673
+ var J = A.current && m[A.current] !== void 0 ? m[A.current] : i !== null && n === !0 ? S.ReadyState.CONNECTING : S.ReadyState.UNINSTANTIATED, X = t.queryParams ? JSON.stringify(t.queryParams) : null, $ = (0, v.useCallback)(function(D, L) {
674
674
  var H;
675
- if (L === void 0 && (L = !0), E.isEventSourceSupported && k.current instanceof EventSource) {
675
+ if (L === void 0 && (L = !0), S.isEventSourceSupported && k.current instanceof EventSource) {
676
676
  console.warn("Unable to send a message from an eventSource");
677
677
  return;
678
678
  }
679
- ((H = k.current) === null || H === void 0 ? void 0 : H.readyState) === E.ReadyState.OPEN ? ((0, o.assertIsWebSocket)(k.current, j.current.skipAssert), k.current.send(D)) : L && be.current.push(D);
679
+ ((H = k.current) === null || H === void 0 ? void 0 : H.readyState) === S.ReadyState.OPEN ? ((0, u.assertIsWebSocket)(k.current, j.current.skipAssert), k.current.send(D)) : L && be.current.push(D);
680
680
  }, []), ge = (0, v.useCallback)(function(D, L) {
681
681
  L === void 0 && (L = !0), $(JSON.stringify(D), L);
682
682
  }, [$]), Oe = (0, v.useCallback)(function() {
683
- return j.current.share !== !0 || E.isEventSourceSupported && k.current instanceof EventSource ? k.current : (G.current === null && k.current && ((0, o.assertIsWebSocket)(k.current, j.current.skipAssert), G.current = (0, l.default)(k.current, se)), G.current);
683
+ return j.current.share !== !0 || S.isEventSourceSupported && k.current instanceof EventSource ? k.current : (G.current === null && k.current && ((0, u.assertIsWebSocket)(k.current, j.current.skipAssert), G.current = (0, l.default)(k.current, se)), G.current);
684
684
  }, []);
685
685
  return (0, v.useEffect)(function() {
686
686
  if (i !== null && n === !0) {
@@ -690,27 +690,27 @@ function Ye() {
690
690
  return O(this, function(ue) {
691
691
  switch (ue.label) {
692
692
  case 0:
693
- return Z = w, [4, (0, c.getUrl)(i, j)];
693
+ return Z = A, [4, (0, c.getUrl)(i, j)];
694
694
  case 1:
695
- return Z.current = ue.sent(), w.current === null ? (console.error("Failed to get a valid URL. WebSocket connection aborted."), w.current = "ABORTED", (0, h.flushSync)(function() {
695
+ return Z.current = ue.sent(), A.current === null ? (console.error("Failed to get a valid URL. WebSocket connection aborted."), A.current = "ABORTED", (0, _.flushSync)(function() {
696
696
  return M(function(Y) {
697
- return r(r({}, Y), { ABORTED: E.ReadyState.CLOSED });
697
+ return r(r({}, Y), { ABORTED: S.ReadyState.CLOSED });
698
698
  });
699
699
  }), [
700
700
  2
701
701
  /*return*/
702
702
  ]) : (z = function(Y) {
703
- L || (0, h.flushSync)(function() {
704
- return u(Y);
703
+ L || (0, _.flushSync)(function() {
704
+ return o(Y);
705
705
  });
706
706
  }, pe = function(Y) {
707
- L || (0, h.flushSync)(function() {
707
+ L || (0, _.flushSync)(function() {
708
708
  return M(function(oe) {
709
709
  var ee;
710
- return r(r({}, oe), w.current && (ee = {}, ee[w.current] = Y, ee));
710
+ return r(r({}, oe), A.current && (ee = {}, ee[A.current] = Y, ee));
711
711
  });
712
712
  });
713
- }, H && (D = (0, _.createOrJoinSocket)(k, w.current, pe, j, z, se, le, Pe, $)), [
713
+ }, H && (D = (0, d.createOrJoinSocket)(k, A.current, pe, j, z, se, le, ke, $)), [
714
714
  2
715
715
  /*return*/
716
716
  ]);
@@ -721,20 +721,20 @@ function Ye() {
721
721
  return se.current = function() {
722
722
  L || (G.current && (G.current = null), D?.(), fe());
723
723
  }, fe(), function() {
724
- L = !0, H = !1, G.current && (G.current = null), D?.(), u(null);
724
+ L = !0, H = !1, G.current && (G.current = null), D?.(), o(null);
725
725
  };
726
726
  } else (i === null || n === !1) && (le.current = 0, M(function(Z) {
727
727
  var z;
728
- return r(r({}, Z), w.current && (z = {}, z[w.current] = E.ReadyState.CLOSED, z));
728
+ return r(r({}, Z), A.current && (z = {}, z[A.current] = S.ReadyState.CLOSED, z));
729
729
  }));
730
730
  }, [i, n, X, $]), (0, v.useEffect)(function() {
731
- J === E.ReadyState.OPEN && be.current.splice(0).forEach(function(D) {
731
+ J === S.ReadyState.OPEN && be.current.splice(0).forEach(function(D) {
732
732
  $(D);
733
733
  });
734
734
  }, [J]), {
735
735
  sendMessage: $,
736
736
  sendJsonMessage: ge,
737
- lastMessage: S,
737
+ lastMessage: E,
738
738
  lastJsonMessage: T,
739
739
  readyState: J,
740
740
  getWebSocket: Oe
@@ -742,27 +742,27 @@ function Ye() {
742
742
  };
743
743
  return F.useWebSocket = a, F;
744
744
  }
745
- var ae = {}, gr;
745
+ var ae = {}, Or;
746
746
  function ht() {
747
- if (gr) return ae;
748
- gr = 1;
747
+ if (Or) return ae;
748
+ Or = 1;
749
749
  var r = ae && ae.__assign || function() {
750
- return r = Object.assign || function(_) {
751
- for (var c, l = 1, o = arguments.length; l < o; l++) {
750
+ return r = Object.assign || function(d) {
751
+ for (var c, l = 1, u = arguments.length; l < u; l++) {
752
752
  c = arguments[l];
753
- for (var a in c) Object.prototype.hasOwnProperty.call(c, a) && (_[a] = c[a]);
753
+ for (var a in c) Object.prototype.hasOwnProperty.call(c, a) && (d[a] = c[a]);
754
754
  }
755
- return _;
755
+ return d;
756
756
  }, r.apply(this, arguments);
757
757
  };
758
758
  Object.defineProperty(ae, "__esModule", { value: !0 }), ae.useSocketIO = void 0;
759
- var g = ye, O = Ye(), y = V(), v = {
759
+ var g = ye, O = Ye(), h = V(), v = {
760
760
  type: "empty",
761
761
  payload: null
762
- }, h = function(_) {
763
- if (!_ || !_.data)
762
+ }, _ = function(d) {
763
+ if (!d || !d.data)
764
764
  return v;
765
- var c = _.data.match(/\[.*]/);
765
+ var c = d.data.match(/\[.*]/);
766
766
  if (!c)
767
767
  return v;
768
768
  var l = JSON.parse(c);
@@ -770,70 +770,70 @@ function ht() {
770
770
  type: l[0],
771
771
  payload: l[1]
772
772
  };
773
- }, E = function(_, c, l) {
774
- c === void 0 && (c = y.DEFAULT_OPTIONS), l === void 0 && (l = !0);
775
- var o = (0, g.useMemo)(function() {
773
+ }, S = function(d, c, l) {
774
+ c === void 0 && (c = h.DEFAULT_OPTIONS), l === void 0 && (l = !0);
775
+ var u = (0, g.useMemo)(function() {
776
776
  return r(r({}, c), { fromSocketIO: !0 });
777
- }, []), a = (0, O.useWebSocket)(_, o, l), i = a.sendMessage, t = a.sendJsonMessage, n = a.lastMessage, f = a.readyState, S = a.getWebSocket, u = (0, g.useMemo)(function() {
778
- return h(n);
777
+ }, []), a = (0, O.useWebSocket)(d, u, l), i = a.sendMessage, t = a.sendJsonMessage, n = a.lastMessage, f = a.readyState, E = a.getWebSocket, o = (0, g.useMemo)(function() {
778
+ return _(n);
779
779
  }, [n]);
780
780
  return {
781
781
  sendMessage: i,
782
782
  sendJsonMessage: t,
783
- lastMessage: u,
784
- lastJsonMessage: u,
783
+ lastMessage: o,
784
+ lastJsonMessage: o,
785
785
  readyState: f,
786
- getWebSocket: S
786
+ getWebSocket: E
787
787
  };
788
788
  };
789
- return ae.useSocketIO = E, ae;
789
+ return ae.useSocketIO = S, ae;
790
790
  }
791
- var x = {}, Or;
791
+ var x = {}, pr;
792
792
  function yt() {
793
- if (Or) return x;
794
- Or = 1;
793
+ if (pr) return x;
794
+ pr = 1;
795
795
  var r = x && x.__assign || function() {
796
- return r = Object.assign || function(E) {
797
- for (var _, c = 1, l = arguments.length; c < l; c++) {
798
- _ = arguments[c];
799
- for (var o in _) Object.prototype.hasOwnProperty.call(_, o) && (E[o] = _[o]);
796
+ return r = Object.assign || function(S) {
797
+ for (var d, c = 1, l = arguments.length; c < l; c++) {
798
+ d = arguments[c];
799
+ for (var u in d) Object.prototype.hasOwnProperty.call(d, u) && (S[u] = d[u]);
800
800
  }
801
- return E;
801
+ return S;
802
802
  }, r.apply(this, arguments);
803
- }, g = x && x.__rest || function(E, _) {
803
+ }, g = x && x.__rest || function(S, d) {
804
804
  var c = {};
805
- for (var l in E) Object.prototype.hasOwnProperty.call(E, l) && _.indexOf(l) < 0 && (c[l] = E[l]);
806
- if (E != null && typeof Object.getOwnPropertySymbols == "function")
807
- for (var o = 0, l = Object.getOwnPropertySymbols(E); o < l.length; o++)
808
- _.indexOf(l[o]) < 0 && Object.prototype.propertyIsEnumerable.call(E, l[o]) && (c[l[o]] = E[l[o]]);
805
+ for (var l in S) Object.prototype.hasOwnProperty.call(S, l) && d.indexOf(l) < 0 && (c[l] = S[l]);
806
+ if (S != null && typeof Object.getOwnPropertySymbols == "function")
807
+ for (var u = 0, l = Object.getOwnPropertySymbols(S); u < l.length; u++)
808
+ d.indexOf(l[u]) < 0 && Object.prototype.propertyIsEnumerable.call(S, l[u]) && (c[l[u]] = S[l[u]]);
809
809
  return c;
810
810
  };
811
811
  Object.defineProperty(x, "__esModule", { value: !0 }), x.useEventSource = void 0;
812
- var O = ye, y = Ye(), v = V(), h = function(E, _, c) {
813
- _ === void 0 && (_ = v.DEFAULT_EVENT_SOURCE_OPTIONS);
814
- var l = _.withCredentials, o = _.events, a = g(_, ["withCredentials", "events"]);
812
+ var O = ye, h = Ye(), v = V(), _ = function(S, d, c) {
813
+ d === void 0 && (d = v.DEFAULT_EVENT_SOURCE_OPTIONS);
814
+ var l = d.withCredentials, u = d.events, a = g(d, ["withCredentials", "events"]);
815
815
  c === void 0 && (c = !0);
816
816
  var i = r(r({}, a), { eventSourceOptions: {
817
817
  withCredentials: l
818
818
  } }), t = (0, O.useRef)(v.EMPTY_EVENT_HANDLERS);
819
- o && (t.current = o);
820
- var n = (0, y.useWebSocket)(E, i, c), f = n.lastMessage, S = n.readyState, u = n.getWebSocket;
819
+ u && (t.current = u);
820
+ var n = (0, h.useWebSocket)(S, i, c), f = n.lastMessage, E = n.readyState, o = n.getWebSocket;
821
821
  return (0, O.useEffect)(function() {
822
- f?.type && Object.entries(t.current).forEach(function(d) {
823
- var A = d[0], M = d[1];
824
- A === f.type && M(f);
822
+ f?.type && Object.entries(t.current).forEach(function(y) {
823
+ var m = y[0], M = y[1];
824
+ m === f.type && M(f);
825
825
  });
826
826
  }, [f]), {
827
827
  lastEvent: f,
828
- readyState: S,
829
- getEventSource: u
828
+ readyState: E,
829
+ getEventSource: o
830
830
  };
831
831
  };
832
- return x.useEventSource = h, x;
832
+ return x.useEventSource = _, x;
833
833
  }
834
- var pr;
834
+ var Tr;
835
835
  function bt() {
836
- return pr || (pr = 1, (function(r) {
836
+ return Tr || (Tr = 1, (function(r) {
837
837
  Object.defineProperty(r, "__esModule", { value: !0 }), r.resetGlobalState = r.useEventSource = r.ReadyState = r.useSocketIO = r.default = void 0;
838
838
  var g = Ye();
839
839
  Object.defineProperty(r, "default", { enumerable: !0, get: function() {
@@ -843,17 +843,17 @@ function bt() {
843
843
  Object.defineProperty(r, "useSocketIO", { enumerable: !0, get: function() {
844
844
  return O.useSocketIO;
845
845
  } });
846
- var y = V();
846
+ var h = V();
847
847
  Object.defineProperty(r, "ReadyState", { enumerable: !0, get: function() {
848
- return y.ReadyState;
848
+ return h.ReadyState;
849
849
  } });
850
850
  var v = yt();
851
851
  Object.defineProperty(r, "useEventSource", { enumerable: !0, get: function() {
852
852
  return v.useEventSource;
853
853
  } });
854
- var h = He();
854
+ var _ = He();
855
855
  Object.defineProperty(r, "resetGlobalState", { enumerable: !0, get: function() {
856
- return h.resetGlobalState;
856
+ return _.resetGlobalState;
857
857
  } });
858
858
  })(Le)), Le;
859
859
  }
@@ -873,87 +873,93 @@ const Ot = /* @__PURE__ */ ft(gt), Q = {
873
873
  socketHandlers: g = {},
874
874
  options: O = {}
875
875
  }) => {
876
- const y = ot(!1), {
877
- sendMessage: v,
878
- sendJsonMessage: h,
879
- lastMessage: E,
880
- // lastJsonMessage,
881
- readyState: _
882
- // getWebSocket,
876
+ const h = ir(!1), v = ir(g), {
877
+ sendMessage: _,
878
+ // 發送普通訊息
879
+ sendJsonMessage: S,
880
+ // 發送 JSON 訊息
881
+ lastMessage: d,
882
+ // 最後接收到的訊息
883
+ // lastJsonMessage, // 最後接收到的 JSON 訊息
884
+ readyState: c
885
+ // WebSocket 連線狀態
886
+ // getWebSocket, // 獲取 WebSocket 實例
883
887
  } = Ot(r, {
884
888
  queryParams: { key: "wsky" },
885
889
  onOpen: () => console.log("連線成功"),
886
- shouldReconnect: () => y.current === !1,
890
+ shouldReconnect: () => h.current === !1,
887
891
  reconnectAttempts: 9999,
888
892
  reconnectInterval: 1e3,
889
893
  ...O
890
- }), c = Je(() => {
894
+ }), l = Je(() => {
891
895
  try {
892
- return JSON.parse(E?.data);
896
+ return JSON.parse(d?.data);
893
897
  } catch {
894
898
  return null;
895
899
  }
896
- }, [E?.data]);
897
- return je(() => {
898
- const l = setInterval(
899
- () => v("ping"),
900
+ }, [d?.data]);
901
+ return Ce(() => {
902
+ const u = setInterval(
903
+ () => _("ping"),
900
904
  pt
901
905
  );
902
- return () => clearInterval(l);
903
- }, [v]), je(() => {
904
- if (!c) return;
906
+ return () => clearInterval(u);
907
+ }, [_]), Ce(() => {
908
+ v.current = g;
909
+ }, [g]), Ce(() => {
910
+ if (!l) return;
905
911
  const {
906
- onDeposit: l,
907
- onTransCode: o,
908
- onError: a,
909
- onUpdateMember: i,
910
- onMaintainNotice: t,
911
- onMaintainNoticeMember: n,
912
- onReload: f,
913
- onTransferInGame: S
914
- } = g, u = Ce(c, "type", ""), d = {
915
- memberInfoUid: Ce(c, "member_info_uid", null),
916
- data: Ce(c, "data", null),
917
- memo: Ce(c, "memo", null)
912
+ onDeposit: u,
913
+ onTransCode: a,
914
+ onError: i,
915
+ onUpdateMember: t,
916
+ onMaintainNotice: n,
917
+ onMaintainNoticeMember: f,
918
+ onReload: E,
919
+ onTransferInGame: o
920
+ } = v.current, y = we(l, "type", ""), m = {
921
+ memberInfoUid: we(l, "member_info_uid", null),
922
+ data: we(l, "data", null),
923
+ memo: we(l, "memo", null)
918
924
  };
919
- switch (u) {
925
+ switch (y) {
920
926
  case Q.DEPOSIT:
921
- l?.(d);
927
+ u?.(m);
922
928
  break;
923
929
  case Q.TRANS_CODE:
924
- o?.(d);
930
+ a?.(m);
925
931
  break;
926
932
  case Q.ERROR:
927
- a?.(d);
933
+ i?.(m);
928
934
  break;
929
935
  case Q.UPDATE_MEMBER:
930
- i?.(d);
936
+ t?.(m);
931
937
  break;
932
938
  case Q.MAINTAIN_NOTICE:
933
- t?.(d);
939
+ n?.(m);
934
940
  break;
935
941
  case Q.MAINTAIN_NOTICE_MEMBER:
936
- n?.(d);
942
+ f?.(m);
937
943
  break;
938
944
  case Q.RELOAD:
939
- f?.(d);
945
+ E?.(m);
940
946
  break;
941
947
  case Q.TRANSFER_IN_GAME:
942
948
  case Q.CHECK_REQUEST:
943
- S?.(d);
949
+ o?.(m);
944
950
  break;
945
951
  default:
946
- console.warn("Unknown socket type:", u);
952
+ console.warn("Unknown socket type:", y);
947
953
  break;
948
954
  }
949
- }, [g, c]), je(() => () => y.current = !0, []), {
950
- sendMessage: v,
951
- sendJsonMessage: h,
952
- readyState: _
955
+ }, [l]), Ce(() => () => h.current = !0, []), {
956
+ sendMessage: _,
957
+ sendJsonMessage: S,
958
+ readyState: c
953
959
  // WebSocket 連線狀態
954
960
  };
955
961
  };
956
- var Ae = { exports: {} }, Se = {};
962
+ var Pe = { exports: {} }, Se = {};
957
963
  /**
958
964
  * @license React
959
965
  * react-jsx-runtime.production.min.js
@@ -963,19 +969,19 @@ var Ae = { exports: {} }, Se = {};
963
969
  * This source code is licensed under the MIT license found in the
964
970
  * LICENSE file in the root directory of this source tree.
965
971
  */
966
- var Tr;
972
+ var mr;
967
973
  function Tt() {
968
- if (Tr) return Se;
969
- Tr = 1;
970
- var r = ye, g = Symbol.for("react.element"), O = Symbol.for("react.fragment"), y = Object.prototype.hasOwnProperty, v = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, h = { key: !0, ref: !0, __self: !0, __source: !0 };
971
- function E(_, c, l) {
972
- var o, a = {}, i = null, t = null;
974
+ if (mr) return Se;
975
+ mr = 1;
976
+ var r = ye, g = Symbol.for("react.element"), O = Symbol.for("react.fragment"), h = Object.prototype.hasOwnProperty, v = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, _ = { key: !0, ref: !0, __self: !0, __source: !0 };
977
+ function S(d, c, l) {
978
+ var u, a = {}, i = null, t = null;
973
979
  l !== void 0 && (i = "" + l), c.key !== void 0 && (i = "" + c.key), c.ref !== void 0 && (t = c.ref);
974
- for (o in c) y.call(c, o) && !h.hasOwnProperty(o) && (a[o] = c[o]);
975
- if (_ && _.defaultProps) for (o in c = _.defaultProps, c) a[o] === void 0 && (a[o] = c[o]);
976
- return { $$typeof: g, type: _, key: i, ref: t, props: a, _owner: v.current };
980
+ for (u in c) h.call(c, u) && !_.hasOwnProperty(u) && (a[u] = c[u]);
981
+ if (d && d.defaultProps) for (u in c = d.defaultProps, c) a[u] === void 0 && (a[u] = c[u]);
982
+ return { $$typeof: g, type: d, key: i, ref: t, props: a, _owner: v.current };
977
983
  }
978
- return Se.Fragment = O, Se.jsx = E, Se.jsxs = E, Se;
984
+ return Se.Fragment = O, Se.jsx = S, Se.jsxs = S, Se;
979
985
  }
980
986
  var he = {};
981
987
  /**
@@ -987,38 +993,38 @@ var he = {};
987
993
  * This source code is licensed under the MIT license found in the
988
994
  * LICENSE file in the root directory of this source tree.
989
995
  */
990
- var mr;
996
+ var Rr;
991
997
  function mt() {
992
- return mr || (mr = 1, process.env.NODE_ENV !== "production" && (function() {
993
- var r = ye, g = Symbol.for("react.element"), O = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), E = Symbol.for("react.provider"), _ = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), l = 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, f = "@@iterator";
994
- function S(e) {
998
+ return Rr || (Rr = 1, process.env.NODE_ENV !== "production" && (function() {
999
+ var r = ye, g = Symbol.for("react.element"), O = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), v = 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"), l = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), a = Symbol.for("react.memo"), i = Symbol.for("react.lazy"), t = Symbol.for("react.offscreen"), n = Symbol.iterator, f = "@@iterator";
1000
+ function E(e) {
995
1001
  if (e === null || typeof e != "object")
996
1002
  return null;
997
1003
  var s = n && e[n] || e[f];
998
1004
  return typeof s == "function" ? s : null;
999
1005
  }
1000
- var u = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
1001
- function d(e) {
1006
+ var o = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
1007
+ function y(e) {
1002
1008
  {
1003
1009
  for (var s = arguments.length, b = new Array(s > 1 ? s - 1 : 0), p = 1; p < s; p++)
1004
1010
  b[p - 1] = arguments[p];
1005
- A("error", e, b);
1011
+ m("error", e, b);
1006
1012
  }
1007
1013
  }
1008
- function A(e, s, b) {
1014
+ function m(e, s, b) {
1009
1015
  {
1010
- var p = u.ReactDebugCurrentFrame, C = p.getStackAddendum();
1011
- C !== "" && (s += "%s", b = b.concat([C]));
1012
- var P = b.map(function(R) {
1013
- return String(R);
1016
+ var p = o.ReactDebugCurrentFrame, w = p.getStackAddendum();
1017
+ w !== "" && (s += "%s", b = b.concat([w]));
1018
+ var P = b.map(function(C) {
1019
+ return String(C);
1014
1020
  });
1015
1021
  P.unshift("Warning: " + s), Function.prototype.apply.call(console[e], console, P);
1016
1022
  }
1017
1023
  }
1018
- var M = !1, T = !1, w = !1, k = !1, se = !1, le;
1024
+ var M = !1, T = !1, A = !1, k = !1, se = !1, le;
1019
1025
  le = Symbol.for("react.module.reference");
1020
- function Pe(e) {
1021
- return !!(typeof e == "string" || typeof e == "function" || e === y || e === h || se || e === v || e === l || e === o || k || e === t || M || T || w || typeof e == "object" && e !== null && (e.$$typeof === i || e.$$typeof === a || e.$$typeof === E || e.$$typeof === _ || e.$$typeof === c || // This needs to include all possible module reference object
1026
+ function ke(e) {
1027
+ return !!(typeof e == "string" || typeof e == "function" || e === h || e === _ || se || e === v || e === l || e === u || k || e === t || M || T || 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
1022
1028
  // types supported by any Flight configuration anywhere since
1023
1029
  // we don't know which Flight build this will end up being used
1024
1030
  // with.
@@ -1028,8 +1034,8 @@ function mt() {
1028
1034
  var p = e.displayName;
1029
1035
  if (p)
1030
1036
  return p;
1031
- var C = s.displayName || s.name || "";
1032
- return C !== "" ? b + "(" + C + ")" : b;
1037
+ var w = s.displayName || s.name || "";
1038
+ return w !== "" ? b + "(" + w + ")" : b;
1033
1039
  }
1034
1040
  function G(e) {
1035
1041
  return e.displayName || "Context";
@@ -1037,30 +1043,30 @@ function mt() {
1037
1043
  function j(e) {
1038
1044
  if (e == null)
1039
1045
  return null;
1040
- if (typeof e.tag == "number" && d("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
1046
+ if (typeof e.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
1041
1047
  return e.displayName || e.name || null;
1042
1048
  if (typeof e == "string")
1043
1049
  return e;
1044
1050
  switch (e) {
1045
- case y:
1051
+ case h:
1046
1052
  return "Fragment";
1047
1053
  case O:
1048
1054
  return "Portal";
1049
- case h:
1055
+ case _:
1050
1056
  return "Profiler";
1051
1057
  case v:
1052
1058
  return "StrictMode";
1053
1059
  case l:
1054
1060
  return "Suspense";
1055
- case o:
1061
+ case u:
1056
1062
  return "SuspenseList";
1057
1063
  }
1058
1064
  if (typeof e == "object")
1059
1065
  switch (e.$$typeof) {
1060
- case _:
1066
+ case d:
1061
1067
  var s = e;
1062
1068
  return G(s) + ".Consumer";
1063
- case E:
1069
+ case S:
1064
1070
  var b = e;
1065
1071
  return G(b._context) + ".Provider";
1066
1072
  case c:
@@ -1069,9 +1075,9 @@ function mt() {
1069
1075
  var p = e.displayName || null;
1070
1076
  return p !== null ? p : j(e.type) || "Memo";
1071
1077
  case i: {
1072
- var C = e, P = C._payload, R = C._init;
1078
+ var w = e, P = w._payload, C = w._init;
1073
1079
  try {
1074
- return j(R(P));
1080
+ return j(C(P));
1075
1081
  } catch {
1076
1082
  return null;
1077
1083
  }
@@ -1138,17 +1144,17 @@ function mt() {
1138
1144
  })
1139
1145
  });
1140
1146
  }
1141
- X < 0 && d("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
1147
+ X < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
1142
1148
  }
1143
1149
  }
1144
- var ue = u.ReactCurrentDispatcher, Y;
1150
+ var ue = o.ReactCurrentDispatcher, Y;
1145
1151
  function oe(e, s, b) {
1146
1152
  {
1147
1153
  if (Y === void 0)
1148
1154
  try {
1149
1155
  throw Error();
1150
- } catch (C) {
1151
- var p = C.stack.trim().match(/\n( *(at )?)/);
1156
+ } catch (w) {
1157
+ var p = w.stack.trim().match(/\n( *(at )?)/);
1152
1158
  Y = p && p[1] || "";
1153
1159
  }
1154
1160
  return `
@@ -1157,8 +1163,8 @@ function mt() {
1157
1163
  }
1158
1164
  var ee = !1, Te;
1159
1165
  {
1160
- var kr = typeof WeakMap == "function" ? WeakMap : Map;
1161
- Te = new kr();
1166
+ var Nr = typeof WeakMap == "function" ? WeakMap : Map;
1167
+ Te = new Nr();
1162
1168
  }
1163
1169
  function Be(e, s) {
1164
1170
  if (!e || ee)
@@ -1170,33 +1176,33 @@ function mt() {
1170
1176
  }
1171
1177
  var p;
1172
1178
  ee = !0;
1173
- var C = Error.prepareStackTrace;
1179
+ var w = Error.prepareStackTrace;
1174
1180
  Error.prepareStackTrace = void 0;
1175
1181
  var P;
1176
1182
  P = ue.current, ue.current = null, z();
1177
1183
  try {
1178
1184
  if (s) {
1179
- var R = function() {
1185
+ var C = function() {
1180
1186
  throw Error();
1181
1187
  };
1182
- if (Object.defineProperty(R.prototype, "props", {
1188
+ if (Object.defineProperty(C.prototype, "props", {
1183
1189
  set: function() {
1184
1190
  throw Error();
1185
1191
  }
1186
1192
  }), typeof Reflect == "object" && Reflect.construct) {
1187
1193
  try {
1188
- Reflect.construct(R, []);
1194
+ Reflect.construct(C, []);
1189
1195
  } catch (W) {
1190
1196
  p = W;
1191
1197
  }
1192
- Reflect.construct(e, [], R);
1198
+ Reflect.construct(e, [], C);
1193
1199
  } else {
1194
1200
  try {
1195
- R.call();
1201
+ C.call();
1196
1202
  } catch (W) {
1197
1203
  p = W;
1198
1204
  }
1199
- e.call(R.prototype);
1205
+ e.call(C.prototype);
1200
1206
  }
1201
1207
  } else {
1202
1208
  try {
@@ -1208,17 +1214,17 @@ function mt() {
1208
1214
  }
1209
1215
  } catch (W) {
1210
1216
  if (W && p && typeof W.stack == "string") {
1211
- for (var m = W.stack.split(`
1217
+ for (var R = W.stack.split(`
1212
1218
  `), U = p.stack.split(`
1213
- `), N = m.length - 1, I = U.length - 1; N >= 1 && I >= 0 && m[N] !== U[I]; )
1219
+ `), N = R.length - 1, I = U.length - 1; N >= 1 && I >= 0 && R[N] !== U[I]; )
1214
1220
  I--;
1215
1221
  for (; N >= 1 && I >= 0; N--, I--)
1216
- if (m[N] !== U[I]) {
1222
+ if (R[N] !== U[I]) {
1217
1223
  if (N !== 1 || I !== 1)
1218
1224
  do
1219
- if (N--, I--, I < 0 || m[N] !== U[I]) {
1225
+ if (N--, I--, I < 0 || R[N] !== U[I]) {
1220
1226
  var q = `
1221
- ` + m[N].replace(" at new ", " at ");
1227
+ ` + R[N].replace(" at new ", " at ");
1222
1228
  return e.displayName && q.includes("<anonymous>") && (q = q.replace("<anonymous>", e.displayName)), typeof e == "function" && Te.set(e, q), q;
1223
1229
  }
1224
1230
  while (N >= 1 && I >= 0);
@@ -1226,15 +1232,15 @@ function mt() {
1226
1232
  }
1227
1233
  }
1228
1234
  } finally {
1229
- ee = !1, ue.current = P, pe(), Error.prepareStackTrace = C;
1235
+ ee = !1, ue.current = P, pe(), Error.prepareStackTrace = w;
1230
1236
  }
1231
1237
  var ie = e ? e.displayName || e.name : "", re = ie ? oe(ie) : "";
1232
1238
  return typeof e == "function" && Te.set(e, re), re;
1233
1239
  }
1234
- function Nr(e, s, b) {
1240
+ function Ir(e, s, b) {
1235
1241
  return Be(e, !1);
1236
1242
  }
1237
- function Ir(e) {
1243
+ function Mr(e) {
1238
1244
  var s = e.prototype;
1239
1245
  return !!(s && s.isReactComponent);
1240
1246
  }
@@ -1242,32 +1248,32 @@ function mt() {
1242
1248
  if (e == null)
1243
1249
  return "";
1244
1250
  if (typeof e == "function")
1245
- return Be(e, Ir(e));
1251
+ return Be(e, Mr(e));
1246
1252
  if (typeof e == "string")
1247
1253
  return oe(e);
1248
1254
  switch (e) {
1249
1255
  case l:
1250
1256
  return oe("Suspense");
1251
- case o:
1257
+ case u:
1252
1258
  return oe("SuspenseList");
1253
1259
  }
1254
1260
  if (typeof e == "object")
1255
1261
  switch (e.$$typeof) {
1256
1262
  case c:
1257
- return Nr(e.render);
1263
+ return Ir(e.render);
1258
1264
  case a:
1259
1265
  return me(e.type, s, b);
1260
1266
  case i: {
1261
- var p = e, C = p._payload, P = p._init;
1267
+ var p = e, w = p._payload, P = p._init;
1262
1268
  try {
1263
- return me(P(C), s, b);
1269
+ return me(P(w), s, b);
1264
1270
  } catch {
1265
1271
  }
1266
1272
  }
1267
1273
  }
1268
1274
  return "";
1269
1275
  }
1270
- var ve = Object.prototype.hasOwnProperty, Ke = {}, xe = u.ReactDebugCurrentFrame;
1276
+ var ve = Object.prototype.hasOwnProperty, Ke = {}, xe = o.ReactDebugCurrentFrame;
1271
1277
  function Re(e) {
1272
1278
  if (e) {
1273
1279
  var s = e._owner, b = me(e.type, e._source, s ? s.type : null);
@@ -1275,36 +1281,36 @@ function mt() {
1275
1281
  } else
1276
1282
  xe.setExtraStackFrame(null);
1277
1283
  }
1278
- function Mr(e, s, b, p, C) {
1284
+ function Dr(e, s, b, p, w) {
1279
1285
  {
1280
1286
  var P = Function.call.bind(ve);
1281
- for (var R in e)
1282
- if (P(e, R)) {
1283
- var m = void 0;
1287
+ for (var C in e)
1288
+ if (P(e, C)) {
1289
+ var R = void 0;
1284
1290
  try {
1285
- if (typeof e[R] != "function") {
1286
- var U = Error((p || "React class") + ": " + b + " 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`.");
1291
+ if (typeof e[C] != "function") {
1292
+ var U = Error((p || "React class") + ": " + b + " type `" + C + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[C] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
1287
1293
  throw U.name = "Invariant Violation", U;
1288
1294
  }
1289
- m = e[R](s, R, p, b, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
1295
+ R = e[C](s, C, p, b, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
1290
1296
  } catch (N) {
1291
- m = N;
1297
+ R = N;
1292
1298
  }
1293
- m && !(m instanceof Error) && (Re(C), d("%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", b, R, typeof m), Re(null)), m instanceof Error && !(m.message in Ke) && (Ke[m.message] = !0, Re(C), d("Failed %s type: %s", b, m.message), Re(null));
1299
+ R && !(R instanceof Error) && (Re(w), y("%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", b, C, typeof R), Re(null)), R instanceof Error && !(R.message in Ke) && (Ke[R.message] = !0, Re(w), y("Failed %s type: %s", b, R.message), Re(null));
1294
1300
  }
1295
1301
  }
1296
1302
  }
1297
- var Dr = Array.isArray;
1298
- function ke(e) {
1299
- return Dr(e);
1303
+ var jr = Array.isArray;
1304
+ function Ne(e) {
1305
+ return jr(e);
1300
1306
  }
1301
- function jr(e) {
1307
+ function Lr(e) {
1302
1308
  {
1303
1309
  var s = typeof Symbol == "function" && Symbol.toStringTag, b = s && e[Symbol.toStringTag] || e.constructor.name || "Object";
1304
1310
  return b;
1305
1311
  }
1306
1312
  }
1307
- function Lr(e) {
1313
+ function Ur(e) {
1308
1314
  try {
1309
1315
  return Qe(e), !1;
1310
1316
  } catch {
@@ -1315,16 +1321,16 @@ function mt() {
1315
1321
  return "" + e;
1316
1322
  }
1317
1323
  function ze(e) {
1318
- if (Lr(e))
1319
- return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", jr(e)), Qe(e);
1324
+ if (Ur(e))
1325
+ return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Lr(e)), Qe(e);
1320
1326
  }
1321
- var Xe = u.ReactCurrentOwner, Ur = {
1327
+ var Xe = o.ReactCurrentOwner, Wr = {
1322
1328
  key: !0,
1323
1329
  ref: !0,
1324
1330
  __self: !0,
1325
1331
  __source: !0
1326
1332
  }, Ze, er;
1327
- function Wr(e) {
1333
+ function Fr(e) {
1328
1334
  if (ve.call(e, "ref")) {
1329
1335
  var s = Object.getOwnPropertyDescriptor(e, "ref").get;
1330
1336
  if (s && s.isReactWarning)
@@ -1332,7 +1338,7 @@ function mt() {
1332
1338
  }
1333
1339
  return e.ref !== void 0;
1334
1340
  }
1335
- function Fr(e) {
1341
+ function qr(e) {
1336
1342
  if (ve.call(e, "key")) {
1337
1343
  var s = Object.getOwnPropertyDescriptor(e, "key").get;
1338
1344
  if (s && s.isReactWarning)
@@ -1340,13 +1346,13 @@ function mt() {
1340
1346
  }
1341
1347
  return e.key !== void 0;
1342
1348
  }
1343
- function qr(e, s) {
1349
+ function Jr(e, s) {
1344
1350
  typeof e.ref == "string" && Xe.current;
1345
1351
  }
1346
- function Jr(e, s) {
1352
+ function Gr(e, s) {
1347
1353
  {
1348
1354
  var b = function() {
1349
- Ze || (Ze = !0, d("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
1355
+ Ze || (Ze = !0, y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
1350
1356
  };
1351
1357
  b.isReactWarning = !0, Object.defineProperty(e, "key", {
1352
1358
  get: b,
@@ -1354,10 +1360,10 @@ function mt() {
1354
1360
  });
1355
1361
  }
1356
1362
  }
1357
- function Gr(e, s) {
1363
+ function Vr(e, s) {
1358
1364
  {
1359
1365
  var b = function() {
1360
- er || (er = !0, d("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
1366
+ er || (er = !0, y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
1361
1367
  };
1362
1368
  b.isReactWarning = !0, Object.defineProperty(e, "ref", {
1363
1369
  get: b,
@@ -1365,54 +1371,54 @@ function mt() {
1365
1371
  });
1366
1372
  }
1367
1373
  }
1368
- var Vr = function(e, s, b, p, C, P, R) {
1369
- var m = {
1374
+ var $r = function(e, s, b, p, w, P, C) {
1375
+ var R = {
1370
1376
  // This tag allows us to uniquely identify this as a React Element
1371
1377
  $$typeof: g,
1372
1378
  // Built-in properties that belong on the element
1373
1379
  type: e,
1374
1380
  key: s,
1375
1381
  ref: b,
1376
- props: R,
1382
+ props: C,
1377
1383
  // Record the component responsible for creating this element.
1378
1384
  _owner: P
1379
1385
  };
1380
- return m._store = {}, Object.defineProperty(m._store, "validated", {
1386
+ return R._store = {}, Object.defineProperty(R._store, "validated", {
1381
1387
  configurable: !1,
1382
1388
  enumerable: !1,
1383
1389
  writable: !0,
1384
1390
  value: !1
1385
- }), Object.defineProperty(m, "_self", {
1391
+ }), Object.defineProperty(R, "_self", {
1386
1392
  configurable: !1,
1387
1393
  enumerable: !1,
1388
1394
  writable: !1,
1389
1395
  value: p
1390
- }), Object.defineProperty(m, "_source", {
1396
+ }), Object.defineProperty(R, "_source", {
1391
1397
  configurable: !1,
1392
1398
  enumerable: !1,
1393
1399
  writable: !1,
1394
- value: C
1395
- }), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
1400
+ value: w
1401
+ }), Object.freeze && (Object.freeze(R.props), Object.freeze(R)), R;
1396
1402
  };
1397
- function $r(e, s, b, p, C) {
1403
+ function Hr(e, s, b, p, w) {
1398
1404
  {
1399
- var P, R = {}, m = null, U = null;
1400
- b !== void 0 && (ze(b), m = "" + b), Fr(s) && (ze(s.key), m = "" + s.key), Wr(s) && (U = s.ref, qr(s, C));
1405
+ var P, C = {}, R = null, U = null;
1406
+ b !== void 0 && (ze(b), R = "" + b), qr(s) && (ze(s.key), R = "" + s.key), Fr(s) && (U = s.ref, Jr(s, w));
1401
1407
  for (P in s)
1402
- ve.call(s, P) && !Ur.hasOwnProperty(P) && (R[P] = s[P]);
1408
+ ve.call(s, P) && !Wr.hasOwnProperty(P) && (C[P] = s[P]);
1403
1409
  if (e && e.defaultProps) {
1404
1410
  var N = e.defaultProps;
1405
1411
  for (P in N)
1406
- R[P] === void 0 && (R[P] = N[P]);
1412
+ C[P] === void 0 && (C[P] = N[P]);
1407
1413
  }
1408
- if (m || U) {
1414
+ if (R || U) {
1409
1415
  var I = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
1410
- m && Jr(R, I), U && Gr(R, I);
1416
+ R && Gr(C, I), U && Vr(C, I);
1411
1417
  }
1412
- return Vr(e, m, U, C, p, Xe.current, R);
1418
+ return $r(e, R, U, w, p, Xe.current, C);
1413
1419
  }
1414
1420
  }
1415
- var Ne = u.ReactCurrentOwner, rr = u.ReactDebugCurrentFrame;
1421
+ var Ie = o.ReactCurrentOwner, rr = o.ReactDebugCurrentFrame;
1416
1422
  function ce(e) {
1417
1423
  if (e) {
1418
1424
  var s = e._owner, b = me(e.type, e._source, s ? s.type : null);
@@ -1420,15 +1426,15 @@ function mt() {
1420
1426
  } else
1421
1427
  rr.setExtraStackFrame(null);
1422
1428
  }
1423
- var Ie;
1424
- Ie = !1;
1425
- function Me(e) {
1429
+ var Me;
1430
+ Me = !1;
1431
+ function De(e) {
1426
1432
  return typeof e == "object" && e !== null && e.$$typeof === g;
1427
1433
  }
1428
1434
  function tr() {
1429
1435
  {
1430
- if (Ne.current) {
1431
- var e = j(Ne.current.type);
1436
+ if (Ie.current) {
1437
+ var e = j(Ie.current.type);
1432
1438
  if (e)
1433
1439
  return `
1434
1440
 
@@ -1437,11 +1443,11 @@ Check the render method of \`` + e + "`.";
1437
1443
  return "";
1438
1444
  }
1439
1445
  }
1440
- function Hr(e) {
1446
+ function Yr(e) {
1441
1447
  return "";
1442
1448
  }
1443
1449
  var nr = {};
1444
- function Yr(e) {
1450
+ function Br(e) {
1445
1451
  {
1446
1452
  var s = tr();
1447
1453
  if (!s) {
@@ -1458,34 +1464,34 @@ Check the top-level render call using <` + b + ">.");
1458
1464
  if (!e._store || e._store.validated || e.key != null)
1459
1465
  return;
1460
1466
  e._store.validated = !0;
1461
- var b = Yr(s);
1467
+ var b = Br(s);
1462
1468
  if (nr[b])
1463
1469
  return;
1464
1470
  nr[b] = !0;
1465
1471
  var p = "";
1466
- e && e._owner && e._owner !== Ne.current && (p = " It was passed a child from " + j(e._owner.type) + "."), ce(e), d('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', b, p), ce(null);
1472
+ e && e._owner && e._owner !== Ie.current && (p = " It was passed a child from " + j(e._owner.type) + "."), ce(e), y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', b, p), ce(null);
1467
1473
  }
1468
1474
  }
1469
1475
  function ur(e, s) {
1470
1476
  {
1471
1477
  if (typeof e != "object")
1472
1478
  return;
1473
- if (ke(e))
1479
+ if (Ne(e))
1474
1480
  for (var b = 0; b < e.length; b++) {
1475
1481
  var p = e[b];
1476
- Me(p) && ar(p, s);
1482
+ De(p) && ar(p, s);
1477
1483
  }
1478
- else if (Me(e))
1484
+ else if (De(e))
1479
1485
  e._store && (e._store.validated = !0);
1480
1486
  else if (e) {
1481
- var C = S(e);
1482
- if (typeof C == "function" && C !== e.entries)
1483
- for (var P = C.call(e), R; !(R = P.next()).done; )
1484
- Me(R.value) && ar(R.value, s);
1487
+ var w = E(e);
1488
+ if (typeof w == "function" && w !== e.entries)
1489
+ for (var P = w.call(e), C; !(C = P.next()).done; )
1490
+ De(C.value) && ar(C.value, s);
1485
1491
  }
1486
1492
  }
1487
1493
  }
1488
- function Br(e) {
1494
+ function Kr(e) {
1489
1495
  {
1490
1496
  var s = e.type;
1491
1497
  if (s == null || typeof s == "string")
@@ -1501,90 +1507,90 @@ Check the top-level render call using <` + b + ">.");
1501
1507
  return;
1502
1508
  if (b) {
1503
1509
  var p = j(s);
1504
- Mr(b, e.props, "prop", p, e);
1505
- } else if (s.PropTypes !== void 0 && !Ie) {
1506
- Ie = !0;
1507
- var C = j(s);
1508
- d("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", C || "Unknown");
1510
+ Dr(b, e.props, "prop", p, e);
1511
+ } else if (s.PropTypes !== void 0 && !Me) {
1512
+ Me = !0;
1513
+ var w = j(s);
1514
+ y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", w || "Unknown");
1509
1515
  }
1510
- typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && d("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1516
+ typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1511
1517
  }
1512
1518
  }
1513
- function Kr(e) {
1519
+ function xr(e) {
1514
1520
  {
1515
1521
  for (var s = Object.keys(e.props), b = 0; b < s.length; b++) {
1516
1522
  var p = s[b];
1517
1523
  if (p !== "children" && p !== "key") {
1518
- ce(e), d("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), ce(null);
1524
+ ce(e), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), ce(null);
1519
1525
  break;
1520
1526
  }
1521
1527
  }
1522
- e.ref !== null && (ce(e), d("Invalid attribute `ref` supplied to `React.Fragment`."), ce(null));
1528
+ e.ref !== null && (ce(e), y("Invalid attribute `ref` supplied to `React.Fragment`."), ce(null));
1523
1529
  }
1524
1530
  }
1525
1531
  var or = {};
1526
- function cr(e, s, b, p, C, P) {
1532
+ function cr(e, s, b, p, w, P) {
1527
1533
  {
1528
- var R = Pe(e);
1529
- if (!R) {
1530
- var m = "";
1531
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (m += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1532
- var U = Hr();
1533
- U ? m += U : m += tr();
1534
+ var C = ke(e);
1535
+ if (!C) {
1536
+ var R = "";
1537
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (R += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1538
+ var U = Yr();
1539
+ U ? R += U : R += tr();
1534
1540
  var N;
1535
- e === null ? N = "null" : ke(e) ? N = "array" : e !== void 0 && e.$$typeof === g ? (N = "<" + (j(e.type) || "Unknown") + " />", m = " Did you accidentally export a JSX literal instead of a component?") : N = typeof e, d("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", N, m);
1541
+ e === null ? N = "null" : Ne(e) ? N = "array" : e !== void 0 && e.$$typeof === g ? (N = "<" + (j(e.type) || "Unknown") + " />", R = " Did you accidentally export a JSX literal instead of a component?") : N = typeof e, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", N, R);
1536
1542
  }
1537
- var I = $r(e, s, b, C, P);
1543
+ var I = Hr(e, s, b, w, P);
1538
1544
  if (I == null)
1539
1545
  return I;
1540
- if (R) {
1546
+ if (C) {
1541
1547
  var q = s.children;
1542
1548
  if (q !== void 0)
1543
1549
  if (p)
1544
- if (ke(q)) {
1550
+ if (Ne(q)) {
1545
1551
  for (var ie = 0; ie < q.length; ie++)
1546
1552
  ur(q[ie], e);
1547
1553
  Object.freeze && Object.freeze(q);
1548
1554
  } else
1549
- d("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1555
+ y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1550
1556
  else
1551
1557
  ur(q, e);
1552
1558
  }
1553
1559
  if (ve.call(s, "key")) {
1554
- var re = j(e), W = Object.keys(s).filter(function(et) {
1555
- return et !== "key";
1556
- }), De = W.length > 0 ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}";
1557
- if (!or[re + De]) {
1558
- var Zr = W.length > 0 ? "{" + W.join(": ..., ") + ": ...}" : "{}";
1559
- d(`A props object containing a "key" prop is being spread into JSX:
1560
+ var re = j(e), W = Object.keys(s).filter(function(rt) {
1561
+ return rt !== "key";
1562
+ }), je = W.length > 0 ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}";
1563
+ if (!or[re + je]) {
1564
+ var et = W.length > 0 ? "{" + W.join(": ..., ") + ": ...}" : "{}";
1565
+ y(`A props object containing a "key" prop is being spread into JSX:
1560
1566
  let props = %s;
1561
1567
  <%s {...props} />
1562
1568
  React keys must be passed directly to JSX without using spread:
1563
1569
  let props = %s;
1564
- <%s key={someKey} {...props} />`, De, re, Zr, re), or[re + De] = !0;
1570
+ <%s key={someKey} {...props} />`, je, re, et, re), or[re + je] = !0;
1565
1571
  }
1566
1572
  }
1567
- return e === y ? Kr(I) : Br(I), I;
1573
+ return e === h ? xr(I) : Kr(I), I;
1568
1574
  }
1569
1575
  }
1570
- function xr(e, s, b) {
1576
+ function Qr(e, s, b) {
1571
1577
  return cr(e, s, b, !0);
1572
1578
  }
1573
- function Qr(e, s, b) {
1579
+ function zr(e, s, b) {
1574
1580
  return cr(e, s, b, !1);
1575
1581
  }
1576
- var zr = Qr, Xr = xr;
1577
- he.Fragment = y, he.jsx = zr, he.jsxs = Xr;
1582
+ var Xr = zr, Zr = Qr;
1583
+ he.Fragment = h, he.jsx = Xr, he.jsxs = Zr;
1578
1584
  })()), he;
1579
1585
  }
1580
- var Rr;
1586
+ var Cr;
1581
1587
  function Rt() {
1582
- return Rr || (Rr = 1, process.env.NODE_ENV === "production" ? Ae.exports = Tt() : Ae.exports = mt()), Ae.exports;
1588
+ return Cr || (Cr = 1, process.env.NODE_ENV === "production" ? Pe.exports = Tt() : Pe.exports = mt()), Pe.exports;
1583
1589
  }
1584
- var Cr = Rt();
1590
+ var wr = Rt();
1585
1591
  function Mt({ children: r, ...g }) {
1586
1592
  const O = Je(() => st(g), [g]), v = Je(
1587
- () => new tt({
1593
+ () => new nt({
1588
1594
  defaultOptions: {
1589
1595
  queries: {
1590
1596
  refetchOnWindowFocus: !1,
@@ -1594,12 +1600,12 @@ function Mt({ children: r, ...g }) {
1594
1600
  }),
1595
1601
  []
1596
1602
  );
1597
- return /* @__PURE__ */ Cr.jsx(nt, { client: v, children: /* @__PURE__ */ Cr.jsx(wr.Provider, { value: { client: O, ...g }, children: r }) });
1603
+ return /* @__PURE__ */ wr.jsx(at, { client: v, children: /* @__PURE__ */ wr.jsx(Ar.Provider, { value: { client: O, ...g }, children: r }) });
1598
1604
  }
1599
1605
  export {
1600
- wr as ApiCtx,
1606
+ Ar as ApiCtx,
1601
1607
  Mt as ApiProvider,
1602
- Ar as useApiContext,
1608
+ Pr as useApiContext,
1603
1609
  It as useClientWebSocket,
1604
1610
  Nt as usePeriodicDataUpdater
1605
1611
  };