@omg-dev/app 0.6.210 → 0.6.212
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/{ChangelogPage-Dp-ue7MR.js → ChangelogPage-DCNaY-sr.js} +13 -1
- package/dist-lib/{SessionFilesPanel-BEsMBxDe.js → SessionFilesPanel-CfkEKcZI.js} +1 -1
- package/dist-lib/{TermView-pH7R8GPy.js → TermView-o2MgHCz_.js} +2 -2
- package/dist-lib/{board-page-CcyFMSbr.js → board-page-z1Jjd9wk.js} +1 -1
- package/dist-lib/{chat-engine-DvwCv6Tr.js → chat-engine-DLGMy3IH.js} +1 -1
- package/dist-lib/{coding-agents-page-CtwEQuEu.js → coding-agents-page-BSCXdLWC.js} +1 -1
- package/dist-lib/{computer-page-BXjUKQ19.js → computer-page-_4TYKC7j.js} +144 -165
- package/dist-lib/{computer-pointer-C3VB2laK.js → computer-pointer-CZ-tnHkw.js} +1309 -1157
- package/dist-lib/{connectors-page-BpnBb51Z.js → connectors-page-CopZTieF.js} +1 -1
- package/dist-lib/{embedded-DbPku-MI.js → embedded-B_ymIz97.js} +15 -15
- package/dist-lib/expo-signin-sheet-BzsKPAam.js +246 -0
- package/dist-lib/index.js +1 -1
- package/dist-lib/{keyboard-pmRTmquI.js → keyboard-OCqD2cDm.js} +1 -1
- package/dist-lib/{resume-session-sheet-BbShw8SQ.js → resume-session-sheet-9fMPRNvR.js} +1 -1
- package/dist-lib/{session-token-usage-ZG7DpMu1.js → session-token-usage-B67WiKJN.js} +1 -1
- package/dist-lib/{shipped-page-BqKBW8p0.js → shipped-page-DpnnMlPz.js} +1 -1
- package/dist-lib/{streamdown-response-C-LQgtwq.js → streamdown-response-CsVevp3-.js} +1 -1
- package/dist-lib/styles.css +1 -1
- package/package.json +3 -3
- package/dist-lib/expo-signin-sheet-DLKpuDBL.js +0 -234
|
@@ -1,20 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
import { aa as Ds } from "./embedded-B_ymIz97.js";
|
|
2
|
+
async function Xa() {
|
|
3
|
+
const i = await Ds("/api/computer/clipboard");
|
|
4
|
+
if (!i.ok) throw Object.assign(new Error("Computer clipboard unavailable"), { status: i.status });
|
|
5
|
+
return (await i.json()).text;
|
|
6
|
+
}
|
|
7
|
+
async function Fa(i) {
|
|
8
|
+
const t = await Ds("/api/computer/clipboard", {
|
|
9
|
+
method: "POST",
|
|
10
|
+
headers: { "Content-Type": "application/json" },
|
|
11
|
+
body: JSON.stringify({ text: i })
|
|
12
|
+
});
|
|
13
|
+
if (!t.ok) throw Object.assign(new Error("Computer clipboard unavailable"), { status: t.status });
|
|
14
|
+
}
|
|
15
|
+
function bn(i) {
|
|
2
16
|
return i >>> 0;
|
|
3
17
|
}
|
|
4
|
-
function
|
|
18
|
+
function ti(i) {
|
|
5
19
|
return i | 0;
|
|
6
20
|
}
|
|
7
|
-
let
|
|
21
|
+
let pi = "warn", Q = () => {
|
|
8
22
|
}, $ = () => {
|
|
9
23
|
}, te = () => {
|
|
10
24
|
}, z = () => {
|
|
11
25
|
};
|
|
12
|
-
function
|
|
13
|
-
if (typeof i > "u" ? i =
|
|
26
|
+
function wn(i) {
|
|
27
|
+
if (typeof i > "u" ? i = pi : pi = i, Q = $ = te = z = () => {
|
|
14
28
|
}, typeof window.console < "u")
|
|
15
29
|
switch (i) {
|
|
16
30
|
case "debug":
|
|
17
|
-
|
|
31
|
+
Q = console.debug.bind(window.console);
|
|
18
32
|
case "info":
|
|
19
33
|
$ = console.info.bind(window.console);
|
|
20
34
|
case "warn":
|
|
@@ -27,7 +41,7 @@ function pn(i) {
|
|
|
27
41
|
throw new window.Error("invalid logging type '" + i + "'");
|
|
28
42
|
}
|
|
29
43
|
}
|
|
30
|
-
|
|
44
|
+
wn();
|
|
31
45
|
function Qt(i, t = !1) {
|
|
32
46
|
try {
|
|
33
47
|
return decodeURIComponent(escape(i));
|
|
@@ -37,10 +51,10 @@ function Qt(i, t = !1) {
|
|
|
37
51
|
throw e;
|
|
38
52
|
}
|
|
39
53
|
}
|
|
40
|
-
function
|
|
54
|
+
function fe(i) {
|
|
41
55
|
return unescape(encodeURIComponent(i));
|
|
42
56
|
}
|
|
43
|
-
const
|
|
57
|
+
const ai = {
|
|
44
58
|
/* Convert data (an array of integers) to a Base64 string. */
|
|
45
59
|
toBase64Table: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),
|
|
46
60
|
base64Pad: "=",
|
|
@@ -205,33 +219,33 @@ const ri = {
|
|
|
205
219
|
return n;
|
|
206
220
|
}
|
|
207
221
|
};
|
|
208
|
-
let
|
|
222
|
+
let Is = "ontouchstart" in document.documentElement || // required for Chrome debugger
|
|
209
223
|
document.ontouchstart !== void 0 || // required for MS Surface
|
|
210
224
|
navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
|
|
211
225
|
window.addEventListener("touchstart", function i() {
|
|
212
|
-
|
|
226
|
+
Is = !0, window.removeEventListener("touchstart", i, !1);
|
|
213
227
|
}, !1);
|
|
214
|
-
let rt = 10 * (window.devicePixelRatio || 1),
|
|
228
|
+
let rt = 10 * (window.devicePixelRatio || 1), Ps = !1;
|
|
215
229
|
try {
|
|
216
230
|
const i = document.createElement("canvas");
|
|
217
|
-
i.style.cursor = 'url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default', i.style.cursor.indexOf("url") === 0 ? ($("Data URI scheme cursor supported"),
|
|
231
|
+
i.style.cursor = 'url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default', i.style.cursor.indexOf("url") === 0 ? ($("Data URI scheme cursor supported"), Ps = !0) : te("Data URI scheme cursor not supported");
|
|
218
232
|
} catch (i) {
|
|
219
233
|
z("Data URI scheme cursor test exception: " + i);
|
|
220
234
|
}
|
|
221
|
-
const
|
|
222
|
-
let
|
|
235
|
+
const mn = Ps;
|
|
236
|
+
let yn = !0;
|
|
223
237
|
try {
|
|
224
238
|
const i = document.createElement("div");
|
|
225
239
|
i.style.visibility = "hidden", i.style.overflow = "scroll", document.body.appendChild(i);
|
|
226
240
|
const t = document.createElement("div");
|
|
227
241
|
i.appendChild(t);
|
|
228
242
|
const e = i.offsetWidth - t.offsetWidth;
|
|
229
|
-
i.parentNode.removeChild(i),
|
|
243
|
+
i.parentNode.removeChild(i), yn = e != 0;
|
|
230
244
|
} catch (i) {
|
|
231
245
|
z("Scrollbar test exception: " + i);
|
|
232
246
|
}
|
|
233
|
-
let
|
|
234
|
-
async function
|
|
247
|
+
let Us = !1;
|
|
248
|
+
async function vn() {
|
|
235
249
|
if (!("VideoDecoder" in window))
|
|
236
250
|
return !1;
|
|
237
251
|
const i = {
|
|
@@ -242,7 +256,7 @@ async function wn() {
|
|
|
242
256
|
};
|
|
243
257
|
if (!(await VideoDecoder.isConfigSupported(i)).supported)
|
|
244
258
|
return !1;
|
|
245
|
-
const e = new Uint8Array(
|
|
259
|
+
const e = new Uint8Array(ai.decode(
|
|
246
260
|
"AAAAAWdCwBTZnpuAgICgAAADACAAAAZB4oVNAAAAAWjJYyyAAAABBgX//4HcRem95tlIt5Ys2CDZI+7veDI2NCAtIGNvcmUgMTY0IHIzMTA4IDMxZTE5ZjkgLSBILjI2NC9NUEVHLTQgQVZDIGNvZGVjIC0gQ29weWxlZnQgMjAwMy0yMDIzIC0gaHR0cDovL3d3dy52aWRlb2xhbi5vcmcveDI2NC5odG1sIC0gb3B0aW9uczogY2FiYWM9MCByZWY9NSBkZWJsb2NrPTE6MDowIGFuYWx5c2U9MHgxOjB4MTExIG1lPWhleCBzdWJtZT04IHBzeT0xIHBzeV9yZD0xLjAwOjAuMDAgbWl4ZWRfcmVmPTEgbWVfcmFuZ2U9MTYgY2hyb21hX21lPTEgdHJlbGxpcz0yIDh4OGRjdD0wIGNxbT0wIGRlYWR6b25lPTIxLDExIGZhc3RfcHNraXA9MSBjaHJvbWFfcXBfb2Zmc2V0PS0yIHRocmVhZHM9MSBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTAgd2VpZ2h0cD0wIGtleWludD1pbmZpbml0ZSBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NTAgcmM9YWJyIG1idHJlZT0xIGJpdHJhdGU9NDAwIHJhdGV0b2w9MS4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAABZYiEBrxmKAAPVccAAS044AA5DRJMnkycJk4TPw=="
|
|
247
261
|
));
|
|
248
262
|
let s = !1, n = null, r = new VideoDecoder({
|
|
@@ -265,11 +279,11 @@ async function wn() {
|
|
|
265
279
|
}
|
|
266
280
|
return !(!s || n !== null);
|
|
267
281
|
}
|
|
268
|
-
|
|
269
|
-
function
|
|
282
|
+
Us = await vn();
|
|
283
|
+
function Te() {
|
|
270
284
|
return !!/mac/i.exec(navigator.platform);
|
|
271
285
|
}
|
|
272
|
-
function
|
|
286
|
+
function gt() {
|
|
273
287
|
return !!/win/i.exec(navigator.platform);
|
|
274
288
|
}
|
|
275
289
|
function Pe() {
|
|
@@ -283,39 +297,39 @@ function Ue(i, t, e) {
|
|
|
283
297
|
function Xe(i) {
|
|
284
298
|
i.stopPropagation(), i.preventDefault();
|
|
285
299
|
}
|
|
286
|
-
let
|
|
300
|
+
let Lt = !1, Ns = null;
|
|
287
301
|
document.captureElement = null;
|
|
288
302
|
function Se(i) {
|
|
289
|
-
if (
|
|
303
|
+
if (Lt) return;
|
|
290
304
|
const t = new i.constructor(i.type, i);
|
|
291
|
-
|
|
305
|
+
Lt = !0, document.captureElement ? document.captureElement.dispatchEvent(t) : Ns.dispatchEvent(t), Lt = !1, i.stopPropagation(), t.defaultPrevented && i.preventDefault(), i.type === "mouseup" && Os();
|
|
292
306
|
}
|
|
293
|
-
function
|
|
307
|
+
function Hs() {
|
|
294
308
|
const i = document.getElementById("noVNC_mouse_capture_elem");
|
|
295
309
|
i.style.cursor = window.getComputedStyle(document.captureElement).cursor;
|
|
296
310
|
}
|
|
297
|
-
const
|
|
298
|
-
function
|
|
311
|
+
const zs = new MutationObserver(Hs);
|
|
312
|
+
function kn(i) {
|
|
299
313
|
if (i.setCapture)
|
|
300
314
|
i.setCapture(), document.captureElement = i;
|
|
301
315
|
else {
|
|
302
|
-
|
|
316
|
+
Os();
|
|
303
317
|
let t = document.getElementById("noVNC_mouse_capture_elem");
|
|
304
|
-
t === null && (t = document.createElement("div"), t.id = "noVNC_mouse_capture_elem", t.style.position = "fixed", t.style.top = "0px", t.style.left = "0px", t.style.width = "100%", t.style.height = "100%", t.style.zIndex = 1e4, t.style.display = "none", document.body.appendChild(t), t.addEventListener("contextmenu", Se), t.addEventListener("mousemove", Se), t.addEventListener("mouseup", Se)), document.captureElement = i,
|
|
318
|
+
t === null && (t = document.createElement("div"), t.id = "noVNC_mouse_capture_elem", t.style.position = "fixed", t.style.top = "0px", t.style.left = "0px", t.style.width = "100%", t.style.height = "100%", t.style.zIndex = 1e4, t.style.display = "none", document.body.appendChild(t), t.addEventListener("contextmenu", Se), t.addEventListener("mousemove", Se), t.addEventListener("mouseup", Se)), document.captureElement = i, zs.observe(i, { attributes: !0 }), Hs(), t.style.display = "", window.addEventListener("mousemove", Se), window.addEventListener("mouseup", Se);
|
|
305
319
|
}
|
|
306
320
|
}
|
|
307
|
-
function
|
|
321
|
+
function Os() {
|
|
308
322
|
if (document.releaseCapture)
|
|
309
323
|
document.releaseCapture(), document.captureElement = null;
|
|
310
324
|
else {
|
|
311
325
|
if (!document.captureElement)
|
|
312
326
|
return;
|
|
313
|
-
|
|
327
|
+
Ns = document.captureElement, document.captureElement = null, zs.disconnect();
|
|
314
328
|
const i = document.getElementById("noVNC_mouse_capture_elem");
|
|
315
329
|
i.style.display = "none", window.removeEventListener("mousemove", Se), window.removeEventListener("mouseup", Se);
|
|
316
330
|
}
|
|
317
331
|
}
|
|
318
|
-
class
|
|
332
|
+
class Vs {
|
|
319
333
|
constructor() {
|
|
320
334
|
this._listeners = /* @__PURE__ */ new Map();
|
|
321
335
|
}
|
|
@@ -329,9 +343,9 @@ class Hs {
|
|
|
329
343
|
return this._listeners.has(t.type) ? (this._listeners.get(t.type).forEach((e) => e.call(this, t)), !t.defaultPrevented) : !0;
|
|
330
344
|
}
|
|
331
345
|
}
|
|
332
|
-
class
|
|
346
|
+
class Sn {
|
|
333
347
|
constructor(t) {
|
|
334
|
-
if (this._drawCtx = null, this._renderQ = [], this._flushPromise = null, this._fbWidth = 0, this._fbHeight = 0, this._prevDrawStyle = "",
|
|
348
|
+
if (this._drawCtx = null, this._renderQ = [], this._flushPromise = null, this._fbWidth = 0, this._fbHeight = 0, this._prevDrawStyle = "", Q(">> Display.constructor"), this._target = t, !this._target)
|
|
335
349
|
throw new Error("Target must be set");
|
|
336
350
|
if (typeof this._target == "string")
|
|
337
351
|
throw new Error("target must be a DOM element");
|
|
@@ -342,7 +356,7 @@ class mn {
|
|
|
342
356
|
top: 0,
|
|
343
357
|
right: this._backbuffer.width,
|
|
344
358
|
bottom: this._backbuffer.height
|
|
345
|
-
},
|
|
359
|
+
}, Q("User Agent: " + navigator.userAgent), Q("<< Display.constructor"), this._scale = 1, this._clipViewport = !1;
|
|
346
360
|
}
|
|
347
361
|
// ===== PROPERTIES =====
|
|
348
362
|
get scale() {
|
|
@@ -370,10 +384,10 @@ class mn {
|
|
|
370
384
|
const s = this._viewportLoc;
|
|
371
385
|
t = Math.floor(t), e = Math.floor(e), this._clipViewport || (t = -s.w, e = -s.h);
|
|
372
386
|
const n = s.x + s.w - 1, r = s.y + s.h - 1;
|
|
373
|
-
t < 0 && s.x + t < 0 && (t = -s.x), n + t >= this._fbWidth && (t -= n + t - this._fbWidth + 1), s.y + e < 0 && (e = -s.y), r + e >= this._fbHeight && (e -= r + e - this._fbHeight + 1), !(t === 0 && e === 0) && (
|
|
387
|
+
t < 0 && s.x + t < 0 && (t = -s.x), n + t >= this._fbWidth && (t -= n + t - this._fbWidth + 1), s.y + e < 0 && (e = -s.y), r + e >= this._fbHeight && (e -= r + e - this._fbHeight + 1), !(t === 0 && e === 0) && (Q("viewportChange deltaX: " + t + ", deltaY: " + e), s.x += t, s.y += e, this._damage(s.x, s.y, s.w, s.h), this.flip());
|
|
374
388
|
}
|
|
375
389
|
viewportChangeSize(t, e) {
|
|
376
|
-
(!this._clipViewport || typeof t > "u" || typeof e > "u") && (
|
|
390
|
+
(!this._clipViewport || typeof t > "u" || typeof e > "u") && (Q("Setting viewport to full display region"), t = this._fbWidth, e = this._fbHeight), t = Math.floor(t), e = Math.floor(e), t > this._fbWidth && (t = this._fbWidth), e > this._fbHeight && (e = this._fbHeight);
|
|
377
391
|
const s = this._viewportLoc;
|
|
378
392
|
if (s.w !== t || s.h !== e) {
|
|
379
393
|
s.w = t, s.h = e;
|
|
@@ -382,10 +396,10 @@ class mn {
|
|
|
382
396
|
}
|
|
383
397
|
}
|
|
384
398
|
absX(t) {
|
|
385
|
-
return this._scale === 0 ? 0 :
|
|
399
|
+
return this._scale === 0 ? 0 : ti(t / this._scale + this._viewportLoc.x);
|
|
386
400
|
}
|
|
387
401
|
absY(t) {
|
|
388
|
-
return this._scale === 0 ? 0 :
|
|
402
|
+
return this._scale === 0 ? 0 : ti(t / this._scale + this._viewportLoc.y);
|
|
389
403
|
}
|
|
390
404
|
resize(t, e) {
|
|
391
405
|
this._prevDrawStyle = "", this._fbWidth = t, this._fbHeight = e;
|
|
@@ -475,7 +489,7 @@ class mn {
|
|
|
475
489
|
if (s === 0 || n === 0)
|
|
476
490
|
return;
|
|
477
491
|
const h = new Image();
|
|
478
|
-
h.src = "data: " + r + ";base64," +
|
|
492
|
+
h.src = "data: " + r + ";base64," + ai.encode(a), this._renderQPush({
|
|
479
493
|
type: "img",
|
|
480
494
|
img: h,
|
|
481
495
|
x: t,
|
|
@@ -580,8 +594,8 @@ class mn {
|
|
|
580
594
|
if (e.frame.ready) {
|
|
581
595
|
let s = e.frame.frame;
|
|
582
596
|
(s.codedWidth < e.width || s.codedHeight < e.height) && te("Decoded video frame does not cover its full rectangle area. Expecting at least " + e.width + "x" + e.height + " but got " + s.codedWidth + "x" + s.codedHeight);
|
|
583
|
-
const n = 0, r = 0, a = e.width, h = e.height, c = e.x, o = e.y, l = a,
|
|
584
|
-
this.drawImage(s, n, r, a, h, c, o, l,
|
|
597
|
+
const n = 0, r = 0, a = e.width, h = e.height, c = e.x, o = e.y, l = a, f = h;
|
|
598
|
+
this.drawImage(s, n, r, a, h, c, o, l, f), s.close();
|
|
585
599
|
} else {
|
|
586
600
|
let s = this;
|
|
587
601
|
e.frame.promise.then(() => {
|
|
@@ -603,8 +617,8 @@ function xe(i, t, e, s, n) {
|
|
|
603
617
|
for (var r = 0; r < s; r++)
|
|
604
618
|
i[n + r] = t[e + r];
|
|
605
619
|
}
|
|
606
|
-
var
|
|
607
|
-
function
|
|
620
|
+
var yt = Uint8Array, ne = Uint16Array, vt = Int32Array;
|
|
621
|
+
function ii(i, t, e, s) {
|
|
608
622
|
for (var n = i & 65535 | 0, r = i >>> 16 & 65535 | 0, a = 0; e !== 0; ) {
|
|
609
623
|
a = e > 2e3 ? 2e3 : e, e -= a;
|
|
610
624
|
do
|
|
@@ -624,72 +638,72 @@ function W() {
|
|
|
624
638
|
return t;
|
|
625
639
|
}
|
|
626
640
|
W();
|
|
627
|
-
var at = 30,
|
|
628
|
-
function
|
|
629
|
-
var e, s, n, r, a, h, c, o, l,
|
|
630
|
-
e = i.state, s = i.next_in,
|
|
641
|
+
var at = 30, Cn = 12;
|
|
642
|
+
function En(i, t) {
|
|
643
|
+
var e, s, n, r, a, h, c, o, l, f, d, x, k, E, M, C, K, A, S, F, R, X, I, D, T;
|
|
644
|
+
e = i.state, s = i.next_in, D = i.input, n = s + (i.avail_in - 5), r = i.next_out, T = i.output, a = r - (t - i.avail_out), h = r + (i.avail_out - 257), c = e.dmax, o = e.wsize, l = e.whave, f = e.wnext, d = e.window, x = e.hold, k = e.bits, E = e.lencode, M = e.distcode, C = (1 << e.lenbits) - 1, K = (1 << e.distbits) - 1;
|
|
631
645
|
e:
|
|
632
646
|
do {
|
|
633
|
-
k < 15 && (x +=
|
|
647
|
+
k < 15 && (x += D[s++] << k, k += 8, x += D[s++] << k, k += 8), A = E[x & C];
|
|
634
648
|
t:
|
|
635
649
|
for (; ; ) {
|
|
636
650
|
if (S = A >>> 24, x >>>= S, k -= S, S = A >>> 16 & 255, S === 0)
|
|
637
|
-
|
|
651
|
+
T[r++] = A & 65535;
|
|
638
652
|
else if (S & 16) {
|
|
639
|
-
F = A & 65535, S &= 15, S && (k < S && (x +=
|
|
653
|
+
F = A & 65535, S &= 15, S && (k < S && (x += D[s++] << k, k += 8), F += x & (1 << S) - 1, x >>>= S, k -= S), k < 15 && (x += D[s++] << k, k += 8, x += D[s++] << k, k += 8), A = M[x & K];
|
|
640
654
|
i:
|
|
641
655
|
for (; ; ) {
|
|
642
656
|
if (S = A >>> 24, x >>>= S, k -= S, S = A >>> 16 & 255, S & 16) {
|
|
643
|
-
if (
|
|
657
|
+
if (R = A & 65535, S &= 15, k < S && (x += D[s++] << k, k += 8, k < S && (x += D[s++] << k, k += 8)), R += x & (1 << S) - 1, R > c) {
|
|
644
658
|
i.msg = "invalid distance too far back", e.mode = at;
|
|
645
659
|
break e;
|
|
646
660
|
}
|
|
647
|
-
if (x >>>= S, k -= S, S = r - a,
|
|
648
|
-
if (S =
|
|
661
|
+
if (x >>>= S, k -= S, S = r - a, R > S) {
|
|
662
|
+
if (S = R - S, S > l && e.sane) {
|
|
649
663
|
i.msg = "invalid distance too far back", e.mode = at;
|
|
650
664
|
break e;
|
|
651
665
|
}
|
|
652
|
-
if (
|
|
653
|
-
if (
|
|
666
|
+
if (X = 0, I = d, f === 0) {
|
|
667
|
+
if (X += o - S, S < F) {
|
|
654
668
|
F -= S;
|
|
655
669
|
do
|
|
656
|
-
|
|
670
|
+
T[r++] = d[X++];
|
|
657
671
|
while (--S);
|
|
658
|
-
|
|
672
|
+
X = r - R, I = T;
|
|
659
673
|
}
|
|
660
|
-
} else if (
|
|
661
|
-
if (
|
|
674
|
+
} else if (f < S) {
|
|
675
|
+
if (X += o + f - S, S -= f, S < F) {
|
|
662
676
|
F -= S;
|
|
663
677
|
do
|
|
664
|
-
|
|
678
|
+
T[r++] = d[X++];
|
|
665
679
|
while (--S);
|
|
666
|
-
if (
|
|
667
|
-
S =
|
|
680
|
+
if (X = 0, f < F) {
|
|
681
|
+
S = f, F -= S;
|
|
668
682
|
do
|
|
669
|
-
|
|
683
|
+
T[r++] = d[X++];
|
|
670
684
|
while (--S);
|
|
671
|
-
|
|
685
|
+
X = r - R, I = T;
|
|
672
686
|
}
|
|
673
687
|
}
|
|
674
|
-
} else if (
|
|
688
|
+
} else if (X += f - S, S < F) {
|
|
675
689
|
F -= S;
|
|
676
690
|
do
|
|
677
|
-
|
|
691
|
+
T[r++] = d[X++];
|
|
678
692
|
while (--S);
|
|
679
|
-
|
|
693
|
+
X = r - R, I = T;
|
|
680
694
|
}
|
|
681
695
|
for (; F > 2; )
|
|
682
|
-
|
|
683
|
-
F && (
|
|
696
|
+
T[r++] = I[X++], T[r++] = I[X++], T[r++] = I[X++], F -= 3;
|
|
697
|
+
F && (T[r++] = I[X++], F > 1 && (T[r++] = I[X++]));
|
|
684
698
|
} else {
|
|
685
|
-
|
|
699
|
+
X = r - R;
|
|
686
700
|
do
|
|
687
|
-
|
|
701
|
+
T[r++] = T[X++], T[r++] = T[X++], T[r++] = T[X++], F -= 3;
|
|
688
702
|
while (F > 2);
|
|
689
|
-
F && (
|
|
703
|
+
F && (T[r++] = T[X++], F > 1 && (T[r++] = T[X++]));
|
|
690
704
|
}
|
|
691
705
|
} else if ((S & 64) === 0) {
|
|
692
|
-
A =
|
|
706
|
+
A = M[(A & 65535) + (x & (1 << S) - 1)];
|
|
693
707
|
continue i;
|
|
694
708
|
} else {
|
|
695
709
|
i.msg = "invalid distance code", e.mode = at;
|
|
@@ -701,7 +715,7 @@ function kn(i, t) {
|
|
|
701
715
|
A = E[(A & 65535) + (x & (1 << S) - 1)];
|
|
702
716
|
continue t;
|
|
703
717
|
} else if (S & 32) {
|
|
704
|
-
e.mode =
|
|
718
|
+
e.mode = Cn;
|
|
705
719
|
break e;
|
|
706
720
|
} else {
|
|
707
721
|
i.msg = "invalid literal/length code", e.mode = at;
|
|
@@ -712,7 +726,7 @@ function kn(i, t) {
|
|
|
712
726
|
} while (s < n && r < h);
|
|
713
727
|
F = k >> 3, s -= F, k -= F << 3, x &= (1 << k) - 1, i.next_in = s, i.next_out = r, i.avail_in = s < n ? 5 + (n - s) : 5 - (s - n), i.avail_out = r < h ? 257 + (h - r) : 257 - (r - h), e.hold = x, e.bits = k;
|
|
714
728
|
}
|
|
715
|
-
var Fe = 15,
|
|
729
|
+
var Fe = 15, gi = 852, bi = 592, wi = 0, Rt = 1, mi = 2, Kn = [
|
|
716
730
|
/* Length codes 257..285 base */
|
|
717
731
|
3,
|
|
718
732
|
4,
|
|
@@ -745,7 +759,7 @@ var Fe = 15, pi = 852, gi = 592, bi = 0, Lt = 1, wi = 2, Sn = [
|
|
|
745
759
|
258,
|
|
746
760
|
0,
|
|
747
761
|
0
|
|
748
|
-
],
|
|
762
|
+
], An = [
|
|
749
763
|
/* Length codes 257..285 extra */
|
|
750
764
|
16,
|
|
751
765
|
16,
|
|
@@ -778,7 +792,7 @@ var Fe = 15, pi = 852, gi = 592, bi = 0, Lt = 1, wi = 2, Sn = [
|
|
|
778
792
|
16,
|
|
779
793
|
72,
|
|
780
794
|
78
|
|
781
|
-
],
|
|
795
|
+
], Xn = [
|
|
782
796
|
/* Distance codes 0..29 base */
|
|
783
797
|
1,
|
|
784
798
|
2,
|
|
@@ -812,7 +826,7 @@ var Fe = 15, pi = 852, gi = 592, bi = 0, Lt = 1, wi = 2, Sn = [
|
|
|
812
826
|
24577,
|
|
813
827
|
0,
|
|
814
828
|
0
|
|
815
|
-
],
|
|
829
|
+
], Fn = [
|
|
816
830
|
/* Distance codes 0..29 extra */
|
|
817
831
|
16,
|
|
818
832
|
16,
|
|
@@ -848,7 +862,7 @@ var Fe = 15, pi = 852, gi = 592, bi = 0, Lt = 1, wi = 2, Sn = [
|
|
|
848
862
|
64
|
|
849
863
|
];
|
|
850
864
|
function We(i, t, e, s, n, r, a, h) {
|
|
851
|
-
var c = h.bits, o = 0, l = 0,
|
|
865
|
+
var c = h.bits, o = 0, l = 0, f = 0, d = 0, x = 0, k = 0, E = 0, M = 0, C = 0, K = 0, A, S, F, R, X, I = null, D = 0, T, O = new ne(Fe + 1), ee = new ne(Fe + 1), Ae = null, re = 0, ve, he, G;
|
|
852
866
|
for (o = 0; o <= Fe; o++)
|
|
853
867
|
O[o] = 0;
|
|
854
868
|
for (l = 0; l < s; l++)
|
|
@@ -857,74 +871,74 @@ function We(i, t, e, s, n, r, a, h) {
|
|
|
857
871
|
;
|
|
858
872
|
if (x > d && (x = d), d === 0)
|
|
859
873
|
return n[r++] = 1 << 24 | 64 << 16 | 0, n[r++] = 1 << 24 | 64 << 16 | 0, h.bits = 1, 0;
|
|
860
|
-
for (
|
|
874
|
+
for (f = 1; f < d && O[f] === 0; f++)
|
|
861
875
|
;
|
|
862
|
-
for (x <
|
|
863
|
-
if (
|
|
876
|
+
for (x < f && (x = f), M = 1, o = 1; o <= Fe; o++)
|
|
877
|
+
if (M <<= 1, M -= O[o], M < 0)
|
|
864
878
|
return -1;
|
|
865
|
-
if (
|
|
879
|
+
if (M > 0 && (i === wi || d !== 1))
|
|
866
880
|
return -1;
|
|
867
881
|
for (ee[1] = 0, o = 1; o < Fe; o++)
|
|
868
882
|
ee[o + 1] = ee[o] + O[o];
|
|
869
883
|
for (l = 0; l < s; l++)
|
|
870
884
|
t[e + l] !== 0 && (a[ee[t[e + l]]++] = l);
|
|
871
|
-
if (i ===
|
|
885
|
+
if (i === wi ? (I = Ae = a, T = 19) : i === Rt ? (I = Kn, D -= 257, Ae = An, re -= 257, T = 256) : (I = Xn, Ae = Fn, T = -1), K = 0, l = 0, o = f, X = r, k = x, E = 0, F = -1, C = 1 << x, R = C - 1, i === Rt && C > gi || i === mi && C > bi)
|
|
872
886
|
return 1;
|
|
873
887
|
for (; ; ) {
|
|
874
|
-
|
|
888
|
+
ve = o - E, a[l] < T ? (he = 0, G = a[l]) : a[l] > T ? (he = Ae[re + a[l]], G = I[D + a[l]]) : (he = 96, G = 0), A = 1 << o - E, S = 1 << k, f = S;
|
|
875
889
|
do
|
|
876
|
-
S -= A, n[
|
|
890
|
+
S -= A, n[X + (K >> E) + S] = ve << 24 | he << 16 | G | 0;
|
|
877
891
|
while (S !== 0);
|
|
878
|
-
for (A = 1 << o - 1;
|
|
892
|
+
for (A = 1 << o - 1; K & A; )
|
|
879
893
|
A >>= 1;
|
|
880
|
-
if (A !== 0 ? (
|
|
894
|
+
if (A !== 0 ? (K &= A - 1, K += A) : K = 0, l++, --O[o] === 0) {
|
|
881
895
|
if (o === d)
|
|
882
896
|
break;
|
|
883
897
|
o = t[e + a[l]];
|
|
884
898
|
}
|
|
885
|
-
if (o > x && (
|
|
886
|
-
for (E === 0 && (E = x),
|
|
887
|
-
k++,
|
|
888
|
-
if (C += 1 << k, i ===
|
|
899
|
+
if (o > x && (K & R) !== F) {
|
|
900
|
+
for (E === 0 && (E = x), X += f, k = o - E, M = 1 << k; k + E < d && (M -= O[k + E], !(M <= 0)); )
|
|
901
|
+
k++, M <<= 1;
|
|
902
|
+
if (C += 1 << k, i === Rt && C > gi || i === mi && C > bi)
|
|
889
903
|
return 1;
|
|
890
|
-
F =
|
|
904
|
+
F = K & R, n[F] = x << 24 | k << 16 | X - r | 0;
|
|
891
905
|
}
|
|
892
906
|
}
|
|
893
|
-
return
|
|
907
|
+
return K !== 0 && (n[X + K] = o - E << 24 | 64 << 16 | 0), h.bits = x, 0;
|
|
894
908
|
}
|
|
895
|
-
var
|
|
896
|
-
const
|
|
897
|
-
var
|
|
898
|
-
function
|
|
909
|
+
var Mn = 0, Gs = 1, Ws = 2;
|
|
910
|
+
const yi = 4, kt = 0, Tn = 1, Qn = 2, Ke = -2, Ln = -3, Rn = -4, Bn = -5, vi = 8;
|
|
911
|
+
var Zs = 1, ki = 2, Si = 3, Ci = 4, Ei = 5, Ki = 6, Ai = 7, Xi = 8, Fi = 9, Mi = 10, Ti = 11, ue = 12, Bt = 13, Qi = 14, Dt = 15, Li = 16, Ri = 17, Bi = 18, Di = 19, ot = 20, ht = 21, Ii = 22, Pi = 23, Ui = 24, Ni = 25, Hi = 26, It = 27, zi = 28, Oi = 29, N = 30, Dn = 31, In = 32, Pn = 852, Un = 592, Nn = 15, Hn = Nn;
|
|
912
|
+
function Vi(i) {
|
|
899
913
|
return (i >>> 24 & 255) + (i >>> 8 & 65280) + ((i & 65280) << 8) + ((i & 255) << 24);
|
|
900
914
|
}
|
|
901
|
-
function
|
|
915
|
+
function zn() {
|
|
902
916
|
this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new ne(320), this.work = new ne(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
|
|
903
917
|
}
|
|
904
|
-
function
|
|
918
|
+
function On(i) {
|
|
905
919
|
var t;
|
|
906
|
-
return !i || !i.state ? Ke : (t = i.state, i.total_in = i.total_out = t.total = 0, i.msg = "", t.wrap && (i.adler = t.wrap & 1), t.mode =
|
|
920
|
+
return !i || !i.state ? Ke : (t = i.state, i.total_in = i.total_out = t.total = 0, i.msg = "", t.wrap && (i.adler = t.wrap & 1), t.mode = Zs, t.last = 0, t.havedict = 0, t.dmax = 32768, t.head = null, t.hold = 0, t.bits = 0, t.lencode = t.lendyn = new vt(Pn), t.distcode = t.distdyn = new vt(Un), t.sane = 1, t.back = -1, kt);
|
|
907
921
|
}
|
|
908
|
-
function
|
|
922
|
+
function Ys(i) {
|
|
909
923
|
var t;
|
|
910
|
-
return !i || !i.state ? Ke : (t = i.state, t.wsize = 0, t.whave = 0, t.wnext = 0,
|
|
924
|
+
return !i || !i.state ? Ke : (t = i.state, t.wsize = 0, t.whave = 0, t.wnext = 0, On(i));
|
|
911
925
|
}
|
|
912
|
-
function
|
|
926
|
+
function Vn(i, t) {
|
|
913
927
|
var e, s;
|
|
914
|
-
return !i || !i.state || (s = i.state, t < 0 ? (e = 0, t = -t) : (e = (t >> 4) + 1, t < 48 && (t &= 15)), t && (t < 8 || t > 15)) ? Ke : (s.window !== null && s.wbits !== t && (s.window = null), s.wrap = e, s.wbits = t,
|
|
928
|
+
return !i || !i.state || (s = i.state, t < 0 ? (e = 0, t = -t) : (e = (t >> 4) + 1, t < 48 && (t &= 15)), t && (t < 8 || t > 15)) ? Ke : (s.window !== null && s.wbits !== t && (s.window = null), s.wrap = e, s.wbits = t, Ys(i));
|
|
915
929
|
}
|
|
916
|
-
function
|
|
930
|
+
function Gn(i, t) {
|
|
917
931
|
var e, s;
|
|
918
|
-
return i ? (s = new
|
|
932
|
+
return i ? (s = new zn(), i.state = s, s.window = null, e = Vn(i, t), e !== kt && (i.state = null), e) : Ke;
|
|
919
933
|
}
|
|
920
|
-
function
|
|
921
|
-
return
|
|
934
|
+
function Wn(i) {
|
|
935
|
+
return Gn(i, Hn);
|
|
922
936
|
}
|
|
923
|
-
var
|
|
924
|
-
function
|
|
925
|
-
if (
|
|
937
|
+
var Gi = !0, Pt, Ut;
|
|
938
|
+
function Zn(i) {
|
|
939
|
+
if (Gi) {
|
|
926
940
|
var t;
|
|
927
|
-
for (
|
|
941
|
+
for (Pt = new vt(512), Ut = new vt(32), t = 0; t < 144; )
|
|
928
942
|
i.lens[t++] = 8;
|
|
929
943
|
for (; t < 256; )
|
|
930
944
|
i.lens[t++] = 9;
|
|
@@ -932,28 +946,28 @@ function Vn(i) {
|
|
|
932
946
|
i.lens[t++] = 7;
|
|
933
947
|
for (; t < 288; )
|
|
934
948
|
i.lens[t++] = 8;
|
|
935
|
-
for (We(
|
|
949
|
+
for (We(Gs, i.lens, 0, 288, Pt, 0, i.work, { bits: 9 }), t = 0; t < 32; )
|
|
936
950
|
i.lens[t++] = 5;
|
|
937
|
-
We(
|
|
951
|
+
We(Ws, i.lens, 0, 32, Ut, 0, i.work, { bits: 5 }), Gi = !1;
|
|
938
952
|
}
|
|
939
|
-
i.lencode =
|
|
953
|
+
i.lencode = Pt, i.lenbits = 9, i.distcode = Ut, i.distbits = 5;
|
|
940
954
|
}
|
|
941
|
-
function
|
|
955
|
+
function Yn(i, t, e, s) {
|
|
942
956
|
var n, r = i.state;
|
|
943
|
-
return r.window === null && (r.wsize = 1 << r.wbits, r.wnext = 0, r.whave = 0, r.window = new
|
|
957
|
+
return r.window === null && (r.wsize = 1 << r.wbits, r.wnext = 0, r.whave = 0, r.window = new yt(r.wsize)), s >= r.wsize ? (xe(r.window, t, e - r.wsize, r.wsize, 0), r.wnext = 0, r.whave = r.wsize) : (n = r.wsize - r.wnext, n > s && (n = s), xe(r.window, t, e - s, n, r.wnext), s -= n, s ? (xe(r.window, t, e - s, s, 0), r.wnext = s, r.whave = r.wsize) : (r.wnext += n, r.wnext === r.wsize && (r.wnext = 0), r.whave < r.wsize && (r.whave += n))), 0;
|
|
944
958
|
}
|
|
945
|
-
function
|
|
946
|
-
var e, s, n, r, a, h, c, o, l,
|
|
959
|
+
function jn(i, t) {
|
|
960
|
+
var e, s, n, r, a, h, c, o, l, f, d, x, k, E, M = 0, C, K, A, S, F, R, X, I, D = new yt(4), T, O, ee = (
|
|
947
961
|
/* permutation of code lengths */
|
|
948
962
|
[16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]
|
|
949
963
|
);
|
|
950
964
|
if (!i || !i.state || !i.output || !i.input && i.avail_in !== 0)
|
|
951
965
|
return Ke;
|
|
952
|
-
e = i.state, e.mode ===
|
|
966
|
+
e = i.state, e.mode === ue && (e.mode = Bt), a = i.next_out, n = i.output, c = i.avail_out, r = i.next_in, s = i.input, h = i.avail_in, o = e.hold, l = e.bits, f = h, d = c, I = kt;
|
|
953
967
|
e:
|
|
954
968
|
for (; ; )
|
|
955
969
|
switch (e.mode) {
|
|
956
|
-
case
|
|
970
|
+
case Zs:
|
|
957
971
|
if (e.wrap === 0) {
|
|
958
972
|
e.mode = Bt;
|
|
959
973
|
break;
|
|
@@ -964,7 +978,7 @@ function Wn(i, t) {
|
|
|
964
978
|
h--, o += s[r++] << l, l += 8;
|
|
965
979
|
}
|
|
966
980
|
if (e.wrap & 2 && o === 35615) {
|
|
967
|
-
e.check = 0,
|
|
981
|
+
e.check = 0, D[0] = o & 255, D[1] = o >>> 8 & 255, e.check = W(e.check), o = 0, l = 0, e.mode = ki;
|
|
968
982
|
break;
|
|
969
983
|
}
|
|
970
984
|
if (e.flags = 0, e.head && (e.head.done = !1), !(e.wrap & 1) || /* check if zlib header allowed */
|
|
@@ -972,25 +986,25 @@ function Wn(i, t) {
|
|
|
972
986
|
i.msg = "incorrect header check", e.mode = N;
|
|
973
987
|
break;
|
|
974
988
|
}
|
|
975
|
-
if ((o & 15) !==
|
|
989
|
+
if ((o & 15) !== vi) {
|
|
976
990
|
i.msg = "unknown compression method", e.mode = N;
|
|
977
991
|
break;
|
|
978
992
|
}
|
|
979
|
-
if (o >>>= 4, l -= 4,
|
|
980
|
-
e.wbits =
|
|
981
|
-
else if (
|
|
993
|
+
if (o >>>= 4, l -= 4, X = (o & 15) + 8, e.wbits === 0)
|
|
994
|
+
e.wbits = X;
|
|
995
|
+
else if (X > e.wbits) {
|
|
982
996
|
i.msg = "invalid window size", e.mode = N;
|
|
983
997
|
break;
|
|
984
998
|
}
|
|
985
|
-
e.dmax = 1 <<
|
|
999
|
+
e.dmax = 1 << X, i.adler = e.check = 1, e.mode = o & 512 ? Mi : ue, o = 0, l = 0;
|
|
986
1000
|
break;
|
|
987
|
-
case
|
|
1001
|
+
case ki:
|
|
988
1002
|
for (; l < 16; ) {
|
|
989
1003
|
if (h === 0)
|
|
990
1004
|
break e;
|
|
991
1005
|
h--, o += s[r++] << l, l += 8;
|
|
992
1006
|
}
|
|
993
|
-
if (e.flags = o, (e.flags & 255) !==
|
|
1007
|
+
if (e.flags = o, (e.flags & 255) !== vi) {
|
|
994
1008
|
i.msg = "unknown compression method", e.mode = N;
|
|
995
1009
|
break;
|
|
996
1010
|
}
|
|
@@ -998,23 +1012,23 @@ function Wn(i, t) {
|
|
|
998
1012
|
i.msg = "unknown header flags set", e.mode = N;
|
|
999
1013
|
break;
|
|
1000
1014
|
}
|
|
1001
|
-
e.head && (e.head.text = o >> 8 & 1), e.flags & 512 && (
|
|
1015
|
+
e.head && (e.head.text = o >> 8 & 1), e.flags & 512 && (D[0] = o & 255, D[1] = o >>> 8 & 255, e.check = W(e.check)), o = 0, l = 0, e.mode = Si;
|
|
1002
1016
|
/* falls through */
|
|
1003
|
-
case
|
|
1017
|
+
case Si:
|
|
1004
1018
|
for (; l < 32; ) {
|
|
1005
1019
|
if (h === 0)
|
|
1006
1020
|
break e;
|
|
1007
1021
|
h--, o += s[r++] << l, l += 8;
|
|
1008
1022
|
}
|
|
1009
|
-
e.head && (e.head.time = o), e.flags & 512 && (
|
|
1023
|
+
e.head && (e.head.time = o), e.flags & 512 && (D[0] = o & 255, D[1] = o >>> 8 & 255, D[2] = o >>> 16 & 255, D[3] = o >>> 24 & 255, e.check = W(e.check)), o = 0, l = 0, e.mode = Ci;
|
|
1010
1024
|
/* falls through */
|
|
1011
|
-
case
|
|
1025
|
+
case Ci:
|
|
1012
1026
|
for (; l < 16; ) {
|
|
1013
1027
|
if (h === 0)
|
|
1014
1028
|
break e;
|
|
1015
1029
|
h--, o += s[r++] << l, l += 8;
|
|
1016
1030
|
}
|
|
1017
|
-
e.head && (e.head.xflags = o & 255, e.head.os = o >> 8), e.flags & 512 && (
|
|
1031
|
+
e.head && (e.head.xflags = o & 255, e.head.os = o >> 8), e.flags & 512 && (D[0] = o & 255, D[1] = o >>> 8 & 255, e.check = W(e.check)), o = 0, l = 0, e.mode = Ei;
|
|
1018
1032
|
/* falls through */
|
|
1019
1033
|
case Ei:
|
|
1020
1034
|
if (e.flags & 1024) {
|
|
@@ -1023,12 +1037,12 @@ function Wn(i, t) {
|
|
|
1023
1037
|
break e;
|
|
1024
1038
|
h--, o += s[r++] << l, l += 8;
|
|
1025
1039
|
}
|
|
1026
|
-
e.length = o, e.head && (e.head.extra_len = o), e.flags & 512 && (
|
|
1040
|
+
e.length = o, e.head && (e.head.extra_len = o), e.flags & 512 && (D[0] = o & 255, D[1] = o >>> 8 & 255, e.check = W(e.check)), o = 0, l = 0;
|
|
1027
1041
|
} else e.head && (e.head.extra = null);
|
|
1028
|
-
e.mode =
|
|
1042
|
+
e.mode = Ki;
|
|
1029
1043
|
/* falls through */
|
|
1030
|
-
case
|
|
1031
|
-
if (e.flags & 1024 && (x = e.length, x > h && (x = h), x && (e.head && (
|
|
1044
|
+
case Ki:
|
|
1045
|
+
if (e.flags & 1024 && (x = e.length, x > h && (x = h), x && (e.head && (X = e.head.extra_len - e.length, e.head.extra || (e.head.extra = new Array(e.head.extra_len)), xe(
|
|
1032
1046
|
e.head.extra,
|
|
1033
1047
|
s,
|
|
1034
1048
|
r,
|
|
@@ -1036,38 +1050,38 @@ function Wn(i, t) {
|
|
|
1036
1050
|
// - no need for additional size check
|
|
1037
1051
|
x,
|
|
1038
1052
|
/*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
|
|
1039
|
-
|
|
1053
|
+
X
|
|
1040
1054
|
)), e.flags & 512 && (e.check = W(e.check)), h -= x, r += x, e.length -= x), e.length))
|
|
1041
1055
|
break e;
|
|
1042
|
-
e.length = 0, e.mode =
|
|
1056
|
+
e.length = 0, e.mode = Ai;
|
|
1043
1057
|
/* falls through */
|
|
1044
|
-
case
|
|
1058
|
+
case Ai:
|
|
1045
1059
|
if (e.flags & 2048) {
|
|
1046
1060
|
if (h === 0)
|
|
1047
1061
|
break e;
|
|
1048
1062
|
x = 0;
|
|
1049
1063
|
do
|
|
1050
|
-
|
|
1051
|
-
while (
|
|
1052
|
-
if (e.flags & 512 && (e.check = W(e.check)), h -= x, r += x,
|
|
1064
|
+
X = s[r + x++], e.head && X && e.length < 65536 && (e.head.name += String.fromCharCode(X));
|
|
1065
|
+
while (X && x < h);
|
|
1066
|
+
if (e.flags & 512 && (e.check = W(e.check)), h -= x, r += x, X)
|
|
1053
1067
|
break e;
|
|
1054
1068
|
} else e.head && (e.head.name = null);
|
|
1055
|
-
e.length = 0, e.mode =
|
|
1069
|
+
e.length = 0, e.mode = Xi;
|
|
1056
1070
|
/* falls through */
|
|
1057
|
-
case
|
|
1071
|
+
case Xi:
|
|
1058
1072
|
if (e.flags & 4096) {
|
|
1059
1073
|
if (h === 0)
|
|
1060
1074
|
break e;
|
|
1061
1075
|
x = 0;
|
|
1062
1076
|
do
|
|
1063
|
-
|
|
1064
|
-
while (
|
|
1065
|
-
if (e.flags & 512 && (e.check = W(e.check)), h -= x, r += x,
|
|
1077
|
+
X = s[r + x++], e.head && X && e.length < 65536 && (e.head.comment += String.fromCharCode(X));
|
|
1078
|
+
while (X && x < h);
|
|
1079
|
+
if (e.flags & 512 && (e.check = W(e.check)), h -= x, r += x, X)
|
|
1066
1080
|
break e;
|
|
1067
1081
|
} else e.head && (e.head.comment = null);
|
|
1068
|
-
e.mode =
|
|
1082
|
+
e.mode = Fi;
|
|
1069
1083
|
/* falls through */
|
|
1070
|
-
case
|
|
1084
|
+
case Fi:
|
|
1071
1085
|
if (e.flags & 512) {
|
|
1072
1086
|
for (; l < 16; ) {
|
|
1073
1087
|
if (h === 0)
|
|
@@ -1080,26 +1094,26 @@ function Wn(i, t) {
|
|
|
1080
1094
|
}
|
|
1081
1095
|
o = 0, l = 0;
|
|
1082
1096
|
}
|
|
1083
|
-
e.head && (e.head.hcrc = e.flags >> 9 & 1, e.head.done = !0), i.adler = e.check = 0, e.mode =
|
|
1097
|
+
e.head && (e.head.hcrc = e.flags >> 9 & 1, e.head.done = !0), i.adler = e.check = 0, e.mode = ue;
|
|
1084
1098
|
break;
|
|
1085
|
-
case
|
|
1099
|
+
case Mi:
|
|
1086
1100
|
for (; l < 32; ) {
|
|
1087
1101
|
if (h === 0)
|
|
1088
1102
|
break e;
|
|
1089
1103
|
h--, o += s[r++] << l, l += 8;
|
|
1090
1104
|
}
|
|
1091
|
-
i.adler = e.check =
|
|
1105
|
+
i.adler = e.check = Vi(o), o = 0, l = 0, e.mode = Ti;
|
|
1092
1106
|
/* falls through */
|
|
1093
|
-
case
|
|
1107
|
+
case Ti:
|
|
1094
1108
|
if (e.havedict === 0)
|
|
1095
|
-
return i.next_out = a, i.avail_out = c, i.next_in = r, i.avail_in = h, e.hold = o, e.bits = l,
|
|
1096
|
-
i.adler = e.check = 1, e.mode =
|
|
1109
|
+
return i.next_out = a, i.avail_out = c, i.next_in = r, i.avail_in = h, e.hold = o, e.bits = l, Qn;
|
|
1110
|
+
i.adler = e.check = 1, e.mode = ue;
|
|
1097
1111
|
/* falls through */
|
|
1098
|
-
case
|
|
1112
|
+
case ue:
|
|
1099
1113
|
/* falls through */
|
|
1100
1114
|
case Bt:
|
|
1101
1115
|
if (e.last) {
|
|
1102
|
-
o >>>= l & 7, l -= l & 7, e.mode =
|
|
1116
|
+
o >>>= l & 7, l -= l & 7, e.mode = It;
|
|
1103
1117
|
break;
|
|
1104
1118
|
}
|
|
1105
1119
|
for (; l < 3; ) {
|
|
@@ -1112,10 +1126,10 @@ function Wn(i, t) {
|
|
|
1112
1126
|
e.mode = Qi;
|
|
1113
1127
|
break;
|
|
1114
1128
|
case 1:
|
|
1115
|
-
|
|
1129
|
+
Zn(e), e.mode = ot;
|
|
1116
1130
|
break;
|
|
1117
1131
|
case 2:
|
|
1118
|
-
e.mode =
|
|
1132
|
+
e.mode = Ri;
|
|
1119
1133
|
break;
|
|
1120
1134
|
case 3:
|
|
1121
1135
|
i.msg = "invalid block type", e.mode = N;
|
|
@@ -1132,21 +1146,21 @@ function Wn(i, t) {
|
|
|
1132
1146
|
i.msg = "invalid stored block lengths", e.mode = N;
|
|
1133
1147
|
break;
|
|
1134
1148
|
}
|
|
1135
|
-
e.length = o & 65535, o = 0, l = 0, e.mode =
|
|
1149
|
+
e.length = o & 65535, o = 0, l = 0, e.mode = Dt;
|
|
1136
1150
|
/* falls through */
|
|
1137
|
-
case
|
|
1138
|
-
e.mode =
|
|
1151
|
+
case Dt:
|
|
1152
|
+
e.mode = Li;
|
|
1139
1153
|
/* falls through */
|
|
1140
|
-
case
|
|
1154
|
+
case Li:
|
|
1141
1155
|
if (x = e.length, x) {
|
|
1142
1156
|
if (x > h && (x = h), x > c && (x = c), x === 0)
|
|
1143
1157
|
break e;
|
|
1144
1158
|
xe(n, s, r, x, a), h -= x, r += x, c -= x, a += x, e.length -= x;
|
|
1145
1159
|
break;
|
|
1146
1160
|
}
|
|
1147
|
-
e.mode =
|
|
1161
|
+
e.mode = ue;
|
|
1148
1162
|
break;
|
|
1149
|
-
case
|
|
1163
|
+
case Ri:
|
|
1150
1164
|
for (; l < 14; ) {
|
|
1151
1165
|
if (h === 0)
|
|
1152
1166
|
break e;
|
|
@@ -1169,15 +1183,15 @@ function Wn(i, t) {
|
|
|
1169
1183
|
}
|
|
1170
1184
|
for (; e.have < 19; )
|
|
1171
1185
|
e.lens[ee[e.have++]] = 0;
|
|
1172
|
-
if (e.lencode = e.lendyn, e.lenbits = 7,
|
|
1186
|
+
if (e.lencode = e.lendyn, e.lenbits = 7, T = { bits: e.lenbits }, I = We(Mn, e.lens, 0, 19, e.lencode, 0, e.work, T), e.lenbits = T.bits, I) {
|
|
1173
1187
|
i.msg = "invalid code lengths set", e.mode = N;
|
|
1174
1188
|
break;
|
|
1175
1189
|
}
|
|
1176
|
-
e.have = 0, e.mode =
|
|
1190
|
+
e.have = 0, e.mode = Di;
|
|
1177
1191
|
/* falls through */
|
|
1178
|
-
case
|
|
1192
|
+
case Di:
|
|
1179
1193
|
for (; e.have < e.nlen + e.ndist; ) {
|
|
1180
|
-
for (;
|
|
1194
|
+
for (; M = e.lencode[o & (1 << e.lenbits) - 1], C = M >>> 24, K = M >>> 16 & 255, A = M & 65535, !(C <= l); ) {
|
|
1181
1195
|
if (h === 0)
|
|
1182
1196
|
break e;
|
|
1183
1197
|
h--, o += s[r++] << l, l += 8;
|
|
@@ -1195,28 +1209,28 @@ function Wn(i, t) {
|
|
|
1195
1209
|
i.msg = "invalid bit length repeat", e.mode = N;
|
|
1196
1210
|
break;
|
|
1197
1211
|
}
|
|
1198
|
-
|
|
1212
|
+
X = e.lens[e.have - 1], x = 3 + (o & 3), o >>>= 2, l -= 2;
|
|
1199
1213
|
} else if (A === 17) {
|
|
1200
1214
|
for (O = C + 3; l < O; ) {
|
|
1201
1215
|
if (h === 0)
|
|
1202
1216
|
break e;
|
|
1203
1217
|
h--, o += s[r++] << l, l += 8;
|
|
1204
1218
|
}
|
|
1205
|
-
o >>>= C, l -= C,
|
|
1219
|
+
o >>>= C, l -= C, X = 0, x = 3 + (o & 7), o >>>= 3, l -= 3;
|
|
1206
1220
|
} else {
|
|
1207
1221
|
for (O = C + 7; l < O; ) {
|
|
1208
1222
|
if (h === 0)
|
|
1209
1223
|
break e;
|
|
1210
1224
|
h--, o += s[r++] << l, l += 8;
|
|
1211
1225
|
}
|
|
1212
|
-
o >>>= C, l -= C,
|
|
1226
|
+
o >>>= C, l -= C, X = 0, x = 11 + (o & 127), o >>>= 7, l -= 7;
|
|
1213
1227
|
}
|
|
1214
1228
|
if (e.have + x > e.nlen + e.ndist) {
|
|
1215
1229
|
i.msg = "invalid bit length repeat", e.mode = N;
|
|
1216
1230
|
break;
|
|
1217
1231
|
}
|
|
1218
1232
|
for (; x--; )
|
|
1219
|
-
e.lens[e.have++] =
|
|
1233
|
+
e.lens[e.have++] = X;
|
|
1220
1234
|
}
|
|
1221
1235
|
}
|
|
1222
1236
|
if (e.mode === N)
|
|
@@ -1225,11 +1239,11 @@ function Wn(i, t) {
|
|
|
1225
1239
|
i.msg = "invalid code -- missing end-of-block", e.mode = N;
|
|
1226
1240
|
break;
|
|
1227
1241
|
}
|
|
1228
|
-
if (e.lenbits = 9,
|
|
1242
|
+
if (e.lenbits = 9, T = { bits: e.lenbits }, I = We(Gs, e.lens, 0, e.nlen, e.lencode, 0, e.work, T), e.lenbits = T.bits, I) {
|
|
1229
1243
|
i.msg = "invalid literal/lengths set", e.mode = N;
|
|
1230
1244
|
break;
|
|
1231
1245
|
}
|
|
1232
|
-
if (e.distbits = 6, e.distcode = e.distdyn,
|
|
1246
|
+
if (e.distbits = 6, e.distcode = e.distdyn, T = { bits: e.distbits }, I = We(Ws, e.lens, e.nlen, e.ndist, e.distcode, 0, e.work, T), e.distbits = T.bits, I) {
|
|
1233
1247
|
i.msg = "invalid distances set", e.mode = N;
|
|
1234
1248
|
break;
|
|
1235
1249
|
}
|
|
@@ -1240,37 +1254,37 @@ function Wn(i, t) {
|
|
|
1240
1254
|
/* falls through */
|
|
1241
1255
|
case ht:
|
|
1242
1256
|
if (h >= 6 && c >= 258) {
|
|
1243
|
-
i.next_out = a, i.avail_out = c, i.next_in = r, i.avail_in = h, e.hold = o, e.bits = l,
|
|
1257
|
+
i.next_out = a, i.avail_out = c, i.next_in = r, i.avail_in = h, e.hold = o, e.bits = l, En(i, d), a = i.next_out, n = i.output, c = i.avail_out, r = i.next_in, s = i.input, h = i.avail_in, o = e.hold, l = e.bits, e.mode === ue && (e.back = -1);
|
|
1244
1258
|
break;
|
|
1245
1259
|
}
|
|
1246
|
-
for (e.back = 0;
|
|
1260
|
+
for (e.back = 0; M = e.lencode[o & (1 << e.lenbits) - 1], C = M >>> 24, K = M >>> 16 & 255, A = M & 65535, !(C <= l); ) {
|
|
1247
1261
|
if (h === 0)
|
|
1248
1262
|
break e;
|
|
1249
1263
|
h--, o += s[r++] << l, l += 8;
|
|
1250
1264
|
}
|
|
1251
|
-
if (
|
|
1252
|
-
for (S = C, F =
|
|
1265
|
+
if (K && (K & 240) === 0) {
|
|
1266
|
+
for (S = C, F = K, R = A; M = e.lencode[R + ((o & (1 << S + F) - 1) >> S)], C = M >>> 24, K = M >>> 16 & 255, A = M & 65535, !(S + C <= l); ) {
|
|
1253
1267
|
if (h === 0)
|
|
1254
1268
|
break e;
|
|
1255
1269
|
h--, o += s[r++] << l, l += 8;
|
|
1256
1270
|
}
|
|
1257
1271
|
o >>>= S, l -= S, e.back += S;
|
|
1258
1272
|
}
|
|
1259
|
-
if (o >>>= C, l -= C, e.back += C, e.length = A,
|
|
1260
|
-
e.mode =
|
|
1273
|
+
if (o >>>= C, l -= C, e.back += C, e.length = A, K === 0) {
|
|
1274
|
+
e.mode = Hi;
|
|
1261
1275
|
break;
|
|
1262
1276
|
}
|
|
1263
|
-
if (
|
|
1264
|
-
e.back = -1, e.mode =
|
|
1277
|
+
if (K & 32) {
|
|
1278
|
+
e.back = -1, e.mode = ue;
|
|
1265
1279
|
break;
|
|
1266
1280
|
}
|
|
1267
|
-
if (
|
|
1281
|
+
if (K & 64) {
|
|
1268
1282
|
i.msg = "invalid literal/length code", e.mode = N;
|
|
1269
1283
|
break;
|
|
1270
1284
|
}
|
|
1271
|
-
e.extra =
|
|
1285
|
+
e.extra = K & 15, e.mode = Ii;
|
|
1272
1286
|
/* falls through */
|
|
1273
|
-
case
|
|
1287
|
+
case Ii:
|
|
1274
1288
|
if (e.extra) {
|
|
1275
1289
|
for (O = e.extra; l < O; ) {
|
|
1276
1290
|
if (h === 0)
|
|
@@ -1279,29 +1293,29 @@ function Wn(i, t) {
|
|
|
1279
1293
|
}
|
|
1280
1294
|
e.length += o & (1 << e.extra) - 1, o >>>= e.extra, l -= e.extra, e.back += e.extra;
|
|
1281
1295
|
}
|
|
1282
|
-
e.was = e.length, e.mode =
|
|
1296
|
+
e.was = e.length, e.mode = Pi;
|
|
1283
1297
|
/* falls through */
|
|
1284
|
-
case
|
|
1285
|
-
for (;
|
|
1298
|
+
case Pi:
|
|
1299
|
+
for (; M = e.distcode[o & (1 << e.distbits) - 1], C = M >>> 24, K = M >>> 16 & 255, A = M & 65535, !(C <= l); ) {
|
|
1286
1300
|
if (h === 0)
|
|
1287
1301
|
break e;
|
|
1288
1302
|
h--, o += s[r++] << l, l += 8;
|
|
1289
1303
|
}
|
|
1290
|
-
if ((
|
|
1291
|
-
for (S = C, F =
|
|
1304
|
+
if ((K & 240) === 0) {
|
|
1305
|
+
for (S = C, F = K, R = A; M = e.distcode[R + ((o & (1 << S + F) - 1) >> S)], C = M >>> 24, K = M >>> 16 & 255, A = M & 65535, !(S + C <= l); ) {
|
|
1292
1306
|
if (h === 0)
|
|
1293
1307
|
break e;
|
|
1294
1308
|
h--, o += s[r++] << l, l += 8;
|
|
1295
1309
|
}
|
|
1296
1310
|
o >>>= S, l -= S, e.back += S;
|
|
1297
1311
|
}
|
|
1298
|
-
if (o >>>= C, l -= C, e.back += C,
|
|
1312
|
+
if (o >>>= C, l -= C, e.back += C, K & 64) {
|
|
1299
1313
|
i.msg = "invalid distance code", e.mode = N;
|
|
1300
1314
|
break;
|
|
1301
1315
|
}
|
|
1302
|
-
e.offset = A, e.extra =
|
|
1316
|
+
e.offset = A, e.extra = K & 15, e.mode = Ui;
|
|
1303
1317
|
/* falls through */
|
|
1304
|
-
case
|
|
1318
|
+
case Ui:
|
|
1305
1319
|
if (e.extra) {
|
|
1306
1320
|
for (O = e.extra; l < O; ) {
|
|
1307
1321
|
if (h === 0)
|
|
@@ -1314,9 +1328,9 @@ function Wn(i, t) {
|
|
|
1314
1328
|
i.msg = "invalid distance too far back", e.mode = N;
|
|
1315
1329
|
break;
|
|
1316
1330
|
}
|
|
1317
|
-
e.mode =
|
|
1331
|
+
e.mode = Ni;
|
|
1318
1332
|
/* falls through */
|
|
1319
|
-
case
|
|
1333
|
+
case Ni:
|
|
1320
1334
|
if (c === 0)
|
|
1321
1335
|
break e;
|
|
1322
1336
|
if (x = d - c, e.offset > x) {
|
|
@@ -1333,12 +1347,12 @@ function Wn(i, t) {
|
|
|
1333
1347
|
while (--x);
|
|
1334
1348
|
e.length === 0 && (e.mode = ht);
|
|
1335
1349
|
break;
|
|
1336
|
-
case
|
|
1350
|
+
case Hi:
|
|
1337
1351
|
if (c === 0)
|
|
1338
1352
|
break e;
|
|
1339
1353
|
n[a++] = e.length, c--, e.mode = ht;
|
|
1340
1354
|
break;
|
|
1341
|
-
case
|
|
1355
|
+
case It:
|
|
1342
1356
|
if (e.wrap) {
|
|
1343
1357
|
for (; l < 32; ) {
|
|
1344
1358
|
if (h === 0)
|
|
@@ -1346,15 +1360,15 @@ function Wn(i, t) {
|
|
|
1346
1360
|
h--, o |= s[r++] << l, l += 8;
|
|
1347
1361
|
}
|
|
1348
1362
|
if (d -= c, i.total_out += d, e.total += d, d && (i.adler = e.check = /*UPDATE(state.check, put - _out, _out);*/
|
|
1349
|
-
e.flags ? W(e.check) :
|
|
1363
|
+
e.flags ? W(e.check) : ii(e.check, n, d, a - d)), d = c, (e.flags ? o : Vi(o)) !== e.check) {
|
|
1350
1364
|
i.msg = "incorrect data check", e.mode = N;
|
|
1351
1365
|
break;
|
|
1352
1366
|
}
|
|
1353
1367
|
o = 0, l = 0;
|
|
1354
1368
|
}
|
|
1355
|
-
e.mode =
|
|
1369
|
+
e.mode = zi;
|
|
1356
1370
|
/* falls through */
|
|
1357
|
-
case
|
|
1371
|
+
case zi:
|
|
1358
1372
|
if (e.wrap && e.flags) {
|
|
1359
1373
|
for (; l < 32; ) {
|
|
1360
1374
|
if (h === 0)
|
|
@@ -1367,86 +1381,86 @@ function Wn(i, t) {
|
|
|
1367
1381
|
}
|
|
1368
1382
|
o = 0, l = 0;
|
|
1369
1383
|
}
|
|
1370
|
-
e.mode =
|
|
1384
|
+
e.mode = Oi;
|
|
1371
1385
|
/* falls through */
|
|
1372
|
-
case
|
|
1373
|
-
|
|
1386
|
+
case Oi:
|
|
1387
|
+
I = Tn;
|
|
1374
1388
|
break e;
|
|
1375
1389
|
case N:
|
|
1376
|
-
|
|
1390
|
+
I = Ln;
|
|
1377
1391
|
break e;
|
|
1378
|
-
case
|
|
1379
|
-
return
|
|
1380
|
-
case
|
|
1392
|
+
case Dn:
|
|
1393
|
+
return Rn;
|
|
1394
|
+
case In:
|
|
1381
1395
|
/* falls through */
|
|
1382
1396
|
default:
|
|
1383
1397
|
return Ke;
|
|
1384
1398
|
}
|
|
1385
|
-
return i.next_out = a, i.avail_out = c, i.next_in = r, i.avail_in = h, e.hold = o, e.bits = l, (e.wsize || d !== i.avail_out && e.mode < N && (e.mode <
|
|
1386
|
-
e.flags ? W(e.check, n, d, i.next_out - d) :
|
|
1399
|
+
return i.next_out = a, i.avail_out = c, i.next_in = r, i.avail_in = h, e.hold = o, e.bits = l, (e.wsize || d !== i.avail_out && e.mode < N && (e.mode < It || t !== yi)) && Yn(i, i.output, i.next_out, d - i.avail_out), f -= i.avail_in, d -= i.avail_out, i.total_in += f, i.total_out += d, e.total += d, e.wrap && d && (i.adler = e.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
|
|
1400
|
+
e.flags ? W(e.check, n, d, i.next_out - d) : ii(e.check, n, d, i.next_out - d)), i.data_type = e.bits + (e.last ? 64 : 0) + (e.mode === ue ? 128 : 0) + (e.mode === ot || e.mode === Dt ? 256 : 0), (f === 0 && d === 0 || t === yi) && I === kt && (I = Bn), I;
|
|
1387
1401
|
}
|
|
1388
|
-
function
|
|
1402
|
+
function js() {
|
|
1389
1403
|
this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0;
|
|
1390
1404
|
}
|
|
1391
|
-
class
|
|
1405
|
+
class Xt {
|
|
1392
1406
|
constructor() {
|
|
1393
|
-
this.strm = new
|
|
1407
|
+
this.strm = new js(), this.chunkSize = 1024 * 10 * 10, this.strm.output = new Uint8Array(this.chunkSize), Wn(this.strm);
|
|
1394
1408
|
}
|
|
1395
1409
|
setInput(t) {
|
|
1396
1410
|
t ? (this.strm.input = t, this.strm.avail_in = this.strm.input.length, this.strm.next_in = 0) : (this.strm.input = null, this.strm.avail_in = 0, this.strm.next_in = 0);
|
|
1397
1411
|
}
|
|
1398
1412
|
inflate(t) {
|
|
1399
|
-
if (t > this.chunkSize && (this.chunkSize = t, this.strm.output = new Uint8Array(this.chunkSize)), this.strm.next_out = 0, this.strm.avail_out = t,
|
|
1413
|
+
if (t > this.chunkSize && (this.chunkSize = t, this.strm.output = new Uint8Array(this.chunkSize)), this.strm.next_out = 0, this.strm.avail_out = t, jn(this.strm, 0) < 0)
|
|
1400
1414
|
throw new Error("zlib inflate failed");
|
|
1401
1415
|
if (this.strm.next_out != t)
|
|
1402
1416
|
throw new Error("Incomplete zlib block");
|
|
1403
1417
|
return new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);
|
|
1404
1418
|
}
|
|
1405
1419
|
reset() {
|
|
1406
|
-
|
|
1420
|
+
Ys(this.strm);
|
|
1407
1421
|
}
|
|
1408
1422
|
}
|
|
1409
|
-
var
|
|
1423
|
+
var qn = 4, Wi = 0, Zi = 1, Jn = 2;
|
|
1410
1424
|
function Ie(i) {
|
|
1411
1425
|
for (var t = i.length; --t >= 0; )
|
|
1412
1426
|
i[t] = 0;
|
|
1413
1427
|
}
|
|
1414
|
-
var
|
|
1428
|
+
var $n = 0, er = 1, tr = 2, ir = 3, sr = 258, oi = 29, tt = 256, je = tt + 1 + oi, Be = 30, hi = 19, qs = 2 * je + 1, Ee = 15, Nt = 16, nr = 7, Js = 256, $s = 16, en = 17, tn = 18, si = (
|
|
1415
1429
|
/* extra bits for each length code */
|
|
1416
1430
|
[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0]
|
|
1417
|
-
),
|
|
1431
|
+
), bt = (
|
|
1418
1432
|
/* extra bits for each distance code */
|
|
1419
1433
|
[0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13]
|
|
1420
|
-
),
|
|
1434
|
+
), rr = (
|
|
1421
1435
|
/* extra bits for each bit length code */
|
|
1422
1436
|
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7]
|
|
1423
|
-
),
|
|
1437
|
+
), sn = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], ar = 512, ge = new Array((je + 2) * 2);
|
|
1424
1438
|
Ie(ge);
|
|
1425
|
-
var Ze = new Array(
|
|
1439
|
+
var Ze = new Array(Be * 2);
|
|
1426
1440
|
Ie(Ze);
|
|
1427
|
-
var qe = new Array(
|
|
1441
|
+
var qe = new Array(ar);
|
|
1428
1442
|
Ie(qe);
|
|
1429
|
-
var Je = new Array(
|
|
1443
|
+
var Je = new Array(sr - ir + 1);
|
|
1430
1444
|
Ie(Je);
|
|
1431
|
-
var
|
|
1432
|
-
Ie(
|
|
1433
|
-
var
|
|
1434
|
-
Ie(
|
|
1435
|
-
function
|
|
1445
|
+
var li = new Array(oi);
|
|
1446
|
+
Ie(li);
|
|
1447
|
+
var St = new Array(Be);
|
|
1448
|
+
Ie(St);
|
|
1449
|
+
function Ht(i, t, e, s, n) {
|
|
1436
1450
|
this.static_tree = i, this.extra_bits = t, this.extra_base = e, this.elems = s, this.max_length = n, this.has_stree = i && i.length;
|
|
1437
1451
|
}
|
|
1438
|
-
var
|
|
1439
|
-
function
|
|
1452
|
+
var nn, rn, an;
|
|
1453
|
+
function zt(i, t) {
|
|
1440
1454
|
this.dyn_tree = i, this.max_code = 0, this.stat_desc = t;
|
|
1441
1455
|
}
|
|
1442
|
-
function
|
|
1456
|
+
function on(i) {
|
|
1443
1457
|
return i < 256 ? qe[i] : qe[256 + (i >>> 7)];
|
|
1444
1458
|
}
|
|
1445
|
-
function
|
|
1459
|
+
function Ct(i, t) {
|
|
1446
1460
|
i.pending_buf[i.pending++] = t & 255, i.pending_buf[i.pending++] = t >>> 8 & 255;
|
|
1447
1461
|
}
|
|
1448
1462
|
function se(i, t, e) {
|
|
1449
|
-
i.bi_valid >
|
|
1463
|
+
i.bi_valid > Nt - e ? (i.bi_buf |= t << i.bi_valid & 65535, Ct(i, i.bi_buf), i.bi_buf = t >> Nt - i.bi_valid, i.bi_valid += e - Nt) : (i.bi_buf |= t << i.bi_valid & 65535, i.bi_valid += e);
|
|
1450
1464
|
}
|
|
1451
1465
|
function de(i, t, e) {
|
|
1452
1466
|
se(
|
|
@@ -1456,18 +1470,18 @@ function de(i, t, e) {
|
|
|
1456
1470
|
/*.Len*/
|
|
1457
1471
|
);
|
|
1458
1472
|
}
|
|
1459
|
-
function
|
|
1473
|
+
function hn(i, t) {
|
|
1460
1474
|
var e = 0;
|
|
1461
1475
|
do
|
|
1462
1476
|
e |= i & 1, i >>>= 1, e <<= 1;
|
|
1463
1477
|
while (--t > 0);
|
|
1464
1478
|
return e >>> 1;
|
|
1465
1479
|
}
|
|
1466
|
-
function
|
|
1467
|
-
var e = t.dyn_tree, s = t.max_code, n = t.stat_desc.static_tree, r = t.stat_desc.has_stree, a = t.stat_desc.extra_bits, h = t.stat_desc.extra_base, c = t.stat_desc.max_length, o, l,
|
|
1468
|
-
for (d = 0; d <=
|
|
1480
|
+
function or(i, t) {
|
|
1481
|
+
var e = t.dyn_tree, s = t.max_code, n = t.stat_desc.static_tree, r = t.stat_desc.has_stree, a = t.stat_desc.extra_bits, h = t.stat_desc.extra_base, c = t.stat_desc.max_length, o, l, f, d, x, k, E = 0;
|
|
1482
|
+
for (d = 0; d <= Ee; d++)
|
|
1469
1483
|
i.bl_count[d] = 0;
|
|
1470
|
-
for (e[i.heap[i.heap_max] * 2 + 1] = 0, o = i.heap_max + 1; o <
|
|
1484
|
+
for (e[i.heap[i.heap_max] * 2 + 1] = 0, o = i.heap_max + 1; o < qs; o++)
|
|
1471
1485
|
l = i.heap[o], d = e[e[l * 2 + 1] * 2 + 1] + 1, d > c && (d = c, E++), e[l * 2 + 1] = d, !(l > s) && (i.bl_count[d]++, x = 0, l >= h && (x = a[l - h]), k = e[l * 2], i.opt_len += k * (d + x), r && (i.static_len += k * (n[l * 2 + 1] + x)));
|
|
1472
1486
|
if (E !== 0) {
|
|
1473
1487
|
do {
|
|
@@ -1477,30 +1491,30 @@ function nr(i, t) {
|
|
|
1477
1491
|
} while (E > 0);
|
|
1478
1492
|
for (d = c; d !== 0; d--)
|
|
1479
1493
|
for (l = i.bl_count[d]; l !== 0; )
|
|
1480
|
-
|
|
1494
|
+
f = i.heap[--o], !(f > s) && (e[f * 2 + 1] !== d && (i.opt_len += (d - e[f * 2 + 1]) * e[f * 2], e[f * 2 + 1] = d), l--);
|
|
1481
1495
|
}
|
|
1482
1496
|
}
|
|
1483
|
-
function
|
|
1484
|
-
var s = new Array(
|
|
1485
|
-
for (r = 1; r <=
|
|
1497
|
+
function ln(i, t, e) {
|
|
1498
|
+
var s = new Array(Ee + 1), n = 0, r, a;
|
|
1499
|
+
for (r = 1; r <= Ee; r++)
|
|
1486
1500
|
s[r] = n = n + e[r - 1] << 1;
|
|
1487
1501
|
for (a = 0; a <= t; a++) {
|
|
1488
1502
|
var h = i[a * 2 + 1];
|
|
1489
|
-
h !== 0 && (i[a * 2] =
|
|
1503
|
+
h !== 0 && (i[a * 2] = hn(s[h]++, h));
|
|
1490
1504
|
}
|
|
1491
1505
|
}
|
|
1492
|
-
function
|
|
1493
|
-
var i, t, e, s, n, r = new Array(
|
|
1494
|
-
for (e = 0, s = 0; s <
|
|
1495
|
-
for (
|
|
1506
|
+
function hr() {
|
|
1507
|
+
var i, t, e, s, n, r = new Array(Ee + 1);
|
|
1508
|
+
for (e = 0, s = 0; s < oi - 1; s++)
|
|
1509
|
+
for (li[s] = e, i = 0; i < 1 << si[s]; i++)
|
|
1496
1510
|
Je[e++] = s;
|
|
1497
1511
|
for (Je[e - 1] = s, n = 0, s = 0; s < 16; s++)
|
|
1498
|
-
for (
|
|
1512
|
+
for (St[s] = n, i = 0; i < 1 << bt[s]; i++)
|
|
1499
1513
|
qe[n++] = s;
|
|
1500
|
-
for (n >>= 7; s <
|
|
1501
|
-
for (
|
|
1514
|
+
for (n >>= 7; s < Be; s++)
|
|
1515
|
+
for (St[s] = n << 7, i = 0; i < 1 << bt[s] - 7; i++)
|
|
1502
1516
|
qe[256 + n++] = s;
|
|
1503
|
-
for (t = 0; t <=
|
|
1517
|
+
for (t = 0; t <= Ee; t++)
|
|
1504
1518
|
r[t] = 0;
|
|
1505
1519
|
for (i = 0; i <= 143; )
|
|
1506
1520
|
ge[i * 2 + 1] = 8, i++, r[8]++;
|
|
@@ -1510,51 +1524,51 @@ function rr() {
|
|
|
1510
1524
|
ge[i * 2 + 1] = 7, i++, r[7]++;
|
|
1511
1525
|
for (; i <= 287; )
|
|
1512
1526
|
ge[i * 2 + 1] = 8, i++, r[8]++;
|
|
1513
|
-
for (
|
|
1514
|
-
Ze[i * 2 + 1] = 5, Ze[i * 2] =
|
|
1515
|
-
|
|
1527
|
+
for (ln(ge, je + 1, r), i = 0; i < Be; i++)
|
|
1528
|
+
Ze[i * 2 + 1] = 5, Ze[i * 2] = hn(i, 5);
|
|
1529
|
+
nn = new Ht(ge, si, tt + 1, je, Ee), rn = new Ht(Ze, bt, 0, Be, Ee), an = new Ht(new Array(0), rr, 0, hi, nr);
|
|
1516
1530
|
}
|
|
1517
|
-
function
|
|
1531
|
+
function cn(i) {
|
|
1518
1532
|
var t;
|
|
1519
1533
|
for (t = 0; t < je; t++)
|
|
1520
1534
|
i.dyn_ltree[t * 2] = 0;
|
|
1521
|
-
for (t = 0; t <
|
|
1535
|
+
for (t = 0; t < Be; t++)
|
|
1522
1536
|
i.dyn_dtree[t * 2] = 0;
|
|
1523
|
-
for (t = 0; t <
|
|
1537
|
+
for (t = 0; t < hi; t++)
|
|
1524
1538
|
i.bl_tree[t * 2] = 0;
|
|
1525
|
-
i.dyn_ltree[
|
|
1539
|
+
i.dyn_ltree[Js * 2] = 1, i.opt_len = i.static_len = 0, i.last_lit = i.matches = 0;
|
|
1526
1540
|
}
|
|
1527
|
-
function
|
|
1528
|
-
i.bi_valid > 8 ?
|
|
1541
|
+
function _n(i) {
|
|
1542
|
+
i.bi_valid > 8 ? Ct(i, i.bi_buf) : i.bi_valid > 0 && (i.pending_buf[i.pending++] = i.bi_buf), i.bi_buf = 0, i.bi_valid = 0;
|
|
1529
1543
|
}
|
|
1530
|
-
function
|
|
1531
|
-
|
|
1544
|
+
function lr(i, t, e, s) {
|
|
1545
|
+
_n(i), Ct(i, e), Ct(i, ~e), xe(i.pending_buf, i.window, t, e, i.pending), i.pending += e;
|
|
1532
1546
|
}
|
|
1533
|
-
function
|
|
1547
|
+
function Yi(i, t, e, s) {
|
|
1534
1548
|
var n = t * 2, r = e * 2;
|
|
1535
1549
|
return i[n] < i[r] || i[n] === i[r] && s[t] <= s[e];
|
|
1536
1550
|
}
|
|
1537
|
-
function
|
|
1538
|
-
for (var s = i.heap[e], n = e << 1; n <= i.heap_len && (n < i.heap_len &&
|
|
1551
|
+
function Ot(i, t, e) {
|
|
1552
|
+
for (var s = i.heap[e], n = e << 1; n <= i.heap_len && (n < i.heap_len && Yi(t, i.heap[n + 1], i.heap[n], i.depth) && n++, !Yi(t, s, i.heap[n], i.depth)); )
|
|
1539
1553
|
i.heap[e] = i.heap[n], e = n, n <<= 1;
|
|
1540
1554
|
i.heap[e] = s;
|
|
1541
1555
|
}
|
|
1542
|
-
function
|
|
1556
|
+
function ji(i, t, e) {
|
|
1543
1557
|
var s, n, r = 0, a, h;
|
|
1544
1558
|
if (i.last_lit !== 0)
|
|
1545
1559
|
do
|
|
1546
|
-
s = i.pending_buf[i.d_buf + r * 2] << 8 | i.pending_buf[i.d_buf + r * 2 + 1], n = i.pending_buf[i.l_buf + r], r++, s === 0 ? de(i, n, t) : (a = Je[n], de(i, a + tt + 1, t), h =
|
|
1560
|
+
s = i.pending_buf[i.d_buf + r * 2] << 8 | i.pending_buf[i.d_buf + r * 2 + 1], n = i.pending_buf[i.l_buf + r], r++, s === 0 ? de(i, n, t) : (a = Je[n], de(i, a + tt + 1, t), h = si[a], h !== 0 && (n -= li[a], se(i, n, h)), s--, a = on(s), de(i, a, e), h = bt[a], h !== 0 && (s -= St[a], se(i, s, h)));
|
|
1547
1561
|
while (r < i.last_lit);
|
|
1548
|
-
de(i,
|
|
1562
|
+
de(i, Js, t);
|
|
1549
1563
|
}
|
|
1550
|
-
function
|
|
1564
|
+
function ni(i, t) {
|
|
1551
1565
|
var e = t.dyn_tree, s = t.stat_desc.static_tree, n = t.stat_desc.has_stree, r = t.stat_desc.elems, a, h, c = -1, o;
|
|
1552
|
-
for (i.heap_len = 0, i.heap_max =
|
|
1566
|
+
for (i.heap_len = 0, i.heap_max = qs, a = 0; a < r; a++)
|
|
1553
1567
|
e[a * 2] !== 0 ? (i.heap[++i.heap_len] = c = a, i.depth[a] = 0) : e[a * 2 + 1] = 0;
|
|
1554
1568
|
for (; i.heap_len < 2; )
|
|
1555
1569
|
o = i.heap[++i.heap_len] = c < 2 ? ++c : 0, e[o * 2] = 1, i.depth[o] = 0, i.opt_len--, n && (i.static_len -= s[o * 2 + 1]);
|
|
1556
1570
|
for (t.max_code = c, a = i.heap_len >> 1; a >= 1; a--)
|
|
1557
|
-
|
|
1571
|
+
Ot(i, e, a);
|
|
1558
1572
|
o = r;
|
|
1559
1573
|
do
|
|
1560
1574
|
a = i.heap[
|
|
@@ -1563,7 +1577,7 @@ function si(i, t) {
|
|
|
1563
1577
|
], i.heap[
|
|
1564
1578
|
1
|
|
1565
1579
|
/*SMALLEST*/
|
|
1566
|
-
] = i.heap[i.heap_len--],
|
|
1580
|
+
] = i.heap[i.heap_len--], Ot(
|
|
1567
1581
|
i,
|
|
1568
1582
|
e,
|
|
1569
1583
|
1
|
|
@@ -1574,7 +1588,7 @@ function si(i, t) {
|
|
|
1574
1588
|
], i.heap[--i.heap_max] = a, i.heap[--i.heap_max] = h, e[o * 2] = e[a * 2] + e[h * 2], i.depth[o] = (i.depth[a] >= i.depth[h] ? i.depth[a] : i.depth[h]) + 1, e[a * 2 + 1] = e[h * 2 + 1] = o, i.heap[
|
|
1575
1589
|
1
|
|
1576
1590
|
/*SMALLEST*/
|
|
1577
|
-
] = o++,
|
|
1591
|
+
] = o++, Ot(
|
|
1578
1592
|
i,
|
|
1579
1593
|
e,
|
|
1580
1594
|
1
|
|
@@ -1584,14 +1598,14 @@ function si(i, t) {
|
|
|
1584
1598
|
i.heap[--i.heap_max] = i.heap[
|
|
1585
1599
|
1
|
|
1586
1600
|
/*SMALLEST*/
|
|
1587
|
-
],
|
|
1601
|
+
], or(i, t), ln(e, c, i.bl_count);
|
|
1588
1602
|
}
|
|
1589
|
-
function
|
|
1603
|
+
function qi(i, t, e) {
|
|
1590
1604
|
var s, n = -1, r, a = t[1], h = 0, c = 7, o = 4;
|
|
1591
1605
|
for (a === 0 && (c = 138, o = 3), t[(e + 1) * 2 + 1] = 65535, s = 0; s <= e; s++)
|
|
1592
|
-
r = a, a = t[(s + 1) * 2 + 1], !(++h < c && r === a) && (h < o ? i.bl_tree[r * 2] += h : r !== 0 ? (r !== n && i.bl_tree[r * 2]++, i.bl_tree[
|
|
1606
|
+
r = a, a = t[(s + 1) * 2 + 1], !(++h < c && r === a) && (h < o ? i.bl_tree[r * 2] += h : r !== 0 ? (r !== n && i.bl_tree[r * 2]++, i.bl_tree[$s * 2]++) : h <= 10 ? i.bl_tree[en * 2]++ : i.bl_tree[tn * 2]++, h = 0, n = r, a === 0 ? (c = 138, o = 3) : r === a ? (c = 6, o = 3) : (c = 7, o = 4));
|
|
1593
1607
|
}
|
|
1594
|
-
function
|
|
1608
|
+
function Ji(i, t, e) {
|
|
1595
1609
|
var s, n = -1, r, a = t[1], h = 0, c = 7, o = 4;
|
|
1596
1610
|
for (a === 0 && (c = 138, o = 3), s = 0; s <= e; s++)
|
|
1597
1611
|
if (r = a, a = t[(s + 1) * 2 + 1], !(++h < c && r === a)) {
|
|
@@ -1599,49 +1613,49 @@ function qi(i, t, e) {
|
|
|
1599
1613
|
do
|
|
1600
1614
|
de(i, r, i.bl_tree);
|
|
1601
1615
|
while (--h !== 0);
|
|
1602
|
-
else r !== 0 ? (r !== n && (de(i, r, i.bl_tree), h--), de(i,
|
|
1616
|
+
else r !== 0 ? (r !== n && (de(i, r, i.bl_tree), h--), de(i, $s, i.bl_tree), se(i, h - 3, 2)) : h <= 10 ? (de(i, en, i.bl_tree), se(i, h - 3, 3)) : (de(i, tn, i.bl_tree), se(i, h - 11, 7));
|
|
1603
1617
|
h = 0, n = r, a === 0 ? (c = 138, o = 3) : r === a ? (c = 6, o = 3) : (c = 7, o = 4);
|
|
1604
1618
|
}
|
|
1605
1619
|
}
|
|
1606
|
-
function
|
|
1620
|
+
function cr(i) {
|
|
1607
1621
|
var t;
|
|
1608
|
-
for (
|
|
1622
|
+
for (qi(i, i.dyn_ltree, i.l_desc.max_code), qi(i, i.dyn_dtree, i.d_desc.max_code), ni(i, i.bl_desc), t = hi - 1; t >= 3 && i.bl_tree[sn[t] * 2 + 1] === 0; t--)
|
|
1609
1623
|
;
|
|
1610
1624
|
return i.opt_len += 3 * (t + 1) + 5 + 5 + 4, t;
|
|
1611
1625
|
}
|
|
1612
|
-
function
|
|
1626
|
+
function _r(i, t, e, s) {
|
|
1613
1627
|
var n;
|
|
1614
1628
|
for (se(i, t - 257, 5), se(i, e - 1, 5), se(i, s - 4, 4), n = 0; n < s; n++)
|
|
1615
|
-
se(i, i.bl_tree[
|
|
1616
|
-
|
|
1629
|
+
se(i, i.bl_tree[sn[n] * 2 + 1], 3);
|
|
1630
|
+
Ji(i, i.dyn_ltree, t - 1), Ji(i, i.dyn_dtree, e - 1);
|
|
1617
1631
|
}
|
|
1618
|
-
function
|
|
1632
|
+
function ur(i) {
|
|
1619
1633
|
var t = 4093624447, e;
|
|
1620
1634
|
for (e = 0; e <= 31; e++, t >>>= 1)
|
|
1621
1635
|
if (t & 1 && i.dyn_ltree[e * 2] !== 0)
|
|
1622
|
-
return
|
|
1636
|
+
return Wi;
|
|
1623
1637
|
if (i.dyn_ltree[18] !== 0 || i.dyn_ltree[20] !== 0 || i.dyn_ltree[26] !== 0)
|
|
1624
|
-
return
|
|
1638
|
+
return Zi;
|
|
1625
1639
|
for (e = 32; e < tt; e++)
|
|
1626
1640
|
if (i.dyn_ltree[e * 2] !== 0)
|
|
1627
|
-
return
|
|
1628
|
-
return
|
|
1641
|
+
return Zi;
|
|
1642
|
+
return Wi;
|
|
1629
1643
|
}
|
|
1630
|
-
var
|
|
1631
|
-
function
|
|
1632
|
-
|
|
1644
|
+
var $i = !1;
|
|
1645
|
+
function fr(i) {
|
|
1646
|
+
$i || (hr(), $i = !0), i.l_desc = new zt(i.dyn_ltree, nn), i.d_desc = new zt(i.dyn_dtree, rn), i.bl_desc = new zt(i.bl_tree, an), i.bi_buf = 0, i.bi_valid = 0, cn(i);
|
|
1633
1647
|
}
|
|
1634
|
-
function
|
|
1635
|
-
se(i, (
|
|
1648
|
+
function un(i, t, e, s) {
|
|
1649
|
+
se(i, ($n << 1) + (s ? 1 : 0), 3), lr(i, t, e);
|
|
1636
1650
|
}
|
|
1637
|
-
function
|
|
1651
|
+
function dr(i, t, e, s) {
|
|
1638
1652
|
var n, r, a = 0;
|
|
1639
|
-
i.level > 0 ? (i.strm.data_type ===
|
|
1653
|
+
i.level > 0 ? (i.strm.data_type === Jn && (i.strm.data_type = ur(i)), ni(i, i.l_desc), ni(i, i.d_desc), a = cr(i), n = i.opt_len + 3 + 7 >>> 3, r = i.static_len + 3 + 7 >>> 3, r <= n && (n = r)) : n = r = e + 5, e + 4 <= n && t !== -1 ? un(i, t, e, s) : i.strategy === qn || r === n ? (se(i, (er << 1) + (s ? 1 : 0), 3), ji(i, ge, Ze)) : (se(i, (tr << 1) + (s ? 1 : 0), 3), _r(i, i.l_desc.max_code + 1, i.d_desc.max_code + 1, a + 1), ji(i, i.dyn_ltree, i.dyn_dtree)), cn(i), s && _n(i);
|
|
1640
1654
|
}
|
|
1641
|
-
function
|
|
1642
|
-
return i.pending_buf[i.d_buf + i.last_lit * 2] = t >>> 8 & 255, i.pending_buf[i.d_buf + i.last_lit * 2 + 1] = t & 255, i.pending_buf[i.l_buf + i.last_lit] = e & 255, i.last_lit++, t === 0 ? i.dyn_ltree[e * 2]++ : (i.matches++, t--, i.dyn_ltree[(Je[e] + tt + 1) * 2]++, i.dyn_dtree[
|
|
1655
|
+
function me(i, t, e) {
|
|
1656
|
+
return i.pending_buf[i.d_buf + i.last_lit * 2] = t >>> 8 & 255, i.pending_buf[i.d_buf + i.last_lit * 2 + 1] = t & 255, i.pending_buf[i.l_buf + i.last_lit] = e & 255, i.last_lit++, t === 0 ? i.dyn_ltree[e * 2]++ : (i.matches++, t--, i.dyn_ltree[(Je[e] + tt + 1) * 2]++, i.dyn_dtree[on(t) * 2]++), i.last_lit === i.lit_bufsize - 1;
|
|
1643
1657
|
}
|
|
1644
|
-
const
|
|
1658
|
+
const xr = {
|
|
1645
1659
|
2: "need dictionary",
|
|
1646
1660
|
/* Z_NEED_DICT 2 */
|
|
1647
1661
|
1: "stream end",
|
|
@@ -1660,15 +1674,15 @@ const fr = {
|
|
|
1660
1674
|
/* Z_BUF_ERROR (-5) */
|
|
1661
1675
|
"-6": "incompatible version"
|
|
1662
1676
|
/* Z_VERSION_ERROR (-6) */
|
|
1663
|
-
}, it = 0,
|
|
1664
|
-
var
|
|
1677
|
+
}, it = 0, es = 3, $e = 4, pr = 5, Qe = 0, De = -2, Vt = -5, fn = -1, gr = 1, lt = 2, br = 3, wr = 4, mr = 0, yr = 2, ci = 8;
|
|
1678
|
+
var vr = 15, kr = 8, Sr = 29, Cr = 256, ri = Cr + 1 + Sr, Er = 30, Kr = 19, Ar = 2 * ri + 1, Xr = 15, P = 3, be = 258, oe = be + P + 1, Fr = 32, dn = 42, ts = 69, Gt = 73, Wt = 91, Zt = 103, Ve = 113, ct = 666, Z = 1, st = 2, et = 3, Ft = 4, Mr = 3;
|
|
1665
1679
|
function Le(i, t) {
|
|
1666
|
-
return i.msg =
|
|
1680
|
+
return i.msg = xr[t], t;
|
|
1667
1681
|
}
|
|
1668
|
-
function
|
|
1682
|
+
function is(i) {
|
|
1669
1683
|
return (i << 1) - (i > 4 ? 9 : 0);
|
|
1670
1684
|
}
|
|
1671
|
-
function
|
|
1685
|
+
function Ce(i) {
|
|
1672
1686
|
for (var t = i.length; --t >= 0; )
|
|
1673
1687
|
i[t] = 0;
|
|
1674
1688
|
}
|
|
@@ -1677,20 +1691,20 @@ function ke(i) {
|
|
|
1677
1691
|
e > i.avail_out && (e = i.avail_out), e !== 0 && (xe(i.output, t.pending_buf, t.pending_out, e, i.next_out), i.next_out += e, t.pending_out += e, i.total_out += e, i.avail_out -= e, t.pending -= e, t.pending === 0 && (t.pending_out = 0));
|
|
1678
1692
|
}
|
|
1679
1693
|
function ie(i, t) {
|
|
1680
|
-
|
|
1694
|
+
dr(i, i.block_start >= 0 ? i.block_start : -1, i.strstart - i.block_start, t), i.block_start = i.strstart, ke(i.strm);
|
|
1681
1695
|
}
|
|
1682
1696
|
function H(i, t) {
|
|
1683
1697
|
i.pending_buf[i.pending++] = t;
|
|
1684
1698
|
}
|
|
1685
|
-
function
|
|
1699
|
+
function Yt(i, t) {
|
|
1686
1700
|
i.pending_buf[i.pending++] = t >>> 8 & 255, i.pending_buf[i.pending++] = t & 255;
|
|
1687
1701
|
}
|
|
1688
|
-
function
|
|
1702
|
+
function Tr(i, t, e, s) {
|
|
1689
1703
|
var n = i.avail_in;
|
|
1690
|
-
return n > s && (n = s), n === 0 ? 0 : (i.avail_in -= n, xe(t, i.input, i.next_in, n, e), i.state.wrap === 1 ? i.adler =
|
|
1704
|
+
return n > s && (n = s), n === 0 ? 0 : (i.avail_in -= n, xe(t, i.input, i.next_in, n, e), i.state.wrap === 1 ? i.adler = ii(i.adler, t, n, e) : i.state.wrap === 2 && (i.adler = W(i.adler)), i.next_in += n, i.total_in += n, n);
|
|
1691
1705
|
}
|
|
1692
|
-
function
|
|
1693
|
-
var e = i.max_chain_length, s = i.strstart, n, r, a = i.prev_length, h = i.nice_match, c = i.strstart > i.w_size - oe ? i.strstart - (i.w_size - oe) : 0, o = i.window, l = i.w_mask,
|
|
1706
|
+
function xn(i, t) {
|
|
1707
|
+
var e = i.max_chain_length, s = i.strstart, n, r, a = i.prev_length, h = i.nice_match, c = i.strstart > i.w_size - oe ? i.strstart - (i.w_size - oe) : 0, o = i.window, l = i.w_mask, f = i.prev, d = i.strstart + be, x = o[s + a - 1], k = o[s + a];
|
|
1694
1708
|
i.prev_length >= i.good_match && (e >>= 2), h > i.lookahead && (h = i.lookahead);
|
|
1695
1709
|
do
|
|
1696
1710
|
if (n = t, !(o[n + a] !== k || o[n + a - 1] !== x || o[n] !== o[s] || o[++n] !== o[s + 1])) {
|
|
@@ -1704,7 +1718,7 @@ function fn(i, t) {
|
|
|
1704
1718
|
x = o[s + a - 1], k = o[s + a];
|
|
1705
1719
|
}
|
|
1706
1720
|
}
|
|
1707
|
-
while ((t =
|
|
1721
|
+
while ((t = f[t & l]) > c && --e !== 0);
|
|
1708
1722
|
return a <= i.lookahead ? a : i.lookahead;
|
|
1709
1723
|
}
|
|
1710
1724
|
function nt(i) {
|
|
@@ -1723,12 +1737,12 @@ function nt(i) {
|
|
|
1723
1737
|
}
|
|
1724
1738
|
if (i.strm.avail_in === 0)
|
|
1725
1739
|
break;
|
|
1726
|
-
if (s =
|
|
1740
|
+
if (s = Tr(i.strm, i.window, i.strstart + i.lookahead, r), i.lookahead += s, i.lookahead + i.insert >= P)
|
|
1727
1741
|
for (a = i.strstart - i.insert, i.ins_h = i.window[a], i.ins_h = (i.ins_h << i.hash_shift ^ i.window[a + 1]) & i.hash_mask; i.insert && (i.ins_h = (i.ins_h << i.hash_shift ^ i.window[a + P - 1]) & i.hash_mask, i.prev[a & i.w_mask] = i.head[i.ins_h], i.head[i.ins_h] = a, a++, i.insert--, !(i.lookahead + i.insert < P)); )
|
|
1728
1742
|
;
|
|
1729
1743
|
} while (i.lookahead < oe && i.strm.avail_in !== 0);
|
|
1730
1744
|
}
|
|
1731
|
-
function
|
|
1745
|
+
function Qr(i, t) {
|
|
1732
1746
|
var e = 65535;
|
|
1733
1747
|
for (e > i.pending_buf_size - 5 && (e = i.pending_buf_size - 5); ; ) {
|
|
1734
1748
|
if (i.lookahead <= 1) {
|
|
@@ -1742,9 +1756,9 @@ function Fr(i, t) {
|
|
|
1742
1756
|
if ((i.strstart === 0 || i.strstart >= s) && (i.lookahead = i.strstart - s, i.strstart = s, ie(i, !1), i.strm.avail_out === 0) || i.strstart - i.block_start >= i.w_size - oe && (ie(i, !1), i.strm.avail_out === 0))
|
|
1743
1757
|
return Z;
|
|
1744
1758
|
}
|
|
1745
|
-
return i.insert = 0, t === $e ? (ie(i, !0), i.strm.avail_out === 0 ? et :
|
|
1759
|
+
return i.insert = 0, t === $e ? (ie(i, !0), i.strm.avail_out === 0 ? et : Ft) : (i.strstart > i.block_start && (ie(i, !1), i.strm.avail_out === 0), Z);
|
|
1746
1760
|
}
|
|
1747
|
-
function
|
|
1761
|
+
function jt(i, t) {
|
|
1748
1762
|
for (var e, s; ; ) {
|
|
1749
1763
|
if (i.lookahead < oe) {
|
|
1750
1764
|
if (nt(i), i.lookahead < oe && t === it)
|
|
@@ -1752,8 +1766,8 @@ function Yt(i, t) {
|
|
|
1752
1766
|
if (i.lookahead === 0)
|
|
1753
1767
|
break;
|
|
1754
1768
|
}
|
|
1755
|
-
if (e = 0, i.lookahead >= P && (i.ins_h = (i.ins_h << i.hash_shift ^ i.window[i.strstart + P - 1]) & i.hash_mask, e = i.prev[i.strstart & i.w_mask] = i.head[i.ins_h], i.head[i.ins_h] = i.strstart), e !== 0 && i.strstart - e <= i.w_size - oe && (i.match_length =
|
|
1756
|
-
if (s =
|
|
1769
|
+
if (e = 0, i.lookahead >= P && (i.ins_h = (i.ins_h << i.hash_shift ^ i.window[i.strstart + P - 1]) & i.hash_mask, e = i.prev[i.strstart & i.w_mask] = i.head[i.ins_h], i.head[i.ins_h] = i.strstart), e !== 0 && i.strstart - e <= i.w_size - oe && (i.match_length = xn(i, e)), i.match_length >= P)
|
|
1770
|
+
if (s = me(i, i.strstart - i.match_start, i.match_length - P), i.lookahead -= i.match_length, i.match_length <= i.max_lazy_match && i.lookahead >= P) {
|
|
1757
1771
|
i.match_length--;
|
|
1758
1772
|
do
|
|
1759
1773
|
i.strstart++, i.ins_h = (i.ins_h << i.hash_shift ^ i.window[i.strstart + P - 1]) & i.hash_mask, e = i.prev[i.strstart & i.w_mask] = i.head[i.ins_h], i.head[i.ins_h] = i.strstart;
|
|
@@ -1762,11 +1776,11 @@ function Yt(i, t) {
|
|
|
1762
1776
|
} else
|
|
1763
1777
|
i.strstart += i.match_length, i.match_length = 0, i.ins_h = i.window[i.strstart], i.ins_h = (i.ins_h << i.hash_shift ^ i.window[i.strstart + 1]) & i.hash_mask;
|
|
1764
1778
|
else
|
|
1765
|
-
s =
|
|
1779
|
+
s = me(i, 0, i.window[i.strstart]), i.lookahead--, i.strstart++;
|
|
1766
1780
|
if (s && (ie(i, !1), i.strm.avail_out === 0))
|
|
1767
1781
|
return Z;
|
|
1768
1782
|
}
|
|
1769
|
-
return i.insert = i.strstart < P - 1 ? i.strstart : P - 1, t === $e ? (ie(i, !0), i.strm.avail_out === 0 ? et :
|
|
1783
|
+
return i.insert = i.strstart < P - 1 ? i.strstart : P - 1, t === $e ? (ie(i, !0), i.strm.avail_out === 0 ? et : Ft) : i.last_lit && (ie(i, !1), i.strm.avail_out === 0) ? Z : st;
|
|
1770
1784
|
}
|
|
1771
1785
|
function Me(i, t) {
|
|
1772
1786
|
for (var e, s, n; ; ) {
|
|
@@ -1776,22 +1790,22 @@ function Me(i, t) {
|
|
|
1776
1790
|
if (i.lookahead === 0)
|
|
1777
1791
|
break;
|
|
1778
1792
|
}
|
|
1779
|
-
if (e = 0, i.lookahead >= P && (i.ins_h = (i.ins_h << i.hash_shift ^ i.window[i.strstart + P - 1]) & i.hash_mask, e = i.prev[i.strstart & i.w_mask] = i.head[i.ins_h], i.head[i.ins_h] = i.strstart), i.prev_length = i.match_length, i.prev_match = i.match_start, i.match_length = P - 1, e !== 0 && i.prev_length < i.max_lazy_match && i.strstart - e <= i.w_size - oe && (i.match_length =
|
|
1780
|
-
n = i.strstart + i.lookahead - P, s =
|
|
1793
|
+
if (e = 0, i.lookahead >= P && (i.ins_h = (i.ins_h << i.hash_shift ^ i.window[i.strstart + P - 1]) & i.hash_mask, e = i.prev[i.strstart & i.w_mask] = i.head[i.ins_h], i.head[i.ins_h] = i.strstart), i.prev_length = i.match_length, i.prev_match = i.match_start, i.match_length = P - 1, e !== 0 && i.prev_length < i.max_lazy_match && i.strstart - e <= i.w_size - oe && (i.match_length = xn(i, e), i.match_length <= 5 && (i.strategy === gr || i.match_length === P && i.strstart - i.match_start > 4096) && (i.match_length = P - 1)), i.prev_length >= P && i.match_length <= i.prev_length) {
|
|
1794
|
+
n = i.strstart + i.lookahead - P, s = me(i, i.strstart - 1 - i.prev_match, i.prev_length - P), i.lookahead -= i.prev_length - 1, i.prev_length -= 2;
|
|
1781
1795
|
do
|
|
1782
1796
|
++i.strstart <= n && (i.ins_h = (i.ins_h << i.hash_shift ^ i.window[i.strstart + P - 1]) & i.hash_mask, e = i.prev[i.strstart & i.w_mask] = i.head[i.ins_h], i.head[i.ins_h] = i.strstart);
|
|
1783
1797
|
while (--i.prev_length !== 0);
|
|
1784
1798
|
if (i.match_available = 0, i.match_length = P - 1, i.strstart++, s && (ie(i, !1), i.strm.avail_out === 0))
|
|
1785
1799
|
return Z;
|
|
1786
1800
|
} else if (i.match_available) {
|
|
1787
|
-
if (s =
|
|
1801
|
+
if (s = me(i, 0, i.window[i.strstart - 1]), s && ie(i, !1), i.strstart++, i.lookahead--, i.strm.avail_out === 0)
|
|
1788
1802
|
return Z;
|
|
1789
1803
|
} else
|
|
1790
1804
|
i.match_available = 1, i.strstart++, i.lookahead--;
|
|
1791
1805
|
}
|
|
1792
|
-
return i.match_available && (s =
|
|
1806
|
+
return i.match_available && (s = me(i, 0, i.window[i.strstart - 1]), i.match_available = 0), i.insert = i.strstart < P - 1 ? i.strstart : P - 1, t === $e ? (ie(i, !0), i.strm.avail_out === 0 ? et : Ft) : i.last_lit && (ie(i, !1), i.strm.avail_out === 0) ? Z : st;
|
|
1793
1807
|
}
|
|
1794
|
-
function
|
|
1808
|
+
function Lr(i, t) {
|
|
1795
1809
|
for (var e, s, n, r, a = i.window; !(i.lookahead <= be && (nt(i), i.lookahead <= be, i.lookahead === 0)); ) {
|
|
1796
1810
|
if (i.match_length = 0, i.lookahead >= P && i.strstart > 0 && (n = i.strstart - 1, s = a[n], s === a[++n] && s === a[++n] && s === a[++n])) {
|
|
1797
1811
|
r = i.strstart + be;
|
|
@@ -1800,30 +1814,30 @@ function Mr(i, t) {
|
|
|
1800
1814
|
while (s === a[++n] && s === a[++n] && s === a[++n] && s === a[++n] && s === a[++n] && s === a[++n] && s === a[++n] && s === a[++n] && n < r);
|
|
1801
1815
|
i.match_length = be - (r - n), i.match_length > i.lookahead && (i.match_length = i.lookahead);
|
|
1802
1816
|
}
|
|
1803
|
-
if (i.match_length >= P ? (e =
|
|
1817
|
+
if (i.match_length >= P ? (e = me(i, 1, i.match_length - P), i.lookahead -= i.match_length, i.strstart += i.match_length, i.match_length = 0) : (e = me(i, 0, i.window[i.strstart]), i.lookahead--, i.strstart++), e && (ie(i, !1), i.strm.avail_out === 0))
|
|
1804
1818
|
return Z;
|
|
1805
1819
|
}
|
|
1806
1820
|
return i.insert = 0, i.last_lit && (ie(i, !1), i.strm.avail_out === 0) ? Z : st;
|
|
1807
1821
|
}
|
|
1808
|
-
function
|
|
1822
|
+
function Rr(i, t) {
|
|
1809
1823
|
for (var e; !(i.lookahead === 0 && (nt(i), i.lookahead === 0)); )
|
|
1810
|
-
if (i.match_length = 0, e =
|
|
1824
|
+
if (i.match_length = 0, e = me(i, 0, i.window[i.strstart]), i.lookahead--, i.strstart++, e && (ie(i, !1), i.strm.avail_out === 0))
|
|
1811
1825
|
return Z;
|
|
1812
1826
|
return i.insert = 0, i.last_lit && (ie(i, !1), i.strm.avail_out === 0) ? Z : st;
|
|
1813
1827
|
}
|
|
1814
1828
|
function le(i, t, e, s, n) {
|
|
1815
1829
|
this.good_length = i, this.max_lazy = t, this.nice_length = e, this.max_chain = s, this.func = n;
|
|
1816
1830
|
}
|
|
1817
|
-
var
|
|
1818
|
-
|
|
1831
|
+
var Re;
|
|
1832
|
+
Re = [
|
|
1819
1833
|
/* good lazy nice chain */
|
|
1820
|
-
new le(0, 0, 0, 0,
|
|
1834
|
+
new le(0, 0, 0, 0, Qr),
|
|
1821
1835
|
/* 0 store only */
|
|
1822
|
-
new le(4, 4, 8, 4,
|
|
1836
|
+
new le(4, 4, 8, 4, jt),
|
|
1823
1837
|
/* 1 max speed, no lazy matches */
|
|
1824
|
-
new le(4, 5, 16, 8,
|
|
1838
|
+
new le(4, 5, 16, 8, jt),
|
|
1825
1839
|
/* 2 */
|
|
1826
|
-
new le(4, 6, 32, 32,
|
|
1840
|
+
new le(4, 6, 32, 32, jt),
|
|
1827
1841
|
/* 3 */
|
|
1828
1842
|
new le(4, 4, 16, 16, Me),
|
|
1829
1843
|
/* 4 lazy matches */
|
|
@@ -1838,56 +1852,56 @@ Be = [
|
|
|
1838
1852
|
new le(32, 258, 258, 4096, Me)
|
|
1839
1853
|
/* 9 max compression */
|
|
1840
1854
|
];
|
|
1841
|
-
function
|
|
1842
|
-
i.window_size = 2 * i.w_size,
|
|
1855
|
+
function Br(i) {
|
|
1856
|
+
i.window_size = 2 * i.w_size, Ce(i.head), i.max_lazy_match = Re[i.level].max_lazy, i.good_match = Re[i.level].good_length, i.nice_match = Re[i.level].nice_length, i.max_chain_length = Re[i.level].max_chain, i.strstart = 0, i.block_start = 0, i.lookahead = 0, i.insert = 0, i.match_length = i.prev_length = P - 1, i.match_available = 0, i.ins_h = 0;
|
|
1843
1857
|
}
|
|
1844
|
-
function
|
|
1845
|
-
this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method =
|
|
1858
|
+
function Dr() {
|
|
1859
|
+
this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = ci, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new ne(Ar * 2), this.dyn_dtree = new ne((2 * Er + 1) * 2), this.bl_tree = new ne((2 * Kr + 1) * 2), Ce(this.dyn_ltree), Ce(this.dyn_dtree), Ce(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new ne(Xr + 1), this.heap = new ne(2 * ri + 1), Ce(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new ne(2 * ri + 1), Ce(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;
|
|
1846
1860
|
}
|
|
1847
|
-
function
|
|
1861
|
+
function Ir(i) {
|
|
1848
1862
|
var t;
|
|
1849
|
-
return !i || !i.state ? Le(i, De) : (i.total_in = i.total_out = 0, i.data_type =
|
|
1863
|
+
return !i || !i.state ? Le(i, De) : (i.total_in = i.total_out = 0, i.data_type = yr, t = i.state, t.pending = 0, t.pending_out = 0, t.wrap < 0 && (t.wrap = -t.wrap), t.status = t.wrap ? dn : Ve, i.adler = t.wrap === 2 ? 0 : 1, t.last_flush = it, fr(t), Qe);
|
|
1850
1864
|
}
|
|
1851
|
-
function
|
|
1852
|
-
var t =
|
|
1853
|
-
return t ===
|
|
1865
|
+
function Pr(i) {
|
|
1866
|
+
var t = Ir(i);
|
|
1867
|
+
return t === Qe && Br(i.state), t;
|
|
1854
1868
|
}
|
|
1855
|
-
function
|
|
1869
|
+
function Ur(i, t, e, s, n, r) {
|
|
1856
1870
|
if (!i)
|
|
1857
1871
|
return De;
|
|
1858
1872
|
var a = 1;
|
|
1859
|
-
if (t ===
|
|
1873
|
+
if (t === fn && (t = 6), t < 0 || t > 9 || r < 0 || r > wr)
|
|
1860
1874
|
return Le(i, De);
|
|
1861
|
-
var h = new
|
|
1862
|
-
return i.state = h, h.strm = i, h.wrap = a, h.gzhead = null, h.w_bits = s, h.w_size = 1 << h.w_bits, h.w_mask = h.w_size - 1, h.hash_bits = n + 7, h.hash_size = 1 << h.hash_bits, h.hash_mask = h.hash_size - 1, h.hash_shift = ~~((h.hash_bits + P - 1) / P), h.window = new
|
|
1875
|
+
var h = new Dr();
|
|
1876
|
+
return i.state = h, h.strm = i, h.wrap = a, h.gzhead = null, h.w_bits = s, h.w_size = 1 << h.w_bits, h.w_mask = h.w_size - 1, h.hash_bits = n + 7, h.hash_size = 1 << h.hash_bits, h.hash_mask = h.hash_size - 1, h.hash_shift = ~~((h.hash_bits + P - 1) / P), h.window = new yt(h.w_size * 2), h.head = new ne(h.hash_size), h.prev = new ne(h.w_size), h.lit_bufsize = 1 << n + 6, h.pending_buf_size = h.lit_bufsize * 4, h.pending_buf = new yt(h.pending_buf_size), h.d_buf = 1 * h.lit_bufsize, h.l_buf = 3 * h.lit_bufsize, h.level = t, h.strategy = r, h.method = e, Pr(i);
|
|
1863
1877
|
}
|
|
1864
|
-
function
|
|
1865
|
-
return
|
|
1878
|
+
function Nr(i, t) {
|
|
1879
|
+
return Ur(i, t, ci, vr, kr, mr);
|
|
1866
1880
|
}
|
|
1867
|
-
function
|
|
1881
|
+
function ss(i, t) {
|
|
1868
1882
|
var e, s, n, r;
|
|
1869
|
-
if (!i || !i.state || t >
|
|
1883
|
+
if (!i || !i.state || t > pr || t < 0)
|
|
1870
1884
|
return i ? Le(i, De) : De;
|
|
1871
1885
|
if (s = i.state, !i.output || !i.input && i.avail_in !== 0 || s.status === ct && t !== $e)
|
|
1872
|
-
return Le(i, i.avail_out === 0 ?
|
|
1873
|
-
if (s.strm = i, e = s.last_flush, s.last_flush = t, s.status ===
|
|
1886
|
+
return Le(i, i.avail_out === 0 ? Vt : De);
|
|
1887
|
+
if (s.strm = i, e = s.last_flush, s.last_flush = t, s.status === dn)
|
|
1874
1888
|
if (s.wrap === 2)
|
|
1875
1889
|
i.adler = 0, H(s, 31), H(s, 139), H(s, 8), s.gzhead ? (H(
|
|
1876
1890
|
s,
|
|
1877
1891
|
(s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (s.gzhead.extra ? 4 : 0) + (s.gzhead.name ? 8 : 0) + (s.gzhead.comment ? 16 : 0)
|
|
1878
|
-
), H(s, s.gzhead.time & 255), H(s, s.gzhead.time >> 8 & 255), H(s, s.gzhead.time >> 16 & 255), H(s, s.gzhead.time >> 24 & 255), H(s, s.level === 9 ? 2 : s.strategy >= lt || s.level < 2 ? 4 : 0), H(s, s.gzhead.os & 255), s.gzhead.extra && s.gzhead.extra.length && (H(s, s.gzhead.extra.length & 255), H(s, s.gzhead.extra.length >> 8 & 255)), s.gzhead.hcrc && (i.adler = W(i.adler, s.pending_buf, s.pending)), s.gzindex = 0, s.status =
|
|
1892
|
+
), H(s, s.gzhead.time & 255), H(s, s.gzhead.time >> 8 & 255), H(s, s.gzhead.time >> 16 & 255), H(s, s.gzhead.time >> 24 & 255), H(s, s.level === 9 ? 2 : s.strategy >= lt || s.level < 2 ? 4 : 0), H(s, s.gzhead.os & 255), s.gzhead.extra && s.gzhead.extra.length && (H(s, s.gzhead.extra.length & 255), H(s, s.gzhead.extra.length >> 8 & 255)), s.gzhead.hcrc && (i.adler = W(i.adler, s.pending_buf, s.pending)), s.gzindex = 0, s.status = ts) : (H(s, 0), H(s, 0), H(s, 0), H(s, 0), H(s, 0), H(s, s.level === 9 ? 2 : s.strategy >= lt || s.level < 2 ? 4 : 0), H(s, Mr), s.status = Ve);
|
|
1879
1893
|
else {
|
|
1880
|
-
var a =
|
|
1881
|
-
s.strategy >= lt || s.level < 2 ? h = 0 : s.level < 6 ? h = 1 : s.level === 6 ? h = 2 : h = 3, a |= h << 6, s.strstart !== 0 && (a |=
|
|
1894
|
+
var a = ci + (s.w_bits - 8 << 4) << 8, h = -1;
|
|
1895
|
+
s.strategy >= lt || s.level < 2 ? h = 0 : s.level < 6 ? h = 1 : s.level === 6 ? h = 2 : h = 3, a |= h << 6, s.strstart !== 0 && (a |= Fr), a += 31 - a % 31, s.status = Ve, Yt(s, a), s.strstart !== 0 && (Yt(s, i.adler >>> 16), Yt(s, i.adler & 65535)), i.adler = 1;
|
|
1882
1896
|
}
|
|
1883
|
-
if (s.status ===
|
|
1897
|
+
if (s.status === ts)
|
|
1884
1898
|
if (s.gzhead.extra) {
|
|
1885
1899
|
for (n = s.pending; s.gzindex < (s.gzhead.extra.length & 65535) && !(s.pending === s.pending_buf_size && (s.gzhead.hcrc && s.pending > n && (i.adler = W(i.adler, s.pending_buf, s.pending - n)), ke(i), n = s.pending, s.pending === s.pending_buf_size)); )
|
|
1886
1900
|
H(s, s.gzhead.extra[s.gzindex] & 255), s.gzindex++;
|
|
1887
|
-
s.gzhead.hcrc && s.pending > n && (i.adler = W(i.adler, s.pending_buf, s.pending - n)), s.gzindex === s.gzhead.extra.length && (s.gzindex = 0, s.status =
|
|
1901
|
+
s.gzhead.hcrc && s.pending > n && (i.adler = W(i.adler, s.pending_buf, s.pending - n)), s.gzindex === s.gzhead.extra.length && (s.gzindex = 0, s.status = Gt);
|
|
1888
1902
|
} else
|
|
1889
|
-
s.status =
|
|
1890
|
-
if (s.status ===
|
|
1903
|
+
s.status = Gt;
|
|
1904
|
+
if (s.status === Gt)
|
|
1891
1905
|
if (s.gzhead.name) {
|
|
1892
1906
|
n = s.pending;
|
|
1893
1907
|
do {
|
|
@@ -1897,10 +1911,10 @@ function is(i, t) {
|
|
|
1897
1911
|
}
|
|
1898
1912
|
s.gzindex < s.gzhead.name.length ? r = s.gzhead.name.charCodeAt(s.gzindex++) & 255 : r = 0, H(s, r);
|
|
1899
1913
|
} while (r !== 0);
|
|
1900
|
-
s.gzhead.hcrc && s.pending > n && (i.adler = W(i.adler, s.pending_buf, s.pending - n)), r === 0 && (s.gzindex = 0, s.status =
|
|
1914
|
+
s.gzhead.hcrc && s.pending > n && (i.adler = W(i.adler, s.pending_buf, s.pending - n)), r === 0 && (s.gzindex = 0, s.status = Wt);
|
|
1901
1915
|
} else
|
|
1902
|
-
s.status =
|
|
1903
|
-
if (s.status ===
|
|
1916
|
+
s.status = Wt;
|
|
1917
|
+
if (s.status === Wt)
|
|
1904
1918
|
if (s.gzhead.comment) {
|
|
1905
1919
|
n = s.pending;
|
|
1906
1920
|
do {
|
|
@@ -1910,38 +1924,38 @@ function is(i, t) {
|
|
|
1910
1924
|
}
|
|
1911
1925
|
s.gzindex < s.gzhead.comment.length ? r = s.gzhead.comment.charCodeAt(s.gzindex++) & 255 : r = 0, H(s, r);
|
|
1912
1926
|
} while (r !== 0);
|
|
1913
|
-
s.gzhead.hcrc && s.pending > n && (i.adler = W(i.adler, s.pending_buf, s.pending - n)), r === 0 && (s.status =
|
|
1927
|
+
s.gzhead.hcrc && s.pending > n && (i.adler = W(i.adler, s.pending_buf, s.pending - n)), r === 0 && (s.status = Zt);
|
|
1914
1928
|
} else
|
|
1915
|
-
s.status =
|
|
1916
|
-
if (s.status ===
|
|
1929
|
+
s.status = Zt;
|
|
1930
|
+
if (s.status === Zt && (s.gzhead.hcrc ? (s.pending + 2 > s.pending_buf_size && ke(i), s.pending + 2 <= s.pending_buf_size && (H(s, i.adler & 255), H(s, i.adler >> 8 & 255), i.adler = 0, s.status = Ve)) : s.status = Ve), s.pending !== 0) {
|
|
1917
1931
|
if (ke(i), i.avail_out === 0)
|
|
1918
|
-
return s.last_flush = -1,
|
|
1919
|
-
} else if (i.avail_in === 0 &&
|
|
1920
|
-
return Le(i,
|
|
1932
|
+
return s.last_flush = -1, Qe;
|
|
1933
|
+
} else if (i.avail_in === 0 && is(t) <= is(e) && t !== $e)
|
|
1934
|
+
return Le(i, Vt);
|
|
1921
1935
|
if (s.status === ct && i.avail_in !== 0)
|
|
1922
|
-
return Le(i,
|
|
1936
|
+
return Le(i, Vt);
|
|
1923
1937
|
if (i.avail_in !== 0 || s.lookahead !== 0 || s.status !== ct) {
|
|
1924
|
-
var c = s.strategy === lt ?
|
|
1925
|
-
if ((c === et || c ===
|
|
1926
|
-
return i.avail_out === 0 && (s.last_flush = -1),
|
|
1927
|
-
if (c === st && (
|
|
1928
|
-
return s.last_flush = -1,
|
|
1938
|
+
var c = s.strategy === lt ? Rr(s) : s.strategy === br ? Lr(s, t) : Re[s.level].func(s, t);
|
|
1939
|
+
if ((c === et || c === Ft) && (s.status = ct), c === Z || c === et)
|
|
1940
|
+
return i.avail_out === 0 && (s.last_flush = -1), Qe;
|
|
1941
|
+
if (c === st && (un(s, 0, 0, !1), Ce(s.head), s.lookahead === 0 && (s.strstart = 0, s.block_start = 0, s.insert = 0), ke(i), i.avail_out === 0))
|
|
1942
|
+
return s.last_flush = -1, Qe;
|
|
1929
1943
|
}
|
|
1930
|
-
return
|
|
1944
|
+
return Qe;
|
|
1931
1945
|
}
|
|
1932
|
-
class
|
|
1946
|
+
class Hr {
|
|
1933
1947
|
constructor() {
|
|
1934
|
-
this.strm = new
|
|
1948
|
+
this.strm = new js(), this.chunkSize = 1024 * 10 * 10, this.outputBuffer = new Uint8Array(this.chunkSize), Nr(this.strm, fn);
|
|
1935
1949
|
}
|
|
1936
1950
|
deflate(t) {
|
|
1937
1951
|
this.strm.input = t, this.strm.avail_in = this.strm.input.length, this.strm.next_in = 0, this.strm.output = this.outputBuffer, this.strm.avail_out = this.chunkSize, this.strm.next_out = 0;
|
|
1938
|
-
let e =
|
|
1952
|
+
let e = ss(this.strm, es), s = new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);
|
|
1939
1953
|
if (e < 0)
|
|
1940
1954
|
throw new Error("zlib deflate failed");
|
|
1941
1955
|
if (this.strm.avail_in > 0) {
|
|
1942
1956
|
let n = [s], r = s.length;
|
|
1943
1957
|
do {
|
|
1944
|
-
if (this.strm.output = new Uint8Array(this.chunkSize), this.strm.next_out = 0, this.strm.avail_out = this.chunkSize, e =
|
|
1958
|
+
if (this.strm.output = new Uint8Array(this.chunkSize), this.strm.next_out = 0, this.strm.avail_out = this.chunkSize, e = ss(this.strm, es), e < 0)
|
|
1945
1959
|
throw new Error("zlib deflate failed");
|
|
1946
1960
|
let c = new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);
|
|
1947
1961
|
r += c.length, n.push(c);
|
|
@@ -1954,7 +1968,7 @@ class Pr {
|
|
|
1954
1968
|
return this.strm.input = null, this.strm.avail_in = 0, this.strm.next_in = 0, s;
|
|
1955
1969
|
}
|
|
1956
1970
|
}
|
|
1957
|
-
const
|
|
1971
|
+
const u = {
|
|
1958
1972
|
XK_BackSpace: 65288,
|
|
1959
1973
|
/* Back space, back char */
|
|
1960
1974
|
XK_Tab: 65289,
|
|
@@ -2256,7 +2270,7 @@ const f = {
|
|
|
2256
2270
|
XF86XK_Hibernate: 269025192,
|
|
2257
2271
|
XF86XK_AudioMicMute: 269025202,
|
|
2258
2272
|
XF86XK_Next_VMode: 269024802
|
|
2259
|
-
},
|
|
2273
|
+
}, zr = {
|
|
2260
2274
|
256: 960,
|
|
2261
2275
|
// XK_Amacron
|
|
2262
2276
|
257: 992,
|
|
@@ -3575,14 +3589,14 @@ const f = {
|
|
|
3575
3589
|
// XK_kana_conjunctive
|
|
3576
3590
|
12540: 1200
|
|
3577
3591
|
// XK_prolongedsound
|
|
3578
|
-
},
|
|
3592
|
+
}, Or = {
|
|
3579
3593
|
lookup(i) {
|
|
3580
3594
|
if (i >= 32 && i <= 255)
|
|
3581
3595
|
return i;
|
|
3582
|
-
const t =
|
|
3596
|
+
const t = zr[i];
|
|
3583
3597
|
return t !== void 0 ? t : 16777216 | i;
|
|
3584
3598
|
}
|
|
3585
|
-
},
|
|
3599
|
+
}, ns = {
|
|
3586
3600
|
8: "Backspace",
|
|
3587
3601
|
9: "Tab",
|
|
3588
3602
|
10: "NumpadClear",
|
|
@@ -3688,7 +3702,7 @@ const f = {
|
|
|
3688
3702
|
183: "LaunchApp2",
|
|
3689
3703
|
225: "AltRight"
|
|
3690
3704
|
// Only when it is AltGraph
|
|
3691
|
-
},
|
|
3705
|
+
}, rs = {
|
|
3692
3706
|
// 3.1.1.1. Writing System Keys
|
|
3693
3707
|
Backspace: "Backspace",
|
|
3694
3708
|
// 3.1.1.2. Functional Keys
|
|
@@ -3785,195 +3799,195 @@ const f = {
|
|
|
3785
3799
|
AudioVolumeMute: "AudioVolumeMute",
|
|
3786
3800
|
AudioVolumeUp: "AudioVolumeUp",
|
|
3787
3801
|
WakeUp: "WakeUp"
|
|
3788
|
-
},
|
|
3789
|
-
function
|
|
3802
|
+
}, ye = {};
|
|
3803
|
+
function m(i, t) {
|
|
3790
3804
|
if (t === void 0) throw new Error('Undefined keysym for key "' + i + '"');
|
|
3791
|
-
if (i in
|
|
3792
|
-
|
|
3805
|
+
if (i in ye) throw new Error('Duplicate entry for key "' + i + '"');
|
|
3806
|
+
ye[i] = [t, t, t, t];
|
|
3793
3807
|
}
|
|
3794
|
-
function
|
|
3808
|
+
function Mt(i, t, e) {
|
|
3795
3809
|
if (t === void 0) throw new Error('Undefined keysym for key "' + i + '"');
|
|
3796
3810
|
if (e === void 0) throw new Error('Undefined keysym for key "' + i + '"');
|
|
3797
|
-
if (i in
|
|
3798
|
-
|
|
3811
|
+
if (i in ye) throw new Error('Duplicate entry for key "' + i + '"');
|
|
3812
|
+
ye[i] = [t, t, e, t];
|
|
3799
3813
|
}
|
|
3800
3814
|
function U(i, t, e) {
|
|
3801
3815
|
if (t === void 0) throw new Error('Undefined keysym for key "' + i + '"');
|
|
3802
3816
|
if (e === void 0) throw new Error('Undefined keysym for key "' + i + '"');
|
|
3803
|
-
if (i in
|
|
3804
|
-
|
|
3805
|
-
}
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
U("Enter",
|
|
3815
|
-
|
|
3816
|
-
U(" ",
|
|
3817
|
-
U("ArrowDown",
|
|
3818
|
-
U("ArrowLeft",
|
|
3819
|
-
U("ArrowRight",
|
|
3820
|
-
U("ArrowUp",
|
|
3821
|
-
U("End",
|
|
3822
|
-
U("Home",
|
|
3823
|
-
U("PageDown",
|
|
3824
|
-
U("PageUp",
|
|
3825
|
-
|
|
3826
|
-
U("Clear",
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
U("Delete",
|
|
3830
|
-
U("Insert",
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
U("=",
|
|
3961
|
-
U("+",
|
|
3962
|
-
U("-",
|
|
3963
|
-
U("*",
|
|
3964
|
-
U("/",
|
|
3965
|
-
U(".",
|
|
3966
|
-
U(",",
|
|
3967
|
-
U("0",
|
|
3968
|
-
U("1",
|
|
3969
|
-
U("2",
|
|
3970
|
-
U("3",
|
|
3971
|
-
U("4",
|
|
3972
|
-
U("5",
|
|
3973
|
-
U("6",
|
|
3974
|
-
U("7",
|
|
3975
|
-
U("8",
|
|
3976
|
-
U("9",
|
|
3817
|
+
if (i in ye) throw new Error('Duplicate entry for key "' + i + '"');
|
|
3818
|
+
ye[i] = [t, t, t, e];
|
|
3819
|
+
}
|
|
3820
|
+
Mt("Alt", u.XK_Alt_L, u.XK_Alt_R);
|
|
3821
|
+
m("AltGraph", u.XK_ISO_Level3_Shift);
|
|
3822
|
+
m("CapsLock", u.XK_Caps_Lock);
|
|
3823
|
+
Mt("Control", u.XK_Control_L, u.XK_Control_R);
|
|
3824
|
+
Mt("Meta", u.XK_Super_L, u.XK_Super_R);
|
|
3825
|
+
m("NumLock", u.XK_Num_Lock);
|
|
3826
|
+
m("ScrollLock", u.XK_Scroll_Lock);
|
|
3827
|
+
Mt("Shift", u.XK_Shift_L, u.XK_Shift_R);
|
|
3828
|
+
U("Enter", u.XK_Return, u.XK_KP_Enter);
|
|
3829
|
+
m("Tab", u.XK_Tab);
|
|
3830
|
+
U(" ", u.XK_space, u.XK_KP_Space);
|
|
3831
|
+
U("ArrowDown", u.XK_Down, u.XK_KP_Down);
|
|
3832
|
+
U("ArrowLeft", u.XK_Left, u.XK_KP_Left);
|
|
3833
|
+
U("ArrowRight", u.XK_Right, u.XK_KP_Right);
|
|
3834
|
+
U("ArrowUp", u.XK_Up, u.XK_KP_Up);
|
|
3835
|
+
U("End", u.XK_End, u.XK_KP_End);
|
|
3836
|
+
U("Home", u.XK_Home, u.XK_KP_Home);
|
|
3837
|
+
U("PageDown", u.XK_Next, u.XK_KP_Next);
|
|
3838
|
+
U("PageUp", u.XK_Prior, u.XK_KP_Prior);
|
|
3839
|
+
m("Backspace", u.XK_BackSpace);
|
|
3840
|
+
U("Clear", u.XK_Clear, u.XK_KP_Begin);
|
|
3841
|
+
m("Copy", u.XF86XK_Copy);
|
|
3842
|
+
m("Cut", u.XF86XK_Cut);
|
|
3843
|
+
U("Delete", u.XK_Delete, u.XK_KP_Delete);
|
|
3844
|
+
U("Insert", u.XK_Insert, u.XK_KP_Insert);
|
|
3845
|
+
m("Paste", u.XF86XK_Paste);
|
|
3846
|
+
m("Redo", u.XK_Redo);
|
|
3847
|
+
m("Undo", u.XK_Undo);
|
|
3848
|
+
m("Cancel", u.XK_Cancel);
|
|
3849
|
+
m("ContextMenu", u.XK_Menu);
|
|
3850
|
+
m("Escape", u.XK_Escape);
|
|
3851
|
+
m("Execute", u.XK_Execute);
|
|
3852
|
+
m("Find", u.XK_Find);
|
|
3853
|
+
m("Help", u.XK_Help);
|
|
3854
|
+
m("Pause", u.XK_Pause);
|
|
3855
|
+
m("Select", u.XK_Select);
|
|
3856
|
+
m("ZoomIn", u.XF86XK_ZoomIn);
|
|
3857
|
+
m("ZoomOut", u.XF86XK_ZoomOut);
|
|
3858
|
+
m("BrightnessDown", u.XF86XK_MonBrightnessDown);
|
|
3859
|
+
m("BrightnessUp", u.XF86XK_MonBrightnessUp);
|
|
3860
|
+
m("Eject", u.XF86XK_Eject);
|
|
3861
|
+
m("LogOff", u.XF86XK_LogOff);
|
|
3862
|
+
m("Power", u.XF86XK_PowerOff);
|
|
3863
|
+
m("PowerOff", u.XF86XK_PowerDown);
|
|
3864
|
+
m("PrintScreen", u.XK_Print);
|
|
3865
|
+
m("Hibernate", u.XF86XK_Hibernate);
|
|
3866
|
+
m("Standby", u.XF86XK_Standby);
|
|
3867
|
+
m("WakeUp", u.XF86XK_WakeUp);
|
|
3868
|
+
m("AllCandidates", u.XK_MultipleCandidate);
|
|
3869
|
+
m("Alphanumeric", u.XK_Eisu_toggle);
|
|
3870
|
+
m("CodeInput", u.XK_Codeinput);
|
|
3871
|
+
m("Compose", u.XK_Multi_key);
|
|
3872
|
+
m("Convert", u.XK_Henkan);
|
|
3873
|
+
m("GroupFirst", u.XK_ISO_First_Group);
|
|
3874
|
+
m("GroupLast", u.XK_ISO_Last_Group);
|
|
3875
|
+
m("GroupNext", u.XK_ISO_Next_Group);
|
|
3876
|
+
m("GroupPrevious", u.XK_ISO_Prev_Group);
|
|
3877
|
+
m("NonConvert", u.XK_Muhenkan);
|
|
3878
|
+
m("PreviousCandidate", u.XK_PreviousCandidate);
|
|
3879
|
+
m("SingleCandidate", u.XK_SingleCandidate);
|
|
3880
|
+
m("HangulMode", u.XK_Hangul);
|
|
3881
|
+
m("HanjaMode", u.XK_Hangul_Hanja);
|
|
3882
|
+
m("JunjaMode", u.XK_Hangul_Jeonja);
|
|
3883
|
+
m("Eisu", u.XK_Eisu_toggle);
|
|
3884
|
+
m("Hankaku", u.XK_Hankaku);
|
|
3885
|
+
m("Hiragana", u.XK_Hiragana);
|
|
3886
|
+
m("HiraganaKatakana", u.XK_Hiragana_Katakana);
|
|
3887
|
+
m("KanaMode", u.XK_Kana_Shift);
|
|
3888
|
+
m("KanjiMode", u.XK_Kanji);
|
|
3889
|
+
m("Katakana", u.XK_Katakana);
|
|
3890
|
+
m("Romaji", u.XK_Romaji);
|
|
3891
|
+
m("Zenkaku", u.XK_Zenkaku);
|
|
3892
|
+
m("ZenkakuHankaku", u.XK_Zenkaku_Hankaku);
|
|
3893
|
+
m("F1", u.XK_F1);
|
|
3894
|
+
m("F2", u.XK_F2);
|
|
3895
|
+
m("F3", u.XK_F3);
|
|
3896
|
+
m("F4", u.XK_F4);
|
|
3897
|
+
m("F5", u.XK_F5);
|
|
3898
|
+
m("F6", u.XK_F6);
|
|
3899
|
+
m("F7", u.XK_F7);
|
|
3900
|
+
m("F8", u.XK_F8);
|
|
3901
|
+
m("F9", u.XK_F9);
|
|
3902
|
+
m("F10", u.XK_F10);
|
|
3903
|
+
m("F11", u.XK_F11);
|
|
3904
|
+
m("F12", u.XK_F12);
|
|
3905
|
+
m("F13", u.XK_F13);
|
|
3906
|
+
m("F14", u.XK_F14);
|
|
3907
|
+
m("F15", u.XK_F15);
|
|
3908
|
+
m("F16", u.XK_F16);
|
|
3909
|
+
m("F17", u.XK_F17);
|
|
3910
|
+
m("F18", u.XK_F18);
|
|
3911
|
+
m("F19", u.XK_F19);
|
|
3912
|
+
m("F20", u.XK_F20);
|
|
3913
|
+
m("F21", u.XK_F21);
|
|
3914
|
+
m("F22", u.XK_F22);
|
|
3915
|
+
m("F23", u.XK_F23);
|
|
3916
|
+
m("F24", u.XK_F24);
|
|
3917
|
+
m("F25", u.XK_F25);
|
|
3918
|
+
m("F26", u.XK_F26);
|
|
3919
|
+
m("F27", u.XK_F27);
|
|
3920
|
+
m("F28", u.XK_F28);
|
|
3921
|
+
m("F29", u.XK_F29);
|
|
3922
|
+
m("F30", u.XK_F30);
|
|
3923
|
+
m("F31", u.XK_F31);
|
|
3924
|
+
m("F32", u.XK_F32);
|
|
3925
|
+
m("F33", u.XK_F33);
|
|
3926
|
+
m("F34", u.XK_F34);
|
|
3927
|
+
m("F35", u.XK_F35);
|
|
3928
|
+
m("Close", u.XF86XK_Close);
|
|
3929
|
+
m("MailForward", u.XF86XK_MailForward);
|
|
3930
|
+
m("MailReply", u.XF86XK_Reply);
|
|
3931
|
+
m("MailSend", u.XF86XK_Send);
|
|
3932
|
+
m("MediaFastForward", u.XF86XK_AudioForward);
|
|
3933
|
+
m("MediaPause", u.XF86XK_AudioPause);
|
|
3934
|
+
m("MediaPlay", u.XF86XK_AudioPlay);
|
|
3935
|
+
m("MediaRecord", u.XF86XK_AudioRecord);
|
|
3936
|
+
m("MediaRewind", u.XF86XK_AudioRewind);
|
|
3937
|
+
m("MediaStop", u.XF86XK_AudioStop);
|
|
3938
|
+
m("MediaTrackNext", u.XF86XK_AudioNext);
|
|
3939
|
+
m("MediaTrackPrevious", u.XF86XK_AudioPrev);
|
|
3940
|
+
m("New", u.XF86XK_New);
|
|
3941
|
+
m("Open", u.XF86XK_Open);
|
|
3942
|
+
m("Print", u.XK_Print);
|
|
3943
|
+
m("Save", u.XF86XK_Save);
|
|
3944
|
+
m("SpellCheck", u.XF86XK_Spell);
|
|
3945
|
+
m("AudioVolumeDown", u.XF86XK_AudioLowerVolume);
|
|
3946
|
+
m("AudioVolumeUp", u.XF86XK_AudioRaiseVolume);
|
|
3947
|
+
m("AudioVolumeMute", u.XF86XK_AudioMute);
|
|
3948
|
+
m("MicrophoneVolumeMute", u.XF86XK_AudioMicMute);
|
|
3949
|
+
m("LaunchApplication1", u.XF86XK_MyComputer);
|
|
3950
|
+
m("LaunchApplication2", u.XF86XK_Calculator);
|
|
3951
|
+
m("LaunchCalendar", u.XF86XK_Calendar);
|
|
3952
|
+
m("LaunchMail", u.XF86XK_Mail);
|
|
3953
|
+
m("LaunchMediaPlayer", u.XF86XK_AudioMedia);
|
|
3954
|
+
m("LaunchMusicPlayer", u.XF86XK_Music);
|
|
3955
|
+
m("LaunchPhone", u.XF86XK_Phone);
|
|
3956
|
+
m("LaunchScreenSaver", u.XF86XK_ScreenSaver);
|
|
3957
|
+
m("LaunchSpreadsheet", u.XF86XK_Excel);
|
|
3958
|
+
m("LaunchWebBrowser", u.XF86XK_WWW);
|
|
3959
|
+
m("LaunchWebCam", u.XF86XK_WebCam);
|
|
3960
|
+
m("LaunchWordProcessor", u.XF86XK_Word);
|
|
3961
|
+
m("BrowserBack", u.XF86XK_Back);
|
|
3962
|
+
m("BrowserFavorites", u.XF86XK_Favorites);
|
|
3963
|
+
m("BrowserForward", u.XF86XK_Forward);
|
|
3964
|
+
m("BrowserHome", u.XF86XK_HomePage);
|
|
3965
|
+
m("BrowserRefresh", u.XF86XK_Refresh);
|
|
3966
|
+
m("BrowserSearch", u.XF86XK_Search);
|
|
3967
|
+
m("BrowserStop", u.XF86XK_Stop);
|
|
3968
|
+
m("Dimmer", u.XF86XK_BrightnessAdjust);
|
|
3969
|
+
m("MediaAudioTrack", u.XF86XK_AudioCycleTrack);
|
|
3970
|
+
m("RandomToggle", u.XF86XK_AudioRandomPlay);
|
|
3971
|
+
m("SplitScreenToggle", u.XF86XK_SplitScreen);
|
|
3972
|
+
m("Subtitle", u.XF86XK_Subtitle);
|
|
3973
|
+
m("VideoModeNext", u.XF86XK_Next_VMode);
|
|
3974
|
+
U("=", u.XK_equal, u.XK_KP_Equal);
|
|
3975
|
+
U("+", u.XK_plus, u.XK_KP_Add);
|
|
3976
|
+
U("-", u.XK_minus, u.XK_KP_Subtract);
|
|
3977
|
+
U("*", u.XK_asterisk, u.XK_KP_Multiply);
|
|
3978
|
+
U("/", u.XK_slash, u.XK_KP_Divide);
|
|
3979
|
+
U(".", u.XK_period, u.XK_KP_Decimal);
|
|
3980
|
+
U(",", u.XK_comma, u.XK_KP_Separator);
|
|
3981
|
+
U("0", u.XK_0, u.XK_KP_0);
|
|
3982
|
+
U("1", u.XK_1, u.XK_KP_1);
|
|
3983
|
+
U("2", u.XK_2, u.XK_KP_2);
|
|
3984
|
+
U("3", u.XK_3, u.XK_KP_3);
|
|
3985
|
+
U("4", u.XK_4, u.XK_KP_4);
|
|
3986
|
+
U("5", u.XK_5, u.XK_KP_5);
|
|
3987
|
+
U("6", u.XK_6, u.XK_KP_6);
|
|
3988
|
+
U("7", u.XK_7, u.XK_KP_7);
|
|
3989
|
+
U("8", u.XK_8, u.XK_KP_8);
|
|
3990
|
+
U("9", u.XK_9, u.XK_KP_9);
|
|
3977
3991
|
function Ye(i) {
|
|
3978
3992
|
if (i.code) {
|
|
3979
3993
|
switch (i.code) {
|
|
@@ -3984,9 +3998,9 @@ function Ye(i) {
|
|
|
3984
3998
|
}
|
|
3985
3999
|
return i.code;
|
|
3986
4000
|
}
|
|
3987
|
-
if (i.keyCode in
|
|
3988
|
-
let t =
|
|
3989
|
-
if (
|
|
4001
|
+
if (i.keyCode in ns) {
|
|
4002
|
+
let t = ns[i.keyCode];
|
|
4003
|
+
if (Te() && t === "ContextMenu" && (t = "MetaRight"), i.location === 2)
|
|
3990
4004
|
switch (t) {
|
|
3991
4005
|
case "ShiftLeft":
|
|
3992
4006
|
return "ShiftRight";
|
|
@@ -4024,7 +4038,7 @@ function Ye(i) {
|
|
|
4024
4038
|
}
|
|
4025
4039
|
return "Unidentified";
|
|
4026
4040
|
}
|
|
4027
|
-
function
|
|
4041
|
+
function Vr(i) {
|
|
4028
4042
|
if (i.key !== void 0 && i.key !== "Unidentified") {
|
|
4029
4043
|
switch (i.key) {
|
|
4030
4044
|
case "OS":
|
|
@@ -4049,40 +4063,40 @@ function Hr(i) {
|
|
|
4049
4063
|
return i.key === "\0" && i.code === "NumpadDecimal" ? "Delete" : i.key;
|
|
4050
4064
|
}
|
|
4051
4065
|
const t = Ye(i);
|
|
4052
|
-
return t in
|
|
4066
|
+
return t in rs ? rs[t] : i.charCode ? String.fromCharCode(i.charCode) : "Unidentified";
|
|
4053
4067
|
}
|
|
4054
|
-
function
|
|
4055
|
-
const t =
|
|
4068
|
+
function Gr(i) {
|
|
4069
|
+
const t = Vr(i);
|
|
4056
4070
|
if (t === "Unidentified")
|
|
4057
4071
|
return null;
|
|
4058
|
-
if (t in
|
|
4072
|
+
if (t in ye) {
|
|
4059
4073
|
let s = i.location;
|
|
4060
4074
|
if (t === "Meta" && s === 0 && (s = 2), t === "Clear" && s === 3 && Ye(i) === "NumLock" && (s = 0), (s === void 0 || s > 3) && (s = 0), t === "Meta") {
|
|
4061
4075
|
let n = Ye(i);
|
|
4062
4076
|
if (n === "AltLeft")
|
|
4063
|
-
return
|
|
4077
|
+
return u.XK_Meta_L;
|
|
4064
4078
|
if (n === "AltRight")
|
|
4065
|
-
return
|
|
4079
|
+
return u.XK_Meta_R;
|
|
4066
4080
|
}
|
|
4067
4081
|
if (t === "Clear" && Ye(i) === "NumLock")
|
|
4068
|
-
return
|
|
4069
|
-
if (
|
|
4082
|
+
return u.XK_Num_Lock;
|
|
4083
|
+
if (gt())
|
|
4070
4084
|
switch (t) {
|
|
4071
4085
|
case "Zenkaku":
|
|
4072
4086
|
case "Hankaku":
|
|
4073
|
-
return
|
|
4087
|
+
return u.XK_Zenkaku_Hankaku;
|
|
4074
4088
|
case "Romaji":
|
|
4075
4089
|
case "KanaMode":
|
|
4076
|
-
return
|
|
4090
|
+
return u.XK_Romaji;
|
|
4077
4091
|
}
|
|
4078
|
-
return
|
|
4092
|
+
return ye[t][s];
|
|
4079
4093
|
}
|
|
4080
4094
|
if (t.length !== 1)
|
|
4081
4095
|
return null;
|
|
4082
4096
|
const e = t.charCodeAt();
|
|
4083
|
-
return e ?
|
|
4097
|
+
return e ? Or.lookup(e) : null;
|
|
4084
4098
|
}
|
|
4085
|
-
class
|
|
4099
|
+
class Wr {
|
|
4086
4100
|
constructor(t) {
|
|
4087
4101
|
this._target = t || null, this._keyDownList = {}, this._altGrArmed = !1, this._eventHandlers = {
|
|
4088
4102
|
keyup: this._handleKeyUp.bind(this),
|
|
@@ -4100,7 +4114,7 @@ class Or {
|
|
|
4100
4114
|
return;
|
|
4101
4115
|
delete this._keyDownList[e];
|
|
4102
4116
|
}
|
|
4103
|
-
|
|
4117
|
+
Q("onkeyevent " + (s ? "down" : "up") + ", keysym: " + t, ", code: " + e + ", numlock: " + n + ", capslock: " + r), this.onkeyevent(t, e, s, n, r);
|
|
4104
4118
|
}
|
|
4105
4119
|
_getKeyCode(t) {
|
|
4106
4120
|
const e = Ye(t);
|
|
@@ -4118,46 +4132,46 @@ class Or {
|
|
|
4118
4132
|
}
|
|
4119
4133
|
_handleKeyDown(t) {
|
|
4120
4134
|
const e = this._getKeyCode(t);
|
|
4121
|
-
let s =
|
|
4122
|
-
if ((
|
|
4135
|
+
let s = Gr(t), n = t.getModifierState("NumLock"), r = t.getModifierState("CapsLock");
|
|
4136
|
+
if ((Te() || Pe()) && (n = null), this._altGrArmed && (this._altGrArmed = !1, clearTimeout(this._altGrTimeout), e === "AltRight" && t.timeStamp - this._altGrCtrlTime < 50 ? s = u.XK_ISO_Level3_Shift : this._sendKeyEvent(u.XK_Control_L, "ControlLeft", !0, n, r)), e === "Unidentified") {
|
|
4123
4137
|
s && (this._sendKeyEvent(s, e, !0, n, r), this._sendKeyEvent(s, e, !1, n, r)), Xe(t);
|
|
4124
4138
|
return;
|
|
4125
4139
|
}
|
|
4126
|
-
if (
|
|
4140
|
+
if (Te() || Pe())
|
|
4127
4141
|
switch (s) {
|
|
4128
|
-
case
|
|
4129
|
-
s =
|
|
4142
|
+
case u.XK_Super_L:
|
|
4143
|
+
s = u.XK_Alt_L;
|
|
4130
4144
|
break;
|
|
4131
|
-
case
|
|
4132
|
-
s =
|
|
4145
|
+
case u.XK_Super_R:
|
|
4146
|
+
s = u.XK_Super_L;
|
|
4133
4147
|
break;
|
|
4134
|
-
case
|
|
4135
|
-
s =
|
|
4148
|
+
case u.XK_Alt_L:
|
|
4149
|
+
s = u.XK_Mode_switch;
|
|
4136
4150
|
break;
|
|
4137
|
-
case
|
|
4138
|
-
s =
|
|
4151
|
+
case u.XK_Alt_R:
|
|
4152
|
+
s = u.XK_ISO_Level3_Shift;
|
|
4139
4153
|
break;
|
|
4140
4154
|
}
|
|
4141
|
-
if (e in this._keyDownList && (s = this._keyDownList[e]), (
|
|
4155
|
+
if (e in this._keyDownList && (s = this._keyDownList[e]), (Te() || Pe()) && t.metaKey && e !== "MetaLeft" && e !== "MetaRight") {
|
|
4142
4156
|
this._sendKeyEvent(s, e, !0, n, r), this._sendKeyEvent(s, e, !1, n, r), Xe(t);
|
|
4143
4157
|
return;
|
|
4144
4158
|
}
|
|
4145
|
-
if ((
|
|
4146
|
-
this._sendKeyEvent(
|
|
4159
|
+
if ((Te() || Pe()) && e === "CapsLock") {
|
|
4160
|
+
this._sendKeyEvent(u.XK_Caps_Lock, "CapsLock", !0, n, r), this._sendKeyEvent(u.XK_Caps_Lock, "CapsLock", !1, n, r), Xe(t);
|
|
4147
4161
|
return;
|
|
4148
4162
|
}
|
|
4149
4163
|
const a = [
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4164
|
+
u.XK_Zenkaku_Hankaku,
|
|
4165
|
+
u.XK_Eisu_toggle,
|
|
4166
|
+
u.XK_Katakana,
|
|
4167
|
+
u.XK_Hiragana,
|
|
4168
|
+
u.XK_Romaji
|
|
4155
4169
|
];
|
|
4156
|
-
if (
|
|
4170
|
+
if (gt() && a.includes(s)) {
|
|
4157
4171
|
this._sendKeyEvent(s, e, !0, n, r), this._sendKeyEvent(s, e, !1, n, r), Xe(t);
|
|
4158
4172
|
return;
|
|
4159
4173
|
}
|
|
4160
|
-
if (Xe(t), e === "ControlLeft" &&
|
|
4174
|
+
if (Xe(t), e === "ControlLeft" && gt() && !("ControlLeft" in this._keyDownList)) {
|
|
4161
4175
|
this._altGrArmed = !0, this._altGrTimeout = setTimeout(this._interruptAltGrSequence.bind(this), 100), this._altGrCtrlTime = t.timeStamp;
|
|
4162
4176
|
return;
|
|
4163
4177
|
}
|
|
@@ -4166,11 +4180,11 @@ class Or {
|
|
|
4166
4180
|
_handleKeyUp(t) {
|
|
4167
4181
|
Xe(t);
|
|
4168
4182
|
const e = this._getKeyCode(t);
|
|
4169
|
-
if (this._interruptAltGrSequence(), (
|
|
4170
|
-
this._sendKeyEvent(
|
|
4183
|
+
if (this._interruptAltGrSequence(), (Te() || Pe()) && e === "CapsLock") {
|
|
4184
|
+
this._sendKeyEvent(u.XK_Caps_Lock, "CapsLock", !0), this._sendKeyEvent(u.XK_Caps_Lock, "CapsLock", !1);
|
|
4171
4185
|
return;
|
|
4172
4186
|
}
|
|
4173
|
-
this._sendKeyEvent(this._keyDownList[e], e, !1),
|
|
4187
|
+
this._sendKeyEvent(this._keyDownList[e], e, !1), gt() && (e === "ShiftLeft" || e === "ShiftRight") && ("ShiftRight" in this._keyDownList && this._sendKeyEvent(
|
|
4174
4188
|
this._keyDownList.ShiftRight,
|
|
4175
4189
|
"ShiftRight",
|
|
4176
4190
|
!1
|
|
@@ -4181,13 +4195,13 @@ class Or {
|
|
|
4181
4195
|
));
|
|
4182
4196
|
}
|
|
4183
4197
|
_interruptAltGrSequence() {
|
|
4184
|
-
this._altGrArmed && (this._altGrArmed = !1, clearTimeout(this._altGrTimeout), this._sendKeyEvent(
|
|
4198
|
+
this._altGrArmed && (this._altGrArmed = !1, clearTimeout(this._altGrTimeout), this._sendKeyEvent(u.XK_Control_L, "ControlLeft", !0));
|
|
4185
4199
|
}
|
|
4186
4200
|
_allKeysUp() {
|
|
4187
|
-
|
|
4201
|
+
Q(">> Keyboard.allKeysUp"), this._interruptAltGrSequence();
|
|
4188
4202
|
for (let t in this._keyDownList)
|
|
4189
4203
|
this._sendKeyEvent(this._keyDownList[t], t, !1);
|
|
4190
|
-
|
|
4204
|
+
Q("<< Keyboard.allKeysUp");
|
|
4191
4205
|
}
|
|
4192
4206
|
// ===== PUBLIC METHODS =====
|
|
4193
4207
|
grab() {
|
|
@@ -4197,10 +4211,10 @@ class Or {
|
|
|
4197
4211
|
this._target.removeEventListener("keydown", this._eventHandlers.keydown), this._target.removeEventListener("keyup", this._eventHandlers.keyup), window.removeEventListener("blur", this._eventHandlers.blur), this._allKeysUp();
|
|
4198
4212
|
}
|
|
4199
4213
|
}
|
|
4200
|
-
const ce = 0,
|
|
4201
|
-
class
|
|
4214
|
+
const ce = 0, as = 1, os = 2, hs = 4, ls = 8, qt = 16, Ne = 32, He = 64, Jt = 127, cs = 50, Zr = 90, _s = 250, Yr = 1e3, jr = 1e3, qr = 50;
|
|
4215
|
+
class Jr {
|
|
4202
4216
|
constructor() {
|
|
4203
|
-
this._target = null, this._state =
|
|
4217
|
+
this._target = null, this._state = Jt, this._tracked = [], this._ignored = [], this._waitingRelease = !1, this._releaseStart = 0, this._longpressTimeoutId = null, this._twoTouchTimeoutId = null, this._boundEventHandler = this._eventHandler.bind(this);
|
|
4204
4218
|
}
|
|
4205
4219
|
attach(t) {
|
|
4206
4220
|
this.detach(), this._target = t, this._target.addEventListener(
|
|
@@ -4256,7 +4270,7 @@ class Yr {
|
|
|
4256
4270
|
this._ignored.push(t);
|
|
4257
4271
|
return;
|
|
4258
4272
|
}
|
|
4259
|
-
if (this._tracked.length > 0 && Date.now() - this._tracked[0].started >
|
|
4273
|
+
if (this._tracked.length > 0 && Date.now() - this._tracked[0].started > _s) {
|
|
4260
4274
|
this._state = ce, this._ignored.push(t);
|
|
4261
4275
|
return;
|
|
4262
4276
|
}
|
|
@@ -4294,16 +4308,16 @@ class Yr {
|
|
|
4294
4308
|
n.lastX = e, n.lastY = s;
|
|
4295
4309
|
let r = e - n.firstX, a = s - n.firstY;
|
|
4296
4310
|
if ((n.firstX !== n.lastX || n.firstY !== n.lastY) && (n.angle = Math.atan2(a, r) * 180 / Math.PI), !this._hasDetectedGesture()) {
|
|
4297
|
-
if (Math.hypot(r, a) <
|
|
4311
|
+
if (Math.hypot(r, a) < cs)
|
|
4298
4312
|
return;
|
|
4299
|
-
if (this._state &= -24, this._stopLongpressTimeout(), this._tracked.length !== 1 && (this._state &= ~
|
|
4313
|
+
if (this._state &= -24, this._stopLongpressTimeout(), this._tracked.length !== 1 && (this._state &= ~ls), this._tracked.length !== 2 && (this._state &= -97), this._tracked.length === 2) {
|
|
4300
4314
|
let h = this._tracked.find((o) => o.id !== t);
|
|
4301
4315
|
if (Math.hypot(
|
|
4302
4316
|
h.firstX - h.lastX,
|
|
4303
4317
|
h.firstY - h.lastY
|
|
4304
|
-
) >
|
|
4318
|
+
) > cs) {
|
|
4305
4319
|
let o = Math.abs(n.angle - h.angle);
|
|
4306
|
-
o = Math.abs((o + 180) % 360 - 180), o >
|
|
4320
|
+
o = Math.abs((o + 180) % 360 - 180), o > Zr ? this._state &= ~Ne : this._state &= ~He, this._isTwoTouchTimeoutRunning() && this._stopTwoTouchTimeout();
|
|
4307
4321
|
} else this._isTwoTouchTimeoutRunning() || this._startTwoTouchTimeout();
|
|
4308
4322
|
}
|
|
4309
4323
|
if (!this._hasDetectedGesture())
|
|
@@ -4314,10 +4328,10 @@ class Yr {
|
|
|
4314
4328
|
}
|
|
4315
4329
|
_touchEnd(t, e, s) {
|
|
4316
4330
|
if (this._ignored.indexOf(t) !== -1) {
|
|
4317
|
-
this._ignored.splice(this._ignored.indexOf(t), 1), this._ignored.length === 0 && this._tracked.length === 0 && (this._state =
|
|
4331
|
+
this._ignored.splice(this._ignored.indexOf(t), 1), this._ignored.length === 0 && this._tracked.length === 0 && (this._state = Jt, this._waitingRelease = !1);
|
|
4318
4332
|
return;
|
|
4319
4333
|
}
|
|
4320
|
-
if (!this._hasDetectedGesture() && this._isTwoTouchTimeoutRunning() && (this._stopTwoTouchTimeout(), this._state = ce), !this._hasDetectedGesture() && (this._state &= -105, this._state &= ~
|
|
4334
|
+
if (!this._hasDetectedGesture() && this._isTwoTouchTimeoutRunning() && (this._stopTwoTouchTimeout(), this._state = ce), !this._hasDetectedGesture() && (this._state &= -105, this._state &= ~qt, this._stopLongpressTimeout(), !this._waitingRelease))
|
|
4321
4335
|
switch (this._releaseStart = Date.now(), this._waitingRelease = !0, this._tracked.length) {
|
|
4322
4336
|
case 1:
|
|
4323
4337
|
this._state &= -7;
|
|
@@ -4327,7 +4341,7 @@ class Yr {
|
|
|
4327
4341
|
break;
|
|
4328
4342
|
}
|
|
4329
4343
|
if (this._waitingRelease) {
|
|
4330
|
-
Date.now() - this._releaseStart >
|
|
4344
|
+
Date.now() - this._releaseStart > _s && (this._state = ce), this._tracked.some((r) => Date.now() - r.started > Yr) && (this._state = ce);
|
|
4331
4345
|
let n = this._tracked.find((r) => r.id === t);
|
|
4332
4346
|
if (n.active = !1, this._hasDetectedGesture())
|
|
4333
4347
|
this._pushEvent("gesturestart");
|
|
@@ -4337,15 +4351,15 @@ class Yr {
|
|
|
4337
4351
|
this._hasDetectedGesture() && this._pushEvent("gestureend");
|
|
4338
4352
|
for (let n = 0; n < this._tracked.length; n++)
|
|
4339
4353
|
this._tracked[n].active && this._ignored.push(this._tracked[n].id);
|
|
4340
|
-
this._tracked = [], this._state = ce, this._ignored.indexOf(t) !== -1 && this._ignored.splice(this._ignored.indexOf(t), 1), this._ignored.length === 0 && (this._state =
|
|
4354
|
+
this._tracked = [], this._state = ce, this._ignored.indexOf(t) !== -1 && this._ignored.splice(this._ignored.indexOf(t), 1), this._ignored.length === 0 && (this._state = Jt, this._waitingRelease = !1);
|
|
4341
4355
|
}
|
|
4342
4356
|
_hasDetectedGesture() {
|
|
4343
|
-
return !(this._state === ce || this._state & this._state - 1 || this._state & (
|
|
4357
|
+
return !(this._state === ce || this._state & this._state - 1 || this._state & (as | os | hs) && this._tracked.some((t) => t.active));
|
|
4344
4358
|
}
|
|
4345
4359
|
_startLongpressTimeout() {
|
|
4346
4360
|
this._stopLongpressTimeout(), this._longpressTimeoutId = setTimeout(
|
|
4347
4361
|
() => this._longpressTimeout(),
|
|
4348
|
-
|
|
4362
|
+
jr
|
|
4349
4363
|
);
|
|
4350
4364
|
}
|
|
4351
4365
|
_stopLongpressTimeout() {
|
|
@@ -4354,12 +4368,12 @@ class Yr {
|
|
|
4354
4368
|
_longpressTimeout() {
|
|
4355
4369
|
if (this._hasDetectedGesture())
|
|
4356
4370
|
throw new Error("A longpress gesture failed, conflict with a different gesture");
|
|
4357
|
-
this._state =
|
|
4371
|
+
this._state = qt, this._pushEvent("gesturestart");
|
|
4358
4372
|
}
|
|
4359
4373
|
_startTwoTouchTimeout() {
|
|
4360
4374
|
this._stopTwoTouchTimeout(), this._twoTouchTimeoutId = setTimeout(
|
|
4361
4375
|
() => this._twoTouchTimeout(),
|
|
4362
|
-
|
|
4376
|
+
qr
|
|
4363
4377
|
);
|
|
4364
4378
|
}
|
|
4365
4379
|
_stopTwoTouchTimeout() {
|
|
@@ -4397,15 +4411,15 @@ class Yr {
|
|
|
4397
4411
|
}
|
|
4398
4412
|
_stateToGesture(t) {
|
|
4399
4413
|
switch (t) {
|
|
4400
|
-
case rs:
|
|
4401
|
-
return "onetap";
|
|
4402
4414
|
case as:
|
|
4403
|
-
return "
|
|
4415
|
+
return "onetap";
|
|
4404
4416
|
case os:
|
|
4405
|
-
return "
|
|
4417
|
+
return "twotap";
|
|
4406
4418
|
case hs:
|
|
4419
|
+
return "threetap";
|
|
4420
|
+
case ls:
|
|
4407
4421
|
return "drag";
|
|
4408
|
-
case
|
|
4422
|
+
case qt:
|
|
4409
4423
|
return "longpress";
|
|
4410
4424
|
case Ne:
|
|
4411
4425
|
return "twodrag";
|
|
@@ -4454,8 +4468,8 @@ class Yr {
|
|
|
4454
4468
|
};
|
|
4455
4469
|
}
|
|
4456
4470
|
}
|
|
4457
|
-
const ze = !
|
|
4458
|
-
class
|
|
4471
|
+
const ze = !mn || Is;
|
|
4472
|
+
class $r {
|
|
4459
4473
|
constructor() {
|
|
4460
4474
|
this._target = null, this._canvas = document.createElement("canvas"), ze && (this._canvas.style.position = "fixed", this._canvas.style.zIndex = "65535", this._canvas.style.pointerEvents = "none", this._canvas.style.userSelect = "none", this._canvas.style.WebkitUserSelect = "none", this._canvas.style.visibility = "hidden"), this._position = { x: 0, y: 0 }, this._hotSpot = { x: 0, y: 0 }, this._eventHandlers = {
|
|
4461
4475
|
mouseover: this._handleMouseOver.bind(this),
|
|
@@ -4549,17 +4563,17 @@ class jr {
|
|
|
4549
4563
|
return document.captureElement && document.documentElement.contains(document.captureElement);
|
|
4550
4564
|
}
|
|
4551
4565
|
}
|
|
4552
|
-
const
|
|
4566
|
+
const $t = 40 * 1024 * 1024, _t = {
|
|
4553
4567
|
CONNECTING: "connecting",
|
|
4554
4568
|
OPEN: "open",
|
|
4555
4569
|
CLOSING: "closing",
|
|
4556
4570
|
CLOSED: "closed"
|
|
4557
|
-
},
|
|
4571
|
+
}, ut = {
|
|
4558
4572
|
CONNECTING: [WebSocket.CONNECTING, _t.CONNECTING],
|
|
4559
4573
|
OPEN: [WebSocket.OPEN, _t.OPEN],
|
|
4560
4574
|
CLOSING: [WebSocket.CLOSING, _t.CLOSING],
|
|
4561
4575
|
CLOSED: [WebSocket.CLOSED, _t.CLOSED]
|
|
4562
|
-
},
|
|
4576
|
+
}, us = [
|
|
4563
4577
|
"send",
|
|
4564
4578
|
"close",
|
|
4565
4579
|
"binaryType",
|
|
@@ -4569,7 +4583,7 @@ const Jt = 40 * 1024 * 1024, _t = {
|
|
|
4569
4583
|
"protocol",
|
|
4570
4584
|
"readyState"
|
|
4571
4585
|
];
|
|
4572
|
-
class
|
|
4586
|
+
class ea {
|
|
4573
4587
|
constructor() {
|
|
4574
4588
|
this._websocket = null, this._rQi = 0, this._rQlen = 0, this._rQbufferSize = 1024 * 1024 * 4, this._rQ = null, this._sQbufferSize = 1024 * 10, this._sQlen = 0, this._sQ = null, this._eventHandlers = {
|
|
4575
4589
|
message: () => {
|
|
@@ -4585,7 +4599,7 @@ class qr {
|
|
|
4585
4599
|
// Getters and setters
|
|
4586
4600
|
get readyState() {
|
|
4587
4601
|
let t;
|
|
4588
|
-
return this._websocket === null ? "unused" : (t = this._websocket.readyState,
|
|
4602
|
+
return this._websocket === null ? "unused" : (t = this._websocket.readyState, ut.CONNECTING.includes(t) ? "connecting" : ut.OPEN.includes(t) ? "open" : ut.CLOSING.includes(t) ? "closing" : ut.CLOSED.includes(t) ? "closed" : "unknown");
|
|
4589
4603
|
}
|
|
4590
4604
|
// Receive queue
|
|
4591
4605
|
rQpeek8() {
|
|
@@ -4691,17 +4705,17 @@ class qr {
|
|
|
4691
4705
|
attach(t) {
|
|
4692
4706
|
this.init();
|
|
4693
4707
|
const e = [...Object.keys(t), ...Object.getOwnPropertyNames(Object.getPrototypeOf(t))];
|
|
4694
|
-
for (let s = 0; s <
|
|
4695
|
-
const n =
|
|
4708
|
+
for (let s = 0; s < us.length; s++) {
|
|
4709
|
+
const n = us[s];
|
|
4696
4710
|
if (e.indexOf(n) < 0)
|
|
4697
4711
|
throw new Error("Raw channel missing property: " + n);
|
|
4698
4712
|
}
|
|
4699
4713
|
this._websocket = t, this._websocket.binaryType = "arraybuffer", this._websocket.onmessage = this._recvMessage.bind(this), this._websocket.onopen = () => {
|
|
4700
|
-
|
|
4714
|
+
Q(">> WebSock.onopen"), this._websocket.protocol && $("Server choose sub-protocol: " + this._websocket.protocol), this._eventHandlers.open(), Q("<< WebSock.onopen");
|
|
4701
4715
|
}, this._websocket.onclose = (s) => {
|
|
4702
|
-
|
|
4716
|
+
Q(">> WebSock.onclose"), this._eventHandlers.close(s), Q("<< WebSock.onclose");
|
|
4703
4717
|
}, this._websocket.onerror = (s) => {
|
|
4704
|
-
|
|
4718
|
+
Q(">> WebSock.onerror: " + s), this._eventHandlers.error(s), Q("<< WebSock.onerror: " + s);
|
|
4705
4719
|
};
|
|
4706
4720
|
}
|
|
4707
4721
|
close() {
|
|
@@ -4716,8 +4730,8 @@ class qr {
|
|
|
4716
4730
|
// unnecessary copying.
|
|
4717
4731
|
_expandCompactRQ(t) {
|
|
4718
4732
|
const e = (this._rQlen - this._rQi + t) * 8, s = this._rQbufferSize < e;
|
|
4719
|
-
if (s && (this._rQbufferSize = Math.max(this._rQbufferSize * 2, e)), this._rQbufferSize >
|
|
4720
|
-
throw new Error("Receive queue buffer exceeded " +
|
|
4733
|
+
if (s && (this._rQbufferSize = Math.max(this._rQbufferSize * 2, e)), this._rQbufferSize > $t && (this._rQbufferSize = $t, this._rQbufferSize - (this._rQlen - this._rQi) < t))
|
|
4734
|
+
throw new Error("Receive queue buffer exceeded " + $t + " bytes, and the new message could not fit");
|
|
4721
4735
|
if (s) {
|
|
4722
4736
|
const n = this._rQ.buffer;
|
|
4723
4737
|
this._rQ = new Uint8Array(this._rQbufferSize), this._rQ.set(new Uint8Array(n, this._rQi, this._rQlen - this._rQi));
|
|
@@ -4729,10 +4743,10 @@ class qr {
|
|
|
4729
4743
|
_recvMessage(t) {
|
|
4730
4744
|
this._rQlen == this._rQi && (this._rQlen = 0, this._rQi = 0);
|
|
4731
4745
|
const e = new Uint8Array(t.data);
|
|
4732
|
-
e.length > this._rQbufferSize - this._rQlen && this._expandCompactRQ(e.length), this._rQ.set(e, this._rQlen), this._rQlen += e.length, this._rQlen - this._rQi > 0 ? this._eventHandlers.message() :
|
|
4746
|
+
e.length > this._rQbufferSize - this._rQlen && this._expandCompactRQ(e.length), this._rQ.set(e, this._rQlen), this._rQlen += e.length, this._rQlen - this._rQi > 0 ? this._eventHandlers.message() : Q("Ignoring empty message");
|
|
4733
4747
|
}
|
|
4734
4748
|
}
|
|
4735
|
-
const
|
|
4749
|
+
const ta = {
|
|
4736
4750
|
Again: 57349,
|
|
4737
4751
|
/* html:Again (Again) -> linux:129 (KEY_AGAIN) -> atset1:57349 */
|
|
4738
4752
|
AltLeft: 56,
|
|
@@ -5090,7 +5104,7 @@ const Jr = {
|
|
|
5090
5104
|
pseudoEncodingVMwareCursor: 1464686180,
|
|
5091
5105
|
pseudoEncodingExtendedClipboard: 3231835598
|
|
5092
5106
|
};
|
|
5093
|
-
class
|
|
5107
|
+
class _i {
|
|
5094
5108
|
constructor() {
|
|
5095
5109
|
this._key = null;
|
|
5096
5110
|
}
|
|
@@ -5098,7 +5112,7 @@ class ci {
|
|
|
5098
5112
|
return { name: "AES-ECB" };
|
|
5099
5113
|
}
|
|
5100
5114
|
static async importKey(t, e, s, n) {
|
|
5101
|
-
const r = new
|
|
5115
|
+
const r = new _i();
|
|
5102
5116
|
return await r._importKey(t, s, n), r;
|
|
5103
5117
|
}
|
|
5104
5118
|
async _importKey(t, e, s) {
|
|
@@ -5125,7 +5139,7 @@ class ci {
|
|
|
5125
5139
|
return s;
|
|
5126
5140
|
}
|
|
5127
5141
|
}
|
|
5128
|
-
class
|
|
5142
|
+
class ui {
|
|
5129
5143
|
constructor() {
|
|
5130
5144
|
this._rawKey = null, this._ctrKey = null, this._cbcKey = null, this._zeroBlock = new Uint8Array(16), this._prefixBlock0 = this._zeroBlock, this._prefixBlock1 = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]), this._prefixBlock2 = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2]);
|
|
5131
5145
|
}
|
|
@@ -5181,7 +5195,7 @@ class _i {
|
|
|
5181
5195
|
return h = new Uint8Array(h), h.slice(h.length - 32, h.length - 16);
|
|
5182
5196
|
}
|
|
5183
5197
|
static async importKey(t, e, s, n) {
|
|
5184
|
-
const r = new
|
|
5198
|
+
const r = new ui();
|
|
5185
5199
|
return await r._importKey(t), r;
|
|
5186
5200
|
}
|
|
5187
5201
|
async _importKey(t) {
|
|
@@ -5208,12 +5222,12 @@ class _i {
|
|
|
5208
5222
|
}
|
|
5209
5223
|
async decrypt(t, e) {
|
|
5210
5224
|
const s = e.slice(0, e.length - 16), n = t.additionalData, r = t.iv, a = e.slice(e.length - 16), h = await this._computeCMAC(r, this._prefixBlock0), c = await this._computeCMAC(n, this._prefixBlock1), o = await this._computeCMAC(s, this._prefixBlock2);
|
|
5211
|
-
for (let
|
|
5212
|
-
o[
|
|
5225
|
+
for (let f = 0; f < 16; f++)
|
|
5226
|
+
o[f] ^= h[f] ^ c[f];
|
|
5213
5227
|
if (o.length !== a.length)
|
|
5214
5228
|
return null;
|
|
5215
|
-
for (let
|
|
5216
|
-
if (o[
|
|
5229
|
+
for (let f = 0; f < a.length; f++)
|
|
5230
|
+
if (o[f] !== a[f])
|
|
5217
5231
|
return null;
|
|
5218
5232
|
return await this._decryptCTR(s, h);
|
|
5219
5233
|
}
|
|
@@ -5267,475 +5281,475 @@ const fs = [
|
|
|
5267
5281
|
35,
|
|
5268
5282
|
28,
|
|
5269
5283
|
31
|
|
5270
|
-
],
|
|
5271
|
-
let p, g,
|
|
5284
|
+
], ia = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28], _ = 0;
|
|
5285
|
+
let p, g, y, b, w, v;
|
|
5272
5286
|
p = 65536;
|
|
5273
5287
|
g = 1 << 24;
|
|
5274
|
-
|
|
5288
|
+
y = p | g;
|
|
5275
5289
|
b = 4;
|
|
5276
5290
|
w = 1024;
|
|
5277
|
-
|
|
5278
|
-
const
|
|
5279
|
-
|
|
5291
|
+
v = b | w;
|
|
5292
|
+
const ds = [
|
|
5293
|
+
y | w,
|
|
5280
5294
|
_ | _,
|
|
5281
5295
|
p | _,
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
p |
|
|
5296
|
+
y | v,
|
|
5297
|
+
y | b,
|
|
5298
|
+
p | v,
|
|
5285
5299
|
_ | b,
|
|
5286
5300
|
p | _,
|
|
5287
5301
|
_ | w,
|
|
5288
|
-
|
|
5289
|
-
|
|
5302
|
+
y | w,
|
|
5303
|
+
y | v,
|
|
5290
5304
|
_ | w,
|
|
5291
|
-
g |
|
|
5292
|
-
|
|
5305
|
+
g | v,
|
|
5306
|
+
y | b,
|
|
5293
5307
|
g | _,
|
|
5294
5308
|
_ | b,
|
|
5295
|
-
_ |
|
|
5309
|
+
_ | v,
|
|
5296
5310
|
g | w,
|
|
5297
5311
|
g | w,
|
|
5298
5312
|
p | w,
|
|
5299
5313
|
p | w,
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
g |
|
|
5314
|
+
y | _,
|
|
5315
|
+
y | _,
|
|
5316
|
+
g | v,
|
|
5303
5317
|
p | b,
|
|
5304
5318
|
g | b,
|
|
5305
5319
|
g | b,
|
|
5306
5320
|
p | b,
|
|
5307
5321
|
_ | _,
|
|
5308
|
-
_ |
|
|
5309
|
-
p |
|
|
5322
|
+
_ | v,
|
|
5323
|
+
p | v,
|
|
5310
5324
|
g | _,
|
|
5311
5325
|
p | _,
|
|
5312
|
-
|
|
5326
|
+
y | v,
|
|
5313
5327
|
_ | b,
|
|
5314
|
-
|
|
5315
|
-
|
|
5328
|
+
y | _,
|
|
5329
|
+
y | w,
|
|
5316
5330
|
g | _,
|
|
5317
5331
|
g | _,
|
|
5318
5332
|
_ | w,
|
|
5319
|
-
|
|
5333
|
+
y | b,
|
|
5320
5334
|
p | _,
|
|
5321
5335
|
p | w,
|
|
5322
5336
|
g | b,
|
|
5323
5337
|
_ | w,
|
|
5324
5338
|
_ | b,
|
|
5325
|
-
g |
|
|
5326
|
-
p |
|
|
5327
|
-
|
|
5339
|
+
g | v,
|
|
5340
|
+
p | v,
|
|
5341
|
+
y | v,
|
|
5328
5342
|
p | b,
|
|
5329
|
-
|
|
5330
|
-
g |
|
|
5343
|
+
y | _,
|
|
5344
|
+
g | v,
|
|
5331
5345
|
g | b,
|
|
5332
|
-
_ |
|
|
5333
|
-
p |
|
|
5334
|
-
|
|
5335
|
-
_ |
|
|
5346
|
+
_ | v,
|
|
5347
|
+
p | v,
|
|
5348
|
+
y | w,
|
|
5349
|
+
_ | v,
|
|
5336
5350
|
g | w,
|
|
5337
5351
|
g | w,
|
|
5338
5352
|
_ | _,
|
|
5339
5353
|
p | b,
|
|
5340
5354
|
p | w,
|
|
5341
5355
|
_ | _,
|
|
5342
|
-
|
|
5356
|
+
y | b
|
|
5343
5357
|
];
|
|
5344
5358
|
p = 1 << 20;
|
|
5345
5359
|
g = 1 << 31;
|
|
5346
|
-
|
|
5360
|
+
y = p | g;
|
|
5347
5361
|
b = 32;
|
|
5348
5362
|
w = 32768;
|
|
5349
|
-
|
|
5350
|
-
const
|
|
5351
|
-
|
|
5363
|
+
v = b | w;
|
|
5364
|
+
const xs = [
|
|
5365
|
+
y | v,
|
|
5352
5366
|
g | w,
|
|
5353
5367
|
_ | w,
|
|
5354
|
-
p |
|
|
5368
|
+
p | v,
|
|
5355
5369
|
p | _,
|
|
5356
5370
|
_ | b,
|
|
5357
|
-
|
|
5358
|
-
g |
|
|
5371
|
+
y | b,
|
|
5372
|
+
g | v,
|
|
5359
5373
|
g | b,
|
|
5360
|
-
|
|
5361
|
-
|
|
5374
|
+
y | v,
|
|
5375
|
+
y | w,
|
|
5362
5376
|
g | _,
|
|
5363
5377
|
g | w,
|
|
5364
5378
|
p | _,
|
|
5365
5379
|
_ | b,
|
|
5366
|
-
|
|
5380
|
+
y | b,
|
|
5367
5381
|
p | w,
|
|
5368
5382
|
p | b,
|
|
5369
|
-
g |
|
|
5383
|
+
g | v,
|
|
5370
5384
|
_ | _,
|
|
5371
5385
|
g | _,
|
|
5372
5386
|
_ | w,
|
|
5373
|
-
p |
|
|
5374
|
-
|
|
5387
|
+
p | v,
|
|
5388
|
+
y | _,
|
|
5375
5389
|
p | b,
|
|
5376
5390
|
g | b,
|
|
5377
5391
|
_ | _,
|
|
5378
5392
|
p | w,
|
|
5379
|
-
_ |
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
_ |
|
|
5393
|
+
_ | v,
|
|
5394
|
+
y | w,
|
|
5395
|
+
y | _,
|
|
5396
|
+
_ | v,
|
|
5383
5397
|
_ | _,
|
|
5384
|
-
p |
|
|
5385
|
-
|
|
5398
|
+
p | v,
|
|
5399
|
+
y | b,
|
|
5386
5400
|
p | _,
|
|
5387
|
-
g |
|
|
5388
|
-
|
|
5389
|
-
|
|
5401
|
+
g | v,
|
|
5402
|
+
y | _,
|
|
5403
|
+
y | w,
|
|
5390
5404
|
_ | w,
|
|
5391
|
-
|
|
5405
|
+
y | _,
|
|
5392
5406
|
g | w,
|
|
5393
5407
|
_ | b,
|
|
5394
|
-
|
|
5395
|
-
p |
|
|
5408
|
+
y | v,
|
|
5409
|
+
p | v,
|
|
5396
5410
|
_ | b,
|
|
5397
5411
|
_ | w,
|
|
5398
5412
|
g | _,
|
|
5399
|
-
_ |
|
|
5400
|
-
|
|
5413
|
+
_ | v,
|
|
5414
|
+
y | w,
|
|
5401
5415
|
p | _,
|
|
5402
5416
|
g | b,
|
|
5403
5417
|
p | b,
|
|
5404
|
-
g |
|
|
5418
|
+
g | v,
|
|
5405
5419
|
g | b,
|
|
5406
5420
|
p | b,
|
|
5407
5421
|
p | w,
|
|
5408
5422
|
_ | _,
|
|
5409
5423
|
g | w,
|
|
5410
|
-
_ |
|
|
5424
|
+
_ | v,
|
|
5411
5425
|
g | _,
|
|
5412
|
-
|
|
5413
|
-
|
|
5426
|
+
y | b,
|
|
5427
|
+
y | v,
|
|
5414
5428
|
p | w
|
|
5415
5429
|
];
|
|
5416
5430
|
p = 1 << 17;
|
|
5417
5431
|
g = 1 << 27;
|
|
5418
|
-
|
|
5432
|
+
y = p | g;
|
|
5419
5433
|
b = 8;
|
|
5420
5434
|
w = 512;
|
|
5421
|
-
|
|
5422
|
-
const
|
|
5423
|
-
_ |
|
|
5424
|
-
|
|
5435
|
+
v = b | w;
|
|
5436
|
+
const ps = [
|
|
5437
|
+
_ | v,
|
|
5438
|
+
y | w,
|
|
5425
5439
|
_ | _,
|
|
5426
|
-
|
|
5440
|
+
y | b,
|
|
5427
5441
|
g | w,
|
|
5428
5442
|
_ | _,
|
|
5429
|
-
p |
|
|
5443
|
+
p | v,
|
|
5430
5444
|
g | w,
|
|
5431
5445
|
p | b,
|
|
5432
5446
|
g | b,
|
|
5433
5447
|
g | b,
|
|
5434
5448
|
p | _,
|
|
5435
|
-
|
|
5449
|
+
y | v,
|
|
5436
5450
|
p | b,
|
|
5437
|
-
|
|
5438
|
-
_ |
|
|
5451
|
+
y | _,
|
|
5452
|
+
_ | v,
|
|
5439
5453
|
g | _,
|
|
5440
5454
|
_ | b,
|
|
5441
|
-
|
|
5455
|
+
y | w,
|
|
5442
5456
|
_ | w,
|
|
5443
5457
|
p | w,
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
p |
|
|
5447
|
-
g |
|
|
5458
|
+
y | _,
|
|
5459
|
+
y | b,
|
|
5460
|
+
p | v,
|
|
5461
|
+
g | v,
|
|
5448
5462
|
p | w,
|
|
5449
5463
|
p | _,
|
|
5450
|
-
g |
|
|
5464
|
+
g | v,
|
|
5451
5465
|
_ | b,
|
|
5452
|
-
|
|
5466
|
+
y | v,
|
|
5453
5467
|
_ | w,
|
|
5454
5468
|
g | _,
|
|
5455
|
-
|
|
5469
|
+
y | w,
|
|
5456
5470
|
g | _,
|
|
5457
5471
|
p | b,
|
|
5458
|
-
_ |
|
|
5472
|
+
_ | v,
|
|
5459
5473
|
p | _,
|
|
5460
|
-
|
|
5474
|
+
y | w,
|
|
5461
5475
|
g | w,
|
|
5462
5476
|
_ | _,
|
|
5463
5477
|
_ | w,
|
|
5464
5478
|
p | b,
|
|
5465
|
-
|
|
5479
|
+
y | v,
|
|
5466
5480
|
g | w,
|
|
5467
5481
|
g | b,
|
|
5468
5482
|
_ | w,
|
|
5469
5483
|
_ | _,
|
|
5470
|
-
|
|
5471
|
-
g |
|
|
5484
|
+
y | b,
|
|
5485
|
+
g | v,
|
|
5472
5486
|
p | _,
|
|
5473
5487
|
g | _,
|
|
5474
|
-
|
|
5488
|
+
y | v,
|
|
5475
5489
|
_ | b,
|
|
5476
|
-
p |
|
|
5490
|
+
p | v,
|
|
5477
5491
|
p | w,
|
|
5478
5492
|
g | b,
|
|
5479
|
-
|
|
5480
|
-
g |
|
|
5481
|
-
_ |
|
|
5482
|
-
|
|
5483
|
-
p |
|
|
5493
|
+
y | _,
|
|
5494
|
+
g | v,
|
|
5495
|
+
_ | v,
|
|
5496
|
+
y | _,
|
|
5497
|
+
p | v,
|
|
5484
5498
|
_ | b,
|
|
5485
|
-
|
|
5499
|
+
y | b,
|
|
5486
5500
|
p | w
|
|
5487
5501
|
];
|
|
5488
5502
|
p = 8192;
|
|
5489
5503
|
g = 1 << 23;
|
|
5490
|
-
|
|
5504
|
+
y = p | g;
|
|
5491
5505
|
b = 1;
|
|
5492
5506
|
w = 128;
|
|
5493
|
-
|
|
5494
|
-
const
|
|
5495
|
-
|
|
5496
|
-
p |
|
|
5497
|
-
p |
|
|
5507
|
+
v = b | w;
|
|
5508
|
+
const gs = [
|
|
5509
|
+
y | b,
|
|
5510
|
+
p | v,
|
|
5511
|
+
p | v,
|
|
5498
5512
|
_ | w,
|
|
5499
|
-
|
|
5500
|
-
g |
|
|
5513
|
+
y | w,
|
|
5514
|
+
g | v,
|
|
5501
5515
|
g | b,
|
|
5502
5516
|
p | b,
|
|
5503
5517
|
_ | _,
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
_ |
|
|
5518
|
+
y | _,
|
|
5519
|
+
y | _,
|
|
5520
|
+
y | v,
|
|
5521
|
+
_ | v,
|
|
5508
5522
|
_ | _,
|
|
5509
5523
|
g | w,
|
|
5510
5524
|
g | b,
|
|
5511
5525
|
_ | b,
|
|
5512
5526
|
p | _,
|
|
5513
5527
|
g | _,
|
|
5514
|
-
|
|
5528
|
+
y | b,
|
|
5515
5529
|
_ | w,
|
|
5516
5530
|
g | _,
|
|
5517
5531
|
p | b,
|
|
5518
5532
|
p | w,
|
|
5519
|
-
g |
|
|
5533
|
+
g | v,
|
|
5520
5534
|
_ | b,
|
|
5521
5535
|
p | w,
|
|
5522
5536
|
g | w,
|
|
5523
5537
|
p | _,
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
_ |
|
|
5538
|
+
y | w,
|
|
5539
|
+
y | v,
|
|
5540
|
+
_ | v,
|
|
5527
5541
|
g | w,
|
|
5528
5542
|
g | b,
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
_ |
|
|
5543
|
+
y | _,
|
|
5544
|
+
y | v,
|
|
5545
|
+
_ | v,
|
|
5532
5546
|
_ | _,
|
|
5533
5547
|
_ | _,
|
|
5534
|
-
|
|
5548
|
+
y | _,
|
|
5535
5549
|
p | w,
|
|
5536
5550
|
g | w,
|
|
5537
|
-
g |
|
|
5551
|
+
g | v,
|
|
5538
5552
|
_ | b,
|
|
5539
|
-
|
|
5540
|
-
p |
|
|
5541
|
-
p |
|
|
5553
|
+
y | b,
|
|
5554
|
+
p | v,
|
|
5555
|
+
p | v,
|
|
5542
5556
|
_ | w,
|
|
5543
|
-
|
|
5544
|
-
_ |
|
|
5557
|
+
y | v,
|
|
5558
|
+
_ | v,
|
|
5545
5559
|
_ | b,
|
|
5546
5560
|
p | _,
|
|
5547
5561
|
g | b,
|
|
5548
5562
|
p | b,
|
|
5549
|
-
|
|
5550
|
-
g |
|
|
5563
|
+
y | w,
|
|
5564
|
+
g | v,
|
|
5551
5565
|
p | b,
|
|
5552
5566
|
p | w,
|
|
5553
5567
|
g | _,
|
|
5554
|
-
|
|
5568
|
+
y | b,
|
|
5555
5569
|
_ | w,
|
|
5556
5570
|
g | _,
|
|
5557
5571
|
p | _,
|
|
5558
|
-
|
|
5572
|
+
y | w
|
|
5559
5573
|
];
|
|
5560
5574
|
p = 1 << 25;
|
|
5561
5575
|
g = 1 << 30;
|
|
5562
|
-
|
|
5576
|
+
y = p | g;
|
|
5563
5577
|
b = 256;
|
|
5564
5578
|
w = 1 << 19;
|
|
5565
|
-
|
|
5566
|
-
const
|
|
5579
|
+
v = b | w;
|
|
5580
|
+
const bs = [
|
|
5567
5581
|
_ | b,
|
|
5568
|
-
p |
|
|
5582
|
+
p | v,
|
|
5569
5583
|
p | w,
|
|
5570
|
-
|
|
5584
|
+
y | b,
|
|
5571
5585
|
_ | w,
|
|
5572
5586
|
_ | b,
|
|
5573
5587
|
g | _,
|
|
5574
5588
|
p | w,
|
|
5575
|
-
g |
|
|
5589
|
+
g | v,
|
|
5576
5590
|
_ | w,
|
|
5577
5591
|
p | b,
|
|
5578
|
-
g |
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
_ |
|
|
5592
|
+
g | v,
|
|
5593
|
+
y | b,
|
|
5594
|
+
y | w,
|
|
5595
|
+
_ | v,
|
|
5582
5596
|
g | _,
|
|
5583
5597
|
p | _,
|
|
5584
5598
|
g | w,
|
|
5585
5599
|
g | w,
|
|
5586
5600
|
_ | _,
|
|
5587
5601
|
g | b,
|
|
5588
|
-
|
|
5589
|
-
|
|
5602
|
+
y | v,
|
|
5603
|
+
y | v,
|
|
5590
5604
|
p | b,
|
|
5591
|
-
|
|
5605
|
+
y | w,
|
|
5592
5606
|
g | b,
|
|
5593
5607
|
_ | _,
|
|
5594
|
-
|
|
5595
|
-
p |
|
|
5608
|
+
y | _,
|
|
5609
|
+
p | v,
|
|
5596
5610
|
p | _,
|
|
5597
|
-
|
|
5598
|
-
_ |
|
|
5611
|
+
y | _,
|
|
5612
|
+
_ | v,
|
|
5599
5613
|
_ | w,
|
|
5600
|
-
|
|
5614
|
+
y | b,
|
|
5601
5615
|
_ | b,
|
|
5602
5616
|
p | _,
|
|
5603
5617
|
g | _,
|
|
5604
5618
|
p | w,
|
|
5605
|
-
|
|
5606
|
-
g |
|
|
5619
|
+
y | b,
|
|
5620
|
+
g | v,
|
|
5607
5621
|
p | b,
|
|
5608
5622
|
g | _,
|
|
5609
|
-
|
|
5610
|
-
p |
|
|
5611
|
-
g |
|
|
5623
|
+
y | w,
|
|
5624
|
+
p | v,
|
|
5625
|
+
g | v,
|
|
5612
5626
|
_ | b,
|
|
5613
5627
|
p | _,
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
_ |
|
|
5617
|
-
|
|
5618
|
-
|
|
5628
|
+
y | w,
|
|
5629
|
+
y | v,
|
|
5630
|
+
_ | v,
|
|
5631
|
+
y | _,
|
|
5632
|
+
y | v,
|
|
5619
5633
|
p | w,
|
|
5620
5634
|
_ | _,
|
|
5621
5635
|
g | w,
|
|
5622
|
-
|
|
5623
|
-
_ |
|
|
5636
|
+
y | _,
|
|
5637
|
+
_ | v,
|
|
5624
5638
|
p | b,
|
|
5625
5639
|
g | b,
|
|
5626
5640
|
_ | w,
|
|
5627
5641
|
_ | _,
|
|
5628
5642
|
g | w,
|
|
5629
|
-
p |
|
|
5643
|
+
p | v,
|
|
5630
5644
|
g | b
|
|
5631
5645
|
];
|
|
5632
5646
|
p = 1 << 22;
|
|
5633
5647
|
g = 1 << 29;
|
|
5634
|
-
|
|
5648
|
+
y = p | g;
|
|
5635
5649
|
b = 16;
|
|
5636
5650
|
w = 16384;
|
|
5637
|
-
|
|
5638
|
-
const
|
|
5651
|
+
v = b | w;
|
|
5652
|
+
const ws = [
|
|
5639
5653
|
g | b,
|
|
5640
|
-
|
|
5654
|
+
y | _,
|
|
5641
5655
|
_ | w,
|
|
5642
|
-
|
|
5643
|
-
|
|
5656
|
+
y | v,
|
|
5657
|
+
y | _,
|
|
5644
5658
|
_ | b,
|
|
5645
|
-
|
|
5659
|
+
y | v,
|
|
5646
5660
|
p | _,
|
|
5647
5661
|
g | w,
|
|
5648
|
-
p |
|
|
5662
|
+
p | v,
|
|
5649
5663
|
p | _,
|
|
5650
5664
|
g | b,
|
|
5651
5665
|
p | b,
|
|
5652
5666
|
g | w,
|
|
5653
5667
|
g | _,
|
|
5654
|
-
_ |
|
|
5668
|
+
_ | v,
|
|
5655
5669
|
_ | _,
|
|
5656
5670
|
p | b,
|
|
5657
|
-
g |
|
|
5671
|
+
g | v,
|
|
5658
5672
|
_ | w,
|
|
5659
5673
|
p | w,
|
|
5660
|
-
g |
|
|
5674
|
+
g | v,
|
|
5661
5675
|
_ | b,
|
|
5662
|
-
|
|
5663
|
-
|
|
5676
|
+
y | b,
|
|
5677
|
+
y | b,
|
|
5664
5678
|
_ | _,
|
|
5665
|
-
p |
|
|
5666
|
-
|
|
5667
|
-
_ |
|
|
5679
|
+
p | v,
|
|
5680
|
+
y | w,
|
|
5681
|
+
_ | v,
|
|
5668
5682
|
p | w,
|
|
5669
|
-
|
|
5683
|
+
y | w,
|
|
5670
5684
|
g | _,
|
|
5671
5685
|
g | w,
|
|
5672
5686
|
_ | b,
|
|
5673
|
-
|
|
5687
|
+
y | b,
|
|
5674
5688
|
p | w,
|
|
5675
|
-
|
|
5689
|
+
y | v,
|
|
5676
5690
|
p | _,
|
|
5677
|
-
_ |
|
|
5691
|
+
_ | v,
|
|
5678
5692
|
g | b,
|
|
5679
5693
|
p | _,
|
|
5680
5694
|
g | w,
|
|
5681
5695
|
g | _,
|
|
5682
|
-
_ |
|
|
5696
|
+
_ | v,
|
|
5683
5697
|
g | b,
|
|
5684
|
-
|
|
5698
|
+
y | v,
|
|
5685
5699
|
p | w,
|
|
5686
|
-
|
|
5687
|
-
p |
|
|
5688
|
-
|
|
5700
|
+
y | _,
|
|
5701
|
+
p | v,
|
|
5702
|
+
y | w,
|
|
5689
5703
|
_ | _,
|
|
5690
|
-
|
|
5704
|
+
y | b,
|
|
5691
5705
|
_ | b,
|
|
5692
5706
|
_ | w,
|
|
5693
|
-
|
|
5694
|
-
p |
|
|
5707
|
+
y | _,
|
|
5708
|
+
p | v,
|
|
5695
5709
|
_ | w,
|
|
5696
5710
|
p | b,
|
|
5697
|
-
g |
|
|
5711
|
+
g | v,
|
|
5698
5712
|
_ | _,
|
|
5699
|
-
|
|
5713
|
+
y | w,
|
|
5700
5714
|
g | _,
|
|
5701
5715
|
p | b,
|
|
5702
|
-
g |
|
|
5716
|
+
g | v
|
|
5703
5717
|
];
|
|
5704
5718
|
p = 1 << 21;
|
|
5705
5719
|
g = 1 << 26;
|
|
5706
|
-
|
|
5720
|
+
y = p | g;
|
|
5707
5721
|
b = 2;
|
|
5708
5722
|
w = 2048;
|
|
5709
|
-
|
|
5710
|
-
const
|
|
5723
|
+
v = b | w;
|
|
5724
|
+
const ms = [
|
|
5711
5725
|
p | _,
|
|
5712
|
-
|
|
5713
|
-
g |
|
|
5726
|
+
y | b,
|
|
5727
|
+
g | v,
|
|
5714
5728
|
_ | _,
|
|
5715
5729
|
_ | w,
|
|
5716
|
-
g |
|
|
5717
|
-
p |
|
|
5718
|
-
|
|
5719
|
-
|
|
5730
|
+
g | v,
|
|
5731
|
+
p | v,
|
|
5732
|
+
y | w,
|
|
5733
|
+
y | v,
|
|
5720
5734
|
p | _,
|
|
5721
5735
|
_ | _,
|
|
5722
5736
|
g | b,
|
|
5723
5737
|
_ | b,
|
|
5724
5738
|
g | _,
|
|
5725
|
-
|
|
5726
|
-
_ |
|
|
5739
|
+
y | b,
|
|
5740
|
+
_ | v,
|
|
5727
5741
|
g | w,
|
|
5728
|
-
p |
|
|
5742
|
+
p | v,
|
|
5729
5743
|
p | b,
|
|
5730
5744
|
g | w,
|
|
5731
5745
|
g | b,
|
|
5732
|
-
|
|
5733
|
-
|
|
5746
|
+
y | _,
|
|
5747
|
+
y | w,
|
|
5734
5748
|
p | b,
|
|
5735
|
-
|
|
5749
|
+
y | _,
|
|
5736
5750
|
_ | w,
|
|
5737
|
-
_ |
|
|
5738
|
-
|
|
5751
|
+
_ | v,
|
|
5752
|
+
y | v,
|
|
5739
5753
|
p | w,
|
|
5740
5754
|
_ | b,
|
|
5741
5755
|
g | _,
|
|
@@ -5743,30 +5757,30 @@ const ws = [
|
|
|
5743
5757
|
g | _,
|
|
5744
5758
|
p | w,
|
|
5745
5759
|
p | _,
|
|
5746
|
-
g |
|
|
5747
|
-
g |
|
|
5748
|
-
|
|
5749
|
-
|
|
5760
|
+
g | v,
|
|
5761
|
+
g | v,
|
|
5762
|
+
y | b,
|
|
5763
|
+
y | b,
|
|
5750
5764
|
_ | b,
|
|
5751
5765
|
p | b,
|
|
5752
5766
|
g | _,
|
|
5753
5767
|
g | w,
|
|
5754
5768
|
p | _,
|
|
5755
|
-
|
|
5756
|
-
_ |
|
|
5757
|
-
p |
|
|
5758
|
-
|
|
5759
|
-
_ |
|
|
5769
|
+
y | w,
|
|
5770
|
+
_ | v,
|
|
5771
|
+
p | v,
|
|
5772
|
+
y | w,
|
|
5773
|
+
_ | v,
|
|
5760
5774
|
g | b,
|
|
5761
|
-
|
|
5762
|
-
|
|
5775
|
+
y | v,
|
|
5776
|
+
y | _,
|
|
5763
5777
|
p | w,
|
|
5764
5778
|
_ | _,
|
|
5765
5779
|
_ | b,
|
|
5766
|
-
|
|
5780
|
+
y | v,
|
|
5767
5781
|
_ | _,
|
|
5768
|
-
p |
|
|
5769
|
-
|
|
5782
|
+
p | v,
|
|
5783
|
+
y | _,
|
|
5770
5784
|
_ | w,
|
|
5771
5785
|
g | b,
|
|
5772
5786
|
g | w,
|
|
@@ -5775,77 +5789,77 @@ const ws = [
|
|
|
5775
5789
|
];
|
|
5776
5790
|
p = 1 << 18;
|
|
5777
5791
|
g = 1 << 28;
|
|
5778
|
-
|
|
5792
|
+
y = p | g;
|
|
5779
5793
|
b = 64;
|
|
5780
5794
|
w = 4096;
|
|
5781
|
-
|
|
5782
|
-
const
|
|
5783
|
-
g |
|
|
5795
|
+
v = b | w;
|
|
5796
|
+
const ys = [
|
|
5797
|
+
g | v,
|
|
5784
5798
|
_ | w,
|
|
5785
5799
|
p | _,
|
|
5786
|
-
|
|
5800
|
+
y | v,
|
|
5787
5801
|
g | _,
|
|
5788
|
-
g |
|
|
5802
|
+
g | v,
|
|
5789
5803
|
_ | b,
|
|
5790
5804
|
g | _,
|
|
5791
5805
|
p | b,
|
|
5792
|
-
|
|
5793
|
-
|
|
5806
|
+
y | _,
|
|
5807
|
+
y | v,
|
|
5794
5808
|
p | w,
|
|
5795
|
-
|
|
5796
|
-
p |
|
|
5809
|
+
y | w,
|
|
5810
|
+
p | v,
|
|
5797
5811
|
_ | w,
|
|
5798
5812
|
_ | b,
|
|
5799
|
-
|
|
5813
|
+
y | _,
|
|
5800
5814
|
g | b,
|
|
5801
5815
|
g | w,
|
|
5802
|
-
_ |
|
|
5816
|
+
_ | v,
|
|
5803
5817
|
p | w,
|
|
5804
5818
|
p | b,
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
_ |
|
|
5819
|
+
y | b,
|
|
5820
|
+
y | w,
|
|
5821
|
+
_ | v,
|
|
5808
5822
|
_ | _,
|
|
5809
5823
|
_ | _,
|
|
5810
|
-
|
|
5824
|
+
y | b,
|
|
5811
5825
|
g | b,
|
|
5812
5826
|
g | w,
|
|
5813
|
-
p |
|
|
5827
|
+
p | v,
|
|
5814
5828
|
p | _,
|
|
5815
|
-
p |
|
|
5829
|
+
p | v,
|
|
5816
5830
|
p | _,
|
|
5817
|
-
|
|
5831
|
+
y | w,
|
|
5818
5832
|
_ | w,
|
|
5819
5833
|
_ | b,
|
|
5820
|
-
|
|
5834
|
+
y | b,
|
|
5821
5835
|
_ | w,
|
|
5822
|
-
p |
|
|
5836
|
+
p | v,
|
|
5823
5837
|
g | w,
|
|
5824
5838
|
_ | b,
|
|
5825
5839
|
g | b,
|
|
5826
|
-
|
|
5827
|
-
|
|
5840
|
+
y | _,
|
|
5841
|
+
y | b,
|
|
5828
5842
|
g | _,
|
|
5829
5843
|
p | _,
|
|
5830
|
-
g |
|
|
5844
|
+
g | v,
|
|
5831
5845
|
_ | _,
|
|
5832
|
-
|
|
5846
|
+
y | v,
|
|
5833
5847
|
p | b,
|
|
5834
5848
|
g | b,
|
|
5835
|
-
|
|
5849
|
+
y | _,
|
|
5836
5850
|
g | w,
|
|
5837
|
-
g |
|
|
5851
|
+
g | v,
|
|
5838
5852
|
_ | _,
|
|
5839
|
-
|
|
5853
|
+
y | v,
|
|
5840
5854
|
p | w,
|
|
5841
5855
|
p | w,
|
|
5842
|
-
_ |
|
|
5843
|
-
_ |
|
|
5856
|
+
_ | v,
|
|
5857
|
+
_ | v,
|
|
5844
5858
|
p | b,
|
|
5845
5859
|
g | _,
|
|
5846
|
-
|
|
5860
|
+
y | w
|
|
5847
5861
|
];
|
|
5848
|
-
class
|
|
5862
|
+
class pn {
|
|
5849
5863
|
constructor(t) {
|
|
5850
5864
|
this.keys = [];
|
|
5851
5865
|
const e = [], s = [], n = [];
|
|
@@ -5859,7 +5873,7 @@ class un {
|
|
|
5859
5873
|
n[a] = n[h] = 0;
|
|
5860
5874
|
for (let c = 28; c < 59; c += 28)
|
|
5861
5875
|
for (let o = c - 28; o < c; ++o) {
|
|
5862
|
-
const l = o +
|
|
5876
|
+
const l = o + ia[r];
|
|
5863
5877
|
s[o] = l < c ? e[l] : e[l - 28];
|
|
5864
5878
|
}
|
|
5865
5879
|
for (let c = 0; c < 24; ++c)
|
|
@@ -5877,8 +5891,8 @@ class un {
|
|
|
5877
5891
|
n = e[s++] << 24 | e[s++] << 16 | e[s++] << 8 | e[s++], r = e[s++] << 24 | e[s++] << 16 | e[s++] << 8 | e[s++], a = (n >>> 4 ^ r) & 252645135, r ^= a, n ^= a << 4, a = (n >>> 16 ^ r) & 65535, r ^= a, n ^= a << 16, a = (r >>> 2 ^ n) & 858993459, n ^= a, r ^= a << 2, a = (r >>> 8 ^ n) & 16711935, n ^= a, r ^= a << 8, r = r << 1 | r >>> 31 & 1, a = (n ^ r) & 2863311530, n ^= a, r ^= a, n = n << 1 | n >>> 31 & 1;
|
|
5878
5892
|
for (let h = 0, c = 0; h < 8; ++h) {
|
|
5879
5893
|
a = r << 28 | r >>> 4, a ^= this.keys[c++];
|
|
5880
|
-
let o =
|
|
5881
|
-
o |=
|
|
5894
|
+
let o = ms[a & 63];
|
|
5895
|
+
o |= bs[a >>> 8 & 63], o |= ps[a >>> 16 & 63], o |= ds[a >>> 24 & 63], a = r ^ this.keys[c++], o |= ys[a & 63], o |= ws[a >>> 8 & 63], o |= gs[a >>> 16 & 63], o |= xs[a >>> 24 & 63], n ^= o, a = n << 28 | n >>> 4, a ^= this.keys[c++], o = ms[a & 63], o |= bs[a >>> 8 & 63], o |= ps[a >>> 16 & 63], o |= ds[a >>> 24 & 63], a = n ^ this.keys[c++], o |= ys[a & 63], o |= ws[a >>> 8 & 63], o |= gs[a >>> 16 & 63], o |= xs[a >>> 24 & 63], r ^= o;
|
|
5882
5896
|
}
|
|
5883
5897
|
for (r = r << 31 | r >>> 1, a = (n ^ r) & 2863311530, n ^= a, r ^= a, n = n << 31 | n >>> 1, a = (n >>> 8 ^ r) & 16711935, r ^= a, n ^= a << 8, a = (n >>> 2 ^ r) & 858993459, r ^= a, n ^= a << 2, a = (r >>> 16 ^ n) & 65535, n ^= a, r ^= a << 16, a = (r >>> 4 ^ n) & 252645135, n ^= a, r ^= a << 4, a = [r, n], s = 0; s < 8; s++)
|
|
5884
5898
|
e[s] = (a[s >>> 2] >>> 8 * (3 - s % 4)) % 256, e[s] < 0 && (e[s] += 256);
|
|
@@ -5897,7 +5911,7 @@ class fi {
|
|
|
5897
5911
|
return r._importKey(t), r;
|
|
5898
5912
|
}
|
|
5899
5913
|
_importKey(t, e, s) {
|
|
5900
|
-
this._cipher = new
|
|
5914
|
+
this._cipher = new pn(t);
|
|
5901
5915
|
}
|
|
5902
5916
|
encrypt(t, e) {
|
|
5903
5917
|
const s = new Uint8Array(e);
|
|
@@ -5909,7 +5923,7 @@ class fi {
|
|
|
5909
5923
|
return s;
|
|
5910
5924
|
}
|
|
5911
5925
|
}
|
|
5912
|
-
class
|
|
5926
|
+
class di {
|
|
5913
5927
|
constructor() {
|
|
5914
5928
|
this._cipher = null;
|
|
5915
5929
|
}
|
|
@@ -5917,11 +5931,11 @@ class ui {
|
|
|
5917
5931
|
return { name: "DES-CBC" };
|
|
5918
5932
|
}
|
|
5919
5933
|
static importKey(t, e, s, n) {
|
|
5920
|
-
const r = new
|
|
5934
|
+
const r = new di();
|
|
5921
5935
|
return r._importKey(t), r;
|
|
5922
5936
|
}
|
|
5923
5937
|
_importKey(t) {
|
|
5924
|
-
this._cipher = new
|
|
5938
|
+
this._cipher = new pn(t);
|
|
5925
5939
|
}
|
|
5926
5940
|
encrypt(t, e) {
|
|
5927
5941
|
const s = new Uint8Array(e);
|
|
@@ -5943,7 +5957,7 @@ function Et(i, t, e) {
|
|
|
5943
5957
|
(t & 1n) === 1n && (s = s * i % e), t = t >> 1n, i = i * i % e;
|
|
5944
5958
|
return s;
|
|
5945
5959
|
}
|
|
5946
|
-
function
|
|
5960
|
+
function Kt(i, t = 0) {
|
|
5947
5961
|
let e = i.toString(16);
|
|
5948
5962
|
t === 0 && (t = Math.ceil(e.length / 2)), e = e.padStart(t * 2, "0");
|
|
5949
5963
|
const s = e.length / 2, n = new Uint8Array(s);
|
|
@@ -5957,7 +5971,7 @@ function ae(i) {
|
|
|
5957
5971
|
t += i[e].toString(16).padStart(2, "0");
|
|
5958
5972
|
return BigInt(t);
|
|
5959
5973
|
}
|
|
5960
|
-
class
|
|
5974
|
+
class At {
|
|
5961
5975
|
constructor() {
|
|
5962
5976
|
this._keyLength = 0, this._keyBytes = 0, this._n = null, this._e = null, this._d = null, this._nBigInt = null, this._eBigInt = null, this._dBigInt = null, this._extractable = !1;
|
|
5963
5977
|
}
|
|
@@ -5965,14 +5979,14 @@ class Kt {
|
|
|
5965
5979
|
return { name: "RSA-PKCS1-v1_5" };
|
|
5966
5980
|
}
|
|
5967
5981
|
_base64urlDecode(t) {
|
|
5968
|
-
return t = t.replace(/-/g, "+").replace(/_/g, "/"), t = t.padEnd(Math.ceil(t.length / 4) * 4, "="),
|
|
5982
|
+
return t = t.replace(/-/g, "+").replace(/_/g, "/"), t = t.padEnd(Math.ceil(t.length / 4) * 4, "="), ai.decode(t);
|
|
5969
5983
|
}
|
|
5970
5984
|
_padArray(t, e) {
|
|
5971
5985
|
const s = new Uint8Array(e);
|
|
5972
5986
|
return s.set(t, e - t.length), s;
|
|
5973
5987
|
}
|
|
5974
5988
|
static async generateKey(t, e, s) {
|
|
5975
|
-
const n = new
|
|
5989
|
+
const n = new At();
|
|
5976
5990
|
return await n._generateKey(t, e), { privateKey: n };
|
|
5977
5991
|
}
|
|
5978
5992
|
async _generateKey(t, e) {
|
|
@@ -5992,7 +6006,7 @@ class Kt {
|
|
|
5992
6006
|
static async importKey(t, e, s, n) {
|
|
5993
6007
|
if (n.length !== 1 || n[0] !== "encrypt")
|
|
5994
6008
|
throw new Error("only support importing RSA public key");
|
|
5995
|
-
const r = new
|
|
6009
|
+
const r = new At();
|
|
5996
6010
|
return await r._importKey(t, s), r;
|
|
5997
6011
|
}
|
|
5998
6012
|
async _importKey(t, e) {
|
|
@@ -6011,12 +6025,12 @@ class Kt {
|
|
|
6011
6025
|
const n = new Uint8Array(this._keyBytes);
|
|
6012
6026
|
n[1] = 2, n.set(s, 2), n.set(e, s.length + 3);
|
|
6013
6027
|
const r = ae(n), a = Et(r, this._eBigInt, this._nBigInt);
|
|
6014
|
-
return
|
|
6028
|
+
return Kt(a, this._keyBytes);
|
|
6015
6029
|
}
|
|
6016
6030
|
async decrypt(t, e) {
|
|
6017
6031
|
if (e.length !== this._keyBytes)
|
|
6018
6032
|
return null;
|
|
6019
|
-
const s = ae(e), n = Et(s, this._dBigInt, this._nBigInt), r =
|
|
6033
|
+
const s = ae(e), n = Et(s, this._dBigInt, this._nBigInt), r = Kt(n, this._keyBytes);
|
|
6020
6034
|
if (r[0] !== 0 || r[1] !== 2)
|
|
6021
6035
|
return null;
|
|
6022
6036
|
let a = 2;
|
|
@@ -6030,7 +6044,7 @@ class Kt {
|
|
|
6030
6044
|
return { n: this._n, e: this._e, d: this._d };
|
|
6031
6045
|
}
|
|
6032
6046
|
}
|
|
6033
|
-
class
|
|
6047
|
+
class sa {
|
|
6034
6048
|
constructor(t) {
|
|
6035
6049
|
this._key = t;
|
|
6036
6050
|
}
|
|
@@ -6041,7 +6055,7 @@ class ea {
|
|
|
6041
6055
|
return this._key;
|
|
6042
6056
|
}
|
|
6043
6057
|
}
|
|
6044
|
-
class
|
|
6058
|
+
class xi {
|
|
6045
6059
|
constructor() {
|
|
6046
6060
|
this._g = null, this._p = null, this._gBigInt = null, this._pBigInt = null, this._privateKey = null;
|
|
6047
6061
|
}
|
|
@@ -6049,12 +6063,12 @@ class di {
|
|
|
6049
6063
|
return { name: "DH" };
|
|
6050
6064
|
}
|
|
6051
6065
|
static generateKey(t, e) {
|
|
6052
|
-
const s = new
|
|
6053
|
-
return s._generateKey(t), { privateKey: s, publicKey: new
|
|
6066
|
+
const s = new xi();
|
|
6067
|
+
return s._generateKey(t), { privateKey: s, publicKey: new sa(s._publicKey) };
|
|
6054
6068
|
}
|
|
6055
6069
|
_generateKey(t) {
|
|
6056
6070
|
const e = t.g, s = t.p;
|
|
6057
|
-
this._keyBytes = s.length, this._gBigInt = ae(e), this._pBigInt = ae(s), this._privateKey = window.crypto.getRandomValues(new Uint8Array(this._keyBytes)), this._privateKeyBigInt = ae(this._privateKey), this._publicKey =
|
|
6071
|
+
this._keyBytes = s.length, this._gBigInt = ae(e), this._pBigInt = ae(s), this._privateKey = window.crypto.getRandomValues(new Uint8Array(this._keyBytes)), this._privateKeyBigInt = ae(this._privateKey), this._publicKey = Kt(Et(
|
|
6058
6072
|
this._gBigInt,
|
|
6059
6073
|
this._privateKeyBigInt,
|
|
6060
6074
|
this._pBigInt
|
|
@@ -6062,33 +6076,33 @@ class di {
|
|
|
6062
6076
|
}
|
|
6063
6077
|
deriveBits(t, e) {
|
|
6064
6078
|
const s = Math.ceil(e / 8), n = new Uint8Array(t.public), r = s > this._keyBytes ? s : this._keyBytes, a = Et(ae(n), this._privateKeyBigInt, this._pBigInt);
|
|
6065
|
-
return
|
|
6079
|
+
return Kt(a, r).slice(0, r);
|
|
6066
6080
|
}
|
|
6067
6081
|
}
|
|
6068
|
-
async function
|
|
6082
|
+
async function na(i) {
|
|
6069
6083
|
let t = "";
|
|
6070
6084
|
for (let e = 0; e < i.length; e++)
|
|
6071
6085
|
t += String.fromCharCode(i[e]);
|
|
6072
|
-
return
|
|
6086
|
+
return ra(oa(ha(aa(t), 8 * t.length)));
|
|
6073
6087
|
}
|
|
6074
|
-
function
|
|
6088
|
+
function ra(i) {
|
|
6075
6089
|
let t = new Uint8Array(i.length);
|
|
6076
6090
|
for (let e = 0; e < i.length; e++)
|
|
6077
6091
|
t[e] = i.charCodeAt(e);
|
|
6078
6092
|
return t;
|
|
6079
6093
|
}
|
|
6080
|
-
function
|
|
6094
|
+
function aa(i) {
|
|
6081
6095
|
let t = Array(i.length >> 2);
|
|
6082
6096
|
for (let e = 0; e < t.length; e++) t[e] = 0;
|
|
6083
6097
|
for (let e = 0; e < 8 * i.length; e += 8) t[e >> 5] |= (255 & i.charCodeAt(e / 8)) << e % 32;
|
|
6084
6098
|
return t;
|
|
6085
6099
|
}
|
|
6086
|
-
function
|
|
6100
|
+
function oa(i) {
|
|
6087
6101
|
let t = "";
|
|
6088
6102
|
for (let e = 0; e < 32 * i.length; e += 8) t += String.fromCharCode(i[e >> 5] >>> e % 32 & 255);
|
|
6089
6103
|
return t;
|
|
6090
6104
|
}
|
|
6091
|
-
function
|
|
6105
|
+
function ha(i, t) {
|
|
6092
6106
|
i[t >> 5] |= 128 << t % 32, i[14 + (t + 64 >>> 9 << 4)] = t;
|
|
6093
6107
|
let e = 1732584193, s = -271733879, n = -1732584194, r = 271733878;
|
|
6094
6108
|
for (let a = 0; a < i.length; a += 16) {
|
|
@@ -6097,38 +6111,38 @@ function ra(i, t) {
|
|
|
6097
6111
|
}
|
|
6098
6112
|
return Array(e, s, n, r);
|
|
6099
6113
|
}
|
|
6100
|
-
function
|
|
6101
|
-
return we(
|
|
6114
|
+
function Tt(i, t, e, s, n, r) {
|
|
6115
|
+
return we(la(we(we(t, i), we(s, r)), n), e);
|
|
6102
6116
|
}
|
|
6103
6117
|
function Y(i, t, e, s, n, r, a) {
|
|
6104
|
-
return
|
|
6118
|
+
return Tt(t & e | ~t & s, i, t, n, r, a);
|
|
6105
6119
|
}
|
|
6106
6120
|
function j(i, t, e, s, n, r, a) {
|
|
6107
|
-
return
|
|
6121
|
+
return Tt(t & s | e & ~s, i, t, n, r, a);
|
|
6108
6122
|
}
|
|
6109
6123
|
function q(i, t, e, s, n, r, a) {
|
|
6110
|
-
return
|
|
6124
|
+
return Tt(t ^ e ^ s, i, t, n, r, a);
|
|
6111
6125
|
}
|
|
6112
6126
|
function J(i, t, e, s, n, r, a) {
|
|
6113
|
-
return
|
|
6127
|
+
return Tt(e ^ (t | ~s), i, t, n, r, a);
|
|
6114
6128
|
}
|
|
6115
6129
|
function we(i, t) {
|
|
6116
6130
|
let e = (65535 & i) + (65535 & t);
|
|
6117
6131
|
return (i >> 16) + (t >> 16) + (e >> 16) << 16 | 65535 & e;
|
|
6118
6132
|
}
|
|
6119
|
-
function
|
|
6133
|
+
function la(i, t) {
|
|
6120
6134
|
return i << t | i >>> 32 - t;
|
|
6121
6135
|
}
|
|
6122
|
-
class
|
|
6136
|
+
class ca {
|
|
6123
6137
|
constructor() {
|
|
6124
6138
|
this._algorithms = {
|
|
6125
|
-
"AES-ECB":
|
|
6126
|
-
"AES-EAX":
|
|
6139
|
+
"AES-ECB": _i,
|
|
6140
|
+
"AES-EAX": ui,
|
|
6127
6141
|
"DES-ECB": fi,
|
|
6128
|
-
"DES-CBC":
|
|
6129
|
-
"RSA-PKCS1-v1_5":
|
|
6130
|
-
DH:
|
|
6131
|
-
MD5:
|
|
6142
|
+
"DES-CBC": di,
|
|
6143
|
+
"RSA-PKCS1-v1_5": At,
|
|
6144
|
+
DH: xi,
|
|
6145
|
+
MD5: na
|
|
6132
6146
|
};
|
|
6133
6147
|
}
|
|
6134
6148
|
encrypt(t, e, s) {
|
|
@@ -6180,8 +6194,8 @@ class oa {
|
|
|
6180
6194
|
return e.deriveBits(t, s);
|
|
6181
6195
|
}
|
|
6182
6196
|
}
|
|
6183
|
-
const V = new
|
|
6184
|
-
class
|
|
6197
|
+
const V = new ca();
|
|
6198
|
+
class vs {
|
|
6185
6199
|
constructor() {
|
|
6186
6200
|
this._cipher = null, this._counter = new Uint8Array(16);
|
|
6187
6201
|
}
|
|
@@ -6214,7 +6228,7 @@ class ms {
|
|
|
6214
6228
|
return n;
|
|
6215
6229
|
}
|
|
6216
6230
|
}
|
|
6217
|
-
class
|
|
6231
|
+
class _a extends Vs {
|
|
6218
6232
|
constructor(t, e) {
|
|
6219
6233
|
super(), this._hasStarted = !1, this._checkSock = null, this._checkCredentials = null, this._approveServerResolve = null, this._sockReject = null, this._credentialsReject = null, this._approveServerReject = null, this._sock = t, this._getCredentials = e;
|
|
6220
6234
|
}
|
|
@@ -6269,49 +6283,49 @@ class ha extends Hs {
|
|
|
6269
6283
|
this.dispatchEvent(new CustomEvent("serververification", {
|
|
6270
6284
|
detail: { type: "RSA", publickey: h }
|
|
6271
6285
|
})), await c;
|
|
6272
|
-
const o = 2048, l = Math.ceil(o / 8),
|
|
6286
|
+
const o = 2048, l = Math.ceil(o / 8), f = (await V.generateKey({
|
|
6273
6287
|
name: "RSA-PKCS1-v1_5",
|
|
6274
6288
|
modulusLength: o,
|
|
6275
6289
|
publicExponent: new Uint8Array([1, 0, 1])
|
|
6276
|
-
}, !0, ["encrypt"])).privateKey, d = await V.exportKey("raw",
|
|
6290
|
+
}, !0, ["encrypt"])).privateKey, d = await V.exportKey("raw", f), x = d.n, k = d.e, E = new Uint8Array(4 + l * 2);
|
|
6277
6291
|
E[0] = (o & 4278190080) >>> 24, E[1] = (o & 16711680) >>> 16, E[2] = (o & 65280) >>> 8, E[3] = o & 255, E.set(x, 4), E.set(k, 4 + l), this._sock.sQpushBytes(E), this._sock.flush();
|
|
6278
|
-
const
|
|
6279
|
-
window.crypto.getRandomValues(
|
|
6292
|
+
const M = new Uint8Array(16);
|
|
6293
|
+
window.crypto.getRandomValues(M);
|
|
6280
6294
|
const C = await V.encrypt(
|
|
6281
6295
|
{ name: "RSA-PKCS1-v1_5" },
|
|
6282
6296
|
a,
|
|
6283
|
-
|
|
6284
|
-
),
|
|
6285
|
-
if (
|
|
6297
|
+
M
|
|
6298
|
+
), K = new Uint8Array(2 + s);
|
|
6299
|
+
if (K[0] = (s & 65280) >>> 8, K[1] = s & 255, K.set(C, 2), this._sock.sQpushBytes(K), this._sock.flush(), await this._waitSockAsync(2), this._sock.rQshift16() !== l)
|
|
6286
6300
|
throw new Error("RA2: wrong encrypted message length");
|
|
6287
6301
|
const A = this._sock.rQshiftBytes(l), S = await V.decrypt(
|
|
6288
6302
|
{ name: "RSA-PKCS1-v1_5" },
|
|
6289
|
-
|
|
6303
|
+
f,
|
|
6290
6304
|
A
|
|
6291
6305
|
);
|
|
6292
6306
|
if (S === null || S.length !== 16)
|
|
6293
6307
|
throw new Error("RA2: corrupted server encrypted random");
|
|
6294
|
-
let F = new Uint8Array(32),
|
|
6295
|
-
F.set(S), F.set(
|
|
6296
|
-
const
|
|
6297
|
-
await
|
|
6298
|
-
const
|
|
6299
|
-
await
|
|
6300
|
-
let
|
|
6301
|
-
if (
|
|
6308
|
+
let F = new Uint8Array(32), R = new Uint8Array(32);
|
|
6309
|
+
F.set(S), F.set(M, 16), R.set(M), R.set(S, 16), F = await window.crypto.subtle.digest("SHA-1", F), F = new Uint8Array(F).slice(0, 16), R = await window.crypto.subtle.digest("SHA-1", R), R = new Uint8Array(R).slice(0, 16);
|
|
6310
|
+
const X = new vs();
|
|
6311
|
+
await X.setKey(F);
|
|
6312
|
+
const I = new vs();
|
|
6313
|
+
await I.setKey(R);
|
|
6314
|
+
let D = new Uint8Array(8 + s * 2 + l * 2), T = new Uint8Array(8 + s * 2 + l * 2);
|
|
6315
|
+
if (D.set(h), D.set(E, 4 + s * 2), T.set(E), T.set(h, 4 + l * 2), D = await window.crypto.subtle.digest("SHA-1", D), T = await window.crypto.subtle.digest("SHA-1", T), D = new Uint8Array(D), T = new Uint8Array(T), this._sock.sQpushBytes(await X.makeMessage(T)), this._sock.flush(), await this._waitSockAsync(38), this._sock.rQshift16() !== 20)
|
|
6302
6316
|
throw new Error("RA2: wrong server hash");
|
|
6303
|
-
const O = await
|
|
6317
|
+
const O = await I.receiveMessage(
|
|
6304
6318
|
20,
|
|
6305
6319
|
this._sock.rQshiftBytes(36)
|
|
6306
6320
|
);
|
|
6307
6321
|
if (O === null)
|
|
6308
6322
|
throw new Error("RA2: failed to authenticate the message");
|
|
6309
6323
|
for (let G = 0; G < 20; G++)
|
|
6310
|
-
if (O[G] !==
|
|
6324
|
+
if (O[G] !== D[G])
|
|
6311
6325
|
throw new Error("RA2: wrong server hash");
|
|
6312
6326
|
if (await this._waitSockAsync(19), this._sock.rQshift16() !== 1)
|
|
6313
6327
|
throw new Error("RA2: wrong subtype");
|
|
6314
|
-
let ee = await
|
|
6328
|
+
let ee = await I.receiveMessage(
|
|
6315
6329
|
1,
|
|
6316
6330
|
this._sock.rQshiftBytes(17)
|
|
6317
6331
|
);
|
|
@@ -6333,14 +6347,14 @@ class ha extends Hs {
|
|
|
6333
6347
|
throw new Error("RA2: wrong subtype");
|
|
6334
6348
|
await Ae;
|
|
6335
6349
|
let re;
|
|
6336
|
-
ee === 1 ? re =
|
|
6337
|
-
const
|
|
6338
|
-
he[0] = re.length, he[re.length + 1] =
|
|
6350
|
+
ee === 1 ? re = fe(this._getCredentials().username).slice(0, 255) : re = "";
|
|
6351
|
+
const ve = fe(this._getCredentials().password).slice(0, 255), he = new Uint8Array(re.length + ve.length + 2);
|
|
6352
|
+
he[0] = re.length, he[re.length + 1] = ve.length;
|
|
6339
6353
|
for (let G = 0; G < re.length; G++)
|
|
6340
6354
|
he[G + 1] = re.charCodeAt(G);
|
|
6341
|
-
for (let G = 0; G <
|
|
6342
|
-
he[re.length + 2 + G] =
|
|
6343
|
-
this._sock.sQpushBytes(await
|
|
6355
|
+
for (let G = 0; G < ve.length; G++)
|
|
6356
|
+
he[re.length + 2 + G] = ve.charCodeAt(G);
|
|
6357
|
+
this._sock.sQpushBytes(await X.makeMessage(he)), this._sock.flush();
|
|
6344
6358
|
}
|
|
6345
6359
|
get hasStarted() {
|
|
6346
6360
|
return this._hasStarted;
|
|
@@ -6349,7 +6363,7 @@ class ha extends Hs {
|
|
|
6349
6363
|
this._hasStarted = t;
|
|
6350
6364
|
}
|
|
6351
6365
|
}
|
|
6352
|
-
class
|
|
6366
|
+
class ua {
|
|
6353
6367
|
constructor() {
|
|
6354
6368
|
this._lines = 0;
|
|
6355
6369
|
}
|
|
@@ -6362,21 +6376,21 @@ class la {
|
|
|
6362
6376
|
if (r.rQwait("RAW", o))
|
|
6363
6377
|
return !1;
|
|
6364
6378
|
const l = e + (n - this._lines);
|
|
6365
|
-
let
|
|
6379
|
+
let f = r.rQshiftBytes(o, !1);
|
|
6366
6380
|
if (h == 8) {
|
|
6367
6381
|
const d = new Uint8Array(s * 4);
|
|
6368
6382
|
for (let x = 0; x < s; x++)
|
|
6369
|
-
d[x * 4 + 0] = (
|
|
6370
|
-
|
|
6383
|
+
d[x * 4 + 0] = (f[x] >> 0 & 3) * 255 / 3, d[x * 4 + 1] = (f[x] >> 2 & 3) * 255 / 3, d[x * 4 + 2] = (f[x] >> 4 & 3) * 255 / 3, d[x * 4 + 3] = 255;
|
|
6384
|
+
f = d;
|
|
6371
6385
|
}
|
|
6372
6386
|
for (let d = 0; d < s; d++)
|
|
6373
|
-
|
|
6374
|
-
a.blitImage(t, l, s, 1,
|
|
6387
|
+
f[d * 4 + 3] = 255;
|
|
6388
|
+
a.blitImage(t, l, s, 1, f, 0), this._lines--;
|
|
6375
6389
|
}
|
|
6376
6390
|
return !0;
|
|
6377
6391
|
}
|
|
6378
6392
|
}
|
|
6379
|
-
class
|
|
6393
|
+
class fa {
|
|
6380
6394
|
decodeRect(t, e, s, n, r, a, h) {
|
|
6381
6395
|
if (r.rQwait("COPYRECT", 4))
|
|
6382
6396
|
return !1;
|
|
@@ -6384,7 +6398,7 @@ class ca {
|
|
|
6384
6398
|
return s === 0 || n === 0 || a.copyImage(c, o, t, e, s, n), !0;
|
|
6385
6399
|
}
|
|
6386
6400
|
}
|
|
6387
|
-
class
|
|
6401
|
+
class da {
|
|
6388
6402
|
constructor() {
|
|
6389
6403
|
this._subrects = 0;
|
|
6390
6404
|
}
|
|
@@ -6399,13 +6413,13 @@ class _a {
|
|
|
6399
6413
|
for (; this._subrects > 0; ) {
|
|
6400
6414
|
if (r.rQwait("RRE", 12))
|
|
6401
6415
|
return !1;
|
|
6402
|
-
let c = r.rQshiftBytes(4), o = r.rQshift16(), l = r.rQshift16(),
|
|
6403
|
-
a.fillRect(t + o, e + l,
|
|
6416
|
+
let c = r.rQshiftBytes(4), o = r.rQshift16(), l = r.rQshift16(), f = r.rQshift16(), d = r.rQshift16();
|
|
6417
|
+
a.fillRect(t + o, e + l, f, d, c), this._subrects--;
|
|
6404
6418
|
}
|
|
6405
6419
|
return !0;
|
|
6406
6420
|
}
|
|
6407
6421
|
}
|
|
6408
|
-
class
|
|
6422
|
+
class xa {
|
|
6409
6423
|
constructor() {
|
|
6410
6424
|
this._tiles = 0, this._lastsubencoding = 0, this._tileBuffer = new Uint8Array(256 * 4);
|
|
6411
6425
|
}
|
|
@@ -6417,9 +6431,9 @@ class fa {
|
|
|
6417
6431
|
let o = r.rQpeek8();
|
|
6418
6432
|
if (o > 30)
|
|
6419
6433
|
throw new Error("Illegal hextile subencoding (subencoding: " + o + ")");
|
|
6420
|
-
const l = this._totalTiles - this._tiles,
|
|
6434
|
+
const l = this._totalTiles - this._tiles, f = l % this._tilesX, d = Math.floor(l / this._tilesX), x = t + f * 16, k = e + d * 16, E = Math.min(16, t + s - x), M = Math.min(16, e + n - k);
|
|
6421
6435
|
if (o & 1)
|
|
6422
|
-
c += E *
|
|
6436
|
+
c += E * M * 4;
|
|
6423
6437
|
else if (o & 2 && (c += 4), o & 4 && (c += 4), o & 8) {
|
|
6424
6438
|
if (c++, r.rQwait("HEXTILE", c))
|
|
6425
6439
|
return !1;
|
|
@@ -6429,20 +6443,20 @@ class fa {
|
|
|
6429
6443
|
if (r.rQwait("HEXTILE", c))
|
|
6430
6444
|
return !1;
|
|
6431
6445
|
if (r.rQshift8(), o === 0)
|
|
6432
|
-
this._lastsubencoding & 1 ?
|
|
6446
|
+
this._lastsubencoding & 1 ? Q(" Ignoring blank after RAW") : a.fillRect(x, k, E, M, this._background);
|
|
6433
6447
|
else if (o & 1) {
|
|
6434
|
-
let C = E *
|
|
6448
|
+
let C = E * M, K = r.rQshiftBytes(C * 4, !1);
|
|
6435
6449
|
for (let A = 0; A < C; A++)
|
|
6436
|
-
|
|
6437
|
-
a.blitImage(x, k, E,
|
|
6450
|
+
K[A * 4 + 3] = 255;
|
|
6451
|
+
a.blitImage(x, k, E, M, K, 0);
|
|
6438
6452
|
} else {
|
|
6439
|
-
if (o & 2 && (this._background = new Uint8Array(r.rQshiftBytes(4))), o & 4 && (this._foreground = new Uint8Array(r.rQshiftBytes(4))), this._startTile(x, k, E,
|
|
6453
|
+
if (o & 2 && (this._background = new Uint8Array(r.rQshiftBytes(4))), o & 4 && (this._foreground = new Uint8Array(r.rQshiftBytes(4))), this._startTile(x, k, E, M, this._background), o & 8) {
|
|
6440
6454
|
let C = r.rQshift8();
|
|
6441
|
-
for (let
|
|
6455
|
+
for (let K = 0; K < C; K++) {
|
|
6442
6456
|
let A;
|
|
6443
6457
|
o & 16 ? A = r.rQshiftBytes(4) : A = this._foreground;
|
|
6444
|
-
const S = r.rQshift8(), F = S >> 4,
|
|
6445
|
-
this._subTile(F, I, D,
|
|
6458
|
+
const S = r.rQshift8(), F = S >> 4, R = S & 15, X = r.rQshift8(), I = (X >> 4) + 1, D = (X & 15) + 1;
|
|
6459
|
+
this._subTile(F, R, I, D, A);
|
|
6446
6460
|
}
|
|
6447
6461
|
}
|
|
6448
6462
|
this._finishTile(a);
|
|
@@ -6460,11 +6474,11 @@ class fa {
|
|
|
6460
6474
|
}
|
|
6461
6475
|
// update sub-rectangle of the current tile
|
|
6462
6476
|
_subTile(t, e, s, n, r) {
|
|
6463
|
-
const a = r[0], h = r[1], c = r[2], o = t + s, l = e + n,
|
|
6477
|
+
const a = r[0], h = r[1], c = r[2], o = t + s, l = e + n, f = this._tileBuffer, d = this._tileW;
|
|
6464
6478
|
for (let x = e; x < l; x++)
|
|
6465
6479
|
for (let k = t; k < o; k++) {
|
|
6466
6480
|
const E = (k + x * d) * 4;
|
|
6467
|
-
|
|
6481
|
+
f[E] = a, f[E + 1] = h, f[E + 2] = c, f[E + 3] = 255;
|
|
6468
6482
|
}
|
|
6469
6483
|
}
|
|
6470
6484
|
// draw the current tile to the screen
|
|
@@ -6479,9 +6493,9 @@ class fa {
|
|
|
6479
6493
|
);
|
|
6480
6494
|
}
|
|
6481
6495
|
}
|
|
6482
|
-
class
|
|
6496
|
+
class pa {
|
|
6483
6497
|
constructor() {
|
|
6484
|
-
this._zlib = new
|
|
6498
|
+
this._zlib = new Xt(), this._length = 0;
|
|
6485
6499
|
}
|
|
6486
6500
|
decodeRect(t, e, s, n, r, a, h) {
|
|
6487
6501
|
if (s === 0 || n === 0)
|
|
@@ -6500,11 +6514,11 @@ class ua {
|
|
|
6500
6514
|
return a.blitImage(t, e, s, n, c, 0), !0;
|
|
6501
6515
|
}
|
|
6502
6516
|
}
|
|
6503
|
-
class
|
|
6517
|
+
class gn {
|
|
6504
6518
|
constructor() {
|
|
6505
6519
|
this._ctl = null, this._filter = null, this._numColors = 0, this._palette = new Uint8Array(1024), this._len = 0, this._zlibs = [];
|
|
6506
6520
|
for (let t = 0; t < 4; t++)
|
|
6507
|
-
this._zlibs[t] = new
|
|
6521
|
+
this._zlibs[t] = new Xt();
|
|
6508
6522
|
}
|
|
6509
6523
|
decodeRect(t, e, s, n, r, a, h) {
|
|
6510
6524
|
if (this._ctl === null) {
|
|
@@ -6639,10 +6653,10 @@ class dn {
|
|
|
6639
6653
|
return !1;
|
|
6640
6654
|
this._zlibs[t].setInput(l), l = this._zlibs[t].inflate(o), this._zlibs[t].setInput(null);
|
|
6641
6655
|
}
|
|
6642
|
-
let
|
|
6656
|
+
let f = new Uint8Array(n * r * 4);
|
|
6643
6657
|
for (let d = 0, x = 0; d < n * r * 4; d += 4, x += 3)
|
|
6644
|
-
|
|
6645
|
-
return h.blitImage(e, s, n, r,
|
|
6658
|
+
f[d] = l[x], f[d + 1] = l[x + 1], f[d + 2] = l[x + 2], f[d + 3] = 255;
|
|
6659
|
+
return h.blitImage(e, s, n, r, f, 0, !1), !0;
|
|
6646
6660
|
}
|
|
6647
6661
|
_paletteFilter(t, e, s, n, r, a, h, c) {
|
|
6648
6662
|
if (this._numColors === 0) {
|
|
@@ -6653,37 +6667,37 @@ class dn {
|
|
|
6653
6667
|
return !1;
|
|
6654
6668
|
this._numColors = x, a.rQskipBytes(1), a.rQshiftTo(this._palette, k);
|
|
6655
6669
|
}
|
|
6656
|
-
const o = this._numColors <= 2 ? 1 : 8,
|
|
6670
|
+
const o = this._numColors <= 2 ? 1 : 8, f = Math.floor((n * o + 7) / 8) * r;
|
|
6657
6671
|
let d;
|
|
6658
|
-
if (
|
|
6672
|
+
if (f === 0)
|
|
6659
6673
|
return !0;
|
|
6660
|
-
if (
|
|
6661
|
-
if (a.rQwait("TIGHT",
|
|
6674
|
+
if (f < 12) {
|
|
6675
|
+
if (a.rQwait("TIGHT", f))
|
|
6662
6676
|
return !1;
|
|
6663
|
-
d = a.rQshiftBytes(
|
|
6677
|
+
d = a.rQshiftBytes(f);
|
|
6664
6678
|
} else {
|
|
6665
6679
|
if (d = this._readData(a), d === null)
|
|
6666
6680
|
return !1;
|
|
6667
|
-
this._zlibs[t].setInput(d), d = this._zlibs[t].inflate(
|
|
6681
|
+
this._zlibs[t].setInput(d), d = this._zlibs[t].inflate(f), this._zlibs[t].setInput(null);
|
|
6668
6682
|
}
|
|
6669
6683
|
return this._numColors == 2 ? this._monoRect(e, s, n, r, d, this._palette, h) : this._paletteRect(e, s, n, r, d, this._palette, h), this._numColors = 0, !0;
|
|
6670
6684
|
}
|
|
6671
6685
|
_monoRect(t, e, s, n, r, a, h) {
|
|
6672
6686
|
const c = this._getScratchBuffer(s * n * 4), o = Math.floor((s + 7) / 8), l = Math.floor(s / 8);
|
|
6673
|
-
for (let
|
|
6687
|
+
for (let f = 0; f < n; f++) {
|
|
6674
6688
|
let d, x, k;
|
|
6675
6689
|
for (k = 0; k < l; k++)
|
|
6676
6690
|
for (let E = 7; E >= 0; E--)
|
|
6677
|
-
d = (
|
|
6691
|
+
d = (f * s + k * 8 + 7 - E) * 4, x = (r[f * o + k] >> E & 1) * 3, c[d] = a[x], c[d + 1] = a[x + 1], c[d + 2] = a[x + 2], c[d + 3] = 255;
|
|
6678
6692
|
for (let E = 7; E >= 8 - s % 8; E--)
|
|
6679
|
-
d = (
|
|
6693
|
+
d = (f * s + k * 8 + 7 - E) * 4, x = (r[f * o + k] >> E & 1) * 3, c[d] = a[x], c[d + 1] = a[x + 1], c[d + 2] = a[x + 2], c[d + 3] = 255;
|
|
6680
6694
|
}
|
|
6681
6695
|
h.blitImage(t, e, s, n, c, 0, !1);
|
|
6682
6696
|
}
|
|
6683
6697
|
_paletteRect(t, e, s, n, r, a, h) {
|
|
6684
6698
|
const c = this._getScratchBuffer(s * n * 4), o = s * n * 4;
|
|
6685
|
-
for (let l = 0,
|
|
6686
|
-
const d = r[
|
|
6699
|
+
for (let l = 0, f = 0; l < o; l += 4, f++) {
|
|
6700
|
+
const d = r[f] * 3;
|
|
6687
6701
|
c[l] = a[d], c[l + 1] = a[d + 1], c[l + 2] = a[d + 2], c[l + 3] = 255;
|
|
6688
6702
|
}
|
|
6689
6703
|
h.blitImage(t, e, s, n, c, 0, !1);
|
|
@@ -6702,29 +6716,29 @@ class dn {
|
|
|
6702
6716
|
return !1;
|
|
6703
6717
|
this._zlibs[t].setInput(l), l = this._zlibs[t].inflate(o), this._zlibs[t].setInput(null);
|
|
6704
6718
|
}
|
|
6705
|
-
let
|
|
6706
|
-
for (let
|
|
6719
|
+
let f = new Uint8Array(4 * n * r), d = 0, x = 0, k = new Uint8Array(3);
|
|
6720
|
+
for (let K = 0; K < n; K++) {
|
|
6707
6721
|
for (let A = 0; A < 3; A++) {
|
|
6708
6722
|
const S = k[A], F = l[x++] + S;
|
|
6709
|
-
|
|
6723
|
+
f[d++] = F, k[A] = F;
|
|
6710
6724
|
}
|
|
6711
|
-
|
|
6725
|
+
f[d++] = 255;
|
|
6712
6726
|
}
|
|
6713
|
-
let E = 0,
|
|
6714
|
-
for (let
|
|
6727
|
+
let E = 0, M = new Uint8Array(3), C = new Uint8Array(3);
|
|
6728
|
+
for (let K = 1; K < r; K++) {
|
|
6715
6729
|
k.fill(0), C.fill(0);
|
|
6716
6730
|
for (let A = 0; A < n; A++) {
|
|
6717
6731
|
for (let S = 0; S < 3; S++) {
|
|
6718
|
-
|
|
6719
|
-
let F = k[S] +
|
|
6732
|
+
M[S] = f[E++];
|
|
6733
|
+
let F = k[S] + M[S] - C[S];
|
|
6720
6734
|
F < 0 ? F = 0 : F > 255 && (F = 255);
|
|
6721
|
-
const
|
|
6722
|
-
|
|
6735
|
+
const R = l[x++] + F;
|
|
6736
|
+
f[d++] = R, C[S] = M[S], k[S] = R;
|
|
6723
6737
|
}
|
|
6724
|
-
|
|
6738
|
+
f[d++] = 255, E++;
|
|
6725
6739
|
}
|
|
6726
6740
|
}
|
|
6727
|
-
return h.blitImage(e, s, n, r,
|
|
6741
|
+
return h.blitImage(e, s, n, r, f, 0, !1), !0;
|
|
6728
6742
|
}
|
|
6729
6743
|
_readData(t) {
|
|
6730
6744
|
if (this._len === 0) {
|
|
@@ -6742,7 +6756,7 @@ class dn {
|
|
|
6742
6756
|
return (!this._scratchBuffer || this._scratchBuffer.length < t) && (this._scratchBuffer = new Uint8Array(t)), this._scratchBuffer;
|
|
6743
6757
|
}
|
|
6744
6758
|
}
|
|
6745
|
-
class
|
|
6759
|
+
class ga extends gn {
|
|
6746
6760
|
_pngRect(t, e, s, n, r, a, h) {
|
|
6747
6761
|
let c = this._readData(r);
|
|
6748
6762
|
return c === null ? !1 : (a.imageRect(t, e, s, n, "image/png", c), !0);
|
|
@@ -6751,10 +6765,10 @@ class da extends dn {
|
|
|
6751
6765
|
throw new Error("BasicCompression received in TightPNG rect");
|
|
6752
6766
|
}
|
|
6753
6767
|
}
|
|
6754
|
-
const
|
|
6755
|
-
class
|
|
6768
|
+
const ft = 64, dt = 64;
|
|
6769
|
+
class ba {
|
|
6756
6770
|
constructor() {
|
|
6757
|
-
this._length = 0, this._inflator = new
|
|
6771
|
+
this._length = 0, this._inflator = new Xt(), this._pixelBuffer = new Uint8Array(ft * dt * 4), this._tileBuffer = new Uint8Array(ft * dt * 4);
|
|
6758
6772
|
}
|
|
6759
6773
|
decodeRect(t, e, s, n, r, a, h) {
|
|
6760
6774
|
if (this._length === 0) {
|
|
@@ -6768,24 +6782,24 @@ class xa {
|
|
|
6768
6782
|
this._inflator.setInput(c);
|
|
6769
6783
|
for (let o = e; o < e + n; o += dt) {
|
|
6770
6784
|
let l = Math.min(dt, e + n - o);
|
|
6771
|
-
for (let
|
|
6772
|
-
let d = Math.min(
|
|
6785
|
+
for (let f = t; f < t + s; f += ft) {
|
|
6786
|
+
let d = Math.min(ft, t + s - f);
|
|
6773
6787
|
const x = d * l, k = this._inflator.inflate(1)[0];
|
|
6774
6788
|
if (k === 0) {
|
|
6775
6789
|
const E = this._readPixels(x);
|
|
6776
|
-
a.blitImage(
|
|
6790
|
+
a.blitImage(f, o, d, l, E, 0, !1);
|
|
6777
6791
|
} else if (k === 1) {
|
|
6778
6792
|
const E = this._readPixels(1);
|
|
6779
|
-
a.fillRect(
|
|
6793
|
+
a.fillRect(f, o, d, l, [E[0], E[1], E[2]]);
|
|
6780
6794
|
} else if (k >= 2 && k <= 16) {
|
|
6781
6795
|
const E = this._decodePaletteTile(k, x, d, l);
|
|
6782
|
-
a.blitImage(
|
|
6796
|
+
a.blitImage(f, o, d, l, E, 0, !1);
|
|
6783
6797
|
} else if (k === 128) {
|
|
6784
6798
|
const E = this._decodeRLETile(x);
|
|
6785
|
-
a.blitImage(
|
|
6799
|
+
a.blitImage(f, o, d, l, E, 0, !1);
|
|
6786
6800
|
} else if (k >= 130 && k <= 255) {
|
|
6787
6801
|
const E = this._decodeRLEPaletteTile(k - 128, x);
|
|
6788
|
-
a.blitImage(
|
|
6802
|
+
a.blitImage(f, o, d, l, E, 0, !1);
|
|
6789
6803
|
} else
|
|
6790
6804
|
throw new Error("Unknown subencoding: " + k);
|
|
6791
6805
|
}
|
|
@@ -6810,14 +6824,14 @@ class xa {
|
|
|
6810
6824
|
_decodePaletteTile(t, e, s, n) {
|
|
6811
6825
|
const r = this._tileBuffer, a = this._readPixels(t), h = this._getBitsPerPixelInPalette(t), c = (1 << h) - 1;
|
|
6812
6826
|
let o = 0, l = this._inflator.inflate(1)[0];
|
|
6813
|
-
for (let
|
|
6827
|
+
for (let f = 0; f < n; f++) {
|
|
6814
6828
|
let d = 8 - h;
|
|
6815
6829
|
for (let x = 0; x < s; x++) {
|
|
6816
6830
|
d < 0 && (d = 8 - h, l = this._inflator.inflate(1)[0]);
|
|
6817
6831
|
let k = l >> d & c;
|
|
6818
6832
|
r[o] = a[k * 4], r[o + 1] = a[k * 4 + 1], r[o + 2] = a[k * 4 + 2], r[o + 3] = a[k * 4 + 3], o += 4, d -= h;
|
|
6819
6833
|
}
|
|
6820
|
-
d < 8 - h &&
|
|
6834
|
+
d < 8 - h && f < n - 1 && (l = this._inflator.inflate(1)[0]);
|
|
6821
6835
|
}
|
|
6822
6836
|
return r;
|
|
6823
6837
|
}
|
|
@@ -6853,7 +6867,7 @@ class xa {
|
|
|
6853
6867
|
return t + 1;
|
|
6854
6868
|
}
|
|
6855
6869
|
}
|
|
6856
|
-
class
|
|
6870
|
+
class wa {
|
|
6857
6871
|
constructor() {
|
|
6858
6872
|
this._cachedQuantTables = [], this._cachedHuffmanTables = [], this._segments = [];
|
|
6859
6873
|
}
|
|
@@ -6884,13 +6898,13 @@ class pa {
|
|
|
6884
6898
|
0,
|
|
6885
6899
|
...this._cachedHuffmanTables
|
|
6886
6900
|
);
|
|
6887
|
-
let
|
|
6901
|
+
let f = 0;
|
|
6888
6902
|
for (let x of this._segments)
|
|
6889
|
-
|
|
6890
|
-
let d = new Uint8Array(
|
|
6891
|
-
|
|
6903
|
+
f += x.length;
|
|
6904
|
+
let d = new Uint8Array(f);
|
|
6905
|
+
f = 0;
|
|
6892
6906
|
for (let x of this._segments)
|
|
6893
|
-
d.set(x,
|
|
6907
|
+
d.set(x, f), f += x.length;
|
|
6894
6908
|
return a.imageRect(t, e, s, n, "image/jpeg", d), c.length !== 0 && (this._cachedHuffmanTables = c), o.length !== 0 && (this._cachedQuantTables = o), this._segments = [], !0;
|
|
6895
6909
|
}
|
|
6896
6910
|
_readSegment(t) {
|
|
@@ -6930,7 +6944,7 @@ class pa {
|
|
|
6930
6944
|
return a[0] = e, a[1] = s, a[2] = n >> 8, a[3] = n, a.set(t.rQshiftBytes(n - 2 + r, !1), 4), a;
|
|
6931
6945
|
}
|
|
6932
6946
|
}
|
|
6933
|
-
class
|
|
6947
|
+
class ma {
|
|
6934
6948
|
constructor(t) {
|
|
6935
6949
|
this._data = t, this._index = 0, this.profileIdc = null, this.constraintSet = null, this.levelIdc = null;
|
|
6936
6950
|
}
|
|
@@ -6988,7 +7002,7 @@ class ga {
|
|
|
6988
7002
|
};
|
|
6989
7003
|
}
|
|
6990
7004
|
}
|
|
6991
|
-
class
|
|
7005
|
+
class ya {
|
|
6992
7006
|
constructor(t, e) {
|
|
6993
7007
|
this.lastUsed = 0, this._width = t, this._height = e, this._profileIdc = null, this._constraintSet = null, this._levelIdc = null, this._decoder = null, this._pendingFrames = [];
|
|
6994
7008
|
}
|
|
@@ -7030,7 +7044,7 @@ class ba {
|
|
|
7030
7044
|
}), this._pendingFrames.push(e), e;
|
|
7031
7045
|
}
|
|
7032
7046
|
decode(t) {
|
|
7033
|
-
let e = new
|
|
7047
|
+
let e = new ma(t), s = null, n = Math.round(window.performance.now() * 1e3);
|
|
7034
7048
|
for (; ; ) {
|
|
7035
7049
|
let r = e.parse();
|
|
7036
7050
|
if (r === null)
|
|
@@ -7065,7 +7079,7 @@ class ba {
|
|
|
7065
7079
|
return s !== null && (s.keep = !0), s;
|
|
7066
7080
|
}
|
|
7067
7081
|
}
|
|
7068
|
-
class
|
|
7082
|
+
class va {
|
|
7069
7083
|
constructor() {
|
|
7070
7084
|
this._tick = 0, this._contexts = {};
|
|
7071
7085
|
}
|
|
@@ -7083,7 +7097,7 @@ class wa {
|
|
|
7083
7097
|
let h = this._findOldestContextId();
|
|
7084
7098
|
delete this._contexts[h];
|
|
7085
7099
|
}
|
|
7086
|
-
let a = new
|
|
7100
|
+
let a = new ya(s, n);
|
|
7087
7101
|
return this._contexts[this._contextId(t, e, s, n)] = a, a;
|
|
7088
7102
|
}
|
|
7089
7103
|
_getContext(t, e, s, n) {
|
|
@@ -7099,10 +7113,10 @@ class wa {
|
|
|
7099
7113
|
decodeRect(t, e, s, n, r, a, h) {
|
|
7100
7114
|
if (r.rQwait("h264 header", 8))
|
|
7101
7115
|
return !1;
|
|
7102
|
-
const l = r.rQshift32(),
|
|
7116
|
+
const l = r.rQshift32(), f = r.rQshift32();
|
|
7103
7117
|
if (r.rQwait("h264 payload", l, 8))
|
|
7104
7118
|
return !1;
|
|
7105
|
-
|
|
7119
|
+
f & 2 ? this._resetAllContexts() : f & 1 && this._resetContext(t, e, s, n);
|
|
7106
7120
|
let d = this._getContext(t, e, s, n);
|
|
7107
7121
|
if (d.lastUsed = this._tick++, l !== 0) {
|
|
7108
7122
|
let x = r.rQshiftBytes(l, !1), k = d.decode(x);
|
|
@@ -7111,8 +7125,8 @@ class wa {
|
|
|
7111
7125
|
return !0;
|
|
7112
7126
|
}
|
|
7113
7127
|
}
|
|
7114
|
-
const
|
|
7115
|
-
class B extends
|
|
7128
|
+
const ka = 3, Sa = "rgb(40, 40, 40)", ks = 17, Ss = 50, Cs = 19, Oe = 75, pe = 50, Ca = 1e3, Ea = 50, Es = 1, xt = 2, Ks = 6, As = 16, ei = 19, Xs = 22, Fs = 30, Ms = 113, Ts = 129, Qs = 256, _e = 1, Ls = 1 << 24, wt = 1 << 25, Rs = 1 << 26, Ge = 1 << 27, mt = 1 << 28;
|
|
7129
|
+
class B extends Vs {
|
|
7116
7130
|
constructor(t, e, s) {
|
|
7117
7131
|
if (!t)
|
|
7118
7132
|
throw new Error("Must specify target");
|
|
@@ -7133,13 +7147,13 @@ class B extends Hs {
|
|
|
7133
7147
|
handleGesture: this._handleGesture.bind(this),
|
|
7134
7148
|
handleRSAAESCredentialsRequired: this._handleRSAAESCredentialsRequired.bind(this),
|
|
7135
7149
|
handleRSAAESServerVerification: this._handleRSAAESServerVerification.bind(this)
|
|
7136
|
-
},
|
|
7150
|
+
}, Q(">> RFB.constructor"), this._screen = document.createElement("div"), this._screen.style.display = "flex", this._screen.style.width = "100%", this._screen.style.height = "100%", this._screen.style.overflow = "auto", this._screen.style.background = Sa, this._canvas = document.createElement("canvas"), this._canvas.style.margin = "auto", this._canvas.style.outline = "none", this._canvas.width = 0, this._canvas.height = 0, this._canvas.tabIndex = -1, this._screen.appendChild(this._canvas), this._cursor = new $r(), this._cursorImage = B.cursors.none, this._decoders[L.encodingRaw] = new ua(), this._decoders[L.encodingCopyRect] = new fa(), this._decoders[L.encodingRRE] = new da(), this._decoders[L.encodingHextile] = new xa(), this._decoders[L.encodingZlib] = new pa(), this._decoders[L.encodingTight] = new gn(), this._decoders[L.encodingTightPNG] = new ga(), this._decoders[L.encodingZRLE] = new ba(), this._decoders[L.encodingJPEG] = new wa(), this._decoders[L.encodingH264] = new va();
|
|
7137
7151
|
try {
|
|
7138
|
-
this._display = new
|
|
7152
|
+
this._display = new Sn(this._canvas);
|
|
7139
7153
|
} catch (n) {
|
|
7140
7154
|
throw z("Display exception: " + n), n;
|
|
7141
7155
|
}
|
|
7142
|
-
this._keyboard = new
|
|
7156
|
+
this._keyboard = new Wr(this._canvas), this._keyboard.onkeyevent = this._handleKeyEvent.bind(this), this._remoteCapsLock = null, this._remoteNumLock = null, this._gestures = new Jr(), this._sock = new ea(), this._sock.on("open", this._socketOpen.bind(this)), this._sock.on("close", this._socketClose.bind(this)), this._sock.on("message", this._handleMessage.bind(this)), this._sock.on("error", this._socketError.bind(this)), this._expectedClientWidth = null, this._expectedClientHeight = null, this._resizeObserver = new ResizeObserver(this._eventHandlers.handleResize), this._updateConnectionState("connecting"), Q("<< RFB.constructor"), this.dragViewport = !1, this.focusOnClick = !0, this._viewOnly = !1, this._clipViewport = !1, this._clippingViewport = !1, this._scaleViewport = !1, this._resizeSession = !1, this._showDotCursor = !1, this._qualityLevel = 6, this._compressionLevel = 2;
|
|
7143
7157
|
}
|
|
7144
7158
|
// ===== PROPERTIES =====
|
|
7145
7159
|
get viewOnly() {
|
|
@@ -7227,7 +7241,7 @@ class B extends Hs {
|
|
|
7227
7241
|
this._rfbCredentials = t, this._resumeAuthentication();
|
|
7228
7242
|
}
|
|
7229
7243
|
sendCtrlAltDel() {
|
|
7230
|
-
this._rfbConnectionState !== "connected" || this._viewOnly || ($("Sending Ctrl-Alt-Del"), this.sendKey(
|
|
7244
|
+
this._rfbConnectionState !== "connected" || this._viewOnly || ($("Sending Ctrl-Alt-Del"), this.sendKey(u.XK_Control_L, "ControlLeft", !0), this.sendKey(u.XK_Alt_L, "AltLeft", !0), this.sendKey(u.XK_Delete, "Delete", !0), this.sendKey(u.XK_Delete, "Delete", !1), this.sendKey(u.XK_Alt_L, "AltLeft", !1), this.sendKey(u.XK_Control_L, "ControlLeft", !1));
|
|
7231
7245
|
}
|
|
7232
7246
|
machineShutdown() {
|
|
7233
7247
|
this._xvpOp(1, 2);
|
|
@@ -7247,7 +7261,7 @@ class B extends Hs {
|
|
|
7247
7261
|
this.sendKey(t, e, !0), this.sendKey(t, e, !1);
|
|
7248
7262
|
return;
|
|
7249
7263
|
}
|
|
7250
|
-
const n =
|
|
7264
|
+
const n = ta[e];
|
|
7251
7265
|
if (this._qemuExtKeyEventSupported && n)
|
|
7252
7266
|
t = t || 0, $("Sending key (" + (s ? "down" : "up") + "): keysym " + t + ", scancode " + n), B.messages.QEMUExtendedKeyEvent(this._sock, t, s, n);
|
|
7253
7267
|
else {
|
|
@@ -7290,29 +7304,29 @@ class B extends Hs {
|
|
|
7290
7304
|
}
|
|
7291
7305
|
// ===== PRIVATE METHODS =====
|
|
7292
7306
|
_connect() {
|
|
7293
|
-
if (
|
|
7307
|
+
if (Q(">> RFB.connect"), this._url)
|
|
7294
7308
|
$(`connecting to ${this._url}`), this._sock.open(this._url, this._wsProtocols);
|
|
7295
7309
|
else {
|
|
7296
7310
|
if ($(`attaching ${this._rawChannel} to Websock`), this._sock.attach(this._rawChannel), this._sock.readyState === "closed")
|
|
7297
7311
|
throw Error("Cannot use already closed WebSocket/RTCDataChannel");
|
|
7298
7312
|
this._sock.readyState === "open" && this._socketOpen();
|
|
7299
7313
|
}
|
|
7300
|
-
this._target.appendChild(this._screen), this._gestures.attach(this._canvas), this._cursor.attach(this._canvas), this._refreshCursor(), this._resizeObserver.observe(this._screen), this._canvas.addEventListener("mousedown", this._eventHandlers.focusCanvas), this._canvas.addEventListener("touchstart", this._eventHandlers.focusCanvas), this._canvas.addEventListener("mousedown", this._eventHandlers.handleMouse), this._canvas.addEventListener("mouseup", this._eventHandlers.handleMouse), this._canvas.addEventListener("mousemove", this._eventHandlers.handleMouse), this._canvas.addEventListener("click", this._eventHandlers.handleMouse), this._canvas.addEventListener("contextmenu", this._eventHandlers.handleMouse), this._canvas.addEventListener("wheel", this._eventHandlers.handleWheel), this._canvas.addEventListener("gesturestart", this._eventHandlers.handleGesture), this._canvas.addEventListener("gesturemove", this._eventHandlers.handleGesture), this._canvas.addEventListener("gestureend", this._eventHandlers.handleGesture),
|
|
7314
|
+
this._target.appendChild(this._screen), this._gestures.attach(this._canvas), this._cursor.attach(this._canvas), this._refreshCursor(), this._resizeObserver.observe(this._screen), this._canvas.addEventListener("mousedown", this._eventHandlers.focusCanvas), this._canvas.addEventListener("touchstart", this._eventHandlers.focusCanvas), this._canvas.addEventListener("mousedown", this._eventHandlers.handleMouse), this._canvas.addEventListener("mouseup", this._eventHandlers.handleMouse), this._canvas.addEventListener("mousemove", this._eventHandlers.handleMouse), this._canvas.addEventListener("click", this._eventHandlers.handleMouse), this._canvas.addEventListener("contextmenu", this._eventHandlers.handleMouse), this._canvas.addEventListener("wheel", this._eventHandlers.handleWheel), this._canvas.addEventListener("gesturestart", this._eventHandlers.handleGesture), this._canvas.addEventListener("gesturemove", this._eventHandlers.handleGesture), this._canvas.addEventListener("gestureend", this._eventHandlers.handleGesture), Q("<< RFB.connect");
|
|
7301
7315
|
}
|
|
7302
7316
|
_disconnect() {
|
|
7303
|
-
|
|
7317
|
+
Q(">> RFB.disconnect"), this._cursor.detach(), this._canvas.removeEventListener("gesturestart", this._eventHandlers.handleGesture), this._canvas.removeEventListener("gesturemove", this._eventHandlers.handleGesture), this._canvas.removeEventListener("gestureend", this._eventHandlers.handleGesture), this._canvas.removeEventListener("wheel", this._eventHandlers.handleWheel), this._canvas.removeEventListener("mousedown", this._eventHandlers.handleMouse), this._canvas.removeEventListener("mouseup", this._eventHandlers.handleMouse), this._canvas.removeEventListener("mousemove", this._eventHandlers.handleMouse), this._canvas.removeEventListener("click", this._eventHandlers.handleMouse), this._canvas.removeEventListener("contextmenu", this._eventHandlers.handleMouse), this._canvas.removeEventListener("mousedown", this._eventHandlers.focusCanvas), this._canvas.removeEventListener("touchstart", this._eventHandlers.focusCanvas), this._resizeObserver.disconnect(), this._keyboard.ungrab(), this._gestures.detach(), this._sock.close();
|
|
7304
7318
|
try {
|
|
7305
7319
|
this._target.removeChild(this._screen);
|
|
7306
7320
|
} catch (t) {
|
|
7307
7321
|
if (t.name !== "NotFoundError") throw t;
|
|
7308
7322
|
}
|
|
7309
|
-
clearTimeout(this._resizeTimeout), clearTimeout(this._mouseMoveTimer),
|
|
7323
|
+
clearTimeout(this._resizeTimeout), clearTimeout(this._mouseMoveTimer), Q("<< RFB.disconnect");
|
|
7310
7324
|
}
|
|
7311
7325
|
_socketOpen() {
|
|
7312
|
-
this._rfbConnectionState === "connecting" && this._rfbInitState === "" ? (this._rfbInitState = "ProtocolVersion",
|
|
7326
|
+
this._rfbConnectionState === "connecting" && this._rfbInitState === "" ? (this._rfbInitState = "ProtocolVersion", Q("Starting VNC handshake")) : this._fail("Unexpected server connection while " + this._rfbConnectionState);
|
|
7313
7327
|
}
|
|
7314
7328
|
_socketClose(t) {
|
|
7315
|
-
|
|
7329
|
+
Q("WebSocket on-close event");
|
|
7316
7330
|
let e = "";
|
|
7317
7331
|
switch (t.code && (e = "(code: " + t.code, t.reason && (e += ", reason: " + t.reason), e += ")"), this._rfbConnectionState) {
|
|
7318
7332
|
case "connecting":
|
|
@@ -7402,7 +7416,7 @@ class B extends Hs {
|
|
|
7402
7416
|
Math.floor(t.h),
|
|
7403
7417
|
this._screenID,
|
|
7404
7418
|
this._screenFlags
|
|
7405
|
-
),
|
|
7419
|
+
), Q("Requested new desktop size: " + t.w + "x" + t.h));
|
|
7406
7420
|
}
|
|
7407
7421
|
// Gets the the size of the available screen
|
|
7408
7422
|
_screenSize() {
|
|
@@ -7423,7 +7437,7 @@ class B extends Hs {
|
|
|
7423
7437
|
_updateConnectionState(t) {
|
|
7424
7438
|
const e = this._rfbConnectionState;
|
|
7425
7439
|
if (t === e) {
|
|
7426
|
-
|
|
7440
|
+
Q("Already in state '" + t + "', ignoring");
|
|
7427
7441
|
return;
|
|
7428
7442
|
}
|
|
7429
7443
|
if (e === "disconnected") {
|
|
@@ -7459,7 +7473,7 @@ class B extends Hs {
|
|
|
7459
7473
|
z("Unknown connection state: " + t);
|
|
7460
7474
|
return;
|
|
7461
7475
|
}
|
|
7462
|
-
switch (this._rfbConnectionState = t,
|
|
7476
|
+
switch (this._rfbConnectionState = t, Q("New state '" + t + "', was '" + e + "'."), this._disconnTimer && t !== "disconnecting" && (Q("Clearing disconnect timer"), clearTimeout(this._disconnTimer), this._disconnTimer = null, this._sock.off("close")), t) {
|
|
7463
7477
|
case "connecting":
|
|
7464
7478
|
this._connect();
|
|
7465
7479
|
break;
|
|
@@ -7469,7 +7483,7 @@ class B extends Hs {
|
|
|
7469
7483
|
case "disconnecting":
|
|
7470
7484
|
this._disconnect(), this._disconnTimer = setTimeout(() => {
|
|
7471
7485
|
z("Disconnection timed out."), this._updateConnectionState("disconnected");
|
|
7472
|
-
},
|
|
7486
|
+
}, ka * 1e3);
|
|
7473
7487
|
break;
|
|
7474
7488
|
case "disconnected":
|
|
7475
7489
|
this.dispatchEvent(new CustomEvent(
|
|
@@ -7530,7 +7544,7 @@ class B extends Hs {
|
|
|
7530
7544
|
}
|
|
7531
7545
|
}
|
|
7532
7546
|
_handleKeyEvent(t, e, s, n, r) {
|
|
7533
|
-
e == "CapsLock" && s && (this._remoteCapsLock = null), this._remoteCapsLock !== null && r !== null && this._remoteCapsLock !== r && s && (
|
|
7547
|
+
e == "CapsLock" && s && (this._remoteCapsLock = null), this._remoteCapsLock !== null && r !== null && this._remoteCapsLock !== r && s && (Q("Fixing remote caps lock"), this.sendKey(u.XK_Caps_Lock, "CapsLock", !0), this.sendKey(u.XK_Caps_Lock, "CapsLock", !1), this._remoteCapsLock = null), e == "NumLock" && s && (this._remoteNumLock = null), this._remoteNumLock !== null && n !== null && this._remoteNumLock !== n && s && (Q("Fixing remote num lock"), this.sendKey(u.XK_Num_Lock, "NumLock", !0), this.sendKey(u.XK_Num_Lock, "NumLock", !1), this._remoteNumLock = null), this.sendKey(t, e, s);
|
|
7534
7548
|
}
|
|
7535
7549
|
static _convertButtonMask(t) {
|
|
7536
7550
|
const e = {
|
|
@@ -7572,7 +7586,7 @@ class B extends Hs {
|
|
|
7572
7586
|
}
|
|
7573
7587
|
this._sendMouse(e.x, e.y, this._mouseButtonMask);
|
|
7574
7588
|
}
|
|
7575
|
-
n &&
|
|
7589
|
+
n && kn(this._canvas), this._handleMouseButton(e.x, e.y, s);
|
|
7576
7590
|
break;
|
|
7577
7591
|
case "mousemove":
|
|
7578
7592
|
if (this._viewportDragging) {
|
|
@@ -7590,9 +7604,9 @@ class B extends Hs {
|
|
|
7590
7604
|
_handleMouseMove(t, e) {
|
|
7591
7605
|
if (this._mousePos = { x: t, y: e }, this._mouseMoveTimer == null) {
|
|
7592
7606
|
const s = Date.now() - this._mouseLastMoveTime;
|
|
7593
|
-
s >
|
|
7607
|
+
s > ks ? (this._sendMouse(t, e, this._mouseButtonMask), this._mouseLastMoveTime = Date.now()) : this._mouseMoveTimer = setTimeout(() => {
|
|
7594
7608
|
this._handleDelayedMouseMove();
|
|
7595
|
-
},
|
|
7609
|
+
}, ks - s);
|
|
7596
7610
|
}
|
|
7597
7611
|
}
|
|
7598
7612
|
_handleDelayedMouseMove() {
|
|
@@ -7629,7 +7643,7 @@ class B extends Hs {
|
|
|
7629
7643
|
t.clientY,
|
|
7630
7644
|
this._canvas
|
|
7631
7645
|
), s = B._convertButtonMask(t.buttons), n = t.deltaX, r = t.deltaY;
|
|
7632
|
-
t.deltaMode !== 0 && (n *=
|
|
7646
|
+
t.deltaMode !== 0 && (n *= Cs, r *= Cs), this._accumulatedWheelDeltaX += n, this._accumulatedWheelDeltaY += r, Math.abs(this._accumulatedWheelDeltaX) >= Ss && (this._accumulatedWheelDeltaX < 0 ? (this._handleMouseButton(e.x, e.y, s | 32), this._handleMouseButton(e.x, e.y, s)) : this._accumulatedWheelDeltaX > 0 && (this._handleMouseButton(e.x, e.y, s | 64), this._handleMouseButton(e.x, e.y, s)), this._accumulatedWheelDeltaX = 0), Math.abs(this._accumulatedWheelDeltaY) >= Ss && (this._accumulatedWheelDeltaY < 0 ? (this._handleMouseButton(e.x, e.y, s | 8), this._handleMouseButton(e.x, e.y, s)) : this._accumulatedWheelDeltaY > 0 && (this._handleMouseButton(e.x, e.y, s | 16), this._handleMouseButton(e.x, e.y, s)), this._accumulatedWheelDeltaY = 0);
|
|
7633
7647
|
}
|
|
7634
7648
|
_fakeMouseMove(t, e, s) {
|
|
7635
7649
|
this._handleMouseMove(e, s), this._cursor.move(t.detail.clientX, t.detail.clientY);
|
|
@@ -7640,9 +7654,9 @@ class B extends Hs {
|
|
|
7640
7654
|
t.detail.clientY,
|
|
7641
7655
|
this._canvas
|
|
7642
7656
|
);
|
|
7643
|
-
if (this._gestureLastTapTime !== null && Date.now() - this._gestureLastTapTime <
|
|
7657
|
+
if (this._gestureLastTapTime !== null && Date.now() - this._gestureLastTapTime < Ca && this._gestureFirstDoubleTapEv.detail.type === t.detail.type) {
|
|
7644
7658
|
let n = this._gestureFirstDoubleTapEv.detail.clientX - t.detail.clientX, r = this._gestureFirstDoubleTapEv.detail.clientY - t.detail.clientY;
|
|
7645
|
-
Math.hypot(n, r) <
|
|
7659
|
+
Math.hypot(n, r) < Ea ? s = Ue(
|
|
7646
7660
|
this._gestureFirstDoubleTapEv.detail.clientX,
|
|
7647
7661
|
this._gestureFirstDoubleTapEv.detail.clientY,
|
|
7648
7662
|
this._canvas
|
|
@@ -7713,12 +7727,12 @@ class B extends Hs {
|
|
|
7713
7727
|
break;
|
|
7714
7728
|
case "pinch":
|
|
7715
7729
|
if (this._fakeMouseMove(t, s.x, s.y), e = Math.hypot(t.detail.magnitudeX, t.detail.magnitudeY), Math.abs(e - this._gestureLastMagnitudeX) > Oe) {
|
|
7716
|
-
for (this._handleKeyEvent(
|
|
7730
|
+
for (this._handleKeyEvent(u.XK_Control_L, "ControlLeft", !0); e - this._gestureLastMagnitudeX > Oe; )
|
|
7717
7731
|
this._handleMouseButton(s.x, s.y, 8), this._handleMouseButton(s.x, s.y, 0), this._gestureLastMagnitudeX += Oe;
|
|
7718
7732
|
for (; e - this._gestureLastMagnitudeX < -Oe; )
|
|
7719
7733
|
this._handleMouseButton(s.x, s.y, 16), this._handleMouseButton(s.x, s.y, 0), this._gestureLastMagnitudeX -= Oe;
|
|
7720
7734
|
}
|
|
7721
|
-
this._handleKeyEvent(
|
|
7735
|
+
this._handleKeyEvent(u.XK_Control_L, "ControlLeft", !1);
|
|
7722
7736
|
break;
|
|
7723
7737
|
}
|
|
7724
7738
|
break;
|
|
@@ -7785,18 +7799,18 @@ class B extends Hs {
|
|
|
7785
7799
|
this._rfbVersion > this._rfbMaxVersion && (this._rfbVersion = this._rfbMaxVersion);
|
|
7786
7800
|
const s = "00" + parseInt(this._rfbVersion, 10) + ".00" + this._rfbVersion * 10 % 10;
|
|
7787
7801
|
this._sock.sQpushString("RFB " + s + `
|
|
7788
|
-
`), this._sock.flush(),
|
|
7802
|
+
`), this._sock.flush(), Q("Sent ProtocolVersion: " + s), this._rfbInitState = "Security";
|
|
7789
7803
|
}
|
|
7790
7804
|
_isSupportedSecurityType(t) {
|
|
7791
7805
|
return [
|
|
7792
7806
|
Es,
|
|
7793
7807
|
xt,
|
|
7794
|
-
Cs,
|
|
7795
7808
|
Ks,
|
|
7796
|
-
$t,
|
|
7797
7809
|
As,
|
|
7810
|
+
ei,
|
|
7798
7811
|
Xs,
|
|
7799
7812
|
Fs,
|
|
7813
|
+
Ms,
|
|
7800
7814
|
Qs
|
|
7801
7815
|
].includes(t);
|
|
7802
7816
|
}
|
|
@@ -7808,7 +7822,7 @@ class B extends Hs {
|
|
|
7808
7822
|
if (t === 0)
|
|
7809
7823
|
return this._rfbInitState = "SecurityReason", this._securityContext = "no security types", this._securityStatus = 1, !0;
|
|
7810
7824
|
const e = this._sock.rQshiftBytes(t);
|
|
7811
|
-
|
|
7825
|
+
Q("Server security types: " + e), this._rfbAuthScheme = -1;
|
|
7812
7826
|
for (let s of e)
|
|
7813
7827
|
if (this._isSupportedSecurityType(s)) {
|
|
7814
7828
|
this._rfbAuthScheme = s;
|
|
@@ -7823,7 +7837,7 @@ class B extends Hs {
|
|
|
7823
7837
|
if (this._rfbAuthScheme = this._sock.rQshift32(), this._rfbAuthScheme == 0)
|
|
7824
7838
|
return this._rfbInitState = "SecurityReason", this._securityContext = "authentication scheme", this._securityStatus = 1, !0;
|
|
7825
7839
|
}
|
|
7826
|
-
return this._rfbInitState = "Authentication",
|
|
7840
|
+
return this._rfbInitState = "Authentication", Q("Authenticating using scheme: " + this._rfbAuthScheme), !0;
|
|
7827
7841
|
}
|
|
7828
7842
|
_handleSecurityReason() {
|
|
7829
7843
|
if (this._sock.rQwait("reason length", 4))
|
|
@@ -7887,7 +7901,7 @@ class B extends Hs {
|
|
|
7887
7901
|
t.push(this._sock.rQshift32());
|
|
7888
7902
|
this._rfbAuthScheme = -1;
|
|
7889
7903
|
for (let e of t)
|
|
7890
|
-
if (e !==
|
|
7904
|
+
if (e !== ei && this._isSupportedSecurityType(e)) {
|
|
7891
7905
|
this._rfbAuthScheme = e;
|
|
7892
7906
|
break;
|
|
7893
7907
|
}
|
|
@@ -7900,7 +7914,7 @@ class B extends Hs {
|
|
|
7900
7914
|
"credentialsrequired",
|
|
7901
7915
|
{ detail: { types: ["username", "password"] } }
|
|
7902
7916
|
)), !1;
|
|
7903
|
-
const t =
|
|
7917
|
+
const t = fe(this._rfbCredentials.username), e = fe(this._rfbCredentials.password);
|
|
7904
7918
|
return this._sock.sQpush32(t.length), this._sock.sQpush32(e.length), this._sock.sQpushString(t), this._sock.sQpushString(e), this._sock.flush(), this._rfbInitState = "SecurityResult", !0;
|
|
7905
7919
|
}
|
|
7906
7920
|
_negotiateStdVNCAuth() {
|
|
@@ -7939,7 +7953,7 @@ class B extends Hs {
|
|
|
7939
7953
|
{ name: "DH", public: e },
|
|
7940
7954
|
s.privateKey,
|
|
7941
7955
|
t * 8
|
|
7942
|
-
), a =
|
|
7956
|
+
), a = fe(this._rfbCredentials.username).substring(0, 63), h = fe(this._rfbCredentials.password).substring(0, 63), c = window.crypto.getRandomValues(new Uint8Array(128));
|
|
7943
7957
|
for (let d = 0; d < a.length; d++)
|
|
7944
7958
|
c[d] = a.charCodeAt(d);
|
|
7945
7959
|
c[a.length] = 0;
|
|
@@ -7952,8 +7966,8 @@ class B extends Hs {
|
|
|
7952
7966
|
{ name: "AES-ECB" },
|
|
7953
7967
|
!1,
|
|
7954
7968
|
["encrypt"]
|
|
7955
|
-
),
|
|
7956
|
-
this._rfbCredentials.ardCredentials =
|
|
7969
|
+
), f = await V.encrypt({ name: "AES-ECB" }, l, c);
|
|
7970
|
+
this._rfbCredentials.ardCredentials = f, this._rfbCredentials.ardPublicKey = n, this._resumeAuthentication();
|
|
7957
7971
|
}
|
|
7958
7972
|
_negotiateTightUnixAuth() {
|
|
7959
7973
|
return this._rfbCredentials.username === void 0 || this._rfbCredentials.password === void 0 ? (this.dispatchEvent(new CustomEvent(
|
|
@@ -7969,7 +7983,7 @@ class B extends Hs {
|
|
|
7969
7983
|
const r = this._sock.rQshift32(), a = this._sock.rQshiftStr(4), h = this._sock.rQshiftStr(8);
|
|
7970
7984
|
s[r] = { vendor: a, signature: h };
|
|
7971
7985
|
}
|
|
7972
|
-
return
|
|
7986
|
+
return Q("Server Tight tunnel types: " + s), s[1] && s[1].vendor === "SICR" && s[1].signature === "SCHANNEL" && (Q("Detected Siemens server. Assuming NOTUNNEL support."), s[0] = { vendor: "TGHT", signature: "NOTUNNEL" }), s[0] ? s[0].vendor != e[0].vendor || s[0].signature != e[0].signature ? this._fail("Client's tunnel type had the incorrect vendor or signature") : (Q("Selected tunnel type: " + e[0]), this._sock.sQpush32(0), this._sock.flush(), !1) : this._fail("Server wanted tunnels, but doesn't support the notunnel type");
|
|
7973
7987
|
}
|
|
7974
7988
|
_negotiateTightAuth() {
|
|
7975
7989
|
if (!this._rfbTightVNC) {
|
|
@@ -7998,16 +8012,16 @@ class B extends Hs {
|
|
|
7998
8012
|
const r = this._sock.rQshiftStr(12);
|
|
7999
8013
|
s.push(r);
|
|
8000
8014
|
}
|
|
8001
|
-
|
|
8015
|
+
Q("Server Tight authentication types: " + s);
|
|
8002
8016
|
for (let n in e)
|
|
8003
8017
|
if (s.indexOf(n) != -1)
|
|
8004
|
-
switch (this._sock.sQpush32(e[n]), this._sock.flush(),
|
|
8018
|
+
switch (this._sock.sQpush32(e[n]), this._sock.flush(), Q("Selected authentication type: " + n), n) {
|
|
8005
8019
|
case "STDVNOAUTH__":
|
|
8006
8020
|
return this._rfbInitState = "SecurityResult", !0;
|
|
8007
8021
|
case "STDVVNCAUTH_":
|
|
8008
8022
|
return this._rfbAuthScheme = xt, !0;
|
|
8009
8023
|
case "TGHTULGNAUTH":
|
|
8010
|
-
return this._rfbAuthScheme =
|
|
8024
|
+
return this._rfbAuthScheme = Ts, !0;
|
|
8011
8025
|
default:
|
|
8012
8026
|
return this._fail("Unsupported tiny auth scheme (scheme: " + n + ")");
|
|
8013
8027
|
}
|
|
@@ -8020,7 +8034,7 @@ class B extends Hs {
|
|
|
8020
8034
|
this.dispatchEvent(t);
|
|
8021
8035
|
}
|
|
8022
8036
|
_negotiateRA2neAuth() {
|
|
8023
|
-
return this._rfbRSAAESAuthenticationState === null && (this._rfbRSAAESAuthenticationState = new
|
|
8037
|
+
return this._rfbRSAAESAuthenticationState === null && (this._rfbRSAAESAuthenticationState = new _a(this._sock, () => this._rfbCredentials), this._rfbRSAAESAuthenticationState.addEventListener(
|
|
8024
8038
|
"serververification",
|
|
8025
8039
|
this._eventHandlers.handleRSAAESServerVerification
|
|
8026
8040
|
), this._rfbRSAAESAuthenticationState.addEventListener(
|
|
@@ -8046,37 +8060,37 @@ class B extends Hs {
|
|
|
8046
8060
|
"credentialsrequired",
|
|
8047
8061
|
{ detail: { types: ["username", "password"] } }
|
|
8048
8062
|
)), !1;
|
|
8049
|
-
const t = this._sock.rQshiftBytes(8), e = this._sock.rQshiftBytes(8), s = this._sock.rQshiftBytes(8), n = V.generateKey({ name: "DH", g: t, p: e }, !0, ["deriveBits"]), r = V.exportKey("raw", n.publicKey), a = V.deriveBits({ name: "DH", public: s }, n.privateKey, 64), h = V.importKey("raw", a, { name: "DES-CBC" }, !1, ["encrypt"]), c =
|
|
8050
|
-
let l = new Uint8Array(256),
|
|
8051
|
-
window.crypto.getRandomValues(l), window.crypto.getRandomValues(
|
|
8063
|
+
const t = this._sock.rQshiftBytes(8), e = this._sock.rQshiftBytes(8), s = this._sock.rQshiftBytes(8), n = V.generateKey({ name: "DH", g: t, p: e }, !0, ["deriveBits"]), r = V.exportKey("raw", n.publicKey), a = V.deriveBits({ name: "DH", public: s }, n.privateKey, 64), h = V.importKey("raw", a, { name: "DES-CBC" }, !1, ["encrypt"]), c = fe(this._rfbCredentials.username).substring(0, 255), o = fe(this._rfbCredentials.password).substring(0, 63);
|
|
8064
|
+
let l = new Uint8Array(256), f = new Uint8Array(64);
|
|
8065
|
+
window.crypto.getRandomValues(l), window.crypto.getRandomValues(f);
|
|
8052
8066
|
for (let d = 0; d < c.length; d++)
|
|
8053
8067
|
l[d] = c.charCodeAt(d);
|
|
8054
8068
|
l[c.length] = 0;
|
|
8055
8069
|
for (let d = 0; d < o.length; d++)
|
|
8056
|
-
|
|
8057
|
-
return
|
|
8070
|
+
f[d] = o.charCodeAt(d);
|
|
8071
|
+
return f[o.length] = 0, l = V.encrypt({ name: "DES-CBC", iv: a }, h, l), f = V.encrypt({ name: "DES-CBC", iv: a }, h, f), this._sock.sQpushBytes(r), this._sock.sQpushBytes(l), this._sock.sQpushBytes(f), this._sock.flush(), this._rfbInitState = "SecurityResult", !0;
|
|
8058
8072
|
}
|
|
8059
8073
|
_negotiateAuthentication() {
|
|
8060
8074
|
switch (this._rfbAuthScheme) {
|
|
8061
8075
|
case Es:
|
|
8062
8076
|
return this._rfbVersion >= 3.8 ? this._rfbInitState = "SecurityResult" : this._rfbInitState = "ClientInitialisation", !0;
|
|
8063
|
-
case As:
|
|
8064
|
-
return this._negotiateXvpAuth();
|
|
8065
8077
|
case Xs:
|
|
8078
|
+
return this._negotiateXvpAuth();
|
|
8079
|
+
case Fs:
|
|
8066
8080
|
return this._negotiateARDAuth();
|
|
8067
8081
|
case xt:
|
|
8068
8082
|
return this._negotiateStdVNCAuth();
|
|
8069
|
-
case
|
|
8083
|
+
case As:
|
|
8070
8084
|
return this._negotiateTightAuth();
|
|
8071
|
-
case
|
|
8085
|
+
case ei:
|
|
8072
8086
|
return this._negotiateVeNCryptAuth();
|
|
8073
8087
|
case Qs:
|
|
8074
8088
|
return this._negotiatePlainAuth();
|
|
8075
|
-
case
|
|
8089
|
+
case Ts:
|
|
8076
8090
|
return this._negotiateTightUnixAuth();
|
|
8077
|
-
case
|
|
8091
|
+
case Ks:
|
|
8078
8092
|
return this._negotiateRA2neAuth();
|
|
8079
|
-
case
|
|
8093
|
+
case Ms:
|
|
8080
8094
|
return this._negotiateMSLogonIIAuth();
|
|
8081
8095
|
default:
|
|
8082
8096
|
return this._fail("Unsupported auth scheme (scheme: " + this._rfbAuthScheme + ")");
|
|
@@ -8086,7 +8100,7 @@ class B extends Hs {
|
|
|
8086
8100
|
if (this._sock.rQwait("VNC auth response ", 4))
|
|
8087
8101
|
return !1;
|
|
8088
8102
|
const t = this._sock.rQshift32();
|
|
8089
|
-
return t === 0 ? (this._rfbInitState = "ClientInitialisation",
|
|
8103
|
+
return t === 0 ? (this._rfbInitState = "ClientInitialisation", Q("Authentication OK"), !0) : this._rfbVersion >= 3.8 ? (this._rfbInitState = "SecurityReason", this._securityContext = "security result", this._securityStatus = t, !0) : (this.dispatchEvent(new CustomEvent(
|
|
8090
8104
|
"securityfailure",
|
|
8091
8105
|
{ detail: { status: t } }
|
|
8092
8106
|
)), this._fail("Security handshake failed"));
|
|
@@ -8094,7 +8108,7 @@ class B extends Hs {
|
|
|
8094
8108
|
_negotiateServerInit() {
|
|
8095
8109
|
if (this._sock.rQwait("server initialization", 24))
|
|
8096
8110
|
return !1;
|
|
8097
|
-
const t = this._sock.rQshift16(), e = this._sock.rQshift16(), s = this._sock.rQshift8(), n = this._sock.rQshift8(), r = this._sock.rQshift8(), a = this._sock.rQshift8(), h = this._sock.rQshift16(), c = this._sock.rQshift16(), o = this._sock.rQshift16(), l = this._sock.rQshift8(),
|
|
8111
|
+
const t = this._sock.rQshift16(), e = this._sock.rQshift16(), s = this._sock.rQshift8(), n = this._sock.rQshift8(), r = this._sock.rQshift8(), a = this._sock.rQshift8(), h = this._sock.rQshift16(), c = this._sock.rQshift16(), o = this._sock.rQshift16(), l = this._sock.rQshift8(), f = this._sock.rQshift8(), d = this._sock.rQshift8();
|
|
8098
8112
|
this._sock.rQskipBytes(3);
|
|
8099
8113
|
const x = this._sock.rQshift32();
|
|
8100
8114
|
if (this._sock.rQwait("server init name", x, 24))
|
|
@@ -8103,18 +8117,18 @@ class B extends Hs {
|
|
|
8103
8117
|
if (k = Qt(k, !0), this._rfbTightVNC) {
|
|
8104
8118
|
if (this._sock.rQwait("TightVNC extended server init header", 8, 24 + x))
|
|
8105
8119
|
return !1;
|
|
8106
|
-
const E = this._sock.rQshift16(),
|
|
8120
|
+
const E = this._sock.rQshift16(), M = this._sock.rQshift16(), C = this._sock.rQshift16();
|
|
8107
8121
|
this._sock.rQskipBytes(2);
|
|
8108
|
-
const
|
|
8109
|
-
if (this._sock.rQwait("TightVNC extended server init header",
|
|
8122
|
+
const K = (E + M + C) * 16;
|
|
8123
|
+
if (this._sock.rQwait("TightVNC extended server init header", K, 32 + x))
|
|
8110
8124
|
return !1;
|
|
8111
|
-
this._sock.rQskipBytes(16 * E), this._sock.rQskipBytes(16 *
|
|
8125
|
+
this._sock.rQskipBytes(16 * E), this._sock.rQskipBytes(16 * M), this._sock.rQskipBytes(16 * C);
|
|
8112
8126
|
}
|
|
8113
|
-
return $("Screen: " + t + "x" + e + ", bpp: " + s + ", depth: " + n + ", bigEndian: " + r + ", trueColor: " + a + ", redMax: " + h + ", greenMax: " + c + ", blueMax: " + o + ", redShift: " + l + ", greenShift: " +
|
|
8127
|
+
return $("Screen: " + t + "x" + e + ", bpp: " + s + ", depth: " + n + ", bigEndian: " + r + ", trueColor: " + a + ", redMax: " + h + ", greenMax: " + c + ", blueMax: " + o + ", redShift: " + l + ", greenShift: " + f + ", blueShift: " + d), this._setDesktopName(k), this._resize(t, e), this._viewOnly || this._keyboard.grab(), this._fbDepth = 24, this._fbName === "Intel(r) AMT KVM" && (te("Intel AMT KVM only supports 8/16 bit depths. Using low color mode."), this._fbDepth = 8), B.messages.pixelFormat(this._sock, this._fbDepth, !0), this._sendEncodings(), B.messages.fbUpdateRequest(this._sock, !1, 0, 0, this._fbWidth, this._fbHeight), this._updateConnectionState("connected"), !0;
|
|
8114
8128
|
}
|
|
8115
8129
|
_sendEncodings() {
|
|
8116
8130
|
const t = [];
|
|
8117
|
-
t.push(L.encodingCopyRect), this._fbDepth == 24 && (
|
|
8131
|
+
t.push(L.encodingCopyRect), this._fbDepth == 24 && (Us && t.push(L.encodingH264), t.push(L.encodingTight), t.push(L.encodingTightPNG), t.push(L.encodingZRLE), t.push(L.encodingJPEG), t.push(L.encodingHextile), t.push(L.encodingRRE), t.push(L.encodingZlib)), t.push(L.encodingRaw), t.push(L.pseudoEncodingQualityLevel0 + this._qualityLevel), t.push(L.pseudoEncodingCompressLevel0 + this._compressionLevel), t.push(L.pseudoEncodingDesktopSize), t.push(L.pseudoEncodingLastRect), t.push(L.pseudoEncodingQEMUExtendedKeyEvent), t.push(L.pseudoEncodingQEMULedEvent), t.push(L.pseudoEncodingExtendedDesktopSize), t.push(L.pseudoEncodingXvp), t.push(L.pseudoEncodingFence), t.push(L.pseudoEncodingContinuousUpdates), t.push(L.pseudoEncodingDesktopName), t.push(L.pseudoEncodingExtendedClipboard), t.push(L.pseudoEncodingExtendedMouseButtons), this._fbDepth == 24 && (t.push(L.pseudoEncodingVMwareCursor), t.push(L.pseudoEncodingCursor)), B.messages.clientEncodings(this._sock, t);
|
|
8118
8132
|
}
|
|
8119
8133
|
/* RFB protocol initialization states:
|
|
8120
8134
|
* ProtocolVersion
|
|
@@ -8150,14 +8164,14 @@ class B extends Hs {
|
|
|
8150
8164
|
setTimeout(this._initMsg.bind(this), 0);
|
|
8151
8165
|
}
|
|
8152
8166
|
_handleSetColourMapMsg() {
|
|
8153
|
-
return
|
|
8167
|
+
return Q("SetColorMapEntries"), this._fail("Unexpected SetColorMapEntries message");
|
|
8154
8168
|
}
|
|
8155
8169
|
_handleServerCutText() {
|
|
8156
|
-
if (
|
|
8170
|
+
if (Q("ServerCutText"), this._sock.rQwait("ServerCutText header", 7, 1))
|
|
8157
8171
|
return !1;
|
|
8158
8172
|
this._sock.rQskipBytes(3);
|
|
8159
8173
|
let t = this._sock.rQshift32();
|
|
8160
|
-
if (t =
|
|
8174
|
+
if (t = ti(t), this._sock.rQwait("ServerCutText content", Math.abs(t), 8))
|
|
8161
8175
|
return !1;
|
|
8162
8176
|
if (t >= 0) {
|
|
8163
8177
|
const e = this._sock.rQshiftStr(t);
|
|
@@ -8171,7 +8185,7 @@ class B extends Hs {
|
|
|
8171
8185
|
t = Math.abs(t);
|
|
8172
8186
|
const e = this._sock.rQshift32();
|
|
8173
8187
|
let s = e & 65535, n = e & 4278190080;
|
|
8174
|
-
if (!!(n &
|
|
8188
|
+
if (!!(n & Ls)) {
|
|
8175
8189
|
this._clipboardServerCapabilitiesFormats = {}, this._clipboardServerCapabilitiesActions = {};
|
|
8176
8190
|
for (let h = 0; h <= 15; h++) {
|
|
8177
8191
|
let c = 1 << h;
|
|
@@ -8182,37 +8196,37 @@ class B extends Hs {
|
|
|
8182
8196
|
this._clipboardServerCapabilitiesActions[c] = !!(n & c);
|
|
8183
8197
|
}
|
|
8184
8198
|
let a = [
|
|
8185
|
-
Ts,
|
|
8186
|
-
bt,
|
|
8187
8199
|
Ls,
|
|
8200
|
+
wt,
|
|
8201
|
+
Rs,
|
|
8188
8202
|
Ge,
|
|
8189
|
-
|
|
8203
|
+
mt
|
|
8190
8204
|
];
|
|
8191
8205
|
B.messages.extendedClipboardCaps(this._sock, a, { extendedClipboardFormatText: 0 });
|
|
8192
|
-
} else if (n ===
|
|
8206
|
+
} else if (n === wt) {
|
|
8193
8207
|
if (this._viewOnly)
|
|
8194
8208
|
return !0;
|
|
8195
|
-
this._clipboardText != null && this._clipboardServerCapabilitiesActions[
|
|
8196
|
-
} else if (n ===
|
|
8209
|
+
this._clipboardText != null && this._clipboardServerCapabilitiesActions[mt] && s & _e && B.messages.extendedClipboardProvide(this._sock, [_e], [this._clipboardText]);
|
|
8210
|
+
} else if (n === Rs) {
|
|
8197
8211
|
if (this._viewOnly)
|
|
8198
8212
|
return !0;
|
|
8199
8213
|
this._clipboardServerCapabilitiesActions[Ge] && (this._clipboardText != null ? B.messages.extendedClipboardNotify(this._sock, [_e]) : B.messages.extendedClipboardNotify(this._sock, []));
|
|
8200
8214
|
} else if (n === Ge) {
|
|
8201
8215
|
if (this._viewOnly)
|
|
8202
8216
|
return !0;
|
|
8203
|
-
this._clipboardServerCapabilitiesActions[
|
|
8204
|
-
} else if (n ===
|
|
8217
|
+
this._clipboardServerCapabilitiesActions[wt] && s & _e && B.messages.extendedClipboardRequest(this._sock, [_e]);
|
|
8218
|
+
} else if (n === mt) {
|
|
8205
8219
|
if (this._viewOnly || !(s & _e))
|
|
8206
8220
|
return !0;
|
|
8207
8221
|
this._clipboardText = null;
|
|
8208
|
-
let a = this._sock.rQshiftBytes(t - 4), h = new
|
|
8222
|
+
let a = this._sock.rQshiftBytes(t - 4), h = new Xt(), c = null;
|
|
8209
8223
|
h.setInput(a);
|
|
8210
8224
|
for (let o = 0; o <= 15; o++) {
|
|
8211
8225
|
let l = 1 << o;
|
|
8212
8226
|
if (s & l) {
|
|
8213
|
-
let
|
|
8214
|
-
|
|
8215
|
-
let x = h.inflate(
|
|
8227
|
+
let f = 0, d = h.inflate(4);
|
|
8228
|
+
f |= d[0] << 24, f |= d[1] << 16, f |= d[2] << 8, f |= d[3];
|
|
8229
|
+
let x = h.inflate(f);
|
|
8216
8230
|
l === _e && (c = x);
|
|
8217
8231
|
}
|
|
8218
8232
|
}
|
|
@@ -8278,7 +8292,7 @@ class B extends Hs {
|
|
|
8278
8292
|
case 1:
|
|
8279
8293
|
return this._handleSetColourMapMsg();
|
|
8280
8294
|
case 2:
|
|
8281
|
-
return
|
|
8295
|
+
return Q("Bell"), this.dispatchEvent(new CustomEvent(
|
|
8282
8296
|
"bell",
|
|
8283
8297
|
{ detail: {} }
|
|
8284
8298
|
)), !0;
|
|
@@ -8291,7 +8305,7 @@ class B extends Hs {
|
|
|
8291
8305
|
case 250:
|
|
8292
8306
|
return this._handleXvpMsg();
|
|
8293
8307
|
default:
|
|
8294
|
-
return this._fail("Unexpected server message (type " + t + ")"),
|
|
8308
|
+
return this._fail("Unexpected server message (type " + t + ")"), Q("sock.rQpeekBytes(30): " + this._sock.rQpeekBytes(30)), !0;
|
|
8295
8309
|
}
|
|
8296
8310
|
}
|
|
8297
8311
|
_framebufferUpdate() {
|
|
@@ -8355,16 +8369,16 @@ class B extends Hs {
|
|
|
8355
8369
|
))
|
|
8356
8370
|
return !1;
|
|
8357
8371
|
let o = new Array(s * n);
|
|
8358
|
-
for (let
|
|
8359
|
-
o[
|
|
8372
|
+
for (let f = 0; f < s * n; f++)
|
|
8373
|
+
o[f] = this._sock.rQshift32();
|
|
8360
8374
|
let l = new Array(s * n);
|
|
8361
|
-
for (let
|
|
8362
|
-
l[
|
|
8363
|
-
for (let
|
|
8364
|
-
if (o[
|
|
8365
|
-
let d = l[
|
|
8366
|
-
a[
|
|
8367
|
-
} else (o[
|
|
8375
|
+
for (let f = 0; f < s * n; f++)
|
|
8376
|
+
l[f] = this._sock.rQshift32();
|
|
8377
|
+
for (let f = 0; f < s * n; f++)
|
|
8378
|
+
if (o[f] == 0) {
|
|
8379
|
+
let d = l[f], x = d >> 8 & 255, k = d >> 16 & 255, E = d >> 24 & 255;
|
|
8380
|
+
a[f * h] = x, a[f * h + 1] = k, a[f * h + 2] = E, a[f * h + 3] = 255;
|
|
8381
|
+
} else (o[f] & -256) == -256 ? l[f] == 0 ? (a[f * h] = 0, a[f * h + 1] = 0, a[f * h + 2] = 0, a[f * h + 3] = 0) : (l[f] & -256, a[f * h] = 0, a[f * h + 1] = 0, a[f * h + 2] = 0, a[f * h + 3] = 255) : (a[f * h] = 0, a[f * h + 1] = 0, a[f * h + 2] = 0, a[f * h + 3] = 255);
|
|
8368
8382
|
} else if (r == 1) {
|
|
8369
8383
|
if (this._sock.rQwait(
|
|
8370
8384
|
"VMware cursor alpha encoding",
|
|
@@ -8387,11 +8401,11 @@ class B extends Hs {
|
|
|
8387
8401
|
if (this._sock.rQwait("cursor encoding", h))
|
|
8388
8402
|
return !1;
|
|
8389
8403
|
const c = this._sock.rQshiftBytes(r), o = this._sock.rQshiftBytes(a);
|
|
8390
|
-
let l = new Uint8Array(s * n * 4),
|
|
8404
|
+
let l = new Uint8Array(s * n * 4), f = 0;
|
|
8391
8405
|
for (let d = 0; d < n; d++)
|
|
8392
8406
|
for (let x = 0; x < s; x++) {
|
|
8393
8407
|
let k = d * Math.ceil(s / 8) + Math.floor(x / 8), E = o[k] << x % 8 & 128 ? 255 : 0;
|
|
8394
|
-
l[
|
|
8408
|
+
l[f] = c[f + 2], l[f + 1] = c[f + 1], l[f + 2] = c[f], l[f + 3] = E, f += 4;
|
|
8395
8409
|
}
|
|
8396
8410
|
return this._updateCursor(l, t, e, s, n), !0;
|
|
8397
8411
|
}
|
|
@@ -8551,13 +8565,13 @@ B.messages = {
|
|
|
8551
8565
|
return e[0] = n >> 24, e[1] = 0, e[2] = 0, e[3] = s, e;
|
|
8552
8566
|
},
|
|
8553
8567
|
extendedClipboardProvide(i, t, e) {
|
|
8554
|
-
let s = new
|
|
8568
|
+
let s = new Hr(), n = [];
|
|
8555
8569
|
for (let h = 0; h < t.length; h++) {
|
|
8556
8570
|
if (t[h] != _e)
|
|
8557
8571
|
throw new Error("Unsupported extended clipboard format for Provide message.");
|
|
8558
8572
|
e[h] = e[h].replace(/\r\n|\r|\n/gm, `\r
|
|
8559
8573
|
`);
|
|
8560
|
-
let c =
|
|
8574
|
+
let c = fe(e[h] + "\0");
|
|
8561
8575
|
n.push(
|
|
8562
8576
|
c.length >> 24 & 255,
|
|
8563
8577
|
c.length >> 16 & 255,
|
|
@@ -8569,7 +8583,7 @@ B.messages = {
|
|
|
8569
8583
|
}
|
|
8570
8584
|
let r = s.deflate(new Uint8Array(n)), a = new Uint8Array(4 + r.length);
|
|
8571
8585
|
a.set(B.messages._buildExtendedClipboardFlags(
|
|
8572
|
-
[
|
|
8586
|
+
[mt],
|
|
8573
8587
|
t
|
|
8574
8588
|
)), a.set(r, 4), B.messages.clientCutText(i, a, !0);
|
|
8575
8589
|
},
|
|
@@ -8582,7 +8596,7 @@ B.messages = {
|
|
|
8582
8596
|
},
|
|
8583
8597
|
extendedClipboardRequest(i, t) {
|
|
8584
8598
|
let e = B.messages._buildExtendedClipboardFlags(
|
|
8585
|
-
[
|
|
8599
|
+
[wt],
|
|
8586
8600
|
t
|
|
8587
8601
|
);
|
|
8588
8602
|
B.messages.clientCutText(i, e, !0);
|
|
@@ -8598,7 +8612,7 @@ B.messages = {
|
|
|
8598
8612
|
clientCutText(i, t, e = !1) {
|
|
8599
8613
|
i.sQpush8(6), i.sQpush8(0), i.sQpush8(0), i.sQpush8(0);
|
|
8600
8614
|
let s;
|
|
8601
|
-
e ? s =
|
|
8615
|
+
e ? s = bn(-t.length) : s = t.length, i.sQpush32(s), i.sQpushBytes(t), i.flush();
|
|
8602
8616
|
},
|
|
8603
8617
|
setDesktopSize(i, t, e, s, n) {
|
|
8604
8618
|
i.sQpush8(251), i.sQpush8(0), i.sQpush16(t), i.sQpush16(e), i.sQpush8(1), i.sQpush8(0), i.sQpush32(s), i.sQpush16(0), i.sQpush16(0), i.sQpush16(t), i.sQpush16(e), i.sQpush32(n), i.flush();
|
|
@@ -8683,7 +8697,141 @@ B.cursors = {
|
|
|
8683
8697
|
hoty: 1
|
|
8684
8698
|
}
|
|
8685
8699
|
};
|
|
8686
|
-
|
|
8700
|
+
function Bs(i) {
|
|
8701
|
+
if (!i || typeof i != "object") return !1;
|
|
8702
|
+
const t = i;
|
|
8703
|
+
return t.status === 404 || t.statusCode === 404 || /\b404\b/.test(t.message ?? "");
|
|
8704
|
+
}
|
|
8705
|
+
function Ka(i) {
|
|
8706
|
+
return typeof ClipboardItem < "u" && navigator.clipboard?.write ? navigator.clipboard.write([new ClipboardItem({
|
|
8707
|
+
"text/plain": i.then((t) => new Blob([t], { type: "text/plain" }))
|
|
8708
|
+
})]) : i.then((t) => navigator.clipboard.writeText(t));
|
|
8709
|
+
}
|
|
8710
|
+
function Ma(i, t, e) {
|
|
8711
|
+
let s = null, n = !1, r = !1;
|
|
8712
|
+
const a = /* @__PURE__ */ new Set(), h = () => {
|
|
8713
|
+
i.viewOnly = !1, e.takeControl?.();
|
|
8714
|
+
}, c = (C, K = !1) => {
|
|
8715
|
+
h(), i.sendKey(65511, "MetaLeft", !1), i.sendKey(65512, "MetaRight", !1), i.sendKey(65515, "MetaLeft", !1), i.sendKey(65516, "MetaRight", !1), i.sendKey(65507, "ControlLeft", !0), K && i.sendKey(65505, "ShiftLeft", !0), i.sendKey(C.charCodeAt(0), `Key${C.toUpperCase()}`, !0), i.sendKey(C.charCodeAt(0), `Key${C.toUpperCase()}`, !1), K && i.sendKey(65505, "ShiftLeft", !1), i.sendKey(65507, "ControlLeft", !1);
|
|
8716
|
+
}, o = (C) => {
|
|
8717
|
+
const K = C.detail?.text;
|
|
8718
|
+
if (typeof K == "string") {
|
|
8719
|
+
s = K;
|
|
8720
|
+
for (const A of [...a]) A(K);
|
|
8721
|
+
}
|
|
8722
|
+
};
|
|
8723
|
+
i.addEventListener("clipboard", o);
|
|
8724
|
+
function l(C = !1, K = !1) {
|
|
8725
|
+
return new Promise((A, S) => {
|
|
8726
|
+
const F = (X) => {
|
|
8727
|
+
clearTimeout(R), a.delete(F), n ? S(new Error("Not connected")) : X || e.readRemoteText ? A(X ?? "") : S(new Error("Select text on the Computer first"));
|
|
8728
|
+
}, R = setTimeout(() => F(s), e.copyTimeoutMs ?? 1e3);
|
|
8729
|
+
a.add(F), c(C ? "x" : "c", K);
|
|
8730
|
+
});
|
|
8731
|
+
}
|
|
8732
|
+
async function f(C = !1, K = !1) {
|
|
8733
|
+
if (n) return;
|
|
8734
|
+
const A = l(C, K);
|
|
8735
|
+
A.catch(() => {
|
|
8736
|
+
});
|
|
8737
|
+
try {
|
|
8738
|
+
const S = e.readRemoteText ? A.then(async (F) => {
|
|
8739
|
+
try {
|
|
8740
|
+
const R = await e.readRemoteText();
|
|
8741
|
+
if (!R) throw new Error("Select text on the Computer first");
|
|
8742
|
+
return R;
|
|
8743
|
+
} catch (R) {
|
|
8744
|
+
if (Bs(R) && F) return F;
|
|
8745
|
+
throw R;
|
|
8746
|
+
}
|
|
8747
|
+
}) : A;
|
|
8748
|
+
S.catch(() => {
|
|
8749
|
+
}), await (e.writeText ?? Ka)(S), n || e.notice(C ? "Cut and copied" : "Copied");
|
|
8750
|
+
} catch (S) {
|
|
8751
|
+
n || e.notice(S instanceof Error && /Select text|Not connected/.test(S.message) ? S.message : "Copy was blocked by this device");
|
|
8752
|
+
}
|
|
8753
|
+
}
|
|
8754
|
+
async function d(C, K = !1) {
|
|
8755
|
+
if (n) return !1;
|
|
8756
|
+
if (!C)
|
|
8757
|
+
return e.notice("Your clipboard is empty"), !1;
|
|
8758
|
+
h();
|
|
8759
|
+
try {
|
|
8760
|
+
if (e.setRemoteText)
|
|
8761
|
+
try {
|
|
8762
|
+
await e.setRemoteText(C);
|
|
8763
|
+
} catch (A) {
|
|
8764
|
+
if (!Bs(A)) throw A;
|
|
8765
|
+
if ([...C].some((S) => S.codePointAt(0) > 255))
|
|
8766
|
+
return e.notice("Update this Computer to paste Unicode text"), !1;
|
|
8767
|
+
i.clipboardPasteFrom(C);
|
|
8768
|
+
}
|
|
8769
|
+
else i.clipboardPasteFrom(C);
|
|
8770
|
+
if (n) return !1;
|
|
8771
|
+
c("v", K);
|
|
8772
|
+
} catch {
|
|
8773
|
+
return n || e.notice("Could not update the Computer clipboard"), !1;
|
|
8774
|
+
}
|
|
8775
|
+
return e.notice("Pasted"), !0;
|
|
8776
|
+
}
|
|
8777
|
+
async function x() {
|
|
8778
|
+
if (!(n || r)) {
|
|
8779
|
+
r = !0;
|
|
8780
|
+
try {
|
|
8781
|
+
const C = await (e.readText ?? (() => navigator.clipboard.readText()))();
|
|
8782
|
+
n || await d(C);
|
|
8783
|
+
} catch {
|
|
8784
|
+
if (n) return;
|
|
8785
|
+
e.focusKeyboard(), e.notice("Use the keyboard's Paste menu");
|
|
8786
|
+
} finally {
|
|
8787
|
+
r = !1;
|
|
8788
|
+
}
|
|
8789
|
+
}
|
|
8790
|
+
}
|
|
8791
|
+
const k = (C) => {
|
|
8792
|
+
const K = C, A = K.clipboardData?.getData("text/plain") ?? "";
|
|
8793
|
+
A && (K.preventDefault(), K.stopImmediatePropagation(), d(A));
|
|
8794
|
+
}, E = (C) => {
|
|
8795
|
+
C.preventDefault(), C.stopImmediatePropagation(), f(C.type === "cut");
|
|
8796
|
+
}, M = (C) => {
|
|
8797
|
+
const K = C;
|
|
8798
|
+
if (!K.ctrlKey && !K.metaKey || K.altKey || K.isComposing) return;
|
|
8799
|
+
const A = K.key.toLowerCase();
|
|
8800
|
+
if (!(A !== "c" && A !== "x" && A !== "v")) {
|
|
8801
|
+
if (K.stopImmediatePropagation(), A === "v" && !e.readText) {
|
|
8802
|
+
e.focusKeyboard();
|
|
8803
|
+
return;
|
|
8804
|
+
}
|
|
8805
|
+
K.preventDefault(), A === "v" ? x() : f(A === "x", K.shiftKey);
|
|
8806
|
+
}
|
|
8807
|
+
};
|
|
8808
|
+
return t.addEventListener("paste", k, !0), t.addEventListener("copy", E, !0), t.addEventListener("cut", E, !0), t.addEventListener("keydown", M, !0), {
|
|
8809
|
+
copy: f,
|
|
8810
|
+
paste: d,
|
|
8811
|
+
pasteFromDevice: x,
|
|
8812
|
+
dispose() {
|
|
8813
|
+
n = !0, s = null;
|
|
8814
|
+
for (const C of [...a]) C(null);
|
|
8815
|
+
i.removeEventListener("clipboard", o), t.removeEventListener("paste", k, !0), t.removeEventListener("copy", E, !0), t.removeEventListener("cut", E, !0), t.removeEventListener("keydown", M, !0);
|
|
8816
|
+
}
|
|
8817
|
+
};
|
|
8818
|
+
}
|
|
8819
|
+
const pt = /* @__PURE__ */ new WeakSet();
|
|
8820
|
+
function Ta(i) {
|
|
8821
|
+
return {
|
|
8822
|
+
onPointerDown(t) {
|
|
8823
|
+
t.preventDefault(), !(t.pointerType === "touch" || t.pointerType === "pen") && (pt.add(t.currentTarget), i());
|
|
8824
|
+
},
|
|
8825
|
+
onPointerUp(t) {
|
|
8826
|
+
t.pointerType !== "touch" && t.pointerType !== "pen" || (t.preventDefault(), pt.add(t.currentTarget), i());
|
|
8827
|
+
},
|
|
8828
|
+
onClick(t) {
|
|
8829
|
+
const e = pt.has(t.currentTarget);
|
|
8830
|
+
pt.delete(t.currentTarget), !(e && t.detail !== 0) && i();
|
|
8831
|
+
}
|
|
8832
|
+
};
|
|
8833
|
+
}
|
|
8834
|
+
class Qa {
|
|
8687
8835
|
constructor(t) {
|
|
8688
8836
|
this.socket = t, t.binaryType = "arraybuffer", t.addEventListener("open", () => this.onopen?.()), t.addEventListener("message", (e) => this.onmessage?.(e)), t.addEventListener("close", (e) => this.onclose?.(e)), t.addEventListener("error", () => this.onerror?.());
|
|
8689
8837
|
}
|
|
@@ -8706,7 +8854,7 @@ class Sa {
|
|
|
8706
8854
|
this.socket.close(t, e);
|
|
8707
8855
|
}
|
|
8708
8856
|
}
|
|
8709
|
-
function
|
|
8857
|
+
function La(i, t, e, s, n = 0) {
|
|
8710
8858
|
(e === "mouseup" ? i.ownerDocument.defaultView : i).dispatchEvent(new MouseEvent(e, {
|
|
8711
8859
|
bubbles: !0,
|
|
8712
8860
|
cancelable: !0,
|
|
@@ -8718,6 +8866,10 @@ function Ea(i, t, e, s, n = 0) {
|
|
|
8718
8866
|
}
|
|
8719
8867
|
export {
|
|
8720
8868
|
B as R,
|
|
8721
|
-
|
|
8722
|
-
|
|
8869
|
+
Qa as a,
|
|
8870
|
+
Ma as b,
|
|
8871
|
+
Ta as c,
|
|
8872
|
+
La as d,
|
|
8873
|
+
Xa as r,
|
|
8874
|
+
Fa as s
|
|
8723
8875
|
};
|