@novnc/novnc 1.2.0-test → 1.3.0-g7ad4e60
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/LICENSE.txt +0 -6
- package/README.md +4 -4
- package/core/decoders/copyrect.js +5 -0
- package/core/decoders/hextile.js +57 -3
- package/core/decoders/raw.js +12 -2
- package/core/decoders/tight.js +24 -8
- package/core/display.js +9 -151
- package/core/input/domkeytable.js +25 -21
- package/core/input/keyboard.js +12 -127
- package/core/input/util.js +18 -35
- package/core/input/vkeys.js +0 -1
- package/core/input/xtscancodes.js +5 -3
- package/core/rfb.js +116 -109
- package/core/util/browser.js +0 -17
- package/core/util/cursor.js +1 -11
- package/core/util/events.js +0 -4
- package/core/websock.js +76 -17
- package/docs/API.md +10 -3
- package/docs/LIBRARY.md +3 -7
- package/lib/base64.js +4 -4
- package/lib/decoders/copyrect.js +7 -2
- package/lib/decoders/hextile.js +63 -7
- package/lib/decoders/raw.js +13 -4
- package/lib/decoders/rre.js +2 -2
- package/lib/decoders/tight.js +38 -20
- package/lib/decoders/tightpng.js +8 -8
- package/lib/deflator.js +4 -4
- package/lib/des.js +2 -2
- package/lib/display.js +45 -212
- package/lib/inflator.js +4 -4
- package/lib/input/domkeytable.js +197 -194
- package/lib/input/fixedkeys.js +2 -2
- package/lib/input/gesturehandler.js +2 -2
- package/lib/input/keyboard.js +38 -158
- package/lib/input/keysym.js +2 -2
- package/lib/input/keysymdef.js +2 -2
- package/lib/input/util.js +34 -79
- package/lib/input/vkeys.js +2 -4
- package/lib/input/xtscancodes.js +11 -5
- package/lib/rfb.js +292 -286
- package/lib/util/browser.js +8 -26
- package/lib/util/cursor.js +4 -16
- package/lib/util/events.js +3 -5
- package/lib/util/eventtarget.js +3 -3
- package/lib/util/int.js +1 -1
- package/lib/util/logging.js +2 -2
- package/lib/vendor/pako/lib/utils/common.js +2 -2
- package/lib/vendor/pako/lib/zlib/adler32.js +1 -1
- package/lib/vendor/pako/lib/zlib/constants.js +2 -2
- package/lib/vendor/pako/lib/zlib/crc32.js +1 -1
- package/lib/vendor/pako/lib/zlib/deflate.js +113 -112
- package/lib/vendor/pako/lib/zlib/gzheader.js +1 -1
- package/lib/vendor/pako/lib/zlib/inffast.js +5 -5
- package/lib/vendor/pako/lib/zlib/inflate.js +50 -48
- package/lib/vendor/pako/lib/zlib/inftrees.js +3 -3
- package/lib/vendor/pako/lib/zlib/messages.js +2 -2
- package/lib/vendor/pako/lib/zlib/trees.js +4 -4
- package/lib/vendor/pako/lib/zlib/zstream.js +1 -1
- package/lib/websock.js +105 -44
- package/package.json +2 -7
- package/core/util/polyfill.js +0 -61
- package/lib/util/polyfill.js +0 -72
- package/lib/vendor/promise.js +0 -255
package/lib/util/browser.js
CHANGED
|
@@ -5,20 +5,20 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
8
|
+
exports.hasScrollbarGutter = exports.dragThreshold = void 0;
|
|
9
|
+
exports.isFirefox = isFirefox;
|
|
10
10
|
exports.isIOS = isIOS;
|
|
11
|
+
exports.isMac = isMac;
|
|
11
12
|
exports.isSafari = isSafari;
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.hasScrollbarGutter = exports.supportsImageMetadata = exports.supportsCursorURIs = exports.dragThreshold = exports.isTouchDevice = void 0;
|
|
13
|
+
exports.isTouchDevice = void 0;
|
|
14
|
+
exports.isWindows = isWindows;
|
|
15
|
+
exports.supportsCursorURIs = void 0;
|
|
16
16
|
|
|
17
17
|
var Log = _interopRequireWildcard(require("./logging.js"));
|
|
18
18
|
|
|
19
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
19
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
20
|
|
|
21
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj
|
|
21
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
22
|
|
|
23
23
|
/*
|
|
24
24
|
* noVNC: HTML5 VNC client
|
|
@@ -60,16 +60,6 @@ try {
|
|
|
60
60
|
|
|
61
61
|
var supportsCursorURIs = _supportsCursorURIs;
|
|
62
62
|
exports.supportsCursorURIs = supportsCursorURIs;
|
|
63
|
-
var _supportsImageMetadata = false;
|
|
64
|
-
|
|
65
|
-
try {
|
|
66
|
-
new ImageData(new Uint8ClampedArray(4), 1, 1);
|
|
67
|
-
_supportsImageMetadata = true;
|
|
68
|
-
} catch (ex) {// ignore failure
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
var supportsImageMetadata = _supportsImageMetadata;
|
|
72
|
-
exports.supportsImageMetadata = supportsImageMetadata;
|
|
73
63
|
var _hasScrollbarGutter = true;
|
|
74
64
|
|
|
75
65
|
try {
|
|
@@ -118,14 +108,6 @@ function isSafari() {
|
|
|
118
108
|
return navigator && navigator.userAgent.indexOf('Safari') !== -1 && navigator.userAgent.indexOf('Chrome') === -1;
|
|
119
109
|
}
|
|
120
110
|
|
|
121
|
-
function isIE() {
|
|
122
|
-
return navigator && !!/trident/i.exec(navigator.userAgent);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function isEdge() {
|
|
126
|
-
return navigator && !!/edge/i.exec(navigator.userAgent);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
111
|
function isFirefox() {
|
|
130
112
|
return navigator && !!/firefox/i.exec(navigator.userAgent);
|
|
131
113
|
}
|
package/lib/util/cursor.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports["default"] = void 0;
|
|
7
7
|
|
|
8
8
|
var _browser = require("./browser.js");
|
|
9
9
|
|
|
@@ -56,10 +56,7 @@ var Cursor = /*#__PURE__*/function () {
|
|
|
56
56
|
this._target = target;
|
|
57
57
|
|
|
58
58
|
if (useFallback) {
|
|
59
|
-
document.body.appendChild(this._canvas);
|
|
60
|
-
/// movement in IE. We want to also capture element
|
|
61
|
-
// movement, size changes, visibility, etc.
|
|
62
|
-
|
|
59
|
+
document.body.appendChild(this._canvas);
|
|
63
60
|
var options = {
|
|
64
61
|
capture: true,
|
|
65
62
|
passive: true
|
|
@@ -119,16 +116,7 @@ var Cursor = /*#__PURE__*/function () {
|
|
|
119
116
|
|
|
120
117
|
this._canvas.width = w;
|
|
121
118
|
this._canvas.height = h;
|
|
122
|
-
var img;
|
|
123
|
-
|
|
124
|
-
try {
|
|
125
|
-
// IE doesn't support this
|
|
126
|
-
img = new ImageData(new Uint8ClampedArray(rgba), w, h);
|
|
127
|
-
} catch (ex) {
|
|
128
|
-
img = ctx.createImageData(w, h);
|
|
129
|
-
img.data.set(new Uint8ClampedArray(rgba));
|
|
130
|
-
}
|
|
131
|
-
|
|
119
|
+
var img = new ImageData(new Uint8ClampedArray(rgba), w, h);
|
|
132
120
|
ctx.clearRect(0, 0, w, h);
|
|
133
121
|
ctx.putImageData(img, 0, 0);
|
|
134
122
|
|
|
@@ -311,4 +299,4 @@ var Cursor = /*#__PURE__*/function () {
|
|
|
311
299
|
return Cursor;
|
|
312
300
|
}();
|
|
313
301
|
|
|
314
|
-
exports
|
|
302
|
+
exports["default"] = Cursor;
|
package/lib/util/events.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getPointerEvent = getPointerEvent;
|
|
7
|
-
exports.stopEvent = stopEvent;
|
|
8
|
-
exports.setCapture = setCapture;
|
|
9
7
|
exports.releaseCapture = releaseCapture;
|
|
8
|
+
exports.setCapture = setCapture;
|
|
9
|
+
exports.stopEvent = stopEvent;
|
|
10
10
|
|
|
11
11
|
/*
|
|
12
12
|
* noVNC: HTML5 VNC client
|
|
@@ -71,9 +71,7 @@ var _captureObserver = new MutationObserver(_capturedElemChanged);
|
|
|
71
71
|
function setCapture(target) {
|
|
72
72
|
if (target.setCapture) {
|
|
73
73
|
target.setCapture();
|
|
74
|
-
document.captureElement = target;
|
|
75
|
-
|
|
76
|
-
target.addEventListener('mouseup', releaseCapture);
|
|
74
|
+
document.captureElement = target;
|
|
77
75
|
} else {
|
|
78
76
|
// Release any existing capture in case this method is
|
|
79
77
|
// called multiple times without coordination
|
package/lib/util/eventtarget.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports["default"] = void 0;
|
|
7
7
|
|
|
8
8
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
9
|
|
|
@@ -38,7 +38,7 @@ var EventTargetMixin = /*#__PURE__*/function () {
|
|
|
38
38
|
key: "removeEventListener",
|
|
39
39
|
value: function removeEventListener(type, callback) {
|
|
40
40
|
if (this._listeners.has(type)) {
|
|
41
|
-
this._listeners.get(type)
|
|
41
|
+
this._listeners.get(type)["delete"](callback);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}, {
|
|
@@ -61,4 +61,4 @@ var EventTargetMixin = /*#__PURE__*/function () {
|
|
|
61
61
|
return EventTargetMixin;
|
|
62
62
|
}();
|
|
63
63
|
|
|
64
|
-
exports
|
|
64
|
+
exports["default"] = EventTargetMixin;
|
package/lib/util/int.js
CHANGED
package/lib/util/logging.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.Warn = exports.Info = exports.Error = exports.Debug = void 0;
|
|
7
7
|
exports.getLogging = getLogging;
|
|
8
|
-
exports.
|
|
8
|
+
exports.initLogging = initLogging;
|
|
9
9
|
|
|
10
10
|
/*
|
|
11
11
|
* noVNC: HTML5 VNC client
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.Buf8 = exports.Buf32 = exports.Buf16 = void 0;
|
|
7
7
|
exports.arraySet = arraySet;
|
|
8
8
|
exports.flattenChunks = flattenChunks;
|
|
9
|
-
exports.
|
|
9
|
+
exports.shrinkBuf = shrinkBuf;
|
|
10
10
|
|
|
11
11
|
// reduce buffer size, avoiding mem copy
|
|
12
12
|
function shrinkBuf(buf, size) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports["default"] = void 0;
|
|
7
7
|
var _default = {
|
|
8
8
|
/* Allowed flush values; see deflate() and inflate() below for details */
|
|
9
9
|
Z_NO_FLUSH: 0,
|
|
@@ -48,4 +48,4 @@ var _default = {
|
|
|
48
48
|
Z_DEFLATED: 8 //Z_NULL: null // Use -1 or null inline, depending on var type
|
|
49
49
|
|
|
50
50
|
};
|
|
51
|
-
exports
|
|
51
|
+
exports["default"] = _default;
|
|
@@ -5,15 +5,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
exports.Z_UNKNOWN = exports.Z_STREAM_ERROR = exports.Z_STREAM_END = exports.Z_RLE = exports.Z_PARTIAL_FLUSH = exports.Z_OK = exports.Z_NO_FLUSH = exports.Z_HUFFMAN_ONLY = exports.Z_FULL_FLUSH = exports.Z_FIXED = exports.Z_FINISH = exports.Z_FILTERED = exports.Z_DEFLATED = exports.Z_DEFAULT_STRATEGY = exports.Z_DEFAULT_COMPRESSION = exports.Z_DATA_ERROR = exports.Z_BUF_ERROR = exports.Z_BLOCK = void 0;
|
|
9
|
+
exports.deflate = deflate;
|
|
10
|
+
exports.deflateEnd = deflateEnd;
|
|
11
|
+
exports.deflateInfo = void 0;
|
|
8
12
|
exports.deflateInit = deflateInit;
|
|
9
13
|
exports.deflateInit2 = deflateInit2;
|
|
10
14
|
exports.deflateReset = deflateReset;
|
|
11
15
|
exports.deflateResetKeep = deflateResetKeep;
|
|
12
|
-
exports.deflateSetHeader = deflateSetHeader;
|
|
13
|
-
exports.deflate = deflate;
|
|
14
|
-
exports.deflateEnd = deflateEnd;
|
|
15
16
|
exports.deflateSetDictionary = deflateSetDictionary;
|
|
16
|
-
exports.
|
|
17
|
+
exports.deflateSetHeader = deflateSetHeader;
|
|
17
18
|
|
|
18
19
|
var utils = _interopRequireWildcard(require("../utils/common.js"));
|
|
19
20
|
|
|
@@ -25,11 +26,11 @@ var _crc = _interopRequireDefault(require("./crc32.js"));
|
|
|
25
26
|
|
|
26
27
|
var _messages = _interopRequireDefault(require("./messages.js"));
|
|
27
28
|
|
|
28
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
30
|
|
|
30
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
31
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
32
|
|
|
32
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj
|
|
33
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
34
|
|
|
34
35
|
/* Public constants ==========================================================*/
|
|
35
36
|
|
|
@@ -150,7 +151,7 @@ var BS_FINISH_DONE = 4;
|
|
|
150
151
|
var OS_CODE = 0x03; // Unix :) . Don't detect, use this default.
|
|
151
152
|
|
|
152
153
|
function err(strm, errorCode) {
|
|
153
|
-
strm.msg = _messages
|
|
154
|
+
strm.msg = _messages["default"][errorCode];
|
|
154
155
|
return errorCode;
|
|
155
156
|
}
|
|
156
157
|
|
|
@@ -246,9 +247,9 @@ function read_buf(strm, buf, start, size) {
|
|
|
246
247
|
utils.arraySet(buf, strm.input, strm.next_in, len, start);
|
|
247
248
|
|
|
248
249
|
if (strm.state.wrap === 1) {
|
|
249
|
-
strm.adler = (0, _adler
|
|
250
|
+
strm.adler = (0, _adler["default"])(strm.adler, buf, len, start);
|
|
250
251
|
} else if (strm.state.wrap === 2) {
|
|
251
|
-
strm.adler = (0, _crc
|
|
252
|
+
strm.adler = (0, _crc["default"])(strm.adler, buf, len, start);
|
|
252
253
|
}
|
|
253
254
|
|
|
254
255
|
strm.next_in += len;
|
|
@@ -872,22 +873,22 @@ function deflate_slow(s, flush) {
|
|
|
872
873
|
&& s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD
|
|
873
874
|
/*MAX_DIST(s)*/
|
|
874
875
|
) {
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
876
|
+
/* To simplify the code, we prevent matches with the string
|
|
877
|
+
* of window index 0 (in particular we have to avoid a match
|
|
878
|
+
* of the string with itself at the start of the input file).
|
|
879
|
+
*/
|
|
880
|
+
s.match_length = longest_match(s, hash_head);
|
|
881
|
+
/* longest_match() sets match_start */
|
|
882
|
+
|
|
883
|
+
if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096
|
|
884
|
+
/*TOO_FAR*/
|
|
885
|
+
)) {
|
|
886
|
+
/* If prev_match is also MIN_MATCH, match_start is garbage
|
|
887
|
+
* but we will ignore the current match anyway.
|
|
878
888
|
*/
|
|
879
|
-
s.match_length =
|
|
880
|
-
/* longest_match() sets match_start */
|
|
881
|
-
|
|
882
|
-
if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096
|
|
883
|
-
/*TOO_FAR*/
|
|
884
|
-
)) {
|
|
885
|
-
/* If prev_match is also MIN_MATCH, match_start is garbage
|
|
886
|
-
* but we will ignore the current match anyway.
|
|
887
|
-
*/
|
|
888
|
-
s.match_length = MIN_MATCH - 1;
|
|
889
|
-
}
|
|
889
|
+
s.match_length = MIN_MATCH - 1;
|
|
890
890
|
}
|
|
891
|
+
}
|
|
891
892
|
/* If there was a match at the previous step and the current
|
|
892
893
|
* match is not better, output the previous match:
|
|
893
894
|
*/
|
|
@@ -1700,7 +1701,7 @@ function deflate(strm, flush) {
|
|
|
1700
1701
|
}
|
|
1701
1702
|
|
|
1702
1703
|
if (s.gzhead.hcrc) {
|
|
1703
|
-
strm.adler = (0, _crc
|
|
1704
|
+
strm.adler = (0, _crc["default"])(strm.adler, s.pending_buf, s.pending, 0);
|
|
1704
1705
|
}
|
|
1705
1706
|
|
|
1706
1707
|
s.gzindex = 0;
|
|
@@ -1746,36 +1747,36 @@ function deflate(strm, flush) {
|
|
|
1746
1747
|
if (s.gzhead.extra
|
|
1747
1748
|
/* != Z_NULL*/
|
|
1748
1749
|
) {
|
|
1749
|
-
|
|
1750
|
-
|
|
1750
|
+
beg = s.pending;
|
|
1751
|
+
/* start of bytes to update crc */
|
|
1751
1752
|
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1753
|
+
while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {
|
|
1754
|
+
if (s.pending === s.pending_buf_size) {
|
|
1755
|
+
if (s.gzhead.hcrc && s.pending > beg) {
|
|
1756
|
+
strm.adler = (0, _crc["default"])(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
1757
|
+
}
|
|
1757
1758
|
|
|
1758
|
-
|
|
1759
|
-
|
|
1759
|
+
flush_pending(strm);
|
|
1760
|
+
beg = s.pending;
|
|
1760
1761
|
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
}
|
|
1762
|
+
if (s.pending === s.pending_buf_size) {
|
|
1763
|
+
break;
|
|
1764
1764
|
}
|
|
1765
|
-
|
|
1766
|
-
put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);
|
|
1767
|
-
s.gzindex++;
|
|
1768
1765
|
}
|
|
1769
1766
|
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1767
|
+
put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);
|
|
1768
|
+
s.gzindex++;
|
|
1769
|
+
}
|
|
1773
1770
|
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1771
|
+
if (s.gzhead.hcrc && s.pending > beg) {
|
|
1772
|
+
strm.adler = (0, _crc["default"])(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
if (s.gzindex === s.gzhead.extra.length) {
|
|
1776
|
+
s.gzindex = 0;
|
|
1777
|
+
s.status = NAME_STATE;
|
|
1778
|
+
}
|
|
1779
|
+
} else {
|
|
1779
1780
|
s.status = NAME_STATE;
|
|
1780
1781
|
}
|
|
1781
1782
|
}
|
|
@@ -1784,44 +1785,44 @@ function deflate(strm, flush) {
|
|
|
1784
1785
|
if (s.gzhead.name
|
|
1785
1786
|
/* != Z_NULL*/
|
|
1786
1787
|
) {
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
do {
|
|
1792
|
-
if (s.pending === s.pending_buf_size) {
|
|
1793
|
-
if (s.gzhead.hcrc && s.pending > beg) {
|
|
1794
|
-
strm.adler = (0, _crc.default)(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
flush_pending(strm);
|
|
1798
|
-
beg = s.pending;
|
|
1788
|
+
beg = s.pending;
|
|
1789
|
+
/* start of bytes to update crc */
|
|
1790
|
+
//int val;
|
|
1799
1791
|
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
}
|
|
1792
|
+
do {
|
|
1793
|
+
if (s.pending === s.pending_buf_size) {
|
|
1794
|
+
if (s.gzhead.hcrc && s.pending > beg) {
|
|
1795
|
+
strm.adler = (0, _crc["default"])(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
1796
|
+
}
|
|
1805
1797
|
|
|
1798
|
+
flush_pending(strm);
|
|
1799
|
+
beg = s.pending;
|
|
1806
1800
|
|
|
1807
|
-
if (s.
|
|
1808
|
-
val =
|
|
1809
|
-
|
|
1810
|
-
val = 0;
|
|
1801
|
+
if (s.pending === s.pending_buf_size) {
|
|
1802
|
+
val = 1;
|
|
1803
|
+
break;
|
|
1811
1804
|
}
|
|
1805
|
+
} // JS specific: little magic to add zero terminator to end of string
|
|
1812
1806
|
|
|
1813
|
-
put_byte(s, val);
|
|
1814
|
-
} while (val !== 0);
|
|
1815
1807
|
|
|
1816
|
-
if (s.
|
|
1817
|
-
|
|
1808
|
+
if (s.gzindex < s.gzhead.name.length) {
|
|
1809
|
+
val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;
|
|
1810
|
+
} else {
|
|
1811
|
+
val = 0;
|
|
1818
1812
|
}
|
|
1819
1813
|
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1814
|
+
put_byte(s, val);
|
|
1815
|
+
} while (val !== 0);
|
|
1816
|
+
|
|
1817
|
+
if (s.gzhead.hcrc && s.pending > beg) {
|
|
1818
|
+
strm.adler = (0, _crc["default"])(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
if (val === 0) {
|
|
1822
|
+
s.gzindex = 0;
|
|
1823
|
+
s.status = COMMENT_STATE;
|
|
1824
|
+
}
|
|
1825
|
+
} else {
|
|
1825
1826
|
s.status = COMMENT_STATE;
|
|
1826
1827
|
}
|
|
1827
1828
|
}
|
|
@@ -1830,43 +1831,43 @@ function deflate(strm, flush) {
|
|
|
1830
1831
|
if (s.gzhead.comment
|
|
1831
1832
|
/* != Z_NULL*/
|
|
1832
1833
|
) {
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
do {
|
|
1838
|
-
if (s.pending === s.pending_buf_size) {
|
|
1839
|
-
if (s.gzhead.hcrc && s.pending > beg) {
|
|
1840
|
-
strm.adler = (0, _crc.default)(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
1841
|
-
}
|
|
1834
|
+
beg = s.pending;
|
|
1835
|
+
/* start of bytes to update crc */
|
|
1836
|
+
//int val;
|
|
1842
1837
|
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
break;
|
|
1849
|
-
}
|
|
1850
|
-
} // JS specific: little magic to add zero terminator to end of string
|
|
1838
|
+
do {
|
|
1839
|
+
if (s.pending === s.pending_buf_size) {
|
|
1840
|
+
if (s.gzhead.hcrc && s.pending > beg) {
|
|
1841
|
+
strm.adler = (0, _crc["default"])(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
1842
|
+
}
|
|
1851
1843
|
|
|
1844
|
+
flush_pending(strm);
|
|
1845
|
+
beg = s.pending;
|
|
1852
1846
|
|
|
1853
|
-
if (s.
|
|
1854
|
-
val =
|
|
1855
|
-
|
|
1856
|
-
val = 0;
|
|
1847
|
+
if (s.pending === s.pending_buf_size) {
|
|
1848
|
+
val = 1;
|
|
1849
|
+
break;
|
|
1857
1850
|
}
|
|
1851
|
+
} // JS specific: little magic to add zero terminator to end of string
|
|
1858
1852
|
|
|
1859
|
-
put_byte(s, val);
|
|
1860
|
-
} while (val !== 0);
|
|
1861
1853
|
|
|
1862
|
-
if (s.
|
|
1863
|
-
|
|
1854
|
+
if (s.gzindex < s.gzhead.comment.length) {
|
|
1855
|
+
val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;
|
|
1856
|
+
} else {
|
|
1857
|
+
val = 0;
|
|
1864
1858
|
}
|
|
1865
1859
|
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1860
|
+
put_byte(s, val);
|
|
1861
|
+
} while (val !== 0);
|
|
1862
|
+
|
|
1863
|
+
if (s.gzhead.hcrc && s.pending > beg) {
|
|
1864
|
+
strm.adler = (0, _crc["default"])(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
if (val === 0) {
|
|
1868
|
+
s.status = HCRC_STATE;
|
|
1869
|
+
}
|
|
1870
|
+
} else {
|
|
1870
1871
|
s.status = HCRC_STATE;
|
|
1871
1872
|
}
|
|
1872
1873
|
}
|
|
@@ -2030,8 +2031,8 @@ function deflateEnd(strm) {
|
|
|
2030
2031
|
|| !strm.state
|
|
2031
2032
|
/*== Z_NULL*/
|
|
2032
2033
|
) {
|
|
2033
|
-
|
|
2034
|
-
|
|
2034
|
+
return Z_STREAM_ERROR;
|
|
2035
|
+
}
|
|
2035
2036
|
|
|
2036
2037
|
status = strm.state.status;
|
|
2037
2038
|
|
|
@@ -2063,8 +2064,8 @@ function deflateSetDictionary(strm, dictionary) {
|
|
|
2063
2064
|
|| !strm.state
|
|
2064
2065
|
/*== Z_NULL*/
|
|
2065
2066
|
) {
|
|
2066
|
-
|
|
2067
|
-
|
|
2067
|
+
return Z_STREAM_ERROR;
|
|
2068
|
+
}
|
|
2068
2069
|
|
|
2069
2070
|
s = strm.state;
|
|
2070
2071
|
wrap = s.wrap;
|
|
@@ -2077,7 +2078,7 @@ function deflateSetDictionary(strm, dictionary) {
|
|
|
2077
2078
|
|
|
2078
2079
|
if (wrap === 1) {
|
|
2079
2080
|
/* adler32(strm->adler, dictionary, dictLength); */
|
|
2080
|
-
strm.adler = (0, _adler
|
|
2081
|
+
strm.adler = (0, _adler["default"])(strm.adler, dictionary, dictLength, 0);
|
|
2081
2082
|
}
|
|
2082
2083
|
|
|
2083
2084
|
s.wrap = 0;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports["default"] = inflate_fast;
|
|
7
7
|
// See state defs from inflate.js
|
|
8
8
|
var BAD = 30;
|
|
9
9
|
/* got a data error -- remain here until reset */
|
|
@@ -392,9 +392,9 @@ function inflate_fast(strm, start) {
|
|
|
392
392
|
}
|
|
393
393
|
} else if ((op & 64) === 0) {
|
|
394
394
|
/* 2nd level distance code */
|
|
395
|
-
here = dcode[(here & 0xffff
|
|
395
|
+
here = dcode[(here & 0xffff
|
|
396
396
|
/*here.val*/
|
|
397
|
-
hold & (1 << op) - 1)];
|
|
397
|
+
) + (hold & (1 << op) - 1)];
|
|
398
398
|
continue dodist;
|
|
399
399
|
} else {
|
|
400
400
|
strm.msg = 'invalid distance code';
|
|
@@ -406,9 +406,9 @@ function inflate_fast(strm, start) {
|
|
|
406
406
|
}
|
|
407
407
|
} else if ((op & 64) === 0) {
|
|
408
408
|
/* 2nd level length code */
|
|
409
|
-
here = lcode[(here & 0xffff
|
|
409
|
+
here = lcode[(here & 0xffff
|
|
410
410
|
/*here.val*/
|
|
411
|
-
hold & (1 << op) - 1)];
|
|
411
|
+
) + (hold & (1 << op) - 1)];
|
|
412
412
|
continue dolen;
|
|
413
413
|
} else if (op & 32) {
|
|
414
414
|
/* end-of-block */
|