@ichaingo/web-worker 1.3.94
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/README.md +7 -0
- package/dist/assets/webWorker-CvepzMkT.js +1419 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -0
- package/dist/webWorker.d.ts +9 -0
- package/dist/webWorker.d.ts.map +1 -0
- package/dist/webWorker.js +20 -0
- package/package.json +32 -0
|
@@ -0,0 +1,1419 @@
|
|
|
1
|
+
var Ge = Object.defineProperty;
|
|
2
|
+
var Be = (v, r, h) => r in v ? Ge(v, r, { enumerable: !0, configurable: !0, writable: !0, value: h }) : v[r] = h;
|
|
3
|
+
var D = (v, r, h) => Be(v, typeof r != "symbol" ? r + "" : r, h);
|
|
4
|
+
var Ie;
|
|
5
|
+
(function(v) {
|
|
6
|
+
v.ALL_CHAIN_LATEST_BLOCK = "allChainLatestBlock", v.CHAIN_LATEST_BLOCK = "chainLatestBlock";
|
|
7
|
+
})(Ie || (Ie = {}));
|
|
8
|
+
var P;
|
|
9
|
+
(function(v) {
|
|
10
|
+
v.CONNECTING = "connecting", v.CONNECTED = "connected", v.DISCONNECTED = "disconnected", v.RECONNECTING = "reconnecting", v.ERROR = "error";
|
|
11
|
+
})(P || (P = {}));
|
|
12
|
+
var Ee = { exports: {} }, f = {};
|
|
13
|
+
/**
|
|
14
|
+
* @license React
|
|
15
|
+
* react.production.js
|
|
16
|
+
*
|
|
17
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the MIT license found in the
|
|
20
|
+
* LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/
|
|
22
|
+
var Me;
|
|
23
|
+
function Ke() {
|
|
24
|
+
if (Me) return f;
|
|
25
|
+
Me = 1;
|
|
26
|
+
var v = Symbol.for("react.transitional.element"), r = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), M = Symbol.for("react.profiler"), k = Symbol.for("react.consumer"), z = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), $ = Symbol.for("react.memo"), G = Symbol.for("react.lazy"), F = Symbol.iterator;
|
|
27
|
+
function ue(t) {
|
|
28
|
+
return t === null || typeof t != "object" ? null : (t = F && t[F] || t["@@iterator"], typeof t == "function" ? t : null);
|
|
29
|
+
}
|
|
30
|
+
var x = {
|
|
31
|
+
isMounted: function() {
|
|
32
|
+
return !1;
|
|
33
|
+
},
|
|
34
|
+
enqueueForceUpdate: function() {
|
|
35
|
+
},
|
|
36
|
+
enqueueReplaceState: function() {
|
|
37
|
+
},
|
|
38
|
+
enqueueSetState: function() {
|
|
39
|
+
}
|
|
40
|
+
}, J = Object.assign, ie = {};
|
|
41
|
+
function H(t, o, c) {
|
|
42
|
+
this.props = t, this.context = o, this.refs = ie, this.updater = c || x;
|
|
43
|
+
}
|
|
44
|
+
H.prototype.isReactComponent = {}, H.prototype.setState = function(t, o) {
|
|
45
|
+
if (typeof t != "object" && typeof t != "function" && t != null)
|
|
46
|
+
throw Error(
|
|
47
|
+
"takes an object of state variables to update or a function which returns an object of state variables."
|
|
48
|
+
);
|
|
49
|
+
this.updater.enqueueSetState(this, t, o, "setState");
|
|
50
|
+
}, H.prototype.forceUpdate = function(t) {
|
|
51
|
+
this.updater.enqueueForceUpdate(this, t, "forceUpdate");
|
|
52
|
+
};
|
|
53
|
+
function Q() {
|
|
54
|
+
}
|
|
55
|
+
Q.prototype = H.prototype;
|
|
56
|
+
function ee(t, o, c) {
|
|
57
|
+
this.props = t, this.context = o, this.refs = ie, this.updater = c || x;
|
|
58
|
+
}
|
|
59
|
+
var L = ee.prototype = new Q();
|
|
60
|
+
L.constructor = ee, J(L, H.prototype), L.isPureReactComponent = !0;
|
|
61
|
+
var ae = Array.isArray, g = { H: null, A: null, T: null, S: null, V: null }, te = Object.prototype.hasOwnProperty;
|
|
62
|
+
function ne(t, o, c, a, _, R) {
|
|
63
|
+
return c = R.ref, {
|
|
64
|
+
$$typeof: v,
|
|
65
|
+
type: t,
|
|
66
|
+
key: o,
|
|
67
|
+
ref: c !== void 0 ? c : null,
|
|
68
|
+
props: R
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function Y(t, o) {
|
|
72
|
+
return ne(
|
|
73
|
+
t.type,
|
|
74
|
+
o,
|
|
75
|
+
void 0,
|
|
76
|
+
void 0,
|
|
77
|
+
void 0,
|
|
78
|
+
t.props
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
function U(t) {
|
|
82
|
+
return typeof t == "object" && t !== null && t.$$typeof === v;
|
|
83
|
+
}
|
|
84
|
+
function me(t) {
|
|
85
|
+
var o = { "=": "=0", ":": "=2" };
|
|
86
|
+
return "$" + t.replace(/[=:]/g, function(c) {
|
|
87
|
+
return o[c];
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
var T = /\/+/g;
|
|
91
|
+
function re(t, o) {
|
|
92
|
+
return typeof t == "object" && t !== null && t.key != null ? me("" + t.key) : o.toString(36);
|
|
93
|
+
}
|
|
94
|
+
function B() {
|
|
95
|
+
}
|
|
96
|
+
function K(t) {
|
|
97
|
+
switch (t.status) {
|
|
98
|
+
case "fulfilled":
|
|
99
|
+
return t.value;
|
|
100
|
+
case "rejected":
|
|
101
|
+
throw t.reason;
|
|
102
|
+
default:
|
|
103
|
+
switch (typeof t.status == "string" ? t.then(B, B) : (t.status = "pending", t.then(
|
|
104
|
+
function(o) {
|
|
105
|
+
t.status === "pending" && (t.status = "fulfilled", t.value = o);
|
|
106
|
+
},
|
|
107
|
+
function(o) {
|
|
108
|
+
t.status === "pending" && (t.status = "rejected", t.reason = o);
|
|
109
|
+
}
|
|
110
|
+
)), t.status) {
|
|
111
|
+
case "fulfilled":
|
|
112
|
+
return t.value;
|
|
113
|
+
case "rejected":
|
|
114
|
+
throw t.reason;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
throw t;
|
|
118
|
+
}
|
|
119
|
+
function j(t, o, c, a, _) {
|
|
120
|
+
var R = typeof t;
|
|
121
|
+
(R === "undefined" || R === "boolean") && (t = null);
|
|
122
|
+
var p = !1;
|
|
123
|
+
if (t === null) p = !0;
|
|
124
|
+
else
|
|
125
|
+
switch (R) {
|
|
126
|
+
case "bigint":
|
|
127
|
+
case "string":
|
|
128
|
+
case "number":
|
|
129
|
+
p = !0;
|
|
130
|
+
break;
|
|
131
|
+
case "object":
|
|
132
|
+
switch (t.$$typeof) {
|
|
133
|
+
case v:
|
|
134
|
+
case r:
|
|
135
|
+
p = !0;
|
|
136
|
+
break;
|
|
137
|
+
case G:
|
|
138
|
+
return p = t._init, j(
|
|
139
|
+
p(t._payload),
|
|
140
|
+
o,
|
|
141
|
+
c,
|
|
142
|
+
a,
|
|
143
|
+
_
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (p)
|
|
148
|
+
return _ = _(t), p = a === "" ? "." + re(t, 0) : a, ae(_) ? (c = "", p != null && (c = p.replace(T, "$&/") + "/"), j(_, o, c, "", function(V) {
|
|
149
|
+
return V;
|
|
150
|
+
})) : _ != null && (U(_) && (_ = Y(
|
|
151
|
+
_,
|
|
152
|
+
c + (_.key == null || t && t.key === _.key ? "" : ("" + _.key).replace(
|
|
153
|
+
T,
|
|
154
|
+
"$&/"
|
|
155
|
+
) + "/") + p
|
|
156
|
+
)), o.push(_)), 1;
|
|
157
|
+
p = 0;
|
|
158
|
+
var I = a === "" ? "." : a + ":";
|
|
159
|
+
if (ae(t))
|
|
160
|
+
for (var w = 0; w < t.length; w++)
|
|
161
|
+
a = t[w], R = I + re(a, w), p += j(
|
|
162
|
+
a,
|
|
163
|
+
o,
|
|
164
|
+
c,
|
|
165
|
+
R,
|
|
166
|
+
_
|
|
167
|
+
);
|
|
168
|
+
else if (w = ue(t), typeof w == "function")
|
|
169
|
+
for (t = w.call(t), w = 0; !(a = t.next()).done; )
|
|
170
|
+
a = a.value, R = I + re(a, w++), p += j(
|
|
171
|
+
a,
|
|
172
|
+
o,
|
|
173
|
+
c,
|
|
174
|
+
R,
|
|
175
|
+
_
|
|
176
|
+
);
|
|
177
|
+
else if (R === "object") {
|
|
178
|
+
if (typeof t.then == "function")
|
|
179
|
+
return j(
|
|
180
|
+
K(t),
|
|
181
|
+
o,
|
|
182
|
+
c,
|
|
183
|
+
a,
|
|
184
|
+
_
|
|
185
|
+
);
|
|
186
|
+
throw o = String(t), Error(
|
|
187
|
+
"Objects are not valid as a React child (found: " + (o === "[object Object]" ? "object with keys {" + Object.keys(t).join(", ") + "}" : o) + "). If you meant to render a collection of children, use an array instead."
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
return p;
|
|
191
|
+
}
|
|
192
|
+
function W(t, o, c) {
|
|
193
|
+
if (t == null) return t;
|
|
194
|
+
var a = [], _ = 0;
|
|
195
|
+
return j(t, a, "", "", function(R) {
|
|
196
|
+
return o.call(c, R, _++);
|
|
197
|
+
}), a;
|
|
198
|
+
}
|
|
199
|
+
function oe(t) {
|
|
200
|
+
if (t._status === -1) {
|
|
201
|
+
var o = t._result;
|
|
202
|
+
o = o(), o.then(
|
|
203
|
+
function(c) {
|
|
204
|
+
(t._status === 0 || t._status === -1) && (t._status = 1, t._result = c);
|
|
205
|
+
},
|
|
206
|
+
function(c) {
|
|
207
|
+
(t._status === 0 || t._status === -1) && (t._status = 2, t._result = c);
|
|
208
|
+
}
|
|
209
|
+
), t._status === -1 && (t._status = 0, t._result = o);
|
|
210
|
+
}
|
|
211
|
+
if (t._status === 1) return t._result.default;
|
|
212
|
+
throw t._result;
|
|
213
|
+
}
|
|
214
|
+
var X = typeof reportError == "function" ? reportError : function(t) {
|
|
215
|
+
if (typeof window == "object" && typeof window.ErrorEvent == "function") {
|
|
216
|
+
var o = new window.ErrorEvent("error", {
|
|
217
|
+
bubbles: !0,
|
|
218
|
+
cancelable: !0,
|
|
219
|
+
message: typeof t == "object" && t !== null && typeof t.message == "string" ? String(t.message) : String(t),
|
|
220
|
+
error: t
|
|
221
|
+
});
|
|
222
|
+
if (!window.dispatchEvent(o)) return;
|
|
223
|
+
} else if (typeof process == "object" && typeof process.emit == "function") {
|
|
224
|
+
process.emit("uncaughtException", t);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
console.error(t);
|
|
228
|
+
};
|
|
229
|
+
function ce() {
|
|
230
|
+
}
|
|
231
|
+
return f.Children = {
|
|
232
|
+
map: W,
|
|
233
|
+
forEach: function(t, o, c) {
|
|
234
|
+
W(
|
|
235
|
+
t,
|
|
236
|
+
function() {
|
|
237
|
+
o.apply(this, arguments);
|
|
238
|
+
},
|
|
239
|
+
c
|
|
240
|
+
);
|
|
241
|
+
},
|
|
242
|
+
count: function(t) {
|
|
243
|
+
var o = 0;
|
|
244
|
+
return W(t, function() {
|
|
245
|
+
o++;
|
|
246
|
+
}), o;
|
|
247
|
+
},
|
|
248
|
+
toArray: function(t) {
|
|
249
|
+
return W(t, function(o) {
|
|
250
|
+
return o;
|
|
251
|
+
}) || [];
|
|
252
|
+
},
|
|
253
|
+
only: function(t) {
|
|
254
|
+
if (!U(t))
|
|
255
|
+
throw Error(
|
|
256
|
+
"React.Children.only expected to receive a single React element child."
|
|
257
|
+
);
|
|
258
|
+
return t;
|
|
259
|
+
}
|
|
260
|
+
}, f.Component = H, f.Fragment = h, f.Profiler = M, f.PureComponent = ee, f.StrictMode = b, f.Suspense = A, f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = g, f.__COMPILER_RUNTIME = {
|
|
261
|
+
__proto__: null,
|
|
262
|
+
c: function(t) {
|
|
263
|
+
return g.H.useMemoCache(t);
|
|
264
|
+
}
|
|
265
|
+
}, f.cache = function(t) {
|
|
266
|
+
return function() {
|
|
267
|
+
return t.apply(null, arguments);
|
|
268
|
+
};
|
|
269
|
+
}, f.cloneElement = function(t, o, c) {
|
|
270
|
+
if (t == null)
|
|
271
|
+
throw Error(
|
|
272
|
+
"The argument must be a React element, but you passed " + t + "."
|
|
273
|
+
);
|
|
274
|
+
var a = J({}, t.props), _ = t.key, R = void 0;
|
|
275
|
+
if (o != null)
|
|
276
|
+
for (p in o.ref !== void 0 && (R = void 0), o.key !== void 0 && (_ = "" + o.key), o)
|
|
277
|
+
!te.call(o, p) || p === "key" || p === "__self" || p === "__source" || p === "ref" && o.ref === void 0 || (a[p] = o[p]);
|
|
278
|
+
var p = arguments.length - 2;
|
|
279
|
+
if (p === 1) a.children = c;
|
|
280
|
+
else if (1 < p) {
|
|
281
|
+
for (var I = Array(p), w = 0; w < p; w++)
|
|
282
|
+
I[w] = arguments[w + 2];
|
|
283
|
+
a.children = I;
|
|
284
|
+
}
|
|
285
|
+
return ne(t.type, _, void 0, void 0, R, a);
|
|
286
|
+
}, f.createContext = function(t) {
|
|
287
|
+
return t = {
|
|
288
|
+
$$typeof: z,
|
|
289
|
+
_currentValue: t,
|
|
290
|
+
_currentValue2: t,
|
|
291
|
+
_threadCount: 0,
|
|
292
|
+
Provider: null,
|
|
293
|
+
Consumer: null
|
|
294
|
+
}, t.Provider = t, t.Consumer = {
|
|
295
|
+
$$typeof: k,
|
|
296
|
+
_context: t
|
|
297
|
+
}, t;
|
|
298
|
+
}, f.createElement = function(t, o, c) {
|
|
299
|
+
var a, _ = {}, R = null;
|
|
300
|
+
if (o != null)
|
|
301
|
+
for (a in o.key !== void 0 && (R = "" + o.key), o)
|
|
302
|
+
te.call(o, a) && a !== "key" && a !== "__self" && a !== "__source" && (_[a] = o[a]);
|
|
303
|
+
var p = arguments.length - 2;
|
|
304
|
+
if (p === 1) _.children = c;
|
|
305
|
+
else if (1 < p) {
|
|
306
|
+
for (var I = Array(p), w = 0; w < p; w++)
|
|
307
|
+
I[w] = arguments[w + 2];
|
|
308
|
+
_.children = I;
|
|
309
|
+
}
|
|
310
|
+
if (t && t.defaultProps)
|
|
311
|
+
for (a in p = t.defaultProps, p)
|
|
312
|
+
_[a] === void 0 && (_[a] = p[a]);
|
|
313
|
+
return ne(t, R, void 0, void 0, null, _);
|
|
314
|
+
}, f.createRef = function() {
|
|
315
|
+
return { current: null };
|
|
316
|
+
}, f.forwardRef = function(t) {
|
|
317
|
+
return { $$typeof: O, render: t };
|
|
318
|
+
}, f.isValidElement = U, f.lazy = function(t) {
|
|
319
|
+
return {
|
|
320
|
+
$$typeof: G,
|
|
321
|
+
_payload: { _status: -1, _result: t },
|
|
322
|
+
_init: oe
|
|
323
|
+
};
|
|
324
|
+
}, f.memo = function(t, o) {
|
|
325
|
+
return {
|
|
326
|
+
$$typeof: $,
|
|
327
|
+
type: t,
|
|
328
|
+
compare: o === void 0 ? null : o
|
|
329
|
+
};
|
|
330
|
+
}, f.startTransition = function(t) {
|
|
331
|
+
var o = g.T, c = {};
|
|
332
|
+
g.T = c;
|
|
333
|
+
try {
|
|
334
|
+
var a = t(), _ = g.S;
|
|
335
|
+
_ !== null && _(c, a), typeof a == "object" && a !== null && typeof a.then == "function" && a.then(ce, X);
|
|
336
|
+
} catch (R) {
|
|
337
|
+
X(R);
|
|
338
|
+
} finally {
|
|
339
|
+
g.T = o;
|
|
340
|
+
}
|
|
341
|
+
}, f.unstable_useCacheRefresh = function() {
|
|
342
|
+
return g.H.useCacheRefresh();
|
|
343
|
+
}, f.use = function(t) {
|
|
344
|
+
return g.H.use(t);
|
|
345
|
+
}, f.useActionState = function(t, o, c) {
|
|
346
|
+
return g.H.useActionState(t, o, c);
|
|
347
|
+
}, f.useCallback = function(t, o) {
|
|
348
|
+
return g.H.useCallback(t, o);
|
|
349
|
+
}, f.useContext = function(t) {
|
|
350
|
+
return g.H.useContext(t);
|
|
351
|
+
}, f.useDebugValue = function() {
|
|
352
|
+
}, f.useDeferredValue = function(t, o) {
|
|
353
|
+
return g.H.useDeferredValue(t, o);
|
|
354
|
+
}, f.useEffect = function(t, o, c) {
|
|
355
|
+
var a = g.H;
|
|
356
|
+
if (typeof c == "function")
|
|
357
|
+
throw Error(
|
|
358
|
+
"useEffect CRUD overload is not enabled in this build of React."
|
|
359
|
+
);
|
|
360
|
+
return a.useEffect(t, o);
|
|
361
|
+
}, f.useId = function() {
|
|
362
|
+
return g.H.useId();
|
|
363
|
+
}, f.useImperativeHandle = function(t, o, c) {
|
|
364
|
+
return g.H.useImperativeHandle(t, o, c);
|
|
365
|
+
}, f.useInsertionEffect = function(t, o) {
|
|
366
|
+
return g.H.useInsertionEffect(t, o);
|
|
367
|
+
}, f.useLayoutEffect = function(t, o) {
|
|
368
|
+
return g.H.useLayoutEffect(t, o);
|
|
369
|
+
}, f.useMemo = function(t, o) {
|
|
370
|
+
return g.H.useMemo(t, o);
|
|
371
|
+
}, f.useOptimistic = function(t, o) {
|
|
372
|
+
return g.H.useOptimistic(t, o);
|
|
373
|
+
}, f.useReducer = function(t, o, c) {
|
|
374
|
+
return g.H.useReducer(t, o, c);
|
|
375
|
+
}, f.useRef = function(t) {
|
|
376
|
+
return g.H.useRef(t);
|
|
377
|
+
}, f.useState = function(t) {
|
|
378
|
+
return g.H.useState(t);
|
|
379
|
+
}, f.useSyncExternalStore = function(t, o, c) {
|
|
380
|
+
return g.H.useSyncExternalStore(
|
|
381
|
+
t,
|
|
382
|
+
o,
|
|
383
|
+
c
|
|
384
|
+
);
|
|
385
|
+
}, f.useTransition = function() {
|
|
386
|
+
return g.H.useTransition();
|
|
387
|
+
}, f.version = "19.1.1", f;
|
|
388
|
+
}
|
|
389
|
+
var se = { exports: {} };
|
|
390
|
+
/**
|
|
391
|
+
* @license React
|
|
392
|
+
* react.development.js
|
|
393
|
+
*
|
|
394
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
395
|
+
*
|
|
396
|
+
* This source code is licensed under the MIT license found in the
|
|
397
|
+
* LICENSE file in the root directory of this source tree.
|
|
398
|
+
*/
|
|
399
|
+
se.exports;
|
|
400
|
+
var $e;
|
|
401
|
+
function Qe() {
|
|
402
|
+
return $e || ($e = 1, (function(v, r) {
|
|
403
|
+
process.env.NODE_ENV !== "production" && (function() {
|
|
404
|
+
function h(e, n) {
|
|
405
|
+
Object.defineProperty(k.prototype, e, {
|
|
406
|
+
get: function() {
|
|
407
|
+
console.warn(
|
|
408
|
+
"%s(...) is deprecated in plain JavaScript React classes. %s",
|
|
409
|
+
n[0],
|
|
410
|
+
n[1]
|
|
411
|
+
);
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
function b(e) {
|
|
416
|
+
return e === null || typeof e != "object" ? null : (e = ve && e[ve] || e["@@iterator"], typeof e == "function" ? e : null);
|
|
417
|
+
}
|
|
418
|
+
function M(e, n) {
|
|
419
|
+
e = (e = e.constructor) && (e.displayName || e.name) || "ReactClass";
|
|
420
|
+
var s = e + "." + n;
|
|
421
|
+
Re[s] || (console.error(
|
|
422
|
+
"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
|
|
423
|
+
n,
|
|
424
|
+
e
|
|
425
|
+
), Re[s] = !0);
|
|
426
|
+
}
|
|
427
|
+
function k(e, n, s) {
|
|
428
|
+
this.props = e, this.context = n, this.refs = _e, this.updater = s || Te;
|
|
429
|
+
}
|
|
430
|
+
function z() {
|
|
431
|
+
}
|
|
432
|
+
function O(e, n, s) {
|
|
433
|
+
this.props = e, this.context = n, this.refs = _e, this.updater = s || Te;
|
|
434
|
+
}
|
|
435
|
+
function A(e) {
|
|
436
|
+
return "" + e;
|
|
437
|
+
}
|
|
438
|
+
function $(e) {
|
|
439
|
+
try {
|
|
440
|
+
A(e);
|
|
441
|
+
var n = !1;
|
|
442
|
+
} catch {
|
|
443
|
+
n = !0;
|
|
444
|
+
}
|
|
445
|
+
if (n) {
|
|
446
|
+
n = console;
|
|
447
|
+
var s = n.error, u = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
448
|
+
return s.call(
|
|
449
|
+
n,
|
|
450
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
451
|
+
u
|
|
452
|
+
), A(e);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
function G(e) {
|
|
456
|
+
if (e == null) return null;
|
|
457
|
+
if (typeof e == "function")
|
|
458
|
+
return e.$$typeof === Ye ? null : e.displayName || e.name || null;
|
|
459
|
+
if (typeof e == "string") return e;
|
|
460
|
+
switch (e) {
|
|
461
|
+
case t:
|
|
462
|
+
return "Fragment";
|
|
463
|
+
case c:
|
|
464
|
+
return "Profiler";
|
|
465
|
+
case o:
|
|
466
|
+
return "StrictMode";
|
|
467
|
+
case p:
|
|
468
|
+
return "Suspense";
|
|
469
|
+
case I:
|
|
470
|
+
return "SuspenseList";
|
|
471
|
+
case He:
|
|
472
|
+
return "Activity";
|
|
473
|
+
}
|
|
474
|
+
if (typeof e == "object")
|
|
475
|
+
switch (typeof e.tag == "number" && console.error(
|
|
476
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
477
|
+
), e.$$typeof) {
|
|
478
|
+
case ce:
|
|
479
|
+
return "Portal";
|
|
480
|
+
case _:
|
|
481
|
+
return (e.displayName || "Context") + ".Provider";
|
|
482
|
+
case a:
|
|
483
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
484
|
+
case R:
|
|
485
|
+
var n = e.render;
|
|
486
|
+
return e = e.displayName, e || (e = n.displayName || n.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
487
|
+
case w:
|
|
488
|
+
return n = e.displayName || null, n !== null ? n : G(e.type) || "Memo";
|
|
489
|
+
case V:
|
|
490
|
+
n = e._payload, e = e._init;
|
|
491
|
+
try {
|
|
492
|
+
return G(e(n));
|
|
493
|
+
} catch {
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
return null;
|
|
497
|
+
}
|
|
498
|
+
function F(e) {
|
|
499
|
+
if (e === t) return "<>";
|
|
500
|
+
if (typeof e == "object" && e !== null && e.$$typeof === V)
|
|
501
|
+
return "<...>";
|
|
502
|
+
try {
|
|
503
|
+
var n = G(e);
|
|
504
|
+
return n ? "<" + n + ">" : "<...>";
|
|
505
|
+
} catch {
|
|
506
|
+
return "<...>";
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
function ue() {
|
|
510
|
+
var e = E.A;
|
|
511
|
+
return e === null ? null : e.getOwner();
|
|
512
|
+
}
|
|
513
|
+
function x() {
|
|
514
|
+
return Error("react-stack-top-frame");
|
|
515
|
+
}
|
|
516
|
+
function J(e) {
|
|
517
|
+
if (le.call(e, "key")) {
|
|
518
|
+
var n = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
519
|
+
if (n && n.isReactWarning) return !1;
|
|
520
|
+
}
|
|
521
|
+
return e.key !== void 0;
|
|
522
|
+
}
|
|
523
|
+
function ie(e, n) {
|
|
524
|
+
function s() {
|
|
525
|
+
Ce || (Ce = !0, console.error(
|
|
526
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
527
|
+
n
|
|
528
|
+
));
|
|
529
|
+
}
|
|
530
|
+
s.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
531
|
+
get: s,
|
|
532
|
+
configurable: !0
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
function H() {
|
|
536
|
+
var e = G(this.type);
|
|
537
|
+
return ke[e] || (ke[e] = !0, console.error(
|
|
538
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
539
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
540
|
+
}
|
|
541
|
+
function Q(e, n, s, u, i, m, l, y) {
|
|
542
|
+
return s = m.ref, e = {
|
|
543
|
+
$$typeof: X,
|
|
544
|
+
type: e,
|
|
545
|
+
key: n,
|
|
546
|
+
props: m,
|
|
547
|
+
_owner: i
|
|
548
|
+
}, (s !== void 0 ? s : null) !== null ? Object.defineProperty(e, "ref", {
|
|
549
|
+
enumerable: !1,
|
|
550
|
+
get: H
|
|
551
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
552
|
+
configurable: !1,
|
|
553
|
+
enumerable: !1,
|
|
554
|
+
writable: !0,
|
|
555
|
+
value: 0
|
|
556
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
557
|
+
configurable: !1,
|
|
558
|
+
enumerable: !1,
|
|
559
|
+
writable: !0,
|
|
560
|
+
value: null
|
|
561
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
562
|
+
configurable: !1,
|
|
563
|
+
enumerable: !1,
|
|
564
|
+
writable: !0,
|
|
565
|
+
value: l
|
|
566
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
567
|
+
configurable: !1,
|
|
568
|
+
enumerable: !1,
|
|
569
|
+
writable: !0,
|
|
570
|
+
value: y
|
|
571
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
572
|
+
}
|
|
573
|
+
function ee(e, n) {
|
|
574
|
+
return n = Q(
|
|
575
|
+
e.type,
|
|
576
|
+
n,
|
|
577
|
+
void 0,
|
|
578
|
+
void 0,
|
|
579
|
+
e._owner,
|
|
580
|
+
e.props,
|
|
581
|
+
e._debugStack,
|
|
582
|
+
e._debugTask
|
|
583
|
+
), e._store && (n._store.validated = e._store.validated), n;
|
|
584
|
+
}
|
|
585
|
+
function L(e) {
|
|
586
|
+
return typeof e == "object" && e !== null && e.$$typeof === X;
|
|
587
|
+
}
|
|
588
|
+
function ae(e) {
|
|
589
|
+
var n = { "=": "=0", ":": "=2" };
|
|
590
|
+
return "$" + e.replace(/[=:]/g, function(s) {
|
|
591
|
+
return n[s];
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
function g(e, n) {
|
|
595
|
+
return typeof e == "object" && e !== null && e.key != null ? ($(e.key), ae("" + e.key)) : n.toString(36);
|
|
596
|
+
}
|
|
597
|
+
function te() {
|
|
598
|
+
}
|
|
599
|
+
function ne(e) {
|
|
600
|
+
switch (e.status) {
|
|
601
|
+
case "fulfilled":
|
|
602
|
+
return e.value;
|
|
603
|
+
case "rejected":
|
|
604
|
+
throw e.reason;
|
|
605
|
+
default:
|
|
606
|
+
switch (typeof e.status == "string" ? e.then(te, te) : (e.status = "pending", e.then(
|
|
607
|
+
function(n) {
|
|
608
|
+
e.status === "pending" && (e.status = "fulfilled", e.value = n);
|
|
609
|
+
},
|
|
610
|
+
function(n) {
|
|
611
|
+
e.status === "pending" && (e.status = "rejected", e.reason = n);
|
|
612
|
+
}
|
|
613
|
+
)), e.status) {
|
|
614
|
+
case "fulfilled":
|
|
615
|
+
return e.value;
|
|
616
|
+
case "rejected":
|
|
617
|
+
throw e.reason;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
throw e;
|
|
621
|
+
}
|
|
622
|
+
function Y(e, n, s, u, i) {
|
|
623
|
+
var m = typeof e;
|
|
624
|
+
(m === "undefined" || m === "boolean") && (e = null);
|
|
625
|
+
var l = !1;
|
|
626
|
+
if (e === null) l = !0;
|
|
627
|
+
else
|
|
628
|
+
switch (m) {
|
|
629
|
+
case "bigint":
|
|
630
|
+
case "string":
|
|
631
|
+
case "number":
|
|
632
|
+
l = !0;
|
|
633
|
+
break;
|
|
634
|
+
case "object":
|
|
635
|
+
switch (e.$$typeof) {
|
|
636
|
+
case X:
|
|
637
|
+
case ce:
|
|
638
|
+
l = !0;
|
|
639
|
+
break;
|
|
640
|
+
case V:
|
|
641
|
+
return l = e._init, Y(
|
|
642
|
+
l(e._payload),
|
|
643
|
+
n,
|
|
644
|
+
s,
|
|
645
|
+
u,
|
|
646
|
+
i
|
|
647
|
+
);
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
if (l) {
|
|
651
|
+
l = e, i = i(l);
|
|
652
|
+
var y = u === "" ? "." + g(l, 0) : u;
|
|
653
|
+
return be(i) ? (s = "", y != null && (s = y.replace(Ne, "$&/") + "/"), Y(i, n, s, "", function(q) {
|
|
654
|
+
return q;
|
|
655
|
+
})) : i != null && (L(i) && (i.key != null && (l && l.key === i.key || $(i.key)), s = ee(
|
|
656
|
+
i,
|
|
657
|
+
s + (i.key == null || l && l.key === i.key ? "" : ("" + i.key).replace(
|
|
658
|
+
Ne,
|
|
659
|
+
"$&/"
|
|
660
|
+
) + "/") + y
|
|
661
|
+
), u !== "" && l != null && L(l) && l.key == null && l._store && !l._store.validated && (s._store.validated = 2), i = s), n.push(i)), 1;
|
|
662
|
+
}
|
|
663
|
+
if (l = 0, y = u === "" ? "." : u + ":", be(e))
|
|
664
|
+
for (var d = 0; d < e.length; d++)
|
|
665
|
+
u = e[d], m = y + g(u, d), l += Y(
|
|
666
|
+
u,
|
|
667
|
+
n,
|
|
668
|
+
s,
|
|
669
|
+
m,
|
|
670
|
+
i
|
|
671
|
+
);
|
|
672
|
+
else if (d = b(e), typeof d == "function")
|
|
673
|
+
for (d === e.entries && (Ae || console.warn(
|
|
674
|
+
"Using Maps as children is not supported. Use an array of keyed ReactElements instead."
|
|
675
|
+
), Ae = !0), e = d.call(e), d = 0; !(u = e.next()).done; )
|
|
676
|
+
u = u.value, m = y + g(u, d++), l += Y(
|
|
677
|
+
u,
|
|
678
|
+
n,
|
|
679
|
+
s,
|
|
680
|
+
m,
|
|
681
|
+
i
|
|
682
|
+
);
|
|
683
|
+
else if (m === "object") {
|
|
684
|
+
if (typeof e.then == "function")
|
|
685
|
+
return Y(
|
|
686
|
+
ne(e),
|
|
687
|
+
n,
|
|
688
|
+
s,
|
|
689
|
+
u,
|
|
690
|
+
i
|
|
691
|
+
);
|
|
692
|
+
throw n = String(e), Error(
|
|
693
|
+
"Objects are not valid as a React child (found: " + (n === "[object Object]" ? "object with keys {" + Object.keys(e).join(", ") + "}" : n) + "). If you meant to render a collection of children, use an array instead."
|
|
694
|
+
);
|
|
695
|
+
}
|
|
696
|
+
return l;
|
|
697
|
+
}
|
|
698
|
+
function U(e, n, s) {
|
|
699
|
+
if (e == null) return e;
|
|
700
|
+
var u = [], i = 0;
|
|
701
|
+
return Y(e, u, "", "", function(m) {
|
|
702
|
+
return n.call(s, m, i++);
|
|
703
|
+
}), u;
|
|
704
|
+
}
|
|
705
|
+
function me(e) {
|
|
706
|
+
if (e._status === -1) {
|
|
707
|
+
var n = e._result;
|
|
708
|
+
n = n(), n.then(
|
|
709
|
+
function(s) {
|
|
710
|
+
(e._status === 0 || e._status === -1) && (e._status = 1, e._result = s);
|
|
711
|
+
},
|
|
712
|
+
function(s) {
|
|
713
|
+
(e._status === 0 || e._status === -1) && (e._status = 2, e._result = s);
|
|
714
|
+
}
|
|
715
|
+
), e._status === -1 && (e._status = 0, e._result = n);
|
|
716
|
+
}
|
|
717
|
+
if (e._status === 1)
|
|
718
|
+
return n = e._result, n === void 0 && console.error(
|
|
719
|
+
`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
720
|
+
|
|
721
|
+
Your code should look like:
|
|
722
|
+
const MyComponent = lazy(() => import('./MyComponent'))
|
|
723
|
+
|
|
724
|
+
Did you accidentally put curly braces around the import?`,
|
|
725
|
+
n
|
|
726
|
+
), "default" in n || console.error(
|
|
727
|
+
`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
728
|
+
|
|
729
|
+
Your code should look like:
|
|
730
|
+
const MyComponent = lazy(() => import('./MyComponent'))`,
|
|
731
|
+
n
|
|
732
|
+
), n.default;
|
|
733
|
+
throw e._result;
|
|
734
|
+
}
|
|
735
|
+
function T() {
|
|
736
|
+
var e = E.H;
|
|
737
|
+
return e === null && console.error(
|
|
738
|
+
`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
739
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
740
|
+
2. You might be breaking the Rules of Hooks
|
|
741
|
+
3. You might have more than one copy of React in the same app
|
|
742
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
|
|
743
|
+
), e;
|
|
744
|
+
}
|
|
745
|
+
function re() {
|
|
746
|
+
}
|
|
747
|
+
function B(e) {
|
|
748
|
+
if (pe === null)
|
|
749
|
+
try {
|
|
750
|
+
var n = ("require" + Math.random()).slice(0, 7);
|
|
751
|
+
pe = (v && v[n]).call(
|
|
752
|
+
v,
|
|
753
|
+
"timers"
|
|
754
|
+
).setImmediate;
|
|
755
|
+
} catch {
|
|
756
|
+
pe = function(u) {
|
|
757
|
+
je === !1 && (je = !0, typeof MessageChannel > "u" && console.error(
|
|
758
|
+
"This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
|
|
759
|
+
));
|
|
760
|
+
var i = new MessageChannel();
|
|
761
|
+
i.port1.onmessage = u, i.port2.postMessage(void 0);
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
return pe(e);
|
|
765
|
+
}
|
|
766
|
+
function K(e) {
|
|
767
|
+
return 1 < e.length && typeof AggregateError == "function" ? new AggregateError(e) : e[0];
|
|
768
|
+
}
|
|
769
|
+
function j(e, n) {
|
|
770
|
+
n !== de - 1 && console.error(
|
|
771
|
+
"You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
|
|
772
|
+
), de = n;
|
|
773
|
+
}
|
|
774
|
+
function W(e, n, s) {
|
|
775
|
+
var u = E.actQueue;
|
|
776
|
+
if (u !== null)
|
|
777
|
+
if (u.length !== 0)
|
|
778
|
+
try {
|
|
779
|
+
oe(u), B(function() {
|
|
780
|
+
return W(e, n, s);
|
|
781
|
+
});
|
|
782
|
+
return;
|
|
783
|
+
} catch (i) {
|
|
784
|
+
E.thrownErrors.push(i);
|
|
785
|
+
}
|
|
786
|
+
else E.actQueue = null;
|
|
787
|
+
0 < E.thrownErrors.length ? (u = K(E.thrownErrors), E.thrownErrors.length = 0, s(u)) : n(e);
|
|
788
|
+
}
|
|
789
|
+
function oe(e) {
|
|
790
|
+
if (!ye) {
|
|
791
|
+
ye = !0;
|
|
792
|
+
var n = 0;
|
|
793
|
+
try {
|
|
794
|
+
for (; n < e.length; n++) {
|
|
795
|
+
var s = e[n];
|
|
796
|
+
do {
|
|
797
|
+
E.didUsePromise = !1;
|
|
798
|
+
var u = s(!1);
|
|
799
|
+
if (u !== null) {
|
|
800
|
+
if (E.didUsePromise) {
|
|
801
|
+
e[n] = s, e.splice(0, n);
|
|
802
|
+
return;
|
|
803
|
+
}
|
|
804
|
+
s = u;
|
|
805
|
+
} else break;
|
|
806
|
+
} while (!0);
|
|
807
|
+
}
|
|
808
|
+
e.length = 0;
|
|
809
|
+
} catch (i) {
|
|
810
|
+
e.splice(0, n + 1), E.thrownErrors.push(i);
|
|
811
|
+
} finally {
|
|
812
|
+
ye = !1;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
817
|
+
var X = Symbol.for("react.transitional.element"), ce = Symbol.for("react.portal"), t = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), a = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), R = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), I = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), V = Symbol.for("react.lazy"), He = Symbol.for("react.activity"), ve = Symbol.iterator, Re = {}, Te = {
|
|
818
|
+
isMounted: function() {
|
|
819
|
+
return !1;
|
|
820
|
+
},
|
|
821
|
+
enqueueForceUpdate: function(e) {
|
|
822
|
+
M(e, "forceUpdate");
|
|
823
|
+
},
|
|
824
|
+
enqueueReplaceState: function(e) {
|
|
825
|
+
M(e, "replaceState");
|
|
826
|
+
},
|
|
827
|
+
enqueueSetState: function(e) {
|
|
828
|
+
M(e, "setState");
|
|
829
|
+
}
|
|
830
|
+
}, we = Object.assign, _e = {};
|
|
831
|
+
Object.freeze(_e), k.prototype.isReactComponent = {}, k.prototype.setState = function(e, n) {
|
|
832
|
+
if (typeof e != "object" && typeof e != "function" && e != null)
|
|
833
|
+
throw Error(
|
|
834
|
+
"takes an object of state variables to update or a function which returns an object of state variables."
|
|
835
|
+
);
|
|
836
|
+
this.updater.enqueueSetState(this, e, n, "setState");
|
|
837
|
+
}, k.prototype.forceUpdate = function(e) {
|
|
838
|
+
this.updater.enqueueForceUpdate(this, e, "forceUpdate");
|
|
839
|
+
};
|
|
840
|
+
var N = {
|
|
841
|
+
isMounted: [
|
|
842
|
+
"isMounted",
|
|
843
|
+
"Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
|
|
844
|
+
],
|
|
845
|
+
replaceState: [
|
|
846
|
+
"replaceState",
|
|
847
|
+
"Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
|
|
848
|
+
]
|
|
849
|
+
}, fe;
|
|
850
|
+
for (fe in N)
|
|
851
|
+
N.hasOwnProperty(fe) && h(fe, N[fe]);
|
|
852
|
+
z.prototype = k.prototype, N = O.prototype = new z(), N.constructor = O, we(N, k.prototype), N.isPureReactComponent = !0;
|
|
853
|
+
var be = Array.isArray, Ye = Symbol.for("react.client.reference"), E = {
|
|
854
|
+
H: null,
|
|
855
|
+
A: null,
|
|
856
|
+
T: null,
|
|
857
|
+
S: null,
|
|
858
|
+
V: null,
|
|
859
|
+
actQueue: null,
|
|
860
|
+
isBatchingLegacy: !1,
|
|
861
|
+
didScheduleLegacyUpdate: !1,
|
|
862
|
+
didUsePromise: !1,
|
|
863
|
+
thrownErrors: [],
|
|
864
|
+
getCurrentStack: null,
|
|
865
|
+
recentlyCreatedOwnerStacks: 0
|
|
866
|
+
}, le = Object.prototype.hasOwnProperty, Oe = console.createTask ? console.createTask : function() {
|
|
867
|
+
return null;
|
|
868
|
+
};
|
|
869
|
+
N = {
|
|
870
|
+
react_stack_bottom_frame: function(e) {
|
|
871
|
+
return e();
|
|
872
|
+
}
|
|
873
|
+
};
|
|
874
|
+
var Ce, Se, ke = {}, Ue = N.react_stack_bottom_frame.bind(
|
|
875
|
+
N,
|
|
876
|
+
x
|
|
877
|
+
)(), We = Oe(F(x)), Ae = !1, Ne = /\/+/g, Pe = typeof reportError == "function" ? reportError : function(e) {
|
|
878
|
+
if (typeof window == "object" && typeof window.ErrorEvent == "function") {
|
|
879
|
+
var n = new window.ErrorEvent("error", {
|
|
880
|
+
bubbles: !0,
|
|
881
|
+
cancelable: !0,
|
|
882
|
+
message: typeof e == "object" && e !== null && typeof e.message == "string" ? String(e.message) : String(e),
|
|
883
|
+
error: e
|
|
884
|
+
});
|
|
885
|
+
if (!window.dispatchEvent(n)) return;
|
|
886
|
+
} else if (typeof process == "object" && typeof process.emit == "function") {
|
|
887
|
+
process.emit("uncaughtException", e);
|
|
888
|
+
return;
|
|
889
|
+
}
|
|
890
|
+
console.error(e);
|
|
891
|
+
}, je = !1, pe = null, de = 0, he = !1, ye = !1, Le = typeof queueMicrotask == "function" ? function(e) {
|
|
892
|
+
queueMicrotask(function() {
|
|
893
|
+
return queueMicrotask(e);
|
|
894
|
+
});
|
|
895
|
+
} : B;
|
|
896
|
+
N = Object.freeze({
|
|
897
|
+
__proto__: null,
|
|
898
|
+
c: function(e) {
|
|
899
|
+
return T().useMemoCache(e);
|
|
900
|
+
}
|
|
901
|
+
}), r.Children = {
|
|
902
|
+
map: U,
|
|
903
|
+
forEach: function(e, n, s) {
|
|
904
|
+
U(
|
|
905
|
+
e,
|
|
906
|
+
function() {
|
|
907
|
+
n.apply(this, arguments);
|
|
908
|
+
},
|
|
909
|
+
s
|
|
910
|
+
);
|
|
911
|
+
},
|
|
912
|
+
count: function(e) {
|
|
913
|
+
var n = 0;
|
|
914
|
+
return U(e, function() {
|
|
915
|
+
n++;
|
|
916
|
+
}), n;
|
|
917
|
+
},
|
|
918
|
+
toArray: function(e) {
|
|
919
|
+
return U(e, function(n) {
|
|
920
|
+
return n;
|
|
921
|
+
}) || [];
|
|
922
|
+
},
|
|
923
|
+
only: function(e) {
|
|
924
|
+
if (!L(e))
|
|
925
|
+
throw Error(
|
|
926
|
+
"React.Children.only expected to receive a single React element child."
|
|
927
|
+
);
|
|
928
|
+
return e;
|
|
929
|
+
}
|
|
930
|
+
}, r.Component = k, r.Fragment = t, r.Profiler = c, r.PureComponent = O, r.StrictMode = o, r.Suspense = p, r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = E, r.__COMPILER_RUNTIME = N, r.act = function(e) {
|
|
931
|
+
var n = E.actQueue, s = de;
|
|
932
|
+
de++;
|
|
933
|
+
var u = E.actQueue = n !== null ? n : [], i = !1;
|
|
934
|
+
try {
|
|
935
|
+
var m = e();
|
|
936
|
+
} catch (d) {
|
|
937
|
+
E.thrownErrors.push(d);
|
|
938
|
+
}
|
|
939
|
+
if (0 < E.thrownErrors.length)
|
|
940
|
+
throw j(n, s), e = K(E.thrownErrors), E.thrownErrors.length = 0, e;
|
|
941
|
+
if (m !== null && typeof m == "object" && typeof m.then == "function") {
|
|
942
|
+
var l = m;
|
|
943
|
+
return Le(function() {
|
|
944
|
+
i || he || (he = !0, console.error(
|
|
945
|
+
"You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
|
|
946
|
+
));
|
|
947
|
+
}), {
|
|
948
|
+
then: function(d, q) {
|
|
949
|
+
i = !0, l.then(
|
|
950
|
+
function(Z) {
|
|
951
|
+
if (j(n, s), s === 0) {
|
|
952
|
+
try {
|
|
953
|
+
oe(u), B(function() {
|
|
954
|
+
return W(
|
|
955
|
+
Z,
|
|
956
|
+
d,
|
|
957
|
+
q
|
|
958
|
+
);
|
|
959
|
+
});
|
|
960
|
+
} catch (ze) {
|
|
961
|
+
E.thrownErrors.push(ze);
|
|
962
|
+
}
|
|
963
|
+
if (0 < E.thrownErrors.length) {
|
|
964
|
+
var qe = K(
|
|
965
|
+
E.thrownErrors
|
|
966
|
+
);
|
|
967
|
+
E.thrownErrors.length = 0, q(qe);
|
|
968
|
+
}
|
|
969
|
+
} else d(Z);
|
|
970
|
+
},
|
|
971
|
+
function(Z) {
|
|
972
|
+
j(n, s), 0 < E.thrownErrors.length && (Z = K(
|
|
973
|
+
E.thrownErrors
|
|
974
|
+
), E.thrownErrors.length = 0), q(Z);
|
|
975
|
+
}
|
|
976
|
+
);
|
|
977
|
+
}
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
var y = m;
|
|
981
|
+
if (j(n, s), s === 0 && (oe(u), u.length !== 0 && Le(function() {
|
|
982
|
+
i || he || (he = !0, console.error(
|
|
983
|
+
"A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
|
|
984
|
+
));
|
|
985
|
+
}), E.actQueue = null), 0 < E.thrownErrors.length)
|
|
986
|
+
throw e = K(E.thrownErrors), E.thrownErrors.length = 0, e;
|
|
987
|
+
return {
|
|
988
|
+
then: function(d, q) {
|
|
989
|
+
i = !0, s === 0 ? (E.actQueue = u, B(function() {
|
|
990
|
+
return W(
|
|
991
|
+
y,
|
|
992
|
+
d,
|
|
993
|
+
q
|
|
994
|
+
);
|
|
995
|
+
})) : d(y);
|
|
996
|
+
}
|
|
997
|
+
};
|
|
998
|
+
}, r.cache = function(e) {
|
|
999
|
+
return function() {
|
|
1000
|
+
return e.apply(null, arguments);
|
|
1001
|
+
};
|
|
1002
|
+
}, r.captureOwnerStack = function() {
|
|
1003
|
+
var e = E.getCurrentStack;
|
|
1004
|
+
return e === null ? null : e();
|
|
1005
|
+
}, r.cloneElement = function(e, n, s) {
|
|
1006
|
+
if (e == null)
|
|
1007
|
+
throw Error(
|
|
1008
|
+
"The argument must be a React element, but you passed " + e + "."
|
|
1009
|
+
);
|
|
1010
|
+
var u = we({}, e.props), i = e.key, m = e._owner;
|
|
1011
|
+
if (n != null) {
|
|
1012
|
+
var l;
|
|
1013
|
+
e: {
|
|
1014
|
+
if (le.call(n, "ref") && (l = Object.getOwnPropertyDescriptor(
|
|
1015
|
+
n,
|
|
1016
|
+
"ref"
|
|
1017
|
+
).get) && l.isReactWarning) {
|
|
1018
|
+
l = !1;
|
|
1019
|
+
break e;
|
|
1020
|
+
}
|
|
1021
|
+
l = n.ref !== void 0;
|
|
1022
|
+
}
|
|
1023
|
+
l && (m = ue()), J(n) && ($(n.key), i = "" + n.key);
|
|
1024
|
+
for (y in n)
|
|
1025
|
+
!le.call(n, y) || y === "key" || y === "__self" || y === "__source" || y === "ref" && n.ref === void 0 || (u[y] = n[y]);
|
|
1026
|
+
}
|
|
1027
|
+
var y = arguments.length - 2;
|
|
1028
|
+
if (y === 1) u.children = s;
|
|
1029
|
+
else if (1 < y) {
|
|
1030
|
+
l = Array(y);
|
|
1031
|
+
for (var d = 0; d < y; d++)
|
|
1032
|
+
l[d] = arguments[d + 2];
|
|
1033
|
+
u.children = l;
|
|
1034
|
+
}
|
|
1035
|
+
for (u = Q(
|
|
1036
|
+
e.type,
|
|
1037
|
+
i,
|
|
1038
|
+
void 0,
|
|
1039
|
+
void 0,
|
|
1040
|
+
m,
|
|
1041
|
+
u,
|
|
1042
|
+
e._debugStack,
|
|
1043
|
+
e._debugTask
|
|
1044
|
+
), i = 2; i < arguments.length; i++)
|
|
1045
|
+
m = arguments[i], L(m) && m._store && (m._store.validated = 1);
|
|
1046
|
+
return u;
|
|
1047
|
+
}, r.createContext = function(e) {
|
|
1048
|
+
return e = {
|
|
1049
|
+
$$typeof: _,
|
|
1050
|
+
_currentValue: e,
|
|
1051
|
+
_currentValue2: e,
|
|
1052
|
+
_threadCount: 0,
|
|
1053
|
+
Provider: null,
|
|
1054
|
+
Consumer: null
|
|
1055
|
+
}, e.Provider = e, e.Consumer = {
|
|
1056
|
+
$$typeof: a,
|
|
1057
|
+
_context: e
|
|
1058
|
+
}, e._currentRenderer = null, e._currentRenderer2 = null, e;
|
|
1059
|
+
}, r.createElement = function(e, n, s) {
|
|
1060
|
+
for (var u = 2; u < arguments.length; u++) {
|
|
1061
|
+
var i = arguments[u];
|
|
1062
|
+
L(i) && i._store && (i._store.validated = 1);
|
|
1063
|
+
}
|
|
1064
|
+
if (u = {}, i = null, n != null)
|
|
1065
|
+
for (d in Se || !("__self" in n) || "key" in n || (Se = !0, console.warn(
|
|
1066
|
+
"Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
|
|
1067
|
+
)), J(n) && ($(n.key), i = "" + n.key), n)
|
|
1068
|
+
le.call(n, d) && d !== "key" && d !== "__self" && d !== "__source" && (u[d] = n[d]);
|
|
1069
|
+
var m = arguments.length - 2;
|
|
1070
|
+
if (m === 1) u.children = s;
|
|
1071
|
+
else if (1 < m) {
|
|
1072
|
+
for (var l = Array(m), y = 0; y < m; y++)
|
|
1073
|
+
l[y] = arguments[y + 2];
|
|
1074
|
+
Object.freeze && Object.freeze(l), u.children = l;
|
|
1075
|
+
}
|
|
1076
|
+
if (e && e.defaultProps)
|
|
1077
|
+
for (d in m = e.defaultProps, m)
|
|
1078
|
+
u[d] === void 0 && (u[d] = m[d]);
|
|
1079
|
+
i && ie(
|
|
1080
|
+
u,
|
|
1081
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
1082
|
+
);
|
|
1083
|
+
var d = 1e4 > E.recentlyCreatedOwnerStacks++;
|
|
1084
|
+
return Q(
|
|
1085
|
+
e,
|
|
1086
|
+
i,
|
|
1087
|
+
void 0,
|
|
1088
|
+
void 0,
|
|
1089
|
+
ue(),
|
|
1090
|
+
u,
|
|
1091
|
+
d ? Error("react-stack-top-frame") : Ue,
|
|
1092
|
+
d ? Oe(F(e)) : We
|
|
1093
|
+
);
|
|
1094
|
+
}, r.createRef = function() {
|
|
1095
|
+
var e = { current: null };
|
|
1096
|
+
return Object.seal(e), e;
|
|
1097
|
+
}, r.forwardRef = function(e) {
|
|
1098
|
+
e != null && e.$$typeof === w ? console.error(
|
|
1099
|
+
"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
|
|
1100
|
+
) : typeof e != "function" ? console.error(
|
|
1101
|
+
"forwardRef requires a render function but was given %s.",
|
|
1102
|
+
e === null ? "null" : typeof e
|
|
1103
|
+
) : e.length !== 0 && e.length !== 2 && console.error(
|
|
1104
|
+
"forwardRef render functions accept exactly two parameters: props and ref. %s",
|
|
1105
|
+
e.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
|
|
1106
|
+
), e != null && e.defaultProps != null && console.error(
|
|
1107
|
+
"forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
|
|
1108
|
+
);
|
|
1109
|
+
var n = { $$typeof: R, render: e }, s;
|
|
1110
|
+
return Object.defineProperty(n, "displayName", {
|
|
1111
|
+
enumerable: !1,
|
|
1112
|
+
configurable: !0,
|
|
1113
|
+
get: function() {
|
|
1114
|
+
return s;
|
|
1115
|
+
},
|
|
1116
|
+
set: function(u) {
|
|
1117
|
+
s = u, e.name || e.displayName || (Object.defineProperty(e, "name", { value: u }), e.displayName = u);
|
|
1118
|
+
}
|
|
1119
|
+
}), n;
|
|
1120
|
+
}, r.isValidElement = L, r.lazy = function(e) {
|
|
1121
|
+
return {
|
|
1122
|
+
$$typeof: V,
|
|
1123
|
+
_payload: { _status: -1, _result: e },
|
|
1124
|
+
_init: me
|
|
1125
|
+
};
|
|
1126
|
+
}, r.memo = function(e, n) {
|
|
1127
|
+
e == null && console.error(
|
|
1128
|
+
"memo: The first argument must be a component. Instead received: %s",
|
|
1129
|
+
e === null ? "null" : typeof e
|
|
1130
|
+
), n = {
|
|
1131
|
+
$$typeof: w,
|
|
1132
|
+
type: e,
|
|
1133
|
+
compare: n === void 0 ? null : n
|
|
1134
|
+
};
|
|
1135
|
+
var s;
|
|
1136
|
+
return Object.defineProperty(n, "displayName", {
|
|
1137
|
+
enumerable: !1,
|
|
1138
|
+
configurable: !0,
|
|
1139
|
+
get: function() {
|
|
1140
|
+
return s;
|
|
1141
|
+
},
|
|
1142
|
+
set: function(u) {
|
|
1143
|
+
s = u, e.name || e.displayName || (Object.defineProperty(e, "name", { value: u }), e.displayName = u);
|
|
1144
|
+
}
|
|
1145
|
+
}), n;
|
|
1146
|
+
}, r.startTransition = function(e) {
|
|
1147
|
+
var n = E.T, s = {};
|
|
1148
|
+
E.T = s, s._updatedFibers = /* @__PURE__ */ new Set();
|
|
1149
|
+
try {
|
|
1150
|
+
var u = e(), i = E.S;
|
|
1151
|
+
i !== null && i(s, u), typeof u == "object" && u !== null && typeof u.then == "function" && u.then(re, Pe);
|
|
1152
|
+
} catch (m) {
|
|
1153
|
+
Pe(m);
|
|
1154
|
+
} finally {
|
|
1155
|
+
n === null && s._updatedFibers && (e = s._updatedFibers.size, s._updatedFibers.clear(), 10 < e && console.warn(
|
|
1156
|
+
"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
|
|
1157
|
+
)), E.T = n;
|
|
1158
|
+
}
|
|
1159
|
+
}, r.unstable_useCacheRefresh = function() {
|
|
1160
|
+
return T().useCacheRefresh();
|
|
1161
|
+
}, r.use = function(e) {
|
|
1162
|
+
return T().use(e);
|
|
1163
|
+
}, r.useActionState = function(e, n, s) {
|
|
1164
|
+
return T().useActionState(
|
|
1165
|
+
e,
|
|
1166
|
+
n,
|
|
1167
|
+
s
|
|
1168
|
+
);
|
|
1169
|
+
}, r.useCallback = function(e, n) {
|
|
1170
|
+
return T().useCallback(e, n);
|
|
1171
|
+
}, r.useContext = function(e) {
|
|
1172
|
+
var n = T();
|
|
1173
|
+
return e.$$typeof === a && console.error(
|
|
1174
|
+
"Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
|
|
1175
|
+
), n.useContext(e);
|
|
1176
|
+
}, r.useDebugValue = function(e, n) {
|
|
1177
|
+
return T().useDebugValue(e, n);
|
|
1178
|
+
}, r.useDeferredValue = function(e, n) {
|
|
1179
|
+
return T().useDeferredValue(e, n);
|
|
1180
|
+
}, r.useEffect = function(e, n, s) {
|
|
1181
|
+
e == null && console.warn(
|
|
1182
|
+
"React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
1183
|
+
);
|
|
1184
|
+
var u = T();
|
|
1185
|
+
if (typeof s == "function")
|
|
1186
|
+
throw Error(
|
|
1187
|
+
"useEffect CRUD overload is not enabled in this build of React."
|
|
1188
|
+
);
|
|
1189
|
+
return u.useEffect(e, n);
|
|
1190
|
+
}, r.useId = function() {
|
|
1191
|
+
return T().useId();
|
|
1192
|
+
}, r.useImperativeHandle = function(e, n, s) {
|
|
1193
|
+
return T().useImperativeHandle(e, n, s);
|
|
1194
|
+
}, r.useInsertionEffect = function(e, n) {
|
|
1195
|
+
return e == null && console.warn(
|
|
1196
|
+
"React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
1197
|
+
), T().useInsertionEffect(e, n);
|
|
1198
|
+
}, r.useLayoutEffect = function(e, n) {
|
|
1199
|
+
return e == null && console.warn(
|
|
1200
|
+
"React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
1201
|
+
), T().useLayoutEffect(e, n);
|
|
1202
|
+
}, r.useMemo = function(e, n) {
|
|
1203
|
+
return T().useMemo(e, n);
|
|
1204
|
+
}, r.useOptimistic = function(e, n) {
|
|
1205
|
+
return T().useOptimistic(e, n);
|
|
1206
|
+
}, r.useReducer = function(e, n, s) {
|
|
1207
|
+
return T().useReducer(e, n, s);
|
|
1208
|
+
}, r.useRef = function(e) {
|
|
1209
|
+
return T().useRef(e);
|
|
1210
|
+
}, r.useState = function(e) {
|
|
1211
|
+
return T().useState(e);
|
|
1212
|
+
}, r.useSyncExternalStore = function(e, n, s) {
|
|
1213
|
+
return T().useSyncExternalStore(
|
|
1214
|
+
e,
|
|
1215
|
+
n,
|
|
1216
|
+
s
|
|
1217
|
+
);
|
|
1218
|
+
}, r.useTransition = function() {
|
|
1219
|
+
return T().useTransition();
|
|
1220
|
+
}, r.version = "19.1.1", typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1221
|
+
})();
|
|
1222
|
+
})(se, se.exports)), se.exports;
|
|
1223
|
+
}
|
|
1224
|
+
var De;
|
|
1225
|
+
function Xe() {
|
|
1226
|
+
return De || (De = 1, process.env.NODE_ENV === "production" ? Ee.exports = Ke() : Ee.exports = Qe()), Ee.exports;
|
|
1227
|
+
}
|
|
1228
|
+
Xe();
|
|
1229
|
+
const S = class S {
|
|
1230
|
+
constructor(r) {
|
|
1231
|
+
D(this, "socket", null);
|
|
1232
|
+
D(this, "config");
|
|
1233
|
+
D(this, "status", P.DISCONNECTED);
|
|
1234
|
+
D(this, "reconnectAttempts", 0);
|
|
1235
|
+
D(this, "reconnectTimer", null);
|
|
1236
|
+
D(this, "heartbeatTimer", null);
|
|
1237
|
+
D(this, "eventListeners", {});
|
|
1238
|
+
this.config = {
|
|
1239
|
+
reconnectInterval: 3e3,
|
|
1240
|
+
maxReconnectAttempts: 5,
|
|
1241
|
+
heartbeatInterval: 3e4,
|
|
1242
|
+
debug: !1,
|
|
1243
|
+
...r
|
|
1244
|
+
};
|
|
1245
|
+
}
|
|
1246
|
+
/**
|
|
1247
|
+
* 获取单例实例
|
|
1248
|
+
*/
|
|
1249
|
+
static getInstance(r) {
|
|
1250
|
+
if (S.instance)
|
|
1251
|
+
r && (JSON.stringify(S.instance.config) !== JSON.stringify(r) && (S.instance = new S(r)), r && (S.instance.config = {
|
|
1252
|
+
...S.instance.config,
|
|
1253
|
+
...r
|
|
1254
|
+
}));
|
|
1255
|
+
else {
|
|
1256
|
+
if (!r)
|
|
1257
|
+
throw new Error("首次创建SocketConnection实例时必须提供配置");
|
|
1258
|
+
S.instance = new S(r);
|
|
1259
|
+
}
|
|
1260
|
+
return S.instance;
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* 连接WebSocket
|
|
1264
|
+
*/
|
|
1265
|
+
connect(r) {
|
|
1266
|
+
return this.config = {
|
|
1267
|
+
...this.config,
|
|
1268
|
+
...r
|
|
1269
|
+
}, new Promise((h, b) => {
|
|
1270
|
+
var k, z;
|
|
1271
|
+
if (((k = this.socket) == null ? void 0 : k.readyState) === WebSocket.OPEN) {
|
|
1272
|
+
h();
|
|
1273
|
+
return;
|
|
1274
|
+
}
|
|
1275
|
+
const M = this.config.url + ((z = this.config) != null && z.params ? `?${Object.entries(this.config.params).map(([O, A]) => `${O}=${A}`).join("&")}` : "");
|
|
1276
|
+
if (M) {
|
|
1277
|
+
this.setStatus(P.CONNECTING), this.log("正在连接WebSocket...", M);
|
|
1278
|
+
try {
|
|
1279
|
+
this.socket = new WebSocket(M, this.config.protocols), this.setupEventListeners(), this.socket.onopen = () => {
|
|
1280
|
+
var O, A;
|
|
1281
|
+
this.log("WebSocket连接成功"), this.setStatus(P.CONNECTED), this.reconnectAttempts = 0, this.startHeartbeat(), (A = (O = this.eventListeners).open) == null || A.call(O), h();
|
|
1282
|
+
}, this.socket.onerror = (O) => {
|
|
1283
|
+
var A, $;
|
|
1284
|
+
this.log("WebSocket连接错误:", O), this.setStatus(P.ERROR), ($ = (A = this.eventListeners).error) == null || $.call(A, O), b(O);
|
|
1285
|
+
};
|
|
1286
|
+
} catch (O) {
|
|
1287
|
+
this.log("创建WebSocket连接失败:", O), this.setStatus(P.ERROR), b(O);
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
});
|
|
1291
|
+
}
|
|
1292
|
+
/**
|
|
1293
|
+
* 断开连接
|
|
1294
|
+
*/
|
|
1295
|
+
disconnect() {
|
|
1296
|
+
this.log("正在断开WebSocket连接..."), this.stopHeartbeat(), this.clearReconnectTimer(), this.socket && (this.socket.close(1e3, "主动断开连接"), this.socket = null), this.setStatus(P.DISCONNECTED);
|
|
1297
|
+
}
|
|
1298
|
+
/**
|
|
1299
|
+
* 发送消息
|
|
1300
|
+
*/
|
|
1301
|
+
send(r) {
|
|
1302
|
+
var h;
|
|
1303
|
+
return ((h = this.socket) == null ? void 0 : h.readyState) === WebSocket.OPEN ? (this.socket.send(r), this.log("发送消息:", r), !0) : (this.log("WebSocket未连接,无法发送消息"), !1);
|
|
1304
|
+
}
|
|
1305
|
+
/**
|
|
1306
|
+
* 发送JSON消息
|
|
1307
|
+
*/
|
|
1308
|
+
sendJSON(r) {
|
|
1309
|
+
return this.send(JSON.stringify(r));
|
|
1310
|
+
}
|
|
1311
|
+
/**
|
|
1312
|
+
* 添加事件监听器
|
|
1313
|
+
*/
|
|
1314
|
+
on(r, h) {
|
|
1315
|
+
this.eventListeners[r] = h;
|
|
1316
|
+
}
|
|
1317
|
+
/**
|
|
1318
|
+
* 移除事件监听器
|
|
1319
|
+
*/
|
|
1320
|
+
off(r) {
|
|
1321
|
+
delete this.eventListeners[r];
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
* 获取连接状态
|
|
1325
|
+
*/
|
|
1326
|
+
getStatus() {
|
|
1327
|
+
return this.status;
|
|
1328
|
+
}
|
|
1329
|
+
/**
|
|
1330
|
+
* 检查是否已连接
|
|
1331
|
+
*/
|
|
1332
|
+
isConnected() {
|
|
1333
|
+
var r;
|
|
1334
|
+
return this.status === P.CONNECTED && ((r = this.socket) == null ? void 0 : r.readyState) === WebSocket.OPEN;
|
|
1335
|
+
}
|
|
1336
|
+
/**
|
|
1337
|
+
* 设置事件监听器
|
|
1338
|
+
*/
|
|
1339
|
+
setupEventListeners() {
|
|
1340
|
+
this.socket && (this.socket.onmessage = (r) => {
|
|
1341
|
+
var h, b;
|
|
1342
|
+
this.log("收到消息:", r.data), r.data !== "pong" && ((b = (h = this.eventListeners).message) == null || b.call(h, r.data));
|
|
1343
|
+
}, this.socket.onclose = (r) => {
|
|
1344
|
+
var h, b;
|
|
1345
|
+
this.log("WebSocket连接关闭:", r.code, r.reason), this.setStatus(P.DISCONNECTED), this.stopHeartbeat(), (b = (h = this.eventListeners).close) == null || b.call(h, r), r.code !== 1e3 && this.reconnectAttempts < (this.config.maxReconnectAttempts || 5) && this.scheduleReconnect();
|
|
1346
|
+
}, this.socket.onerror = (r) => {
|
|
1347
|
+
var h, b;
|
|
1348
|
+
this.log("WebSocket错误:", r), this.setStatus(P.ERROR), (b = (h = this.eventListeners).error) == null || b.call(h, r);
|
|
1349
|
+
});
|
|
1350
|
+
}
|
|
1351
|
+
/**
|
|
1352
|
+
* 设置连接状态
|
|
1353
|
+
*/
|
|
1354
|
+
setStatus(r) {
|
|
1355
|
+
var h, b;
|
|
1356
|
+
this.status !== r && (this.status = r, this.log("连接状态变更:", r), (b = (h = this.eventListeners).statusChange) == null || b.call(h, r));
|
|
1357
|
+
}
|
|
1358
|
+
/**
|
|
1359
|
+
* 安排重连
|
|
1360
|
+
*/
|
|
1361
|
+
scheduleReconnect() {
|
|
1362
|
+
this.reconnectTimer || (this.reconnectAttempts++, this.setStatus(P.RECONNECTING), this.log(`准备重连 (第${this.reconnectAttempts}次)...`), this.reconnectTimer = setTimeout(() => {
|
|
1363
|
+
this.reconnectTimer = null, this.connect().catch(() => {
|
|
1364
|
+
});
|
|
1365
|
+
}, this.config.reconnectInterval || 3e3));
|
|
1366
|
+
}
|
|
1367
|
+
/**
|
|
1368
|
+
* 清除重连定时器
|
|
1369
|
+
*/
|
|
1370
|
+
clearReconnectTimer() {
|
|
1371
|
+
this.reconnectTimer && (clearTimeout(this.reconnectTimer), this.reconnectTimer = null);
|
|
1372
|
+
}
|
|
1373
|
+
/**
|
|
1374
|
+
* 开始心跳检测
|
|
1375
|
+
*/
|
|
1376
|
+
startHeartbeat() {
|
|
1377
|
+
this.stopHeartbeat(), this.config.heartbeatInterval && this.config.heartbeatInterval > 0 && (this.heartbeatTimer = setInterval(() => {
|
|
1378
|
+
this.isConnected() && this.send("ping");
|
|
1379
|
+
}, this.config.heartbeatInterval));
|
|
1380
|
+
}
|
|
1381
|
+
/**
|
|
1382
|
+
* 停止心跳检测
|
|
1383
|
+
*/
|
|
1384
|
+
stopHeartbeat() {
|
|
1385
|
+
this.heartbeatTimer && (clearInterval(this.heartbeatTimer), this.heartbeatTimer = null);
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* 日志输出
|
|
1389
|
+
*/
|
|
1390
|
+
log(...r) {
|
|
1391
|
+
this.config.debug && console.log("[SocketConnection]", ...r);
|
|
1392
|
+
}
|
|
1393
|
+
/**
|
|
1394
|
+
* 销毁实例
|
|
1395
|
+
*/
|
|
1396
|
+
destroy() {
|
|
1397
|
+
this.disconnect(), this.eventListeners = {}, S.instance = null;
|
|
1398
|
+
}
|
|
1399
|
+
};
|
|
1400
|
+
D(S, "instance", null);
|
|
1401
|
+
let ge = S, C = null;
|
|
1402
|
+
self.onmessage = (v) => {
|
|
1403
|
+
const { type: r, data: h } = (v == null ? void 0 : v.data) || {};
|
|
1404
|
+
switch (r) {
|
|
1405
|
+
case "INIT":
|
|
1406
|
+
C = ge.getInstance({ url: h == null ? void 0 : h.url, debug: (h == null ? void 0 : h.debug) ?? !0 }), C == null || C.connect(), C == null || C.on("open", () => {
|
|
1407
|
+
self.postMessage({ type: "INIT_OK" });
|
|
1408
|
+
}), C == null || C.on("message", (b) => {
|
|
1409
|
+
self.postMessage({ type: "RECEIVE_MESSAGE", data: b });
|
|
1410
|
+
});
|
|
1411
|
+
break;
|
|
1412
|
+
case "SEND_MESSAGE":
|
|
1413
|
+
C == null || C.send(JSON.stringify(h));
|
|
1414
|
+
break;
|
|
1415
|
+
case "CLOSE":
|
|
1416
|
+
C == null || C.disconnect(), C = null;
|
|
1417
|
+
break;
|
|
1418
|
+
}
|
|
1419
|
+
};
|