@famibee/skynovel 2.0.1 → 2.0.3
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 +6 -4
- 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 +985 -950
- 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 +2631 -2593
- 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/sn/RubySpliter.d.ts.map +1 -1
- package/dist/web.js +418 -418
- 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 +6 -4
- 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 +985 -950
- 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 +11 -11
- 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/dist_app/sn/RubySpliter.d.ts.map +1 -1
- package/package.json +20 -21
package/dist/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]", d = typeof ArrayBuffer == "function", f = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e && e.buffer instanceof ArrayBuffer, p = ({ type: e, data: t }, n, r) => u && t instanceof Blob ? n ? r(t) : m(t, r) : d && (t instanceof ArrayBuffer || f(t)) ? n ? r(t) : m(new Blob([t]), r) : r(s[e] + (t || "")), m = (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 h(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 g;
|
|
27
|
+
function ee(e, t) {
|
|
28
|
+
if (u && e.data instanceof Blob) return e.data.arrayBuffer().then(h).then(t);
|
|
29
|
+
if (d && (e.data instanceof ArrayBuffer || f(e.data))) return t(h(e.data));
|
|
30
|
+
p(e, !1, (e) => {
|
|
31
|
+
g ||= new TextEncoder(), t(g.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 te = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", _ = typeof Uint8Array > "u" ? [] : /* @__PURE__ */ new Uint8Array(256);
|
|
37
|
+
for (let e = 0; e < 64; e++) _[te.charCodeAt(e)] = e;
|
|
38
|
+
var ne = (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 = _[e.charCodeAt(r)], o = _[e.charCodeAt(r + 1)], s = _[e.charCodeAt(r + 2)], c = _[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
|
+
}, re = typeof ArrayBuffer == "function", v = (e, t) => {
|
|
45
|
+
if (typeof e != "string") return {
|
|
45
46
|
type: "message",
|
|
46
|
-
data:
|
|
47
|
+
data: y(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: ie(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
|
+
}, ie = (e, t) => re ? y(ne(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
|
+
}, y = (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
|
+
}, b = "", ae = (e, t) => {
|
|
66
|
+
let n = e.length, r = Array(n), i = 0;
|
|
67
|
+
e.forEach((e, a) => {
|
|
68
|
+
p(e, !1, (e) => {
|
|
69
|
+
r[a] = e, ++i === n && t(r.join(b));
|
|
71
70
|
});
|
|
72
71
|
});
|
|
73
|
-
},
|
|
74
|
-
let
|
|
75
|
-
for (let
|
|
76
|
-
let
|
|
77
|
-
if (
|
|
72
|
+
}, oe = (e, t) => {
|
|
73
|
+
let n = e.split(b), r = [];
|
|
74
|
+
for (let e = 0; e < n.length; e++) {
|
|
75
|
+
let i = v(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 se() {
|
|
81
|
+
return new TransformStream({ transform(e, t) {
|
|
82
|
+
ee(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 x;
|
|
99
|
+
function S(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 C(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 ce(e, t) {
|
|
109
|
+
x ||= 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 (S(n) < 1) break;
|
|
115
|
+
let e = C(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 (S(n) < 2) break;
|
|
119
|
+
let e = C(n, 2);
|
|
120
|
+
i = new DataView(e.buffer, e.byteOffset, e.length).getUint16(0), r = 3;
|
|
121
|
+
} else if (r === 2) {
|
|
122
|
+
if (S(n) < 8) break;
|
|
123
|
+
let e = C(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 (S(n) < i) break;
|
|
131
|
+
let e = C(n, i);
|
|
132
|
+
s.enqueue(v(a ? e : x.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 w(e) {
|
|
144
|
+
if (e) return le(e);
|
|
144
145
|
}
|
|
145
|
-
function
|
|
146
|
-
for (var
|
|
147
|
-
return
|
|
146
|
+
function le(e) {
|
|
147
|
+
for (var t in w.prototype) e[t] = w.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
|
+
w.prototype.on = w.prototype.addEventListener = function(e, t) {
|
|
151
|
+
return this._callbacks = this._callbacks || {}, (this._callbacks["$" + e] = this._callbacks["$" + e] || []).push(t), this;
|
|
152
|
+
}, w.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
|
+
}, w.prototype.off = w.prototype.removeListener = w.prototype.removeAllListeners = w.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
|
+
}, w.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
|
+
}, w.prototype.emitReserved = w.prototype.emit, w.prototype.listeners = function(e) {
|
|
176
|
+
return this._callbacks = this._callbacks || {}, this._callbacks["$" + e] || [];
|
|
177
|
+
}, w.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 T = typeof Promise == "function" && typeof Promise.resolve == "function" ? (e) => Promise.resolve().then(e) : (e, t) => t(e, 0), E = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), ue = "arraybuffer";
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region node_modules/engine.io-client/build/esm/util.js
|
|
185
|
+
function D(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 de = E.setTimeout, fe = E.clearTimeout;
|
|
189
|
+
function O(e, t) {
|
|
190
|
+
t.useNativeTimers ? (e.setTimeoutFn = de.bind(E), e.clearTimeoutFn = fe.bind(E)) : (e.setTimeoutFn = E.setTimeout.bind(E), e.clearTimeoutFn = E.clearTimeout.bind(E));
|
|
186
191
|
}
|
|
187
|
-
var
|
|
188
|
-
function
|
|
189
|
-
return typeof
|
|
192
|
+
var pe = 1.33;
|
|
193
|
+
function me(e) {
|
|
194
|
+
return typeof e == "string" ? he(e) : Math.ceil((e.byteLength || e.size) * pe);
|
|
190
195
|
}
|
|
191
|
-
function
|
|
192
|
-
let
|
|
193
|
-
for (let
|
|
194
|
-
return
|
|
196
|
+
function he(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 ge() {
|
|
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 _e(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 ve(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 ye = 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
|
+
}, k = class extends w {
|
|
226
|
+
constructor(e) {
|
|
227
|
+
super(), this.writable = !1, O(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 ye(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 = v(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
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 = _e(e);
|
|
267
|
+
return t.length ? "?" + t : "";
|
|
259
268
|
}
|
|
260
|
-
},
|
|
269
|
+
}, be = class extends k {
|
|
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
|
+
oe(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, ae(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] = ge()), !this.supportsBinary && !t.sid && (t.b64 = 1), this.createUri(e, t);
|
|
309
318
|
}
|
|
310
|
-
},
|
|
319
|
+
}, A = !1;
|
|
311
320
|
try {
|
|
312
|
-
|
|
321
|
+
A = typeof XMLHttpRequest < "u" && "withCredentials" in new XMLHttpRequest();
|
|
313
322
|
} catch {}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
323
|
+
var xe = A;
|
|
324
|
+
//#endregion
|
|
325
|
+
//#region node_modules/engine.io-client/build/esm/transports/polling-xhr.js
|
|
326
|
+
function Se() {}
|
|
327
|
+
var Ce = class extends be {
|
|
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
|
+
}, j = class e extends w {
|
|
350
|
+
constructor(e, t, n) {
|
|
351
|
+
super(), this.createRequest = e, O(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 = D(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 = Se, 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 (j.requestsCount = 0, j.requests = {}, typeof document < "u") {
|
|
406
|
+
if (typeof attachEvent == "function") attachEvent("onunload", M);
|
|
393
407
|
else if (typeof addEventListener == "function") {
|
|
394
|
-
let
|
|
395
|
-
addEventListener(
|
|
408
|
+
let e = "onpagehide" in E ? "pagehide" : "unload";
|
|
409
|
+
addEventListener(e, M, !1);
|
|
396
410
|
}
|
|
397
411
|
}
|
|
398
|
-
function
|
|
399
|
-
for (let
|
|
412
|
+
function M() {
|
|
413
|
+
for (let e in j.requests) j.requests.hasOwnProperty(e) && j.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 we = (function() {
|
|
416
|
+
let e = N({ xdomain: !1 });
|
|
417
|
+
return e && e.responseType !== null;
|
|
418
|
+
})(), Te = class extends Ce {
|
|
419
|
+
constructor(e) {
|
|
420
|
+
super(e);
|
|
421
|
+
let t = e && e.forceBase64;
|
|
422
|
+
this.supportsBinary = we && !t;
|
|
423
|
+
}
|
|
424
|
+
request(e = {}) {
|
|
425
|
+
return Object.assign(e, { xd: this.xd }, this.opts), new j(N, this.uri(), e);
|
|
412
426
|
}
|
|
413
427
|
};
|
|
414
|
-
function
|
|
415
|
-
let
|
|
428
|
+
function N(e) {
|
|
429
|
+
let t = e.xdomain;
|
|
416
430
|
try {
|
|
417
|
-
if (typeof XMLHttpRequest < "u" && (!
|
|
431
|
+
if (typeof XMLHttpRequest < "u" && (!t || xe)) return new XMLHttpRequest();
|
|
418
432
|
} catch {}
|
|
419
|
-
if (!
|
|
420
|
-
return new
|
|
433
|
+
if (!t) try {
|
|
434
|
+
return new E[["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 P = typeof navigator < "u" && typeof navigator.product == "string" && navigator.product.toLowerCase() === "reactnative", Ee = class extends k {
|
|
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 = P ? {} : D(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
|
+
p(n, this.supportsBinary, (e) => {
|
|
450
466
|
try {
|
|
451
|
-
this.doWrite(
|
|
467
|
+
this.doWrite(n, e);
|
|
452
468
|
} catch {}
|
|
453
|
-
|
|
469
|
+
r && T(() => {
|
|
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] = ge()), this.supportsBinary || (t.b64 = 1), this.createUri(e, t);
|
|
481
|
+
}
|
|
482
|
+
}, F = E.WebSocket || E.MozWebSocket, De = {
|
|
483
|
+
websocket: class extends Ee {
|
|
484
|
+
createSocket(e, t, n) {
|
|
485
|
+
return P ? new F(e, t, n) : t ? new F(e, t) : new F(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 k {
|
|
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 = ce(2 ** 53 - 1, this.socket.binaryType), n = e.readable.pipeThrough(t).getReader(), r = se();
|
|
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 && T(() => {
|
|
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: Te
|
|
537
|
+
}, Oe = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, ke = [
|
|
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 I(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 = Oe.exec(e || ""), a = {}, o = 14;
|
|
558
|
+
for (; o--;) a[ke[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 = Ae(a, a.path), a.queryKey = je(a, a.query), a;
|
|
546
560
|
}
|
|
547
|
-
function
|
|
548
|
-
let
|
|
549
|
-
return (
|
|
561
|
+
function Ae(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 je(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 L = typeof addEventListener == "function" && typeof removeEventListener == "function", R = [];
|
|
574
|
+
L && addEventListener("offline", () => {
|
|
575
|
+
R.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 z = class e extends w {
|
|
578
|
+
constructor(e, t) {
|
|
579
|
+
if (super(), this.binaryType = ue, 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 = I(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 = I(t.host).host);
|
|
583
|
+
O(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 = ve(this.opts.query)), L && (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
|
+
}, R.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,367 @@ 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 += me(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, T(() => {
|
|
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(), L && (this._beforeunloadEventListener && removeEventListener("beforeunload", this._beforeunloadEventListener, !1), this._offlineEventListener)) {
|
|
722
|
+
let e = R.indexOf(this._offlineEventListener);
|
|
723
|
+
e !== -1 && R.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
|
+
z.protocol = 4;
|
|
730
|
+
var Me = class extends z {
|
|
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
|
+
z.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
|
+
z.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
|
+
}, B = class extends Me {
|
|
788
|
+
constructor(e, t = {}) {
|
|
789
|
+
let n = typeof e == "object" ? e : t;
|
|
790
|
+
(!n.transports || n.transports && typeof n.transports[0] == "string") && (n.transports = (n.transports || [
|
|
775
791
|
"polling",
|
|
776
792
|
"websocket",
|
|
777
793
|
"webtransport"
|
|
778
|
-
]).map((
|
|
794
|
+
]).map((e) => De[e]).filter((e) => !!e)), super(e, n);
|
|
779
795
|
}
|
|
780
796
|
};
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
let
|
|
786
|
-
|
|
797
|
+
B.protocol;
|
|
798
|
+
//#endregion
|
|
799
|
+
//#region node_modules/socket.io-client/build/esm/url.js
|
|
800
|
+
function Ne(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 = I(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 Pe = typeof ArrayBuffer == "function", Fe = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e.buffer instanceof ArrayBuffer, V = Object.prototype.toString, Ie = typeof Blob == "function" || typeof Blob < "u" && V.call(Blob) === "[object BlobConstructor]", Le = typeof File == "function" || typeof File < "u" && V.call(File) === "[object FileConstructor]";
|
|
809
|
+
function H(e) {
|
|
810
|
+
return Pe && (e instanceof ArrayBuffer || Fe(e)) || Ie && e instanceof Blob || Le && e instanceof File;
|
|
791
811
|
}
|
|
792
|
-
function
|
|
793
|
-
if (!
|
|
794
|
-
if (Array.isArray(
|
|
795
|
-
for (let
|
|
812
|
+
function U(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 (U(e[t])) return !0;
|
|
796
816
|
return !1;
|
|
797
817
|
}
|
|
798
|
-
if (
|
|
799
|
-
if (
|
|
800
|
-
for (let
|
|
818
|
+
if (H(e)) return !0;
|
|
819
|
+
if (e.toJSON && typeof e.toJSON == "function" && arguments.length === 1) return U(e.toJSON(), !0);
|
|
820
|
+
for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && U(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 Re(e) {
|
|
826
|
+
let t = [], n = e.data, r = e;
|
|
827
|
+
return r.data = W(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 W(e, t) {
|
|
833
|
+
if (!e) return e;
|
|
834
|
+
if (H(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
|
-
let
|
|
824
|
-
for (let
|
|
825
|
-
return
|
|
826
|
-
}
|
|
827
|
-
return
|
|
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] = W(e[r], t);
|
|
843
|
+
return n;
|
|
844
|
+
} else if (typeof e == "object" && !(e instanceof Date)) {
|
|
845
|
+
let n = {};
|
|
846
|
+
for (let r in e) Object.prototype.hasOwnProperty.call(e, r) && (n[r] = W(e[r], t));
|
|
847
|
+
return n;
|
|
848
|
+
}
|
|
849
|
+
return e;
|
|
828
850
|
}
|
|
829
|
-
function
|
|
830
|
-
return
|
|
851
|
+
function ze(e, t) {
|
|
852
|
+
return e.data = G(e.data, t), delete e.attachments, e;
|
|
831
853
|
}
|
|
832
|
-
function
|
|
833
|
-
if (!
|
|
834
|
-
if (
|
|
835
|
-
if (typeof
|
|
854
|
+
function G(e, t) {
|
|
855
|
+
if (!e) return e;
|
|
856
|
+
if (e && e._placeholder === !0) {
|
|
857
|
+
if (typeof e.num == "number" && e.num >= 0 && e.num < t.length) return t[e.num];
|
|
836
858
|
throw Error("illegal attachments");
|
|
837
|
-
} else if (Array.isArray(
|
|
838
|
-
else if (typeof
|
|
839
|
-
return
|
|
859
|
+
} else if (Array.isArray(e)) for (let n = 0; n < e.length; n++) e[n] = G(e[n], t);
|
|
860
|
+
else if (typeof e == "object") for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && (e[n] = G(e[n], t));
|
|
861
|
+
return e;
|
|
840
862
|
}
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
863
|
+
//#endregion
|
|
864
|
+
//#region node_modules/socket.io-parser/build/esm/index.js
|
|
865
|
+
var Be = /* @__PURE__ */ e({
|
|
866
|
+
Decoder: () => Ue,
|
|
867
|
+
Encoder: () => He,
|
|
868
|
+
PacketType: () => K,
|
|
845
869
|
protocol: () => 5
|
|
846
|
-
}
|
|
870
|
+
}), Ve = [
|
|
847
871
|
"connect",
|
|
848
872
|
"connect_error",
|
|
849
873
|
"disconnect",
|
|
850
874
|
"disconnecting",
|
|
851
875
|
"newListener",
|
|
852
876
|
"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
|
|
877
|
+
], K;
|
|
878
|
+
(function(e) {
|
|
879
|
+
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";
|
|
880
|
+
})(K ||= {});
|
|
881
|
+
var He = class {
|
|
882
|
+
constructor(e) {
|
|
883
|
+
this.replacer = e;
|
|
884
|
+
}
|
|
885
|
+
encode(e) {
|
|
886
|
+
return (e.type === K.EVENT || e.type === K.ACK) && U(e) ? this.encodeAsBinary({
|
|
887
|
+
type: e.type === K.EVENT ? K.BINARY_EVENT : K.BINARY_ACK,
|
|
888
|
+
nsp: e.nsp,
|
|
889
|
+
data: e.data,
|
|
890
|
+
id: e.id
|
|
891
|
+
}) : [this.encodeAsString(e)];
|
|
892
|
+
}
|
|
893
|
+
encodeAsString(e) {
|
|
894
|
+
let t = "" + e.type;
|
|
895
|
+
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;
|
|
896
|
+
}
|
|
897
|
+
encodeAsBinary(e) {
|
|
898
|
+
let t = Re(e), n = this.encodeAsString(t.packet), r = t.buffers;
|
|
899
|
+
return r.unshift(n), r;
|
|
876
900
|
}
|
|
877
901
|
};
|
|
878
|
-
function
|
|
879
|
-
return Object.prototype.toString.call(
|
|
902
|
+
function q(e) {
|
|
903
|
+
return Object.prototype.toString.call(e) === "[object Object]";
|
|
880
904
|
}
|
|
881
|
-
var
|
|
882
|
-
constructor(
|
|
883
|
-
super(), this.reviver =
|
|
905
|
+
var Ue = class e extends w {
|
|
906
|
+
constructor(e) {
|
|
907
|
+
super(), this.reviver = e;
|
|
884
908
|
}
|
|
885
|
-
add(
|
|
886
|
-
let
|
|
887
|
-
if (typeof
|
|
909
|
+
add(e) {
|
|
910
|
+
let t;
|
|
911
|
+
if (typeof e == "string") {
|
|
888
912
|
if (this.reconstructor) throw Error("got plaintext data when reconstructing a packet");
|
|
889
|
-
|
|
890
|
-
let
|
|
891
|
-
|
|
892
|
-
} else if (
|
|
913
|
+
t = this.decodeString(e);
|
|
914
|
+
let n = t.type === K.BINARY_EVENT;
|
|
915
|
+
n || t.type === K.BINARY_ACK ? (t.type = n ? K.EVENT : K.ACK, this.reconstructor = new We(t), t.attachments === 0 && super.emitReserved("decoded", t)) : super.emitReserved("decoded", t);
|
|
916
|
+
} else if (H(e) || e.base64) if (this.reconstructor) t = this.reconstructor.takeBinaryData(e), t && (this.reconstructor = null, super.emitReserved("decoded", t));
|
|
893
917
|
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
|
-
|
|
918
|
+
else throw Error("Unknown type: " + e);
|
|
919
|
+
}
|
|
920
|
+
decodeString(t) {
|
|
921
|
+
let n = 0, r = { type: Number(t.charAt(0)) };
|
|
922
|
+
if (K[r.type] === void 0) throw Error("unknown packet type " + r.type);
|
|
923
|
+
if (r.type === K.BINARY_EVENT || r.type === K.BINARY_ACK) {
|
|
924
|
+
let e = n + 1;
|
|
925
|
+
for (; t.charAt(++n) !== "-" && n != t.length;);
|
|
926
|
+
let i = t.substring(e, n);
|
|
927
|
+
if (i != Number(i) || t.charAt(n) !== "-") throw Error("Illegal attachments");
|
|
928
|
+
r.attachments = Number(i);
|
|
905
929
|
}
|
|
906
|
-
if (
|
|
907
|
-
let
|
|
908
|
-
for (; ++
|
|
909
|
-
|
|
910
|
-
} else
|
|
911
|
-
let
|
|
912
|
-
if (
|
|
913
|
-
let
|
|
914
|
-
for (; ++
|
|
915
|
-
let
|
|
916
|
-
if (
|
|
917
|
-
--
|
|
930
|
+
if (t.charAt(n + 1) === "/") {
|
|
931
|
+
let e = n + 1;
|
|
932
|
+
for (; ++n && !(t.charAt(n) === "," || n === t.length););
|
|
933
|
+
r.nsp = t.substring(e, n);
|
|
934
|
+
} else r.nsp = "/";
|
|
935
|
+
let i = t.charAt(n + 1);
|
|
936
|
+
if (i !== "" && Number(i) == i) {
|
|
937
|
+
let e = n + 1;
|
|
938
|
+
for (; ++n;) {
|
|
939
|
+
let e = t.charAt(n);
|
|
940
|
+
if (e == null || Number(e) != e) {
|
|
941
|
+
--n;
|
|
918
942
|
break;
|
|
919
943
|
}
|
|
920
|
-
if (
|
|
944
|
+
if (n === t.length) break;
|
|
921
945
|
}
|
|
922
|
-
|
|
946
|
+
r.id = Number(t.substring(e, n + 1));
|
|
923
947
|
}
|
|
924
|
-
if (
|
|
925
|
-
let
|
|
926
|
-
if (
|
|
948
|
+
if (t.charAt(++n)) {
|
|
949
|
+
let i = this.tryParse(t.substr(n));
|
|
950
|
+
if (e.isPayloadValid(r.type, i)) r.data = i;
|
|
927
951
|
else throw Error("invalid payload");
|
|
928
952
|
}
|
|
929
|
-
return
|
|
953
|
+
return r;
|
|
930
954
|
}
|
|
931
|
-
tryParse(
|
|
955
|
+
tryParse(e) {
|
|
932
956
|
try {
|
|
933
|
-
return JSON.parse(
|
|
957
|
+
return JSON.parse(e, this.reviver);
|
|
934
958
|
} catch {
|
|
935
959
|
return !1;
|
|
936
960
|
}
|
|
937
961
|
}
|
|
938
|
-
static isPayloadValid(
|
|
939
|
-
switch (
|
|
940
|
-
case
|
|
941
|
-
case
|
|
942
|
-
case
|
|
943
|
-
case
|
|
944
|
-
case
|
|
945
|
-
case
|
|
946
|
-
case
|
|
962
|
+
static isPayloadValid(e, t) {
|
|
963
|
+
switch (e) {
|
|
964
|
+
case K.CONNECT: return q(t);
|
|
965
|
+
case K.DISCONNECT: return t === void 0;
|
|
966
|
+
case K.CONNECT_ERROR: return typeof t == "string" || q(t);
|
|
967
|
+
case K.EVENT:
|
|
968
|
+
case K.BINARY_EVENT: return Array.isArray(t) && (typeof t[0] == "number" || typeof t[0] == "string" && Ve.indexOf(t[0]) === -1);
|
|
969
|
+
case K.ACK:
|
|
970
|
+
case K.BINARY_ACK: return Array.isArray(t);
|
|
947
971
|
}
|
|
948
972
|
}
|
|
949
973
|
destroy() {
|
|
950
974
|
this.reconstructor &&= (this.reconstructor.finishedReconstruction(), null);
|
|
951
975
|
}
|
|
952
|
-
},
|
|
953
|
-
constructor(
|
|
954
|
-
this.packet =
|
|
976
|
+
}, We = class {
|
|
977
|
+
constructor(e) {
|
|
978
|
+
this.packet = e, this.buffers = [], this.reconPack = e;
|
|
955
979
|
}
|
|
956
|
-
takeBinaryData(
|
|
957
|
-
if (this.buffers.push(
|
|
958
|
-
let
|
|
959
|
-
return this.finishedReconstruction(),
|
|
980
|
+
takeBinaryData(e) {
|
|
981
|
+
if (this.buffers.push(e), this.buffers.length === this.reconPack.attachments) {
|
|
982
|
+
let e = ze(this.reconPack, this.buffers);
|
|
983
|
+
return this.finishedReconstruction(), e;
|
|
960
984
|
}
|
|
961
985
|
return null;
|
|
962
986
|
}
|
|
@@ -964,33 +988,37 @@ var Decoder = class h extends Emitter {
|
|
|
964
988
|
this.reconPack = null, this.buffers = [];
|
|
965
989
|
}
|
|
966
990
|
};
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
991
|
+
//#endregion
|
|
992
|
+
//#region node_modules/socket.io-client/build/esm/on.js
|
|
993
|
+
function J(e, t, n) {
|
|
994
|
+
return e.on(t, n), function() {
|
|
995
|
+
e.off(t, n);
|
|
970
996
|
};
|
|
971
997
|
}
|
|
972
|
-
|
|
998
|
+
//#endregion
|
|
999
|
+
//#region node_modules/socket.io-client/build/esm/socket.js
|
|
1000
|
+
var Ge = Object.freeze({
|
|
973
1001
|
connect: 1,
|
|
974
1002
|
connect_error: 1,
|
|
975
1003
|
disconnect: 1,
|
|
976
1004
|
disconnecting: 1,
|
|
977
1005
|
newListener: 1,
|
|
978
1006
|
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 =
|
|
1007
|
+
}), Y = class extends w {
|
|
1008
|
+
constructor(e, t, n) {
|
|
1009
|
+
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
1010
|
}
|
|
983
1011
|
get disconnected() {
|
|
984
1012
|
return !this.connected;
|
|
985
1013
|
}
|
|
986
1014
|
subEvents() {
|
|
987
1015
|
if (this.subs) return;
|
|
988
|
-
let
|
|
1016
|
+
let e = this.io;
|
|
989
1017
|
this.subs = [
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
1018
|
+
J(e, "open", this.onopen.bind(this)),
|
|
1019
|
+
J(e, "packet", this.onpacket.bind(this)),
|
|
1020
|
+
J(e, "error", this.onerror.bind(this)),
|
|
1021
|
+
J(e, "close", this.onclose.bind(this))
|
|
994
1022
|
];
|
|
995
1023
|
}
|
|
996
1024
|
get active() {
|
|
@@ -1002,326 +1030,328 @@ var RESERVED_EVENTS = Object.freeze({
|
|
|
1002
1030
|
open() {
|
|
1003
1031
|
return this.connect();
|
|
1004
1032
|
}
|
|
1005
|
-
send(...
|
|
1006
|
-
return
|
|
1033
|
+
send(...e) {
|
|
1034
|
+
return e.unshift("message"), this.emit.apply(this, e), this;
|
|
1007
1035
|
}
|
|
1008
|
-
emit(
|
|
1009
|
-
if (
|
|
1010
|
-
if (
|
|
1011
|
-
let
|
|
1012
|
-
type:
|
|
1013
|
-
data:
|
|
1036
|
+
emit(e, ...t) {
|
|
1037
|
+
if (Ge.hasOwnProperty(e)) throw Error("\"" + e.toString() + "\" is a reserved event name");
|
|
1038
|
+
if (t.unshift(e), this._opts.retries && !this.flags.fromQueue && !this.flags.volatile) return this._addToQueue(t), this;
|
|
1039
|
+
let n = {
|
|
1040
|
+
type: K.EVENT,
|
|
1041
|
+
data: t
|
|
1014
1042
|
};
|
|
1015
|
-
if (
|
|
1016
|
-
let
|
|
1017
|
-
this._registerAckCallback(
|
|
1043
|
+
if (n.options = {}, n.options.compress = this.flags.compress !== !1, typeof t[t.length - 1] == "function") {
|
|
1044
|
+
let e = this.ids++, r = t.pop();
|
|
1045
|
+
this._registerAckCallback(e, r), n.id = e;
|
|
1018
1046
|
}
|
|
1019
|
-
let
|
|
1020
|
-
return this.flags.volatile && !
|
|
1047
|
+
let r = this.io.engine?.transport?.writable, i = this.connected && !this.io.engine?._hasPingExpired();
|
|
1048
|
+
return this.flags.volatile && !r || (i ? (this.notifyOutgoingListeners(n), this.packet(n)) : this.sendBuffer.push(n)), this.flags = {}, this;
|
|
1021
1049
|
}
|
|
1022
|
-
_registerAckCallback(
|
|
1023
|
-
let
|
|
1024
|
-
if (
|
|
1025
|
-
this.acks[
|
|
1050
|
+
_registerAckCallback(e, t) {
|
|
1051
|
+
let n = this.flags.timeout ?? this._opts.ackTimeout;
|
|
1052
|
+
if (n === void 0) {
|
|
1053
|
+
this.acks[e] = t;
|
|
1026
1054
|
return;
|
|
1027
1055
|
}
|
|
1028
|
-
let
|
|
1029
|
-
delete this.acks[
|
|
1030
|
-
for (let
|
|
1031
|
-
|
|
1032
|
-
},
|
|
1033
|
-
this.io.clearTimeoutFn(
|
|
1056
|
+
let r = this.io.setTimeoutFn(() => {
|
|
1057
|
+
delete this.acks[e];
|
|
1058
|
+
for (let t = 0; t < this.sendBuffer.length; t++) this.sendBuffer[t].id === e && this.sendBuffer.splice(t, 1);
|
|
1059
|
+
t.call(this, /* @__PURE__ */ Error("operation has timed out"));
|
|
1060
|
+
}, n), i = (...e) => {
|
|
1061
|
+
this.io.clearTimeoutFn(r), t.apply(this, e);
|
|
1034
1062
|
};
|
|
1035
|
-
|
|
1063
|
+
i.withError = !0, this.acks[e] = i;
|
|
1036
1064
|
}
|
|
1037
|
-
emitWithAck(
|
|
1038
|
-
return new Promise((
|
|
1039
|
-
let
|
|
1040
|
-
|
|
1065
|
+
emitWithAck(e, ...t) {
|
|
1066
|
+
return new Promise((n, r) => {
|
|
1067
|
+
let i = (e, t) => e ? r(e) : n(t);
|
|
1068
|
+
i.withError = !0, t.push(i), this.emit(e, ...t);
|
|
1041
1069
|
});
|
|
1042
1070
|
}
|
|
1043
|
-
_addToQueue(
|
|
1044
|
-
let
|
|
1045
|
-
typeof
|
|
1046
|
-
let
|
|
1071
|
+
_addToQueue(e) {
|
|
1072
|
+
let t;
|
|
1073
|
+
typeof e[e.length - 1] == "function" && (t = e.pop());
|
|
1074
|
+
let n = {
|
|
1047
1075
|
id: this._queueSeq++,
|
|
1048
1076
|
tryCount: 0,
|
|
1049
1077
|
pending: !1,
|
|
1050
|
-
args:
|
|
1078
|
+
args: e,
|
|
1051
1079
|
flags: Object.assign({ fromQueue: !0 }, this.flags)
|
|
1052
1080
|
};
|
|
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();
|
|
1081
|
+
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
1082
|
}
|
|
1057
|
-
_drainQueue(
|
|
1083
|
+
_drainQueue(e = !1) {
|
|
1058
1084
|
if (!this.connected || this._queue.length === 0) return;
|
|
1059
|
-
let
|
|
1060
|
-
|
|
1085
|
+
let t = this._queue[0];
|
|
1086
|
+
t.pending && !e || (t.pending = !0, t.tryCount++, this.flags = t.flags, this.emit.apply(this, t.args));
|
|
1061
1087
|
}
|
|
1062
|
-
packet(
|
|
1063
|
-
|
|
1088
|
+
packet(e) {
|
|
1089
|
+
e.nsp = this.nsp, this.io._packet(e);
|
|
1064
1090
|
}
|
|
1065
1091
|
onopen() {
|
|
1066
|
-
typeof this.auth == "function" ? this.auth((
|
|
1067
|
-
this._sendConnectPacket(
|
|
1092
|
+
typeof this.auth == "function" ? this.auth((e) => {
|
|
1093
|
+
this._sendConnectPacket(e);
|
|
1068
1094
|
}) : this._sendConnectPacket(this.auth);
|
|
1069
1095
|
}
|
|
1070
|
-
_sendConnectPacket(
|
|
1096
|
+
_sendConnectPacket(e) {
|
|
1071
1097
|
this.packet({
|
|
1072
|
-
type:
|
|
1098
|
+
type: K.CONNECT,
|
|
1073
1099
|
data: this._pid ? Object.assign({
|
|
1074
1100
|
pid: this._pid,
|
|
1075
1101
|
offset: this._lastOffset
|
|
1076
|
-
},
|
|
1102
|
+
}, e) : e
|
|
1077
1103
|
});
|
|
1078
1104
|
}
|
|
1079
|
-
onerror(
|
|
1080
|
-
this.connected || this.emitReserved("connect_error",
|
|
1105
|
+
onerror(e) {
|
|
1106
|
+
this.connected || this.emitReserved("connect_error", e);
|
|
1081
1107
|
}
|
|
1082
|
-
onclose(
|
|
1083
|
-
this.connected = !1, delete this.id, this.emitReserved("disconnect",
|
|
1108
|
+
onclose(e, t) {
|
|
1109
|
+
this.connected = !1, delete this.id, this.emitReserved("disconnect", e, t), this._clearAcks();
|
|
1084
1110
|
}
|
|
1085
1111
|
_clearAcks() {
|
|
1086
|
-
Object.keys(this.acks).forEach((
|
|
1087
|
-
if (!this.sendBuffer.some((
|
|
1088
|
-
let
|
|
1089
|
-
delete this.acks[
|
|
1112
|
+
Object.keys(this.acks).forEach((e) => {
|
|
1113
|
+
if (!this.sendBuffer.some((t) => String(t.id) === e)) {
|
|
1114
|
+
let t = this.acks[e];
|
|
1115
|
+
delete this.acks[e], t.withError && t.call(this, /* @__PURE__ */ Error("socket has been disconnected"));
|
|
1090
1116
|
}
|
|
1091
1117
|
});
|
|
1092
1118
|
}
|
|
1093
|
-
onpacket(
|
|
1094
|
-
if (
|
|
1095
|
-
case
|
|
1096
|
-
|
|
1119
|
+
onpacket(e) {
|
|
1120
|
+
if (e.nsp === this.nsp) switch (e.type) {
|
|
1121
|
+
case K.CONNECT:
|
|
1122
|
+
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
1123
|
break;
|
|
1098
|
-
case
|
|
1099
|
-
case
|
|
1100
|
-
this.onevent(
|
|
1124
|
+
case K.EVENT:
|
|
1125
|
+
case K.BINARY_EVENT:
|
|
1126
|
+
this.onevent(e);
|
|
1101
1127
|
break;
|
|
1102
|
-
case
|
|
1103
|
-
case
|
|
1104
|
-
this.onack(
|
|
1128
|
+
case K.ACK:
|
|
1129
|
+
case K.BINARY_ACK:
|
|
1130
|
+
this.onack(e);
|
|
1105
1131
|
break;
|
|
1106
|
-
case
|
|
1132
|
+
case K.DISCONNECT:
|
|
1107
1133
|
this.ondisconnect();
|
|
1108
1134
|
break;
|
|
1109
|
-
case
|
|
1135
|
+
case K.CONNECT_ERROR:
|
|
1110
1136
|
this.destroy();
|
|
1111
|
-
let
|
|
1112
|
-
|
|
1137
|
+
let t = Error(e.data.message);
|
|
1138
|
+
t.data = e.data.data, this.emitReserved("connect_error", t);
|
|
1113
1139
|
break;
|
|
1114
1140
|
}
|
|
1115
1141
|
}
|
|
1116
|
-
onevent(
|
|
1117
|
-
let
|
|
1118
|
-
|
|
1142
|
+
onevent(e) {
|
|
1143
|
+
let t = e.data || [];
|
|
1144
|
+
e.id != null && t.push(this.ack(e.id)), this.connected ? this.emitEvent(t) : this.receiveBuffer.push(Object.freeze(t));
|
|
1119
1145
|
}
|
|
1120
|
-
emitEvent(
|
|
1146
|
+
emitEvent(e) {
|
|
1121
1147
|
if (this._anyListeners && this._anyListeners.length) {
|
|
1122
|
-
let
|
|
1123
|
-
for (let
|
|
1148
|
+
let t = this._anyListeners.slice();
|
|
1149
|
+
for (let n of t) n.apply(this, e);
|
|
1124
1150
|
}
|
|
1125
|
-
super.emit.apply(this,
|
|
1126
|
-
}
|
|
1127
|
-
ack(
|
|
1128
|
-
let
|
|
1129
|
-
return function(...
|
|
1130
|
-
|
|
1131
|
-
type:
|
|
1132
|
-
id:
|
|
1133
|
-
data:
|
|
1151
|
+
super.emit.apply(this, e), this._pid && e.length && typeof e[e.length - 1] == "string" && (this._lastOffset = e[e.length - 1]);
|
|
1152
|
+
}
|
|
1153
|
+
ack(e) {
|
|
1154
|
+
let t = this, n = !1;
|
|
1155
|
+
return function(...r) {
|
|
1156
|
+
n || (n = !0, t.packet({
|
|
1157
|
+
type: K.ACK,
|
|
1158
|
+
id: e,
|
|
1159
|
+
data: r
|
|
1134
1160
|
}));
|
|
1135
1161
|
};
|
|
1136
1162
|
}
|
|
1137
|
-
onack(
|
|
1138
|
-
let
|
|
1139
|
-
typeof
|
|
1163
|
+
onack(e) {
|
|
1164
|
+
let t = this.acks[e.id];
|
|
1165
|
+
typeof t == "function" && (delete this.acks[e.id], t.withError && e.data.unshift(null), t.apply(this, e.data));
|
|
1140
1166
|
}
|
|
1141
|
-
onconnect(
|
|
1142
|
-
this.id =
|
|
1167
|
+
onconnect(e, t) {
|
|
1168
|
+
this.id = e, this.recovered = t && this._pid === t, this._pid = t, this.connected = !0, this.emitBuffered(), this._drainQueue(!0), this.emitReserved("connect");
|
|
1143
1169
|
}
|
|
1144
1170
|
emitBuffered() {
|
|
1145
|
-
this.receiveBuffer.forEach((
|
|
1146
|
-
this.notifyOutgoingListeners(
|
|
1171
|
+
this.receiveBuffer.forEach((e) => this.emitEvent(e)), this.receiveBuffer = [], this.sendBuffer.forEach((e) => {
|
|
1172
|
+
this.notifyOutgoingListeners(e), this.packet(e);
|
|
1147
1173
|
}), this.sendBuffer = [];
|
|
1148
1174
|
}
|
|
1149
1175
|
ondisconnect() {
|
|
1150
1176
|
this.destroy(), this.onclose("io server disconnect");
|
|
1151
1177
|
}
|
|
1152
1178
|
destroy() {
|
|
1153
|
-
this.subs &&= (this.subs.forEach((
|
|
1179
|
+
this.subs &&= (this.subs.forEach((e) => e()), void 0), this.io._destroy(this);
|
|
1154
1180
|
}
|
|
1155
1181
|
disconnect() {
|
|
1156
|
-
return this.connected && this.packet({ type:
|
|
1182
|
+
return this.connected && this.packet({ type: K.DISCONNECT }), this.destroy(), this.connected && this.onclose("io client disconnect"), this;
|
|
1157
1183
|
}
|
|
1158
1184
|
close() {
|
|
1159
1185
|
return this.disconnect();
|
|
1160
1186
|
}
|
|
1161
|
-
compress(
|
|
1162
|
-
return this.flags.compress =
|
|
1187
|
+
compress(e) {
|
|
1188
|
+
return this.flags.compress = e, this;
|
|
1163
1189
|
}
|
|
1164
1190
|
get volatile() {
|
|
1165
1191
|
return this.flags.volatile = !0, this;
|
|
1166
1192
|
}
|
|
1167
|
-
timeout(
|
|
1168
|
-
return this.flags.timeout =
|
|
1193
|
+
timeout(e) {
|
|
1194
|
+
return this.flags.timeout = e, this;
|
|
1169
1195
|
}
|
|
1170
|
-
onAny(
|
|
1171
|
-
return this._anyListeners = this._anyListeners || [], this._anyListeners.push(
|
|
1196
|
+
onAny(e) {
|
|
1197
|
+
return this._anyListeners = this._anyListeners || [], this._anyListeners.push(e), this;
|
|
1172
1198
|
}
|
|
1173
|
-
prependAny(
|
|
1174
|
-
return this._anyListeners = this._anyListeners || [], this._anyListeners.unshift(
|
|
1199
|
+
prependAny(e) {
|
|
1200
|
+
return this._anyListeners = this._anyListeners || [], this._anyListeners.unshift(e), this;
|
|
1175
1201
|
}
|
|
1176
|
-
offAny(
|
|
1202
|
+
offAny(e) {
|
|
1177
1203
|
if (!this._anyListeners) return this;
|
|
1178
|
-
if (
|
|
1179
|
-
let
|
|
1180
|
-
for (let
|
|
1204
|
+
if (e) {
|
|
1205
|
+
let t = this._anyListeners;
|
|
1206
|
+
for (let n = 0; n < t.length; n++) if (e === t[n]) return t.splice(n, 1), this;
|
|
1181
1207
|
} else this._anyListeners = [];
|
|
1182
1208
|
return this;
|
|
1183
1209
|
}
|
|
1184
1210
|
listenersAny() {
|
|
1185
1211
|
return this._anyListeners || [];
|
|
1186
1212
|
}
|
|
1187
|
-
onAnyOutgoing(
|
|
1188
|
-
return this._anyOutgoingListeners = this._anyOutgoingListeners || [], this._anyOutgoingListeners.push(
|
|
1213
|
+
onAnyOutgoing(e) {
|
|
1214
|
+
return this._anyOutgoingListeners = this._anyOutgoingListeners || [], this._anyOutgoingListeners.push(e), this;
|
|
1189
1215
|
}
|
|
1190
|
-
prependAnyOutgoing(
|
|
1191
|
-
return this._anyOutgoingListeners = this._anyOutgoingListeners || [], this._anyOutgoingListeners.unshift(
|
|
1216
|
+
prependAnyOutgoing(e) {
|
|
1217
|
+
return this._anyOutgoingListeners = this._anyOutgoingListeners || [], this._anyOutgoingListeners.unshift(e), this;
|
|
1192
1218
|
}
|
|
1193
|
-
offAnyOutgoing(
|
|
1219
|
+
offAnyOutgoing(e) {
|
|
1194
1220
|
if (!this._anyOutgoingListeners) return this;
|
|
1195
|
-
if (
|
|
1196
|
-
let
|
|
1197
|
-
for (let
|
|
1221
|
+
if (e) {
|
|
1222
|
+
let t = this._anyOutgoingListeners;
|
|
1223
|
+
for (let n = 0; n < t.length; n++) if (e === t[n]) return t.splice(n, 1), this;
|
|
1198
1224
|
} else this._anyOutgoingListeners = [];
|
|
1199
1225
|
return this;
|
|
1200
1226
|
}
|
|
1201
1227
|
listenersAnyOutgoing() {
|
|
1202
1228
|
return this._anyOutgoingListeners || [];
|
|
1203
1229
|
}
|
|
1204
|
-
notifyOutgoingListeners(
|
|
1230
|
+
notifyOutgoingListeners(e) {
|
|
1205
1231
|
if (this._anyOutgoingListeners && this._anyOutgoingListeners.length) {
|
|
1206
|
-
let
|
|
1207
|
-
for (let
|
|
1232
|
+
let t = this._anyOutgoingListeners.slice();
|
|
1233
|
+
for (let n of t) n.apply(this, e.data);
|
|
1208
1234
|
}
|
|
1209
1235
|
}
|
|
1210
1236
|
};
|
|
1211
|
-
|
|
1212
|
-
|
|
1237
|
+
//#endregion
|
|
1238
|
+
//#region node_modules/socket.io-client/build/esm/contrib/backo2.js
|
|
1239
|
+
function X(e) {
|
|
1240
|
+
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
1241
|
}
|
|
1214
|
-
|
|
1215
|
-
var
|
|
1242
|
+
X.prototype.duration = function() {
|
|
1243
|
+
var e = this.ms * this.factor ** +this.attempts++;
|
|
1216
1244
|
if (this.jitter) {
|
|
1217
|
-
var
|
|
1218
|
-
|
|
1245
|
+
var t = Math.random(), n = Math.floor(t * this.jitter * e);
|
|
1246
|
+
e = Math.floor(t * 10) & 1 ? e + n : e - n;
|
|
1219
1247
|
}
|
|
1220
|
-
return Math.min(
|
|
1221
|
-
},
|
|
1248
|
+
return Math.min(e, this.max) | 0;
|
|
1249
|
+
}, X.prototype.reset = function() {
|
|
1222
1250
|
this.attempts = 0;
|
|
1223
|
-
},
|
|
1224
|
-
this.ms =
|
|
1225
|
-
},
|
|
1226
|
-
this.max =
|
|
1227
|
-
},
|
|
1228
|
-
this.jitter =
|
|
1251
|
+
}, X.prototype.setMin = function(e) {
|
|
1252
|
+
this.ms = e;
|
|
1253
|
+
}, X.prototype.setMax = function(e) {
|
|
1254
|
+
this.max = e;
|
|
1255
|
+
}, X.prototype.setJitter = function(e) {
|
|
1256
|
+
this.jitter = e;
|
|
1229
1257
|
};
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1258
|
+
//#endregion
|
|
1259
|
+
//#region node_modules/socket.io-client/build/esm/manager.js
|
|
1260
|
+
var Z = class extends w {
|
|
1261
|
+
constructor(e, t) {
|
|
1262
|
+
super(), this.nsps = {}, this.subs = [], e && typeof e == "object" && (t = e, e = void 0), t ||= {}, t.path = t.path || "/socket.io", this.opts = t, O(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
1263
|
min: this.reconnectionDelay(),
|
|
1234
1264
|
max: this.reconnectionDelayMax(),
|
|
1235
1265
|
jitter: this.randomizationFactor()
|
|
1236
|
-
}), this.timeout(
|
|
1237
|
-
let
|
|
1238
|
-
this.encoder = new
|
|
1266
|
+
}), this.timeout(t.timeout == null ? 2e4 : t.timeout), this._readyState = "closed", this.uri = e;
|
|
1267
|
+
let n = t.parser || Be;
|
|
1268
|
+
this.encoder = new n.Encoder(), this.decoder = new n.Decoder(), this._autoConnect = t.autoConnect !== !1, this._autoConnect && this.open();
|
|
1239
1269
|
}
|
|
1240
|
-
reconnection(
|
|
1241
|
-
return arguments.length ? (this._reconnection = !!
|
|
1270
|
+
reconnection(e) {
|
|
1271
|
+
return arguments.length ? (this._reconnection = !!e, e || (this.skipReconnect = !0), this) : this._reconnection;
|
|
1242
1272
|
}
|
|
1243
|
-
reconnectionAttempts(
|
|
1244
|
-
return
|
|
1273
|
+
reconnectionAttempts(e) {
|
|
1274
|
+
return e === void 0 ? this._reconnectionAttempts : (this._reconnectionAttempts = e, this);
|
|
1245
1275
|
}
|
|
1246
|
-
reconnectionDelay(
|
|
1247
|
-
var
|
|
1248
|
-
return
|
|
1276
|
+
reconnectionDelay(e) {
|
|
1277
|
+
var t;
|
|
1278
|
+
return e === void 0 ? this._reconnectionDelay : (this._reconnectionDelay = e, (t = this.backoff) == null || t.setMin(e), this);
|
|
1249
1279
|
}
|
|
1250
|
-
randomizationFactor(
|
|
1251
|
-
var
|
|
1252
|
-
return
|
|
1280
|
+
randomizationFactor(e) {
|
|
1281
|
+
var t;
|
|
1282
|
+
return e === void 0 ? this._randomizationFactor : (this._randomizationFactor = e, (t = this.backoff) == null || t.setJitter(e), this);
|
|
1253
1283
|
}
|
|
1254
|
-
reconnectionDelayMax(
|
|
1255
|
-
var
|
|
1256
|
-
return
|
|
1284
|
+
reconnectionDelayMax(e) {
|
|
1285
|
+
var t;
|
|
1286
|
+
return e === void 0 ? this._reconnectionDelayMax : (this._reconnectionDelayMax = e, (t = this.backoff) == null || t.setMax(e), this);
|
|
1257
1287
|
}
|
|
1258
|
-
timeout(
|
|
1259
|
-
return arguments.length ? (this._timeout =
|
|
1288
|
+
timeout(e) {
|
|
1289
|
+
return arguments.length ? (this._timeout = e, this) : this._timeout;
|
|
1260
1290
|
}
|
|
1261
1291
|
maybeReconnectOnOpen() {
|
|
1262
1292
|
!this._reconnecting && this._reconnection && this.backoff.attempts === 0 && this.reconnect();
|
|
1263
1293
|
}
|
|
1264
|
-
open(
|
|
1294
|
+
open(e) {
|
|
1265
1295
|
if (~this._readyState.indexOf("open")) return this;
|
|
1266
|
-
this.engine = new
|
|
1267
|
-
let
|
|
1296
|
+
this.engine = new B(this.uri, this.opts);
|
|
1297
|
+
let t = this.engine, n = this;
|
|
1268
1298
|
this._readyState = "opening", this.skipReconnect = !1;
|
|
1269
|
-
let
|
|
1270
|
-
|
|
1271
|
-
}),
|
|
1272
|
-
this.cleanup(), this._readyState = "closed", this.emitReserved("error",
|
|
1273
|
-
},
|
|
1299
|
+
let r = J(t, "open", function() {
|
|
1300
|
+
n.onopen(), e && e();
|
|
1301
|
+
}), i = (t) => {
|
|
1302
|
+
this.cleanup(), this._readyState = "closed", this.emitReserved("error", t), e ? e(t) : this.maybeReconnectOnOpen();
|
|
1303
|
+
}, a = J(t, "error", i);
|
|
1274
1304
|
if (!1 !== this._timeout) {
|
|
1275
|
-
let
|
|
1276
|
-
|
|
1277
|
-
},
|
|
1278
|
-
this.opts.autoUnref &&
|
|
1279
|
-
this.clearTimeoutFn(
|
|
1305
|
+
let e = this._timeout, n = this.setTimeoutFn(() => {
|
|
1306
|
+
r(), i(/* @__PURE__ */ Error("timeout")), t.close();
|
|
1307
|
+
}, e);
|
|
1308
|
+
this.opts.autoUnref && n.unref(), this.subs.push(() => {
|
|
1309
|
+
this.clearTimeoutFn(n);
|
|
1280
1310
|
});
|
|
1281
1311
|
}
|
|
1282
|
-
return this.subs.push(
|
|
1312
|
+
return this.subs.push(r), this.subs.push(a), this;
|
|
1283
1313
|
}
|
|
1284
|
-
connect(
|
|
1285
|
-
return this.open(
|
|
1314
|
+
connect(e) {
|
|
1315
|
+
return this.open(e);
|
|
1286
1316
|
}
|
|
1287
1317
|
onopen() {
|
|
1288
1318
|
this.cleanup(), this._readyState = "open", this.emitReserved("open");
|
|
1289
|
-
let
|
|
1290
|
-
this.subs.push(
|
|
1319
|
+
let e = this.engine;
|
|
1320
|
+
this.subs.push(J(e, "ping", this.onping.bind(this)), J(e, "data", this.ondata.bind(this)), J(e, "error", this.onerror.bind(this)), J(e, "close", this.onclose.bind(this)), J(this.decoder, "decoded", this.ondecoded.bind(this)));
|
|
1291
1321
|
}
|
|
1292
1322
|
onping() {
|
|
1293
1323
|
this.emitReserved("ping");
|
|
1294
1324
|
}
|
|
1295
|
-
ondata(
|
|
1325
|
+
ondata(e) {
|
|
1296
1326
|
try {
|
|
1297
|
-
this.decoder.add(
|
|
1298
|
-
} catch (
|
|
1299
|
-
this.onclose("parse error",
|
|
1327
|
+
this.decoder.add(e);
|
|
1328
|
+
} catch (e) {
|
|
1329
|
+
this.onclose("parse error", e);
|
|
1300
1330
|
}
|
|
1301
1331
|
}
|
|
1302
|
-
ondecoded(
|
|
1303
|
-
|
|
1304
|
-
this.emitReserved("packet",
|
|
1332
|
+
ondecoded(e) {
|
|
1333
|
+
T(() => {
|
|
1334
|
+
this.emitReserved("packet", e);
|
|
1305
1335
|
}, this.setTimeoutFn);
|
|
1306
1336
|
}
|
|
1307
|
-
onerror(
|
|
1308
|
-
this.emitReserved("error",
|
|
1337
|
+
onerror(e) {
|
|
1338
|
+
this.emitReserved("error", e);
|
|
1309
1339
|
}
|
|
1310
|
-
socket(
|
|
1311
|
-
let
|
|
1312
|
-
return
|
|
1340
|
+
socket(e, t) {
|
|
1341
|
+
let n = this.nsps[e];
|
|
1342
|
+
return n ? this._autoConnect && !n.active && n.connect() : (n = new Y(this, e, t), this.nsps[e] = n), n;
|
|
1313
1343
|
}
|
|
1314
|
-
_destroy(
|
|
1315
|
-
let
|
|
1316
|
-
for (let
|
|
1344
|
+
_destroy(e) {
|
|
1345
|
+
let t = Object.keys(this.nsps);
|
|
1346
|
+
for (let e of t) if (this.nsps[e].active) return;
|
|
1317
1347
|
this._close();
|
|
1318
1348
|
}
|
|
1319
|
-
_packet(
|
|
1320
|
-
let
|
|
1321
|
-
for (let
|
|
1349
|
+
_packet(e) {
|
|
1350
|
+
let t = this.encoder.encode(e);
|
|
1351
|
+
for (let n = 0; n < t.length; n++) this.engine.write(t[n], e.options);
|
|
1322
1352
|
}
|
|
1323
1353
|
cleanup() {
|
|
1324
|
-
this.subs.forEach((
|
|
1354
|
+
this.subs.forEach((e) => e()), this.subs.length = 0, this.decoder.destroy();
|
|
1325
1355
|
}
|
|
1326
1356
|
_close() {
|
|
1327
1357
|
this.skipReconnect = !0, this._reconnecting = !1, this.onclose("forced close");
|
|
@@ -1329,55 +1359,59 @@ var Manager = class extends Emitter {
|
|
|
1329
1359
|
disconnect() {
|
|
1330
1360
|
return this._close();
|
|
1331
1361
|
}
|
|
1332
|
-
onclose(
|
|
1333
|
-
var
|
|
1334
|
-
this.cleanup(), (
|
|
1362
|
+
onclose(e, t) {
|
|
1363
|
+
var n;
|
|
1364
|
+
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
1365
|
}
|
|
1336
1366
|
reconnect() {
|
|
1337
1367
|
if (this._reconnecting || this.skipReconnect) return this;
|
|
1338
|
-
let
|
|
1368
|
+
let e = this;
|
|
1339
1369
|
if (this.backoff.attempts >= this._reconnectionAttempts) this.backoff.reset(), this.emitReserved("reconnect_failed"), this._reconnecting = !1;
|
|
1340
1370
|
else {
|
|
1341
|
-
let
|
|
1371
|
+
let t = this.backoff.duration();
|
|
1342
1372
|
this._reconnecting = !0;
|
|
1343
|
-
let
|
|
1344
|
-
|
|
1345
|
-
|
|
1373
|
+
let n = this.setTimeoutFn(() => {
|
|
1374
|
+
e.skipReconnect || (this.emitReserved("reconnect_attempt", e.backoff.attempts), !e.skipReconnect && e.open((t) => {
|
|
1375
|
+
t ? (e._reconnecting = !1, e.reconnect(), this.emitReserved("reconnect_error", t)) : e.onreconnect();
|
|
1346
1376
|
}));
|
|
1347
|
-
},
|
|
1348
|
-
this.opts.autoUnref &&
|
|
1349
|
-
this.clearTimeoutFn(
|
|
1377
|
+
}, t);
|
|
1378
|
+
this.opts.autoUnref && n.unref(), this.subs.push(() => {
|
|
1379
|
+
this.clearTimeoutFn(n);
|
|
1350
1380
|
});
|
|
1351
1381
|
}
|
|
1352
1382
|
}
|
|
1353
1383
|
onreconnect() {
|
|
1354
|
-
let
|
|
1355
|
-
this._reconnecting = !1, this.backoff.reset(), this.emitReserved("reconnect",
|
|
1356
|
-
}
|
|
1357
|
-
},
|
|
1358
|
-
function
|
|
1359
|
-
typeof
|
|
1360
|
-
let
|
|
1361
|
-
return
|
|
1384
|
+
let e = this.backoff.attempts;
|
|
1385
|
+
this._reconnecting = !1, this.backoff.reset(), this.emitReserved("reconnect", e);
|
|
1386
|
+
}
|
|
1387
|
+
}, Q = {};
|
|
1388
|
+
function $(e, t) {
|
|
1389
|
+
typeof e == "object" && (t = e, e = void 0), t ||= {};
|
|
1390
|
+
let n = Ne(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;
|
|
1391
|
+
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
1392
|
}
|
|
1363
|
-
Object.assign(
|
|
1364
|
-
Manager,
|
|
1365
|
-
Socket,
|
|
1366
|
-
io:
|
|
1367
|
-
connect:
|
|
1393
|
+
Object.assign($, {
|
|
1394
|
+
Manager: Z,
|
|
1395
|
+
Socket: Y,
|
|
1396
|
+
io: $,
|
|
1397
|
+
connect: $
|
|
1368
1398
|
});
|
|
1369
|
-
|
|
1370
|
-
|
|
1399
|
+
//#endregion
|
|
1400
|
+
//#region src/sn/SysBase.ts
|
|
1401
|
+
var Ke = class e {
|
|
1402
|
+
hPlg;
|
|
1403
|
+
arg;
|
|
1404
|
+
elc = new a();
|
|
1371
1405
|
hFactoryCls = {};
|
|
1372
|
-
constructor(
|
|
1373
|
-
this.hPlg =
|
|
1406
|
+
constructor(e = {}, t) {
|
|
1407
|
+
this.hPlg = e, this.arg = t;
|
|
1374
1408
|
}
|
|
1375
1409
|
destroy() {
|
|
1376
1410
|
this.elc.clear();
|
|
1377
1411
|
}
|
|
1378
|
-
async loaded(...[
|
|
1379
|
-
let
|
|
1380
|
-
return delete
|
|
1412
|
+
async loaded(...[e]) {
|
|
1413
|
+
let t = e.snsys_pre;
|
|
1414
|
+
return delete e.snsys_pre, t?.init({
|
|
1381
1415
|
getInfo: this.#n,
|
|
1382
1416
|
addTag: () => {},
|
|
1383
1417
|
addLayCls: () => {},
|
|
@@ -1385,51 +1419,51 @@ var SysBase = class h {
|
|
|
1385
1419
|
getVal: () => ({}),
|
|
1386
1420
|
resume: () => {},
|
|
1387
1421
|
render: () => {},
|
|
1388
|
-
setDec: (
|
|
1389
|
-
this.dec =
|
|
1422
|
+
setDec: (e) => {
|
|
1423
|
+
this.dec = e;
|
|
1390
1424
|
},
|
|
1391
|
-
setDecAB: (
|
|
1392
|
-
this.#_ =
|
|
1425
|
+
setDecAB: (e) => {
|
|
1426
|
+
this.#_ = e;
|
|
1393
1427
|
},
|
|
1394
|
-
setEnc: (
|
|
1395
|
-
this.enc =
|
|
1428
|
+
setEnc: (e) => {
|
|
1429
|
+
this.enc = e;
|
|
1396
1430
|
},
|
|
1397
|
-
getStK: (
|
|
1398
|
-
this.stk =
|
|
1431
|
+
getStK: (e) => {
|
|
1432
|
+
this.stk = e;
|
|
1399
1433
|
},
|
|
1400
|
-
getHash: (
|
|
1401
|
-
this.hash =
|
|
1434
|
+
getHash: (e) => {
|
|
1435
|
+
this.hash = e;
|
|
1402
1436
|
}
|
|
1403
1437
|
});
|
|
1404
1438
|
}
|
|
1405
1439
|
main = void 0;
|
|
1406
1440
|
cfg;
|
|
1407
|
-
setMain(
|
|
1408
|
-
this.main =
|
|
1441
|
+
setMain(e, t) {
|
|
1442
|
+
this.main = e, this.cfg = t;
|
|
1409
1443
|
}
|
|
1410
1444
|
async run() {
|
|
1411
|
-
let [{ Main:
|
|
1445
|
+
let [{ Main: e }, { TxtLayer: t }, { GrpLayer: n }] = await Promise.all([
|
|
1412
1446
|
import("./Main.js"),
|
|
1413
1447
|
import("./TxtLayer.js"),
|
|
1414
1448
|
import("./GrpLayer.js")
|
|
1415
1449
|
]);
|
|
1416
1450
|
this.hFactoryCls = {
|
|
1417
|
-
grp: () => new
|
|
1418
|
-
txt: () => new
|
|
1451
|
+
grp: () => new n(),
|
|
1452
|
+
txt: () => new t()
|
|
1419
1453
|
}, this.run = async () => {
|
|
1420
|
-
this.main?.destroy(), this.main = await
|
|
1454
|
+
this.main?.destroy(), this.main = await e.generate(this);
|
|
1421
1455
|
}, await this.run();
|
|
1422
1456
|
}
|
|
1423
1457
|
stop() {
|
|
1424
1458
|
this.main?.destroy(), this.main = void 0;
|
|
1425
1459
|
}
|
|
1426
|
-
fetch = (
|
|
1460
|
+
fetch = (e, t) => fetch(e, t);
|
|
1427
1461
|
data = {
|
|
1428
|
-
sys:
|
|
1462
|
+
sys: i(),
|
|
1429
1463
|
mark: {},
|
|
1430
1464
|
kidoku: {}
|
|
1431
1465
|
};
|
|
1432
|
-
async initVal(
|
|
1466
|
+
async initVal(e, t) {}
|
|
1433
1467
|
flush() {
|
|
1434
1468
|
if (this.#e) {
|
|
1435
1469
|
this.#t = !0;
|
|
@@ -1443,28 +1477,28 @@ var SysBase = class h {
|
|
|
1443
1477
|
#t = !1;
|
|
1444
1478
|
flushSub() {}
|
|
1445
1479
|
val;
|
|
1446
|
-
init(
|
|
1447
|
-
let
|
|
1448
|
-
this.val =
|
|
1449
|
-
let
|
|
1450
|
-
return
|
|
1451
|
-
|
|
1452
|
-
}).catch((
|
|
1480
|
+
init(e, t, n) {
|
|
1481
|
+
let i = [];
|
|
1482
|
+
this.val = n;
|
|
1483
|
+
let a = "";
|
|
1484
|
+
return i.push(n.init().then(() => {
|
|
1485
|
+
a = "sys", a += String(n.getVal("sys:TextLayer.Back.Alpha", 1)), a = "kidoku", n.saveKidoku();
|
|
1486
|
+
}).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
1487
|
getInfo: this.#n,
|
|
1454
|
-
addTag: (
|
|
1455
|
-
if (
|
|
1456
|
-
|
|
1488
|
+
addTag: (t, n) => {
|
|
1489
|
+
if (t in e) throw `すでに定義済みのタグ[${t}]です`;
|
|
1490
|
+
e[t] = n;
|
|
1457
1491
|
},
|
|
1458
|
-
addLayCls: (
|
|
1459
|
-
if (
|
|
1460
|
-
this.hFactoryCls[
|
|
1492
|
+
addLayCls: (e, t) => {
|
|
1493
|
+
if (e in this.hFactoryCls) throw `すでに定義済みのレイヤcls【${e}】です`;
|
|
1494
|
+
this.hFactoryCls[e] = t;
|
|
1461
1495
|
},
|
|
1462
|
-
searchPath: (
|
|
1463
|
-
getVal: (
|
|
1496
|
+
searchPath: (e, t = o.DEFAULT) => this.cfg.searchPath(e, t),
|
|
1497
|
+
getVal: (e, t) => n.getVal(e, t),
|
|
1464
1498
|
resume: () => this.main?.resume(),
|
|
1465
|
-
render: (
|
|
1466
|
-
...
|
|
1467
|
-
clear:
|
|
1499
|
+
render: (e, n, r = !1) => t.renderer.render(e, {
|
|
1500
|
+
...n ? { renderTexture: n } : {},
|
|
1501
|
+
clear: r
|
|
1468
1502
|
}),
|
|
1469
1503
|
setDec: () => {},
|
|
1470
1504
|
setDecAB: () => {},
|
|
@@ -1474,8 +1508,8 @@ var SysBase = class h {
|
|
|
1474
1508
|
}))];
|
|
1475
1509
|
}
|
|
1476
1510
|
#n = () => ({ window: {
|
|
1477
|
-
width:
|
|
1478
|
-
height:
|
|
1511
|
+
width: r.stageW,
|
|
1512
|
+
height: r.stageH
|
|
1479
1513
|
} });
|
|
1480
1514
|
#r = 0;
|
|
1481
1515
|
#i = 0;
|
|
@@ -1508,37 +1542,37 @@ var SysBase = class h {
|
|
|
1508
1542
|
isFullScr = !1;
|
|
1509
1543
|
cvsResize() {
|
|
1510
1544
|
if (!this.main) return;
|
|
1511
|
-
let
|
|
1512
|
-
if (
|
|
1513
|
-
let
|
|
1514
|
-
|
|
1545
|
+
let e = globalThis.innerWidth, t = globalThis.innerHeight, i = this.main.cvs, a = i.parentElement !== document.body;
|
|
1546
|
+
if (a) {
|
|
1547
|
+
let n = globalThis.getComputedStyle(i);
|
|
1548
|
+
e = parseFloat(n.width), t = parseFloat(n.height);
|
|
1515
1549
|
}
|
|
1516
|
-
if (
|
|
1517
|
-
let
|
|
1518
|
-
(
|
|
1550
|
+
if (r.isMobile) {
|
|
1551
|
+
let n = screen.orientation.angle % 180 == 0;
|
|
1552
|
+
(n && e > t || !n && e < t) && ([e, t] = [t, e]);
|
|
1519
1553
|
}
|
|
1520
|
-
let
|
|
1521
|
-
if (
|
|
1554
|
+
let o = i.getBoundingClientRect();
|
|
1555
|
+
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
1556
|
else {
|
|
1523
|
-
let
|
|
1524
|
-
|
|
1557
|
+
let n = 1 - this.#a;
|
|
1558
|
+
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
1559
|
}
|
|
1526
|
-
else this.#r =
|
|
1527
|
-
let
|
|
1528
|
-
|
|
1529
|
-
let
|
|
1530
|
-
|
|
1560
|
+
else this.#r = r.stageW, this.#i = r.stageH, this.#a = 1, this.#c = 0, this.#l = 0;
|
|
1561
|
+
let s = i.parentElement.style;
|
|
1562
|
+
a || (s.position = "relative", s.width = `${String(this.#r)}px`, s.height = `${String(this.#i)}px`);
|
|
1563
|
+
let c = i.style;
|
|
1564
|
+
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
1565
|
}
|
|
1532
|
-
use4ViteElectron(
|
|
1566
|
+
use4ViteElectron(e, t, n, r) {
|
|
1533
1567
|
return !1;
|
|
1534
1568
|
}
|
|
1535
|
-
attach_debug(
|
|
1569
|
+
attach_debug(e) {
|
|
1536
1570
|
this.attach_debug = () => {};
|
|
1537
|
-
let
|
|
1538
|
-
|
|
1539
|
-
this.callHook(
|
|
1540
|
-
}).on("disconnect", () =>
|
|
1541
|
-
for (let
|
|
1571
|
+
let t = document.createElement("style");
|
|
1572
|
+
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) => {
|
|
1573
|
+
this.callHook(e, t);
|
|
1574
|
+
}).on("disconnect", () => e.setLoop(!0)), this.callHook = (e, t) => {
|
|
1575
|
+
for (let n of this.#p) n(e, t);
|
|
1542
1576
|
};
|
|
1543
1577
|
}
|
|
1544
1578
|
extPort = 3776;
|
|
@@ -1547,8 +1581,8 @@ var SysBase = class h {
|
|
|
1547
1581
|
}
|
|
1548
1582
|
#u = void 0;
|
|
1549
1583
|
#d = {
|
|
1550
|
-
auth: (
|
|
1551
|
-
if (
|
|
1584
|
+
auth: (e) => {
|
|
1585
|
+
if (e.t !== this.cfg.oCfg.debuger_token) {
|
|
1552
1586
|
this.end();
|
|
1553
1587
|
return;
|
|
1554
1588
|
}
|
|
@@ -1556,8 +1590,8 @@ var SysBase = class h {
|
|
|
1556
1590
|
},
|
|
1557
1591
|
continue: () => this.toast("再生"),
|
|
1558
1592
|
disconnect: () => this.toast("切断"),
|
|
1559
|
-
restart: (
|
|
1560
|
-
this.send2Dbg(
|
|
1593
|
+
restart: (e) => {
|
|
1594
|
+
this.send2Dbg(e?.ri ?? "", {}), this.end(), this.run();
|
|
1561
1595
|
},
|
|
1562
1596
|
pause: () => this.toast("一時停止"),
|
|
1563
1597
|
stopOnEntry: () => this.toast("一時停止"),
|
|
@@ -1567,22 +1601,22 @@ var SysBase = class h {
|
|
|
1567
1601
|
stopOnStepIn: () => this.toast("ステップイン"),
|
|
1568
1602
|
stopOnStepOut: () => this.toast("ステップアウト"),
|
|
1569
1603
|
stopOnBackstep: () => this.toast("一歩戻る"),
|
|
1570
|
-
_addPath: (
|
|
1604
|
+
_addPath: (e) => this.cfg.addPath(e.fn, e.o)
|
|
1571
1605
|
};
|
|
1572
|
-
toast(
|
|
1606
|
+
toast(t) {
|
|
1573
1607
|
if (!this.main) return;
|
|
1574
|
-
let
|
|
1575
|
-
for (let
|
|
1576
|
-
let
|
|
1577
|
-
if (!
|
|
1578
|
-
|
|
1579
|
-
let
|
|
1580
|
-
|
|
1581
|
-
left: ${String((
|
|
1582
|
-
top: ${String((
|
|
1608
|
+
let n = document.body;
|
|
1609
|
+
for (let e of [...Array.from(n.getElementsByClassName("sn_BounceIn")), ...Array.from(n.getElementsByClassName("sn_HopIn"))]) e.remove();
|
|
1610
|
+
let i = document.createElement("img"), a = e.#f[t];
|
|
1611
|
+
if (!a) throw Error(`toast 名ミス=${t}`);
|
|
1612
|
+
i.src = `data:image/svg+xml;base64,${a.dat}`;
|
|
1613
|
+
let o = Math.min(r.stageW, r.stageH) / 4 * this.#a;
|
|
1614
|
+
i.width = i.height = o, i.style.cssText = `position: absolute;
|
|
1615
|
+
left: ${String((r.stageW - o) / 2 * this.#a + o * (a.dx ?? 0))}px;
|
|
1616
|
+
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
1617
|
once: !0,
|
|
1584
1618
|
passive: !0
|
|
1585
|
-
}),
|
|
1619
|
+
}), n.insertBefore(i, this.main.cvs);
|
|
1586
1620
|
}
|
|
1587
1621
|
static #f = {
|
|
1588
1622
|
接続: {
|
|
@@ -1615,100 +1649,100 @@ top: ${String((CmnLib.stageH - Y) / 2 * this.#a + Y * (J.dy ?? 0))}px;`, q.class
|
|
|
1615
1649
|
};
|
|
1616
1650
|
pathBaseCnvSnPath4Dbg = "";
|
|
1617
1651
|
fire;
|
|
1618
|
-
setFire(
|
|
1619
|
-
this.fire =
|
|
1652
|
+
setFire(e) {
|
|
1653
|
+
this.fire = e;
|
|
1620
1654
|
}
|
|
1621
1655
|
#p = [];
|
|
1622
|
-
addHook(
|
|
1623
|
-
this.#p.push(
|
|
1656
|
+
addHook(e) {
|
|
1657
|
+
this.#p.push(e);
|
|
1624
1658
|
}
|
|
1625
|
-
callHook = (
|
|
1626
|
-
send2Dbg = (
|
|
1627
|
-
this.#u?.emit("data",
|
|
1659
|
+
callHook = (e, t) => {};
|
|
1660
|
+
send2Dbg = (e, t) => {
|
|
1661
|
+
this.#u?.emit("data", e, t);
|
|
1628
1662
|
};
|
|
1629
|
-
copyBMFolder = (
|
|
1630
|
-
eraseBMFolder = (
|
|
1663
|
+
copyBMFolder = (e, t) => {};
|
|
1664
|
+
eraseBMFolder = (e) => {};
|
|
1631
1665
|
close = () => !1;
|
|
1632
1666
|
_export = () => !1;
|
|
1633
1667
|
_import = () => !1;
|
|
1634
1668
|
navigate_to = () => !1;
|
|
1635
|
-
title = (
|
|
1636
|
-
let { text:
|
|
1637
|
-
if (!
|
|
1638
|
-
return this.#m =
|
|
1669
|
+
title = (e) => {
|
|
1670
|
+
let { text: t } = e;
|
|
1671
|
+
if (!t) throw "[title] textは必須です";
|
|
1672
|
+
return this.#m = t, this.titleSub(this.#m + this.#g), !1;
|
|
1639
1673
|
};
|
|
1640
1674
|
#m = "";
|
|
1641
|
-
titleSub(
|
|
1642
|
-
#h = (
|
|
1643
|
-
if (!
|
|
1644
|
-
let
|
|
1645
|
-
return this.elc.add(document,
|
|
1646
|
-
|
|
1675
|
+
titleSub(e) {}
|
|
1676
|
+
#h = (n) => {
|
|
1677
|
+
if (!n.key) return this.tglFlscr_sub().catch((t) => e.tglFlscr_HdrErr(t)), !1;
|
|
1678
|
+
let r = n.key.toLowerCase();
|
|
1679
|
+
return this.elc.add(document, t, (t) => {
|
|
1680
|
+
e.modKey(t) + t.key.toLowerCase() === r && (t.stopPropagation(), this.tglFlscr_sub().catch((t) => e.tglFlscr_HdrErr(t)));
|
|
1647
1681
|
}, { passive: !0 }), !1;
|
|
1648
1682
|
};
|
|
1649
|
-
static tglFlscr_HdrErr(
|
|
1650
|
-
|
|
1683
|
+
static tglFlscr_HdrErr(e) {
|
|
1684
|
+
e instanceof TypeError && console.error("フルスクリーン化でエラーです。ブラウザ環境でキー入力きっかけでないと発生します"), console.error(`fn:SysBase.ts tglFlscr ${String(e)}`);
|
|
1651
1685
|
}
|
|
1652
|
-
static modKey(
|
|
1653
|
-
return (
|
|
1686
|
+
static modKey(e) {
|
|
1687
|
+
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
1688
|
}
|
|
1655
1689
|
async tglFlscr_sub() {}
|
|
1656
1690
|
update_check = () => !1;
|
|
1657
1691
|
window = () => !1;
|
|
1658
1692
|
#g = "";
|
|
1659
|
-
setTitleInfo(
|
|
1660
|
-
this.#g =
|
|
1693
|
+
setTitleInfo(e) {
|
|
1694
|
+
this.#g = e, this.titleSub(this.#m + this.#g);
|
|
1661
1695
|
}
|
|
1662
1696
|
#_ = () => Promise.resolve({
|
|
1663
1697
|
ext_num: 0,
|
|
1664
1698
|
ab: /* @__PURE__ */ new ArrayBuffer(0)
|
|
1665
1699
|
});
|
|
1666
|
-
dec = (
|
|
1667
|
-
async decAB(
|
|
1668
|
-
let { ext_num:
|
|
1669
|
-
return
|
|
1700
|
+
dec = (e, t) => Promise.resolve(t);
|
|
1701
|
+
async decAB(e) {
|
|
1702
|
+
let { ext_num: t, ab: n } = await this.#_(e), r = this.#v[t];
|
|
1703
|
+
return r?.fnc ? await r.fnc(n) : n;
|
|
1670
1704
|
}
|
|
1671
1705
|
#v = {
|
|
1672
1706
|
1: {
|
|
1673
1707
|
ext: "jpeg",
|
|
1674
|
-
fnc: (
|
|
1708
|
+
fnc: (e) => this.#y(e, "image/jpeg")
|
|
1675
1709
|
},
|
|
1676
1710
|
2: {
|
|
1677
1711
|
ext: "png",
|
|
1678
|
-
fnc: (
|
|
1712
|
+
fnc: (e) => this.#y(e, "image/png")
|
|
1679
1713
|
},
|
|
1680
1714
|
3: {
|
|
1681
1715
|
ext: "svg",
|
|
1682
|
-
fnc: (
|
|
1716
|
+
fnc: (e) => this.#y(e, "image/svg+xml")
|
|
1683
1717
|
},
|
|
1684
1718
|
4: {
|
|
1685
1719
|
ext: "webp",
|
|
1686
|
-
fnc: (
|
|
1720
|
+
fnc: (e) => this.#y(e, "image/webp")
|
|
1687
1721
|
},
|
|
1688
1722
|
20: {
|
|
1689
1723
|
ext: "mp4",
|
|
1690
|
-
fnc: (
|
|
1724
|
+
fnc: (e) => this.#b(e, "video/mp4")
|
|
1691
1725
|
},
|
|
1692
1726
|
21: {
|
|
1693
1727
|
ext: "webm",
|
|
1694
|
-
fnc: (
|
|
1728
|
+
fnc: (e) => this.#b(e, "video/webm")
|
|
1695
1729
|
},
|
|
1696
1730
|
22: {
|
|
1697
1731
|
ext: "ogv",
|
|
1698
|
-
fnc: (
|
|
1732
|
+
fnc: (e) => this.#b(e, "video/ogv")
|
|
1699
1733
|
}
|
|
1700
1734
|
};
|
|
1701
|
-
#y = (
|
|
1702
|
-
let
|
|
1703
|
-
|
|
1735
|
+
#y = (e, t) => new Promise((n, r) => {
|
|
1736
|
+
let i = new Blob([e], { type: t }), a = new Image();
|
|
1737
|
+
a.onload = () => n(a), a.onerror = (e) => r(Error(e instanceof Event ? e.type : e)), a.src = URL.createObjectURL(i);
|
|
1704
1738
|
});
|
|
1705
|
-
#b = (
|
|
1706
|
-
let
|
|
1707
|
-
this.elc.add(
|
|
1739
|
+
#b = (e, t) => new Promise((n, r) => {
|
|
1740
|
+
let i = new Blob([e], { type: t }), a = document.createElement("video");
|
|
1741
|
+
this.elc.add(a, "error", () => r(Error(a.error?.message ?? ""))), this.elc.add(a, "canplay", () => n(a)), a.src = URL.createObjectURL(i);
|
|
1708
1742
|
});
|
|
1709
|
-
enc = async (
|
|
1743
|
+
enc = async (e) => e;
|
|
1710
1744
|
stk = () => "";
|
|
1711
|
-
hash = (
|
|
1745
|
+
hash = (e) => "";
|
|
1712
1746
|
isApp = !1;
|
|
1713
1747
|
$path_downloads = "";
|
|
1714
1748
|
get path_downloads() {
|
|
@@ -1718,12 +1752,13 @@ top: ${String((CmnLib.stageH - Y) / 2 * this.#a + Y * (J.dy ?? 0))}px;`, q.class
|
|
|
1718
1752
|
get path_userdata() {
|
|
1719
1753
|
return this.$path_userdata;
|
|
1720
1754
|
}
|
|
1721
|
-
capturePage(
|
|
1722
|
-
async savePic(
|
|
1723
|
-
async ensureFile(
|
|
1724
|
-
async appendFile(
|
|
1725
|
-
async outputFile(
|
|
1755
|
+
capturePage(e, t, n, r) {}
|
|
1756
|
+
async savePic(e, t) {}
|
|
1757
|
+
async ensureFile(e) {}
|
|
1758
|
+
async appendFile(e, t) {}
|
|
1759
|
+
async outputFile(e, t) {}
|
|
1726
1760
|
};
|
|
1727
|
-
|
|
1761
|
+
//#endregion
|
|
1762
|
+
export { Ke as t };
|
|
1728
1763
|
|
|
1729
1764
|
//# sourceMappingURL=SysBase.js.map
|