@novnc/novnc 1.4.0 → 1.5.0-beta-gaead0b2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +0 -3
  2. package/lib/base64.js +5 -6
  3. package/lib/crypto/aes.js +481 -0
  4. package/lib/crypto/bigint.js +41 -0
  5. package/lib/crypto/crypto.js +109 -0
  6. package/lib/{des.js → crypto/des.js} +88 -15
  7. package/lib/crypto/dh.js +81 -0
  8. package/lib/crypto/md5.js +97 -0
  9. package/lib/crypto/rsa.js +312 -0
  10. package/lib/decoders/copyrect.js +9 -11
  11. package/lib/decoders/hextile.js +30 -34
  12. package/lib/decoders/jpeg.js +136 -110
  13. package/lib/decoders/raw.js +31 -39
  14. package/lib/decoders/rre.js +9 -11
  15. package/lib/decoders/tight.js +82 -21
  16. package/lib/decoders/tightpng.js +26 -22
  17. package/lib/decoders/zrle.js +18 -14
  18. package/lib/deflator.js +17 -14
  19. package/lib/display.js +31 -24
  20. package/lib/encodings.js +2 -2
  21. package/lib/inflator.js +17 -14
  22. package/lib/input/domkeytable.js +2 -3
  23. package/lib/input/fixedkeys.js +2 -3
  24. package/lib/input/gesturehandler.js +9 -11
  25. package/lib/input/keyboard.js +38 -26
  26. package/lib/input/keysym.js +2 -3
  27. package/lib/input/keysymdef.js +2 -3
  28. package/lib/input/util.js +5 -5
  29. package/lib/input/vkeys.js +2 -3
  30. package/lib/input/xtscancodes.js +2 -3
  31. package/lib/ra2.js +196 -666
  32. package/lib/rfb.js +340 -439
  33. package/lib/util/browser.js +8 -11
  34. package/lib/util/cursor.js +16 -12
  35. package/lib/util/eventtarget.js +9 -11
  36. package/lib/util/logging.js +4 -9
  37. package/lib/vendor/pako/lib/utils/common.js +3 -6
  38. package/lib/vendor/pako/lib/zlib/constants.js +2 -3
  39. package/lib/vendor/pako/lib/zlib/deflate.js +25 -59
  40. package/lib/vendor/pako/lib/zlib/inffast.js +0 -2
  41. package/lib/vendor/pako/lib/zlib/inflate.js +18 -42
  42. package/lib/vendor/pako/lib/zlib/inftrees.js +3 -5
  43. package/lib/vendor/pako/lib/zlib/messages.js +2 -3
  44. package/lib/vendor/pako/lib/zlib/trees.js +3 -10
  45. package/lib/websock.js +107 -96
  46. package/package.json +3 -10
  47. package/core/base64.js +0 -104
  48. package/core/decoders/copyrect.js +0 -27
  49. package/core/decoders/hextile.js +0 -191
  50. package/core/decoders/jpeg.js +0 -141
  51. package/core/decoders/raw.js +0 -66
  52. package/core/decoders/rre.js +0 -44
  53. package/core/decoders/tight.js +0 -331
  54. package/core/decoders/tightpng.js +0 -27
  55. package/core/decoders/zrle.js +0 -185
  56. package/core/deflator.js +0 -85
  57. package/core/des.js +0 -266
  58. package/core/display.js +0 -525
  59. package/core/encodings.js +0 -48
  60. package/core/inflator.js +0 -66
  61. package/core/input/domkeytable.js +0 -311
  62. package/core/input/fixedkeys.js +0 -129
  63. package/core/input/gesturehandler.js +0 -567
  64. package/core/input/keyboard.js +0 -283
  65. package/core/input/keysym.js +0 -616
  66. package/core/input/keysymdef.js +0 -688
  67. package/core/input/util.js +0 -191
  68. package/core/input/vkeys.js +0 -116
  69. package/core/input/xtscancodes.js +0 -173
  70. package/core/ra2.js +0 -567
  71. package/core/rfb.js +0 -3373
  72. package/core/util/browser.js +0 -152
  73. package/core/util/cursor.js +0 -247
  74. package/core/util/element.js +0 -32
  75. package/core/util/events.js +0 -138
  76. package/core/util/eventtarget.js +0 -35
  77. package/core/util/int.js +0 -15
  78. package/core/util/logging.js +0 -56
  79. package/core/util/md5.js +0 -79
  80. package/core/util/strings.js +0 -28
  81. package/core/websock.js +0 -353
  82. package/lib/util/md5.js +0 -77
  83. package/vendor/pako/LICENSE +0 -21
  84. package/vendor/pako/README.md +0 -6
  85. package/vendor/pako/lib/utils/common.js +0 -45
  86. package/vendor/pako/lib/zlib/adler32.js +0 -27
  87. package/vendor/pako/lib/zlib/constants.js +0 -47
  88. package/vendor/pako/lib/zlib/crc32.js +0 -36
  89. package/vendor/pako/lib/zlib/deflate.js +0 -1846
  90. package/vendor/pako/lib/zlib/gzheader.js +0 -35
  91. package/vendor/pako/lib/zlib/inffast.js +0 -324
  92. package/vendor/pako/lib/zlib/inflate.js +0 -1527
  93. package/vendor/pako/lib/zlib/inftrees.js +0 -322
  94. package/vendor/pako/lib/zlib/messages.js +0 -11
  95. package/vendor/pako/lib/zlib/trees.js +0 -1195
  96. package/vendor/pako/lib/zlib/zstream.js +0 -24
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _aes = require("./aes.js");
8
+ var _des = require("./des.js");
9
+ var _rsa = require("./rsa.js");
10
+ var _dh = require("./dh.js");
11
+ var _md = require("./md5.js");
12
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
13
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
15
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
18
+ // A single interface for the cryptographic algorithms not supported by SubtleCrypto.
19
+ // Both synchronous and asynchronous implmentations are allowed.
20
+ var LegacyCrypto = /*#__PURE__*/function () {
21
+ function LegacyCrypto() {
22
+ _classCallCheck(this, LegacyCrypto);
23
+ this._algorithms = {
24
+ "AES-ECB": _aes.AESECBCipher,
25
+ "AES-EAX": _aes.AESEAXCipher,
26
+ "DES-ECB": _des.DESECBCipher,
27
+ "DES-CBC": _des.DESCBCCipher,
28
+ "RSA-PKCS1-v1_5": _rsa.RSACipher,
29
+ "DH": _dh.DHCipher,
30
+ "MD5": _md.MD5
31
+ };
32
+ }
33
+ return _createClass(LegacyCrypto, [{
34
+ key: "encrypt",
35
+ value: function encrypt(algorithm, key, data) {
36
+ if (key.algorithm.name !== algorithm.name) {
37
+ throw new Error("algorithm does not match");
38
+ }
39
+ if (typeof key.encrypt !== "function") {
40
+ throw new Error("key does not support encryption");
41
+ }
42
+ return key.encrypt(algorithm, data);
43
+ }
44
+ }, {
45
+ key: "decrypt",
46
+ value: function decrypt(algorithm, key, data) {
47
+ if (key.algorithm.name !== algorithm.name) {
48
+ throw new Error("algorithm does not match");
49
+ }
50
+ if (typeof key.decrypt !== "function") {
51
+ throw new Error("key does not support encryption");
52
+ }
53
+ return key.decrypt(algorithm, data);
54
+ }
55
+ }, {
56
+ key: "importKey",
57
+ value: function importKey(format, keyData, algorithm, extractable, keyUsages) {
58
+ if (format !== "raw") {
59
+ throw new Error("key format is not supported");
60
+ }
61
+ var alg = this._algorithms[algorithm.name];
62
+ if (typeof alg === "undefined" || typeof alg.importKey !== "function") {
63
+ throw new Error("algorithm is not supported");
64
+ }
65
+ return alg.importKey(keyData, algorithm, extractable, keyUsages);
66
+ }
67
+ }, {
68
+ key: "generateKey",
69
+ value: function generateKey(algorithm, extractable, keyUsages) {
70
+ var alg = this._algorithms[algorithm.name];
71
+ if (typeof alg === "undefined" || typeof alg.generateKey !== "function") {
72
+ throw new Error("algorithm is not supported");
73
+ }
74
+ return alg.generateKey(algorithm, extractable, keyUsages);
75
+ }
76
+ }, {
77
+ key: "exportKey",
78
+ value: function exportKey(format, key) {
79
+ if (format !== "raw") {
80
+ throw new Error("key format is not supported");
81
+ }
82
+ if (typeof key.exportKey !== "function") {
83
+ throw new Error("key does not support exportKey");
84
+ }
85
+ return key.exportKey();
86
+ }
87
+ }, {
88
+ key: "digest",
89
+ value: function digest(algorithm, data) {
90
+ var alg = this._algorithms[algorithm];
91
+ if (typeof alg !== "function") {
92
+ throw new Error("algorithm is not supported");
93
+ }
94
+ return alg(data);
95
+ }
96
+ }, {
97
+ key: "deriveBits",
98
+ value: function deriveBits(algorithm, key, length) {
99
+ if (key.algorithm.name !== algorithm.name) {
100
+ throw new Error("algorithm does not match");
101
+ }
102
+ if (typeof key.deriveBits !== "function") {
103
+ throw new Error("key does not support deriveBits");
104
+ }
105
+ return key.deriveBits(algorithm, length);
106
+ }
107
+ }]);
108
+ }();
109
+ var _default = exports["default"] = new LegacyCrypto();
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = void 0;
7
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
10
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ exports.DESECBCipher = exports.DESCBCCipher = void 0;
7
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
8
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
9
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
10
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
12
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
13
  /*
14
14
  * Ported from Flashlight VNC ActionScript implementation:
15
15
  * http://www.wizhelp.com/flashlight-vnc/
@@ -204,7 +204,7 @@ var DES = /*#__PURE__*/function () {
204
204
  }
