@famibee/skynovel 2.0.2 → 2.0.4

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