@famibee/skynovel 2.0.2 → 2.0.4
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/Button.js +36 -34
- package/dist/Button.js.map +1 -1
- package/dist/CallStack.js +11 -6
- package/dist/CallStack.js.map +1 -1
- package/dist/CmnInterface.js +13 -11
- package/dist/CmnInterface.js.map +1 -1
- package/dist/CmnLib.js +58 -56
- package/dist/CmnLib.js.map +1 -1
- package/dist/Config.js +9 -7
- package/dist/Config.js.map +1 -1
- package/dist/ConfigBase.js +52 -49
- package/dist/ConfigBase.js.map +1 -1
- package/dist/DebugMng.js +9 -6
- package/dist/DebugMng.js.map +1 -1
- package/dist/EventListenerCtn.js +6 -4
- package/dist/EventListenerCtn.js.map +1 -1
- package/dist/EventMng.js +522 -417
- package/dist/EventMng.js.map +1 -1
- package/dist/Grammar.js +22 -20
- package/dist/Grammar.js.map +1 -1
- package/dist/GrpLayer.js +58 -57
- package/dist/GrpLayer.js.map +1 -1
- package/dist/Layer.js +66 -64
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMng.js +461 -441
- package/dist/LayerMng.js.map +1 -1
- package/dist/Main.js +69 -67
- package/dist/Main.js.map +1 -1
- package/dist/PropParser.js +23 -19
- package/dist/PropParser.js.map +1 -1
- package/dist/Reading.js +422 -418
- package/dist/Reading.js.map +1 -1
- package/dist/RubySpliter.js +4 -2
- package/dist/RubySpliter.js.map +1 -1
- package/dist/ScriptIterator.js +374 -370
- package/dist/ScriptIterator.js.map +1 -1
- package/dist/SndBuf.js +643 -622
- package/dist/SndBuf.js.map +1 -1
- package/dist/SoundMng.js +59 -60
- package/dist/SoundMng.js.map +1 -1
- package/dist/SpritesMng.js +135 -129
- package/dist/SpritesMng.js.map +1 -1
- package/dist/SysBase.js +1019 -955
- package/dist/SysBase.js.map +1 -1
- package/dist/TxtLayer.js +558 -551
- package/dist/TxtLayer.js.map +1 -1
- package/dist/Variable.js +47 -45
- package/dist/Variable.js.map +1 -1
- package/dist/chunk.js +11 -9
- package/dist/gamepad.js +396 -660
- package/dist/gamepad.js.map +1 -1
- package/dist/pixi.js +3044 -3648
- package/dist/pixi.js.map +1 -1
- package/dist/platform.js +6 -4
- package/dist/platform.js.map +1 -1
- package/dist/rolldown-runtime.js +20 -0
- package/dist/web.js +106 -590
- package/dist/web.js.map +1 -1
- package/dist_app/Button.js +36 -34
- package/dist_app/Button.js.map +1 -1
- package/dist_app/CallStack.js +11 -6
- package/dist_app/CallStack.js.map +1 -1
- package/dist_app/CmnInterface.js +13 -11
- package/dist_app/CmnInterface.js.map +1 -1
- package/dist_app/CmnLib.js +58 -56
- package/dist_app/CmnLib.js.map +1 -1
- package/dist_app/Config.js +9 -7
- package/dist_app/Config.js.map +1 -1
- package/dist_app/ConfigBase.js +52 -49
- package/dist_app/ConfigBase.js.map +1 -1
- package/dist_app/DebugMng.js +9 -6
- package/dist_app/DebugMng.js.map +1 -1
- package/dist_app/EventListenerCtn.js +6 -4
- package/dist_app/EventListenerCtn.js.map +1 -1
- package/dist_app/EventMng.js +522 -417
- package/dist_app/EventMng.js.map +1 -1
- package/dist_app/Grammar.js +22 -20
- package/dist_app/Grammar.js.map +1 -1
- package/dist_app/GrpLayer.js +58 -57
- package/dist_app/GrpLayer.js.map +1 -1
- package/dist_app/Layer.js +66 -64
- package/dist_app/Layer.js.map +1 -1
- package/dist_app/LayerMng.js +461 -441
- package/dist_app/LayerMng.js.map +1 -1
- package/dist_app/Main.js +69 -67
- package/dist_app/Main.js.map +1 -1
- package/dist_app/PropParser.js +23 -19
- package/dist_app/PropParser.js.map +1 -1
- package/dist_app/Reading.js +422 -418
- package/dist_app/Reading.js.map +1 -1
- package/dist_app/RubySpliter.js +4 -2
- package/dist_app/RubySpliter.js.map +1 -1
- package/dist_app/ScriptIterator.js +374 -370
- package/dist_app/ScriptIterator.js.map +1 -1
- package/dist_app/SndBuf.js +643 -622
- package/dist_app/SndBuf.js.map +1 -1
- package/dist_app/SoundMng.js +59 -60
- package/dist_app/SoundMng.js.map +1 -1
- package/dist_app/SpritesMng.js +135 -129
- package/dist_app/SpritesMng.js.map +1 -1
- package/dist_app/SysBase.js +1019 -955
- package/dist_app/SysBase.js.map +1 -1
- package/dist_app/TxtLayer.js +558 -551
- package/dist_app/TxtLayer.js.map +1 -1
- package/dist_app/Variable.js +47 -45
- package/dist_app/Variable.js.map +1 -1
- package/dist_app/app.js +62 -63
- package/dist_app/app.js.map +1 -1
- package/dist_app/appMain.js +1 -21
- package/dist_app/appMain.js.map +1 -1
- package/dist_app/chunk.js +11 -9
- package/dist_app/gamepad.js +396 -660
- package/dist_app/gamepad.js.map +1 -1
- package/dist_app/pixi.js +2028 -1990
- package/dist_app/pixi.js.map +1 -1
- package/dist_app/platform.js +6 -4
- package/dist_app/platform.js.map +1 -1
- package/dist_app/preload.js +1 -1
- package/dist_app/preload.js.map +1 -1
- package/dist_app/rolldown-runtime.js +20 -0
- package/package.json +20 -47
package/dist_app/SysBase.js
CHANGED
|
@@ -1,224 +1,233 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { i as
|
|
3
|
-
import { n as
|
|
4
|
-
import { t as
|
|
5
|
-
import { n as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Object.
|
|
10
|
-
|
|
1
|
+
import { n as e } from "./rolldown-runtime.js";
|
|
2
|
+
import { i as t, s as n, t as r } from "./CmnLib.js";
|
|
3
|
+
import { n as i } from "./CmnInterface.js";
|
|
4
|
+
import { t as a } from "./EventListenerCtn.js";
|
|
5
|
+
import { n as o } from "./ConfigBase.js";
|
|
6
|
+
//#region node_modules/engine.io-parser/build/esm/commons.js
|
|
7
|
+
var s = Object.create(null);
|
|
8
|
+
s.open = "0", s.close = "1", s.ping = "2", s.pong = "3", s.message = "4", s.upgrade = "5", s.noop = "6";
|
|
9
|
+
var c = Object.create(null);
|
|
10
|
+
Object.keys(s).forEach((e) => {
|
|
11
|
+
c[s[e]] = e;
|
|
11
12
|
});
|
|
12
|
-
var
|
|
13
|
+
var l = {
|
|
13
14
|
type: "error",
|
|
14
15
|
data: "parser error"
|
|
15
|
-
},
|
|
16
|
-
let
|
|
17
|
-
return
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
},
|
|
16
|
+
}, u = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", ee = typeof ArrayBuffer == "function", d = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e && e.buffer instanceof ArrayBuffer, f = ({ type: e, data: t }, n, r) => u && t instanceof Blob ? n ? r(t) : p(t, r) : ee && (t instanceof ArrayBuffer || d(t)) ? n ? r(t) : p(new Blob([t]), r) : r(s[e] + (t || "")), p = (e, t) => {
|
|
17
|
+
let n = new FileReader();
|
|
18
|
+
return n.onload = function() {
|
|
19
|
+
let e = n.result.split(",")[1];
|
|
20
|
+
t("b" + (e || ""));
|
|
21
|
+
}, n.readAsDataURL(e);
|
|
21
22
|
};
|
|
22
|
-
function
|
|
23
|
-
return
|
|
23
|
+
function m(e) {
|
|
24
|
+
return e instanceof Uint8Array ? e : e instanceof ArrayBuffer ? new Uint8Array(e) : new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
|
|
24
25
|
}
|
|
25
|
-
var
|
|
26
|
-
function
|
|
27
|
-
if (
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
var te;
|
|
27
|
+
function ne(e, t) {
|
|
28
|
+
if (u && e.data instanceof Blob) return e.data.arrayBuffer().then(m).then(t);
|
|
29
|
+
if (ee && (e.data instanceof ArrayBuffer || d(e.data))) return t(m(e.data));
|
|
30
|
+
f(e, !1, (e) => {
|
|
31
|
+
te ||= new TextEncoder(), t(te.encode(e));
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (typeof
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js
|
|
36
|
+
var re = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", h = typeof Uint8Array > "u" ? [] : /* @__PURE__ */ new Uint8Array(256);
|
|
37
|
+
for (let e = 0; e < 64; e++) h[re.charCodeAt(e)] = e;
|
|
38
|
+
var ie = (e) => {
|
|
39
|
+
let t = e.length * .75, n = e.length, r, i = 0, a, o, s, c;
|
|
40
|
+
e[e.length - 1] === "=" && (t--, e[e.length - 2] === "=" && t--);
|
|
41
|
+
let l = new ArrayBuffer(t), u = new Uint8Array(l);
|
|
42
|
+
for (r = 0; r < n; r += 4) a = h[e.charCodeAt(r)], o = h[e.charCodeAt(r + 1)], s = h[e.charCodeAt(r + 2)], c = h[e.charCodeAt(r + 3)], u[i++] = a << 2 | o >> 4, u[i++] = (o & 15) << 4 | s >> 2, u[i++] = (s & 3) << 6 | c & 63;
|
|
43
|
+
return l;
|
|
44
|
+
}, ae = typeof ArrayBuffer == "function", g = (e, t) => {
|
|
45
|
+
if (typeof e != "string") return {
|
|
45
46
|
type: "message",
|
|
46
|
-
data:
|
|
47
|
+
data: _(e, t)
|
|
47
48
|
};
|
|
48
|
-
let
|
|
49
|
-
return
|
|
49
|
+
let n = e.charAt(0);
|
|
50
|
+
return n === "b" ? {
|
|
50
51
|
type: "message",
|
|
51
|
-
data:
|
|
52
|
-
} :
|
|
53
|
-
type:
|
|
54
|
-
data:
|
|
55
|
-
} : { type:
|
|
56
|
-
}
|
|
57
|
-
var decodeBase64Packet = (h, W) => withNativeArrayBuffer$1 ? mapBinary(decode$1(h), W) : {
|
|
52
|
+
data: oe(e.substring(1), t)
|
|
53
|
+
} : c[n] ? e.length > 1 ? {
|
|
54
|
+
type: c[n],
|
|
55
|
+
data: e.substring(1)
|
|
56
|
+
} : { type: c[n] } : l;
|
|
57
|
+
}, oe = (e, t) => ae ? _(ie(e), t) : {
|
|
58
58
|
base64: !0,
|
|
59
|
-
data:
|
|
60
|
-
},
|
|
61
|
-
switch (
|
|
62
|
-
case "blob": return
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
K[J] = h, ++q === G && W(K.join(SEPARATOR));
|
|
59
|
+
data: e
|
|
60
|
+
}, _ = (e, t) => {
|
|
61
|
+
switch (t) {
|
|
62
|
+
case "blob": return e instanceof Blob ? e : new Blob([e]);
|
|
63
|
+
default: return e instanceof ArrayBuffer ? e : e.buffer;
|
|
64
|
+
}
|
|
65
|
+
}, v = "", se = (e, t) => {
|
|
66
|
+
let n = e.length, r = Array(n), i = 0;
|
|
67
|
+
e.forEach((e, a) => {
|
|
68
|
+
f(e, !1, (e) => {
|
|
69
|
+
r[a] = e, ++i === n && t(r.join(v));
|
|
71
70
|
});
|
|
72
71
|
});
|
|
73
|
-
},
|
|
74
|
-
let
|
|
75
|
-
for (let
|
|
76
|
-
let
|
|
77
|
-
if (
|
|
72
|
+
}, ce = (e, t) => {
|
|
73
|
+
let n = e.split(v), r = [];
|
|
74
|
+
for (let e = 0; e < n.length; e++) {
|
|
75
|
+
let i = g(n[e], t);
|
|
76
|
+
if (r.push(i), i.type === "error") break;
|
|
78
77
|
}
|
|
79
|
-
return
|
|
78
|
+
return r;
|
|
80
79
|
};
|
|
81
|
-
function
|
|
82
|
-
return new TransformStream({ transform(
|
|
83
|
-
|
|
84
|
-
let
|
|
85
|
-
if (
|
|
86
|
-
else if (
|
|
87
|
-
|
|
88
|
-
let
|
|
89
|
-
|
|
80
|
+
function le() {
|
|
81
|
+
return new TransformStream({ transform(e, t) {
|
|
82
|
+
ne(e, (n) => {
|
|
83
|
+
let r = n.length, i;
|
|
84
|
+
if (r < 126) i = /* @__PURE__ */ new Uint8Array(1), new DataView(i.buffer).setUint8(0, r);
|
|
85
|
+
else if (r < 65536) {
|
|
86
|
+
i = /* @__PURE__ */ new Uint8Array(3);
|
|
87
|
+
let e = new DataView(i.buffer);
|
|
88
|
+
e.setUint8(0, 126), e.setUint16(1, r);
|
|
90
89
|
} else {
|
|
91
|
-
|
|
92
|
-
let
|
|
93
|
-
|
|
90
|
+
i = /* @__PURE__ */ new Uint8Array(9);
|
|
91
|
+
let e = new DataView(i.buffer);
|
|
92
|
+
e.setUint8(0, 127), e.setBigUint64(1, BigInt(r));
|
|
94
93
|
}
|
|
95
|
-
|
|
94
|
+
e.data && typeof e.data != "string" && (i[0] |= 128), t.enqueue(i), t.enqueue(n);
|
|
96
95
|
});
|
|
97
96
|
} });
|
|
98
97
|
}
|
|
99
|
-
var
|
|
100
|
-
function
|
|
101
|
-
return
|
|
98
|
+
var y;
|
|
99
|
+
function b(e) {
|
|
100
|
+
return e.reduce((e, t) => e + t.length, 0);
|
|
102
101
|
}
|
|
103
|
-
function
|
|
104
|
-
if (
|
|
105
|
-
let
|
|
106
|
-
for (let
|
|
107
|
-
return
|
|
102
|
+
function x(e, t) {
|
|
103
|
+
if (e[0].length === t) return e.shift();
|
|
104
|
+
let n = new Uint8Array(t), r = 0;
|
|
105
|
+
for (let i = 0; i < t; i++) n[i] = e[0][r++], r === e[0].length && (e.shift(), r = 0);
|
|
106
|
+
return e.length && r < e[0].length && (e[0] = e[0].slice(r)), n;
|
|
108
107
|
}
|
|
109
|
-
function
|
|
110
|
-
|
|
111
|
-
let
|
|
112
|
-
return new TransformStream({ transform(
|
|
113
|
-
for (
|
|
114
|
-
if (
|
|
115
|
-
if (
|
|
116
|
-
let
|
|
117
|
-
|
|
118
|
-
} else if (
|
|
119
|
-
if (
|
|
120
|
-
let
|
|
121
|
-
|
|
122
|
-
} else if (
|
|
123
|
-
if (
|
|
124
|
-
let
|
|
125
|
-
if (
|
|
126
|
-
|
|
108
|
+
function ue(e, t) {
|
|
109
|
+
y ||= new TextDecoder();
|
|
110
|
+
let n = [], r = 0, i = -1, a = !1;
|
|
111
|
+
return new TransformStream({ transform(o, s) {
|
|
112
|
+
for (n.push(o);;) {
|
|
113
|
+
if (r === 0) {
|
|
114
|
+
if (b(n) < 1) break;
|
|
115
|
+
let e = x(n, 1);
|
|
116
|
+
a = (e[0] & 128) == 128, i = e[0] & 127, r = i < 126 ? 3 : i === 126 ? 1 : 2;
|
|
117
|
+
} else if (r === 1) {
|
|
118
|
+
if (b(n) < 2) break;
|
|
119
|
+
let e = x(n, 2);
|
|
120
|
+
i = new DataView(e.buffer, e.byteOffset, e.length).getUint16(0), r = 3;
|
|
121
|
+
} else if (r === 2) {
|
|
122
|
+
if (b(n) < 8) break;
|
|
123
|
+
let e = x(n, 8), t = new DataView(e.buffer, e.byteOffset, e.length), a = t.getUint32(0);
|
|
124
|
+
if (a > 2 ** 21 - 1) {
|
|
125
|
+
s.enqueue(l);
|
|
127
126
|
break;
|
|
128
127
|
}
|
|
129
|
-
|
|
128
|
+
i = a * 2 ** 32 + t.getUint32(4), r = 3;
|
|
130
129
|
} else {
|
|
131
|
-
if (
|
|
132
|
-
let
|
|
133
|
-
|
|
130
|
+
if (b(n) < i) break;
|
|
131
|
+
let e = x(n, i);
|
|
132
|
+
s.enqueue(g(a ? e : y.decode(e), t)), r = 0;
|
|
134
133
|
}
|
|
135
|
-
if (
|
|
136
|
-
|
|
134
|
+
if (i === 0 || i > e) {
|
|
135
|
+
s.enqueue(l);
|
|
137
136
|
break;
|
|
138
137
|
}
|
|
139
138
|
}
|
|
140
139
|
} });
|
|
141
140
|
}
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region node_modules/@socket.io/component-emitter/lib/esm/index.js
|
|
143
|
+
function S(e) {
|
|
144
|
+
if (e) return de(e);
|
|
144
145
|
}
|
|
145
|
-
function
|
|
146
|
-
for (var
|
|
147
|
-
return
|
|
146
|
+
function de(e) {
|
|
147
|
+
for (var t in S.prototype) e[t] = S.prototype[t];
|
|
148
|
+
return e;
|
|
148
149
|
}
|
|
149
|
-
|
|
150
|
-
return this._callbacks = this._callbacks || {}, (this._callbacks["$" +
|
|
151
|
-
},
|
|
152
|
-
function
|
|
153
|
-
this.off(
|
|
154
|
-
}
|
|
155
|
-
return
|
|
156
|
-
},
|
|
150
|
+
S.prototype.on = S.prototype.addEventListener = function(e, t) {
|
|
151
|
+
return this._callbacks = this._callbacks || {}, (this._callbacks["$" + e] = this._callbacks["$" + e] || []).push(t), this;
|
|
152
|
+
}, S.prototype.once = function(e, t) {
|
|
153
|
+
function n() {
|
|
154
|
+
this.off(e, n), t.apply(this, arguments);
|
|
155
|
+
}
|
|
156
|
+
return n.fn = t, this.on(e, n), this;
|
|
157
|
+
}, S.prototype.off = S.prototype.removeListener = S.prototype.removeAllListeners = S.prototype.removeEventListener = function(e, t) {
|
|
157
158
|
if (this._callbacks = this._callbacks || {}, arguments.length == 0) return this._callbacks = {}, this;
|
|
158
|
-
var
|
|
159
|
-
if (!
|
|
160
|
-
if (arguments.length == 1) return delete this._callbacks["$" +
|
|
161
|
-
for (var
|
|
162
|
-
|
|
159
|
+
var n = this._callbacks["$" + e];
|
|
160
|
+
if (!n) return this;
|
|
161
|
+
if (arguments.length == 1) return delete this._callbacks["$" + e], this;
|
|
162
|
+
for (var r, i = 0; i < n.length; i++) if (r = n[i], r === t || r.fn === t) {
|
|
163
|
+
n.splice(i, 1);
|
|
163
164
|
break;
|
|
164
165
|
}
|
|
165
|
-
return
|
|
166
|
-
},
|
|
166
|
+
return n.length === 0 && delete this._callbacks["$" + e], this;
|
|
167
|
+
}, S.prototype.emit = function(e) {
|
|
167
168
|
this._callbacks = this._callbacks || {};
|
|
168
|
-
for (var
|
|
169
|
-
if (
|
|
170
|
-
|
|
171
|
-
for (var
|
|
169
|
+
for (var t = Array(arguments.length - 1), n = this._callbacks["$" + e], r = 1; r < arguments.length; r++) t[r - 1] = arguments[r];
|
|
170
|
+
if (n) {
|
|
171
|
+
n = n.slice(0);
|
|
172
|
+
for (var r = 0, i = n.length; r < i; ++r) n[r].apply(this, t);
|
|
172
173
|
}
|
|
173
174
|
return this;
|
|
174
|
-
},
|
|
175
|
-
return this._callbacks = this._callbacks || {}, this._callbacks["$" +
|
|
176
|
-
},
|
|
177
|
-
return !!this.listeners(
|
|
175
|
+
}, S.prototype.emitReserved = S.prototype.emit, S.prototype.listeners = function(e) {
|
|
176
|
+
return this._callbacks = this._callbacks || {}, this._callbacks["$" + e] || [];
|
|
177
|
+
}, S.prototype.hasListeners = function(e) {
|
|
178
|
+
return !!this.listeners(e).length;
|
|
178
179
|
};
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
//#endregion
|
|
181
|
+
//#region node_modules/engine.io-client/build/esm/globals.js
|
|
182
|
+
var C = typeof Promise == "function" && typeof Promise.resolve == "function" ? (e) => Promise.resolve().then(e) : (e, t) => t(e, 0), w = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), fe = "arraybuffer";
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region node_modules/engine.io-client/build/esm/util.js
|
|
185
|
+
function T(e, ...t) {
|
|
186
|
+
return t.reduce((t, n) => (e.hasOwnProperty(n) && (t[n] = e[n]), t), {});
|
|
182
187
|
}
|
|
183
|
-
var
|
|
184
|
-
function
|
|
185
|
-
|
|
188
|
+
var pe = w.setTimeout, me = w.clearTimeout;
|
|
189
|
+
function E(e, t) {
|
|
190
|
+
t.useNativeTimers ? (e.setTimeoutFn = pe.bind(w), e.clearTimeoutFn = me.bind(w)) : (e.setTimeoutFn = w.setTimeout.bind(w), e.clearTimeoutFn = w.clearTimeout.bind(w));
|
|
186
191
|
}
|
|
187
|
-
var
|
|
188
|
-
function
|
|
189
|
-
return typeof
|
|
192
|
+
var he = 1.33;
|
|
193
|
+
function ge(e) {
|
|
194
|
+
return typeof e == "string" ? _e(e) : Math.ceil((e.byteLength || e.size) * he);
|
|
190
195
|
}
|
|
191
|
-
function
|
|
192
|
-
let
|
|
193
|
-
for (let
|
|
194
|
-
return
|
|
196
|
+
function _e(e) {
|
|
197
|
+
let t = 0, n = 0;
|
|
198
|
+
for (let r = 0, i = e.length; r < i; r++) t = e.charCodeAt(r), t < 128 ? n += 1 : t < 2048 ? n += 2 : t < 55296 || t >= 57344 ? n += 3 : (r++, n += 4);
|
|
199
|
+
return n;
|
|
195
200
|
}
|
|
196
|
-
function
|
|
201
|
+
function D() {
|
|
197
202
|
return Date.now().toString(36).substring(3) + Math.random().toString(36).substring(2, 5);
|
|
198
203
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region node_modules/engine.io-client/build/esm/contrib/parseqs.js
|
|
206
|
+
function ve(e) {
|
|
207
|
+
let t = "";
|
|
208
|
+
for (let n in e) e.hasOwnProperty(n) && (t.length && (t += "&"), t += encodeURIComponent(n) + "=" + encodeURIComponent(e[n]));
|
|
209
|
+
return t;
|
|
203
210
|
}
|
|
204
|
-
function
|
|
205
|
-
let
|
|
206
|
-
for (let
|
|
207
|
-
let
|
|
208
|
-
|
|
211
|
+
function ye(e) {
|
|
212
|
+
let t = {}, n = e.split("&");
|
|
213
|
+
for (let e = 0, r = n.length; e < r; e++) {
|
|
214
|
+
let r = n[e].split("=");
|
|
215
|
+
t[decodeURIComponent(r[0])] = decodeURIComponent(r[1]);
|
|
209
216
|
}
|
|
210
|
-
return
|
|
217
|
+
return t;
|
|
211
218
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region node_modules/engine.io-client/build/esm/transport.js
|
|
221
|
+
var be = class extends Error {
|
|
222
|
+
constructor(e, t, n) {
|
|
223
|
+
super(e), this.description = t, this.context = n, this.type = "TransportError";
|
|
215
224
|
}
|
|
216
|
-
},
|
|
217
|
-
constructor(
|
|
218
|
-
super(), this.writable = !1,
|
|
225
|
+
}, O = class extends S {
|
|
226
|
+
constructor(e) {
|
|
227
|
+
super(), this.writable = !1, E(this, e), this.opts = e, this.query = e.query, this.socket = e.socket, this.supportsBinary = !e.forceBase64;
|
|
219
228
|
}
|
|
220
|
-
onError(
|
|
221
|
-
return super.emitReserved("error", new
|
|
229
|
+
onError(e, t, n) {
|
|
230
|
+
return super.emitReserved("error", new be(e, t, n)), this;
|
|
222
231
|
}
|
|
223
232
|
open() {
|
|
224
233
|
return this.readyState = "opening", this.doOpen(), this;
|
|
@@ -226,38 +235,38 @@ var TransportError = class extends Error {
|
|
|
226
235
|
close() {
|
|
227
236
|
return (this.readyState === "opening" || this.readyState === "open") && (this.doClose(), this.onClose()), this;
|
|
228
237
|
}
|
|
229
|
-
send(
|
|
230
|
-
this.readyState === "open" && this.write(
|
|
238
|
+
send(e) {
|
|
239
|
+
this.readyState === "open" && this.write(e);
|
|
231
240
|
}
|
|
232
241
|
onOpen() {
|
|
233
242
|
this.readyState = "open", this.writable = !0, super.emitReserved("open");
|
|
234
243
|
}
|
|
235
|
-
onData(
|
|
236
|
-
let
|
|
237
|
-
this.onPacket(
|
|
244
|
+
onData(e) {
|
|
245
|
+
let t = g(e, this.socket.binaryType);
|
|
246
|
+
this.onPacket(t);
|
|
238
247
|
}
|
|
239
|
-
onPacket(
|
|
240
|
-
super.emitReserved("packet",
|
|
248
|
+
onPacket(e) {
|
|
249
|
+
super.emitReserved("packet", e);
|
|
241
250
|
}
|
|
242
|
-
onClose(
|
|
243
|
-
this.readyState = "closed", super.emitReserved("close",
|
|
251
|
+
onClose(e) {
|
|
252
|
+
this.readyState = "closed", super.emitReserved("close", e);
|
|
244
253
|
}
|
|
245
|
-
pause(
|
|
246
|
-
createUri(
|
|
247
|
-
return
|
|
254
|
+
pause(e) {}
|
|
255
|
+
createUri(e, t = {}) {
|
|
256
|
+
return e + "://" + this._hostname() + this._port() + this.opts.path + this._query(t);
|
|
248
257
|
}
|
|
249
258
|
_hostname() {
|
|
250
|
-
let
|
|
251
|
-
return
|
|
259
|
+
let e = this.opts.hostname;
|
|
260
|
+
return e.indexOf(":") === -1 ? e : "[" + e + "]";
|
|
252
261
|
}
|
|
253
262
|
_port() {
|
|
254
|
-
return this.opts.port && (this.opts.secure && Number(this.opts.port !== 443
|
|
263
|
+
return this.opts.port && (this.opts.secure && Number(this.opts.port) !== 443 || !this.opts.secure && Number(this.opts.port) !== 80) ? ":" + this.opts.port : "";
|
|
255
264
|
}
|
|
256
|
-
_query(
|
|
257
|
-
let
|
|
258
|
-
return
|
|
265
|
+
_query(e) {
|
|
266
|
+
let t = ve(e);
|
|
267
|
+
return t.length ? "?" + t : "";
|
|
259
268
|
}
|
|
260
|
-
},
|
|
269
|
+
}, xe = class extends O {
|
|
261
270
|
constructor() {
|
|
262
271
|
super(...arguments), this._polling = !1;
|
|
263
272
|
}
|
|
@@ -267,190 +276,197 @@ var TransportError = class extends Error {
|
|
|
267
276
|
doOpen() {
|
|
268
277
|
this._poll();
|
|
269
278
|
}
|
|
270
|
-
pause(
|
|
279
|
+
pause(e) {
|
|
271
280
|
this.readyState = "pausing";
|
|
272
|
-
let
|
|
273
|
-
this.readyState = "paused",
|
|
281
|
+
let t = () => {
|
|
282
|
+
this.readyState = "paused", e();
|
|
274
283
|
};
|
|
275
284
|
if (this._polling || !this.writable) {
|
|
276
|
-
let
|
|
277
|
-
this._polling && (
|
|
278
|
-
--
|
|
279
|
-
})), this.writable || (
|
|
280
|
-
--
|
|
285
|
+
let e = 0;
|
|
286
|
+
this._polling && (e++, this.once("pollComplete", function() {
|
|
287
|
+
--e || t();
|
|
288
|
+
})), this.writable || (e++, this.once("drain", function() {
|
|
289
|
+
--e || t();
|
|
281
290
|
}));
|
|
282
|
-
} else
|
|
291
|
+
} else t();
|
|
283
292
|
}
|
|
284
293
|
_poll() {
|
|
285
294
|
this._polling = !0, this.doPoll(), this.emitReserved("poll");
|
|
286
295
|
}
|
|
287
|
-
onData(
|
|
288
|
-
|
|
289
|
-
if (this.readyState === "opening" &&
|
|
290
|
-
this.onPacket(
|
|
296
|
+
onData(e) {
|
|
297
|
+
ce(e, this.socket.binaryType).forEach((e) => {
|
|
298
|
+
if (this.readyState === "opening" && e.type === "open" && this.onOpen(), e.type === "close") return this.onClose({ description: "transport closed by the server" }), !1;
|
|
299
|
+
this.onPacket(e);
|
|
291
300
|
}), this.readyState !== "closed" && (this._polling = !1, this.emitReserved("pollComplete"), this.readyState === "open" && this._poll());
|
|
292
301
|
}
|
|
293
302
|
doClose() {
|
|
294
|
-
let
|
|
303
|
+
let e = () => {
|
|
295
304
|
this.write([{ type: "close" }]);
|
|
296
305
|
};
|
|
297
|
-
this.readyState === "open" ?
|
|
306
|
+
this.readyState === "open" ? e() : this.once("open", e);
|
|
298
307
|
}
|
|
299
|
-
write(
|
|
300
|
-
this.writable = !1,
|
|
301
|
-
this.doWrite(
|
|
308
|
+
write(e) {
|
|
309
|
+
this.writable = !1, se(e, (e) => {
|
|
310
|
+
this.doWrite(e, () => {
|
|
302
311
|
this.writable = !0, this.emitReserved("drain");
|
|
303
312
|
});
|
|
304
313
|
});
|
|
305
314
|
}
|
|
306
315
|
uri() {
|
|
307
|
-
let
|
|
308
|
-
return !1 !== this.opts.timestampRequests && (
|
|
316
|
+
let e = this.opts.secure ? "https" : "http", t = this.query || {};
|
|
317
|
+
return !1 !== this.opts.timestampRequests && (t[this.opts.timestampParam] = D()), !this.supportsBinary && !t.sid && (t.b64 = 1), this.createUri(e, t);
|
|
309
318
|
}
|
|
310
|
-
},
|
|
319
|
+
}, k = !1;
|
|
311
320
|
try {
|
|
312
|
-
|
|
321
|
+
k = typeof XMLHttpRequest < "u" && "withCredentials" in new XMLHttpRequest();
|
|
313
322
|
} catch {}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
323
|
+
var Se = k;
|
|
324
|
+
//#endregion
|
|
325
|
+
//#region node_modules/engine.io-client/build/esm/transports/polling-xhr.js
|
|
326
|
+
function Ce() {}
|
|
327
|
+
var we = class extends xe {
|
|
328
|
+
constructor(e) {
|
|
329
|
+
if (super(e), typeof location < "u") {
|
|
330
|
+
let t = location.protocol === "https:", n = location.port;
|
|
331
|
+
n ||= t ? "443" : "80", this.xd = typeof location < "u" && e.hostname !== location.hostname || n !== e.port;
|
|
321
332
|
}
|
|
322
333
|
}
|
|
323
|
-
doWrite(
|
|
324
|
-
let
|
|
334
|
+
doWrite(e, t) {
|
|
335
|
+
let n = this.request({
|
|
325
336
|
method: "POST",
|
|
326
|
-
data:
|
|
337
|
+
data: e
|
|
327
338
|
});
|
|
328
|
-
|
|
329
|
-
this.onError("xhr post error",
|
|
339
|
+
n.on("success", t), n.on("error", (e, t) => {
|
|
340
|
+
this.onError("xhr post error", e, t);
|
|
330
341
|
});
|
|
331
342
|
}
|
|
332
343
|
doPoll() {
|
|
333
|
-
let
|
|
334
|
-
|
|
335
|
-
this.onError("xhr poll error",
|
|
336
|
-
}), this.pollXhr =
|
|
344
|
+
let e = this.request();
|
|
345
|
+
e.on("data", this.onData.bind(this)), e.on("error", (e, t) => {
|
|
346
|
+
this.onError("xhr poll error", e, t);
|
|
347
|
+
}), this.pollXhr = e;
|
|
337
348
|
}
|
|
338
|
-
},
|
|
339
|
-
constructor(
|
|
340
|
-
super(), this.createRequest =
|
|
349
|
+
}, A = class e extends S {
|
|
350
|
+
constructor(e, t, n) {
|
|
351
|
+
super(), this.createRequest = e, E(this, n), this._opts = n, this._method = n.method || "GET", this._uri = t, this._data = n.data === void 0 ? null : n.data, this._create();
|
|
341
352
|
}
|
|
342
353
|
_create() {
|
|
343
|
-
var
|
|
344
|
-
let
|
|
345
|
-
|
|
346
|
-
let
|
|
354
|
+
var t;
|
|
355
|
+
let n = T(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
|
|
356
|
+
n.xdomain = !!this._opts.xd;
|
|
357
|
+
let r = this._xhr = this.createRequest(n);
|
|
347
358
|
try {
|
|
348
|
-
|
|
359
|
+
r.open(this._method, this._uri, !0);
|
|
349
360
|
try {
|
|
350
|
-
if (this._opts.extraHeaders)
|
|
361
|
+
if (this._opts.extraHeaders) {
|
|
362
|
+
r.setDisableHeaderCheck && r.setDisableHeaderCheck(!0);
|
|
363
|
+
for (let e in this._opts.extraHeaders) this._opts.extraHeaders.hasOwnProperty(e) && r.setRequestHeader(e, this._opts.extraHeaders[e]);
|
|
364
|
+
}
|
|
351
365
|
} catch {}
|
|
352
366
|
if (this._method === "POST") try {
|
|
353
|
-
|
|
367
|
+
r.setRequestHeader("Content-type", "text/plain;charset=UTF-8");
|
|
354
368
|
} catch {}
|
|
355
369
|
try {
|
|
356
|
-
|
|
370
|
+
r.setRequestHeader("Accept", "*/*");
|
|
357
371
|
} catch {}
|
|
358
|
-
(
|
|
359
|
-
var
|
|
360
|
-
|
|
361
|
-
this._onError(typeof
|
|
372
|
+
(t = this._opts.cookieJar) == null || t.addCookies(r), "withCredentials" in r && (r.withCredentials = this._opts.withCredentials), this._opts.requestTimeout && (r.timeout = this._opts.requestTimeout), r.onreadystatechange = () => {
|
|
373
|
+
var e;
|
|
374
|
+
r.readyState === 3 && ((e = this._opts.cookieJar) == null || e.parseCookies(r.getResponseHeader("set-cookie"))), r.readyState === 4 && (r.status === 200 || r.status === 1223 ? this._onLoad() : this.setTimeoutFn(() => {
|
|
375
|
+
this._onError(typeof r.status == "number" ? r.status : 0);
|
|
362
376
|
}, 0));
|
|
363
|
-
},
|
|
364
|
-
} catch (
|
|
377
|
+
}, r.send(this._data);
|
|
378
|
+
} catch (e) {
|
|
365
379
|
this.setTimeoutFn(() => {
|
|
366
|
-
this._onError(
|
|
380
|
+
this._onError(e);
|
|
367
381
|
}, 0);
|
|
368
382
|
return;
|
|
369
383
|
}
|
|
370
|
-
typeof document < "u" && (this._index =
|
|
384
|
+
typeof document < "u" && (this._index = e.requestsCount++, e.requests[this._index] = this);
|
|
371
385
|
}
|
|
372
|
-
_onError(
|
|
373
|
-
this.emitReserved("error",
|
|
386
|
+
_onError(e) {
|
|
387
|
+
this.emitReserved("error", e, this._xhr), this._cleanup(!0);
|
|
374
388
|
}
|
|
375
|
-
_cleanup(
|
|
389
|
+
_cleanup(t) {
|
|
376
390
|
if (!(this._xhr === void 0 || this._xhr === null)) {
|
|
377
|
-
if (this._xhr.onreadystatechange =
|
|
391
|
+
if (this._xhr.onreadystatechange = Ce, t) try {
|
|
378
392
|
this._xhr.abort();
|
|
379
393
|
} catch {}
|
|
380
|
-
typeof document < "u" && delete
|
|
394
|
+
typeof document < "u" && delete e.requests[this._index], this._xhr = null;
|
|
381
395
|
}
|
|
382
396
|
}
|
|
383
397
|
_onLoad() {
|
|
384
|
-
let
|
|
385
|
-
|
|
398
|
+
let e = this._xhr.responseText;
|
|
399
|
+
e !== null && (this.emitReserved("data", e), this.emitReserved("success"), this._cleanup());
|
|
386
400
|
}
|
|
387
401
|
abort() {
|
|
388
402
|
this._cleanup();
|
|
389
403
|
}
|
|
390
404
|
};
|
|
391
|
-
if (
|
|
392
|
-
if (typeof attachEvent == "function") attachEvent("onunload",
|
|
405
|
+
if (A.requestsCount = 0, A.requests = {}, typeof document < "u") {
|
|
406
|
+
if (typeof attachEvent == "function") attachEvent("onunload", j);
|
|
393
407
|
else if (typeof addEventListener == "function") {
|
|
394
|
-
let
|
|
395
|
-
addEventListener(
|
|
408
|
+
let e = "onpagehide" in w ? "pagehide" : "unload";
|
|
409
|
+
addEventListener(e, j, !1);
|
|
396
410
|
}
|
|
397
411
|
}
|
|
398
|
-
function
|
|
399
|
-
for (let
|
|
412
|
+
function j() {
|
|
413
|
+
for (let e in A.requests) A.requests.hasOwnProperty(e) && A.requests[e].abort();
|
|
400
414
|
}
|
|
401
|
-
var
|
|
402
|
-
let
|
|
403
|
-
return
|
|
404
|
-
})(),
|
|
405
|
-
constructor(
|
|
406
|
-
super(
|
|
407
|
-
let
|
|
408
|
-
this.supportsBinary =
|
|
409
|
-
}
|
|
410
|
-
request(
|
|
411
|
-
return Object.assign(
|
|
415
|
+
var Te = (function() {
|
|
416
|
+
let e = M({ xdomain: !1 });
|
|
417
|
+
return e && e.responseType !== null;
|
|
418
|
+
})(), Ee = class extends we {
|
|
419
|
+
constructor(e) {
|
|
420
|
+
super(e);
|
|
421
|
+
let t = e && e.forceBase64;
|
|
422
|
+
this.supportsBinary = Te && !t;
|
|
423
|
+
}
|
|
424
|
+
request(e = {}) {
|
|
425
|
+
return Object.assign(e, { xd: this.xd }, this.opts), new A(M, this.uri(), e);
|
|
412
426
|
}
|
|
413
427
|
};
|
|
414
|
-
function
|
|
415
|
-
let
|
|
428
|
+
function M(e) {
|
|
429
|
+
let t = e.xdomain;
|
|
416
430
|
try {
|
|
417
|
-
if (typeof XMLHttpRequest < "u" && (!
|
|
431
|
+
if (typeof XMLHttpRequest < "u" && (!t || Se)) return new XMLHttpRequest();
|
|
418
432
|
} catch {}
|
|
419
|
-
if (!
|
|
420
|
-
return new
|
|
433
|
+
if (!t) try {
|
|
434
|
+
return new w[["Active", "Object"].join("X")]("Microsoft.XMLHTTP");
|
|
421
435
|
} catch {}
|
|
422
436
|
}
|
|
423
|
-
|
|
437
|
+
//#endregion
|
|
438
|
+
//#region node_modules/engine.io-client/build/esm/transports/websocket.js
|
|
439
|
+
var N = typeof navigator < "u" && typeof navigator.product == "string" && navigator.product.toLowerCase() === "reactnative", De = class extends O {
|
|
424
440
|
get name() {
|
|
425
441
|
return "websocket";
|
|
426
442
|
}
|
|
427
443
|
doOpen() {
|
|
428
|
-
let
|
|
429
|
-
this.opts.extraHeaders && (
|
|
444
|
+
let e = this.uri(), t = this.opts.protocols, n = N ? {} : T(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity");
|
|
445
|
+
this.opts.extraHeaders && (n.headers = this.opts.extraHeaders);
|
|
430
446
|
try {
|
|
431
|
-
this.ws = this.createSocket(
|
|
432
|
-
} catch (
|
|
433
|
-
return this.emitReserved("error",
|
|
447
|
+
this.ws = this.createSocket(e, t, n);
|
|
448
|
+
} catch (e) {
|
|
449
|
+
return this.emitReserved("error", e);
|
|
434
450
|
}
|
|
435
451
|
this.ws.binaryType = this.socket.binaryType, this.addEventListeners();
|
|
436
452
|
}
|
|
437
453
|
addEventListeners() {
|
|
438
454
|
this.ws.onopen = () => {
|
|
439
455
|
this.opts.autoUnref && this.ws._socket.unref(), this.onOpen();
|
|
440
|
-
}, this.ws.onclose = (
|
|
456
|
+
}, this.ws.onclose = (e) => this.onClose({
|
|
441
457
|
description: "websocket connection closed",
|
|
442
|
-
context:
|
|
443
|
-
}), this.ws.onmessage = (
|
|
458
|
+
context: e
|
|
459
|
+
}), this.ws.onmessage = (e) => this.onData(e.data), this.ws.onerror = (e) => this.onError("websocket error", e);
|
|
444
460
|
}
|
|
445
|
-
write(
|
|
461
|
+
write(e) {
|
|
446
462
|
this.writable = !1;
|
|
447
|
-
for (let
|
|
448
|
-
let
|
|
449
|
-
|
|
463
|
+
for (let t = 0; t < e.length; t++) {
|
|
464
|
+
let n = e[t], r = t === e.length - 1;
|
|
465
|
+
f(n, this.supportsBinary, (e) => {
|
|
450
466
|
try {
|
|
451
|
-
this.doWrite(
|
|
467
|
+
this.doWrite(n, e);
|
|
452
468
|
} catch {}
|
|
453
|
-
|
|
469
|
+
r && C(() => {
|
|
454
470
|
this.writable = !0, this.emitReserved("drain");
|
|
455
471
|
}, this.setTimeoutFn);
|
|
456
472
|
});
|
|
@@ -460,67 +476,65 @@ var isReactNative = typeof navigator < "u" && typeof navigator.product == "strin
|
|
|
460
476
|
this.ws !== void 0 && (this.ws.onerror = () => {}, this.ws.close(), this.ws = null);
|
|
461
477
|
}
|
|
462
478
|
uri() {
|
|
463
|
-
let
|
|
464
|
-
return this.opts.timestampRequests && (
|
|
465
|
-
}
|
|
466
|
-
},
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
return isReactNative ? new WebSocketCtor(h, W, G) : W ? new WebSocketCtor(h, W) : new WebSocketCtor(h);
|
|
479
|
+
let e = this.opts.secure ? "wss" : "ws", t = this.query || {};
|
|
480
|
+
return this.opts.timestampRequests && (t[this.opts.timestampParam] = D()), this.supportsBinary || (t.b64 = 1), this.createUri(e, t);
|
|
481
|
+
}
|
|
482
|
+
}, P = w.WebSocket || w.MozWebSocket, Oe = {
|
|
483
|
+
websocket: class extends De {
|
|
484
|
+
createSocket(e, t, n) {
|
|
485
|
+
return N ? new P(e, t, n) : t ? new P(e, t) : new P(e);
|
|
471
486
|
}
|
|
472
|
-
doWrite(
|
|
473
|
-
this.ws.send(
|
|
487
|
+
doWrite(e, t) {
|
|
488
|
+
this.ws.send(t);
|
|
474
489
|
}
|
|
475
490
|
},
|
|
476
|
-
webtransport: class extends
|
|
491
|
+
webtransport: class extends O {
|
|
477
492
|
get name() {
|
|
478
493
|
return "webtransport";
|
|
479
494
|
}
|
|
480
495
|
doOpen() {
|
|
481
496
|
try {
|
|
482
497
|
this._transport = new WebTransport(this.createUri("https"), this.opts.transportOptions[this.name]);
|
|
483
|
-
} catch (
|
|
484
|
-
return this.emitReserved("error",
|
|
498
|
+
} catch (e) {
|
|
499
|
+
return this.emitReserved("error", e);
|
|
485
500
|
}
|
|
486
501
|
this._transport.closed.then(() => {
|
|
487
502
|
this.onClose();
|
|
488
|
-
}).catch((
|
|
489
|
-
this.onError("webtransport error",
|
|
503
|
+
}).catch((e) => {
|
|
504
|
+
this.onError("webtransport error", e);
|
|
490
505
|
}), this._transport.ready.then(() => {
|
|
491
|
-
this._transport.createBidirectionalStream().then((
|
|
492
|
-
let
|
|
493
|
-
|
|
494
|
-
let
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
}).catch((
|
|
506
|
+
this._transport.createBidirectionalStream().then((e) => {
|
|
507
|
+
let t = ue(2 ** 53 - 1, this.socket.binaryType), n = e.readable.pipeThrough(t).getReader(), r = le();
|
|
508
|
+
r.readable.pipeTo(e.writable), this._writer = r.writable.getWriter();
|
|
509
|
+
let i = () => {
|
|
510
|
+
n.read().then(({ done: e, value: t }) => {
|
|
511
|
+
e || (this.onPacket(t), i());
|
|
512
|
+
}).catch((e) => {});
|
|
498
513
|
};
|
|
499
|
-
|
|
500
|
-
let
|
|
501
|
-
this.query.sid && (
|
|
514
|
+
i();
|
|
515
|
+
let a = { type: "open" };
|
|
516
|
+
this.query.sid && (a.data = `{"sid":"${this.query.sid}"}`), this._writer.write(a).then(() => this.onOpen());
|
|
502
517
|
});
|
|
503
518
|
});
|
|
504
519
|
}
|
|
505
|
-
write(
|
|
520
|
+
write(e) {
|
|
506
521
|
this.writable = !1;
|
|
507
|
-
for (let
|
|
508
|
-
let
|
|
509
|
-
this._writer.write(
|
|
510
|
-
|
|
522
|
+
for (let t = 0; t < e.length; t++) {
|
|
523
|
+
let n = e[t], r = t === e.length - 1;
|
|
524
|
+
this._writer.write(n).then(() => {
|
|
525
|
+
r && C(() => {
|
|
511
526
|
this.writable = !0, this.emitReserved("drain");
|
|
512
527
|
}, this.setTimeoutFn);
|
|
513
528
|
});
|
|
514
529
|
}
|
|
515
530
|
}
|
|
516
531
|
doClose() {
|
|
517
|
-
var
|
|
518
|
-
(
|
|
532
|
+
var e;
|
|
533
|
+
(e = this._transport) == null || e.close();
|
|
519
534
|
}
|
|
520
535
|
},
|
|
521
|
-
polling:
|
|
522
|
-
}
|
|
523
|
-
var re = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, parts = [
|
|
536
|
+
polling: Ee
|
|
537
|
+
}, ke = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, Ae = [
|
|
524
538
|
"source",
|
|
525
539
|
"protocol",
|
|
526
540
|
"authority",
|
|
@@ -536,37 +550,39 @@ var re = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*
|
|
|
536
550
|
"query",
|
|
537
551
|
"anchor"
|
|
538
552
|
];
|
|
539
|
-
function
|
|
540
|
-
if (
|
|
541
|
-
let
|
|
542
|
-
|
|
543
|
-
let
|
|
544
|
-
for (;
|
|
545
|
-
return
|
|
553
|
+
function F(e) {
|
|
554
|
+
if (e.length > 8e3) throw "URI too long";
|
|
555
|
+
let t = e, n = e.indexOf("["), r = e.indexOf("]");
|
|
556
|
+
n != -1 && r != -1 && (e = e.substring(0, n) + e.substring(n, r).replace(/:/g, ";") + e.substring(r, e.length));
|
|
557
|
+
let i = ke.exec(e || ""), a = {}, o = 14;
|
|
558
|
+
for (; o--;) a[Ae[o]] = i[o] || "";
|
|
559
|
+
return n != -1 && r != -1 && (a.source = t, a.host = a.host.substring(1, a.host.length - 1).replace(/;/g, ":"), a.authority = a.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), a.ipv6uri = !0), a.pathNames = je(a, a.path), a.queryKey = Me(a, a.query), a;
|
|
546
560
|
}
|
|
547
|
-
function
|
|
548
|
-
let
|
|
549
|
-
return (
|
|
561
|
+
function je(e, t) {
|
|
562
|
+
let n = t.replace(/\/{2,9}/g, "/").split("/");
|
|
563
|
+
return (t.slice(0, 1) == "/" || t.length === 0) && n.splice(0, 1), t.slice(-1) == "/" && n.splice(n.length - 1, 1), n;
|
|
550
564
|
}
|
|
551
|
-
function
|
|
552
|
-
let
|
|
553
|
-
return
|
|
554
|
-
|
|
555
|
-
}),
|
|
565
|
+
function Me(e, t) {
|
|
566
|
+
let n = {};
|
|
567
|
+
return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function(e, t, r) {
|
|
568
|
+
t && (n[t] = r);
|
|
569
|
+
}), n;
|
|
556
570
|
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
571
|
+
//#endregion
|
|
572
|
+
//#region node_modules/engine.io-client/build/esm/socket.js
|
|
573
|
+
var I = typeof addEventListener == "function" && typeof removeEventListener == "function", L = [];
|
|
574
|
+
I && addEventListener("offline", () => {
|
|
575
|
+
L.forEach((e) => e());
|
|
560
576
|
}, !1);
|
|
561
|
-
var
|
|
562
|
-
constructor(
|
|
563
|
-
if (super(), this.binaryType =
|
|
564
|
-
let
|
|
565
|
-
|
|
566
|
-
} else
|
|
567
|
-
|
|
568
|
-
let
|
|
569
|
-
this.transports.push(
|
|
577
|
+
var R = class e extends S {
|
|
578
|
+
constructor(e, t) {
|
|
579
|
+
if (super(), this.binaryType = fe, this.writeBuffer = [], this._prevBufferLen = 0, this._pingInterval = -1, this._pingTimeout = -1, this._maxPayload = -1, this._pingTimeoutTime = Infinity, e && typeof e == "object" && (t = e, e = null), e) {
|
|
580
|
+
let n = F(e);
|
|
581
|
+
t.hostname = n.host, t.secure = n.protocol === "https" || n.protocol === "wss", t.port = n.port, n.query && (t.query = n.query);
|
|
582
|
+
} else t.host && (t.hostname = F(t.host).host);
|
|
583
|
+
E(this, t), this.secure = t.secure == null ? typeof location < "u" && location.protocol === "https:" : t.secure, t.hostname && !t.port && (t.port = this.secure ? "443" : "80"), this.hostname = t.hostname || (typeof location < "u" ? location.hostname : "localhost"), this.port = t.port || (typeof location < "u" && location.port ? location.port : this.secure ? "443" : "80"), this.transports = [], this._transportsByName = {}, t.transports.forEach((e) => {
|
|
584
|
+
let t = e.prototype.name;
|
|
585
|
+
this.transports.push(t), this._transportsByName[t] = e;
|
|
570
586
|
}), this.opts = Object.assign({
|
|
571
587
|
path: "/engine.io",
|
|
572
588
|
agent: !1,
|
|
@@ -579,23 +595,23 @@ var SocketWithoutUpgrade = class h extends Emitter {
|
|
|
579
595
|
perMessageDeflate: { threshold: 1024 },
|
|
580
596
|
transportOptions: {},
|
|
581
597
|
closeOnBeforeunload: !1
|
|
582
|
-
},
|
|
598
|
+
}, t), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query = ye(this.opts.query)), I && (this.opts.closeOnBeforeunload && (this._beforeunloadEventListener = () => {
|
|
583
599
|
this.transport && (this.transport.removeAllListeners(), this.transport.close());
|
|
584
600
|
}, addEventListener("beforeunload", this._beforeunloadEventListener, !1)), this.hostname !== "localhost" && (this._offlineEventListener = () => {
|
|
585
601
|
this._onClose("transport close", { description: "network connection lost" });
|
|
586
|
-
},
|
|
602
|
+
}, L.push(this._offlineEventListener))), this.opts.withCredentials && (this._cookieJar = void 0), this._open();
|
|
587
603
|
}
|
|
588
|
-
createTransport(
|
|
589
|
-
let
|
|
590
|
-
|
|
591
|
-
let
|
|
592
|
-
query:
|
|
604
|
+
createTransport(e) {
|
|
605
|
+
let t = Object.assign({}, this.opts.query);
|
|
606
|
+
t.EIO = 4, t.transport = e, this.id && (t.sid = this.id);
|
|
607
|
+
let n = Object.assign({}, this.opts, {
|
|
608
|
+
query: t,
|
|
593
609
|
socket: this,
|
|
594
610
|
hostname: this.hostname,
|
|
595
611
|
secure: this.secure,
|
|
596
612
|
port: this.port
|
|
597
|
-
}, this.opts.transportOptions[
|
|
598
|
-
return new this._transportsByName[
|
|
613
|
+
}, this.opts.transportOptions[e]);
|
|
614
|
+
return new this._transportsByName[e](n);
|
|
599
615
|
}
|
|
600
616
|
_open() {
|
|
601
617
|
if (this.transports.length === 0) {
|
|
@@ -604,359 +620,371 @@ var SocketWithoutUpgrade = class h extends Emitter {
|
|
|
604
620
|
}, 0);
|
|
605
621
|
return;
|
|
606
622
|
}
|
|
607
|
-
let
|
|
623
|
+
let t = this.opts.rememberUpgrade && e.priorWebsocketSuccess && this.transports.indexOf("websocket") !== -1 ? "websocket" : this.transports[0];
|
|
608
624
|
this.readyState = "opening";
|
|
609
|
-
let
|
|
610
|
-
|
|
625
|
+
let n = this.createTransport(t);
|
|
626
|
+
n.open(), this.setTransport(n);
|
|
611
627
|
}
|
|
612
|
-
setTransport(
|
|
613
|
-
this.transport && this.transport.removeAllListeners(), this.transport =
|
|
628
|
+
setTransport(e) {
|
|
629
|
+
this.transport && this.transport.removeAllListeners(), this.transport = e, e.on("drain", this._onDrain.bind(this)).on("packet", this._onPacket.bind(this)).on("error", this._onError.bind(this)).on("close", (e) => this._onClose("transport close", e));
|
|
614
630
|
}
|
|
615
631
|
onOpen() {
|
|
616
|
-
this.readyState = "open",
|
|
632
|
+
this.readyState = "open", e.priorWebsocketSuccess = this.transport.name === "websocket", this.emitReserved("open"), this.flush();
|
|
617
633
|
}
|
|
618
|
-
_onPacket(
|
|
619
|
-
if (this.readyState === "opening" || this.readyState === "open" || this.readyState === "closing") switch (this.emitReserved("packet",
|
|
634
|
+
_onPacket(e) {
|
|
635
|
+
if (this.readyState === "opening" || this.readyState === "open" || this.readyState === "closing") switch (this.emitReserved("packet", e), this.emitReserved("heartbeat"), e.type) {
|
|
620
636
|
case "open":
|
|
621
|
-
this.onHandshake(JSON.parse(
|
|
637
|
+
this.onHandshake(JSON.parse(e.data));
|
|
622
638
|
break;
|
|
623
639
|
case "ping":
|
|
624
640
|
this._sendPacket("pong"), this.emitReserved("ping"), this.emitReserved("pong"), this._resetPingTimeout();
|
|
625
641
|
break;
|
|
626
642
|
case "error":
|
|
627
|
-
let
|
|
628
|
-
|
|
643
|
+
let t = /* @__PURE__ */ Error("server error");
|
|
644
|
+
t.code = e.data, this._onError(t);
|
|
629
645
|
break;
|
|
630
646
|
case "message":
|
|
631
|
-
this.emitReserved("data",
|
|
647
|
+
this.emitReserved("data", e.data), this.emitReserved("message", e.data);
|
|
632
648
|
break;
|
|
633
649
|
}
|
|
634
650
|
}
|
|
635
|
-
onHandshake(
|
|
636
|
-
this.emitReserved("handshake",
|
|
651
|
+
onHandshake(e) {
|
|
652
|
+
this.emitReserved("handshake", e), this.id = e.sid, this.transport.query.sid = e.sid, this._pingInterval = e.pingInterval, this._pingTimeout = e.pingTimeout, this._maxPayload = e.maxPayload, this.onOpen(), this.readyState !== "closed" && this._resetPingTimeout();
|
|
637
653
|
}
|
|
638
654
|
_resetPingTimeout() {
|
|
639
655
|
this.clearTimeoutFn(this._pingTimeoutTimer);
|
|
640
|
-
let
|
|
641
|
-
this._pingTimeoutTime = Date.now() +
|
|
656
|
+
let e = this._pingInterval + this._pingTimeout;
|
|
657
|
+
this._pingTimeoutTime = Date.now() + e, this._pingTimeoutTimer = this.setTimeoutFn(() => {
|
|
642
658
|
this._onClose("ping timeout");
|
|
643
|
-
},
|
|
659
|
+
}, e), this.opts.autoUnref && this._pingTimeoutTimer.unref();
|
|
644
660
|
}
|
|
645
661
|
_onDrain() {
|
|
646
662
|
this.writeBuffer.splice(0, this._prevBufferLen), this._prevBufferLen = 0, this.writeBuffer.length === 0 ? this.emitReserved("drain") : this.flush();
|
|
647
663
|
}
|
|
648
664
|
flush() {
|
|
649
665
|
if (this.readyState !== "closed" && this.transport.writable && !this.upgrading && this.writeBuffer.length) {
|
|
650
|
-
let
|
|
651
|
-
this.transport.send(
|
|
666
|
+
let e = this._getWritablePackets();
|
|
667
|
+
this.transport.send(e), this._prevBufferLen = e.length, this.emitReserved("flush");
|
|
652
668
|
}
|
|
653
669
|
}
|
|
654
670
|
_getWritablePackets() {
|
|
655
671
|
if (!(this._maxPayload && this.transport.name === "polling" && this.writeBuffer.length > 1)) return this.writeBuffer;
|
|
656
|
-
let
|
|
657
|
-
for (let
|
|
658
|
-
let
|
|
659
|
-
if (
|
|
660
|
-
|
|
672
|
+
let e = 1;
|
|
673
|
+
for (let t = 0; t < this.writeBuffer.length; t++) {
|
|
674
|
+
let n = this.writeBuffer[t].data;
|
|
675
|
+
if (n && (e += ge(n)), t > 0 && e > this._maxPayload) return this.writeBuffer.slice(0, t);
|
|
676
|
+
e += 2;
|
|
661
677
|
}
|
|
662
678
|
return this.writeBuffer;
|
|
663
679
|
}
|
|
664
680
|
_hasPingExpired() {
|
|
665
681
|
if (!this._pingTimeoutTime) return !0;
|
|
666
|
-
let
|
|
667
|
-
return
|
|
682
|
+
let e = Date.now() > this._pingTimeoutTime;
|
|
683
|
+
return e && (this._pingTimeoutTime = 0, C(() => {
|
|
668
684
|
this._onClose("ping timeout");
|
|
669
|
-
}, this.setTimeoutFn)),
|
|
685
|
+
}, this.setTimeoutFn)), e;
|
|
670
686
|
}
|
|
671
|
-
write(
|
|
672
|
-
return this._sendPacket("message",
|
|
687
|
+
write(e, t, n) {
|
|
688
|
+
return this._sendPacket("message", e, t, n), this;
|
|
673
689
|
}
|
|
674
|
-
send(
|
|
675
|
-
return this._sendPacket("message",
|
|
690
|
+
send(e, t, n) {
|
|
691
|
+
return this._sendPacket("message", e, t, n), this;
|
|
676
692
|
}
|
|
677
|
-
_sendPacket(
|
|
678
|
-
if (typeof
|
|
679
|
-
|
|
680
|
-
let
|
|
681
|
-
type:
|
|
682
|
-
data:
|
|
683
|
-
options:
|
|
693
|
+
_sendPacket(e, t, n, r) {
|
|
694
|
+
if (typeof t == "function" && (r = t, t = void 0), typeof n == "function" && (r = n, n = null), this.readyState === "closing" || this.readyState === "closed") return;
|
|
695
|
+
n ||= {}, n.compress = !1 !== n.compress;
|
|
696
|
+
let i = {
|
|
697
|
+
type: e,
|
|
698
|
+
data: t,
|
|
699
|
+
options: n
|
|
684
700
|
};
|
|
685
|
-
this.emitReserved("packetCreate",
|
|
701
|
+
this.emitReserved("packetCreate", i), this.writeBuffer.push(i), r && this.once("flush", r), this.flush();
|
|
686
702
|
}
|
|
687
703
|
close() {
|
|
688
|
-
let
|
|
704
|
+
let e = () => {
|
|
689
705
|
this._onClose("forced close"), this.transport.close();
|
|
690
|
-
},
|
|
691
|
-
this.off("upgrade",
|
|
692
|
-
},
|
|
693
|
-
this.once("upgrade",
|
|
706
|
+
}, t = () => {
|
|
707
|
+
this.off("upgrade", t), this.off("upgradeError", t), e();
|
|
708
|
+
}, n = () => {
|
|
709
|
+
this.once("upgrade", t), this.once("upgradeError", t);
|
|
694
710
|
};
|
|
695
711
|
return (this.readyState === "opening" || this.readyState === "open") && (this.readyState = "closing", this.writeBuffer.length ? this.once("drain", () => {
|
|
696
|
-
this.upgrading ?
|
|
697
|
-
}) : this.upgrading ?
|
|
712
|
+
this.upgrading ? n() : e();
|
|
713
|
+
}) : this.upgrading ? n() : e()), this;
|
|
698
714
|
}
|
|
699
|
-
_onError(
|
|
700
|
-
if (
|
|
701
|
-
this.emitReserved("error",
|
|
715
|
+
_onError(t) {
|
|
716
|
+
if (e.priorWebsocketSuccess = !1, this.opts.tryAllTransports && this.transports.length > 1 && this.readyState === "opening") return this.transports.shift(), this._open();
|
|
717
|
+
this.emitReserved("error", t), this._onClose("transport error", t);
|
|
702
718
|
}
|
|
703
|
-
_onClose(
|
|
719
|
+
_onClose(e, t) {
|
|
704
720
|
if (this.readyState === "opening" || this.readyState === "open" || this.readyState === "closing") {
|
|
705
|
-
if (this.clearTimeoutFn(this._pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(),
|
|
706
|
-
let
|
|
707
|
-
|
|
721
|
+
if (this.clearTimeoutFn(this._pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(), I && (this._beforeunloadEventListener && removeEventListener("beforeunload", this._beforeunloadEventListener, !1), this._offlineEventListener)) {
|
|
722
|
+
let e = L.indexOf(this._offlineEventListener);
|
|
723
|
+
e !== -1 && L.splice(e, 1);
|
|
708
724
|
}
|
|
709
|
-
this.readyState = "closed", this.id = null, this.emitReserved("close",
|
|
725
|
+
this.readyState = "closed", this.id = null, this.emitReserved("close", e, t), this.writeBuffer = [], this._prevBufferLen = 0;
|
|
710
726
|
}
|
|
711
727
|
}
|
|
712
728
|
};
|
|
713
|
-
|
|
714
|
-
var
|
|
729
|
+
R.protocol = 4;
|
|
730
|
+
var Ne = class extends R {
|
|
715
731
|
constructor() {
|
|
716
732
|
super(...arguments), this._upgrades = [];
|
|
717
733
|
}
|
|
718
734
|
onOpen() {
|
|
719
|
-
if (super.onOpen(), this.readyState === "open" && this.opts.upgrade) for (let
|
|
735
|
+
if (super.onOpen(), this.readyState === "open" && this.opts.upgrade) for (let e = 0; e < this._upgrades.length; e++) this._probe(this._upgrades[e]);
|
|
720
736
|
}
|
|
721
|
-
_probe(
|
|
722
|
-
let
|
|
723
|
-
|
|
724
|
-
let
|
|
725
|
-
|
|
737
|
+
_probe(e) {
|
|
738
|
+
let t = this.createTransport(e), n = !1;
|
|
739
|
+
R.priorWebsocketSuccess = !1;
|
|
740
|
+
let r = () => {
|
|
741
|
+
n || (t.send([{
|
|
726
742
|
type: "ping",
|
|
727
743
|
data: "probe"
|
|
728
|
-
}]),
|
|
729
|
-
if (!
|
|
730
|
-
if (this.upgrading = !0, this.emitReserved("upgrading",
|
|
731
|
-
|
|
732
|
-
|
|
744
|
+
}]), t.once("packet", (e) => {
|
|
745
|
+
if (!n) if (e.type === "pong" && e.data === "probe") {
|
|
746
|
+
if (this.upgrading = !0, this.emitReserved("upgrading", t), !t) return;
|
|
747
|
+
R.priorWebsocketSuccess = t.name === "websocket", this.transport.pause(() => {
|
|
748
|
+
n || this.readyState !== "closed" && (l(), this.setTransport(t), t.send([{ type: "upgrade" }]), this.emitReserved("upgrade", t), t = null, this.upgrading = !1, this.flush());
|
|
733
749
|
});
|
|
734
750
|
} else {
|
|
735
|
-
let
|
|
736
|
-
|
|
751
|
+
let e = /* @__PURE__ */ Error("probe error");
|
|
752
|
+
e.transport = t.name, this.emitReserved("upgradeError", e);
|
|
737
753
|
}
|
|
738
754
|
}));
|
|
739
755
|
};
|
|
740
|
-
function
|
|
741
|
-
|
|
756
|
+
function i() {
|
|
757
|
+
n || (n = !0, l(), t.close(), t = null);
|
|
742
758
|
}
|
|
743
|
-
let
|
|
744
|
-
let
|
|
745
|
-
|
|
759
|
+
let a = (e) => {
|
|
760
|
+
let n = /* @__PURE__ */ Error("probe error: " + e);
|
|
761
|
+
n.transport = t.name, i(), this.emitReserved("upgradeError", n);
|
|
746
762
|
};
|
|
747
|
-
function
|
|
748
|
-
|
|
763
|
+
function o() {
|
|
764
|
+
a("transport closed");
|
|
749
765
|
}
|
|
750
|
-
function
|
|
751
|
-
|
|
766
|
+
function s() {
|
|
767
|
+
a("socket closed");
|
|
752
768
|
}
|
|
753
|
-
function
|
|
754
|
-
|
|
769
|
+
function c(e) {
|
|
770
|
+
t && e.name !== t.name && i();
|
|
755
771
|
}
|
|
756
|
-
let
|
|
757
|
-
|
|
772
|
+
let l = () => {
|
|
773
|
+
t.removeListener("open", r), t.removeListener("error", a), t.removeListener("close", o), this.off("close", s), this.off("upgrading", c);
|
|
758
774
|
};
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
}, 200) :
|
|
762
|
-
}
|
|
763
|
-
onHandshake(
|
|
764
|
-
this._upgrades = this._filterUpgrades(
|
|
765
|
-
}
|
|
766
|
-
_filterUpgrades(
|
|
767
|
-
let
|
|
768
|
-
for (let
|
|
769
|
-
return
|
|
770
|
-
}
|
|
771
|
-
},
|
|
772
|
-
constructor(
|
|
773
|
-
let
|
|
774
|
-
(!
|
|
775
|
+
t.once("open", r), t.once("error", a), t.once("close", o), this.once("close", s), this.once("upgrading", c), this._upgrades.indexOf("webtransport") !== -1 && e !== "webtransport" ? this.setTimeoutFn(() => {
|
|
776
|
+
n || t.open();
|
|
777
|
+
}, 200) : t.open();
|
|
778
|
+
}
|
|
779
|
+
onHandshake(e) {
|
|
780
|
+
this._upgrades = this._filterUpgrades(e.upgrades), super.onHandshake(e);
|
|
781
|
+
}
|
|
782
|
+
_filterUpgrades(e) {
|
|
783
|
+
let t = [];
|
|
784
|
+
for (let n = 0; n < e.length; n++) ~this.transports.indexOf(e[n]) && t.push(e[n]);
|
|
785
|
+
return t;
|
|
786
|
+
}
|
|
787
|
+
}, z = class extends Ne {
|
|
788
|
+
constructor(e, t = {}) {
|
|
789
|
+
let n = typeof e == "object", r = n ? { ...e } : { ...t };
|
|
790
|
+
(!r.transports || r.transports && typeof r.transports[0] == "string") && (r.transports = (r.transports || [
|
|
775
791
|
"polling",
|
|
776
792
|
"websocket",
|
|
777
793
|
"webtransport"
|
|
778
|
-
]).map((
|
|
794
|
+
]).map((e) => Oe[e]).filter((e) => !!e)), super(n ? r : e, r);
|
|
779
795
|
}
|
|
780
796
|
};
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
let
|
|
786
|
-
|
|
797
|
+
z.protocol;
|
|
798
|
+
//#endregion
|
|
799
|
+
//#region node_modules/socket.io-client/build/esm/url.js
|
|
800
|
+
function Pe(e, t = "", n) {
|
|
801
|
+
let r = e;
|
|
802
|
+
n ||= typeof location < "u" && location, e ??= n.protocol + "//" + n.host, typeof e == "string" && (e.charAt(0) === "/" && (e = e.charAt(1) === "/" ? n.protocol + e : n.host + e), /^(https?|wss?):\/\//.test(e) || (e = n === void 0 ? "https://" + e : n.protocol + "//" + e), r = F(e)), r.port || (/^(http|ws)$/.test(r.protocol) ? r.port = "80" : /^(http|ws)s$/.test(r.protocol) && (r.port = "443")), r.path = r.path || "/";
|
|
803
|
+
let i = r.host.indexOf(":") === -1 ? r.host : "[" + r.host + "]";
|
|
804
|
+
return r.id = r.protocol + "://" + i + ":" + r.port + t, r.href = r.protocol + "://" + i + (n && n.port === r.port ? "" : ":" + r.port), r;
|
|
787
805
|
}
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
806
|
+
//#endregion
|
|
807
|
+
//#region node_modules/socket.io-parser/build/esm/is-binary.js
|
|
808
|
+
var Fe = typeof ArrayBuffer == "function", Ie = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e.buffer instanceof ArrayBuffer, B = Object.prototype.toString, Le = typeof Blob == "function" || typeof Blob < "u" && B.call(Blob) === "[object BlobConstructor]", Re = typeof File == "function" || typeof File < "u" && B.call(File) === "[object FileConstructor]";
|
|
809
|
+
function V(e) {
|
|
810
|
+
return Fe && (e instanceof ArrayBuffer || Ie(e)) || Le && e instanceof Blob || Re && e instanceof File;
|
|
791
811
|
}
|
|
792
|
-
function
|
|
793
|
-
if (!
|
|
794
|
-
if (Array.isArray(
|
|
795
|
-
for (let
|
|
812
|
+
function H(e, t) {
|
|
813
|
+
if (!e || typeof e != "object") return !1;
|
|
814
|
+
if (Array.isArray(e)) {
|
|
815
|
+
for (let t = 0, n = e.length; t < n; t++) if (H(e[t])) return !0;
|
|
796
816
|
return !1;
|
|
797
817
|
}
|
|
798
|
-
if (
|
|
799
|
-
if (
|
|
800
|
-
for (let
|
|
818
|
+
if (V(e)) return !0;
|
|
819
|
+
if (e.toJSON && typeof e.toJSON == "function" && arguments.length === 1) return H(e.toJSON(), !0);
|
|
820
|
+
for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && H(e[t])) return !0;
|
|
801
821
|
return !1;
|
|
802
822
|
}
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
823
|
+
//#endregion
|
|
824
|
+
//#region node_modules/socket.io-parser/build/esm/binary.js
|
|
825
|
+
function ze(e) {
|
|
826
|
+
let t = [], n = e.data, r = e;
|
|
827
|
+
return r.data = U(n, t), r.attachments = t.length, {
|
|
828
|
+
packet: r,
|
|
829
|
+
buffers: t
|
|
808
830
|
};
|
|
809
831
|
}
|
|
810
|
-
function
|
|
811
|
-
if (!
|
|
812
|
-
if (
|
|
813
|
-
let
|
|
832
|
+
function U(e, t, n) {
|
|
833
|
+
if (!e) return e;
|
|
834
|
+
if (V(e)) {
|
|
835
|
+
let n = {
|
|
814
836
|
_placeholder: !0,
|
|
815
|
-
num:
|
|
837
|
+
num: t.length
|
|
816
838
|
};
|
|
817
|
-
return
|
|
818
|
-
} else if (Array.isArray(
|
|
819
|
-
let
|
|
820
|
-
for (let
|
|
821
|
-
return
|
|
822
|
-
} else if (typeof
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
839
|
+
return t.push(e), n;
|
|
840
|
+
} else if (Array.isArray(e)) {
|
|
841
|
+
let n = Array(e.length);
|
|
842
|
+
for (let r = 0; r < e.length; r++) n[r] = U(e[r], t);
|
|
843
|
+
return n;
|
|
844
|
+
} else if (typeof e == "object" && !(e instanceof Date)) {
|
|
845
|
+
if (e.toJSON && typeof e.toJSON == "function" && !n) return U(e.toJSON(), t, !0);
|
|
846
|
+
let r = {};
|
|
847
|
+
for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && (r[n] = U(e[n], t));
|
|
848
|
+
return r;
|
|
849
|
+
}
|
|
850
|
+
return e;
|
|
828
851
|
}
|
|
829
|
-
function
|
|
830
|
-
return
|
|
852
|
+
function Be(e, t) {
|
|
853
|
+
return e.data = W(e.data, t), delete e.attachments, e;
|
|
831
854
|
}
|
|
832
|
-
function
|
|
833
|
-
if (!
|
|
834
|
-
if (
|
|
835
|
-
if (typeof
|
|
855
|
+
function W(e, t) {
|
|
856
|
+
if (!e) return e;
|
|
857
|
+
if (e && e._placeholder === !0) {
|
|
858
|
+
if (typeof e.num == "number" && e.num >= 0 && e.num < t.length) return t[e.num];
|
|
836
859
|
throw Error("illegal attachments");
|
|
837
|
-
} else if (Array.isArray(
|
|
838
|
-
else if (typeof
|
|
839
|
-
return
|
|
860
|
+
} else if (Array.isArray(e)) for (let n = 0; n < e.length; n++) e[n] = W(e[n], t);
|
|
861
|
+
else if (typeof e == "object") for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && (e[n] = W(e[n], t));
|
|
862
|
+
return e;
|
|
840
863
|
}
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
864
|
+
//#endregion
|
|
865
|
+
//#region node_modules/socket.io-parser/build/esm/index.js
|
|
866
|
+
var Ve = /* @__PURE__ */ e({
|
|
867
|
+
Decoder: () => Ue,
|
|
868
|
+
Encoder: () => He,
|
|
869
|
+
PacketType: () => K,
|
|
870
|
+
isPacketValid: () => Je,
|
|
845
871
|
protocol: () => 5
|
|
846
|
-
}
|
|
872
|
+
}), G = [
|
|
847
873
|
"connect",
|
|
848
874
|
"connect_error",
|
|
849
875
|
"disconnect",
|
|
850
876
|
"disconnecting",
|
|
851
877
|
"newListener",
|
|
852
878
|
"removeListener"
|
|
853
|
-
],
|
|
854
|
-
(function(
|
|
855
|
-
|
|
856
|
-
})(
|
|
857
|
-
var
|
|
858
|
-
constructor(
|
|
859
|
-
this.replacer =
|
|
860
|
-
}
|
|
861
|
-
encode(
|
|
862
|
-
return (
|
|
863
|
-
type:
|
|
864
|
-
nsp:
|
|
865
|
-
data:
|
|
866
|
-
id:
|
|
867
|
-
}) : [this.encodeAsString(
|
|
868
|
-
}
|
|
869
|
-
encodeAsString(
|
|
870
|
-
let
|
|
871
|
-
return (
|
|
872
|
-
}
|
|
873
|
-
encodeAsBinary(
|
|
874
|
-
let
|
|
875
|
-
return
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
if (typeof h == "string") {
|
|
879
|
+
], K;
|
|
880
|
+
(function(e) {
|
|
881
|
+
e[e.CONNECT = 0] = "CONNECT", e[e.DISCONNECT = 1] = "DISCONNECT", e[e.EVENT = 2] = "EVENT", e[e.ACK = 3] = "ACK", e[e.CONNECT_ERROR = 4] = "CONNECT_ERROR", e[e.BINARY_EVENT = 5] = "BINARY_EVENT", e[e.BINARY_ACK = 6] = "BINARY_ACK";
|
|
882
|
+
})(K ||= {});
|
|
883
|
+
var He = class {
|
|
884
|
+
constructor(e) {
|
|
885
|
+
this.replacer = e;
|
|
886
|
+
}
|
|
887
|
+
encode(e) {
|
|
888
|
+
return (e.type === K.EVENT || e.type === K.ACK) && H(e) ? this.encodeAsBinary({
|
|
889
|
+
type: e.type === K.EVENT ? K.BINARY_EVENT : K.BINARY_ACK,
|
|
890
|
+
nsp: e.nsp,
|
|
891
|
+
data: e.data,
|
|
892
|
+
id: e.id
|
|
893
|
+
}) : [this.encodeAsString(e)];
|
|
894
|
+
}
|
|
895
|
+
encodeAsString(e) {
|
|
896
|
+
let t = "" + e.type;
|
|
897
|
+
return (e.type === K.BINARY_EVENT || e.type === K.BINARY_ACK) && (t += e.attachments + "-"), e.nsp && e.nsp !== "/" && (t += e.nsp + ","), e.id != null && (t += e.id), e.data != null && (t += JSON.stringify(e.data, this.replacer)), t;
|
|
898
|
+
}
|
|
899
|
+
encodeAsBinary(e) {
|
|
900
|
+
let t = ze(e), n = this.encodeAsString(t.packet), r = t.buffers;
|
|
901
|
+
return r.unshift(n), r;
|
|
902
|
+
}
|
|
903
|
+
}, Ue = class e extends S {
|
|
904
|
+
constructor(e) {
|
|
905
|
+
super(), this.opts = Object.assign({
|
|
906
|
+
reviver: void 0,
|
|
907
|
+
maxAttachments: 10
|
|
908
|
+
}, typeof e == "function" ? { reviver: e } : e);
|
|
909
|
+
}
|
|
910
|
+
add(e) {
|
|
911
|
+
let t;
|
|
912
|
+
if (typeof e == "string") {
|
|
888
913
|
if (this.reconstructor) throw Error("got plaintext data when reconstructing a packet");
|
|
889
|
-
|
|
890
|
-
let
|
|
891
|
-
|
|
892
|
-
} else if (
|
|
914
|
+
t = this.decodeString(e);
|
|
915
|
+
let n = t.type === K.BINARY_EVENT;
|
|
916
|
+
n || t.type === K.BINARY_ACK ? (t.type = n ? K.EVENT : K.ACK, this.reconstructor = new We(t)) : super.emitReserved("decoded", t);
|
|
917
|
+
} else if (V(e) || e.base64) if (this.reconstructor) t = this.reconstructor.takeBinaryData(e), t && (this.reconstructor = null, super.emitReserved("decoded", t));
|
|
893
918
|
else throw Error("got binary data when not reconstructing a packet");
|
|
894
|
-
else throw Error("Unknown type: " +
|
|
895
|
-
}
|
|
896
|
-
decodeString(
|
|
897
|
-
let
|
|
898
|
-
if (
|
|
899
|
-
if (
|
|
900
|
-
let
|
|
901
|
-
for (;
|
|
902
|
-
let
|
|
903
|
-
if (
|
|
904
|
-
|
|
919
|
+
else throw Error("Unknown type: " + e);
|
|
920
|
+
}
|
|
921
|
+
decodeString(t) {
|
|
922
|
+
let n = 0, r = { type: Number(t.charAt(0)) };
|
|
923
|
+
if (K[r.type] === void 0) throw Error("unknown packet type " + r.type);
|
|
924
|
+
if (r.type === K.BINARY_EVENT || r.type === K.BINARY_ACK) {
|
|
925
|
+
let e = n + 1;
|
|
926
|
+
for (; t.charAt(++n) !== "-" && n != t.length;);
|
|
927
|
+
let i = t.substring(e, n);
|
|
928
|
+
if (i != Number(i) || t.charAt(n) !== "-") throw Error("Illegal attachments");
|
|
929
|
+
let a = Number(i);
|
|
930
|
+
if (!q(a) || a < 1) throw Error("Illegal attachments");
|
|
931
|
+
if (a > this.opts.maxAttachments) throw Error("too many attachments");
|
|
932
|
+
r.attachments = a;
|
|
905
933
|
}
|
|
906
|
-
if (
|
|
907
|
-
let
|
|
908
|
-
for (; ++
|
|
909
|
-
|
|
910
|
-
} else
|
|
911
|
-
let
|
|
912
|
-
if (
|
|
913
|
-
let
|
|
914
|
-
for (; ++
|
|
915
|
-
let
|
|
916
|
-
if (
|
|
917
|
-
--
|
|
934
|
+
if (t.charAt(n + 1) === "/") {
|
|
935
|
+
let e = n + 1;
|
|
936
|
+
for (; ++n && !(t.charAt(n) === "," || n === t.length););
|
|
937
|
+
r.nsp = t.substring(e, n);
|
|
938
|
+
} else r.nsp = "/";
|
|
939
|
+
let i = t.charAt(n + 1);
|
|
940
|
+
if (i !== "" && Number(i) == i) {
|
|
941
|
+
let e = n + 1;
|
|
942
|
+
for (; ++n;) {
|
|
943
|
+
let e = t.charAt(n);
|
|
944
|
+
if (e == null || Number(e) != e) {
|
|
945
|
+
--n;
|
|
918
946
|
break;
|
|
919
947
|
}
|
|
920
|
-
if (
|
|
948
|
+
if (n === t.length) break;
|
|
921
949
|
}
|
|
922
|
-
|
|
950
|
+
r.id = Number(t.substring(e, n + 1));
|
|
923
951
|
}
|
|
924
|
-
if (
|
|
925
|
-
let
|
|
926
|
-
if (
|
|
952
|
+
if (t.charAt(++n)) {
|
|
953
|
+
let i = this.tryParse(t.substr(n));
|
|
954
|
+
if (e.isPayloadValid(r.type, i)) r.data = i;
|
|
927
955
|
else throw Error("invalid payload");
|
|
928
956
|
}
|
|
929
|
-
return
|
|
957
|
+
return r;
|
|
930
958
|
}
|
|
931
|
-
tryParse(
|
|
959
|
+
tryParse(e) {
|
|
932
960
|
try {
|
|
933
|
-
return JSON.parse(
|
|
961
|
+
return JSON.parse(e, this.opts.reviver);
|
|
934
962
|
} catch {
|
|
935
963
|
return !1;
|
|
936
964
|
}
|
|
937
965
|
}
|
|
938
|
-
static isPayloadValid(
|
|
939
|
-
switch (
|
|
940
|
-
case
|
|
941
|
-
case
|
|
942
|
-
case
|
|
943
|
-
case
|
|
944
|
-
case
|
|
945
|
-
case
|
|
946
|
-
case
|
|
966
|
+
static isPayloadValid(e, t) {
|
|
967
|
+
switch (e) {
|
|
968
|
+
case K.CONNECT: return J(t);
|
|
969
|
+
case K.DISCONNECT: return t === void 0;
|
|
970
|
+
case K.CONNECT_ERROR: return typeof t == "string" || J(t);
|
|
971
|
+
case K.EVENT:
|
|
972
|
+
case K.BINARY_EVENT: return Array.isArray(t) && (typeof t[0] == "number" || typeof t[0] == "string" && G.indexOf(t[0]) === -1);
|
|
973
|
+
case K.ACK:
|
|
974
|
+
case K.BINARY_ACK: return Array.isArray(t);
|
|
947
975
|
}
|
|
948
976
|
}
|
|
949
977
|
destroy() {
|
|
950
978
|
this.reconstructor &&= (this.reconstructor.finishedReconstruction(), null);
|
|
951
979
|
}
|
|
952
|
-
},
|
|
953
|
-
constructor(
|
|
954
|
-
this.packet =
|
|
980
|
+
}, We = class {
|
|
981
|
+
constructor(e) {
|
|
982
|
+
this.packet = e, this.buffers = [], this.reconPack = e;
|
|
955
983
|
}
|
|
956
|
-
takeBinaryData(
|
|
957
|
-
if (this.buffers.push(
|
|
958
|
-
let
|
|
959
|
-
return this.finishedReconstruction(),
|
|
984
|
+
takeBinaryData(e) {
|
|
985
|
+
if (this.buffers.push(e), this.buffers.length === this.reconPack.attachments) {
|
|
986
|
+
let e = Be(this.reconPack, this.buffers);
|
|
987
|
+
return this.finishedReconstruction(), e;
|
|
960
988
|
}
|
|
961
989
|
return null;
|
|
962
990
|
}
|
|
@@ -964,33 +992,62 @@ var Decoder = class h extends Emitter {
|
|
|
964
992
|
this.reconPack = null, this.buffers = [];
|
|
965
993
|
}
|
|
966
994
|
};
|
|
967
|
-
function
|
|
968
|
-
return
|
|
969
|
-
|
|
995
|
+
function Ge(e) {
|
|
996
|
+
return typeof e == "string";
|
|
997
|
+
}
|
|
998
|
+
var q = Number.isInteger || function(e) {
|
|
999
|
+
return typeof e == "number" && isFinite(e) && Math.floor(e) === e;
|
|
1000
|
+
};
|
|
1001
|
+
function Ke(e) {
|
|
1002
|
+
return e === void 0 || q(e);
|
|
1003
|
+
}
|
|
1004
|
+
function J(e) {
|
|
1005
|
+
return Object.prototype.toString.call(e) === "[object Object]";
|
|
1006
|
+
}
|
|
1007
|
+
function qe(e, t) {
|
|
1008
|
+
switch (e) {
|
|
1009
|
+
case K.CONNECT: return t === void 0 || J(t);
|
|
1010
|
+
case K.DISCONNECT: return t === void 0;
|
|
1011
|
+
case K.EVENT: return Array.isArray(t) && (typeof t[0] == "number" || typeof t[0] == "string" && G.indexOf(t[0]) === -1);
|
|
1012
|
+
case K.ACK: return Array.isArray(t);
|
|
1013
|
+
case K.CONNECT_ERROR: return typeof t == "string" || J(t);
|
|
1014
|
+
default: return !1;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
function Je(e) {
|
|
1018
|
+
return Ge(e.nsp) && Ke(e.id) && qe(e.type, e.data);
|
|
1019
|
+
}
|
|
1020
|
+
//#endregion
|
|
1021
|
+
//#region node_modules/socket.io-client/build/esm/on.js
|
|
1022
|
+
function Y(e, t, n) {
|
|
1023
|
+
return e.on(t, n), function() {
|
|
1024
|
+
e.off(t, n);
|
|
970
1025
|
};
|
|
971
1026
|
}
|
|
972
|
-
|
|
1027
|
+
//#endregion
|
|
1028
|
+
//#region node_modules/socket.io-client/build/esm/socket.js
|
|
1029
|
+
var Ye = Object.freeze({
|
|
973
1030
|
connect: 1,
|
|
974
1031
|
connect_error: 1,
|
|
975
1032
|
disconnect: 1,
|
|
976
1033
|
disconnecting: 1,
|
|
977
1034
|
newListener: 1,
|
|
978
1035
|
removeListener: 1
|
|
979
|
-
}),
|
|
980
|
-
constructor(
|
|
981
|
-
super(), this.connected = !1, this.recovered = !1, this.receiveBuffer = [], this.sendBuffer = [], this._queue = [], this._queueSeq = 0, this.ids = 0, this.acks = {}, this.flags = {}, this.io =
|
|
1036
|
+
}), Xe = class extends S {
|
|
1037
|
+
constructor(e, t, n) {
|
|
1038
|
+
super(), this.connected = !1, this.recovered = !1, this.receiveBuffer = [], this.sendBuffer = [], this._queue = [], this._queueSeq = 0, this.ids = 0, this.acks = {}, this.flags = {}, this.io = e, this.nsp = t, n && n.auth && (this.auth = n.auth), this._opts = Object.assign({}, n), this.io._autoConnect && this.open();
|
|
982
1039
|
}
|
|
983
1040
|
get disconnected() {
|
|
984
1041
|
return !this.connected;
|
|
985
1042
|
}
|
|
986
1043
|
subEvents() {
|
|
987
1044
|
if (this.subs) return;
|
|
988
|
-
let
|
|
1045
|
+
let e = this.io;
|
|
989
1046
|
this.subs = [
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
1047
|
+
Y(e, "open", this.onopen.bind(this)),
|
|
1048
|
+
Y(e, "packet", this.onpacket.bind(this)),
|
|
1049
|
+
Y(e, "error", this.onerror.bind(this)),
|
|
1050
|
+
Y(e, "close", this.onclose.bind(this))
|
|
994
1051
|
];
|
|
995
1052
|
}
|
|
996
1053
|
get active() {
|
|
@@ -1002,326 +1059,328 @@ var RESERVED_EVENTS = Object.freeze({
|
|
|
1002
1059
|
open() {
|
|
1003
1060
|
return this.connect();
|
|
1004
1061
|
}
|
|
1005
|
-
send(...
|
|
1006
|
-
return
|
|
1062
|
+
send(...e) {
|
|
1063
|
+
return e.unshift("message"), this.emit.apply(this, e), this;
|
|
1007
1064
|
}
|
|
1008
|
-
emit(
|
|
1009
|
-
if (
|
|
1010
|
-
if (
|
|
1011
|
-
let
|
|
1012
|
-
type:
|
|
1013
|
-
data:
|
|
1065
|
+
emit(e, ...t) {
|
|
1066
|
+
if (Ye.hasOwnProperty(e)) throw Error("\"" + e.toString() + "\" is a reserved event name");
|
|
1067
|
+
if (t.unshift(e), this._opts.retries && !this.flags.fromQueue && !this.flags.volatile) return this._addToQueue(t), this;
|
|
1068
|
+
let n = {
|
|
1069
|
+
type: K.EVENT,
|
|
1070
|
+
data: t
|
|
1014
1071
|
};
|
|
1015
|
-
if (
|
|
1016
|
-
let
|
|
1017
|
-
this._registerAckCallback(
|
|
1072
|
+
if (n.options = {}, n.options.compress = this.flags.compress !== !1, typeof t[t.length - 1] == "function") {
|
|
1073
|
+
let e = this.ids++, r = t.pop();
|
|
1074
|
+
this._registerAckCallback(e, r), n.id = e;
|
|
1018
1075
|
}
|
|
1019
|
-
let
|
|
1020
|
-
return this.flags.volatile && !
|
|
1076
|
+
let r = this.io.engine?.transport?.writable, i = this.connected && !this.io.engine?._hasPingExpired();
|
|
1077
|
+
return this.flags.volatile && !r || (i ? (this.notifyOutgoingListeners(n), this.packet(n)) : this.sendBuffer.push(n)), this.flags = {}, this;
|
|
1021
1078
|
}
|
|
1022
|
-
_registerAckCallback(
|
|
1023
|
-
let
|
|
1024
|
-
if (
|
|
1025
|
-
this.acks[
|
|
1079
|
+
_registerAckCallback(e, t) {
|
|
1080
|
+
let n = this.flags.timeout ?? this._opts.ackTimeout;
|
|
1081
|
+
if (n === void 0) {
|
|
1082
|
+
this.acks[e] = t;
|
|
1026
1083
|
return;
|
|
1027
1084
|
}
|
|
1028
|
-
let
|
|
1029
|
-
delete this.acks[
|
|
1030
|
-
for (let
|
|
1031
|
-
|
|
1032
|
-
},
|
|
1033
|
-
this.io.clearTimeoutFn(
|
|
1085
|
+
let r = this.io.setTimeoutFn(() => {
|
|
1086
|
+
delete this.acks[e];
|
|
1087
|
+
for (let t = 0; t < this.sendBuffer.length; t++) this.sendBuffer[t].id === e && this.sendBuffer.splice(t, 1);
|
|
1088
|
+
t.call(this, /* @__PURE__ */ Error("operation has timed out"));
|
|
1089
|
+
}, n), i = (...e) => {
|
|
1090
|
+
this.io.clearTimeoutFn(r), t.apply(this, e);
|
|
1034
1091
|
};
|
|
1035
|
-
|
|
1092
|
+
i.withError = !0, this.acks[e] = i;
|
|
1036
1093
|
}
|
|
1037
|
-
emitWithAck(
|
|
1038
|
-
return new Promise((
|
|
1039
|
-
let
|
|
1040
|
-
|
|
1094
|
+
emitWithAck(e, ...t) {
|
|
1095
|
+
return new Promise((n, r) => {
|
|
1096
|
+
let i = (e, t) => e ? r(e) : n(t);
|
|
1097
|
+
i.withError = !0, t.push(i), this.emit(e, ...t);
|
|
1041
1098
|
});
|
|
1042
1099
|
}
|
|
1043
|
-
_addToQueue(
|
|
1044
|
-
let
|
|
1045
|
-
typeof
|
|
1046
|
-
let
|
|
1100
|
+
_addToQueue(e) {
|
|
1101
|
+
let t;
|
|
1102
|
+
typeof e[e.length - 1] == "function" && (t = e.pop());
|
|
1103
|
+
let n = {
|
|
1047
1104
|
id: this._queueSeq++,
|
|
1048
1105
|
tryCount: 0,
|
|
1049
1106
|
pending: !1,
|
|
1050
|
-
args:
|
|
1107
|
+
args: e,
|
|
1051
1108
|
flags: Object.assign({ fromQueue: !0 }, this.flags)
|
|
1052
1109
|
};
|
|
1053
|
-
|
|
1054
|
-
if (G === this._queue[0]) return h === null ? (this._queue.shift(), W && W(null, ...K)) : G.tryCount > this._opts.retries && (this._queue.shift(), W && W(h)), G.pending = !1, this._drainQueue();
|
|
1055
|
-
}), this._queue.push(G), this._drainQueue();
|
|
1110
|
+
e.push((e, ...r) => (this._queue[0], e === null ? (this._queue.shift(), t && t(null, ...r)) : n.tryCount > this._opts.retries && (this._queue.shift(), t && t(e)), n.pending = !1, this._drainQueue())), this._queue.push(n), this._drainQueue();
|
|
1056
1111
|
}
|
|
1057
|
-
_drainQueue(
|
|
1112
|
+
_drainQueue(e = !1) {
|
|
1058
1113
|
if (!this.connected || this._queue.length === 0) return;
|
|
1059
|
-
let
|
|
1060
|
-
|
|
1114
|
+
let t = this._queue[0];
|
|
1115
|
+
t.pending && !e || (t.pending = !0, t.tryCount++, this.flags = t.flags, this.emit.apply(this, t.args));
|
|
1061
1116
|
}
|
|
1062
|
-
packet(
|
|
1063
|
-
|
|
1117
|
+
packet(e) {
|
|
1118
|
+
e.nsp = this.nsp, this.io._packet(e);
|
|
1064
1119
|
}
|
|
1065
1120
|
onopen() {
|
|
1066
|
-
typeof this.auth == "function" ? this.auth((
|
|
1067
|
-
this._sendConnectPacket(
|
|
1121
|
+
typeof this.auth == "function" ? this.auth((e) => {
|
|
1122
|
+
this._sendConnectPacket(e);
|
|
1068
1123
|
}) : this._sendConnectPacket(this.auth);
|
|
1069
1124
|
}
|
|
1070
|
-
_sendConnectPacket(
|
|
1125
|
+
_sendConnectPacket(e) {
|
|
1071
1126
|
this.packet({
|
|
1072
|
-
type:
|
|
1127
|
+
type: K.CONNECT,
|
|
1073
1128
|
data: this._pid ? Object.assign({
|
|
1074
1129
|
pid: this._pid,
|
|
1075
1130
|
offset: this._lastOffset
|
|
1076
|
-
},
|
|
1131
|
+
}, e) : e
|
|
1077
1132
|
});
|
|
1078
1133
|
}
|
|
1079
|
-
onerror(
|
|
1080
|
-
this.connected || this.emitReserved("connect_error",
|
|
1134
|
+
onerror(e) {
|
|
1135
|
+
this.connected || this.emitReserved("connect_error", e);
|
|
1081
1136
|
}
|
|
1082
|
-
onclose(
|
|
1083
|
-
this.connected = !1, delete this.id, this.emitReserved("disconnect",
|
|
1137
|
+
onclose(e, t) {
|
|
1138
|
+
this.connected = !1, delete this.id, this.emitReserved("disconnect", e, t), this._clearAcks();
|
|
1084
1139
|
}
|
|
1085
1140
|
_clearAcks() {
|
|
1086
|
-
Object.keys(this.acks).forEach((
|
|
1087
|
-
if (!this.sendBuffer.some((
|
|
1088
|
-
let
|
|
1089
|
-
delete this.acks[
|
|
1141
|
+
Object.keys(this.acks).forEach((e) => {
|
|
1142
|
+
if (!this.sendBuffer.some((t) => String(t.id) === e)) {
|
|
1143
|
+
let t = this.acks[e];
|
|
1144
|
+
delete this.acks[e], t.withError && t.call(this, /* @__PURE__ */ Error("socket has been disconnected"));
|
|
1090
1145
|
}
|
|
1091
1146
|
});
|
|
1092
1147
|
}
|
|
1093
|
-
onpacket(
|
|
1094
|
-
if (
|
|
1095
|
-
case
|
|
1096
|
-
|
|
1148
|
+
onpacket(e) {
|
|
1149
|
+
if (e.nsp === this.nsp) switch (e.type) {
|
|
1150
|
+
case K.CONNECT:
|
|
1151
|
+
e.data && e.data.sid ? this.onconnect(e.data.sid, e.data.pid) : this.emitReserved("connect_error", /* @__PURE__ */ Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));
|
|
1097
1152
|
break;
|
|
1098
|
-
case
|
|
1099
|
-
case
|
|
1100
|
-
this.onevent(
|
|
1153
|
+
case K.EVENT:
|
|
1154
|
+
case K.BINARY_EVENT:
|
|
1155
|
+
this.onevent(e);
|
|
1101
1156
|
break;
|
|
1102
|
-
case
|
|
1103
|
-
case
|
|
1104
|
-
this.onack(
|
|
1157
|
+
case K.ACK:
|
|
1158
|
+
case K.BINARY_ACK:
|
|
1159
|
+
this.onack(e);
|
|
1105
1160
|
break;
|
|
1106
|
-
case
|
|
1161
|
+
case K.DISCONNECT:
|
|
1107
1162
|
this.ondisconnect();
|
|
1108
1163
|
break;
|
|
1109
|
-
case
|
|
1164
|
+
case K.CONNECT_ERROR:
|
|
1110
1165
|
this.destroy();
|
|
1111
|
-
let
|
|
1112
|
-
|
|
1166
|
+
let t = Error(e.data.message);
|
|
1167
|
+
t.data = e.data.data, this.emitReserved("connect_error", t);
|
|
1113
1168
|
break;
|
|
1114
1169
|
}
|
|
1115
1170
|
}
|
|
1116
|
-
onevent(
|
|
1117
|
-
let
|
|
1118
|
-
|
|
1171
|
+
onevent(e) {
|
|
1172
|
+
let t = e.data || [];
|
|
1173
|
+
e.id != null && t.push(this.ack(e.id)), this.connected ? this.emitEvent(t) : this.receiveBuffer.push(Object.freeze(t));
|
|
1119
1174
|
}
|
|
1120
|
-
emitEvent(
|
|
1175
|
+
emitEvent(e) {
|
|
1121
1176
|
if (this._anyListeners && this._anyListeners.length) {
|
|
1122
|
-
let
|
|
1123
|
-
for (let
|
|
1177
|
+
let t = this._anyListeners.slice();
|
|
1178
|
+
for (let n of t) n.apply(this, e);
|
|
1124
1179
|
}
|
|
1125
|
-
super.emit.apply(this,
|
|
1126
|
-
}
|
|
1127
|
-
ack(
|
|
1128
|
-
let
|
|
1129
|
-
return function(...
|
|
1130
|
-
|
|
1131
|
-
type:
|
|
1132
|
-
id:
|
|
1133
|
-
data:
|
|
1180
|
+
super.emit.apply(this, e), this._pid && e.length && typeof e[e.length - 1] == "string" && (this._lastOffset = e[e.length - 1]);
|
|
1181
|
+
}
|
|
1182
|
+
ack(e) {
|
|
1183
|
+
let t = this, n = !1;
|
|
1184
|
+
return function(...r) {
|
|
1185
|
+
n || (n = !0, t.packet({
|
|
1186
|
+
type: K.ACK,
|
|
1187
|
+
id: e,
|
|
1188
|
+
data: r
|
|
1134
1189
|
}));
|
|
1135
1190
|
};
|
|
1136
1191
|
}
|
|
1137
|
-
onack(
|
|
1138
|
-
let
|
|
1139
|
-
typeof
|
|
1192
|
+
onack(e) {
|
|
1193
|
+
let t = this.acks[e.id];
|
|
1194
|
+
typeof t == "function" && (delete this.acks[e.id], t.withError && e.data.unshift(null), t.apply(this, e.data));
|
|
1140
1195
|
}
|
|
1141
|
-
onconnect(
|
|
1142
|
-
this.id =
|
|
1196
|
+
onconnect(e, t) {
|
|
1197
|
+
this.id = e, this.recovered = t && this._pid === t, this._pid = t, this.connected = !0, this.emitBuffered(), this._drainQueue(!0), this.emitReserved("connect");
|
|
1143
1198
|
}
|
|
1144
1199
|
emitBuffered() {
|
|
1145
|
-
this.receiveBuffer.forEach((
|
|
1146
|
-
this.notifyOutgoingListeners(
|
|
1200
|
+
this.receiveBuffer.forEach((e) => this.emitEvent(e)), this.receiveBuffer = [], this.sendBuffer.forEach((e) => {
|
|
1201
|
+
this.notifyOutgoingListeners(e), this.packet(e);
|
|
1147
1202
|
}), this.sendBuffer = [];
|
|
1148
1203
|
}
|
|
1149
1204
|
ondisconnect() {
|
|
1150
1205
|
this.destroy(), this.onclose("io server disconnect");
|
|
1151
1206
|
}
|
|
1152
1207
|
destroy() {
|
|
1153
|
-
this.subs &&= (this.subs.forEach((
|
|
1208
|
+
this.subs &&= (this.subs.forEach((e) => e()), void 0), this.io._destroy(this);
|
|
1154
1209
|
}
|
|
1155
1210
|
disconnect() {
|
|
1156
|
-
return this.connected && this.packet({ type:
|
|
1211
|
+
return this.connected && this.packet({ type: K.DISCONNECT }), this.destroy(), this.connected && this.onclose("io client disconnect"), this;
|
|
1157
1212
|
}
|
|
1158
1213
|
close() {
|
|
1159
1214
|
return this.disconnect();
|
|
1160
1215
|
}
|
|
1161
|
-
compress(
|
|
1162
|
-
return this.flags.compress =
|
|
1216
|
+
compress(e) {
|
|
1217
|
+
return this.flags.compress = e, this;
|
|
1163
1218
|
}
|
|
1164
1219
|
get volatile() {
|
|
1165
1220
|
return this.flags.volatile = !0, this;
|
|
1166
1221
|
}
|
|
1167
|
-
timeout(
|
|
1168
|
-
return this.flags.timeout =
|
|
1222
|
+
timeout(e) {
|
|
1223
|
+
return this.flags.timeout = e, this;
|
|
1169
1224
|
}
|
|
1170
|
-
onAny(
|
|
1171
|
-
return this._anyListeners = this._anyListeners || [], this._anyListeners.push(
|
|
1225
|
+
onAny(e) {
|
|
1226
|
+
return this._anyListeners = this._anyListeners || [], this._anyListeners.push(e), this;
|
|
1172
1227
|
}
|
|
1173
|
-
prependAny(
|
|
1174
|
-
return this._anyListeners = this._anyListeners || [], this._anyListeners.unshift(
|
|
1228
|
+
prependAny(e) {
|
|
1229
|
+
return this._anyListeners = this._anyListeners || [], this._anyListeners.unshift(e), this;
|
|
1175
1230
|
}
|
|
1176
|
-
offAny(
|
|
1231
|
+
offAny(e) {
|
|
1177
1232
|
if (!this._anyListeners) return this;
|
|
1178
|
-
if (
|
|
1179
|
-
let
|
|
1180
|
-
for (let
|
|
1233
|
+
if (e) {
|
|
1234
|
+
let t = this._anyListeners;
|
|
1235
|
+
for (let n = 0; n < t.length; n++) if (e === t[n]) return t.splice(n, 1), this;
|
|
1181
1236
|
} else this._anyListeners = [];
|
|
1182
1237
|
return this;
|
|
1183
1238
|
}
|
|
1184
1239
|
listenersAny() {
|
|
1185
1240
|
return this._anyListeners || [];
|
|
1186
1241
|
}
|
|
1187
|
-
onAnyOutgoing(
|
|
1188
|
-
return this._anyOutgoingListeners = this._anyOutgoingListeners || [], this._anyOutgoingListeners.push(
|
|
1242
|
+
onAnyOutgoing(e) {
|
|
1243
|
+
return this._anyOutgoingListeners = this._anyOutgoingListeners || [], this._anyOutgoingListeners.push(e), this;
|
|
1189
1244
|
}
|
|
1190
|
-
prependAnyOutgoing(
|
|
1191
|
-
return this._anyOutgoingListeners = this._anyOutgoingListeners || [], this._anyOutgoingListeners.unshift(
|
|
1245
|
+
prependAnyOutgoing(e) {
|
|
1246
|
+
return this._anyOutgoingListeners = this._anyOutgoingListeners || [], this._anyOutgoingListeners.unshift(e), this;
|
|
1192
1247
|
}
|
|
1193
|
-
offAnyOutgoing(
|
|
1248
|
+
offAnyOutgoing(e) {
|
|
1194
1249
|
if (!this._anyOutgoingListeners) return this;
|
|
1195
|
-
if (
|
|
1196
|
-
let
|
|
1197
|
-
for (let
|
|
1250
|
+
if (e) {
|
|
1251
|
+
let t = this._anyOutgoingListeners;
|
|
1252
|
+
for (let n = 0; n < t.length; n++) if (e === t[n]) return t.splice(n, 1), this;
|
|
1198
1253
|
} else this._anyOutgoingListeners = [];
|
|
1199
1254
|
return this;
|
|
1200
1255
|
}
|
|
1201
1256
|
listenersAnyOutgoing() {
|
|
1202
1257
|
return this._anyOutgoingListeners || [];
|
|
1203
1258
|
}
|
|
1204
|
-
notifyOutgoingListeners(
|
|
1259
|
+
notifyOutgoingListeners(e) {
|
|
1205
1260
|
if (this._anyOutgoingListeners && this._anyOutgoingListeners.length) {
|
|
1206
|
-
let
|
|
1207
|
-
for (let
|
|
1261
|
+
let t = this._anyOutgoingListeners.slice();
|
|
1262
|
+
for (let n of t) n.apply(this, e.data);
|
|
1208
1263
|
}
|
|
1209
1264
|
}
|
|
1210
1265
|
};
|
|
1211
|
-
|
|
1212
|
-
|
|
1266
|
+
//#endregion
|
|
1267
|
+
//#region node_modules/socket.io-client/build/esm/contrib/backo2.js
|
|
1268
|
+
function X(e) {
|
|
1269
|
+
e ||= {}, this.ms = e.min || 100, this.max = e.max || 1e4, this.factor = e.factor || 2, this.jitter = e.jitter > 0 && e.jitter <= 1 ? e.jitter : 0, this.attempts = 0;
|
|
1213
1270
|
}
|
|
1214
|
-
|
|
1215
|
-
var
|
|
1271
|
+
X.prototype.duration = function() {
|
|
1272
|
+
var e = this.ms * this.factor ** +this.attempts++;
|
|
1216
1273
|
if (this.jitter) {
|
|
1217
|
-
var
|
|
1218
|
-
|
|
1274
|
+
var t = Math.random(), n = Math.floor(t * this.jitter * e);
|
|
1275
|
+
e = Math.floor(t * 10) & 1 ? e + n : e - n;
|
|
1219
1276
|
}
|
|
1220
|
-
return Math.min(
|
|
1221
|
-
},
|
|
1277
|
+
return Math.min(e, this.max) | 0;
|
|
1278
|
+
}, X.prototype.reset = function() {
|
|
1222
1279
|
this.attempts = 0;
|
|
1223
|
-
},
|
|
1224
|
-
this.ms =
|
|
1225
|
-
},
|
|
1226
|
-
this.max =
|
|
1227
|
-
},
|
|
1228
|
-
this.jitter =
|
|
1280
|
+
}, X.prototype.setMin = function(e) {
|
|
1281
|
+
this.ms = e;
|
|
1282
|
+
}, X.prototype.setMax = function(e) {
|
|
1283
|
+
this.max = e;
|
|
1284
|
+
}, X.prototype.setJitter = function(e) {
|
|
1285
|
+
this.jitter = e;
|
|
1229
1286
|
};
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1287
|
+
//#endregion
|
|
1288
|
+
//#region node_modules/socket.io-client/build/esm/manager.js
|
|
1289
|
+
var Z = class extends S {
|
|
1290
|
+
constructor(e, t) {
|
|
1291
|
+
super(), this.nsps = {}, this.subs = [], e && typeof e == "object" && (t = e, e = void 0), t ||= {}, t.path = t.path || "/socket.io", this.opts = t, E(this, t), this.reconnection(t.reconnection !== !1), this.reconnectionAttempts(t.reconnectionAttempts || Infinity), this.reconnectionDelay(t.reconnectionDelay || 1e3), this.reconnectionDelayMax(t.reconnectionDelayMax || 5e3), this.randomizationFactor(t.randomizationFactor ?? .5), this.backoff = new X({
|
|
1233
1292
|
min: this.reconnectionDelay(),
|
|
1234
1293
|
max: this.reconnectionDelayMax(),
|
|
1235
1294
|
jitter: this.randomizationFactor()
|
|
1236
|
-
}), this.timeout(
|
|
1237
|
-
let
|
|
1238
|
-
this.encoder = new
|
|
1295
|
+
}), this.timeout(t.timeout == null ? 2e4 : t.timeout), this._readyState = "closed", this.uri = e;
|
|
1296
|
+
let n = t.parser || Ve;
|
|
1297
|
+
this.encoder = new n.Encoder(), this.decoder = new n.Decoder(), this._autoConnect = t.autoConnect !== !1, this._autoConnect && this.open();
|
|
1239
1298
|
}
|
|
1240
|
-
reconnection(
|
|
1241
|
-
return arguments.length ? (this._reconnection = !!
|
|
1299
|
+
reconnection(e) {
|
|
1300
|
+
return arguments.length ? (this._reconnection = !!e, e || (this.skipReconnect = !0), this) : this._reconnection;
|
|
1242
1301
|
}
|
|
1243
|
-
reconnectionAttempts(
|
|
1244
|
-
return
|
|
1302
|
+
reconnectionAttempts(e) {
|
|
1303
|
+
return e === void 0 ? this._reconnectionAttempts : (this._reconnectionAttempts = e, this);
|
|
1245
1304
|
}
|
|
1246
|
-
reconnectionDelay(
|
|
1247
|
-
var
|
|
1248
|
-
return
|
|
1305
|
+
reconnectionDelay(e) {
|
|
1306
|
+
var t;
|
|
1307
|
+
return e === void 0 ? this._reconnectionDelay : (this._reconnectionDelay = e, (t = this.backoff) == null || t.setMin(e), this);
|
|
1249
1308
|
}
|
|
1250
|
-
randomizationFactor(
|
|
1251
|
-
var
|
|
1252
|
-
return
|
|
1309
|
+
randomizationFactor(e) {
|
|
1310
|
+
var t;
|
|
1311
|
+
return e === void 0 ? this._randomizationFactor : (this._randomizationFactor = e, (t = this.backoff) == null || t.setJitter(e), this);
|
|
1253
1312
|
}
|
|
1254
|
-
reconnectionDelayMax(
|
|
1255
|
-
var
|
|
1256
|
-
return
|
|
1313
|
+
reconnectionDelayMax(e) {
|
|
1314
|
+
var t;
|
|
1315
|
+
return e === void 0 ? this._reconnectionDelayMax : (this._reconnectionDelayMax = e, (t = this.backoff) == null || t.setMax(e), this);
|
|
1257
1316
|
}
|
|
1258
|
-
timeout(
|
|
1259
|
-
return arguments.length ? (this._timeout =
|
|
1317
|
+
timeout(e) {
|
|
1318
|
+
return arguments.length ? (this._timeout = e, this) : this._timeout;
|
|
1260
1319
|
}
|
|
1261
1320
|
maybeReconnectOnOpen() {
|
|
1262
1321
|
!this._reconnecting && this._reconnection && this.backoff.attempts === 0 && this.reconnect();
|
|
1263
1322
|
}
|
|
1264
|
-
open(
|
|
1323
|
+
open(e) {
|
|
1265
1324
|
if (~this._readyState.indexOf("open")) return this;
|
|
1266
|
-
this.engine = new
|
|
1267
|
-
let
|
|
1325
|
+
this.engine = new z(this.uri, this.opts);
|
|
1326
|
+
let t = this.engine, n = this;
|
|
1268
1327
|
this._readyState = "opening", this.skipReconnect = !1;
|
|
1269
|
-
let
|
|
1270
|
-
|
|
1271
|
-
}),
|
|
1272
|
-
this.cleanup(), this._readyState = "closed", this.emitReserved("error",
|
|
1273
|
-
},
|
|
1328
|
+
let r = Y(t, "open", function() {
|
|
1329
|
+
n.onopen(), e && e();
|
|
1330
|
+
}), i = (t) => {
|
|
1331
|
+
this.cleanup(), this._readyState = "closed", this.emitReserved("error", t), e ? e(t) : this.maybeReconnectOnOpen();
|
|
1332
|
+
}, a = Y(t, "error", i);
|
|
1274
1333
|
if (!1 !== this._timeout) {
|
|
1275
|
-
let
|
|
1276
|
-
|
|
1277
|
-
},
|
|
1278
|
-
this.opts.autoUnref &&
|
|
1279
|
-
this.clearTimeoutFn(
|
|
1334
|
+
let e = this._timeout, n = this.setTimeoutFn(() => {
|
|
1335
|
+
r(), i(/* @__PURE__ */ Error("timeout")), t.close();
|
|
1336
|
+
}, e);
|
|
1337
|
+
this.opts.autoUnref && n.unref(), this.subs.push(() => {
|
|
1338
|
+
this.clearTimeoutFn(n);
|
|
1280
1339
|
});
|
|
1281
1340
|
}
|
|
1282
|
-
return this.subs.push(
|
|
1341
|
+
return this.subs.push(r), this.subs.push(a), this;
|
|
1283
1342
|
}
|
|
1284
|
-
connect(
|
|
1285
|
-
return this.open(
|
|
1343
|
+
connect(e) {
|
|
1344
|
+
return this.open(e);
|
|
1286
1345
|
}
|
|
1287
1346
|
onopen() {
|
|
1288
1347
|
this.cleanup(), this._readyState = "open", this.emitReserved("open");
|
|
1289
|
-
let
|
|
1290
|
-
this.subs.push(
|
|
1348
|
+
let e = this.engine;
|
|
1349
|
+
this.subs.push(Y(e, "ping", this.onping.bind(this)), Y(e, "data", this.ondata.bind(this)), Y(e, "error", this.onerror.bind(this)), Y(e, "close", this.onclose.bind(this)), Y(this.decoder, "decoded", this.ondecoded.bind(this)));
|
|
1291
1350
|
}
|
|
1292
1351
|
onping() {
|
|
1293
1352
|
this.emitReserved("ping");
|
|
1294
1353
|
}
|
|
1295
|
-
ondata(
|
|
1354
|
+
ondata(e) {
|
|
1296
1355
|
try {
|
|
1297
|
-
this.decoder.add(
|
|
1298
|
-
} catch (
|
|
1299
|
-
this.onclose("parse error",
|
|
1356
|
+
this.decoder.add(e);
|
|
1357
|
+
} catch (e) {
|
|
1358
|
+
this.onclose("parse error", e);
|
|
1300
1359
|
}
|
|
1301
1360
|
}
|
|
1302
|
-
ondecoded(
|
|
1303
|
-
|
|
1304
|
-
this.emitReserved("packet",
|
|
1361
|
+
ondecoded(e) {
|
|
1362
|
+
C(() => {
|
|
1363
|
+
this.emitReserved("packet", e);
|
|
1305
1364
|
}, this.setTimeoutFn);
|
|
1306
1365
|
}
|
|
1307
|
-
onerror(
|
|
1308
|
-
this.emitReserved("error",
|
|
1366
|
+
onerror(e) {
|
|
1367
|
+
this.emitReserved("error", e);
|
|
1309
1368
|
}
|
|
1310
|
-
socket(
|
|
1311
|
-
let
|
|
1312
|
-
return
|
|
1369
|
+
socket(e, t) {
|
|
1370
|
+
let n = this.nsps[e];
|
|
1371
|
+
return n ? this._autoConnect && !n.active && n.connect() : (n = new Xe(this, e, t), this.nsps[e] = n), n;
|
|
1313
1372
|
}
|
|
1314
|
-
_destroy(
|
|
1315
|
-
let
|
|
1316
|
-
for (let
|
|
1373
|
+
_destroy(e) {
|
|
1374
|
+
let t = Object.keys(this.nsps);
|
|
1375
|
+
for (let e of t) if (this.nsps[e].active) return;
|
|
1317
1376
|
this._close();
|
|
1318
1377
|
}
|
|
1319
|
-
_packet(
|
|
1320
|
-
let
|
|
1321
|
-
for (let
|
|
1378
|
+
_packet(e) {
|
|
1379
|
+
let t = this.encoder.encode(e);
|
|
1380
|
+
for (let n = 0; n < t.length; n++) this.engine.write(t[n], e.options);
|
|
1322
1381
|
}
|
|
1323
1382
|
cleanup() {
|
|
1324
|
-
this.subs.forEach((
|
|
1383
|
+
this.subs.forEach((e) => e()), this.subs.length = 0, this.decoder.destroy();
|
|
1325
1384
|
}
|
|
1326
1385
|
_close() {
|
|
1327
1386
|
this.skipReconnect = !0, this._reconnecting = !1, this.onclose("forced close");
|
|
@@ -1329,55 +1388,59 @@ var Manager = class extends Emitter {
|
|
|
1329
1388
|
disconnect() {
|
|
1330
1389
|
return this._close();
|
|
1331
1390
|
}
|
|
1332
|
-
onclose(
|
|
1333
|
-
var
|
|
1334
|
-
this.cleanup(), (
|
|
1391
|
+
onclose(e, t) {
|
|
1392
|
+
var n;
|
|
1393
|
+
this.cleanup(), (n = this.engine) == null || n.close(), this.backoff.reset(), this._readyState = "closed", this.emitReserved("close", e, t), this._reconnection && !this.skipReconnect && this.reconnect();
|
|
1335
1394
|
}
|
|
1336
1395
|
reconnect() {
|
|
1337
1396
|
if (this._reconnecting || this.skipReconnect) return this;
|
|
1338
|
-
let
|
|
1397
|
+
let e = this;
|
|
1339
1398
|
if (this.backoff.attempts >= this._reconnectionAttempts) this.backoff.reset(), this.emitReserved("reconnect_failed"), this._reconnecting = !1;
|
|
1340
1399
|
else {
|
|
1341
|
-
let
|
|
1400
|
+
let t = this.backoff.duration();
|
|
1342
1401
|
this._reconnecting = !0;
|
|
1343
|
-
let
|
|
1344
|
-
|
|
1345
|
-
|
|
1402
|
+
let n = this.setTimeoutFn(() => {
|
|
1403
|
+
e.skipReconnect || (this.emitReserved("reconnect_attempt", e.backoff.attempts), !e.skipReconnect && e.open((t) => {
|
|
1404
|
+
t ? (e._reconnecting = !1, e.reconnect(), this.emitReserved("reconnect_error", t)) : e.onreconnect();
|
|
1346
1405
|
}));
|
|
1347
|
-
},
|
|
1348
|
-
this.opts.autoUnref &&
|
|
1349
|
-
this.clearTimeoutFn(
|
|
1406
|
+
}, t);
|
|
1407
|
+
this.opts.autoUnref && n.unref(), this.subs.push(() => {
|
|
1408
|
+
this.clearTimeoutFn(n);
|
|
1350
1409
|
});
|
|
1351
1410
|
}
|
|
1352
1411
|
}
|
|
1353
1412
|
onreconnect() {
|
|
1354
|
-
let
|
|
1355
|
-
this._reconnecting = !1, this.backoff.reset(), this.emitReserved("reconnect",
|
|
1356
|
-
}
|
|
1357
|
-
},
|
|
1358
|
-
function
|
|
1359
|
-
typeof
|
|
1360
|
-
let
|
|
1361
|
-
return
|
|
1413
|
+
let e = this.backoff.attempts;
|
|
1414
|
+
this._reconnecting = !1, this.backoff.reset(), this.emitReserved("reconnect", e);
|
|
1415
|
+
}
|
|
1416
|
+
}, Q = {};
|
|
1417
|
+
function $(e, t) {
|
|
1418
|
+
typeof e == "object" && (t = e, e = void 0), t ||= {};
|
|
1419
|
+
let n = Pe(e, t.path || "/socket.io"), r = n.source, i = n.id, a = n.path, o = Q[i] && a in Q[i].nsps, s = t.forceNew || t["force new connection"] || !1 === t.multiplex || o, c;
|
|
1420
|
+
return s ? c = new Z(r, t) : (Q[i] || (Q[i] = new Z(r, t)), c = Q[i]), n.query && !t.query && (t.query = n.queryKey), c.socket(n.path, t);
|
|
1362
1421
|
}
|
|
1363
|
-
Object.assign(
|
|
1364
|
-
Manager,
|
|
1365
|
-
Socket,
|
|
1366
|
-
io:
|
|
1367
|
-
connect:
|
|
1422
|
+
Object.assign($, {
|
|
1423
|
+
Manager: Z,
|
|
1424
|
+
Socket: Xe,
|
|
1425
|
+
io: $,
|
|
1426
|
+
connect: $
|
|
1368
1427
|
});
|
|
1369
|
-
|
|
1370
|
-
|
|
1428
|
+
//#endregion
|
|
1429
|
+
//#region src/sn/SysBase.ts
|
|
1430
|
+
var Ze = class e {
|
|
1431
|
+
hPlg;
|
|
1432
|
+
arg;
|
|
1433
|
+
elc = new a();
|
|
1371
1434
|
hFactoryCls = {};
|
|
1372
|
-
constructor(
|
|
1373
|
-
this.hPlg =
|
|
1435
|
+
constructor(e = {}, t) {
|
|
1436
|
+
this.hPlg = e, this.arg = t;
|
|
1374
1437
|
}
|
|
1375
1438
|
destroy() {
|
|
1376
1439
|
this.elc.clear();
|
|
1377
1440
|
}
|
|
1378
|
-
async loaded(...[
|
|
1379
|
-
let
|
|
1380
|
-
return delete
|
|
1441
|
+
async loaded(...[e]) {
|
|
1442
|
+
let t = e.snsys_pre;
|
|
1443
|
+
return delete e.snsys_pre, t?.init({
|
|
1381
1444
|
getInfo: this.#n,
|
|
1382
1445
|
addTag: () => {},
|
|
1383
1446
|
addLayCls: () => {},
|
|
@@ -1385,51 +1448,51 @@ var SysBase = class h {
|
|
|
1385
1448
|
getVal: () => ({}),
|
|
1386
1449
|
resume: () => {},
|
|
1387
1450
|
render: () => {},
|
|
1388
|
-
setDec: (
|
|
1389
|
-
this.dec =
|
|
1451
|
+
setDec: (e) => {
|
|
1452
|
+
this.dec = e;
|
|
1390
1453
|
},
|
|
1391
|
-
setDecAB: (
|
|
1392
|
-
this.#_ =
|
|
1454
|
+
setDecAB: (e) => {
|
|
1455
|
+
this.#_ = e;
|
|
1393
1456
|
},
|
|
1394
|
-
setEnc: (
|
|
1395
|
-
this.enc =
|
|
1457
|
+
setEnc: (e) => {
|
|
1458
|
+
this.enc = e;
|
|
1396
1459
|
},
|
|
1397
|
-
getStK: (
|
|
1398
|
-
this.stk =
|
|
1460
|
+
getStK: (e) => {
|
|
1461
|
+
this.stk = e;
|
|
1399
1462
|
},
|
|
1400
|
-
getHash: (
|
|
1401
|
-
this.hash =
|
|
1463
|
+
getHash: (e) => {
|
|
1464
|
+
this.hash = e;
|
|
1402
1465
|
}
|
|
1403
1466
|
});
|
|
1404
1467
|
}
|
|
1405
1468
|
main = void 0;
|
|
1406
1469
|
cfg;
|
|
1407
|
-
setMain(
|
|
1408
|
-
this.main =
|
|
1470
|
+
setMain(e, t) {
|
|
1471
|
+
this.main = e, this.cfg = t;
|
|
1409
1472
|
}
|
|
1410
1473
|
async run() {
|
|
1411
|
-
let [{ Main:
|
|
1474
|
+
let [{ Main: e }, { TxtLayer: t }, { GrpLayer: n }] = await Promise.all([
|
|
1412
1475
|
import("./Main.js"),
|
|
1413
1476
|
import("./TxtLayer.js"),
|
|
1414
1477
|
import("./GrpLayer.js")
|
|
1415
1478
|
]);
|
|
1416
1479
|
this.hFactoryCls = {
|
|
1417
|
-
grp: () => new
|
|
1418
|
-
txt: () => new
|
|
1480
|
+
grp: () => new n(),
|
|
1481
|
+
txt: () => new t()
|
|
1419
1482
|
}, this.run = async () => {
|
|
1420
|
-
this.main?.destroy(), this.main = await
|
|
1483
|
+
this.main?.destroy(), this.main = await e.generate(this);
|
|
1421
1484
|
}, await this.run();
|
|
1422
1485
|
}
|
|
1423
1486
|
stop() {
|
|
1424
1487
|
this.main?.destroy(), this.main = void 0;
|
|
1425
1488
|
}
|
|
1426
|
-
fetch = (
|
|
1489
|
+
fetch = (e, t) => fetch(e, t);
|
|
1427
1490
|
data = {
|
|
1428
|
-
sys:
|
|
1491
|
+
sys: i(),
|
|
1429
1492
|
mark: {},
|
|
1430
1493
|
kidoku: {}
|
|
1431
1494
|
};
|
|
1432
|
-
async initVal(
|
|
1495
|
+
async initVal(e, t) {}
|
|
1433
1496
|
flush() {
|
|
1434
1497
|
if (this.#e) {
|
|
1435
1498
|
this.#t = !0;
|
|
@@ -1443,28 +1506,28 @@ var SysBase = class h {
|
|
|
1443
1506
|
#t = !1;
|
|
1444
1507
|
flushSub() {}
|
|
1445
1508
|
val;
|
|
1446
|
-
init(
|
|
1447
|
-
let
|
|
1448
|
-
this.val =
|
|
1449
|
-
let
|
|
1450
|
-
return
|
|
1451
|
-
|
|
1452
|
-
}).catch((
|
|
1509
|
+
init(e, t, n) {
|
|
1510
|
+
let i = [];
|
|
1511
|
+
this.val = n;
|
|
1512
|
+
let a = "";
|
|
1513
|
+
return i.push(n.init().then(() => {
|
|
1514
|
+
a = "sys", a += String(n.getVal("sys:TextLayer.Back.Alpha", 1)), a = "kidoku", n.saveKidoku();
|
|
1515
|
+
}).catch((e) => console.error(`セーブデータ(${a})が壊れています。一度クリアする必要があります(b) %o`, e))), e.close = (e) => this.close(e), e.export = (e) => this._export(e), e.import = (e) => this._import(e), e.navigate_to = (e) => this.navigate_to(e), e.title = (e) => this.title(e), e.toggle_full_screen = (e) => this.#h(e), e.update_check = (e) => this.update_check(e), e.window = (e) => this.window(e), e.title({ text: this.cfg.oCfg.book.title || "SKYNovel" }), n.defTmp("const.sn.isApp", () => this.isApp), n.defTmp("const.sn.isDbg", () => r.isDbg), n.defTmp("const.sn.isPackaged", () => r.isPackaged), n.defTmp("const.sn.needClick2Play", () => r.needClick2Play()), n.defTmp("const.sn.displayState", () => this.isFullScr), n.setVal_Nochk("sys", "const.sn.cfg.ns", this.cfg.oCfg.save_ns), n.flush(), r.isDbg && this.attach_debug(this.main), [...i, ...Object.values(this.hPlg).map((r) => r.init({
|
|
1453
1516
|
getInfo: this.#n,
|
|
1454
|
-
addTag: (
|
|
1455
|
-
if (
|
|
1456
|
-
|
|
1517
|
+
addTag: (t, n) => {
|
|
1518
|
+
if (t in e) throw `すでに定義済みのタグ[${t}]です`;
|
|
1519
|
+
e[t] = n;
|
|
1457
1520
|
},
|
|
1458
|
-
addLayCls: (
|
|
1459
|
-
if (
|
|
1460
|
-
this.hFactoryCls[
|
|
1521
|
+
addLayCls: (e, t) => {
|
|
1522
|
+
if (e in this.hFactoryCls) throw `すでに定義済みのレイヤcls【${e}】です`;
|
|
1523
|
+
this.hFactoryCls[e] = t;
|
|
1461
1524
|
},
|
|
1462
|
-
searchPath: (
|
|
1463
|
-
getVal: (
|
|
1525
|
+
searchPath: (e, t = o.DEFAULT) => this.cfg.searchPath(e, t),
|
|
1526
|
+
getVal: (e, t) => n.getVal(e, t),
|
|
1464
1527
|
resume: () => this.main?.resume(),
|
|
1465
|
-
render: (
|
|
1466
|
-
...
|
|
1467
|
-
clear:
|
|
1528
|
+
render: (e, n, r = !1) => t.renderer.render(e, {
|
|
1529
|
+
...n ? { renderTexture: n } : {},
|
|
1530
|
+
clear: r
|
|
1468
1531
|
}),
|
|
1469
1532
|
setDec: () => {},
|
|
1470
1533
|
setDecAB: () => {},
|
|
@@ -1474,8 +1537,8 @@ var SysBase = class h {
|
|
|
1474
1537
|
}))];
|
|
1475
1538
|
}
|
|
1476
1539
|
#n = () => ({ window: {
|
|
1477
|
-
width:
|
|
1478
|
-
height:
|
|
1540
|
+
width: r.stageW,
|
|
1541
|
+
height: r.stageH
|
|
1479
1542
|
} });
|
|
1480
1543
|
#r = 0;
|
|
1481
1544
|
#i = 0;
|
|
@@ -1508,37 +1571,37 @@ var SysBase = class h {
|
|
|
1508
1571
|
isFullScr = !1;
|
|
1509
1572
|
cvsResize() {
|
|
1510
1573
|
if (!this.main) return;
|
|
1511
|
-
let
|
|
1512
|
-
if (
|
|
1513
|
-
let
|
|
1514
|
-
|
|
1574
|
+
let e = globalThis.innerWidth, t = globalThis.innerHeight, i = this.main.cvs, a = i.parentElement !== document.body;
|
|
1575
|
+
if (a) {
|
|
1576
|
+
let n = globalThis.getComputedStyle(i);
|
|
1577
|
+
e = parseFloat(n.width), t = parseFloat(n.height);
|
|
1515
1578
|
}
|
|
1516
|
-
if (
|
|
1517
|
-
let
|
|
1518
|
-
(
|
|
1579
|
+
if (r.isMobile) {
|
|
1580
|
+
let n = screen.orientation.angle % 180 == 0;
|
|
1581
|
+
(n && e > t || !n && e < t) && ([e, t] = [t, e]);
|
|
1519
1582
|
}
|
|
1520
|
-
let
|
|
1521
|
-
if (
|
|
1583
|
+
let o = i.getBoundingClientRect();
|
|
1584
|
+
if (n(r.hDip, "expanding", !0) || a || r.stageW > e || r.stageH > t) if (r.stageW / r.stageH <= e / t ? (this.#i = t, this.#r = r.stageW / r.stageH * t) : (this.#r = e, this.#i = r.stageH / r.stageW * e), this.#a = this.#r / r.stageW, a) this.#c = 0, this.#l = 0;
|
|
1522
1585
|
else {
|
|
1523
|
-
let
|
|
1524
|
-
|
|
1586
|
+
let n = 1 - this.#a;
|
|
1587
|
+
r.isMobile ? (this.#c = (e - this.#r) / 2 * n, this.#l = (t - this.#i) / 2 * n) : (this.#c = o.left * n, this.#l = o.top * n);
|
|
1525
1588
|
}
|
|
1526
|
-
else this.#r =
|
|
1527
|
-
let
|
|
1528
|
-
|
|
1529
|
-
let
|
|
1530
|
-
|
|
1589
|
+
else this.#r = r.stageW, this.#i = r.stageH, this.#a = 1, this.#c = 0, this.#l = 0;
|
|
1590
|
+
let s = i.parentElement.style;
|
|
1591
|
+
a || (s.position = "relative", s.width = `${String(this.#r)}px`, s.height = `${String(this.#i)}px`);
|
|
1592
|
+
let c = i.style;
|
|
1593
|
+
c.width = s.width, c.height = s.height, a ? (this.#o = o.left, this.#s = o.top) : (this.#o = 0, this.#s = 0), this.isFullScr && (this.#o += (e - this.#r) / 2, this.#s += (t - this.#i) / 2);
|
|
1531
1594
|
}
|
|
1532
|
-
use4ViteElectron(
|
|
1595
|
+
use4ViteElectron(e, t, n, r) {
|
|
1533
1596
|
return !1;
|
|
1534
1597
|
}
|
|
1535
|
-
attach_debug(
|
|
1598
|
+
attach_debug(e) {
|
|
1536
1599
|
this.attach_debug = () => {};
|
|
1537
|
-
let
|
|
1538
|
-
|
|
1539
|
-
this.callHook(
|
|
1540
|
-
}).on("disconnect", () =>
|
|
1541
|
-
for (let
|
|
1600
|
+
let t = document.createElement("style");
|
|
1601
|
+
t.innerHTML = "/* SKYNovel Dbg */\n.sn_BounceInOut { animation: sn_kfBounceInOut linear 1.5s; }\n@keyframes sn_kfBounceInOut{\n0% {opacity: 0; transform: scaleX(0.30) scaleY(0.30);}\n10% {opacity: 1; transform: scaleX(1.10) scaleY(1.10);}\n20% { transform: scaleX(0.95) scaleY(0.95);}\n30% { transform: scaleX(1.00) scaleY(1.00);}\n70% {opacity: 1;}\n100%{opacity: 0;}\n}\n.sn_BounceIn { animation: sn_kfBounceIn linear 0.3s; }\n@keyframes sn_kfBounceIn{\n0% {opacity: 0; transform: scaleX(0.30) scaleY(0.30);}\n50% {opacity: 1; transform: scaleX(1.10) scaleY(1.10);}\n100%{ transform: scaleX(0.95) scaleY(0.95);}\n}\n.sn_HopIn { animation: sn_kfHopIn linear 0.8s; }\n@keyframes sn_kfHopIn{\n0% {transform: translate(0px, 0px);}\n15% {transform: translate(0px, -25px);}\n30% {transform: translate(0px, 0px);}\n45% {transform: translate(0px, -15px);}\n60% {transform: translate(0px, 0px);}\n75% {transform: translate(0px, -5px);}\n100%{transform: translate(0px, 0px);}\n}", document.getElementsByTagName("head")[0].appendChild(t), this.addHook((e, t) => this.#d[e]?.(t)), this.#u = $(`http://localhost:${String(this.extPort)}`), this.#u.on("data", (e, t) => {
|
|
1602
|
+
this.callHook(e, t);
|
|
1603
|
+
}).on("disconnect", () => e.setLoop(!0)), this.callHook = (e, t) => {
|
|
1604
|
+
for (let n of this.#p) n(e, t);
|
|
1542
1605
|
};
|
|
1543
1606
|
}
|
|
1544
1607
|
extPort = 3776;
|
|
@@ -1547,8 +1610,8 @@ var SysBase = class h {
|
|
|
1547
1610
|
}
|
|
1548
1611
|
#u = void 0;
|
|
1549
1612
|
#d = {
|
|
1550
|
-
auth: (
|
|
1551
|
-
if (
|
|
1613
|
+
auth: (e) => {
|
|
1614
|
+
if (e.t !== this.cfg.oCfg.debuger_token) {
|
|
1552
1615
|
this.end();
|
|
1553
1616
|
return;
|
|
1554
1617
|
}
|
|
@@ -1556,8 +1619,8 @@ var SysBase = class h {
|
|
|
1556
1619
|
},
|
|
1557
1620
|
continue: () => this.toast("再生"),
|
|
1558
1621
|
disconnect: () => this.toast("切断"),
|
|
1559
|
-
restart: (
|
|
1560
|
-
this.send2Dbg(
|
|
1622
|
+
restart: (e) => {
|
|
1623
|
+
this.send2Dbg(e?.ri ?? "", {}), this.end(), this.run();
|
|
1561
1624
|
},
|
|
1562
1625
|
pause: () => this.toast("一時停止"),
|
|
1563
1626
|
stopOnEntry: () => this.toast("一時停止"),
|
|
@@ -1567,22 +1630,22 @@ var SysBase = class h {
|
|
|
1567
1630
|
stopOnStepIn: () => this.toast("ステップイン"),
|
|
1568
1631
|
stopOnStepOut: () => this.toast("ステップアウト"),
|
|
1569
1632
|
stopOnBackstep: () => this.toast("一歩戻る"),
|
|
1570
|
-
_addPath: (
|
|
1633
|
+
_addPath: (e) => this.cfg.addPath(e.fn, e.o)
|
|
1571
1634
|
};
|
|
1572
|
-
toast(
|
|
1635
|
+
toast(t) {
|
|
1573
1636
|
if (!this.main) return;
|
|
1574
|
-
let
|
|
1575
|
-
for (let
|
|
1576
|
-
let
|
|
1577
|
-
if (!
|
|
1578
|
-
|
|
1579
|
-
let
|
|
1580
|
-
|
|
1581
|
-
left: ${String((
|
|
1582
|
-
top: ${String((
|
|
1637
|
+
let n = document.body;
|
|
1638
|
+
for (let e of [...Array.from(n.getElementsByClassName("sn_BounceIn")), ...Array.from(n.getElementsByClassName("sn_HopIn"))]) e.remove();
|
|
1639
|
+
let i = document.createElement("img"), a = e.#f[t];
|
|
1640
|
+
if (!a) throw Error(`toast 名ミス=${t}`);
|
|
1641
|
+
i.src = `data:image/svg+xml;base64,${a.dat}`;
|
|
1642
|
+
let o = Math.min(r.stageW, r.stageH) / 4 * this.#a;
|
|
1643
|
+
i.width = i.height = o, i.style.cssText = `position: absolute;
|
|
1644
|
+
left: ${String((r.stageW - o) / 2 * this.#a + o * (a.dx ?? 0))}px;
|
|
1645
|
+
top: ${String((r.stageH - o) / 2 * this.#a + o * (a.dy ?? 0))}px;`, i.classList.add("sn_toast", a.ease ?? "sn_BounceInOut"), a.ease || i.addEventListener("animationend", () => n.removeChild(i), {
|
|
1583
1646
|
once: !0,
|
|
1584
1647
|
passive: !0
|
|
1585
|
-
}),
|
|
1648
|
+
}), n.insertBefore(i, this.main.cvs);
|
|
1586
1649
|
}
|
|
1587
1650
|
static #f = {
|
|
1588
1651
|
接続: {
|
|
@@ -1615,100 +1678,100 @@ top: ${String((CmnLib.stageH - Y) / 2 * this.#a + Y * (J.dy ?? 0))}px;`, q.class
|
|
|
1615
1678
|
};
|
|
1616
1679
|
pathBaseCnvSnPath4Dbg = "";
|
|
1617
1680
|
fire;
|
|
1618
|
-
setFire(
|
|
1619
|
-
this.fire =
|
|
1681
|
+
setFire(e) {
|
|
1682
|
+
this.fire = e;
|
|
1620
1683
|
}
|
|
1621
1684
|
#p = [];
|
|
1622
|
-
addHook(
|
|
1623
|
-
this.#p.push(
|
|
1685
|
+
addHook(e) {
|
|
1686
|
+
this.#p.push(e);
|
|
1624
1687
|
}
|
|
1625
|
-
callHook = (
|
|
1626
|
-
send2Dbg = (
|
|
1627
|
-
this.#u?.emit("data",
|
|
1688
|
+
callHook = (e, t) => {};
|
|
1689
|
+
send2Dbg = (e, t) => {
|
|
1690
|
+
this.#u?.emit("data", e, t);
|
|
1628
1691
|
};
|
|
1629
|
-
copyBMFolder = (
|
|
1630
|
-
eraseBMFolder = (
|
|
1692
|
+
copyBMFolder = (e, t) => {};
|
|
1693
|
+
eraseBMFolder = (e) => {};
|
|
1631
1694
|
close = () => !1;
|
|
1632
1695
|
_export = () => !1;
|
|
1633
1696
|
_import = () => !1;
|
|
1634
1697
|
navigate_to = () => !1;
|
|
1635
|
-
title = (
|
|
1636
|
-
let { text:
|
|
1637
|
-
if (!
|
|
1638
|
-
return this.#m =
|
|
1698
|
+
title = (e) => {
|
|
1699
|
+
let { text: t } = e;
|
|
1700
|
+
if (!t) throw "[title] textは必須です";
|
|
1701
|
+
return this.#m = t, this.titleSub(this.#m + this.#g), !1;
|
|
1639
1702
|
};
|
|
1640
1703
|
#m = "";
|
|
1641
|
-
titleSub(
|
|
1642
|
-
#h = (
|
|
1643
|
-
if (!
|
|
1644
|
-
let
|
|
1645
|
-
return this.elc.add(document,
|
|
1646
|
-
|
|
1704
|
+
titleSub(e) {}
|
|
1705
|
+
#h = (n) => {
|
|
1706
|
+
if (!n.key) return this.tglFlscr_sub().catch((t) => e.tglFlscr_HdrErr(t)), !1;
|
|
1707
|
+
let r = n.key.toLowerCase();
|
|
1708
|
+
return this.elc.add(document, t, (t) => {
|
|
1709
|
+
e.modKey(t) + t.key.toLowerCase() === r && (t.stopPropagation(), this.tglFlscr_sub().catch((t) => e.tglFlscr_HdrErr(t)));
|
|
1647
1710
|
}, { passive: !0 }), !1;
|
|
1648
1711
|
};
|
|
1649
|
-
static tglFlscr_HdrErr(
|
|
1650
|
-
|
|
1712
|
+
static tglFlscr_HdrErr(e) {
|
|
1713
|
+
e instanceof TypeError && console.error("フルスクリーン化でエラーです。ブラウザ環境でキー入力きっかけでないと発生します"), console.error(`fn:SysBase.ts tglFlscr ${String(e)}`);
|
|
1651
1714
|
}
|
|
1652
|
-
static modKey(
|
|
1653
|
-
return (
|
|
1715
|
+
static modKey(e) {
|
|
1716
|
+
return (e.altKey ? e.key === "Alt" ? "" : "alt+" : "") + (e.ctrlKey ? e.key === "Control" ? "" : "ctrl+" : "") + (e.metaKey ? e.key === "Meta" ? "" : "meta+" : "") + (e.shiftKey ? e.key === "Shift" ? "" : "shift+" : "");
|
|
1654
1717
|
}
|
|
1655
1718
|
async tglFlscr_sub() {}
|
|
1656
1719
|
update_check = () => !1;
|
|
1657
1720
|
window = () => !1;
|
|
1658
1721
|
#g = "";
|
|
1659
|
-
setTitleInfo(
|
|
1660
|
-
this.#g =
|
|
1722
|
+
setTitleInfo(e) {
|
|
1723
|
+
this.#g = e, this.titleSub(this.#m + this.#g);
|
|
1661
1724
|
}
|
|
1662
1725
|
#_ = () => Promise.resolve({
|
|
1663
1726
|
ext_num: 0,
|
|
1664
1727
|
ab: /* @__PURE__ */ new ArrayBuffer(0)
|
|
1665
1728
|
});
|
|
1666
|
-
dec = (
|
|
1667
|
-
async decAB(
|
|
1668
|
-
let { ext_num:
|
|
1669
|
-
return
|
|
1729
|
+
dec = (e, t) => Promise.resolve(t);
|
|
1730
|
+
async decAB(e) {
|
|
1731
|
+
let { ext_num: t, ab: n } = await this.#_(e), r = this.#v[t];
|
|
1732
|
+
return r?.fnc ? await r.fnc(n) : n;
|
|
1670
1733
|
}
|
|
1671
1734
|
#v = {
|
|
1672
1735
|
1: {
|
|
1673
1736
|
ext: "jpeg",
|
|
1674
|
-
fnc: (
|
|
1737
|
+
fnc: (e) => this.#y(e, "image/jpeg")
|
|
1675
1738
|
},
|
|
1676
1739
|
2: {
|
|
1677
1740
|
ext: "png",
|
|
1678
|
-
fnc: (
|
|
1741
|
+
fnc: (e) => this.#y(e, "image/png")
|
|
1679
1742
|
},
|
|
1680
1743
|
3: {
|
|
1681
1744
|
ext: "svg",
|
|
1682
|
-
fnc: (
|
|
1745
|
+
fnc: (e) => this.#y(e, "image/svg+xml")
|
|
1683
1746
|
},
|
|
1684
1747
|
4: {
|
|
1685
1748
|
ext: "webp",
|
|
1686
|
-
fnc: (
|
|
1749
|
+
fnc: (e) => this.#y(e, "image/webp")
|
|
1687
1750
|
},
|
|
1688
1751
|
20: {
|
|
1689
1752
|
ext: "mp4",
|
|
1690
|
-
fnc: (
|
|
1753
|
+
fnc: (e) => this.#b(e, "video/mp4")
|
|
1691
1754
|
},
|
|
1692
1755
|
21: {
|
|
1693
1756
|
ext: "webm",
|
|
1694
|
-
fnc: (
|
|
1757
|
+
fnc: (e) => this.#b(e, "video/webm")
|
|
1695
1758
|
},
|
|
1696
1759
|
22: {
|
|
1697
1760
|
ext: "ogv",
|
|
1698
|
-
fnc: (
|
|
1761
|
+
fnc: (e) => this.#b(e, "video/ogv")
|
|
1699
1762
|
}
|
|
1700
1763
|
};
|
|
1701
|
-
#y = (
|
|
1702
|
-
let
|
|
1703
|
-
|
|
1764
|
+
#y = (e, t) => new Promise((n, r) => {
|
|
1765
|
+
let i = new Blob([e], { type: t }), a = new Image();
|
|
1766
|
+
a.onload = () => n(a), a.onerror = (e) => r(Error(e instanceof Event ? e.type : e)), a.src = URL.createObjectURL(i);
|
|
1704
1767
|
});
|
|
1705
|
-
#b = (
|
|
1706
|
-
let
|
|
1707
|
-
this.elc.add(
|
|
1768
|
+
#b = (e, t) => new Promise((n, r) => {
|
|
1769
|
+
let i = new Blob([e], { type: t }), a = document.createElement("video");
|
|
1770
|
+
this.elc.add(a, "error", () => r(Error(a.error?.message ?? ""))), this.elc.add(a, "canplay", () => n(a)), a.src = URL.createObjectURL(i);
|
|
1708
1771
|
});
|
|
1709
|
-
enc = async (
|
|
1772
|
+
enc = async (e) => e;
|
|
1710
1773
|
stk = () => "";
|
|
1711
|
-
hash = (
|
|
1774
|
+
hash = (e) => "";
|
|
1712
1775
|
isApp = !1;
|
|
1713
1776
|
$path_downloads = "";
|
|
1714
1777
|
get path_downloads() {
|
|
@@ -1718,12 +1781,13 @@ top: ${String((CmnLib.stageH - Y) / 2 * this.#a + Y * (J.dy ?? 0))}px;`, q.class
|
|
|
1718
1781
|
get path_userdata() {
|
|
1719
1782
|
return this.$path_userdata;
|
|
1720
1783
|
}
|
|
1721
|
-
capturePage(
|
|
1722
|
-
async savePic(
|
|
1723
|
-
async ensureFile(
|
|
1724
|
-
async appendFile(
|
|
1725
|
-
async outputFile(
|
|
1784
|
+
capturePage(e, t, n, r) {}
|
|
1785
|
+
async savePic(e, t) {}
|
|
1786
|
+
async ensureFile(e) {}
|
|
1787
|
+
async appendFile(e, t) {}
|
|
1788
|
+
async outputFile(e, t) {}
|
|
1726
1789
|
};
|
|
1727
|
-
|
|
1790
|
+
//#endregion
|
|
1791
|
+
export { Ze as t };
|
|
1728
1792
|
|
|
1729
1793
|
//# sourceMappingURL=SysBase.js.map
|