205
205
 
206
206
  // Encrypt 8 bytes of text
207
- _createClass(DES, [{
207
+ return _createClass(DES, [{
208
208
  key: "enc8",
209
209
  value: function enc8(text) {
210
210
  var b = text.slice();
@@ -285,17 +285,90 @@ var DES = /*#__PURE__*/function () {
285
285
  b[i] += 256;
286
286
  } // unsigned
287
287
  }
288
-
289
288
  return b;
290
289
  }
291
-
292
- // Encrypt 16 bytes of text using passwd as key
290
+ }]);
291
+ }();
292
+ var DESECBCipher = exports.DESECBCipher = /*#__PURE__*/function () {
293
+ function DESECBCipher() {
294
+ _classCallCheck(this, DESECBCipher);
295
+ this._cipher = null;
296
+ }
297
+ return _createClass(DESECBCipher, [{
298
+ key: "algorithm",
299
+ get: function get() {
300
+ return {
301
+ name: "DES-ECB"
302
+ };
303
+ }
304
+ }, {
305
+ key: "_importKey",
306
+ value: function _importKey(key, _extractable, _keyUsages) {
307
+ this._cipher = new DES(key);
308
+ }
293
309
  }, {
294
310
  key: "encrypt",
295
- value: function encrypt(t) {
296
- return this.enc8(t.slice(0, 8)).concat(this.enc8(t.slice(8, 16)));
311
+ value: function encrypt(_algorithm, plaintext) {
312
+ var x = new Uint8Array(plaintext);
313
+ if (x.length % 8 !== 0 || this._cipher === null) {
314
+ return null;
315
+ }
316
+ var n = x.length / 8;
317
+ for (var i = 0; i < n; i++) {
318
+ x.set(this._cipher.enc8(x.slice(i * 8, i * 8 + 8)), i * 8);
319
+ }
320
+ return x;
321
+ }
322
+ }], [{
323
+ key: "importKey",
324
+ value: function importKey(key, _algorithm, _extractable, _keyUsages) {
325
+ var cipher = new DESECBCipher();
326
+ cipher._importKey(key);
327
+ return cipher;
297
328
  }
298
329
  }]);
299
- return DES;
300
330
  }();
301
- exports["default"] = DES;
331
+ var DESCBCCipher = exports.DESCBCCipher = /*#__PURE__*/function () {
332
+ function DESCBCCipher() {
333
+ _classCallCheck(this, DESCBCCipher);
334
+ this._cipher = null;
335
+ }
336
+ return _createClass(DESCBCCipher, [{
337
+ key: "algorithm",
338
+ get: function get() {
339
+ return {
340
+ name: "DES-CBC"
341
+ };
342
+ }
343
+ }, {
344
+ key: "_importKey",
345
+ value: function _importKey(key) {
346
+ this._cipher = new DES(key);
347
+ }
348
+ }, {
349
+ key: "encrypt",
350
+ value: function encrypt(algorithm, plaintext) {
351
+ var x = new Uint8Array(plaintext);
352
+ var y = new Uint8Array(algorithm.iv);
353
+ if (x.length % 8 !== 0 || this._cipher === null) {
354
+ return null;
355
+ }
356
+ var n = x.length / 8;
357
+ for (var i = 0; i < n; i++) {
358
+ for (var j = 0; j < 8; j++) {
359
+ y[j] ^= plaintext[i * 8 + j];
360
+ }
361
+ y = this._cipher.enc8(y);
362
+ x.set(y, i * 8);
363
+ }
364
+ return x;
365
+ }
366
+ }], [{
367
+ key: "importKey",
368
+ value: function importKey(key, _algorithm, _extractable, _keyUsages) {
369
+ var cipher = new DESCBCCipher();
370
+ cipher._importKey(key);
371
+ return cipher;
372
+ }
373
+ }]);
374
+ }();
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DHCipher = void 0;
7
+ var _bigint = require("./bigint.js");
8
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
9
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
10
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
11
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
13
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
+ var DHPublicKey = /*#__PURE__*/function () {
15
+ function DHPublicKey(key) {
16
+ _classCallCheck(this, DHPublicKey);
17
+ this._key = key;
18
+ }
19
+ return _createClass(DHPublicKey, [{
20
+ key: "algorithm",
21
+ get: function get() {
22
+ return {
23
+ name: "DH"
24
+ };
25
+ }
26
+ }, {
27
+ key: "exportKey",
28
+ value: function exportKey() {
29
+ return this._key;
30
+ }
31
+ }]);
32
+ }();
33
+ var DHCipher = exports.DHCipher = /*#__PURE__*/function () {
34
+ function DHCipher() {
35
+ _classCallCheck(this, DHCipher);
36
+ this._g = null;
37
+ this._p = null;
38
+ this._gBigInt = null;
39
+ this._pBigInt = null;
40
+ this._privateKey = null;
41
+ }
42
+ return _createClass(DHCipher, [{
43
+ key: "algorithm",
44
+ get: function get() {
45
+ return {
46
+ name: "DH"
47
+ };
48
+ }
49
+ }, {
50
+ key: "_generateKey",
51
+ value: function _generateKey(algorithm) {
52
+ var g = algorithm.g;
53
+ var p = algorithm.p;
54
+ this._keyBytes = p.length;
55
+ this._gBigInt = (0, _bigint.u8ArrayToBigInt)(g);
56
+ this._pBigInt = (0, _bigint.u8ArrayToBigInt)(p);
57
+ this._privateKey = window.crypto.getRandomValues(new Uint8Array(this._keyBytes));
58
+ this._privateKeyBigInt = (0, _bigint.u8ArrayToBigInt)(this._privateKey);
59
+ this._publicKey = (0, _bigint.bigIntToU8Array)((0, _bigint.modPow)(this._gBigInt, this._privateKeyBigInt, this._pBigInt), this._keyBytes);
60
+ }
61
+ }, {
62
+ key: "deriveBits",
63
+ value: function deriveBits(algorithm, length) {
64
+ var bytes = Math.ceil(length / 8);
65
+ var pkey = new Uint8Array(algorithm["public"]);
66
+ var len = bytes > this._keyBytes ? bytes : this._keyBytes;
67
+ var secret = (0, _bigint.modPow)((0, _bigint.u8ArrayToBigInt)(pkey), this._privateKeyBigInt, this._pBigInt);
68
+ return (0, _bigint.bigIntToU8Array)(secret, len).slice(0, len);
69
+ }
70
+ }], [{
71
+ key: "generateKey",
72
+ value: function generateKey(algorithm, _extractable) {
73
+ var cipher = new DHCipher();
74
+ cipher._generateKey(algorithm);
75
+ return {
76
+ privateKey: cipher,
77
+ publicKey: new DHPublicKey(cipher._publicKey)
78
+ };
79
+ }
80
+ }]);
81
+ }();
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MD5 = MD5;
7
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
8
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
9
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
10
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
11
+ /*
12
+ * noVNC: HTML5 VNC client
13
+ * Copyright (C) 2021 The noVNC Authors
14
+ * Licensed under MPL 2.0 (see LICENSE.txt)
15
+ *
16
+ * See README.md for usage and integration instructions.
17
+ */
18
+ /*
19
+ * Performs MD5 hashing on an array of bytes, returns an array of bytes
20
+ */
21
+ function MD5(_x) {
22
+ return _MD.apply(this, arguments);
23
+ }
24
+ function _MD() {
25
+ _MD = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(d) {
26
+ var s, i;
27
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
28
+ while (1) switch (_context.prev = _context.next) {
29
+ case 0:
30
+ s = "";
31
+ for (i = 0; i < d.length; i++) {
32
+ s += String.fromCharCode(d[i]);
33
+ }
34
+ return _context.abrupt("return", M(V(Y(X(s), 8 * s.length))));
35
+ case 3:
36
+ case "end":
37
+ return _context.stop();
38
+ }
39
+ }, _callee);
40
+ }));
41
+ return _MD.apply(this, arguments);
42
+ }
43
+ function M(d) {
44
+ var f = new Uint8Array(d.length);
45
+ for (var i = 0; i < d.length; i++) {
46
+ f[i] = d.charCodeAt(i);
47
+ }
48
+ return f;
49
+ }
50
+ function X(d) {
51
+ var r = Array(d.length >> 2);
52
+ for (var m = 0; m < r.length; m++) r[m] = 0;
53
+ for (var _m = 0; _m < 8 * d.length; _m += 8) r[_m >> 5] |= (255 & d.charCodeAt(_m / 8)) << _m % 32;
54
+ return r;
55
+ }
56
+ function V(d) {
57
+ var r = "";
58
+ for (var m = 0; m < 32 * d.length; m += 8) r += String.fromCharCode(d[m >> 5] >>> m % 32 & 255);
59
+ return r;
60
+ }
61
+ function Y(d, g) {
62
+ d[g >> 5] |= 128 << g % 32, d[14 + (g + 64 >>> 9 << 4)] = g;
63
+ var m = 1732584193,
64
+ f = -271733879,
65
+ r = -1732584194,
66
+ i = 271733878;
67
+ for (var n = 0; n < d.length; n += 16) {
68
+ var h = m,
69
+ t = f,
70
+ _g = r,
71
+ e = i;
72
+ f = ii(f = ii(f = ii(f = ii(f = hh(f = hh(f = hh(f = hh(f = gg(f = gg(f = gg(f = gg(f = ff(f = ff(f = ff(f = ff(f, r = ff(r, i = ff(i, m = ff(m, f, r, i, d[n + 0], 7, -680876936), f, r, d[n + 1], 12, -389564586), m, f, d[n + 2], 17, 606105819), i, m, d[n + 3], 22, -1044525330), r = ff(r, i = ff(i, m = ff(m, f, r, i, d[n + 4], 7, -176418897), f, r, d[n + 5], 12, 1200080426), m, f, d[n + 6], 17, -1473231341), i, m, d[n + 7], 22, -45705983), r = ff(r, i = ff(i, m = ff(m, f, r, i, d[n + 8], 7, 1770035416), f, r, d[n + 9], 12, -1958414417), m, f, d[n + 10], 17, -42063), i, m, d[n + 11], 22, -1990404162), r = ff(r, i = ff(i, m = ff(m, f, r, i, d[n + 12], 7, 1804603682), f, r, d[n + 13], 12, -40341101), m, f, d[n + 14], 17, -1502002290), i, m, d[n + 15], 22, 1236535329), r = gg(r, i = gg(i, m = gg(m, f, r, i, d[n + 1], 5, -165796510), f, r, d[n + 6], 9, -1069501632), m, f, d[n + 11], 14, 643717713), i, m, d[n + 0], 20, -373897302), r = gg(r, i = gg(i, m = gg(m, f, r, i, d[n + 5], 5, -701558691), f, r, d[n + 10], 9, 38016083), m, f, d[n + 15], 14, -660478335), i, m, d[n + 4], 20, -405537848), r = gg(r, i = gg(i, m = gg(m, f, r, i, d[n + 9], 5, 568446438), f, r, d[n + 14], 9, -1019803690), m, f, d[n + 3], 14, -187363961), i, m, d[n + 8], 20, 1163531501), r = gg(r, i = gg(i, m = gg(m, f, r, i, d[n + 13], 5, -1444681467), f, r, d[n + 2], 9, -51403784), m, f, d[n + 7], 14, 1735328473), i, m, d[n + 12], 20, -1926607734), r = hh(r, i = hh(i, m = hh(m, f, r, i, d[n + 5], 4, -378558), f, r, d[n + 8], 11, -2022574463), m, f, d[n + 11], 16, 1839030562), i, m, d[n + 14], 23, -35309556), r = hh(r, i = hh(i, m = hh(m, f, r, i, d[n + 1], 4, -1530992060), f, r, d[n + 4], 11, 1272893353), m, f, d[n + 7], 16, -155497632), i, m, d[n + 10], 23, -1094730640), r = hh(r, i = hh(i, m = hh(m, f, r, i, d[n + 13], 4, 681279174), f, r, d[n + 0], 11, -358537222), m, f, d[n + 3], 16, -722521979), i, m, d[n + 6], 23, 76029189), r = hh(r, i = hh(i, m = hh(m, f, r, i, d[n + 9], 4, -640364487), f, r, d[n + 12], 11, -421815835), m, f, d[n + 15], 16, 530742520), i, m, d[n + 2], 23, -995338651), r = ii(r, i = ii(i, m = ii(m, f, r, i, d[n + 0], 6, -198630844), f, r, d[n + 7], 10, 1126891415), m, f, d[n + 14], 15, -1416354905), i, m, d[n + 5], 21, -57434055), r = ii(r, i = ii(i, m = ii(m, f, r, i, d[n + 12], 6, 1700485571), f, r, d[n + 3], 10, -1894986606), m, f, d[n + 10], 15, -1051523), i, m, d[n + 1], 21, -2054922799), r = ii(r, i = ii(i, m = ii(m, f, r, i, d[n + 8], 6, 1873313359), f, r, d[n + 15], 10, -30611744), m, f, d[n + 6], 15, -1560198380), i, m, d[n + 13], 21, 1309151649), r = ii(r, i = ii(i, m = ii(m, f, r, i, d[n + 4], 6, -145523070), f, r, d[n + 11], 10, -1120210379), m, f, d[n + 2], 15, 718787259), i, m, d[n + 9], 21, -343485551), m = add(m, h), f = add(f, t), r = add(r, _g), i = add(i, e);
73
+ }
74
+ return Array(m, f, r, i);
75
+ }
76
+ function cmn(d, g, m, f, r, i) {
77
+ return add(rol(add(add(g, d), add(f, i)), r), m);
78
+ }
79
+ function ff(d, g, m, f, r, i, n) {
80
+ return cmn(g & m | ~g & f, d, g, r, i, n);
81
+ }
82
+ function gg(d, g, m, f, r, i, n) {
83
+ return cmn(g & f | m & ~f, d, g, r, i, n);
84
+ }
85
+ function hh(d, g, m, f, r, i, n) {
86
+ return cmn(g ^ m ^ f, d, g, r, i, n);
87
+ }
88
+ function ii(d, g, m, f, r, i, n) {
89
+ return cmn(m ^ (g | ~f), d, g, r, i, n);
90
+ }
91
+ function add(d, g) {
92
+ var m = (65535 & d) + (65535 & g);
93
+ return (d >> 16) + (g >> 16) + (m >> 16) << 16 | 65535 & m;
94
+ }
95
+ function rol(d, g) {
96
+ return d << g | d >>> 32 - g;
97
+ }