diff --git a/dist/pako.es5.js b/dist/pako.es5.js index db752a8..74004c1 100644 --- a/dist/pako.es5.js +++ b/dist/pako.es5.js @@ -1,5 +1,5 @@ -/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */ +/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : @@ -33,17 +33,17 @@ //const Z_HUFFMAN_ONLY = 2; //const Z_RLE = 3; - var Z_FIXED = 4; //const Z_DEFAULT_STRATEGY = 0; + var Z_FIXED$1 = 4; //const Z_DEFAULT_STRATEGY = 0; /* Possible values of the data_type field (though see inflate()) */ var Z_BINARY = 0; var Z_TEXT = 1; //const Z_ASCII = 1; // = Z_TEXT - var Z_UNKNOWN = 2; + var Z_UNKNOWN$1 = 2; /*============================================================================*/ - function zero(buf) { + function zero$1(buf) { var len = buf.length; while (--len >= 0) { @@ -57,8 +57,8 @@ var DYN_TREES = 2; /* The three kinds of block type */ - var MIN_MATCH = 3; - var MAX_MATCH = 258; + var MIN_MATCH$1 = 3; + var MAX_MATCH$1 = 258; /* The minimum and maximum match lengths */ // From deflate.h @@ -66,25 +66,25 @@ * Internal compression state. */ - var LENGTH_CODES = 29; + var LENGTH_CODES$1 = 29; /* number of length codes, not counting the special END_BLOCK code */ - var LITERALS = 256; + var LITERALS$1 = 256; /* number of literal bytes 0..255 */ - var L_CODES = LITERALS + 1 + LENGTH_CODES; + var L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1; /* number of Literal or Length codes, including the END_BLOCK code */ - var D_CODES = 30; + var D_CODES$1 = 30; /* number of distance codes */ - var BL_CODES = 19; + var BL_CODES$1 = 19; /* number of codes used to transfer the bit lengths */ - var HEAP_SIZE = 2 * L_CODES + 1; + var HEAP_SIZE$1 = 2 * L_CODES$1 + 1; /* maximum heap size */ - var MAX_BITS = 15; + var MAX_BITS$1 = 15; /* All codes must not exceed MAX_BITS bits */ var Buf_size = 16; @@ -136,39 +136,39 @@ /* see definition of array dist_code below */ // !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1 - var static_ltree = new Array((L_CODES + 2) * 2); - zero(static_ltree); + var static_ltree = new Array((L_CODES$1 + 2) * 2); + zero$1(static_ltree); /* The static literal tree. Since the bit lengths are imposed, there is no * need for the L_CODES extra codes used during heap construction. However * The codes 286 and 287 are needed to build a canonical tree (see _tr_init * below). */ - var static_dtree = new Array(D_CODES * 2); - zero(static_dtree); + var static_dtree = new Array(D_CODES$1 * 2); + zero$1(static_dtree); /* The static distance tree. (Actually a trivial tree since all codes use * 5 bits.) */ var _dist_code = new Array(DIST_CODE_LEN); - zero(_dist_code); + zero$1(_dist_code); /* Distance codes. The first 256 values correspond to the distances * 3 .. 258, the last 256 values correspond to the top 8 bits of * the 15 bit distances. */ - var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); + var _length_code = new Array(MAX_MATCH$1 - MIN_MATCH$1 + 1); - zero(_length_code); + zero$1(_length_code); /* length code for each normalized match length (0 == MIN_MATCH) */ - var base_length = new Array(LENGTH_CODES); - zero(base_length); + var base_length = new Array(LENGTH_CODES$1); + zero$1(base_length); /* First normalized length for each code (0 = MIN_MATCH) */ - var base_dist = new Array(D_CODES); - zero(base_dist); + var base_dist = new Array(D_CODES$1); + zero$1(base_dist); /* First normalized distance for each code (0 = distance of 1) */ function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) { @@ -320,7 +320,7 @@ var overflow = 0; /* number of elements with bit length too large */ - for (bits = 0; bits <= MAX_BITS; bits++) { + for (bits = 0; bits <= MAX_BITS$1; bits++) { s.bl_count[bits] = 0; } /* In a first pass, compute the optimal bit lengths (which may @@ -333,7 +333,7 @@ = 0; /* root of the heap */ - for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { + for (h = s.heap_max + 1; h < HEAP_SIZE$1; h++) { n = s.heap[h]; bits = tree[tree[n * 2 + 1] /*.Dad*/ @@ -454,7 +454,7 @@ // int max_code; /* largest code with non zero frequency */ // ushf *bl_count; /* number of codes at each bit length */ { - var next_code = new Array(MAX_BITS + 1); + var next_code = new Array(MAX_BITS$1 + 1); /* next code value for each bit length */ var code = 0; @@ -470,7 +470,7 @@ * without bit reversal. */ - for (bits = 1; bits <= MAX_BITS; bits++) { + for (bits = 1; bits <= MAX_BITS$1; bits++) { next_code[bits] = code = code + bl_count[bits - 1] << 1; } /* Check that the bit counts in bl_count are consistent. The last code @@ -519,7 +519,7 @@ var dist; /* distance index */ - var bl_count = new Array(MAX_BITS + 1); + var bl_count = new Array(MAX_BITS$1 + 1); /* number of codes at each bit length for an optimal tree */ // do check in _tr_init() //if (static_init_done) return; @@ -538,7 +538,7 @@ length = 0; - for (code = 0; code < LENGTH_CODES - 1; code++) { + for (code = 0; code < LENGTH_CODES$1 - 1; code++) { base_length[code] = length; for (n = 0; n < 1 << extra_lbits[code]; n++) { @@ -569,7 +569,7 @@ dist >>= 7; /* from now on, all distances are divided by 128 */ - for (; code < D_CODES; code++) { + for (; code < D_CODES$1; code++) { base_dist[code] = dist << 7; for (n = 0; n < 1 << extra_dbits[code] - 7; n++) { @@ -580,7 +580,7 @@ /* Construct the codes of the static literal tree */ - for (bits = 0; bits <= MAX_BITS; bits++) { + for (bits = 0; bits <= MAX_BITS$1; bits++) { bl_count[bits] = 0; } @@ -623,10 +623,10 @@ */ - gen_codes(static_ltree, L_CODES + 1, bl_count); + gen_codes(static_ltree, L_CODES$1 + 1, bl_count); /* The static distance tree is trivial: */ - for (n = 0; n < D_CODES; n++) { + for (n = 0; n < D_CODES$1; n++) { static_dtree[n * 2 + 1] /*.Len*/ = 5; @@ -636,9 +636,9 @@ } // Now data ready and we can init static trees - static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); - static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); - static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); //static_init_done = true; + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS$1 + 1, L_CODES$1, MAX_BITS$1); + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES$1, MAX_BITS$1); + static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES$1, MAX_BL_BITS); //static_init_done = true; }; /* =========================================================================== * Initialize a new block. @@ -651,19 +651,19 @@ /* Initialize the trees. */ - for (n = 0; n < L_CODES; n++) { + for (n = 0; n < L_CODES$1; n++) { s.dyn_ltree[n * 2] /*.Freq*/ = 0; } - for (n = 0; n < D_CODES; n++) { + for (n = 0; n < D_CODES$1; n++) { s.dyn_dtree[n * 2] /*.Freq*/ = 0; } - for (n = 0; n < BL_CODES; n++) { + for (n = 0; n < BL_CODES$1; n++) { s.bl_tree[n * 2] /*.Freq*/ = 0; @@ -815,7 +815,7 @@ } else { /* Here, lc is the match length - MIN_MATCH */ code = _length_code[lc]; - send_code(s, code + LITERALS + 1, ltree); + send_code(s, code + LITERALS$1 + 1, ltree); /* send the length code */ extra = extra_lbits[code]; @@ -885,7 +885,7 @@ */ s.heap_len = 0; - s.heap_max = HEAP_SIZE; + s.heap_max = HEAP_SIZE$1; for (n = 0; n < elems; n++) { if (tree[n * 2] @@ -1196,7 +1196,7 @@ * 3 but the actual value used is 4.) */ - for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { + for (max_blindex = BL_CODES$1 - 1; max_blindex >= 3; max_blindex--) { if (s.bl_tree[bl_order[max_blindex] * 2 + 1] /*.Len*/ !== 0) { @@ -1295,7 +1295,7 @@ return Z_TEXT; } - for (n = 32; n < LITERALS; n++) { + for (n = 32; n < LITERALS$1; n++) { if (s.dyn_ltree[n * 2] /*.Freq*/ !== 0) { @@ -1315,7 +1315,7 @@ * Initialize the tree data structures for a new zlib stream. */ - var _tr_init = function _tr_init(s) { + var _tr_init$1 = function _tr_init(s) { if (!static_init_done) { tr_static_init(); static_init_done = true; @@ -1335,7 +1335,7 @@ */ - var _tr_stored_block = function _tr_stored_block(s, buf, stored_len, last) //DeflateState *s; + var _tr_stored_block$1 = function _tr_stored_block(s, buf, stored_len, last) //DeflateState *s; //charf *buf; /* input block */ //ulg stored_len; /* length of input block */ //int last; /* one if this is the last block for a file */ @@ -1352,7 +1352,7 @@ */ - var _tr_align = function _tr_align(s) { + var _tr_align$1 = function _tr_align(s) { send_bits(s, STATIC_TREES << 1, 3); send_code(s, END_BLOCK, static_ltree); bi_flush(s); @@ -1363,7 +1363,7 @@ */ - var _tr_flush_block = function _tr_flush_block(s, buf, stored_len, last) //DeflateState *s; + var _tr_flush_block$1 = function _tr_flush_block(s, buf, stored_len, last) //DeflateState *s; //charf *buf; /* input block, or NULL if too old */ //ulg stored_len; /* length of input block */ //int last; /* one if this is the last block for a file */ @@ -1378,7 +1378,7 @@ if (s.level > 0) { /* Check if the file is binary or text */ - if (s.strm.data_type === Z_UNKNOWN) { + if (s.strm.data_type === Z_UNKNOWN$1) { s.strm.data_type = detect_data_type(s); } /* Construct the literal and distance trees */ @@ -1424,8 +1424,8 @@ * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to * transform a block into a stored block. */ - _tr_stored_block(s, buf, stored_len, last); - } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { + _tr_stored_block$1(s, buf, stored_len, last); + } else if (s.strategy === Z_FIXED$1 || static_lenb === opt_lenb) { send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); compress_block(s, static_ltree, static_dtree); } else { @@ -1453,7 +1453,7 @@ */ - var _tr_tally = function _tr_tally(s, dist, lc) // deflate_state *s; + var _tr_tally$1 = function _tr_tally(s, dist, lc) // deflate_state *s; // unsigned dist; /* distance of matched string */ // unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ { @@ -1476,7 +1476,7 @@ // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); - s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2] /*.Freq*/++; + s.dyn_ltree[(_length_code[lc] + LITERALS$1 + 1) * 2] /*.Freq*/++; s.dyn_dtree[d_code(dist) * 2] /*.Freq*/++; } // (!) This block is disabled in zlib defaults, // don't enable it for binary compatibility @@ -1508,11 +1508,11 @@ */ }; - var _tr_init_1 = _tr_init; - var _tr_stored_block_1 = _tr_stored_block; - var _tr_flush_block_1 = _tr_flush_block; - var _tr_tally_1 = _tr_tally; - var _tr_align_1 = _tr_align; + var _tr_init_1 = _tr_init$1; + var _tr_stored_block_1 = _tr_stored_block$1; + var _tr_flush_block_1 = _tr_flush_block$1; + var _tr_tally_1 = _tr_tally$1; + var _tr_align_1 = _tr_align$1; var trees = { _tr_init: _tr_init_1, _tr_stored_block: _tr_stored_block_1, @@ -1690,7 +1690,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. - var constants = { + var constants$2 = { /* Allowed flush values; see deflate() and inflate() below for details */ Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, @@ -1754,66 +1754,66 @@ // 3. This notice may not be removed or altered from any source distribution. - var _tr_init$1 = trees._tr_init, - _tr_stored_block$1 = trees._tr_stored_block, - _tr_flush_block$1 = trees._tr_flush_block, - _tr_tally$1 = trees._tr_tally, - _tr_align$1 = trees._tr_align; + var _tr_init = trees._tr_init, + _tr_stored_block = trees._tr_stored_block, + _tr_flush_block = trees._tr_flush_block, + _tr_tally = trees._tr_tally, + _tr_align = trees._tr_align; /* Public constants ==========================================================*/ /* ===========================================================================*/ - var Z_NO_FLUSH = constants.Z_NO_FLUSH, - Z_PARTIAL_FLUSH = constants.Z_PARTIAL_FLUSH, - Z_FULL_FLUSH = constants.Z_FULL_FLUSH, - Z_FINISH = constants.Z_FINISH, - Z_BLOCK = constants.Z_BLOCK, - Z_OK = constants.Z_OK, - Z_STREAM_END = constants.Z_STREAM_END, - Z_STREAM_ERROR = constants.Z_STREAM_ERROR, - Z_DATA_ERROR = constants.Z_DATA_ERROR, - Z_BUF_ERROR = constants.Z_BUF_ERROR, - Z_DEFAULT_COMPRESSION = constants.Z_DEFAULT_COMPRESSION, - Z_FILTERED = constants.Z_FILTERED, - Z_HUFFMAN_ONLY = constants.Z_HUFFMAN_ONLY, - Z_RLE = constants.Z_RLE, - Z_FIXED$1 = constants.Z_FIXED, - Z_DEFAULT_STRATEGY = constants.Z_DEFAULT_STRATEGY, - Z_UNKNOWN$1 = constants.Z_UNKNOWN, - Z_DEFLATED = constants.Z_DEFLATED; + var Z_NO_FLUSH$2 = constants$2.Z_NO_FLUSH, + Z_PARTIAL_FLUSH = constants$2.Z_PARTIAL_FLUSH, + Z_FULL_FLUSH$1 = constants$2.Z_FULL_FLUSH, + Z_FINISH$3 = constants$2.Z_FINISH, + Z_BLOCK$1 = constants$2.Z_BLOCK, + Z_OK$3 = constants$2.Z_OK, + Z_STREAM_END$3 = constants$2.Z_STREAM_END, + Z_STREAM_ERROR$2 = constants$2.Z_STREAM_ERROR, + Z_DATA_ERROR$2 = constants$2.Z_DATA_ERROR, + Z_BUF_ERROR$1 = constants$2.Z_BUF_ERROR, + Z_DEFAULT_COMPRESSION$1 = constants$2.Z_DEFAULT_COMPRESSION, + Z_FILTERED = constants$2.Z_FILTERED, + Z_HUFFMAN_ONLY = constants$2.Z_HUFFMAN_ONLY, + Z_RLE = constants$2.Z_RLE, + Z_FIXED = constants$2.Z_FIXED, + Z_DEFAULT_STRATEGY$1 = constants$2.Z_DEFAULT_STRATEGY, + Z_UNKNOWN = constants$2.Z_UNKNOWN, + Z_DEFLATED$2 = constants$2.Z_DEFLATED; /*============================================================================*/ var MAX_MEM_LEVEL = 9; /* Maximum value for memLevel in deflateInit2 */ - var MAX_WBITS = 15; + var MAX_WBITS$1 = 15; /* 32K LZ77 window */ var DEF_MEM_LEVEL = 8; - var LENGTH_CODES$1 = 29; + var LENGTH_CODES = 29; /* number of length codes, not counting the special END_BLOCK code */ - var LITERALS$1 = 256; + var LITERALS = 256; /* number of literal bytes 0..255 */ - var L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1; + var L_CODES = LITERALS + 1 + LENGTH_CODES; /* number of Literal or Length codes, including the END_BLOCK code */ - var D_CODES$1 = 30; + var D_CODES = 30; /* number of distance codes */ - var BL_CODES$1 = 19; + var BL_CODES = 19; /* number of codes used to transfer the bit lengths */ - var HEAP_SIZE$1 = 2 * L_CODES$1 + 1; + var HEAP_SIZE = 2 * L_CODES + 1; /* maximum heap size */ - var MAX_BITS$1 = 15; + var MAX_BITS = 15; /* All codes must not exceed MAX_BITS bits */ - var MIN_MATCH$1 = 3; - var MAX_MATCH$1 = 258; - var MIN_LOOKAHEAD = MAX_MATCH$1 + MIN_MATCH$1 + 1; + var MIN_MATCH = 3; + var MAX_MATCH = 258; + var MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1; var PRESET_DICT = 0x20; var INIT_STATE = 42; var EXTRA_STATE = 69; @@ -1845,7 +1845,7 @@ return (f << 1) - (f > 4 ? 9 : 0); }; - var zero$1 = function zero(buf) { + var zero = function zero(buf) { var len = buf.length; while (--len >= 0) { @@ -1896,7 +1896,7 @@ }; var flush_block_only = function flush_block_only(s, last) { - _tr_flush_block$1(s, s.block_start >= 0 ? s.block_start : -1, s.strstart - s.block_start, last); + _tr_flush_block(s, s.block_start >= 0 ? s.block_start : -1, s.strstart - s.block_start, last); s.block_start = s.strstart; flush_pending(s.strm); @@ -1993,7 +1993,7 @@ * we prevent matches with the string of window index 0. */ - var strend = s.strstart + MAX_MATCH$1; + var strend = s.strstart + MAX_MATCH; var scan_end1 = _win[scan + best_len - 1]; var scan_end = _win[scan + best_len]; /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. @@ -2051,8 +2051,8 @@ } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend); // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - len = MAX_MATCH$1 - (strend - scan); - scan = strend - MAX_MATCH$1; + len = MAX_MATCH - (strend - scan); + scan = strend - MAX_MATCH; if (len > best_len) { s.match_start = cur_match; @@ -2166,7 +2166,7 @@ s.lookahead += n; /* Initialize the hash value now that we have some input: */ - if (s.lookahead + s.insert >= MIN_MATCH$1) { + if (s.lookahead + s.insert >= MIN_MATCH) { str = s.strstart - s.insert; s.ins_h = s.window[str]; /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */ @@ -2177,13 +2177,13 @@ while (s.insert) { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]); s.prev[str & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = str; str++; s.insert--; - if (s.lookahead + s.insert < MIN_MATCH$1) { + if (s.lookahead + s.insert < MIN_MATCH) { break; } } @@ -2265,7 +2265,7 @@ // } fill_window(s); - if (s.lookahead === 0 && flush === Z_NO_FLUSH) { + if (s.lookahead === 0 && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } @@ -2317,7 +2317,7 @@ s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); @@ -2368,7 +2368,7 @@ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } @@ -2386,9 +2386,9 @@ /*NIL*/ ; - if (s.lookahead >= MIN_MATCH$1) { + if (s.lookahead >= MIN_MATCH) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -2409,12 +2409,12 @@ /* longest_match() sets match_start */ } - if (s.match_length >= MIN_MATCH$1) { + if (s.match_length >= MIN_MATCH) { // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only /*** _tr_tally_dist(s, s.strstart - s.match_start, s.match_length - MIN_MATCH, bflush); ***/ - bflush = _tr_tally$1(s, s.strstart - s.match_start, s.match_length - MIN_MATCH$1); + bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; /* Insert new strings in the hash table only if the match length * is not too large. This saves time but degrades compression. @@ -2422,7 +2422,7 @@ if (s.match_length <= s.max_lazy_match /*max_insert_length*/ - && s.lookahead >= MIN_MATCH$1) { + && s.lookahead >= MIN_MATCH) { s.match_length--; /* string at strstart already in table */ @@ -2430,7 +2430,7 @@ s.strstart++; /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -2460,7 +2460,7 @@ //Tracevv((stderr,"%c", s.window[s.strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; } @@ -2477,9 +2477,9 @@ } } - s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1; + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); @@ -2531,7 +2531,7 @@ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } @@ -2550,9 +2550,9 @@ /*NIL*/ ; - if (s.lookahead >= MIN_MATCH$1) { + if (s.lookahead >= MIN_MATCH) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -2563,43 +2563,43 @@ s.prev_length = s.match_length; s.prev_match = s.match_start; - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; if (hash_head !== 0 /*NIL*/ && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD /*MAX_DIST(s)*/ ) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - s.match_length = longest_match(s, hash_head); - /* longest_match() sets match_start */ + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s.match_length = longest_match(s, hash_head); + /* longest_match() sets match_start */ - if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH$1 && s.strstart - s.match_start > 4096 - /*TOO_FAR*/ - )) { - /* If prev_match is also MIN_MATCH, match_start is garbage - * but we will ignore the current match anyway. - */ - s.match_length = MIN_MATCH$1 - 1; - } + if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096 + /*TOO_FAR*/ + )) { + /* If prev_match is also MIN_MATCH, match_start is garbage + * but we will ignore the current match anyway. + */ + s.match_length = MIN_MATCH - 1; } + } /* If there was a match at the previous step and the current * match is not better, output the previous match: */ - if (s.prev_length >= MIN_MATCH$1 && s.match_length <= s.prev_length) { - max_insert = s.strstart + s.lookahead - MIN_MATCH$1; + if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { + max_insert = s.strstart + s.lookahead - MIN_MATCH; /* Do not insert strings in hash table beyond this. */ //check_match(s, s.strstart-1, s.prev_match, s.prev_length); /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH, bflush);***/ - bflush = _tr_tally$1(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH$1); + bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); /* Insert in hash table all strings up to the end of the match. * strstart-1 and strstart are already inserted. If there is not * enough lookahead, the last two strings are not inserted in @@ -2612,7 +2612,7 @@ do { if (++s.strstart <= max_insert) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -2620,7 +2620,7 @@ } while (--s.prev_length !== 0); s.match_available = 0; - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; s.strstart++; if (bflush) { @@ -2641,7 +2641,7 @@ //Tracevv((stderr,"%c", s->window[s->strstart-1])); /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]); + bflush = _tr_tally(s, 0, s.window[s.strstart - 1]); if (bflush) { /*** FLUSH_BLOCK_ONLY(s, 0) ***/ @@ -2670,13 +2670,13 @@ //Tracevv((stderr,"%c", s->window[s->strstart-1])); /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]); + bflush = _tr_tally(s, 0, s.window[s.strstart - 1]); s.match_available = 0; } - s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1; + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); @@ -2726,10 +2726,10 @@ * at the end of the input file. We need MAX_MATCH bytes * for the longest run, plus one for the unrolled loop. */ - if (s.lookahead <= MAX_MATCH$1) { + if (s.lookahead <= MAX_MATCH) { fill_window(s); - if (s.lookahead <= MAX_MATCH$1 && flush === Z_NO_FLUSH) { + if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } @@ -2744,18 +2744,18 @@ s.match_length = 0; - if (s.lookahead >= MIN_MATCH$1 && s.strstart > 0) { + if (s.lookahead >= MIN_MATCH && s.strstart > 0) { scan = s.strstart - 1; prev = _win[scan]; if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { - strend = s.strstart + MAX_MATCH$1; + strend = s.strstart + MAX_MATCH; do { /*jshint noempty:false*/ } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend); - s.match_length = MAX_MATCH$1 - (strend - scan); + s.match_length = MAX_MATCH - (strend - scan); if (s.match_length > s.lookahead) { s.match_length = s.lookahead; @@ -2766,11 +2766,11 @@ /* Emit match if have run of MIN_MATCH or longer, else emit literal */ - if (s.match_length >= MIN_MATCH$1) { + if (s.match_length >= MIN_MATCH) { //check_match(s, s.strstart, s.strstart - 1, s.match_length); /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ - bflush = _tr_tally$1(s, 1, s.match_length - MIN_MATCH$1); + bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; s.strstart += s.match_length; s.match_length = 0; @@ -2779,7 +2779,7 @@ //Tracevv((stderr,"%c", s->window[s->strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; } @@ -2798,7 +2798,7 @@ s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); @@ -2840,7 +2840,7 @@ fill_window(s); if (s.lookahead === 0) { - if (flush === Z_NO_FLUSH) { + if (flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } @@ -2855,7 +2855,7 @@ /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; @@ -2873,7 +2873,7 @@ s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); @@ -2945,7 +2945,7 @@ s.window_size = 2 * s.w_size; /*** CLEAR_HASH(s); ***/ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); /* Set the default configuration parameters: */ @@ -2958,7 +2958,7 @@ s.block_start = 0; s.lookahead = 0; s.insert = 0; - s.match_length = s.prev_length = MIN_MATCH$1 - 1; + s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; s.ins_h = 0; }; @@ -2991,7 +2991,7 @@ this.gzindex = 0; /* where in extra, name, or comment */ - this.method = Z_DEFLATED; + this.method = Z_DEFLATED$2; /* can only be DEFLATED */ this.last_flush = -1; @@ -3115,12 +3115,12 @@ // Use flat array of DOUBLE size, with interleaved fata, // because JS does not support effective - this.dyn_ltree = new Uint16Array(HEAP_SIZE$1 * 2); - this.dyn_dtree = new Uint16Array((2 * D_CODES$1 + 1) * 2); - this.bl_tree = new Uint16Array((2 * BL_CODES$1 + 1) * 2); - zero$1(this.dyn_ltree); - zero$1(this.dyn_dtree); - zero$1(this.bl_tree); + this.dyn_ltree = new Uint16Array(HEAP_SIZE * 2); + this.dyn_dtree = new Uint16Array((2 * D_CODES + 1) * 2); + this.bl_tree = new Uint16Array((2 * BL_CODES + 1) * 2); + zero(this.dyn_ltree); + zero(this.dyn_dtree); + zero(this.bl_tree); this.l_desc = null; /* desc. for literal tree */ @@ -3131,14 +3131,14 @@ /* desc. for bit length tree */ //ush bl_count[MAX_BITS+1]; - this.bl_count = new Uint16Array(MAX_BITS$1 + 1); + this.bl_count = new Uint16Array(MAX_BITS + 1); /* number of codes at each bit length for an optimal tree */ //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ - this.heap = new Uint16Array(2 * L_CODES$1 + 1); + this.heap = new Uint16Array(2 * L_CODES + 1); /* heap used to build the Huffman trees */ - zero$1(this.heap); + zero(this.heap); this.heap_len = 0; /* number of elements in the heap */ @@ -3149,9 +3149,9 @@ * The same heap array is used to build all trees. */ - this.depth = new Uint16Array(2 * L_CODES$1 + 1); //uch depth[2*L_CODES+1]; + this.depth = new Uint16Array(2 * L_CODES + 1); //uch depth[2*L_CODES+1]; - zero$1(this.depth); + zero(this.depth); /* Depth of each subtree used as tie breaker for trees of equal frequency */ @@ -3221,11 +3221,11 @@ var deflateResetKeep = function deflateResetKeep(strm) { if (!strm || !strm.state) { - return err(strm, Z_STREAM_ERROR); + return err(strm, Z_STREAM_ERROR$2); } strm.total_in = strm.total_out = 0; - strm.data_type = Z_UNKNOWN$1; + strm.data_type = Z_UNKNOWN; var s = strm.state; s.pending = 0; s.pending_out = 0; @@ -3239,17 +3239,17 @@ strm.adler = s.wrap === 2 ? 0 // crc32(0, Z_NULL, 0) : 1; // adler32(0, Z_NULL, 0) - s.last_flush = Z_NO_FLUSH; + s.last_flush = Z_NO_FLUSH$2; - _tr_init$1(s); + _tr_init(s); - return Z_OK; + return Z_OK$3; }; var deflateReset = function deflateReset(strm) { var ret = deflateResetKeep(strm); - if (ret === Z_OK) { + if (ret === Z_OK$3) { lm_init(strm.state); } @@ -3258,26 +3258,26 @@ var deflateSetHeader = function deflateSetHeader(strm, head) { if (!strm || !strm.state) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } if (strm.state.wrap !== 2) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } strm.state.gzhead = head; - return Z_OK; + return Z_OK$3; }; var deflateInit2 = function deflateInit2(strm, level, method, windowBits, memLevel, strategy) { if (!strm) { // === Z_NULL - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } var wrap = 1; - if (level === Z_DEFAULT_COMPRESSION) { + if (level === Z_DEFAULT_COMPRESSION$1) { level = 6; } @@ -3292,8 +3292,8 @@ windowBits -= 16; } - if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED$1) { - return err(strm, Z_STREAM_ERROR); + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED$2 || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) { + return err(strm, Z_STREAM_ERROR$2); } if (windowBits === 8) { @@ -3313,7 +3313,7 @@ s.hash_bits = memLevel + 7; s.hash_size = 1 << s.hash_bits; s.hash_mask = s.hash_size - 1; - s.hash_shift = ~~((s.hash_bits + MIN_MATCH$1 - 1) / MIN_MATCH$1); + s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); s.window = new Uint8Array(s.w_size * 2); s.head = new Uint16Array(s.hash_size); s.prev = new Uint16Array(s.w_size); // Don't need mem init magic for JS. @@ -3338,20 +3338,20 @@ }; var deflateInit = function deflateInit(strm, level) { - return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); + return deflateInit2(strm, level, Z_DEFLATED$2, MAX_WBITS$1, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY$1); }; - var deflate = function deflate(strm, flush) { + var deflate$2 = function deflate(strm, flush) { var beg, val; // for gzip header write only - if (!strm || !strm.state || flush > Z_BLOCK || flush < 0) { - return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; + if (!strm || !strm.state || flush > Z_BLOCK$1 || flush < 0) { + return strm ? err(strm, Z_STREAM_ERROR$2) : Z_STREAM_ERROR$2; } var s = strm.state; - if (!strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH) { - return err(strm, strm.avail_out === 0 ? Z_BUF_ERROR : Z_STREAM_ERROR); + if (!strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH$3) { + return err(strm, strm.avail_out === 0 ? Z_BUF_ERROR$1 : Z_STREAM_ERROR$2); } s.strm = strm; @@ -3403,7 +3403,7 @@ } } else // DEFLATE header { - var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8; + var header = Z_DEFLATED$2 + (s.w_bits - 8 << 4) << 8; var level_flags = -1; if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { @@ -3441,36 +3441,36 @@ if (s.gzhead.extra /* != Z_NULL*/ ) { - beg = s.pending; - /* start of bytes to update crc */ + beg = s.pending; + /* start of bytes to update crc */ - while (s.gzindex < (s.gzhead.extra.length & 0xffff)) { - if (s.pending === s.pending_buf_size) { - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); - } - - flush_pending(strm); - beg = s.pending; - - if (s.pending === s.pending_buf_size) { - break; - } + while (s.gzindex < (s.gzhead.extra.length & 0xffff)) { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); } - put_byte(s, s.gzhead.extra[s.gzindex] & 0xff); - s.gzindex++; + flush_pending(strm); + beg = s.pending; + + if (s.pending === s.pending_buf_size) { + break; + } } - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); - } + put_byte(s, s.gzhead.extra[s.gzindex] & 0xff); + s.gzindex++; + } - if (s.gzindex === s.gzhead.extra.length) { - s.gzindex = 0; - s.status = NAME_STATE; - } - } else { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); + } + + if (s.gzindex === s.gzhead.extra.length) { + s.gzindex = 0; + s.status = NAME_STATE; + } + } else { s.status = NAME_STATE; } } @@ -3479,44 +3479,44 @@ if (s.gzhead.name /* != Z_NULL*/ ) { - beg = s.pending; - /* start of bytes to update crc */ - //int val; + beg = s.pending; + /* start of bytes to update crc */ + //int val; - do { - if (s.pending === s.pending_buf_size) { - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); - } - - flush_pending(strm); - beg = s.pending; - - if (s.pending === s.pending_buf_size) { - val = 1; - break; - } - } // JS specific: little magic to add zero terminator to end of string - - - if (s.gzindex < s.gzhead.name.length) { - val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff; - } else { - val = 0; + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); } - put_byte(s, val); - } while (val !== 0); + flush_pending(strm); + beg = s.pending; - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } // JS specific: little magic to add zero terminator to end of string + + + if (s.gzindex < s.gzhead.name.length) { + val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff; + } else { + val = 0; } - if (val === 0) { - s.gzindex = 0; - s.status = COMMENT_STATE; - } - } else { + put_byte(s, val); + } while (val !== 0); + + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); + } + + if (val === 0) { + s.gzindex = 0; + s.status = COMMENT_STATE; + } + } else { s.status = COMMENT_STATE; } } @@ -3525,43 +3525,43 @@ if (s.gzhead.comment /* != Z_NULL*/ ) { - beg = s.pending; - /* start of bytes to update crc */ - //int val; + beg = s.pending; + /* start of bytes to update crc */ + //int val; - do { - if (s.pending === s.pending_buf_size) { - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); - } - - flush_pending(strm); - beg = s.pending; - - if (s.pending === s.pending_buf_size) { - val = 1; - break; - } - } // JS specific: little magic to add zero terminator to end of string - - - if (s.gzindex < s.gzhead.comment.length) { - val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff; - } else { - val = 0; + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); } - put_byte(s, val); - } while (val !== 0); + flush_pending(strm); + beg = s.pending; - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } // JS specific: little magic to add zero terminator to end of string + + + if (s.gzindex < s.gzhead.comment.length) { + val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff; + } else { + val = 0; } - if (val === 0) { - s.status = HCRC_STATE; - } - } else { + put_byte(s, val); + } while (val !== 0); + + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); + } + + if (val === 0) { + s.status = HCRC_STATE; + } + } else { s.status = HCRC_STATE; } } @@ -3598,27 +3598,27 @@ * return OK instead of BUF_ERROR at next call of deflate: */ s.last_flush = -1; - return Z_OK; + return Z_OK$3; } /* Make sure there is something to do and avoid duplicate consecutive * flushes. For repeated and useless calls with Z_FINISH, we keep * returning Z_STREAM_END instead of Z_BUF_ERROR. */ - } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH) { - return err(strm, Z_BUF_ERROR); + } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH$3) { + return err(strm, Z_BUF_ERROR$1); } /* User must not provide more input after the first FINISH: */ if (s.status === FINISH_STATE && strm.avail_in !== 0) { - return err(strm, Z_BUF_ERROR); + return err(strm, Z_BUF_ERROR$1); } /* Start a new block or continue the current one. */ - if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) { + if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH$2 && s.status !== FINISH_STATE) { var bstate = s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : s.strategy === Z_RLE ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush); if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { @@ -3631,7 +3631,7 @@ /* avoid BUF_ERROR next call, see above */ } - return Z_OK; + return Z_OK$3; /* If flush != Z_NO_FLUSH && avail_out == 0, the next call * of deflate should use the same flush parameter to make sure * that the flush is complete. So we don't have to output an @@ -3643,20 +3643,20 @@ if (bstate === BS_BLOCK_DONE) { if (flush === Z_PARTIAL_FLUSH) { - _tr_align$1(s); - } else if (flush !== Z_BLOCK) { + _tr_align(s); + } else if (flush !== Z_BLOCK$1) { /* FULL_FLUSH or SYNC_FLUSH */ - _tr_stored_block$1(s, 0, 0, false); + _tr_stored_block(s, 0, 0, false); /* For a full flush, this empty block will be recognized * as a special marker by inflate_sync(). */ - if (flush === Z_FULL_FLUSH) { + if (flush === Z_FULL_FLUSH$1) { /*** CLEAR_HASH(s); ***/ /* forget history */ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); if (s.lookahead === 0) { s.strstart = 0; @@ -3672,19 +3672,19 @@ s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ - return Z_OK; + return Z_OK$3; } } } //Assert(strm->avail_out > 0, "bug2"); //if (strm.avail_out <= 0) { throw new Error("bug2");} - if (flush !== Z_FINISH) { - return Z_OK; + if (flush !== Z_FINISH$3) { + return Z_OK$3; } if (s.wrap <= 0) { - return Z_STREAM_END; + return Z_STREAM_END$3; } /* Write the trailer */ @@ -3714,7 +3714,7 @@ /* write the trailer only once! */ - return s.pending !== 0 ? Z_OK : Z_STREAM_END; + return s.pending !== 0 ? Z_OK$3 : Z_STREAM_END$3; }; var deflateEnd = function deflateEnd(strm) { @@ -3723,17 +3723,17 @@ || !strm.state /*== Z_NULL*/ ) { - return Z_STREAM_ERROR; - } + return Z_STREAM_ERROR$2; + } var status = strm.state.status; if (status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE) { - return err(strm, Z_STREAM_ERROR); + return err(strm, Z_STREAM_ERROR$2); } strm.state = null; - return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; + return status === BUSY_STATE ? err(strm, Z_DATA_ERROR$2) : Z_OK$3; }; /* ========================================================================= * Initializes the compression dictionary from the given byte @@ -3749,14 +3749,14 @@ || !strm.state /*== Z_NULL*/ ) { - return Z_STREAM_ERROR; - } + return Z_STREAM_ERROR$2; + } var s = strm.state; var wrap = s.wrap; if (wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } /* when using zlib wrappers, compute Adler-32 for provided dictionary */ @@ -3776,7 +3776,7 @@ /* already empty otherwise */ /*** CLEAR_HASH(s); ***/ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); s.strstart = 0; s.block_start = 0; @@ -3802,20 +3802,20 @@ strm.input = dictionary; fill_window(s); - while (s.lookahead >= MIN_MATCH$1) { + while (s.lookahead >= MIN_MATCH) { var str = s.strstart; - var n = s.lookahead - (MIN_MATCH$1 - 1); + var n = s.lookahead - (MIN_MATCH - 1); do { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]); s.prev[str & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = str; str++; } while (--n); s.strstart = str; - s.lookahead = MIN_MATCH$1 - 1; + s.lookahead = MIN_MATCH - 1; fill_window(s); } @@ -3823,13 +3823,13 @@ s.block_start = s.strstart; s.insert = s.lookahead; s.lookahead = 0; - s.match_length = s.prev_length = MIN_MATCH$1 - 1; + s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; strm.next_in = next; strm.input = input; strm.avail_in = avail; s.wrap = wrap; - return Z_OK; + return Z_OK$3; }; var deflateInit_1 = deflateInit; @@ -3837,7 +3837,7 @@ var deflateReset_1 = deflateReset; var deflateResetKeep_1 = deflateResetKeep; var deflateSetHeader_1 = deflateSetHeader; - var deflate_2 = deflate; + var deflate_2$1 = deflate$2; var deflateEnd_1 = deflateEnd; var deflateSetDictionary_1 = deflateSetDictionary; var deflateInfo = 'pako deflate (from Nodeca project)'; @@ -3850,13 +3850,13 @@ module.exports.deflateTune = deflateTune; */ - var deflate_1 = { + var deflate_1$2 = { deflateInit: deflateInit_1, deflateInit2: deflateInit2_1, deflateReset: deflateReset_1, deflateResetKeep: deflateResetKeep_1, deflateSetHeader: deflateSetHeader_1, - deflate: deflate_2, + deflate: deflate_2$1, deflateEnd: deflateEnd_1, deflateSetDictionary: deflateSetDictionary_1, deflateInfo: deflateInfo @@ -3961,6 +3961,10 @@ // convert string to array (typed, when possible) var string2buf = function string2buf(str) { + if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) { + return new TextEncoder().encode(str); + } + var buf, c, c2, @@ -4045,8 +4049,13 @@ var buf2string = function buf2string(buf, max) { - var i, out; - var len = max || buf.length; // Reserve max possible length (2 words per char) + var len = max || buf.length; + + if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) { + return new TextDecoder().decode(buf.subarray(0, max)); + } + + var i, out; // Reserve max possible length (2 words per char) // NB: by unknown reasons, Array is significantly faster for // String.fromCharCode.apply than Uint16Array. @@ -4195,20 +4204,20 @@ var zstream = ZStream; - var toString = Object.prototype.toString; + var toString$1 = Object.prototype.toString; /* Public constants ==========================================================*/ /* ===========================================================================*/ - var Z_NO_FLUSH$1 = constants.Z_NO_FLUSH, - Z_SYNC_FLUSH = constants.Z_SYNC_FLUSH, - Z_FULL_FLUSH$1 = constants.Z_FULL_FLUSH, - Z_FINISH$1 = constants.Z_FINISH, - Z_OK$1 = constants.Z_OK, - Z_STREAM_END$1 = constants.Z_STREAM_END, - Z_DEFAULT_COMPRESSION$1 = constants.Z_DEFAULT_COMPRESSION, - Z_DEFAULT_STRATEGY$1 = constants.Z_DEFAULT_STRATEGY, - Z_DEFLATED$1 = constants.Z_DEFLATED; + var Z_NO_FLUSH$1 = constants$2.Z_NO_FLUSH, + Z_SYNC_FLUSH = constants$2.Z_SYNC_FLUSH, + Z_FULL_FLUSH = constants$2.Z_FULL_FLUSH, + Z_FINISH$2 = constants$2.Z_FINISH, + Z_OK$2 = constants$2.Z_OK, + Z_STREAM_END$2 = constants$2.Z_STREAM_END, + Z_DEFAULT_COMPRESSION = constants$2.Z_DEFAULT_COMPRESSION, + Z_DEFAULT_STRATEGY = constants$2.Z_DEFAULT_STRATEGY, + Z_DEFLATED$1 = constants$2.Z_DEFLATED; /* ===========================================================================*/ /** @@ -4296,14 +4305,14 @@ * ``` **/ - function Deflate(options) { + function Deflate$1(options) { this.options = common.assign({ - level: Z_DEFAULT_COMPRESSION$1, + level: Z_DEFAULT_COMPRESSION, method: Z_DEFLATED$1, chunkSize: 16384, windowBits: 15, memLevel: 8, - strategy: Z_DEFAULT_STRATEGY$1 + strategy: Z_DEFAULT_STRATEGY }, options || {}); var opt = this.options; @@ -4323,14 +4332,14 @@ this.strm = new zstream(); this.strm.avail_out = 0; - var status = deflate_1.deflateInit2(this.strm, opt.level, opt.method, opt.windowBits, opt.memLevel, opt.strategy); + var status = deflate_1$2.deflateInit2(this.strm, opt.level, opt.method, opt.windowBits, opt.memLevel, opt.strategy); - if (status !== Z_OK$1) { + if (status !== Z_OK$2) { throw new Error(messages[status]); } if (opt.header) { - deflate_1.deflateSetHeader(this.strm, opt.header); + deflate_1$2.deflateSetHeader(this.strm, opt.header); } if (opt.dictionary) { @@ -4339,15 +4348,15 @@ if (typeof opt.dictionary === 'string') { // If we need to compress text, change encoding to utf8. dict = strings.string2buf(opt.dictionary); - } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { + } else if (toString$1.call(opt.dictionary) === '[object ArrayBuffer]') { dict = new Uint8Array(opt.dictionary); } else { dict = opt.dictionary; } - status = deflate_1.deflateSetDictionary(this.strm, dict); + status = deflate_1$2.deflateSetDictionary(this.strm, dict); - if (status !== Z_OK$1) { + if (status !== Z_OK$2) { throw new Error(messages[status]); } @@ -4378,7 +4387,7 @@ **/ - Deflate.prototype.push = function (data, flush_mode) { + Deflate$1.prototype.push = function (data, flush_mode) { var strm = this.strm; var chunkSize = this.options.chunkSize; @@ -4388,12 +4397,12 @@ return false; } - if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;else _flush_mode = flush_mode === true ? Z_FINISH$1 : Z_NO_FLUSH$1; // Convert data if needed + if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;else _flush_mode = flush_mode === true ? Z_FINISH$2 : Z_NO_FLUSH$1; // Convert data if needed if (typeof data === 'string') { // If we need to compress text, change encoding to utf8. strm.input = strings.string2buf(data); - } else if (toString.call(data) === '[object ArrayBuffer]') { + } else if (toString$1.call(data) === '[object ArrayBuffer]') { strm.input = new Uint8Array(data); } else { strm.input = data; @@ -4410,23 +4419,23 @@ } // Make sure avail_out > 6 to avoid repeating markers - if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH$1) && strm.avail_out <= 6) { + if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH) && strm.avail_out <= 6) { this.onData(strm.output.subarray(0, strm.next_out)); strm.avail_out = 0; continue; } - status = deflate_1.deflate(strm, _flush_mode); // Ended => flush and finish + status = deflate_1$2.deflate(strm, _flush_mode); // Ended => flush and finish - if (status === Z_STREAM_END$1) { + if (status === Z_STREAM_END$2) { if (strm.next_out > 0) { this.onData(strm.output.subarray(0, strm.next_out)); } - status = deflate_1.deflateEnd(this.strm); + status = deflate_1$2.deflateEnd(this.strm); this.onEnd(status); this.ended = true; - return status === Z_OK$1; + return status === Z_OK$2; } // Flush if out buffer full @@ -4456,7 +4465,7 @@ **/ - Deflate.prototype.onData = function (chunk) { + Deflate$1.prototype.onData = function (chunk) { this.chunks.push(chunk); }; /** @@ -4470,9 +4479,9 @@ **/ - Deflate.prototype.onEnd = function (status) { + Deflate$1.prototype.onEnd = function (status) { // On success - join - if (status === Z_OK$1) { + if (status === Z_OK$2) { this.result = common.flattenChunks(this.chunks); } @@ -4515,7 +4524,7 @@ function deflate$1(input, options) { - var deflator = new Deflate(options); + var deflator = new Deflate$1(options); deflator.push(input, true); // That will never happens, if you don't cheat with options :) if (deflator.err) { @@ -4534,7 +4543,7 @@ **/ - function deflateRaw(input, options) { + function deflateRaw$1(input, options) { options = options || {}; options.raw = true; return deflate$1(input, options); @@ -4549,22 +4558,22 @@ **/ - function gzip(input, options) { + function gzip$1(input, options) { options = options || {}; options.gzip = true; return deflate$1(input, options); } - var Deflate_1 = Deflate; - var deflate_2$1 = deflate$1; - var deflateRaw_1 = deflateRaw; - var gzip_1 = gzip; - var constants$1 = constants; + var Deflate_1$1 = Deflate$1; + var deflate_2 = deflate$1; + var deflateRaw_1$1 = deflateRaw$1; + var gzip_1$1 = gzip$1; + var constants$1 = constants$2; var deflate_1$1 = { - Deflate: Deflate_1, - deflate: deflate_2$1, - deflateRaw: deflateRaw_1, - gzip: gzip_1, + Deflate: Deflate_1$1, + deflate: deflate_2, + deflateRaw: deflateRaw_1$1, + gzip: gzip_1$1, constants: constants$1 }; @@ -4587,10 +4596,10 @@ // 3. This notice may not be removed or altered from any source distribution. // See state defs from inflate.js - var BAD = 30; + var BAD$1 = 30; /* got a data error -- remain here until reset */ - var TYPE = 12; + var TYPE$1 = 12; /* i: waiting for type bits, including last-flag bit */ /* @@ -4821,7 +4830,7 @@ if (dist > dmax) { strm.msg = 'invalid distance too far back'; - state.mode = BAD; + state.mode = BAD$1; break top; } //#endif @@ -4840,7 +4849,7 @@ if (op > whave) { if (state.sane) { strm.msg = 'invalid distance too far back'; - state.mode = BAD; + state.mode = BAD$1; break top; } // (!) This block is disabled in zlib defaults, // don't enable it for binary compatibility @@ -4972,13 +4981,11 @@ } } else if ((op & 64) === 0) { /* 2nd level distance code */ - here = dcode[(here & 0xffff) + ( - /*here.val*/ - hold & (1 << op) - 1)]; + here = dcode[(here & 0xffff) + (hold & (1 << op) - 1)]; continue dodist; } else { strm.msg = 'invalid distance code'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -4986,18 +4993,16 @@ } } else if ((op & 64) === 0) { /* 2nd level length code */ - here = lcode[(here & 0xffff) + ( - /*here.val*/ - hold & (1 << op) - 1)]; + here = lcode[(here & 0xffff) + (hold & (1 << op) - 1)]; continue dolen; } else if (op & 32) { /* end-of-block */ //Tracevv((stderr, "inflate: end of block\n")); - state.mode = TYPE; + state.mode = TYPE$1; break top; } else { strm.msg = 'invalid literal/length code'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -5041,12 +5046,12 @@ // 3. This notice may not be removed or altered from any source distribution. var MAXBITS = 15; - var ENOUGH_LENS = 852; - var ENOUGH_DISTS = 592; //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + var ENOUGH_LENS$1 = 852; + var ENOUGH_DISTS$1 = 592; //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); - var CODES = 0; - var LENS = 1; - var DISTS = 2; + var CODES$1 = 0; + var LENS$1 = 1; + var DISTS$1 = 2; var lbase = new Uint16Array([ /* Length codes 257..285 base */ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0]); @@ -5213,7 +5218,7 @@ } - if (left > 0 && (type === CODES || max !== 1)) { + if (left > 0 && (type === CODES$1 || max !== 1)) { return -1; /* incomplete set */ } @@ -5265,12 +5270,12 @@ // to avoid deopts in old v8 - if (type === CODES) { + if (type === CODES$1) { base = extra = work; /* dummy value--not used */ end = 19; - } else if (type === LENS) { + } else if (type === LENS$1) { base = lbase; base_index -= 257; extra = lext; @@ -5314,7 +5319,7 @@ /* check available table space */ - if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) { + if (type === LENS$1 && used > ENOUGH_LENS$1 || type === DISTS$1 && used > ENOUGH_DISTS$1) { return 1; } /* process all codes and make table entries */ @@ -5409,7 +5414,7 @@ used += 1 << curr; - if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) { + if (type === LENS$1 && used > ENOUGH_LENS$1 || type === DISTS$1 && used > ENOUGH_DISTS$1) { return 1; } /* point entry in root table to sub-table */ @@ -5463,24 +5468,24 @@ // 3. This notice may not be removed or altered from any source distribution. - var CODES$1 = 0; - var LENS$1 = 1; - var DISTS$1 = 2; + var CODES = 0; + var LENS = 1; + var DISTS = 2; /* Public constants ==========================================================*/ /* ===========================================================================*/ - var Z_FINISH$2 = constants.Z_FINISH, - Z_BLOCK$1 = constants.Z_BLOCK, - Z_TREES = constants.Z_TREES, - Z_OK$2 = constants.Z_OK, - Z_STREAM_END$2 = constants.Z_STREAM_END, - Z_NEED_DICT = constants.Z_NEED_DICT, - Z_STREAM_ERROR$1 = constants.Z_STREAM_ERROR, - Z_DATA_ERROR$1 = constants.Z_DATA_ERROR, - Z_MEM_ERROR = constants.Z_MEM_ERROR, - Z_BUF_ERROR$1 = constants.Z_BUF_ERROR, - Z_DEFLATED$2 = constants.Z_DEFLATED; + var Z_FINISH$1 = constants$2.Z_FINISH, + Z_BLOCK = constants$2.Z_BLOCK, + Z_TREES = constants$2.Z_TREES, + Z_OK$1 = constants$2.Z_OK, + Z_STREAM_END$1 = constants$2.Z_STREAM_END, + Z_NEED_DICT$1 = constants$2.Z_NEED_DICT, + Z_STREAM_ERROR$1 = constants$2.Z_STREAM_ERROR, + Z_DATA_ERROR$1 = constants$2.Z_DATA_ERROR, + Z_MEM_ERROR$1 = constants$2.Z_MEM_ERROR, + Z_BUF_ERROR = constants$2.Z_BUF_ERROR, + Z_DEFLATED = constants$2.Z_DEFLATED; /* STATES ====================================================================*/ /* ===========================================================================*/ @@ -5518,7 +5523,7 @@ var DICT = 11; /* waiting for inflateSetDictionary() call */ - var TYPE$1 = 12; + var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ var TYPEDO = 13; @@ -5572,7 +5577,7 @@ var DONE = 29; /* finished check, done -- remain here until reset */ - var BAD$1 = 30; + var BAD = 30; /* got a data error -- remain here until reset */ var MEM = 31; @@ -5583,13 +5588,13 @@ /* ===========================================================================*/ - var ENOUGH_LENS$1 = 852; - var ENOUGH_DISTS$1 = 592; //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + var ENOUGH_LENS = 852; + var ENOUGH_DISTS = 592; //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); - var MAX_WBITS$1 = 15; + var MAX_WBITS = 15; /* 32K LZ77 window */ - var DEF_WBITS = MAX_WBITS$1; + var DEF_WBITS = MAX_WBITS; var zswap32 = function zswap32(q) { return (q >>> 24 & 0xff) + (q >>> 8 & 0xff00) + ((q & 0xff00) << 8) + ((q & 0xff) << 24); @@ -5746,12 +5751,12 @@ state.hold = 0; state.bits = 0; //state.lencode = state.distcode = state.next = state.codes; - state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS$1); - state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS$1); + state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS); + state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS); state.sane = 1; state.back = -1; //Tracev((stderr, "inflate: reset\n")); - return Z_OK$2; + return Z_OK$1; }; var inflateReset = function inflateReset(strm) { @@ -5820,7 +5825,7 @@ ; var ret = inflateReset2(strm, windowBits); - if (ret !== Z_OK$2) { + if (ret !== Z_OK$1) { strm.state = null /*Z_NULL*/ ; @@ -5872,7 +5877,7 @@ state.lens[sym++] = 8; } - inftrees(LENS$1, state.lens, 0, 288, lenfix, 0, state.work, { + inftrees(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); /* distance table */ @@ -5883,7 +5888,7 @@ state.lens[sym++] = 5; } - inftrees(DISTS$1, state.lens, 0, 32, distfix, 0, state.work, { + inftrees(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); /* do this just once */ @@ -5962,7 +5967,7 @@ return 0; }; - var inflate = function inflate(strm, flush) { + var inflate$2 = function inflate(strm, flush) { var state; var input, output; // input/output buffers @@ -6022,7 +6027,7 @@ state = strm.state; - if (state.mode === TYPE$1) { + if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ @@ -6040,7 +6045,7 @@ _in = have; _out = left; - ret = Z_OK$2; + ret = Z_OK$1; inf_leave: // goto emulation for (;;) { @@ -6090,19 +6095,15 @@ if (!(state.wrap & 1) || /* check if zlib header allowed */ - (((hold & 0xff) << - /*BITS(8)*/ - 8) + (hold >> 8)) % 31) { + (((hold & 0xff) << 8) + (hold >> 8)) % 31) { strm.msg = 'incorrect header check'; - state.mode = BAD$1; + state.mode = BAD; break; } - if ((hold & 0x0f) !== - /*BITS(4)*/ - Z_DEFLATED$2) { + if ((hold & 0x0f) !== Z_DEFLATED) { strm.msg = 'unknown compression method'; - state.mode = BAD$1; + state.mode = BAD; break; } //--- DROPBITS(4) ---// @@ -6110,15 +6111,13 @@ hold >>>= 4; bits -= 4; //---// - len = (hold & 0x0f) + - /*BITS(4)*/ - 8; + len = (hold & 0x0f) + 8; if (state.wbits === 0) { state.wbits = len; } else if (len > state.wbits) { strm.msg = 'invalid window size'; - state.mode = BAD$1; + state.mode = BAD; break; } // !!! pako patch. Force use `options.windowBits` if passed. // Required to always use max window size by default. @@ -6130,7 +6129,7 @@ strm.adler = state.check = 1 /*adler32(0L, Z_NULL, 0)*/ ; - state.mode = hold & 0x200 ? DICTID : TYPE$1; //=== INITBITS(); + state.mode = hold & 0x200 ? DICTID : TYPE; //=== INITBITS(); hold = 0; bits = 0; //===// @@ -6152,15 +6151,15 @@ state.flags = hold; - if ((state.flags & 0xff) !== Z_DEFLATED$2) { + if ((state.flags & 0xff) !== Z_DEFLATED) { strm.msg = 'unknown compression method'; - state.mode = BAD$1; + state.mode = BAD; break; } if (state.flags & 0xe000) { strm.msg = 'unknown header flags set'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -6427,7 +6426,7 @@ if (hold !== (state.check & 0xffff)) { strm.msg = 'header crc mismatch'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -6442,7 +6441,7 @@ } strm.adler = state.check = 0; - state.mode = TYPE$1; + state.mode = TYPE; break; case DICTID: @@ -6477,18 +6476,18 @@ state.hold = hold; state.bits = bits; //--- - return Z_NEED_DICT; + return Z_NEED_DICT$1; } strm.adler = state.check = 1 /*adler32(0L, Z_NULL, 0)*/ ; - state.mode = TYPE$1; + state.mode = TYPE; /* falls through */ - case TYPE$1: - if (flush === Z_BLOCK$1 || flush === Z_TREES) { + case TYPE: + if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } @@ -6524,7 +6523,6 @@ bits -= 1; //---// switch (hold & 0x03) { - /*BITS(2)*/ case 0: /* stored block */ //Tracev((stderr, "inflate: stored block%s\n", @@ -6559,7 +6557,7 @@ case 3: strm.msg = 'invalid block type'; - state.mode = BAD$1; + state.mode = BAD; } //--- DROPBITS(2) ---// @@ -6587,7 +6585,7 @@ if ((hold & 0xffff) !== (hold >>> 16 ^ 0xffff)) { strm.msg = 'invalid stored block lengths'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -6639,7 +6637,7 @@ } //Tracev((stderr, "inflate: stored end\n")); - state.mode = TYPE$1; + state.mode = TYPE; break; case TABLE: @@ -6655,23 +6653,17 @@ } //===// - state.nlen = (hold & 0x1f) + - /*BITS(5)*/ - 257; //--- DROPBITS(5) ---// + state.nlen = (hold & 0x1f) + 257; //--- DROPBITS(5) ---// hold >>>= 5; bits -= 5; //---// - state.ndist = (hold & 0x1f) + - /*BITS(5)*/ - 1; //--- DROPBITS(5) ---// + state.ndist = (hold & 0x1f) + 1; //--- DROPBITS(5) ---// hold >>>= 5; bits -= 5; //---// - state.ncode = (hold & 0x0f) + - /*BITS(4)*/ - 4; //--- DROPBITS(4) ---// + state.ncode = (hold & 0x0f) + 4; //--- DROPBITS(4) ---// hold >>>= 4; bits -= 4; //---// @@ -6679,7 +6671,7 @@ if (state.nlen > 286 || state.ndist > 30) { strm.msg = 'too many length or distance symbols'; - state.mode = BAD$1; + state.mode = BAD; break; } //#endif //Tracev((stderr, "inflate: table sizes ok\n")); @@ -6724,12 +6716,12 @@ opts = { bits: state.lenbits }; - ret = inftrees(CODES$1, state.lens, 0, 19, state.lencode, 0, state.work, opts); + ret = inftrees(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); state.lenbits = opts.bits; if (ret) { strm.msg = 'invalid code lengths set'; - state.mode = BAD$1; + state.mode = BAD; break; } //Tracev((stderr, "inflate: code lengths ok\n")); @@ -6791,7 +6783,7 @@ if (state.have === 0) { strm.msg = 'invalid bit length repeat'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -6855,7 +6847,7 @@ if (state.have + copy > state.nlen + state.ndist) { strm.msg = 'invalid bit length repeat'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -6867,7 +6859,7 @@ /* handle error breaks in while */ - if (state.mode === BAD$1) { + if (state.mode === BAD) { break; } /* check for end-of-block code (better have one) */ @@ -6875,7 +6867,7 @@ if (state.lens[256] === 0) { strm.msg = 'invalid code -- missing end-of-block'; - state.mode = BAD$1; + state.mode = BAD; break; } /* build code tables -- note: do not change the lenbits or distbits @@ -6887,14 +6879,14 @@ opts = { bits: state.lenbits }; - ret = inftrees(LENS$1, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. + ret = inftrees(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. // state.next_index = opts.table_index; state.lenbits = opts.bits; // state.lencode = state.next; if (ret) { strm.msg = 'invalid literal/lengths set'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -6905,14 +6897,14 @@ opts = { bits: state.distbits }; - ret = inftrees(DISTS$1, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. + ret = inftrees(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. // state.next_index = opts.table_index; state.distbits = opts.bits; // state.distcode = state.next; if (ret) { strm.msg = 'invalid distances set'; - state.mode = BAD$1; + state.mode = BAD; break; } //Tracev((stderr, 'inflate: codes ok\n')); @@ -6951,7 +6943,7 @@ hold = state.hold; bits = state.bits; //--- - if (state.mode === TYPE$1) { + if (state.mode === TYPE) { state.back = -1; } @@ -6988,9 +6980,7 @@ last_val = here_val; for (;;) { - here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> - /*BITS(last.bits + last.op)*/ - last_bits)]; + here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; here_bits = here >>> 24; here_op = here >>> 16 & 0xff; here_val = here & 0xffff; @@ -7034,13 +7024,13 @@ if (here_op & 32) { //Tracevv((stderr, "inflate: end of block\n")); state.back = -1; - state.mode = TYPE$1; + state.mode = TYPE; break; } if (here_op & 64) { strm.msg = 'invalid literal/length code'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -7110,9 +7100,7 @@ last_val = here_val; for (;;) { - here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> - /*BITS(last.bits + last.op)*/ - last_bits)]; + here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; here_bits = here >>> 24; here_op = here >>> 16 & 0xff; here_val = here & 0xffff; @@ -7146,7 +7134,7 @@ if (here_op & 64) { strm.msg = 'invalid distance code'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -7185,7 +7173,7 @@ if (state.offset > state.dmax) { strm.msg = 'invalid distance too far back'; - state.mode = BAD$1; + state.mode = BAD; break; } //#endif //Tracevv((stderr, "inflate: distance %u\n", state.offset)); @@ -7209,7 +7197,7 @@ if (copy > state.whave) { if (state.sane) { strm.msg = 'invalid distance too far back'; - state.mode = BAD$1; + state.mode = BAD; break; } // (!) This block is disabled in zlib defaults, // don't enable it for binary compatibility @@ -7295,16 +7283,14 @@ state.total += _out; if (_out) { - strm.adler = state.check = - /*UPDATE(state.check, put - _out, _out);*/ - state.flags ? crc32_1(state.check, output, _out, put - _out) : adler32_1(state.check, output, _out, put - _out); + strm.adler = state.check = state.flags ? crc32_1(state.check, output, _out, put - _out) : adler32_1(state.check, output, _out, put - _out); } _out = left; // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too if ((state.flags ? hold : zswap32(hold)) !== state.check) { strm.msg = 'incorrect data check'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -7334,7 +7320,7 @@ if (hold !== (state.total & 0xffffffff)) { strm.msg = 'incorrect length check'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -7349,15 +7335,15 @@ /* falls through */ case DONE: - ret = Z_STREAM_END$2; + ret = Z_STREAM_END$1; break inf_leave; - case BAD$1: + case BAD: ret = Z_DATA_ERROR$1; break inf_leave; case MEM: - return Z_MEM_ERROR; + return Z_MEM_ERROR$1; case SYNC: /* falls through */ @@ -7383,7 +7369,7 @@ state.hold = hold; state.bits = bits; //--- - if (state.wsize || _out !== strm.avail_out && state.mode < BAD$1 && (state.mode < CHECK || flush !== Z_FINISH$2)) { + if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH$1)) { if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) ; } @@ -7394,15 +7380,13 @@ state.total += _out; if (state.wrap && _out) { - strm.adler = state.check = - /*UPDATE(state.check, strm.next_out - _out, _out);*/ - state.flags ? crc32_1(state.check, output, _out, strm.next_out - _out) : adler32_1(state.check, output, _out, strm.next_out - _out); + strm.adler = state.check = state.flags ? crc32_1(state.check, output, _out, strm.next_out - _out) : adler32_1(state.check, output, _out, strm.next_out - _out); } - strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE$1 ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); + strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); - if ((_in === 0 && _out === 0 || flush === Z_FINISH$2) && ret === Z_OK$2) { - ret = Z_BUF_ERROR$1; + if ((_in === 0 && _out === 0 || flush === Z_FINISH$1) && ret === Z_OK$1) { + ret = Z_BUF_ERROR; } return ret; @@ -7412,8 +7396,8 @@ if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/ ) { - return Z_STREAM_ERROR$1; - } + return Z_STREAM_ERROR$1; + } var state = strm.state; @@ -7422,7 +7406,7 @@ } strm.state = null; - return Z_OK$2; + return Z_OK$1; }; var inflateGetHeader = function inflateGetHeader(strm, head) { @@ -7441,7 +7425,7 @@ state.head = head; head.done = false; - return Z_OK$2; + return Z_OK$1; }; var inflateSetDictionary = function inflateSetDictionary(strm, dictionary) { @@ -7456,8 +7440,8 @@ || !strm.state /* == Z_NULL */ ) { - return Z_STREAM_ERROR$1; - } + return Z_STREAM_ERROR$1; + } state = strm.state; @@ -7487,12 +7471,12 @@ if (ret) { state.mode = MEM; - return Z_MEM_ERROR; + return Z_MEM_ERROR$1; } state.havedict = 1; // Tracev((stderr, "inflate: dictionary set\n")); - return Z_OK$2; + return Z_OK$1; }; var inflateReset_1 = inflateReset; @@ -7500,7 +7484,7 @@ var inflateResetKeep_1 = inflateResetKeep; var inflateInit_1 = inflateInit; var inflateInit2_1 = inflateInit2; - var inflate_2 = inflate; + var inflate_2$1 = inflate$2; var inflateEnd_1 = inflateEnd; var inflateGetHeader_1 = inflateGetHeader; var inflateSetDictionary_1 = inflateSetDictionary; @@ -7515,13 +7499,13 @@ module.exports.inflateUndermine = inflateUndermine; */ - var inflate_1 = { + var inflate_1$2 = { inflateReset: inflateReset_1, inflateReset2: inflateReset2_1, inflateResetKeep: inflateResetKeep_1, inflateInit: inflateInit_1, inflateInit2: inflateInit2_1, - inflate: inflate_2, + inflate: inflate_2$1, inflateEnd: inflateEnd_1, inflateGetHeader: inflateGetHeader_1, inflateSetDictionary: inflateSetDictionary_1, @@ -7595,19 +7579,19 @@ var gzheader = GZheader; - var toString$1 = Object.prototype.toString; + var toString = Object.prototype.toString; /* Public constants ==========================================================*/ /* ===========================================================================*/ - var Z_NO_FLUSH$2 = constants.Z_NO_FLUSH, - Z_FINISH$3 = constants.Z_FINISH, - Z_OK$3 = constants.Z_OK, - Z_STREAM_END$3 = constants.Z_STREAM_END, - Z_NEED_DICT$1 = constants.Z_NEED_DICT, - Z_STREAM_ERROR$2 = constants.Z_STREAM_ERROR, - Z_DATA_ERROR$2 = constants.Z_DATA_ERROR, - Z_MEM_ERROR$1 = constants.Z_MEM_ERROR; + var Z_NO_FLUSH = constants$2.Z_NO_FLUSH, + Z_FINISH = constants$2.Z_FINISH, + Z_OK = constants$2.Z_OK, + Z_STREAM_END = constants$2.Z_STREAM_END, + Z_NEED_DICT = constants$2.Z_NEED_DICT, + Z_STREAM_ERROR = constants$2.Z_STREAM_ERROR, + Z_DATA_ERROR = constants$2.Z_DATA_ERROR, + Z_MEM_ERROR = constants$2.Z_MEM_ERROR; /* ===========================================================================*/ /** @@ -7687,7 +7671,7 @@ * ``` **/ - function Inflate(options) { + function Inflate$1(options) { this.options = common.assign({ chunkSize: 1024 * 64, windowBits: 15, @@ -7729,28 +7713,28 @@ this.strm = new zstream(); this.strm.avail_out = 0; - var status = inflate_1.inflateInit2(this.strm, opt.windowBits); + var status = inflate_1$2.inflateInit2(this.strm, opt.windowBits); - if (status !== Z_OK$3) { + if (status !== Z_OK) { throw new Error(messages[status]); } this.header = new gzheader(); - inflate_1.inflateGetHeader(this.strm, this.header); // Setup dictionary + inflate_1$2.inflateGetHeader(this.strm, this.header); // Setup dictionary if (opt.dictionary) { // Convert data if needed if (typeof opt.dictionary === 'string') { opt.dictionary = strings.string2buf(opt.dictionary); - } else if (toString$1.call(opt.dictionary) === '[object ArrayBuffer]') { + } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { opt.dictionary = new Uint8Array(opt.dictionary); } if (opt.raw) { //In raw mode we need to set the dictionary early - status = inflate_1.inflateSetDictionary(this.strm, opt.dictionary); + status = inflate_1$2.inflateSetDictionary(this.strm, opt.dictionary); - if (status !== Z_OK$3) { + if (status !== Z_OK) { throw new Error(messages[status]); } } @@ -7783,7 +7767,7 @@ **/ - Inflate.prototype.push = function (data, flush_mode) { + Inflate$1.prototype.push = function (data, flush_mode) { var strm = this.strm; var chunkSize = this.options.chunkSize; var dictionary = this.options.dictionary; @@ -7791,9 +7775,9 @@ var status, _flush_mode, last_avail_out; if (this.ended) return false; - if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;else _flush_mode = flush_mode === true ? Z_FINISH$3 : Z_NO_FLUSH$2; // Convert data if needed + if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH; // Convert data if needed - if (toString$1.call(data) === '[object ArrayBuffer]') { + if (toString.call(data) === '[object ArrayBuffer]') { strm.input = new Uint8Array(data); } else { strm.input = data; @@ -7809,30 +7793,30 @@ strm.avail_out = chunkSize; } - status = inflate_1.inflate(strm, _flush_mode); + status = inflate_1$2.inflate(strm, _flush_mode); - if (status === Z_NEED_DICT$1 && dictionary) { - status = inflate_1.inflateSetDictionary(strm, dictionary); + if (status === Z_NEED_DICT && dictionary) { + status = inflate_1$2.inflateSetDictionary(strm, dictionary); - if (status === Z_OK$3) { - status = inflate_1.inflate(strm, _flush_mode); - } else if (status === Z_DATA_ERROR$2) { + if (status === Z_OK) { + status = inflate_1$2.inflate(strm, _flush_mode); + } else if (status === Z_DATA_ERROR) { // Replace code with more verbose - status = Z_NEED_DICT$1; + status = Z_NEED_DICT; } } // Skip snyc markers if more data follows and not raw mode - while (strm.avail_in > 0 && status === Z_STREAM_END$3 && strm.state.wrap > 0 && data[strm.next_in] !== 0) { - inflate_1.inflateReset(strm); - status = inflate_1.inflate(strm, _flush_mode); + while (strm.avail_in > 0 && status === Z_STREAM_END && strm.state.wrap > 0 && data[strm.next_in] !== 0) { + inflate_1$2.inflateReset(strm); + status = inflate_1$2.inflate(strm, _flush_mode); } switch (status) { - case Z_STREAM_ERROR$2: - case Z_DATA_ERROR$2: - case Z_NEED_DICT$1: - case Z_MEM_ERROR$1: + case Z_STREAM_ERROR: + case Z_DATA_ERROR: + case Z_NEED_DICT: + case Z_MEM_ERROR: this.onEnd(status); this.ended = true; return false; @@ -7843,7 +7827,7 @@ last_avail_out = strm.avail_out; if (strm.next_out) { - if (strm.avail_out === 0 || status === Z_STREAM_END$3) { + if (strm.avail_out === 0 || status === Z_STREAM_END) { if (this.options.to === 'string') { var next_out_utf8 = strings.utf8border(strm.output, strm.next_out); var tail = strm.next_out - next_out_utf8; @@ -7860,10 +7844,10 @@ } // Must repeat iteration if out buffer is full - if (status === Z_OK$3 && last_avail_out === 0) continue; // Finalize if end of stream reached. + if (status === Z_OK && last_avail_out === 0) continue; // Finalize if end of stream reached. - if (status === Z_STREAM_END$3) { - status = inflate_1.inflateEnd(this.strm); + if (status === Z_STREAM_END) { + status = inflate_1$2.inflateEnd(this.strm); this.onEnd(status); this.ended = true; return true; @@ -7884,7 +7868,7 @@ **/ - Inflate.prototype.onData = function (chunk) { + Inflate$1.prototype.onData = function (chunk) { this.chunks.push(chunk); }; /** @@ -7898,9 +7882,9 @@ **/ - Inflate.prototype.onEnd = function (status) { + Inflate$1.prototype.onEnd = function (status) { // On success - join - if (status === Z_OK$3) { + if (status === Z_OK) { if (this.options.to === 'string') { this.result = this.chunks.join(''); } else { @@ -7946,7 +7930,7 @@ * * try { * output = pako.inflate(input); - * } catch (err) + * } catch (err) { * console.log(err); * } * ``` @@ -7954,7 +7938,7 @@ function inflate$1(input, options) { - var inflator = new Inflate(options); + var inflator = new Inflate$1(options); inflator.push(input); // That will never happens, if you don't cheat with options :) if (inflator.err) throw inflator.msg || messages[inflator.err]; @@ -7970,7 +7954,7 @@ **/ - function inflateRaw(input, options) { + function inflateRaw$1(input, options) { options = options || {}; options.raw = true; return inflate$1(input, options); @@ -7985,57 +7969,57 @@ **/ - var Inflate_1 = Inflate; - var inflate_2$1 = inflate$1; - var inflateRaw_1 = inflateRaw; - var ungzip = inflate$1; - var constants$2 = constants; + var Inflate_1$1 = Inflate$1; + var inflate_2 = inflate$1; + var inflateRaw_1$1 = inflateRaw$1; + var ungzip$1 = inflate$1; + var constants = constants$2; var inflate_1$1 = { - Inflate: Inflate_1, - inflate: inflate_2$1, - inflateRaw: inflateRaw_1, - ungzip: ungzip, - constants: constants$2 + Inflate: Inflate_1$1, + inflate: inflate_2, + inflateRaw: inflateRaw_1$1, + ungzip: ungzip$1, + constants: constants }; - var Deflate$1 = deflate_1$1.Deflate, - deflate$2 = deflate_1$1.deflate, - deflateRaw$1 = deflate_1$1.deflateRaw, - gzip$1 = deflate_1$1.gzip; - var Inflate$1 = inflate_1$1.Inflate, - inflate$2 = inflate_1$1.inflate, - inflateRaw$1 = inflate_1$1.inflateRaw, - ungzip$1 = inflate_1$1.ungzip; - var Deflate_1$1 = Deflate$1; - var deflate_1$2 = deflate$2; - var deflateRaw_1$1 = deflateRaw$1; - var gzip_1$1 = gzip$1; - var Inflate_1$1 = Inflate$1; - var inflate_1$2 = inflate$2; - var inflateRaw_1$1 = inflateRaw$1; - var ungzip_1 = ungzip$1; - var constants_1 = constants; + var Deflate = deflate_1$1.Deflate, + deflate = deflate_1$1.deflate, + deflateRaw = deflate_1$1.deflateRaw, + gzip = deflate_1$1.gzip; + var Inflate = inflate_1$1.Inflate, + inflate = inflate_1$1.inflate, + inflateRaw = inflate_1$1.inflateRaw, + ungzip = inflate_1$1.ungzip; + var Deflate_1 = Deflate; + var deflate_1 = deflate; + var deflateRaw_1 = deflateRaw; + var gzip_1 = gzip; + var Inflate_1 = Inflate; + var inflate_1 = inflate; + var inflateRaw_1 = inflateRaw; + var ungzip_1 = ungzip; + var constants_1 = constants$2; var pako = { - Deflate: Deflate_1$1, - deflate: deflate_1$2, - deflateRaw: deflateRaw_1$1, - gzip: gzip_1$1, - Inflate: Inflate_1$1, - inflate: inflate_1$2, - inflateRaw: inflateRaw_1$1, + Deflate: Deflate_1, + deflate: deflate_1, + deflateRaw: deflateRaw_1, + gzip: gzip_1, + Inflate: Inflate_1, + inflate: inflate_1, + inflateRaw: inflateRaw_1, ungzip: ungzip_1, constants: constants_1 }; - exports.Deflate = Deflate_1$1; - exports.Inflate = Inflate_1$1; + exports.Deflate = Deflate_1; + exports.Inflate = Inflate_1; exports.constants = constants_1; - exports.default = pako; - exports.deflate = deflate_1$2; - exports.deflateRaw = deflateRaw_1$1; - exports.gzip = gzip_1$1; - exports.inflate = inflate_1$2; - exports.inflateRaw = inflateRaw_1$1; + exports['default'] = pako; + exports.deflate = deflate_1; + exports.deflateRaw = deflateRaw_1; + exports.gzip = gzip_1; + exports.inflate = inflate_1; + exports.inflateRaw = inflateRaw_1; exports.ungzip = ungzip_1; Object.defineProperty(exports, '__esModule', { value: true }); diff --git a/dist/pako.es5.min.js b/dist/pako.es5.min.js index a339688..1bfd2df 100644 --- a/dist/pako.es5.min.js +++ b/dist/pako.es5.min.js @@ -1,2 +1,2 @@ -/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).pako={})}(this,(function(t){"use strict";function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,i=286,n=30,r=15,s=new Uint8Array([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]),o=new Uint8Array([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]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=new Array(576);e(d);var _=new Array(60);e(_);var f=new Array(512);e(f);var u=new Array(256);e(u);var c=new Array(29);e(c);var w,b,g,p=new Array(n);function m(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function v(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(p);var k=function(t){return t<256?f[t]:f[256+(t>>>7)]},y=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<>>=1,a<<=1}while(--e>0);return a>>>1},E=function(t,e,a){var i,n,s=new Array(16),o=0;for(i=1;i<=r;i++)s[i]=o=o+a[i-1]<<1;for(n=0;n<=e;n++){var l=t[2*n+1];0!==l&&(t[2*n]=A(s[l]++,l))}},R=function(t){var e;for(e=0;e8?y(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},S=function(t,e,a,i){var n=2*e,r=2*a;return t[n]>1;a>=1;a--)U(t,s,a);n=h;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,s,1),i=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=i,s[2*n]=s[2*a]+s[2*i],t.depth[n]=(t.depth[a]>=t.depth[i]?t.depth[a]:t.depth[i])+1,s[2*a+1]=s[2*i+1]=n,t.heap[1]=n++,U(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,i,n,s,o,l,h=e.dyn_tree,d=e.max_code,_=e.stat_desc.static_tree,f=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,w=e.stat_desc.max_length,b=0;for(s=0;s<=r;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=h[2*h[2*(i=t.heap[a])+1]+1]+1)>w&&(s=w,b++),h[2*i+1]=s,i>d||(t.bl_count[s]++,o=0,i>=c&&(o=u[i-c]),l=h[2*i],t.opt_len+=l*(s+o),f&&(t.static_len+=l*(_[2*i+1]+o)));if(0!==b){do{for(s=w-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[w]--,b-=2}while(b>0);for(s=w;0!==s;s--)for(i=t.bl_count[s];0!==i;)(n=t.heap[--a])>d||(h[2*n+1]!==s&&(t.opt_len+=(s-h[2*n+1])*h[2*n],h[2*n+1]=s),i--)}}(t,e),E(s,d,t.bl_count)},T=function(t,e,a){var i,n,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=s,s=e[2*(i+1)+1],++o>=7;h0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=r&&(r=s)):r=s=i+5,i+4<=r&&-1!==e?L(t,e,i,n):4===t.strategy||s===r?(x(t,2+(n?1:0),3),D(t,d,_)):(x(t,4+(n?1:0),3),function(t,e,a,i){var n;for(x(t,e-257,5),x(t,a-1,5),x(t,i-4,4),n=0;n>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(u[i]+a+1)]++,t.dyn_dtree[2*k(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){x(t,2,3),z(t,256,d),function(t){16===t.bi_valid?(y(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},B=function(t,e,a,i){for(var n=65535&t|0,r=t>>>16&65535|0,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{r=r+(n=n+e[i++]|0)|0}while(--s);n%=65521,r%=65521}return n|r<<16|0},C=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),M=function(t,e,a,i){var n=C,r=i+a;t^=-1;for(var s=i;s>>8^n[255&(t^e[s])];return-1^t},H={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},K=N._tr_init,P=N._tr_stored_block,Y=N._tr_flush_block,G=N._tr_tally,X=N._tr_align,W=j.Z_NO_FLUSH,q=j.Z_PARTIAL_FLUSH,J=j.Z_FULL_FLUSH,Q=j.Z_FINISH,V=j.Z_BLOCK,$=j.Z_OK,tt=j.Z_STREAM_END,et=j.Z_STREAM_ERROR,at=j.Z_DATA_ERROR,it=j.Z_BUF_ERROR,nt=j.Z_DEFAULT_COMPRESSION,rt=j.Z_FILTERED,st=j.Z_HUFFMAN_ONLY,ot=j.Z_RLE,lt=j.Z_FIXED,ht=j.Z_DEFAULT_STRATEGY,dt=j.Z_UNKNOWN,_t=j.Z_DEFLATED,ft=258,ut=262,ct=103,wt=113,bt=666,gt=function(t,e){return t.msg=H[e],e},pt=function(t){return(t<<1)-(t>4?9:0)},mt=function(t){for(var e=t.length;--e>=0;)t[e]=0},vt=function(t,e,a){return(e<t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},yt=function(t,e){Y(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,kt(t.strm)},xt=function(t,e){t.pending_buf[t.pending++]=e},zt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},At=function(t,e){var a,i,n=t.max_chain_length,r=t.strstart,s=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-ut?t.strstart-(t.w_size-ut):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+ft,u=h[r+s-1],c=h[r+s];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(h[(a=e)+s]===c&&h[a+s-1]===u&&h[a]===h[r]&&h[++a]===h[r+1]){r+=2,a++;do{}while(h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&rs){if(t.match_start=e,s=i,i>=o)break;u=h[r+s-1],c=h[r+s]}}}while((e=_[e&d])>l&&0!=--n);return s<=t.lookahead?s:t.lookahead},Et=function(t){var e,a,i,n,r,s,o,l,h,d,_=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=_+(_-ut)){t.window.set(t.window.subarray(_,_+_),0),t.match_start-=_,t.strstart-=_,t.block_start-=_,e=a=t.hash_size;do{i=t.head[--e],t.head[e]=i>=_?i-_:0}while(--a);e=a=_;do{i=t.prev[--e],t.prev[e]=i>=_?i-_:0}while(--a);n+=_}if(0===t.strm.avail_in)break;if(s=t.strm,o=t.window,l=t.strstart+t.lookahead,h=n,d=void 0,(d=s.avail_in)>h&&(d=h),a=0===d?0:(s.avail_in-=d,o.set(s.input.subarray(s.next_in,s.next_in+d),l),1===s.state.wrap?s.adler=B(s.adler,o,d,l):2===s.state.wrap&&(s.adler=M(s.adler,o,d,l)),s.next_in+=d,s.total_in+=d,d),t.lookahead+=a,t.lookahead+t.insert>=3)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=vt(t,t.ins_h,t.window[r+1]);t.insert&&(t.ins_h=vt(t,t.ins_h,t.window[r+3-1]),t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead=3&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ut&&(t.match_length=At(t,a)),t.match_length>=3)if(i=G(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=vt(t,t.ins_h,t.window[t.strstart+1]);else i=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2},Zt=function(t,e){for(var a,i,n;;){if(t.lookahead=3&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=G(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(yt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((i=G(t,0,t.window[t.strstart-1]))&&yt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=G(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2};function St(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}var Ut=[new St(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Et(t),0===t.lookahead&&e===W)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+a;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,yt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-ut&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(yt(t,!1),t.strm.avail_out),1)})),new St(4,4,8,4,Rt),new St(4,5,16,8,Rt),new St(4,6,32,32,Rt),new St(4,4,16,16,Zt),new St(8,16,32,32,Zt),new St(8,16,128,128,Zt),new St(8,32,128,256,Zt),new St(32,128,258,1024,Zt),new St(32,258,258,4096,Zt)];function Dt(){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=_t,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 Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),mt(this.dyn_ltree),mt(this.dyn_dtree),mt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),mt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),mt(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}var Ot=function(t){if(!t||!t.state)return gt(t,et);t.total_in=t.total_out=0,t.data_type=dt;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:wt,t.adler=2===e.wrap?0:1,e.last_flush=W,K(e),$},Tt=function(t){var e,a=Ot(t);return a===$&&((e=t.state).window_size=2*e.w_size,mt(e.head),e.max_lazy_match=Ut[e.level].max_lazy,e.good_match=Ut[e.level].good_length,e.nice_match=Ut[e.level].nice_length,e.max_chain_length=Ut[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},It=function(t,e,a,i,n,r){if(!t)return et;var s=1;if(e===nt&&(e=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),n<1||n>9||a!==_t||i<8||i>15||e<0||e>9||r<0||r>lt)return gt(t,et);8===i&&(i=9);var o=new Dt;return t.state=o,o.strm=t,o.wrap=s,o.gzhead=null,o.w_bits=i,o.w_size=1<V||e<0)return t?gt(t,et):et;var n=t.state;if(!t.output||!t.input&&0!==t.avail_in||n.status===bt&&e!==Q)return gt(t,0===t.avail_out?it:et);n.strm=t;var r=n.last_flush;if(n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,xt(n,31),xt(n,139),xt(n,8),n.gzhead?(xt(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),xt(n,255&n.gzhead.time),xt(n,n.gzhead.time>>8&255),xt(n,n.gzhead.time>>16&255),xt(n,n.gzhead.time>>24&255),xt(n,9===n.level?2:n.strategy>=st||n.level<2?4:0),xt(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(xt(n,255&n.gzhead.extra.length),xt(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=M(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,9===n.level?2:n.strategy>=st||n.level<2?4:0),xt(n,3),n.status=wt);else{var s=_t+(n.w_bits-8<<4)<<8;s|=(n.strategy>=st||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(s|=32),s+=31-s%31,n.status=wt,zt(n,s),0!==n.strstart&&(zt(n,t.adler>>>16),zt(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(a=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),kt(t),a=n.pending,n.pending!==n.pending_buf_size));)xt(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),kt(t),a=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexa&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),0===i&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),kt(t),a=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexa&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),0===i&&(n.status=ct)}else n.status=ct;if(n.status===ct&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&kt(t),n.pending+2<=n.pending_buf_size&&(xt(n,255&t.adler),xt(n,t.adler>>8&255),t.adler=0,n.status=wt)):n.status=wt),0!==n.pending){if(kt(t),0===t.avail_out)return n.last_flush=-1,$}else if(0===t.avail_in&&pt(e)<=pt(r)&&e!==Q)return gt(t,it);if(n.status===bt&&0!==t.avail_in)return gt(t,it);if(0!==t.avail_in||0!==n.lookahead||e!==W&&n.status!==bt){var o=n.strategy===st?function(t,e){for(var a;;){if(0===t.lookahead&&(Et(t),0===t.lookahead)){if(e===W)return 1;break}if(t.match_length=0,a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2}(n,e):n.strategy===ot?function(t,e){for(var a,i,n,r,s=t.window;;){if(t.lookahead<=ft){if(Et(t),t.lookahead<=ft&&e===W)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=s[n=t.strstart-1])===s[++n]&&i===s[++n]&&i===s[++n]){r=t.strstart+ft;do{}while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=G(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2}(n,e):Ut[n.level].func(n,e);if(3!==o&&4!==o||(n.status=bt),1===o||3===o)return 0===t.avail_out&&(n.last_flush=-1),$;if(2===o&&(e===q?X(n):e!==V&&(P(n,0,0,!1),e===J&&(mt(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),kt(t),0===t.avail_out))return n.last_flush=-1,$}return e!==Q?$:n.wrap<=0?tt:(2===n.wrap?(xt(n,255&t.adler),xt(n,t.adler>>8&255),xt(n,t.adler>>16&255),xt(n,t.adler>>24&255),xt(n,255&t.total_in),xt(n,t.total_in>>8&255),xt(n,t.total_in>>16&255),xt(n,t.total_in>>24&255)):(zt(n,t.adler>>>16),zt(n,65535&t.adler)),kt(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?$:tt)},deflateEnd:function(t){if(!t||!t.state)return et;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==ct&&e!==wt&&e!==bt?gt(t,et):(t.state=null,e===wt?gt(t,at):$)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return et;var i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return et;if(1===n&&(t.adler=B(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(mt(i.head),i.strstart=0,i.block_start=0,i.insert=0);var r=new Uint8Array(i.w_size);r.set(e.subarray(a-i.w_size,a),0),e=r,a=i.w_size}var s=t.avail_in,o=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Et(i);i.lookahead>=3;){var h=i.strstart,d=i.lookahead-2;do{i.ins_h=vt(i,i.ins_h,i.window[h+3-1]),i.prev[h&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=h,h++}while(--d);i.strstart=h,i.lookahead=2,Et(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=o,t.input=l,t.avail_in=s,i.wrap=n,$},deflateInfo:"pako deflate (from Nodeca project)"};function Lt(t){return(Lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Nt=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},Bt=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var a=e.shift();if(a){if("object"!==Lt(a))throw new TypeError(a+"must be non-object");for(var i in a)Nt(a,i)&&(t[i]=a[i])}}return t},Ct=function(t){for(var e=0,a=0,i=t.length;a=252?6:jt>=248?5:jt>=240?4:jt>=224?3:jt>=192?2:1;Ht[254]=Ht[254]=1;var Kt=function(t){var e,a,i,n,r,s=t.length,o=0;for(n=0;n>>6,e[r++]=128|63&a):a<65536?(e[r++]=224|a>>>12,e[r++]=128|a>>>6&63,e[r++]=128|63&a):(e[r++]=240|a>>>18,e[r++]=128|a>>>12&63,e[r++]=128|a>>>6&63,e[r++]=128|63&a);return e},Pt=function(t,e){var a,i,n=e||t.length,r=new Array(2*n);for(i=0,a=0;a4)r[i++]=65533,a+=o-1;else{for(s&=2===o?31:3===o?15:7;o>1&&a1?r[i++]=65533:s<65536?r[i++]=s:(s-=65536,r[i++]=55296|s>>10&1023,r[i++]=56320|1023&s)}}}return function(t,e){if(e<65534&&t.subarray&&Mt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));for(var a="",i=0;it.length&&(e=t.length);for(var a=e-1;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Ht[t[a]]>e?a:e};var Gt=function(){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},Xt=Object.prototype.toString,Wt=j.Z_NO_FLUSH,qt=j.Z_SYNC_FLUSH,Jt=j.Z_FULL_FLUSH,Qt=j.Z_FINISH,Vt=j.Z_OK,$t=j.Z_STREAM_END,te=j.Z_DEFAULT_COMPRESSION,ee=j.Z_DEFAULT_STRATEGY,ae=j.Z_DEFLATED;function ie(t){this.options=Bt({level:te,method:ae,chunkSize:16384,windowBits:15,memLevel:8,strategy:ee},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Gt,this.strm.avail_out=0;var a=Ft.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Vt)throw new Error(H[a]);if(e.header&&Ft.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(i="string"==typeof e.dictionary?Kt(e.dictionary):"[object ArrayBuffer]"===Xt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(a=Ft.deflateSetDictionary(this.strm,i))!==Vt)throw new Error(H[a]);this._dict_set=!0}}function ne(t,e){var a=new ie(e);if(a.push(t,!0),a.err)throw a.msg||H[a.err];return a.result}ie.prototype.push=function(t,e){var a,i,n=this.strm,r=this.options.chunkSize;if(this.ended)return!1;for(i=e===~~e?e:!0===e?Qt:Wt,"string"==typeof t?n.input=Kt(t):"[object ArrayBuffer]"===Xt.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(i===qt||i===Jt)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if((a=Ft.deflate(n,i))===$t)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),a=Ft.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Vt;if(0!==n.avail_out){if(i>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},ie.prototype.onData=function(t){this.chunks.push(t)},ie.prototype.onEnd=function(t){t===Vt&&(this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var re={Deflate:ie,deflate:ne,deflateRaw:function(t,e){return(e=e||{}).raw=!0,ne(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,ne(t,e)},constants:j},se=function(t,e){var a,i,n,r,s,o,l,h,d,_,f,u,c,w,b,g,p,m,v,k,y,x,z,A,E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,r=n-(e-t.avail_out),s=n+(t.avail_out-257),o=E.dmax,l=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,u=E.bits,c=E.lencode,w=E.distcode,b=(1<>>=m=p>>>24,u-=m,0===(m=p>>>16&255))A[n++]=65535&p;else{if(!(16&m)){if(0==(64&m)){p=c[(65535&p)+(f&(1<>>=m,u-=m),u<15&&(f+=z[a++]<>>=m=p>>>24,u-=m,!(16&(m=p>>>16&255))){if(0==(64&m)){p=w[(65535&p)+(f&(1<o){t.msg="invalid distance too far back",E.mode=30;break t}if(f>>>=m,u-=m,k>(m=n-r)){if((m=k-m)>h&&E.sane){t.msg="invalid distance too far back",E.mode=30;break t}if(y=0,x=_,0===d){if(y+=l-m,m2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],v-=3;v&&(A[n++]=x[y++],v>1&&(A[n++]=x[y++]))}else{y=n-k;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],v-=3}while(v>2);v&&(A[n++]=A[y++],v>1&&(A[n++]=A[y++]))}break}}break}}while(a>3,f&=(1<<(u-=v<<3))-1,t.next_in=a,t.next_out=n,t.avail_in=a=1&&0===U[k];k--);if(y>k&&(y=k),0===k)return n[r++]=20971520,n[r++]=20971520,o.bits=1,0;for(v=1;v0&&(0===t||1!==k))return-1;for(D[1]=0,p=1;p852||2===t&&E>592)return 1;for(;;){c=p-z,s[m]u?(w=O[T+s[m]],b=Z[S+s[m]]):(w=96,b=0),l=1<>z)+(h-=l)]=c<<24|w<<16|b|0}while(0!==h);for(l=1<>=1;if(0!==l?(R&=l-1,R+=l):R=0,m++,0==--U[p]){if(p===k)break;p=e[a+s[m]]}if(p>y&&(R&_)!==d){for(0===z&&(z=y),f+=v,A=1<<(x=p-z);x+z852||2===t&&E>592)return 1;n[d=R&_]=y<<24|x<<16|f-r|0}}return 0!==R&&(n[f+R]=p-z<<24|64<<16|0),o.bits=y,0},ue=j.Z_FINISH,ce=j.Z_BLOCK,we=j.Z_TREES,be=j.Z_OK,ge=j.Z_STREAM_END,pe=j.Z_NEED_DICT,me=j.Z_STREAM_ERROR,ve=j.Z_DATA_ERROR,ke=j.Z_MEM_ERROR,ye=j.Z_BUF_ERROR,xe=j.Z_DEFLATED,ze=12,Ae=30,Ee=function(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)};function Re(){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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var Ze,Se,Ue=function(t){if(!t||!t.state)return me;var e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,be},De=function(t){if(!t||!t.state)return me;var e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Ue(t)},Oe=function(t,e){var a;if(!t||!t.state)return me;var i=t.state;return e<0?(a=0,e=-e):(a=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?me:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,De(t))},Te=function(t,e){if(!t)return me;var a=new Re;t.state=a,a.window=null;var i=Oe(t,e);return i!==be&&(t.state=null),i},Ie=!0,Fe=function(t){if(Ie){Ze=new Int32Array(512),Se=new Int32Array(32);for(var e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(fe(1,t.lens,0,288,Ze,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;fe(2,t.lens,0,32,Se,0,t.work,{bits:5}),Ie=!1}t.lencode=Ze,t.lenbits=9,t.distcode=Se,t.distbits=5},Le=function(t,e,a,i){var n,r=t.state;return null===r.window&&(r.wsize=1<=r.wsize?(r.window.set(e.subarray(a-r.wsize,a),0),r.wnext=0,r.whave=r.wsize):((n=r.wsize-r.wnext)>i&&(n=i),r.window.set(e.subarray(a-i,a-i+n),r.wnext),(i-=n)?(r.window.set(e.subarray(a-i,a),0),r.wnext=i,r.whave=r.wsize):(r.wnext+=n,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,a.check=M(a.check,R,2,0),h=0,d=0,a.mode=2;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=Ae;break}if((15&h)!==xe){t.msg="unknown compression method",a.mode=Ae;break}if(d-=4,y=8+(15&(h>>>=4)),0===a.wbits)a.wbits=y;else if(y>a.wbits){t.msg="invalid window size",a.mode=Ae;break}a.dmax=1<>8&1),512&a.flags&&(R[0]=255&h,R[1]=h>>>8&255,a.check=M(a.check,R,2,0)),h=0,d=0,a.mode=3;case 3:for(;d<32;){if(0===o)break t;o--,h+=i[r++]<>>8&255,R[2]=h>>>16&255,R[3]=h>>>24&255,a.check=M(a.check,R,4,0)),h=0,d=0,a.mode=4;case 4:for(;d<16;){if(0===o)break t;o--,h+=i[r++]<>8),512&a.flags&&(R[0]=255&h,R[1]=h>>>8&255,a.check=M(a.check,R,2,0)),h=0,d=0,a.mode=5;case 5:if(1024&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[r++]<>>8&255,a.check=M(a.check,R,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=6;case 6:if(1024&a.flags&&((u=a.length)>o&&(u=o),u&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(r,r+u),y)),512&a.flags&&(a.check=M(a.check,i,u,r)),o-=u,r+=u,a.length-=u),a.length))break t;a.length=0,a.mode=7;case 7:if(2048&a.flags){if(0===o)break t;u=0;do{y=i[r+u++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&u>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=ze;break;case 10:for(;d<32;){if(0===o)break t;o--,h+=i[r++]<>>=7&d,d-=7&d,a.mode=27;break}for(;d<3;){if(0===o)break t;o--,h+=i[r++]<>>=1)){case 0:a.mode=14;break;case 1:if(Fe(a),a.mode=20,e===we){h>>>=2,d-=2;break t}break;case 2:a.mode=17;break;case 3:t.msg="invalid block type",a.mode=Ae}h>>>=2,d-=2;break;case 14:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=i[r++]<>>16^65535)){t.msg="invalid stored block lengths",a.mode=Ae;break}if(a.length=65535&h,h=0,d=0,a.mode=15,e===we)break t;case 15:a.mode=16;case 16:if(u=a.length){if(u>o&&(u=o),u>l&&(u=l),0===u)break t;n.set(i.subarray(r,r+u),s),o-=u,r+=u,l-=u,s+=u,a.length-=u;break}a.mode=ze;break;case 17:for(;d<14;){if(0===o)break t;o--,h+=i[r++]<>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=Ae;break}a.have=0,a.mode=18;case 18:for(;a.have>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,z={bits:a.lenbits},x=fe(0,a.lens,0,19,a.lencode,0,a.work,z),a.lenbits=z.bits,x){t.msg="invalid code lengths set",a.mode=Ae;break}a.have=0,a.mode=19;case 19:for(;a.have>>16&255,p=65535&E,!((b=E>>>24)<=d);){if(0===o)break t;o--,h+=i[r++]<>>=b,d-=b,a.lens[a.have++]=p;else{if(16===p){for(A=b+2;d>>=b,d-=b,0===a.have){t.msg="invalid bit length repeat",a.mode=Ae;break}y=a.lens[a.have-1],u=3+(3&h),h>>>=2,d-=2}else if(17===p){for(A=b+3;d>>=b)),h>>>=3,d-=3}else{for(A=b+7;d>>=b)),h>>>=7,d-=7}if(a.have+u>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=Ae;break}for(;u--;)a.lens[a.have++]=y}}if(a.mode===Ae)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=Ae;break}if(a.lenbits=9,z={bits:a.lenbits},x=fe(1,a.lens,0,a.nlen,a.lencode,0,a.work,z),a.lenbits=z.bits,x){t.msg="invalid literal/lengths set",a.mode=Ae;break}if(a.distbits=6,a.distcode=a.distdyn,z={bits:a.distbits},x=fe(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,z),a.distbits=z.bits,x){t.msg="invalid distances set",a.mode=Ae;break}if(a.mode=20,e===we)break t;case 20:a.mode=21;case 21:if(o>=6&&l>=258){t.next_out=s,t.avail_out=l,t.next_in=r,t.avail_in=o,a.hold=h,a.bits=d,se(t,f),s=t.next_out,n=t.output,l=t.avail_out,r=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,a.mode===ze&&(a.back=-1);break}for(a.back=0;g=(E=a.lencode[h&(1<>>16&255,p=65535&E,!((b=E>>>24)<=d);){if(0===o)break t;o--,h+=i[r++]<>m)])>>>16&255,p=65535&E,!(m+(b=E>>>24)<=d);){if(0===o)break t;o--,h+=i[r++]<>>=m,d-=m,a.back+=m}if(h>>>=b,d-=b,a.back+=b,a.length=p,0===g){a.mode=26;break}if(32&g){a.back=-1,a.mode=ze;break}if(64&g){t.msg="invalid literal/length code",a.mode=Ae;break}a.extra=15&g,a.mode=22;case 22:if(a.extra){for(A=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=23;case 23:for(;g=(E=a.distcode[h&(1<>>16&255,p=65535&E,!((b=E>>>24)<=d);){if(0===o)break t;o--,h+=i[r++]<>m)])>>>16&255,p=65535&E,!(m+(b=E>>>24)<=d);){if(0===o)break t;o--,h+=i[r++]<>>=m,d-=m,a.back+=m}if(h>>>=b,d-=b,a.back+=b,64&g){t.msg="invalid distance code",a.mode=Ae;break}a.offset=p,a.extra=15&g,a.mode=24;case 24:if(a.extra){for(A=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=Ae;break}a.mode=25;case 25:if(0===l)break t;if(u=f-l,a.offset>u){if((u=a.offset-u)>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=Ae;break}u>a.wnext?(u-=a.wnext,c=a.wsize-u):c=a.wnext-u,u>a.length&&(u=a.length),w=a.window}else w=n,c=s-a.offset,u=a.length;u>l&&(u=l),l-=u,a.length-=u;do{n[s++]=w[c++]}while(--u);0===a.length&&(a.mode=21);break;case 26:if(0===l)break t;n[s++]=a.length,l--,a.mode=21;break;case 27:if(a.wrap){for(;d<32;){if(0===o)break t;o--,h|=i[r++]<=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Gt,this.strm.avail_out=0;var a=Ne.inflateInit2(this.strm,e.windowBits);if(a!==je)throw new Error(H[a]);if(this.header=new Be,Ne.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Kt(e.dictionary):"[object ArrayBuffer]"===Ce.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Ne.inflateSetDictionary(this.strm,e.dictionary))!==je))throw new Error(H[a])}function qe(t,e){var a=new We(e);if(a.push(t),a.err)throw a.msg||H[a.err];return a.result}We.prototype.push=function(t,e){var a,i,n,r=this.strm,s=this.options.chunkSize,o=this.options.dictionary;if(this.ended)return!1;for(i=e===~~e?e:!0===e?He:Me,"[object ArrayBuffer]"===Ce.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(s),r.next_out=0,r.avail_out=s),(a=Ne.inflate(r,i))===Pe&&o&&((a=Ne.inflateSetDictionary(r,o))===je?a=Ne.inflate(r,i):a===Ge&&(a=Pe));r.avail_in>0&&a===Ke&&r.state.wrap>0&&0!==t[r.next_in];)Ne.inflateReset(r),a=Ne.inflate(r,i);switch(a){case Ye:case Ge:case Pe:case Xe:return this.onEnd(a),this.ended=!0,!1}if(n=r.avail_out,r.next_out&&(0===r.avail_out||a===Ke))if("string"===this.options.to){var l=Yt(r.output,r.next_out),h=r.next_out-l,d=Pt(r.output,l);r.next_out=h,r.avail_out=s-h,h&&r.output.set(r.output.subarray(l,l+h),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(a!==je||0!==n){if(a===Ke)return a=Ne.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},We.prototype.onData=function(t){this.chunks.push(t)},We.prototype.onEnd=function(t){t===je&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Je={Inflate:We,inflate:qe,inflateRaw:function(t,e){return(e=e||{}).raw=!0,qe(t,e)},ungzip:qe,constants:j},Qe=re.Deflate,Ve=re.deflate,$e=re.deflateRaw,ta=re.gzip,ea=Je.Inflate,aa=Je.inflate,ia=Je.inflateRaw,na=Je.ungzip,ra=j,sa={Deflate:Qe,deflate:Ve,deflateRaw:$e,gzip:ta,Inflate:ea,inflate:aa,inflateRaw:ia,ungzip:na,constants:ra};t.Deflate=Qe,t.Inflate=ea,t.constants=ra,t.default=sa,t.deflate=Ve,t.deflateRaw=$e,t.gzip=ta,t.inflate=aa,t.inflateRaw=ia,t.ungzip=na,Object.defineProperty(t,"__esModule",{value:!0})})); +/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).pako={})}(this,(function(t){"use strict";function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,i=286,n=30,r=15,s=new Uint8Array([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]),o=new Uint8Array([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]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=new Array(576);e(d);var _=new Array(60);e(_);var f=new Array(512);e(f);var u=new Array(256);e(u);var c=new Array(29);e(c);var w,b,g,p=new Array(n);function m(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function v(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(p);var k=function(t){return t<256?f[t]:f[256+(t>>>7)]},y=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<>>=1,a<<=1}while(--e>0);return a>>>1},E=function(t,e,a){var i,n,s=new Array(16),o=0;for(i=1;i<=r;i++)s[i]=o=o+a[i-1]<<1;for(n=0;n<=e;n++){var l=t[2*n+1];0!==l&&(t[2*n]=A(s[l]++,l))}},R=function(t){var e;for(e=0;e8?y(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},S=function(t,e,a,i){var n=2*e,r=2*a;return t[n]>1;a>=1;a--)U(t,s,a);n=h;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,s,1),i=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=i,s[2*n]=s[2*a]+s[2*i],t.depth[n]=(t.depth[a]>=t.depth[i]?t.depth[a]:t.depth[i])+1,s[2*a+1]=s[2*i+1]=n,t.heap[1]=n++,U(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,i,n,s,o,l,h=e.dyn_tree,d=e.max_code,_=e.stat_desc.static_tree,f=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,w=e.stat_desc.max_length,b=0;for(s=0;s<=r;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=h[2*h[2*(i=t.heap[a])+1]+1]+1)>w&&(s=w,b++),h[2*i+1]=s,i>d||(t.bl_count[s]++,o=0,i>=c&&(o=u[i-c]),l=h[2*i],t.opt_len+=l*(s+o),f&&(t.static_len+=l*(_[2*i+1]+o)));if(0!==b){do{for(s=w-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[w]--,b-=2}while(b>0);for(s=w;0!==s;s--)for(i=t.bl_count[s];0!==i;)(n=t.heap[--a])>d||(h[2*n+1]!==s&&(t.opt_len+=(s-h[2*n+1])*h[2*n],h[2*n+1]=s),i--)}}(t,e),E(s,d,t.bl_count)},O=function(t,e,a){var i,n,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=s,s=e[2*(i+1)+1],++o>=7;h0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=r&&(r=s)):r=s=i+5,i+4<=r&&-1!==e?L(t,e,i,n):4===t.strategy||s===r?(x(t,2+(n?1:0),3),D(t,d,_)):(x(t,4+(n?1:0),3),function(t,e,a,i){var n;for(x(t,e-257,5),x(t,a-1,5),x(t,i-4,4),n=0;n>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(u[i]+a+1)]++,t.dyn_dtree[2*k(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){x(t,2,3),z(t,256,d),function(t){16===t.bi_valid?(y(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},B=function(t,e,a,i){for(var n=65535&t|0,r=t>>>16&65535|0,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{r=r+(n=n+e[i++]|0)|0}while(--s);n%=65521,r%=65521}return n|r<<16|0},C=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),M=function(t,e,a,i){var n=C,r=i+a;t^=-1;for(var s=i;s>>8^n[255&(t^e[s])];return-1^t},H={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},K=N._tr_init,P=N._tr_stored_block,Y=N._tr_flush_block,G=N._tr_tally,X=N._tr_align,W=j.Z_NO_FLUSH,q=j.Z_PARTIAL_FLUSH,J=j.Z_FULL_FLUSH,Q=j.Z_FINISH,V=j.Z_BLOCK,$=j.Z_OK,tt=j.Z_STREAM_END,et=j.Z_STREAM_ERROR,at=j.Z_DATA_ERROR,it=j.Z_BUF_ERROR,nt=j.Z_DEFAULT_COMPRESSION,rt=j.Z_FILTERED,st=j.Z_HUFFMAN_ONLY,ot=j.Z_RLE,lt=j.Z_FIXED,ht=j.Z_DEFAULT_STRATEGY,dt=j.Z_UNKNOWN,_t=j.Z_DEFLATED,ft=258,ut=262,ct=103,wt=113,bt=666,gt=function(t,e){return t.msg=H[e],e},pt=function(t){return(t<<1)-(t>4?9:0)},mt=function(t){for(var e=t.length;--e>=0;)t[e]=0},vt=function(t,e,a){return(e<t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},yt=function(t,e){Y(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,kt(t.strm)},xt=function(t,e){t.pending_buf[t.pending++]=e},zt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},At=function(t,e){var a,i,n=t.max_chain_length,r=t.strstart,s=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-ut?t.strstart-(t.w_size-ut):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+ft,u=h[r+s-1],c=h[r+s];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(h[(a=e)+s]===c&&h[a+s-1]===u&&h[a]===h[r]&&h[++a]===h[r+1]){r+=2,a++;do{}while(h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&rs){if(t.match_start=e,s=i,i>=o)break;u=h[r+s-1],c=h[r+s]}}}while((e=_[e&d])>l&&0!=--n);return s<=t.lookahead?s:t.lookahead},Et=function(t){var e,a,i,n,r,s,o,l,h,d,_=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=_+(_-ut)){t.window.set(t.window.subarray(_,_+_),0),t.match_start-=_,t.strstart-=_,t.block_start-=_,e=a=t.hash_size;do{i=t.head[--e],t.head[e]=i>=_?i-_:0}while(--a);e=a=_;do{i=t.prev[--e],t.prev[e]=i>=_?i-_:0}while(--a);n+=_}if(0===t.strm.avail_in)break;if(s=t.strm,o=t.window,l=t.strstart+t.lookahead,h=n,d=void 0,(d=s.avail_in)>h&&(d=h),a=0===d?0:(s.avail_in-=d,o.set(s.input.subarray(s.next_in,s.next_in+d),l),1===s.state.wrap?s.adler=B(s.adler,o,d,l):2===s.state.wrap&&(s.adler=M(s.adler,o,d,l)),s.next_in+=d,s.total_in+=d,d),t.lookahead+=a,t.lookahead+t.insert>=3)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=vt(t,t.ins_h,t.window[r+1]);t.insert&&(t.ins_h=vt(t,t.ins_h,t.window[r+3-1]),t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead=3&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ut&&(t.match_length=At(t,a)),t.match_length>=3)if(i=G(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=vt(t,t.ins_h,t.window[t.strstart+1]);else i=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2},Zt=function(t,e){for(var a,i,n;;){if(t.lookahead=3&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=G(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(yt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((i=G(t,0,t.window[t.strstart-1]))&&yt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=G(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2};function St(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}var Ut=[new St(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Et(t),0===t.lookahead&&e===W)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+a;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,yt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-ut&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(yt(t,!1),t.strm.avail_out),1)})),new St(4,4,8,4,Rt),new St(4,5,16,8,Rt),new St(4,6,32,32,Rt),new St(4,4,16,16,Zt),new St(8,16,32,32,Zt),new St(8,16,128,128,Zt),new St(8,32,128,256,Zt),new St(32,128,258,1024,Zt),new St(32,258,258,4096,Zt)];function Dt(){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=_t,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 Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),mt(this.dyn_ltree),mt(this.dyn_dtree),mt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),mt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),mt(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}var Tt=function(t){if(!t||!t.state)return gt(t,et);t.total_in=t.total_out=0,t.data_type=dt;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:wt,t.adler=2===e.wrap?0:1,e.last_flush=W,K(e),$},Ot=function(t){var e,a=Tt(t);return a===$&&((e=t.state).window_size=2*e.w_size,mt(e.head),e.max_lazy_match=Ut[e.level].max_lazy,e.good_match=Ut[e.level].good_length,e.nice_match=Ut[e.level].nice_length,e.max_chain_length=Ut[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},It=function(t,e,a,i,n,r){if(!t)return et;var s=1;if(e===nt&&(e=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),n<1||n>9||a!==_t||i<8||i>15||e<0||e>9||r<0||r>lt)return gt(t,et);8===i&&(i=9);var o=new Dt;return t.state=o,o.strm=t,o.wrap=s,o.gzhead=null,o.w_bits=i,o.w_size=1<V||e<0)return t?gt(t,et):et;var n=t.state;if(!t.output||!t.input&&0!==t.avail_in||n.status===bt&&e!==Q)return gt(t,0===t.avail_out?it:et);n.strm=t;var r=n.last_flush;if(n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,xt(n,31),xt(n,139),xt(n,8),n.gzhead?(xt(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),xt(n,255&n.gzhead.time),xt(n,n.gzhead.time>>8&255),xt(n,n.gzhead.time>>16&255),xt(n,n.gzhead.time>>24&255),xt(n,9===n.level?2:n.strategy>=st||n.level<2?4:0),xt(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(xt(n,255&n.gzhead.extra.length),xt(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=M(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,9===n.level?2:n.strategy>=st||n.level<2?4:0),xt(n,3),n.status=wt);else{var s=_t+(n.w_bits-8<<4)<<8;s|=(n.strategy>=st||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(s|=32),s+=31-s%31,n.status=wt,zt(n,s),0!==n.strstart&&(zt(n,t.adler>>>16),zt(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(a=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),kt(t),a=n.pending,n.pending!==n.pending_buf_size));)xt(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),kt(t),a=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexa&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),0===i&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),kt(t),a=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexa&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),0===i&&(n.status=ct)}else n.status=ct;if(n.status===ct&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&kt(t),n.pending+2<=n.pending_buf_size&&(xt(n,255&t.adler),xt(n,t.adler>>8&255),t.adler=0,n.status=wt)):n.status=wt),0!==n.pending){if(kt(t),0===t.avail_out)return n.last_flush=-1,$}else if(0===t.avail_in&&pt(e)<=pt(r)&&e!==Q)return gt(t,it);if(n.status===bt&&0!==t.avail_in)return gt(t,it);if(0!==t.avail_in||0!==n.lookahead||e!==W&&n.status!==bt){var o=n.strategy===st?function(t,e){for(var a;;){if(0===t.lookahead&&(Et(t),0===t.lookahead)){if(e===W)return 1;break}if(t.match_length=0,a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2}(n,e):n.strategy===ot?function(t,e){for(var a,i,n,r,s=t.window;;){if(t.lookahead<=ft){if(Et(t),t.lookahead<=ft&&e===W)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=s[n=t.strstart-1])===s[++n]&&i===s[++n]&&i===s[++n]){r=t.strstart+ft;do{}while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=G(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2}(n,e):Ut[n.level].func(n,e);if(3!==o&&4!==o||(n.status=bt),1===o||3===o)return 0===t.avail_out&&(n.last_flush=-1),$;if(2===o&&(e===q?X(n):e!==V&&(P(n,0,0,!1),e===J&&(mt(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),kt(t),0===t.avail_out))return n.last_flush=-1,$}return e!==Q?$:n.wrap<=0?tt:(2===n.wrap?(xt(n,255&t.adler),xt(n,t.adler>>8&255),xt(n,t.adler>>16&255),xt(n,t.adler>>24&255),xt(n,255&t.total_in),xt(n,t.total_in>>8&255),xt(n,t.total_in>>16&255),xt(n,t.total_in>>24&255)):(zt(n,t.adler>>>16),zt(n,65535&t.adler)),kt(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?$:tt)},deflateEnd:function(t){if(!t||!t.state)return et;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==ct&&e!==wt&&e!==bt?gt(t,et):(t.state=null,e===wt?gt(t,at):$)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return et;var i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return et;if(1===n&&(t.adler=B(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(mt(i.head),i.strstart=0,i.block_start=0,i.insert=0);var r=new Uint8Array(i.w_size);r.set(e.subarray(a-i.w_size,a),0),e=r,a=i.w_size}var s=t.avail_in,o=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Et(i);i.lookahead>=3;){var h=i.strstart,d=i.lookahead-2;do{i.ins_h=vt(i,i.ins_h,i.window[h+3-1]),i.prev[h&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=h,h++}while(--d);i.strstart=h,i.lookahead=2,Et(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=o,t.input=l,t.avail_in=s,i.wrap=n,$},deflateInfo:"pako deflate (from Nodeca project)"};function Lt(t){return(Lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Nt=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},Bt=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var a=e.shift();if(a){if("object"!==Lt(a))throw new TypeError(a+"must be non-object");for(var i in a)Nt(a,i)&&(t[i]=a[i])}}return t},Ct=function(t){for(var e=0,a=0,i=t.length;a=252?6:jt>=248?5:jt>=240?4:jt>=224?3:jt>=192?2:1;Ht[254]=Ht[254]=1;var Kt=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,a,i,n,r,s=t.length,o=0;for(n=0;n>>6,e[r++]=128|63&a):a<65536?(e[r++]=224|a>>>12,e[r++]=128|a>>>6&63,e[r++]=128|63&a):(e[r++]=240|a>>>18,e[r++]=128|a>>>12&63,e[r++]=128|a>>>6&63,e[r++]=128|63&a);return e},Pt=function(t,e){var a,i,n=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));var r=new Array(2*n);for(i=0,a=0;a4)r[i++]=65533,a+=o-1;else{for(s&=2===o?31:3===o?15:7;o>1&&a1?r[i++]=65533:s<65536?r[i++]=s:(s-=65536,r[i++]=55296|s>>10&1023,r[i++]=56320|1023&s)}}}return function(t,e){if(e<65534&&t.subarray&&Mt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));for(var a="",i=0;it.length&&(e=t.length);for(var a=e-1;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Ht[t[a]]>e?a:e};var Gt=function(){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},Xt=Object.prototype.toString,Wt=j.Z_NO_FLUSH,qt=j.Z_SYNC_FLUSH,Jt=j.Z_FULL_FLUSH,Qt=j.Z_FINISH,Vt=j.Z_OK,$t=j.Z_STREAM_END,te=j.Z_DEFAULT_COMPRESSION,ee=j.Z_DEFAULT_STRATEGY,ae=j.Z_DEFLATED;function ie(t){this.options=Bt({level:te,method:ae,chunkSize:16384,windowBits:15,memLevel:8,strategy:ee},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Gt,this.strm.avail_out=0;var a=Ft.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Vt)throw new Error(H[a]);if(e.header&&Ft.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(i="string"==typeof e.dictionary?Kt(e.dictionary):"[object ArrayBuffer]"===Xt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(a=Ft.deflateSetDictionary(this.strm,i))!==Vt)throw new Error(H[a]);this._dict_set=!0}}function ne(t,e){var a=new ie(e);if(a.push(t,!0),a.err)throw a.msg||H[a.err];return a.result}ie.prototype.push=function(t,e){var a,i,n=this.strm,r=this.options.chunkSize;if(this.ended)return!1;for(i=e===~~e?e:!0===e?Qt:Wt,"string"==typeof t?n.input=Kt(t):"[object ArrayBuffer]"===Xt.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(i===qt||i===Jt)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if((a=Ft.deflate(n,i))===$t)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),a=Ft.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Vt;if(0!==n.avail_out){if(i>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},ie.prototype.onData=function(t){this.chunks.push(t)},ie.prototype.onEnd=function(t){t===Vt&&(this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var re={Deflate:ie,deflate:ne,deflateRaw:function(t,e){return(e=e||{}).raw=!0,ne(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,ne(t,e)},constants:j},se=function(t,e){var a,i,n,r,s,o,l,h,d,_,f,u,c,w,b,g,p,m,v,k,y,x,z,A,E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,r=n-(e-t.avail_out),s=n+(t.avail_out-257),o=E.dmax,l=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,u=E.bits,c=E.lencode,w=E.distcode,b=(1<>>=m=p>>>24,u-=m,0===(m=p>>>16&255))A[n++]=65535&p;else{if(!(16&m)){if(0==(64&m)){p=c[(65535&p)+(f&(1<>>=m,u-=m),u<15&&(f+=z[a++]<>>=m=p>>>24,u-=m,!(16&(m=p>>>16&255))){if(0==(64&m)){p=w[(65535&p)+(f&(1<o){t.msg="invalid distance too far back",E.mode=30;break t}if(f>>>=m,u-=m,k>(m=n-r)){if((m=k-m)>h&&E.sane){t.msg="invalid distance too far back",E.mode=30;break t}if(y=0,x=_,0===d){if(y+=l-m,m2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],v-=3;v&&(A[n++]=x[y++],v>1&&(A[n++]=x[y++]))}else{y=n-k;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],v-=3}while(v>2);v&&(A[n++]=A[y++],v>1&&(A[n++]=A[y++]))}break}}break}}while(a>3,f&=(1<<(u-=v<<3))-1,t.next_in=a,t.next_out=n,t.avail_in=a=1&&0===U[k];k--);if(y>k&&(y=k),0===k)return n[r++]=20971520,n[r++]=20971520,o.bits=1,0;for(v=1;v0&&(0===t||1!==k))return-1;for(D[1]=0,p=1;p852||2===t&&E>592)return 1;for(;;){c=p-z,s[m]u?(w=T[O+s[m]],b=Z[S+s[m]]):(w=96,b=0),l=1<>z)+(h-=l)]=c<<24|w<<16|b|0}while(0!==h);for(l=1<>=1;if(0!==l?(R&=l-1,R+=l):R=0,m++,0==--U[p]){if(p===k)break;p=e[a+s[m]]}if(p>y&&(R&_)!==d){for(0===z&&(z=y),f+=v,A=1<<(x=p-z);x+z852||2===t&&E>592)return 1;n[d=R&_]=y<<24|x<<16|f-r|0}}return 0!==R&&(n[f+R]=p-z<<24|64<<16|0),o.bits=y,0},ue=j.Z_FINISH,ce=j.Z_BLOCK,we=j.Z_TREES,be=j.Z_OK,ge=j.Z_STREAM_END,pe=j.Z_NEED_DICT,me=j.Z_STREAM_ERROR,ve=j.Z_DATA_ERROR,ke=j.Z_MEM_ERROR,ye=j.Z_BUF_ERROR,xe=j.Z_DEFLATED,ze=12,Ae=30,Ee=function(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)};function Re(){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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var Ze,Se,Ue=function(t){if(!t||!t.state)return me;var e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,be},De=function(t){if(!t||!t.state)return me;var e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Ue(t)},Te=function(t,e){var a;if(!t||!t.state)return me;var i=t.state;return e<0?(a=0,e=-e):(a=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?me:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,De(t))},Oe=function(t,e){if(!t)return me;var a=new Re;t.state=a,a.window=null;var i=Te(t,e);return i!==be&&(t.state=null),i},Ie=!0,Fe=function(t){if(Ie){Ze=new Int32Array(512),Se=new Int32Array(32);for(var e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(fe(1,t.lens,0,288,Ze,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;fe(2,t.lens,0,32,Se,0,t.work,{bits:5}),Ie=!1}t.lencode=Ze,t.lenbits=9,t.distcode=Se,t.distbits=5},Le=function(t,e,a,i){var n,r=t.state;return null===r.window&&(r.wsize=1<=r.wsize?(r.window.set(e.subarray(a-r.wsize,a),0),r.wnext=0,r.whave=r.wsize):((n=r.wsize-r.wnext)>i&&(n=i),r.window.set(e.subarray(a-i,a-i+n),r.wnext),(i-=n)?(r.window.set(e.subarray(a-i,a),0),r.wnext=i,r.whave=r.wsize):(r.wnext+=n,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,a.check=M(a.check,R,2,0),h=0,d=0,a.mode=2;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=Ae;break}if((15&h)!==xe){t.msg="unknown compression method",a.mode=Ae;break}if(d-=4,y=8+(15&(h>>>=4)),0===a.wbits)a.wbits=y;else if(y>a.wbits){t.msg="invalid window size",a.mode=Ae;break}a.dmax=1<>8&1),512&a.flags&&(R[0]=255&h,R[1]=h>>>8&255,a.check=M(a.check,R,2,0)),h=0,d=0,a.mode=3;case 3:for(;d<32;){if(0===o)break t;o--,h+=i[r++]<>>8&255,R[2]=h>>>16&255,R[3]=h>>>24&255,a.check=M(a.check,R,4,0)),h=0,d=0,a.mode=4;case 4:for(;d<16;){if(0===o)break t;o--,h+=i[r++]<>8),512&a.flags&&(R[0]=255&h,R[1]=h>>>8&255,a.check=M(a.check,R,2,0)),h=0,d=0,a.mode=5;case 5:if(1024&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[r++]<>>8&255,a.check=M(a.check,R,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=6;case 6:if(1024&a.flags&&((u=a.length)>o&&(u=o),u&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(r,r+u),y)),512&a.flags&&(a.check=M(a.check,i,u,r)),o-=u,r+=u,a.length-=u),a.length))break t;a.length=0,a.mode=7;case 7:if(2048&a.flags){if(0===o)break t;u=0;do{y=i[r+u++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&u>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=ze;break;case 10:for(;d<32;){if(0===o)break t;o--,h+=i[r++]<>>=7&d,d-=7&d,a.mode=27;break}for(;d<3;){if(0===o)break t;o--,h+=i[r++]<>>=1)){case 0:a.mode=14;break;case 1:if(Fe(a),a.mode=20,e===we){h>>>=2,d-=2;break t}break;case 2:a.mode=17;break;case 3:t.msg="invalid block type",a.mode=Ae}h>>>=2,d-=2;break;case 14:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=i[r++]<>>16^65535)){t.msg="invalid stored block lengths",a.mode=Ae;break}if(a.length=65535&h,h=0,d=0,a.mode=15,e===we)break t;case 15:a.mode=16;case 16:if(u=a.length){if(u>o&&(u=o),u>l&&(u=l),0===u)break t;n.set(i.subarray(r,r+u),s),o-=u,r+=u,l-=u,s+=u,a.length-=u;break}a.mode=ze;break;case 17:for(;d<14;){if(0===o)break t;o--,h+=i[r++]<>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=Ae;break}a.have=0,a.mode=18;case 18:for(;a.have>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,z={bits:a.lenbits},x=fe(0,a.lens,0,19,a.lencode,0,a.work,z),a.lenbits=z.bits,x){t.msg="invalid code lengths set",a.mode=Ae;break}a.have=0,a.mode=19;case 19:for(;a.have>>16&255,p=65535&E,!((b=E>>>24)<=d);){if(0===o)break t;o--,h+=i[r++]<>>=b,d-=b,a.lens[a.have++]=p;else{if(16===p){for(A=b+2;d>>=b,d-=b,0===a.have){t.msg="invalid bit length repeat",a.mode=Ae;break}y=a.lens[a.have-1],u=3+(3&h),h>>>=2,d-=2}else if(17===p){for(A=b+3;d>>=b)),h>>>=3,d-=3}else{for(A=b+7;d>>=b)),h>>>=7,d-=7}if(a.have+u>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=Ae;break}for(;u--;)a.lens[a.have++]=y}}if(a.mode===Ae)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=Ae;break}if(a.lenbits=9,z={bits:a.lenbits},x=fe(1,a.lens,0,a.nlen,a.lencode,0,a.work,z),a.lenbits=z.bits,x){t.msg="invalid literal/lengths set",a.mode=Ae;break}if(a.distbits=6,a.distcode=a.distdyn,z={bits:a.distbits},x=fe(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,z),a.distbits=z.bits,x){t.msg="invalid distances set",a.mode=Ae;break}if(a.mode=20,e===we)break t;case 20:a.mode=21;case 21:if(o>=6&&l>=258){t.next_out=s,t.avail_out=l,t.next_in=r,t.avail_in=o,a.hold=h,a.bits=d,se(t,f),s=t.next_out,n=t.output,l=t.avail_out,r=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,a.mode===ze&&(a.back=-1);break}for(a.back=0;g=(E=a.lencode[h&(1<>>16&255,p=65535&E,!((b=E>>>24)<=d);){if(0===o)break t;o--,h+=i[r++]<>m)])>>>16&255,p=65535&E,!(m+(b=E>>>24)<=d);){if(0===o)break t;o--,h+=i[r++]<>>=m,d-=m,a.back+=m}if(h>>>=b,d-=b,a.back+=b,a.length=p,0===g){a.mode=26;break}if(32&g){a.back=-1,a.mode=ze;break}if(64&g){t.msg="invalid literal/length code",a.mode=Ae;break}a.extra=15&g,a.mode=22;case 22:if(a.extra){for(A=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=23;case 23:for(;g=(E=a.distcode[h&(1<>>16&255,p=65535&E,!((b=E>>>24)<=d);){if(0===o)break t;o--,h+=i[r++]<>m)])>>>16&255,p=65535&E,!(m+(b=E>>>24)<=d);){if(0===o)break t;o--,h+=i[r++]<>>=m,d-=m,a.back+=m}if(h>>>=b,d-=b,a.back+=b,64&g){t.msg="invalid distance code",a.mode=Ae;break}a.offset=p,a.extra=15&g,a.mode=24;case 24:if(a.extra){for(A=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=Ae;break}a.mode=25;case 25:if(0===l)break t;if(u=f-l,a.offset>u){if((u=a.offset-u)>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=Ae;break}u>a.wnext?(u-=a.wnext,c=a.wsize-u):c=a.wnext-u,u>a.length&&(u=a.length),w=a.window}else w=n,c=s-a.offset,u=a.length;u>l&&(u=l),l-=u,a.length-=u;do{n[s++]=w[c++]}while(--u);0===a.length&&(a.mode=21);break;case 26:if(0===l)break t;n[s++]=a.length,l--,a.mode=21;break;case 27:if(a.wrap){for(;d<32;){if(0===o)break t;o--,h|=i[r++]<=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Gt,this.strm.avail_out=0;var a=Ne.inflateInit2(this.strm,e.windowBits);if(a!==je)throw new Error(H[a]);if(this.header=new Be,Ne.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Kt(e.dictionary):"[object ArrayBuffer]"===Ce.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Ne.inflateSetDictionary(this.strm,e.dictionary))!==je))throw new Error(H[a])}function qe(t,e){var a=new We(e);if(a.push(t),a.err)throw a.msg||H[a.err];return a.result}We.prototype.push=function(t,e){var a,i,n,r=this.strm,s=this.options.chunkSize,o=this.options.dictionary;if(this.ended)return!1;for(i=e===~~e?e:!0===e?He:Me,"[object ArrayBuffer]"===Ce.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(s),r.next_out=0,r.avail_out=s),(a=Ne.inflate(r,i))===Pe&&o&&((a=Ne.inflateSetDictionary(r,o))===je?a=Ne.inflate(r,i):a===Ge&&(a=Pe));r.avail_in>0&&a===Ke&&r.state.wrap>0&&0!==t[r.next_in];)Ne.inflateReset(r),a=Ne.inflate(r,i);switch(a){case Ye:case Ge:case Pe:case Xe:return this.onEnd(a),this.ended=!0,!1}if(n=r.avail_out,r.next_out&&(0===r.avail_out||a===Ke))if("string"===this.options.to){var l=Yt(r.output,r.next_out),h=r.next_out-l,d=Pt(r.output,l);r.next_out=h,r.avail_out=s-h,h&&r.output.set(r.output.subarray(l,l+h),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(a!==je||0!==n){if(a===Ke)return a=Ne.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},We.prototype.onData=function(t){this.chunks.push(t)},We.prototype.onEnd=function(t){t===je&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Je={Inflate:We,inflate:qe,inflateRaw:function(t,e){return(e=e||{}).raw=!0,qe(t,e)},ungzip:qe,constants:j},Qe=re.Deflate,Ve=re.deflate,$e=re.deflateRaw,ta=re.gzip,ea=Je.Inflate,aa=Je.inflate,ia=Je.inflateRaw,na=Je.ungzip,ra=j,sa={Deflate:Qe,deflate:Ve,deflateRaw:$e,gzip:ta,Inflate:ea,inflate:aa,inflateRaw:ia,ungzip:na,constants:ra};t.Deflate=Qe,t.Inflate=ea,t.constants=ra,t.default=sa,t.deflate=Ve,t.deflateRaw=$e,t.gzip=ta,t.inflate=aa,t.inflateRaw=ia,t.ungzip=na,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/dist/pako.esm.mjs b/dist/pako.esm.mjs index 4f5dbf8..7c75f83 100644 --- a/dist/pako.esm.mjs +++ b/dist/pako.esm.mjs @@ -1,5 +1,5 @@ -/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */ +/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */ // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // @@ -28,19 +28,19 @@ //const Z_FILTERED = 1; //const Z_HUFFMAN_ONLY = 2; //const Z_RLE = 3; -const Z_FIXED = 4; +const Z_FIXED$1 = 4; //const Z_DEFAULT_STRATEGY = 0; /* Possible values of the data_type field (though see inflate()) */ const Z_BINARY = 0; const Z_TEXT = 1; //const Z_ASCII = 1; // = Z_TEXT -const Z_UNKNOWN = 2; +const Z_UNKNOWN$1 = 2; /*============================================================================*/ -function zero(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } } +function zero$1(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } } // From zutil.h @@ -49,8 +49,8 @@ const STATIC_TREES = 1; const DYN_TREES = 2; /* The three kinds of block type */ -const MIN_MATCH = 3; -const MAX_MATCH = 258; +const MIN_MATCH$1 = 3; +const MAX_MATCH$1 = 258; /* The minimum and maximum match lengths */ // From deflate.h @@ -58,25 +58,25 @@ const MAX_MATCH = 258; * Internal compression state. */ -const LENGTH_CODES = 29; +const LENGTH_CODES$1 = 29; /* number of length codes, not counting the special END_BLOCK code */ -const LITERALS = 256; +const LITERALS$1 = 256; /* number of literal bytes 0..255 */ -const L_CODES = LITERALS + 1 + LENGTH_CODES; +const L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1; /* number of Literal or Length codes, including the END_BLOCK code */ -const D_CODES = 30; +const D_CODES$1 = 30; /* number of distance codes */ -const BL_CODES = 19; +const BL_CODES$1 = 19; /* number of codes used to transfer the bit lengths */ -const HEAP_SIZE = 2 * L_CODES + 1; +const HEAP_SIZE$1 = 2 * L_CODES$1 + 1; /* maximum heap size */ -const MAX_BITS = 15; +const MAX_BITS$1 = 15; /* All codes must not exceed MAX_BITS bits */ const Buf_size = 16; @@ -129,37 +129,37 @@ const bl_order = const DIST_CODE_LEN = 512; /* see definition of array dist_code below */ // !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1 -const static_ltree = new Array((L_CODES + 2) * 2); -zero(static_ltree); +const static_ltree = new Array((L_CODES$1 + 2) * 2); +zero$1(static_ltree); /* The static literal tree. Since the bit lengths are imposed, there is no * need for the L_CODES extra codes used during heap construction. However * The codes 286 and 287 are needed to build a canonical tree (see _tr_init * below). */ -const static_dtree = new Array(D_CODES * 2); -zero(static_dtree); +const static_dtree = new Array(D_CODES$1 * 2); +zero$1(static_dtree); /* The static distance tree. (Actually a trivial tree since all codes use * 5 bits.) */ const _dist_code = new Array(DIST_CODE_LEN); -zero(_dist_code); +zero$1(_dist_code); /* Distance codes. The first 256 values correspond to the distances * 3 .. 258, the last 256 values correspond to the top 8 bits of * the 15 bit distances. */ -const _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); -zero(_length_code); +const _length_code = new Array(MAX_MATCH$1 - MIN_MATCH$1 + 1); +zero$1(_length_code); /* length code for each normalized match length (0 == MIN_MATCH) */ -const base_length = new Array(LENGTH_CODES); -zero(base_length); +const base_length = new Array(LENGTH_CODES$1); +zero$1(base_length); /* First normalized length for each code (0 = MIN_MATCH) */ -const base_dist = new Array(D_CODES); -zero(base_dist); +const base_dist = new Array(D_CODES$1); +zero$1(base_dist); /* First normalized distance for each code (0 = distance of 1) */ @@ -294,7 +294,7 @@ const gen_bitlen = (s, desc) => let f; /* frequency */ let overflow = 0; /* number of elements with bit length too large */ - for (bits = 0; bits <= MAX_BITS; bits++) { + for (bits = 0; bits <= MAX_BITS$1; bits++) { s.bl_count[bits] = 0; } @@ -303,7 +303,7 @@ const gen_bitlen = (s, desc) => */ tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */ - for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { + for (h = s.heap_max + 1; h < HEAP_SIZE$1; h++) { n = s.heap[h]; bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1; if (bits > max_length) { @@ -378,7 +378,7 @@ const gen_codes = (tree, max_code, bl_count) => // int max_code; /* largest code with non zero frequency */ // ushf *bl_count; /* number of codes at each bit length */ { - const next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */ + const next_code = new Array(MAX_BITS$1 + 1); /* next code value for each bit length */ let code = 0; /* running code value */ let bits; /* bit index */ let n; /* code index */ @@ -386,7 +386,7 @@ const gen_codes = (tree, max_code, bl_count) => /* The distribution counts are first used to generate the code values * without bit reversal. */ - for (bits = 1; bits <= MAX_BITS; bits++) { + for (bits = 1; bits <= MAX_BITS$1; bits++) { next_code[bits] = code = (code + bl_count[bits - 1]) << 1; } /* Check that the bit counts in bl_count are consistent. The last code @@ -418,7 +418,7 @@ const tr_static_init = () => { let length; /* length value */ let code; /* code value */ let dist; /* distance index */ - const bl_count = new Array(MAX_BITS + 1); + const bl_count = new Array(MAX_BITS$1 + 1); /* number of codes at each bit length for an optimal tree */ // do check in _tr_init() @@ -435,7 +435,7 @@ const tr_static_init = () => { /* Initialize the mapping length (0..255) -> length code (0..28) */ length = 0; - for (code = 0; code < LENGTH_CODES - 1; code++) { + for (code = 0; code < LENGTH_CODES$1 - 1; code++) { base_length[code] = length; for (n = 0; n < (1 << extra_lbits[code]); n++) { _length_code[length++] = code; @@ -458,7 +458,7 @@ const tr_static_init = () => { } //Assert (dist == 256, "tr_static_init: dist != 256"); dist >>= 7; /* from now on, all distances are divided by 128 */ - for (; code < D_CODES; code++) { + for (; code < D_CODES$1; code++) { base_dist[code] = dist << 7; for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) { _dist_code[256 + dist++] = code; @@ -467,7 +467,7 @@ const tr_static_init = () => { //Assert (dist == 256, "tr_static_init: 256+dist != 512"); /* Construct the codes of the static literal tree */ - for (bits = 0; bits <= MAX_BITS; bits++) { + for (bits = 0; bits <= MAX_BITS$1; bits++) { bl_count[bits] = 0; } @@ -496,18 +496,18 @@ const tr_static_init = () => { * tree construction to get a canonical Huffman tree (longest code * all ones) */ - gen_codes(static_ltree, L_CODES + 1, bl_count); + gen_codes(static_ltree, L_CODES$1 + 1, bl_count); /* The static distance tree is trivial: */ - for (n = 0; n < D_CODES; n++) { + for (n = 0; n < D_CODES$1; n++) { static_dtree[n * 2 + 1]/*.Len*/ = 5; static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5); } // Now data ready and we can init static trees - static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); - static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); - static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS$1 + 1, L_CODES$1, MAX_BITS$1); + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES$1, MAX_BITS$1); + static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES$1, MAX_BL_BITS); //static_init_done = true; }; @@ -521,9 +521,9 @@ const init_block = (s) => { let n; /* iterates over tree elements */ /* Initialize the trees. */ - for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } - for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } - for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < L_CODES$1; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < D_CODES$1; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < BL_CODES$1; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1; s.opt_len = s.static_len = 0; @@ -643,7 +643,7 @@ const compress_block = (s, ltree, dtree) => } else { /* Here, lc is the match length - MIN_MATCH */ code = _length_code[lc]; - send_code(s, code + LITERALS + 1, ltree); /* send the length code */ + send_code(s, code + LITERALS$1 + 1, ltree); /* send the length code */ extra = extra_lbits[code]; if (extra !== 0) { lc -= base_length[code]; @@ -697,7 +697,7 @@ const build_tree = (s, desc) => * heap[0] is not used. */ s.heap_len = 0; - s.heap_max = HEAP_SIZE; + s.heap_max = HEAP_SIZE$1; for (n = 0; n < elems; n++) { if (tree[n * 2]/*.Freq*/ !== 0) { @@ -931,7 +931,7 @@ const build_bl_tree = (s) => { * requires that at least 4 bit length codes be sent. (appnote.txt says * 3 but the actual value used is 4.) */ - for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { + for (max_blindex = BL_CODES$1 - 1; max_blindex >= 3; max_blindex--) { if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) { break; } @@ -1010,7 +1010,7 @@ const detect_data_type = (s) => { s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) { return Z_TEXT; } - for (n = 32; n < LITERALS; n++) { + for (n = 32; n < LITERALS$1; n++) { if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) { return Z_TEXT; } @@ -1028,7 +1028,7 @@ let static_init_done = false; /* =========================================================================== * Initialize the tree data structures for a new zlib stream. */ -const _tr_init = (s) => +const _tr_init$1 = (s) => { if (!static_init_done) { @@ -1051,7 +1051,7 @@ const _tr_init = (s) => /* =========================================================================== * Send a stored block */ -const _tr_stored_block = (s, buf, stored_len, last) => +const _tr_stored_block$1 = (s, buf, stored_len, last) => //DeflateState *s; //charf *buf; /* input block */ //ulg stored_len; /* length of input block */ @@ -1066,7 +1066,7 @@ const _tr_stored_block = (s, buf, stored_len, last) => * Send one empty static block to give enough lookahead for inflate. * This takes 10 bits, of which 7 may remain in the bit buffer. */ -const _tr_align = (s) => { +const _tr_align$1 = (s) => { send_bits(s, STATIC_TREES << 1, 3); send_code(s, END_BLOCK, static_ltree); bi_flush(s); @@ -1077,7 +1077,7 @@ const _tr_align = (s) => { * Determine the best encoding for the current block: dynamic trees, static * trees or store, and output the encoded block to the zip file. */ -const _tr_flush_block = (s, buf, stored_len, last) => +const _tr_flush_block$1 = (s, buf, stored_len, last) => //DeflateState *s; //charf *buf; /* input block, or NULL if too old */ //ulg stored_len; /* length of input block */ @@ -1090,7 +1090,7 @@ const _tr_flush_block = (s, buf, stored_len, last) => if (s.level > 0) { /* Check if the file is binary or text */ - if (s.strm.data_type === Z_UNKNOWN) { + if (s.strm.data_type === Z_UNKNOWN$1) { s.strm.data_type = detect_data_type(s); } @@ -1135,9 +1135,9 @@ const _tr_flush_block = (s, buf, stored_len, last) => * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to * transform a block into a stored block. */ - _tr_stored_block(s, buf, stored_len, last); + _tr_stored_block$1(s, buf, stored_len, last); - } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { + } else if (s.strategy === Z_FIXED$1 || static_lenb === opt_lenb) { send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); compress_block(s, static_ltree, static_dtree); @@ -1164,7 +1164,7 @@ const _tr_flush_block = (s, buf, stored_len, last) => * Save the match info and tally the frequency counts. Return true if * the current block must be flushed. */ -const _tr_tally = (s, dist, lc) => +const _tr_tally$1 = (s, dist, lc) => // deflate_state *s; // unsigned dist; /* distance of matched string */ // unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ @@ -1188,7 +1188,7 @@ const _tr_tally = (s, dist, lc) => // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); - s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++; + s.dyn_ltree[(_length_code[lc] + LITERALS$1 + 1) * 2]/*.Freq*/++; s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++; } @@ -1222,11 +1222,11 @@ const _tr_tally = (s, dist, lc) => */ }; -var _tr_init_1 = _tr_init; -var _tr_stored_block_1 = _tr_stored_block; -var _tr_flush_block_1 = _tr_flush_block; -var _tr_tally_1 = _tr_tally; -var _tr_align_1 = _tr_align; +var _tr_init_1 = _tr_init$1; +var _tr_stored_block_1 = _tr_stored_block$1; +var _tr_flush_block_1 = _tr_flush_block$1; +var _tr_tally_1 = _tr_tally$1; +var _tr_align_1 = _tr_align$1; var trees = { _tr_init: _tr_init_1, @@ -1394,7 +1394,7 @@ var messages = { // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -var constants = { +var constants$2 = { /* Allowed flush values; see deflate() and inflate() below for details */ Z_NO_FLUSH: 0, @@ -1461,7 +1461,7 @@ var constants = { // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -const { _tr_init: _tr_init$1, _tr_stored_block: _tr_stored_block$1, _tr_flush_block: _tr_flush_block$1, _tr_tally: _tr_tally$1, _tr_align: _tr_align$1 } = trees; +const { _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align } = trees; @@ -1470,42 +1470,42 @@ const { _tr_init: _tr_init$1, _tr_stored_block: _tr_stored_block$1, _tr_flush_bl /* ===========================================================================*/ const { - Z_NO_FLUSH, Z_PARTIAL_FLUSH, Z_FULL_FLUSH, Z_FINISH, Z_BLOCK, - Z_OK, Z_STREAM_END, Z_STREAM_ERROR, Z_DATA_ERROR, Z_BUF_ERROR, - Z_DEFAULT_COMPRESSION, - Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED: Z_FIXED$1, Z_DEFAULT_STRATEGY, - Z_UNKNOWN: Z_UNKNOWN$1, - Z_DEFLATED -} = constants; + Z_NO_FLUSH: Z_NO_FLUSH$2, Z_PARTIAL_FLUSH, Z_FULL_FLUSH: Z_FULL_FLUSH$1, Z_FINISH: Z_FINISH$3, Z_BLOCK: Z_BLOCK$1, + Z_OK: Z_OK$3, Z_STREAM_END: Z_STREAM_END$3, Z_STREAM_ERROR: Z_STREAM_ERROR$2, Z_DATA_ERROR: Z_DATA_ERROR$2, Z_BUF_ERROR: Z_BUF_ERROR$1, + Z_DEFAULT_COMPRESSION: Z_DEFAULT_COMPRESSION$1, + Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED, Z_DEFAULT_STRATEGY: Z_DEFAULT_STRATEGY$1, + Z_UNKNOWN, + Z_DEFLATED: Z_DEFLATED$2 +} = constants$2; /*============================================================================*/ const MAX_MEM_LEVEL = 9; /* Maximum value for memLevel in deflateInit2 */ -const MAX_WBITS = 15; +const MAX_WBITS$1 = 15; /* 32K LZ77 window */ const DEF_MEM_LEVEL = 8; -const LENGTH_CODES$1 = 29; +const LENGTH_CODES = 29; /* number of length codes, not counting the special END_BLOCK code */ -const LITERALS$1 = 256; +const LITERALS = 256; /* number of literal bytes 0..255 */ -const L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1; +const L_CODES = LITERALS + 1 + LENGTH_CODES; /* number of Literal or Length codes, including the END_BLOCK code */ -const D_CODES$1 = 30; +const D_CODES = 30; /* number of distance codes */ -const BL_CODES$1 = 19; +const BL_CODES = 19; /* number of codes used to transfer the bit lengths */ -const HEAP_SIZE$1 = 2 * L_CODES$1 + 1; +const HEAP_SIZE = 2 * L_CODES + 1; /* maximum heap size */ -const MAX_BITS$1 = 15; +const MAX_BITS = 15; /* All codes must not exceed MAX_BITS bits */ -const MIN_MATCH$1 = 3; -const MAX_MATCH$1 = 258; -const MIN_LOOKAHEAD = (MAX_MATCH$1 + MIN_MATCH$1 + 1); +const MIN_MATCH = 3; +const MAX_MATCH = 258; +const MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); const PRESET_DICT = 0x20; @@ -1533,7 +1533,7 @@ const rank = (f) => { return ((f) << 1) - ((f) > 4 ? 9 : 0); }; -const zero$1 = (buf) => { +const zero = (buf) => { let len = buf.length; while (--len >= 0) { buf[len] = 0; } }; @@ -1574,7 +1574,7 @@ const flush_pending = (strm) => { const flush_block_only = (s, last) => { - _tr_flush_block$1(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); + _tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); s.block_start = s.strstart; flush_pending(s.strm); }; @@ -1661,7 +1661,7 @@ const longest_match = (s, cur_match) => { * we prevent matches with the string of window index 0. */ - const strend = s.strstart + MAX_MATCH$1; + const strend = s.strstart + MAX_MATCH; let scan_end1 = _win[scan + best_len - 1]; let scan_end = _win[scan + best_len]; @@ -1724,8 +1724,8 @@ const longest_match = (s, cur_match) => { // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - len = MAX_MATCH$1 - (strend - scan); - scan = strend - MAX_MATCH$1; + len = MAX_MATCH - (strend - scan); + scan = strend - MAX_MATCH; if (len > best_len) { s.match_start = cur_match; @@ -1839,7 +1839,7 @@ const fill_window = (s) => { s.lookahead += n; /* Initialize the hash value now that we have some input: */ - if (s.lookahead + s.insert >= MIN_MATCH$1) { + if (s.lookahead + s.insert >= MIN_MATCH) { str = s.strstart - s.insert; s.ins_h = s.window[str]; @@ -1850,13 +1850,13 @@ const fill_window = (s) => { //#endif while (s.insert) { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]); s.prev[str & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = str; str++; s.insert--; - if (s.lookahead + s.insert < MIN_MATCH$1) { + if (s.lookahead + s.insert < MIN_MATCH) { break; } } @@ -1938,7 +1938,7 @@ const deflate_stored = (s, flush) => { // } fill_window(s); - if (s.lookahead === 0 && flush === Z_NO_FLUSH) { + if (s.lookahead === 0 && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } @@ -1984,7 +1984,7 @@ const deflate_stored = (s, flush) => { s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -2026,7 +2026,7 @@ const deflate_fast = (s, flush) => { */ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } if (s.lookahead === 0) { @@ -2038,9 +2038,9 @@ const deflate_fast = (s, flush) => { * dictionary, and set hash_head to the head of the hash chain: */ hash_head = 0/*NIL*/; - if (s.lookahead >= MIN_MATCH$1) { + if (s.lookahead >= MIN_MATCH) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -2057,24 +2057,24 @@ const deflate_fast = (s, flush) => { s.match_length = longest_match(s, hash_head); /* longest_match() sets match_start */ } - if (s.match_length >= MIN_MATCH$1) { + if (s.match_length >= MIN_MATCH) { // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only /*** _tr_tally_dist(s, s.strstart - s.match_start, s.match_length - MIN_MATCH, bflush); ***/ - bflush = _tr_tally$1(s, s.strstart - s.match_start, s.match_length - MIN_MATCH$1); + bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; /* Insert new strings in the hash table only if the match length * is not too large. This saves time but degrades compression. */ - if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH$1) { + if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) { s.match_length--; /* string at strstart already in table */ do { s.strstart++; /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -2102,7 +2102,7 @@ const deflate_fast = (s, flush) => { /* No match, output a literal byte */ //Tracevv((stderr,"%c", s.window[s.strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; @@ -2116,8 +2116,8 @@ const deflate_fast = (s, flush) => { /***/ } } - s.insert = ((s.strstart < (MIN_MATCH$1 - 1)) ? s.strstart : MIN_MATCH$1 - 1); - if (flush === Z_FINISH) { + s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1); + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -2158,7 +2158,7 @@ const deflate_slow = (s, flush) => { */ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } /* flush the current block */ @@ -2168,9 +2168,9 @@ const deflate_slow = (s, flush) => { * dictionary, and set hash_head to the head of the hash chain: */ hash_head = 0/*NIL*/; - if (s.lookahead >= MIN_MATCH$1) { + if (s.lookahead >= MIN_MATCH) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -2180,7 +2180,7 @@ const deflate_slow = (s, flush) => { */ s.prev_length = s.match_length; s.prev_match = s.match_start; - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) { @@ -2192,26 +2192,26 @@ const deflate_slow = (s, flush) => { /* longest_match() sets match_start */ if (s.match_length <= 5 && - (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH$1 && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { + (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { /* If prev_match is also MIN_MATCH, match_start is garbage * but we will ignore the current match anyway. */ - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; } } /* If there was a match at the previous step and the current * match is not better, output the previous match: */ - if (s.prev_length >= MIN_MATCH$1 && s.match_length <= s.prev_length) { - max_insert = s.strstart + s.lookahead - MIN_MATCH$1; + if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { + max_insert = s.strstart + s.lookahead - MIN_MATCH; /* Do not insert strings in hash table beyond this. */ //check_match(s, s.strstart-1, s.prev_match, s.prev_length); /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH, bflush);***/ - bflush = _tr_tally$1(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH$1); + bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); /* Insert in hash table all strings up to the end of the match. * strstart-1 and strstart are already inserted. If there is not * enough lookahead, the last two strings are not inserted in @@ -2222,14 +2222,14 @@ const deflate_slow = (s, flush) => { do { if (++s.strstart <= max_insert) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ } } while (--s.prev_length !== 0); s.match_available = 0; - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; s.strstart++; if (bflush) { @@ -2248,7 +2248,7 @@ const deflate_slow = (s, flush) => { */ //Tracevv((stderr,"%c", s->window[s->strstart-1])); /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]); + bflush = _tr_tally(s, 0, s.window[s.strstart - 1]); if (bflush) { /*** FLUSH_BLOCK_ONLY(s, 0) ***/ @@ -2273,12 +2273,12 @@ const deflate_slow = (s, flush) => { if (s.match_available) { //Tracevv((stderr,"%c", s->window[s->strstart-1])); /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]); + bflush = _tr_tally(s, 0, s.window[s.strstart - 1]); s.match_available = 0; } - s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1; - if (flush === Z_FINISH) { + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -2318,9 +2318,9 @@ const deflate_rle = (s, flush) => { * at the end of the input file. We need MAX_MATCH bytes * for the longest run, plus one for the unrolled loop. */ - if (s.lookahead <= MAX_MATCH$1) { + if (s.lookahead <= MAX_MATCH) { fill_window(s); - if (s.lookahead <= MAX_MATCH$1 && flush === Z_NO_FLUSH) { + if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } /* flush the current block */ @@ -2328,11 +2328,11 @@ const deflate_rle = (s, flush) => { /* See how many times the previous byte repeats */ s.match_length = 0; - if (s.lookahead >= MIN_MATCH$1 && s.strstart > 0) { + if (s.lookahead >= MIN_MATCH && s.strstart > 0) { scan = s.strstart - 1; prev = _win[scan]; if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { - strend = s.strstart + MAX_MATCH$1; + strend = s.strstart + MAX_MATCH; do { /*jshint noempty:false*/ } while (prev === _win[++scan] && prev === _win[++scan] && @@ -2340,7 +2340,7 @@ const deflate_rle = (s, flush) => { prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend); - s.match_length = MAX_MATCH$1 - (strend - scan); + s.match_length = MAX_MATCH - (strend - scan); if (s.match_length > s.lookahead) { s.match_length = s.lookahead; } @@ -2349,11 +2349,11 @@ const deflate_rle = (s, flush) => { } /* Emit match if have run of MIN_MATCH or longer, else emit literal */ - if (s.match_length >= MIN_MATCH$1) { + if (s.match_length >= MIN_MATCH) { //check_match(s, s.strstart, s.strstart - 1, s.match_length); /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ - bflush = _tr_tally$1(s, 1, s.match_length - MIN_MATCH$1); + bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; s.strstart += s.match_length; @@ -2362,7 +2362,7 @@ const deflate_rle = (s, flush) => { /* No match, output a literal byte */ //Tracevv((stderr,"%c", s->window[s->strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; @@ -2377,7 +2377,7 @@ const deflate_rle = (s, flush) => { } } s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -2410,7 +2410,7 @@ const deflate_huff = (s, flush) => { if (s.lookahead === 0) { fill_window(s); if (s.lookahead === 0) { - if (flush === Z_NO_FLUSH) { + if (flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } break; /* flush the current block */ @@ -2421,7 +2421,7 @@ const deflate_huff = (s, flush) => { s.match_length = 0; //Tracevv((stderr,"%c", s->window[s->strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; if (bflush) { @@ -2434,7 +2434,7 @@ const deflate_huff = (s, flush) => { } } s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -2492,7 +2492,7 @@ const lm_init = (s) => { s.window_size = 2 * s.w_size; /*** CLEAR_HASH(s); ***/ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); /* Set the default configuration parameters: */ @@ -2505,7 +2505,7 @@ const lm_init = (s) => { s.block_start = 0; s.lookahead = 0; s.insert = 0; - s.match_length = s.prev_length = MIN_MATCH$1 - 1; + s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; s.ins_h = 0; }; @@ -2521,7 +2521,7 @@ function DeflateState() { this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ this.gzhead = null; /* gzip header information to write */ this.gzindex = 0; /* where in extra, name, or comment */ - this.method = Z_DEFLATED; /* can only be DEFLATED */ + this.method = Z_DEFLATED$2; /* can only be DEFLATED */ this.last_flush = -1; /* value of flush param for previous deflate call */ this.w_size = 0; /* LZ77 window size (32K by default) */ @@ -2614,24 +2614,24 @@ function DeflateState() { // Use flat array of DOUBLE size, with interleaved fata, // because JS does not support effective - this.dyn_ltree = new Uint16Array(HEAP_SIZE$1 * 2); - this.dyn_dtree = new Uint16Array((2 * D_CODES$1 + 1) * 2); - this.bl_tree = new Uint16Array((2 * BL_CODES$1 + 1) * 2); - zero$1(this.dyn_ltree); - zero$1(this.dyn_dtree); - zero$1(this.bl_tree); + this.dyn_ltree = new Uint16Array(HEAP_SIZE * 2); + this.dyn_dtree = new Uint16Array((2 * D_CODES + 1) * 2); + this.bl_tree = new Uint16Array((2 * BL_CODES + 1) * 2); + zero(this.dyn_ltree); + zero(this.dyn_dtree); + zero(this.bl_tree); this.l_desc = null; /* desc. for literal tree */ this.d_desc = null; /* desc. for distance tree */ this.bl_desc = null; /* desc. for bit length tree */ //ush bl_count[MAX_BITS+1]; - this.bl_count = new Uint16Array(MAX_BITS$1 + 1); + this.bl_count = new Uint16Array(MAX_BITS + 1); /* number of codes at each bit length for an optimal tree */ //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ - this.heap = new Uint16Array(2 * L_CODES$1 + 1); /* heap used to build the Huffman trees */ - zero$1(this.heap); + this.heap = new Uint16Array(2 * L_CODES + 1); /* heap used to build the Huffman trees */ + zero(this.heap); this.heap_len = 0; /* number of elements in the heap */ this.heap_max = 0; /* element of largest frequency */ @@ -2639,8 +2639,8 @@ function DeflateState() { * The same heap array is used to build all trees. */ - this.depth = new Uint16Array(2 * L_CODES$1 + 1); //uch depth[2*L_CODES+1]; - zero$1(this.depth); + this.depth = new Uint16Array(2 * L_CODES + 1); //uch depth[2*L_CODES+1]; + zero(this.depth); /* Depth of each subtree used as tie breaker for trees of equal frequency */ @@ -2703,11 +2703,11 @@ function DeflateState() { const deflateResetKeep = (strm) => { if (!strm || !strm.state) { - return err(strm, Z_STREAM_ERROR); + return err(strm, Z_STREAM_ERROR$2); } strm.total_in = strm.total_out = 0; - strm.data_type = Z_UNKNOWN$1; + strm.data_type = Z_UNKNOWN; const s = strm.state; s.pending = 0; @@ -2722,16 +2722,16 @@ const deflateResetKeep = (strm) => { 0 // crc32(0, Z_NULL, 0) : 1; // adler32(0, Z_NULL, 0) - s.last_flush = Z_NO_FLUSH; - _tr_init$1(s); - return Z_OK; + s.last_flush = Z_NO_FLUSH$2; + _tr_init(s); + return Z_OK$3; }; const deflateReset = (strm) => { const ret = deflateResetKeep(strm); - if (ret === Z_OK) { + if (ret === Z_OK$3) { lm_init(strm.state); } return ret; @@ -2740,21 +2740,21 @@ const deflateReset = (strm) => { const deflateSetHeader = (strm, head) => { - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; } + if (!strm || !strm.state) { return Z_STREAM_ERROR$2; } + if (strm.state.wrap !== 2) { return Z_STREAM_ERROR$2; } strm.state.gzhead = head; - return Z_OK; + return Z_OK$3; }; const deflateInit2 = (strm, level, method, windowBits, memLevel, strategy) => { if (!strm) { // === Z_NULL - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } let wrap = 1; - if (level === Z_DEFAULT_COMPRESSION) { + if (level === Z_DEFAULT_COMPRESSION$1) { level = 6; } @@ -2769,10 +2769,10 @@ const deflateInit2 = (strm, level, method, windowBits, memLevel, strategy) => { } - if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED$2 || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_FIXED$1) { - return err(strm, Z_STREAM_ERROR); + strategy < 0 || strategy > Z_FIXED) { + return err(strm, Z_STREAM_ERROR$2); } @@ -2795,7 +2795,7 @@ const deflateInit2 = (strm, level, method, windowBits, memLevel, strategy) => { s.hash_bits = memLevel + 7; s.hash_size = 1 << s.hash_bits; s.hash_mask = s.hash_size - 1; - s.hash_shift = ~~((s.hash_bits + MIN_MATCH$1 - 1) / MIN_MATCH$1); + s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); s.window = new Uint8Array(s.w_size * 2); s.head = new Uint16Array(s.hash_size); @@ -2828,25 +2828,25 @@ const deflateInit2 = (strm, level, method, windowBits, memLevel, strategy) => { const deflateInit = (strm, level) => { - return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); + return deflateInit2(strm, level, Z_DEFLATED$2, MAX_WBITS$1, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY$1); }; -const deflate = (strm, flush) => { +const deflate$2 = (strm, flush) => { let beg, val; // for gzip header write only if (!strm || !strm.state || - flush > Z_BLOCK || flush < 0) { - return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; + flush > Z_BLOCK$1 || flush < 0) { + return strm ? err(strm, Z_STREAM_ERROR$2) : Z_STREAM_ERROR$2; } const s = strm.state; if (!strm.output || (!strm.input && strm.avail_in !== 0) || - (s.status === FINISH_STATE && flush !== Z_FINISH)) { - return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR); + (s.status === FINISH_STATE && flush !== Z_FINISH$3)) { + return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR$1 : Z_STREAM_ERROR$2); } s.strm = strm; /* just in case */ @@ -2901,7 +2901,7 @@ const deflate = (strm, flush) => { } else // DEFLATE header { - let header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8; + let header = (Z_DEFLATED$2 + ((s.w_bits - 8) << 4)) << 8; let level_flags = -1; if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { @@ -3064,7 +3064,7 @@ const deflate = (strm, flush) => { * return OK instead of BUF_ERROR at next call of deflate: */ s.last_flush = -1; - return Z_OK; + return Z_OK$3; } /* Make sure there is something to do and avoid duplicate consecutive @@ -3072,19 +3072,19 @@ const deflate = (strm, flush) => { * returning Z_STREAM_END instead of Z_BUF_ERROR. */ } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && - flush !== Z_FINISH) { - return err(strm, Z_BUF_ERROR); + flush !== Z_FINISH$3) { + return err(strm, Z_BUF_ERROR$1); } /* User must not provide more input after the first FINISH: */ if (s.status === FINISH_STATE && strm.avail_in !== 0) { - return err(strm, Z_BUF_ERROR); + return err(strm, Z_BUF_ERROR$1); } /* Start a new block or continue the current one. */ if (strm.avail_in !== 0 || s.lookahead !== 0 || - (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) { + (flush !== Z_NO_FLUSH$2 && s.status !== FINISH_STATE)) { let bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) : (s.strategy === Z_RLE ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush)); @@ -3097,7 +3097,7 @@ const deflate = (strm, flush) => { s.last_flush = -1; /* avoid BUF_ERROR next call, see above */ } - return Z_OK; + return Z_OK$3; /* If flush != Z_NO_FLUSH && avail_out == 0, the next call * of deflate should use the same flush parameter to make sure * that the flush is complete. So we don't have to output an @@ -3108,17 +3108,17 @@ const deflate = (strm, flush) => { } if (bstate === BS_BLOCK_DONE) { if (flush === Z_PARTIAL_FLUSH) { - _tr_align$1(s); + _tr_align(s); } - else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ + else if (flush !== Z_BLOCK$1) { /* FULL_FLUSH or SYNC_FLUSH */ - _tr_stored_block$1(s, 0, 0, false); + _tr_stored_block(s, 0, 0, false); /* For a full flush, this empty block will be recognized * as a special marker by inflate_sync(). */ - if (flush === Z_FULL_FLUSH) { + if (flush === Z_FULL_FLUSH$1) { /*** CLEAR_HASH(s); ***/ /* forget history */ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); if (s.lookahead === 0) { s.strstart = 0; @@ -3130,15 +3130,15 @@ const deflate = (strm, flush) => { flush_pending(strm); if (strm.avail_out === 0) { s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ - return Z_OK; + return Z_OK$3; } } } //Assert(strm->avail_out > 0, "bug2"); //if (strm.avail_out <= 0) { throw new Error("bug2");} - if (flush !== Z_FINISH) { return Z_OK; } - if (s.wrap <= 0) { return Z_STREAM_END; } + if (flush !== Z_FINISH$3) { return Z_OK$3; } + if (s.wrap <= 0) { return Z_STREAM_END$3; } /* Write the trailer */ if (s.wrap === 2) { @@ -3163,14 +3163,14 @@ const deflate = (strm, flush) => { */ if (s.wrap > 0) { s.wrap = -s.wrap; } /* write the trailer only once! */ - return s.pending !== 0 ? Z_OK : Z_STREAM_END; + return s.pending !== 0 ? Z_OK$3 : Z_STREAM_END$3; }; const deflateEnd = (strm) => { if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } const status = strm.state.status; @@ -3182,12 +3182,12 @@ const deflateEnd = (strm) => { status !== BUSY_STATE && status !== FINISH_STATE ) { - return err(strm, Z_STREAM_ERROR); + return err(strm, Z_STREAM_ERROR$2); } strm.state = null; - return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; + return status === BUSY_STATE ? err(strm, Z_DATA_ERROR$2) : Z_OK$3; }; @@ -3200,14 +3200,14 @@ const deflateSetDictionary = (strm, dictionary) => { let dictLength = dictionary.length; if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } const s = strm.state; const wrap = s.wrap; if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } /* when using zlib wrappers, compute Adler-32 for provided dictionary */ @@ -3222,7 +3222,7 @@ const deflateSetDictionary = (strm, dictionary) => { if (dictLength >= s.w_size) { if (wrap === 0) { /* already empty otherwise */ /*** CLEAR_HASH(s); ***/ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); s.strstart = 0; s.block_start = 0; s.insert = 0; @@ -3242,12 +3242,12 @@ const deflateSetDictionary = (strm, dictionary) => { strm.next_in = 0; strm.input = dictionary; fill_window(s); - while (s.lookahead >= MIN_MATCH$1) { + while (s.lookahead >= MIN_MATCH) { let str = s.strstart; - let n = s.lookahead - (MIN_MATCH$1 - 1); + let n = s.lookahead - (MIN_MATCH - 1); do { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]); s.prev[str & s.w_mask] = s.head[s.ins_h]; @@ -3255,20 +3255,20 @@ const deflateSetDictionary = (strm, dictionary) => { str++; } while (--n); s.strstart = str; - s.lookahead = MIN_MATCH$1 - 1; + s.lookahead = MIN_MATCH - 1; fill_window(s); } s.strstart += s.lookahead; s.block_start = s.strstart; s.insert = s.lookahead; s.lookahead = 0; - s.match_length = s.prev_length = MIN_MATCH$1 - 1; + s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; strm.next_in = next; strm.input = input; strm.avail_in = avail; s.wrap = wrap; - return Z_OK; + return Z_OK$3; }; @@ -3277,7 +3277,7 @@ var deflateInit2_1 = deflateInit2; var deflateReset_1 = deflateReset; var deflateResetKeep_1 = deflateResetKeep; var deflateSetHeader_1 = deflateSetHeader; -var deflate_2 = deflate; +var deflate_2$1 = deflate$2; var deflateEnd_1 = deflateEnd; var deflateSetDictionary_1 = deflateSetDictionary; var deflateInfo = 'pako deflate (from Nodeca project)'; @@ -3291,13 +3291,13 @@ module.exports.deflatePrime = deflatePrime; module.exports.deflateTune = deflateTune; */ -var deflate_1 = { +var deflate_1$2 = { deflateInit: deflateInit_1, deflateInit2: deflateInit2_1, deflateReset: deflateReset_1, deflateResetKeep: deflateResetKeep_1, deflateSetHeader: deflateSetHeader_1, - deflate: deflate_2, + deflate: deflate_2$1, deflateEnd: deflateEnd_1, deflateSetDictionary: deflateSetDictionary_1, deflateInfo: deflateInfo @@ -3379,6 +3379,10 @@ _utf8len[254] = _utf8len[254] = 1; // Invalid sequence start // convert string to array (typed, when possible) var string2buf = (str) => { + if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) { + return new TextEncoder().encode(str); + } + let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; // count binary size @@ -3452,9 +3456,14 @@ const buf2binstring = (buf, len) => { // convert array to string var buf2string = (buf, max) => { - let i, out; const len = max || buf.length; + if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) { + return new TextDecoder().decode(buf.subarray(0, max)); + } + + let i, out; + // Reserve max possible length (2 words per char) // NB: by unknown reasons, Array is significantly faster for // String.fromCharCode.apply than Uint16Array. @@ -3571,18 +3580,18 @@ function ZStream() { var zstream = ZStream; -const toString = Object.prototype.toString; +const toString$1 = Object.prototype.toString; /* Public constants ==========================================================*/ /* ===========================================================================*/ const { - Z_NO_FLUSH: Z_NO_FLUSH$1, Z_SYNC_FLUSH, Z_FULL_FLUSH: Z_FULL_FLUSH$1, Z_FINISH: Z_FINISH$1, - Z_OK: Z_OK$1, Z_STREAM_END: Z_STREAM_END$1, - Z_DEFAULT_COMPRESSION: Z_DEFAULT_COMPRESSION$1, - Z_DEFAULT_STRATEGY: Z_DEFAULT_STRATEGY$1, + Z_NO_FLUSH: Z_NO_FLUSH$1, Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH: Z_FINISH$2, + Z_OK: Z_OK$2, Z_STREAM_END: Z_STREAM_END$2, + Z_DEFAULT_COMPRESSION, + Z_DEFAULT_STRATEGY, Z_DEFLATED: Z_DEFLATED$1 -} = constants; +} = constants$2; /* ===========================================================================*/ @@ -3672,14 +3681,14 @@ const { * console.log(deflate.result); * ``` **/ -function Deflate(options) { +function Deflate$1(options) { this.options = common.assign({ - level: Z_DEFAULT_COMPRESSION$1, + level: Z_DEFAULT_COMPRESSION, method: Z_DEFLATED$1, chunkSize: 16384, windowBits: 15, memLevel: 8, - strategy: Z_DEFAULT_STRATEGY$1 + strategy: Z_DEFAULT_STRATEGY }, options || {}); let opt = this.options; @@ -3700,7 +3709,7 @@ function Deflate(options) { this.strm = new zstream(); this.strm.avail_out = 0; - let status = deflate_1.deflateInit2( + let status = deflate_1$2.deflateInit2( this.strm, opt.level, opt.method, @@ -3709,12 +3718,12 @@ function Deflate(options) { opt.strategy ); - if (status !== Z_OK$1) { + if (status !== Z_OK$2) { throw new Error(messages[status]); } if (opt.header) { - deflate_1.deflateSetHeader(this.strm, opt.header); + deflate_1$2.deflateSetHeader(this.strm, opt.header); } if (opt.dictionary) { @@ -3723,15 +3732,15 @@ function Deflate(options) { if (typeof opt.dictionary === 'string') { // If we need to compress text, change encoding to utf8. dict = strings.string2buf(opt.dictionary); - } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { + } else if (toString$1.call(opt.dictionary) === '[object ArrayBuffer]') { dict = new Uint8Array(opt.dictionary); } else { dict = opt.dictionary; } - status = deflate_1.deflateSetDictionary(this.strm, dict); + status = deflate_1$2.deflateSetDictionary(this.strm, dict); - if (status !== Z_OK$1) { + if (status !== Z_OK$2) { throw new Error(messages[status]); } @@ -3761,7 +3770,7 @@ function Deflate(options) { * push(chunk, true); // push last chunk * ``` **/ -Deflate.prototype.push = function (data, flush_mode) { +Deflate$1.prototype.push = function (data, flush_mode) { const strm = this.strm; const chunkSize = this.options.chunkSize; let status, _flush_mode; @@ -3769,13 +3778,13 @@ Deflate.prototype.push = function (data, flush_mode) { if (this.ended) { return false; } if (flush_mode === ~~flush_mode) _flush_mode = flush_mode; - else _flush_mode = flush_mode === true ? Z_FINISH$1 : Z_NO_FLUSH$1; + else _flush_mode = flush_mode === true ? Z_FINISH$2 : Z_NO_FLUSH$1; // Convert data if needed if (typeof data === 'string') { // If we need to compress text, change encoding to utf8. strm.input = strings.string2buf(data); - } else if (toString.call(data) === '[object ArrayBuffer]') { + } else if (toString$1.call(data) === '[object ArrayBuffer]') { strm.input = new Uint8Array(data); } else { strm.input = data; @@ -3792,23 +3801,23 @@ Deflate.prototype.push = function (data, flush_mode) { } // Make sure avail_out > 6 to avoid repeating markers - if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH$1) && strm.avail_out <= 6) { + if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH) && strm.avail_out <= 6) { this.onData(strm.output.subarray(0, strm.next_out)); strm.avail_out = 0; continue; } - status = deflate_1.deflate(strm, _flush_mode); + status = deflate_1$2.deflate(strm, _flush_mode); // Ended => flush and finish - if (status === Z_STREAM_END$1) { + if (status === Z_STREAM_END$2) { if (strm.next_out > 0) { this.onData(strm.output.subarray(0, strm.next_out)); } - status = deflate_1.deflateEnd(this.strm); + status = deflate_1$2.deflateEnd(this.strm); this.onEnd(status); this.ended = true; - return status === Z_OK$1; + return status === Z_OK$2; } // Flush if out buffer full @@ -3838,7 +3847,7 @@ Deflate.prototype.push = function (data, flush_mode) { * By default, stores data blocks in `chunks[]` property and glue * those in `onEnd`. Override this handler, if you need another behaviour. **/ -Deflate.prototype.onData = function (chunk) { +Deflate$1.prototype.onData = function (chunk) { this.chunks.push(chunk); }; @@ -3852,9 +3861,9 @@ Deflate.prototype.onData = function (chunk) { * complete (Z_FINISH). By default - join collected chunks, * free memory and fill `results` / `err` properties. **/ -Deflate.prototype.onEnd = function (status) { +Deflate$1.prototype.onEnd = function (status) { // On success - join - if (status === Z_OK$1) { + if (status === Z_OK$2) { this.result = common.flattenChunks(this.chunks); } this.chunks = []; @@ -3896,7 +3905,7 @@ Deflate.prototype.onEnd = function (status) { * ``` **/ function deflate$1(input, options) { - const deflator = new Deflate(options); + const deflator = new Deflate$1(options); deflator.push(input, true); @@ -3915,7 +3924,7 @@ function deflate$1(input, options) { * The same as [[deflate]], but creates raw data, without wrapper * (header and adler32 crc). **/ -function deflateRaw(input, options) { +function deflateRaw$1(input, options) { options = options || {}; options.raw = true; return deflate$1(input, options); @@ -3930,24 +3939,24 @@ function deflateRaw(input, options) { * The same as [[deflate]], but create gzip wrapper instead of * deflate one. **/ -function gzip(input, options) { +function gzip$1(input, options) { options = options || {}; options.gzip = true; return deflate$1(input, options); } -var Deflate_1 = Deflate; -var deflate_2$1 = deflate$1; -var deflateRaw_1 = deflateRaw; -var gzip_1 = gzip; -var constants$1 = constants; +var Deflate_1$1 = Deflate$1; +var deflate_2 = deflate$1; +var deflateRaw_1$1 = deflateRaw$1; +var gzip_1$1 = gzip$1; +var constants$1 = constants$2; var deflate_1$1 = { - Deflate: Deflate_1, - deflate: deflate_2$1, - deflateRaw: deflateRaw_1, - gzip: gzip_1, + Deflate: Deflate_1$1, + deflate: deflate_2, + deflateRaw: deflateRaw_1$1, + gzip: gzip_1$1, constants: constants$1 }; @@ -3971,8 +3980,8 @@ var deflate_1$1 = { // 3. This notice may not be removed or altered from any source distribution. // See state defs from inflate.js -const BAD = 30; /* got a data error -- remain here until reset */ -const TYPE = 12; /* i: waiting for type bits, including last-flag bit */ +const BAD$1 = 30; /* got a data error -- remain here until reset */ +const TYPE$1 = 12; /* i: waiting for type bits, including last-flag bit */ /* Decode literal, length, and distance codes and write out the resulting @@ -4134,7 +4143,7 @@ var inffast = function inflate_fast(strm, start) { //#ifdef INFLATE_STRICT if (dist > dmax) { strm.msg = 'invalid distance too far back'; - state.mode = BAD; + state.mode = BAD$1; break top; } //#endif @@ -4147,7 +4156,7 @@ var inffast = function inflate_fast(strm, start) { if (op > whave) { if (state.sane) { strm.msg = 'invalid distance too far back'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -4252,7 +4261,7 @@ var inffast = function inflate_fast(strm, start) { } else { strm.msg = 'invalid distance code'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -4265,12 +4274,12 @@ var inffast = function inflate_fast(strm, start) { } else if (op & 32) { /* end-of-block */ //Tracevv((stderr, "inflate: end of block\n")); - state.mode = TYPE; + state.mode = TYPE$1; break top; } else { strm.msg = 'invalid literal/length code'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -4314,13 +4323,13 @@ var inffast = function inflate_fast(strm, start) { // 3. This notice may not be removed or altered from any source distribution. const MAXBITS = 15; -const ENOUGH_LENS = 852; -const ENOUGH_DISTS = 592; +const ENOUGH_LENS$1 = 852; +const ENOUGH_DISTS$1 = 592; //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); -const CODES = 0; -const LENS = 1; -const DISTS = 2; +const CODES$1 = 0; +const LENS$1 = 1; +const DISTS$1 = 2; const lbase = new Uint16Array([ /* Length codes 257..285 base */ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, @@ -4452,7 +4461,7 @@ const inflate_table = (type, lens, lens_index, codes, table, table_index, work, return -1; } /* over-subscribed */ } - if (left > 0 && (type === CODES || max !== 1)) { + if (left > 0 && (type === CODES$1 || max !== 1)) { return -1; /* incomplete set */ } @@ -4503,11 +4512,11 @@ const inflate_table = (type, lens, lens_index, codes, table, table_index, work, /* set up for code type */ // poor man optimization - use if-else instead of switch, // to avoid deopts in old v8 - if (type === CODES) { + if (type === CODES$1) { base = extra = work; /* dummy value--not used */ end = 19; - } else if (type === LENS) { + } else if (type === LENS$1) { base = lbase; base_index -= 257; extra = lext; @@ -4532,8 +4541,8 @@ const inflate_table = (type, lens, lens_index, codes, table, table_index, work, mask = used - 1; /* mask for comparing low */ /* check available table space */ - if ((type === LENS && used > ENOUGH_LENS) || - (type === DISTS && used > ENOUGH_DISTS)) { + if ((type === LENS$1 && used > ENOUGH_LENS$1) || + (type === DISTS$1 && used > ENOUGH_DISTS$1)) { return 1; } @@ -4604,8 +4613,8 @@ const inflate_table = (type, lens, lens_index, codes, table, table_index, work, /* check for enough space */ used += 1 << curr; - if ((type === LENS && used > ENOUGH_LENS) || - (type === DISTS && used > ENOUGH_DISTS)) { + if ((type === LENS$1 && used > ENOUGH_LENS$1) || + (type === DISTS$1 && used > ENOUGH_DISTS$1)) { return 1; } @@ -4661,18 +4670,18 @@ var inftrees = inflate_table; -const CODES$1 = 0; -const LENS$1 = 1; -const DISTS$1 = 2; +const CODES = 0; +const LENS = 1; +const DISTS = 2; /* Public constants ==========================================================*/ /* ===========================================================================*/ const { - Z_FINISH: Z_FINISH$2, Z_BLOCK: Z_BLOCK$1, Z_TREES, - Z_OK: Z_OK$2, Z_STREAM_END: Z_STREAM_END$2, Z_NEED_DICT, Z_STREAM_ERROR: Z_STREAM_ERROR$1, Z_DATA_ERROR: Z_DATA_ERROR$1, Z_MEM_ERROR, Z_BUF_ERROR: Z_BUF_ERROR$1, - Z_DEFLATED: Z_DEFLATED$2 -} = constants; + Z_FINISH: Z_FINISH$1, Z_BLOCK, Z_TREES, + Z_OK: Z_OK$1, Z_STREAM_END: Z_STREAM_END$1, Z_NEED_DICT: Z_NEED_DICT$1, Z_STREAM_ERROR: Z_STREAM_ERROR$1, Z_DATA_ERROR: Z_DATA_ERROR$1, Z_MEM_ERROR: Z_MEM_ERROR$1, Z_BUF_ERROR, + Z_DEFLATED +} = constants$2; /* STATES ====================================================================*/ @@ -4690,7 +4699,7 @@ const COMMENT = 8; /* i: waiting for end of comment (gzip) */ const HCRC = 9; /* i: waiting for header crc (gzip) */ const DICTID = 10; /* i: waiting for dictionary check value */ const DICT = 11; /* waiting for inflateSetDictionary() call */ -const TYPE$1 = 12; /* i: waiting for type bits, including last-flag bit */ +const TYPE = 12; /* i: waiting for type bits, including last-flag bit */ const TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ const STORED = 14; /* i: waiting for stored size (length and complement) */ const COPY_ = 15; /* i/o: same as COPY below, but only first time in */ @@ -4708,7 +4717,7 @@ const LIT = 26; /* o: waiting for output space to write literal const CHECK = 27; /* i: waiting for 32-bit check value */ const LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ const DONE = 29; /* finished check, done -- remain here until reset */ -const BAD$1 = 30; /* got a data error -- remain here until reset */ +const BAD = 30; /* got a data error -- remain here until reset */ const MEM = 31; /* got an inflate() memory error -- remain here until reset */ const SYNC = 32; /* looking for synchronization bytes to restart inflate() */ @@ -4716,13 +4725,13 @@ const SYNC = 32; /* looking for synchronization bytes to restart inflate -const ENOUGH_LENS$1 = 852; -const ENOUGH_DISTS$1 = 592; +const ENOUGH_LENS = 852; +const ENOUGH_DISTS = 592; //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); -const MAX_WBITS$1 = 15; +const MAX_WBITS = 15; /* 32K LZ77 window */ -const DEF_WBITS = MAX_WBITS$1; +const DEF_WBITS = MAX_WBITS; const zswap32 = (q) => { @@ -4810,13 +4819,13 @@ const inflateResetKeep = (strm) => { state.hold = 0; state.bits = 0; //state.lencode = state.distcode = state.next = state.codes; - state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS$1); - state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS$1); + state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS); + state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS); state.sane = 1; state.back = -1; //Tracev((stderr, "inflate: reset\n")); - return Z_OK$2; + return Z_OK$1; }; @@ -4878,7 +4887,7 @@ const inflateInit2 = (strm, windowBits) => { strm.state = state; state.window = null/*Z_NULL*/; const ret = inflateReset2(strm, windowBits); - if (ret !== Z_OK$2) { + if (ret !== Z_OK$1) { strm.state = null/*Z_NULL*/; } return ret; @@ -4920,13 +4929,13 @@ const fixedtables = (state) => { while (sym < 280) { state.lens[sym++] = 7; } while (sym < 288) { state.lens[sym++] = 8; } - inftrees(LENS$1, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); + inftrees(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); /* distance table */ sym = 0; while (sym < 32) { state.lens[sym++] = 5; } - inftrees(DISTS$1, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); + inftrees(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); /* do this just once */ virgin = false; @@ -4997,7 +5006,7 @@ const updatewindow = (strm, src, end, copy) => { }; -const inflate = (strm, flush) => { +const inflate$2 = (strm, flush) => { let state; let input, output; // input/output buffers @@ -5031,7 +5040,7 @@ const inflate = (strm, flush) => { } state = strm.state; - if (state.mode === TYPE$1) { state.mode = TYPEDO; } /* skip check */ + if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ //--- LOAD() --- @@ -5047,7 +5056,7 @@ const inflate = (strm, flush) => { _in = have; _out = left; - ret = Z_OK$2; + ret = Z_OK$1; inf_leave: // goto emulation for (;;) { @@ -5087,12 +5096,12 @@ const inflate = (strm, flush) => { if (!(state.wrap & 1) || /* check if zlib header allowed */ (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) { strm.msg = 'incorrect header check'; - state.mode = BAD$1; + state.mode = BAD; break; } - if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED$2) { + if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) { strm.msg = 'unknown compression method'; - state.mode = BAD$1; + state.mode = BAD; break; } //--- DROPBITS(4) ---// @@ -5105,7 +5114,7 @@ const inflate = (strm, flush) => { } else if (len > state.wbits) { strm.msg = 'invalid window size'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -5116,7 +5125,7 @@ const inflate = (strm, flush) => { //Tracev((stderr, "inflate: zlib header ok\n")); strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; - state.mode = hold & 0x200 ? DICTID : TYPE$1; + state.mode = hold & 0x200 ? DICTID : TYPE; //=== INITBITS(); hold = 0; bits = 0; @@ -5132,14 +5141,14 @@ const inflate = (strm, flush) => { } //===// state.flags = hold; - if ((state.flags & 0xff) !== Z_DEFLATED$2) { + if ((state.flags & 0xff) !== Z_DEFLATED) { strm.msg = 'unknown compression method'; - state.mode = BAD$1; + state.mode = BAD; break; } if (state.flags & 0xe000) { strm.msg = 'unknown header flags set'; - state.mode = BAD$1; + state.mode = BAD; break; } if (state.head) { @@ -5342,7 +5351,7 @@ const inflate = (strm, flush) => { //===// if (hold !== (state.check & 0xffff)) { strm.msg = 'header crc mismatch'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -5355,7 +5364,7 @@ const inflate = (strm, flush) => { state.head.done = true; } strm.adler = state.check = 0; - state.mode = TYPE$1; + state.mode = TYPE; break; case DICTID: //=== NEEDBITS(32); */ @@ -5383,13 +5392,13 @@ const inflate = (strm, flush) => { state.hold = hold; state.bits = bits; //--- - return Z_NEED_DICT; + return Z_NEED_DICT$1; } strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; - state.mode = TYPE$1; + state.mode = TYPE; /* falls through */ - case TYPE$1: - if (flush === Z_BLOCK$1 || flush === Z_TREES) { break inf_leave; } + case TYPE: + if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } /* falls through */ case TYPEDO: if (state.last) { @@ -5440,7 +5449,7 @@ const inflate = (strm, flush) => { break; case 3: strm.msg = 'invalid block type'; - state.mode = BAD$1; + state.mode = BAD; } //--- DROPBITS(2) ---// hold >>>= 2; @@ -5462,7 +5471,7 @@ const inflate = (strm, flush) => { //===// if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { strm.msg = 'invalid stored block lengths'; - state.mode = BAD$1; + state.mode = BAD; break; } state.length = hold & 0xffff; @@ -5495,7 +5504,7 @@ const inflate = (strm, flush) => { break; } //Tracev((stderr, "inflate: stored end\n")); - state.mode = TYPE$1; + state.mode = TYPE; break; case TABLE: //=== NEEDBITS(14); */ @@ -5524,7 +5533,7 @@ const inflate = (strm, flush) => { //#ifndef PKZIP_BUG_WORKAROUND if (state.nlen > 286 || state.ndist > 30) { strm.msg = 'too many length or distance symbols'; - state.mode = BAD$1; + state.mode = BAD; break; } //#endif @@ -5559,12 +5568,12 @@ const inflate = (strm, flush) => { state.lenbits = 7; opts = { bits: state.lenbits }; - ret = inftrees(CODES$1, state.lens, 0, 19, state.lencode, 0, state.work, opts); + ret = inftrees(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); state.lenbits = opts.bits; if (ret) { strm.msg = 'invalid code lengths set'; - state.mode = BAD$1; + state.mode = BAD; break; } //Tracev((stderr, "inflate: code lengths ok\n")); @@ -5611,7 +5620,7 @@ const inflate = (strm, flush) => { //---// if (state.have === 0) { strm.msg = 'invalid bit length repeat'; - state.mode = BAD$1; + state.mode = BAD; break; } len = state.lens[state.have - 1]; @@ -5665,7 +5674,7 @@ const inflate = (strm, flush) => { } if (state.have + copy > state.nlen + state.ndist) { strm.msg = 'invalid bit length repeat'; - state.mode = BAD$1; + state.mode = BAD; break; } while (copy--) { @@ -5675,12 +5684,12 @@ const inflate = (strm, flush) => { } /* handle error breaks in while */ - if (state.mode === BAD$1) { break; } + if (state.mode === BAD) { break; } /* check for end-of-block code (better have one) */ if (state.lens[256] === 0) { strm.msg = 'invalid code -- missing end-of-block'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -5690,7 +5699,7 @@ const inflate = (strm, flush) => { state.lenbits = 9; opts = { bits: state.lenbits }; - ret = inftrees(LENS$1, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); + ret = inftrees(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. // state.next_index = opts.table_index; state.lenbits = opts.bits; @@ -5698,7 +5707,7 @@ const inflate = (strm, flush) => { if (ret) { strm.msg = 'invalid literal/lengths set'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -5707,7 +5716,7 @@ const inflate = (strm, flush) => { // Switch to use dynamic table state.distcode = state.distdyn; opts = { bits: state.distbits }; - ret = inftrees(DISTS$1, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); + ret = inftrees(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. // state.next_index = opts.table_index; state.distbits = opts.bits; @@ -5715,7 +5724,7 @@ const inflate = (strm, flush) => { if (ret) { strm.msg = 'invalid distances set'; - state.mode = BAD$1; + state.mode = BAD; break; } //Tracev((stderr, 'inflate: codes ok\n')); @@ -5747,7 +5756,7 @@ const inflate = (strm, flush) => { bits = state.bits; //--- - if (state.mode === TYPE$1) { + if (state.mode === TYPE) { state.back = -1; } break; @@ -5808,12 +5817,12 @@ const inflate = (strm, flush) => { if (here_op & 32) { //Tracevv((stderr, "inflate: end of block\n")); state.back = -1; - state.mode = TYPE$1; + state.mode = TYPE; break; } if (here_op & 64) { strm.msg = 'invalid literal/length code'; - state.mode = BAD$1; + state.mode = BAD; break; } state.extra = here_op & 15; @@ -5888,7 +5897,7 @@ const inflate = (strm, flush) => { state.back += here_bits; if (here_op & 64) { strm.msg = 'invalid distance code'; - state.mode = BAD$1; + state.mode = BAD; break; } state.offset = here_val; @@ -5916,7 +5925,7 @@ const inflate = (strm, flush) => { //#ifdef INFLATE_STRICT if (state.offset > state.dmax) { strm.msg = 'invalid distance too far back'; - state.mode = BAD$1; + state.mode = BAD; break; } //#endif @@ -5931,7 +5940,7 @@ const inflate = (strm, flush) => { if (copy > state.whave) { if (state.sane) { strm.msg = 'invalid distance too far back'; - state.mode = BAD$1; + state.mode = BAD; break; } // (!) This block is disabled in zlib defaults, @@ -6003,7 +6012,7 @@ const inflate = (strm, flush) => { // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too if ((state.flags ? hold : zswap32(hold)) !== state.check) { strm.msg = 'incorrect data check'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -6026,7 +6035,7 @@ const inflate = (strm, flush) => { //===// if (hold !== (state.total & 0xffffffff)) { strm.msg = 'incorrect length check'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -6038,13 +6047,13 @@ const inflate = (strm, flush) => { state.mode = DONE; /* falls through */ case DONE: - ret = Z_STREAM_END$2; + ret = Z_STREAM_END$1; break inf_leave; - case BAD$1: + case BAD: ret = Z_DATA_ERROR$1; break inf_leave; case MEM: - return Z_MEM_ERROR; + return Z_MEM_ERROR$1; case SYNC: /* falls through */ default: @@ -6070,8 +6079,8 @@ const inflate = (strm, flush) => { state.bits = bits; //--- - if (state.wsize || (_out !== strm.avail_out && state.mode < BAD$1 && - (state.mode < CHECK || flush !== Z_FINISH$2))) { + if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && + (state.mode < CHECK || flush !== Z_FINISH$1))) { if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) ; } _in -= strm.avail_in; @@ -6084,10 +6093,10 @@ const inflate = (strm, flush) => { (state.flags ? crc32_1(state.check, output, _out, strm.next_out - _out) : adler32_1(state.check, output, _out, strm.next_out - _out)); } strm.data_type = state.bits + (state.last ? 64 : 0) + - (state.mode === TYPE$1 ? 128 : 0) + + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); - if (((_in === 0 && _out === 0) || flush === Z_FINISH$2) && ret === Z_OK$2) { - ret = Z_BUF_ERROR$1; + if (((_in === 0 && _out === 0) || flush === Z_FINISH$1) && ret === Z_OK$1) { + ret = Z_BUF_ERROR; } return ret; }; @@ -6104,7 +6113,7 @@ const inflateEnd = (strm) => { state.window = null; } strm.state = null; - return Z_OK$2; + return Z_OK$1; }; @@ -6118,7 +6127,7 @@ const inflateGetHeader = (strm, head) => { /* save header structure */ state.head = head; head.done = false; - return Z_OK$2; + return Z_OK$1; }; @@ -6151,11 +6160,11 @@ const inflateSetDictionary = (strm, dictionary) => { ret = updatewindow(strm, dictionary, dictLength, dictLength); if (ret) { state.mode = MEM; - return Z_MEM_ERROR; + return Z_MEM_ERROR$1; } state.havedict = 1; // Tracev((stderr, "inflate: dictionary set\n")); - return Z_OK$2; + return Z_OK$1; }; @@ -6164,7 +6173,7 @@ var inflateReset2_1 = inflateReset2; var inflateResetKeep_1 = inflateResetKeep; var inflateInit_1 = inflateInit; var inflateInit2_1 = inflateInit2; -var inflate_2 = inflate; +var inflate_2$1 = inflate$2; var inflateEnd_1 = inflateEnd; var inflateGetHeader_1 = inflateGetHeader; var inflateSetDictionary_1 = inflateSetDictionary; @@ -6180,13 +6189,13 @@ module.exports.inflateSyncPoint = inflateSyncPoint; module.exports.inflateUndermine = inflateUndermine; */ -var inflate_1 = { +var inflate_1$2 = { inflateReset: inflateReset_1, inflateReset2: inflateReset2_1, inflateResetKeep: inflateResetKeep_1, inflateInit: inflateInit_1, inflateInit2: inflateInit2_1, - inflate: inflate_2, + inflate: inflate_2$1, inflateEnd: inflateEnd_1, inflateGetHeader: inflateGetHeader_1, inflateSetDictionary: inflateSetDictionary_1, @@ -6250,15 +6259,15 @@ function GZheader() { var gzheader = GZheader; -const toString$1 = Object.prototype.toString; +const toString = Object.prototype.toString; /* Public constants ==========================================================*/ /* ===========================================================================*/ const { - Z_NO_FLUSH: Z_NO_FLUSH$2, Z_FINISH: Z_FINISH$3, - Z_OK: Z_OK$3, Z_STREAM_END: Z_STREAM_END$3, Z_NEED_DICT: Z_NEED_DICT$1, Z_STREAM_ERROR: Z_STREAM_ERROR$2, Z_DATA_ERROR: Z_DATA_ERROR$2, Z_MEM_ERROR: Z_MEM_ERROR$1 -} = constants; + Z_NO_FLUSH, Z_FINISH, + Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR +} = constants$2; /* ===========================================================================*/ @@ -6340,7 +6349,7 @@ const { * console.log(inflate.result); * ``` **/ -function Inflate(options) { +function Inflate$1(options) { this.options = common.assign({ chunkSize: 1024 * 64, windowBits: 15, @@ -6380,30 +6389,30 @@ function Inflate(options) { this.strm = new zstream(); this.strm.avail_out = 0; - let status = inflate_1.inflateInit2( + let status = inflate_1$2.inflateInit2( this.strm, opt.windowBits ); - if (status !== Z_OK$3) { + if (status !== Z_OK) { throw new Error(messages[status]); } this.header = new gzheader(); - inflate_1.inflateGetHeader(this.strm, this.header); + inflate_1$2.inflateGetHeader(this.strm, this.header); // Setup dictionary if (opt.dictionary) { // Convert data if needed if (typeof opt.dictionary === 'string') { opt.dictionary = strings.string2buf(opt.dictionary); - } else if (toString$1.call(opt.dictionary) === '[object ArrayBuffer]') { + } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { opt.dictionary = new Uint8Array(opt.dictionary); } if (opt.raw) { //In raw mode we need to set the dictionary early - status = inflate_1.inflateSetDictionary(this.strm, opt.dictionary); - if (status !== Z_OK$3) { + status = inflate_1$2.inflateSetDictionary(this.strm, opt.dictionary); + if (status !== Z_OK) { throw new Error(messages[status]); } } @@ -6435,7 +6444,7 @@ function Inflate(options) { * push(chunk, true); // push last chunk * ``` **/ -Inflate.prototype.push = function (data, flush_mode) { +Inflate$1.prototype.push = function (data, flush_mode) { const strm = this.strm; const chunkSize = this.options.chunkSize; const dictionary = this.options.dictionary; @@ -6444,10 +6453,10 @@ Inflate.prototype.push = function (data, flush_mode) { if (this.ended) return false; if (flush_mode === ~~flush_mode) _flush_mode = flush_mode; - else _flush_mode = flush_mode === true ? Z_FINISH$3 : Z_NO_FLUSH$2; + else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH; // Convert data if needed - if (toString$1.call(data) === '[object ArrayBuffer]') { + if (toString.call(data) === '[object ArrayBuffer]') { strm.input = new Uint8Array(data); } else { strm.input = data; @@ -6463,34 +6472,34 @@ Inflate.prototype.push = function (data, flush_mode) { strm.avail_out = chunkSize; } - status = inflate_1.inflate(strm, _flush_mode); + status = inflate_1$2.inflate(strm, _flush_mode); - if (status === Z_NEED_DICT$1 && dictionary) { - status = inflate_1.inflateSetDictionary(strm, dictionary); + if (status === Z_NEED_DICT && dictionary) { + status = inflate_1$2.inflateSetDictionary(strm, dictionary); - if (status === Z_OK$3) { - status = inflate_1.inflate(strm, _flush_mode); - } else if (status === Z_DATA_ERROR$2) { + if (status === Z_OK) { + status = inflate_1$2.inflate(strm, _flush_mode); + } else if (status === Z_DATA_ERROR) { // Replace code with more verbose - status = Z_NEED_DICT$1; + status = Z_NEED_DICT; } } // Skip snyc markers if more data follows and not raw mode while (strm.avail_in > 0 && - status === Z_STREAM_END$3 && + status === Z_STREAM_END && strm.state.wrap > 0 && data[strm.next_in] !== 0) { - inflate_1.inflateReset(strm); - status = inflate_1.inflate(strm, _flush_mode); + inflate_1$2.inflateReset(strm); + status = inflate_1$2.inflate(strm, _flush_mode); } switch (status) { - case Z_STREAM_ERROR$2: - case Z_DATA_ERROR$2: - case Z_NEED_DICT$1: - case Z_MEM_ERROR$1: + case Z_STREAM_ERROR: + case Z_DATA_ERROR: + case Z_NEED_DICT: + case Z_MEM_ERROR: this.onEnd(status); this.ended = true; return false; @@ -6501,7 +6510,7 @@ Inflate.prototype.push = function (data, flush_mode) { last_avail_out = strm.avail_out; if (strm.next_out) { - if (strm.avail_out === 0 || status === Z_STREAM_END$3) { + if (strm.avail_out === 0 || status === Z_STREAM_END) { if (this.options.to === 'string') { @@ -6524,11 +6533,11 @@ Inflate.prototype.push = function (data, flush_mode) { } // Must repeat iteration if out buffer is full - if (status === Z_OK$3 && last_avail_out === 0) continue; + if (status === Z_OK && last_avail_out === 0) continue; // Finalize if end of stream reached. - if (status === Z_STREAM_END$3) { - status = inflate_1.inflateEnd(this.strm); + if (status === Z_STREAM_END) { + status = inflate_1$2.inflateEnd(this.strm); this.onEnd(status); this.ended = true; return true; @@ -6549,7 +6558,7 @@ Inflate.prototype.push = function (data, flush_mode) { * By default, stores data blocks in `chunks[]` property and glue * those in `onEnd`. Override this handler, if you need another behaviour. **/ -Inflate.prototype.onData = function (chunk) { +Inflate$1.prototype.onData = function (chunk) { this.chunks.push(chunk); }; @@ -6563,9 +6572,9 @@ Inflate.prototype.onData = function (chunk) { * complete (Z_FINISH). By default - join collected chunks, * free memory and fill `results` / `err` properties. **/ -Inflate.prototype.onEnd = function (status) { +Inflate$1.prototype.onEnd = function (status) { // On success - join - if (status === Z_OK$3) { + if (status === Z_OK) { if (this.options.to === 'string') { this.result = this.chunks.join(''); } else { @@ -6612,13 +6621,13 @@ Inflate.prototype.onEnd = function (status) { * * try { * output = pako.inflate(input); - * } catch (err) + * } catch (err) { * console.log(err); * } * ``` **/ function inflate$1(input, options) { - const inflator = new Inflate(options); + const inflator = new Inflate$1(options); inflator.push(input); @@ -6637,7 +6646,7 @@ function inflate$1(input, options) { * The same as [[inflate]], but creates raw data, without wrapper * (header and adler32 crc). **/ -function inflateRaw(input, options) { +function inflateRaw$1(input, options) { options = options || {}; options.raw = true; return inflate$1(input, options); @@ -6654,47 +6663,46 @@ function inflateRaw(input, options) { **/ -var Inflate_1 = Inflate; -var inflate_2$1 = inflate$1; -var inflateRaw_1 = inflateRaw; -var ungzip = inflate$1; -var constants$2 = constants; +var Inflate_1$1 = Inflate$1; +var inflate_2 = inflate$1; +var inflateRaw_1$1 = inflateRaw$1; +var ungzip$1 = inflate$1; +var constants = constants$2; var inflate_1$1 = { - Inflate: Inflate_1, - inflate: inflate_2$1, - inflateRaw: inflateRaw_1, - ungzip: ungzip, - constants: constants$2 + Inflate: Inflate_1$1, + inflate: inflate_2, + inflateRaw: inflateRaw_1$1, + ungzip: ungzip$1, + constants: constants }; -const { Deflate: Deflate$1, deflate: deflate$2, deflateRaw: deflateRaw$1, gzip: gzip$1 } = deflate_1$1; +const { Deflate, deflate, deflateRaw, gzip } = deflate_1$1; -const { Inflate: Inflate$1, inflate: inflate$2, inflateRaw: inflateRaw$1, ungzip: ungzip$1 } = inflate_1$1; +const { Inflate, inflate, inflateRaw, ungzip } = inflate_1$1; -var Deflate_1$1 = Deflate$1; -var deflate_1$2 = deflate$2; -var deflateRaw_1$1 = deflateRaw$1; -var gzip_1$1 = gzip$1; -var Inflate_1$1 = Inflate$1; -var inflate_1$2 = inflate$2; -var inflateRaw_1$1 = inflateRaw$1; -var ungzip_1 = ungzip$1; -var constants_1 = constants; +var Deflate_1 = Deflate; +var deflate_1 = deflate; +var deflateRaw_1 = deflateRaw; +var gzip_1 = gzip; +var Inflate_1 = Inflate; +var inflate_1 = inflate; +var inflateRaw_1 = inflateRaw; +var ungzip_1 = ungzip; +var constants_1 = constants$2; var pako = { - Deflate: Deflate_1$1, - deflate: deflate_1$2, - deflateRaw: deflateRaw_1$1, - gzip: gzip_1$1, - Inflate: Inflate_1$1, - inflate: inflate_1$2, - inflateRaw: inflateRaw_1$1, + Deflate: Deflate_1, + deflate: deflate_1, + deflateRaw: deflateRaw_1, + gzip: gzip_1, + Inflate: Inflate_1, + inflate: inflate_1, + inflateRaw: inflateRaw_1, ungzip: ungzip_1, constants: constants_1 }; -export default pako; -export { Deflate_1$1 as Deflate, Inflate_1$1 as Inflate, constants_1 as constants, deflate_1$2 as deflate, deflateRaw_1$1 as deflateRaw, gzip_1$1 as gzip, inflate_1$2 as inflate, inflateRaw_1$1 as inflateRaw, ungzip_1 as ungzip }; +export { Deflate_1 as Deflate, Inflate_1 as Inflate, constants_1 as constants, pako as default, deflate_1 as deflate, deflateRaw_1 as deflateRaw, gzip_1 as gzip, inflate_1 as inflate, inflateRaw_1 as inflateRaw, ungzip_1 as ungzip }; diff --git a/dist/pako.js b/dist/pako.js index 697d184..f4efe65 100644 --- a/dist/pako.js +++ b/dist/pako.js @@ -1,5 +1,5 @@ -/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */ +/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : @@ -34,19 +34,19 @@ //const Z_FILTERED = 1; //const Z_HUFFMAN_ONLY = 2; //const Z_RLE = 3; - const Z_FIXED = 4; + const Z_FIXED$1 = 4; //const Z_DEFAULT_STRATEGY = 0; /* Possible values of the data_type field (though see inflate()) */ const Z_BINARY = 0; const Z_TEXT = 1; //const Z_ASCII = 1; // = Z_TEXT - const Z_UNKNOWN = 2; + const Z_UNKNOWN$1 = 2; /*============================================================================*/ - function zero(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } } + function zero$1(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } } // From zutil.h @@ -55,8 +55,8 @@ const DYN_TREES = 2; /* The three kinds of block type */ - const MIN_MATCH = 3; - const MAX_MATCH = 258; + const MIN_MATCH$1 = 3; + const MAX_MATCH$1 = 258; /* The minimum and maximum match lengths */ // From deflate.h @@ -64,25 +64,25 @@ * Internal compression state. */ - const LENGTH_CODES = 29; + const LENGTH_CODES$1 = 29; /* number of length codes, not counting the special END_BLOCK code */ - const LITERALS = 256; + const LITERALS$1 = 256; /* number of literal bytes 0..255 */ - const L_CODES = LITERALS + 1 + LENGTH_CODES; + const L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1; /* number of Literal or Length codes, including the END_BLOCK code */ - const D_CODES = 30; + const D_CODES$1 = 30; /* number of distance codes */ - const BL_CODES = 19; + const BL_CODES$1 = 19; /* number of codes used to transfer the bit lengths */ - const HEAP_SIZE = 2 * L_CODES + 1; + const HEAP_SIZE$1 = 2 * L_CODES$1 + 1; /* maximum heap size */ - const MAX_BITS = 15; + const MAX_BITS$1 = 15; /* All codes must not exceed MAX_BITS bits */ const Buf_size = 16; @@ -135,37 +135,37 @@ const DIST_CODE_LEN = 512; /* see definition of array dist_code below */ // !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1 - const static_ltree = new Array((L_CODES + 2) * 2); - zero(static_ltree); + const static_ltree = new Array((L_CODES$1 + 2) * 2); + zero$1(static_ltree); /* The static literal tree. Since the bit lengths are imposed, there is no * need for the L_CODES extra codes used during heap construction. However * The codes 286 and 287 are needed to build a canonical tree (see _tr_init * below). */ - const static_dtree = new Array(D_CODES * 2); - zero(static_dtree); + const static_dtree = new Array(D_CODES$1 * 2); + zero$1(static_dtree); /* The static distance tree. (Actually a trivial tree since all codes use * 5 bits.) */ const _dist_code = new Array(DIST_CODE_LEN); - zero(_dist_code); + zero$1(_dist_code); /* Distance codes. The first 256 values correspond to the distances * 3 .. 258, the last 256 values correspond to the top 8 bits of * the 15 bit distances. */ - const _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); - zero(_length_code); + const _length_code = new Array(MAX_MATCH$1 - MIN_MATCH$1 + 1); + zero$1(_length_code); /* length code for each normalized match length (0 == MIN_MATCH) */ - const base_length = new Array(LENGTH_CODES); - zero(base_length); + const base_length = new Array(LENGTH_CODES$1); + zero$1(base_length); /* First normalized length for each code (0 = MIN_MATCH) */ - const base_dist = new Array(D_CODES); - zero(base_dist); + const base_dist = new Array(D_CODES$1); + zero$1(base_dist); /* First normalized distance for each code (0 = distance of 1) */ @@ -300,7 +300,7 @@ let f; /* frequency */ let overflow = 0; /* number of elements with bit length too large */ - for (bits = 0; bits <= MAX_BITS; bits++) { + for (bits = 0; bits <= MAX_BITS$1; bits++) { s.bl_count[bits] = 0; } @@ -309,7 +309,7 @@ */ tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */ - for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { + for (h = s.heap_max + 1; h < HEAP_SIZE$1; h++) { n = s.heap[h]; bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1; if (bits > max_length) { @@ -384,7 +384,7 @@ // int max_code; /* largest code with non zero frequency */ // ushf *bl_count; /* number of codes at each bit length */ { - const next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */ + const next_code = new Array(MAX_BITS$1 + 1); /* next code value for each bit length */ let code = 0; /* running code value */ let bits; /* bit index */ let n; /* code index */ @@ -392,7 +392,7 @@ /* The distribution counts are first used to generate the code values * without bit reversal. */ - for (bits = 1; bits <= MAX_BITS; bits++) { + for (bits = 1; bits <= MAX_BITS$1; bits++) { next_code[bits] = code = (code + bl_count[bits - 1]) << 1; } /* Check that the bit counts in bl_count are consistent. The last code @@ -424,7 +424,7 @@ let length; /* length value */ let code; /* code value */ let dist; /* distance index */ - const bl_count = new Array(MAX_BITS + 1); + const bl_count = new Array(MAX_BITS$1 + 1); /* number of codes at each bit length for an optimal tree */ // do check in _tr_init() @@ -441,7 +441,7 @@ /* Initialize the mapping length (0..255) -> length code (0..28) */ length = 0; - for (code = 0; code < LENGTH_CODES - 1; code++) { + for (code = 0; code < LENGTH_CODES$1 - 1; code++) { base_length[code] = length; for (n = 0; n < (1 << extra_lbits[code]); n++) { _length_code[length++] = code; @@ -464,7 +464,7 @@ } //Assert (dist == 256, "tr_static_init: dist != 256"); dist >>= 7; /* from now on, all distances are divided by 128 */ - for (; code < D_CODES; code++) { + for (; code < D_CODES$1; code++) { base_dist[code] = dist << 7; for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) { _dist_code[256 + dist++] = code; @@ -473,7 +473,7 @@ //Assert (dist == 256, "tr_static_init: 256+dist != 512"); /* Construct the codes of the static literal tree */ - for (bits = 0; bits <= MAX_BITS; bits++) { + for (bits = 0; bits <= MAX_BITS$1; bits++) { bl_count[bits] = 0; } @@ -502,18 +502,18 @@ * tree construction to get a canonical Huffman tree (longest code * all ones) */ - gen_codes(static_ltree, L_CODES + 1, bl_count); + gen_codes(static_ltree, L_CODES$1 + 1, bl_count); /* The static distance tree is trivial: */ - for (n = 0; n < D_CODES; n++) { + for (n = 0; n < D_CODES$1; n++) { static_dtree[n * 2 + 1]/*.Len*/ = 5; static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5); } // Now data ready and we can init static trees - static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); - static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); - static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS$1 + 1, L_CODES$1, MAX_BITS$1); + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES$1, MAX_BITS$1); + static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES$1, MAX_BL_BITS); //static_init_done = true; }; @@ -527,9 +527,9 @@ let n; /* iterates over tree elements */ /* Initialize the trees. */ - for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } - for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } - for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < L_CODES$1; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < D_CODES$1; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < BL_CODES$1; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1; s.opt_len = s.static_len = 0; @@ -649,7 +649,7 @@ } else { /* Here, lc is the match length - MIN_MATCH */ code = _length_code[lc]; - send_code(s, code + LITERALS + 1, ltree); /* send the length code */ + send_code(s, code + LITERALS$1 + 1, ltree); /* send the length code */ extra = extra_lbits[code]; if (extra !== 0) { lc -= base_length[code]; @@ -703,7 +703,7 @@ * heap[0] is not used. */ s.heap_len = 0; - s.heap_max = HEAP_SIZE; + s.heap_max = HEAP_SIZE$1; for (n = 0; n < elems; n++) { if (tree[n * 2]/*.Freq*/ !== 0) { @@ -937,7 +937,7 @@ * requires that at least 4 bit length codes be sent. (appnote.txt says * 3 but the actual value used is 4.) */ - for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { + for (max_blindex = BL_CODES$1 - 1; max_blindex >= 3; max_blindex--) { if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) { break; } @@ -1016,7 +1016,7 @@ s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) { return Z_TEXT; } - for (n = 32; n < LITERALS; n++) { + for (n = 32; n < LITERALS$1; n++) { if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) { return Z_TEXT; } @@ -1034,7 +1034,7 @@ /* =========================================================================== * Initialize the tree data structures for a new zlib stream. */ - const _tr_init = (s) => + const _tr_init$1 = (s) => { if (!static_init_done) { @@ -1057,7 +1057,7 @@ /* =========================================================================== * Send a stored block */ - const _tr_stored_block = (s, buf, stored_len, last) => + const _tr_stored_block$1 = (s, buf, stored_len, last) => //DeflateState *s; //charf *buf; /* input block */ //ulg stored_len; /* length of input block */ @@ -1072,7 +1072,7 @@ * Send one empty static block to give enough lookahead for inflate. * This takes 10 bits, of which 7 may remain in the bit buffer. */ - const _tr_align = (s) => { + const _tr_align$1 = (s) => { send_bits(s, STATIC_TREES << 1, 3); send_code(s, END_BLOCK, static_ltree); bi_flush(s); @@ -1083,7 +1083,7 @@ * Determine the best encoding for the current block: dynamic trees, static * trees or store, and output the encoded block to the zip file. */ - const _tr_flush_block = (s, buf, stored_len, last) => + const _tr_flush_block$1 = (s, buf, stored_len, last) => //DeflateState *s; //charf *buf; /* input block, or NULL if too old */ //ulg stored_len; /* length of input block */ @@ -1096,7 +1096,7 @@ if (s.level > 0) { /* Check if the file is binary or text */ - if (s.strm.data_type === Z_UNKNOWN) { + if (s.strm.data_type === Z_UNKNOWN$1) { s.strm.data_type = detect_data_type(s); } @@ -1141,9 +1141,9 @@ * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to * transform a block into a stored block. */ - _tr_stored_block(s, buf, stored_len, last); + _tr_stored_block$1(s, buf, stored_len, last); - } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { + } else if (s.strategy === Z_FIXED$1 || static_lenb === opt_lenb) { send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); compress_block(s, static_ltree, static_dtree); @@ -1170,7 +1170,7 @@ * Save the match info and tally the frequency counts. Return true if * the current block must be flushed. */ - const _tr_tally = (s, dist, lc) => + const _tr_tally$1 = (s, dist, lc) => // deflate_state *s; // unsigned dist; /* distance of matched string */ // unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ @@ -1194,7 +1194,7 @@ // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); - s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++; + s.dyn_ltree[(_length_code[lc] + LITERALS$1 + 1) * 2]/*.Freq*/++; s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++; } @@ -1228,11 +1228,11 @@ */ }; - var _tr_init_1 = _tr_init; - var _tr_stored_block_1 = _tr_stored_block; - var _tr_flush_block_1 = _tr_flush_block; - var _tr_tally_1 = _tr_tally; - var _tr_align_1 = _tr_align; + var _tr_init_1 = _tr_init$1; + var _tr_stored_block_1 = _tr_stored_block$1; + var _tr_flush_block_1 = _tr_flush_block$1; + var _tr_tally_1 = _tr_tally$1; + var _tr_align_1 = _tr_align$1; var trees = { _tr_init: _tr_init_1, @@ -1400,7 +1400,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. - var constants = { + var constants$2 = { /* Allowed flush values; see deflate() and inflate() below for details */ Z_NO_FLUSH: 0, @@ -1467,7 +1467,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. - const { _tr_init: _tr_init$1, _tr_stored_block: _tr_stored_block$1, _tr_flush_block: _tr_flush_block$1, _tr_tally: _tr_tally$1, _tr_align: _tr_align$1 } = trees; + const { _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align } = trees; @@ -1476,42 +1476,42 @@ /* ===========================================================================*/ const { - Z_NO_FLUSH, Z_PARTIAL_FLUSH, Z_FULL_FLUSH, Z_FINISH, Z_BLOCK, - Z_OK, Z_STREAM_END, Z_STREAM_ERROR, Z_DATA_ERROR, Z_BUF_ERROR, - Z_DEFAULT_COMPRESSION, - Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED: Z_FIXED$1, Z_DEFAULT_STRATEGY, - Z_UNKNOWN: Z_UNKNOWN$1, - Z_DEFLATED - } = constants; + Z_NO_FLUSH: Z_NO_FLUSH$2, Z_PARTIAL_FLUSH, Z_FULL_FLUSH: Z_FULL_FLUSH$1, Z_FINISH: Z_FINISH$3, Z_BLOCK: Z_BLOCK$1, + Z_OK: Z_OK$3, Z_STREAM_END: Z_STREAM_END$3, Z_STREAM_ERROR: Z_STREAM_ERROR$2, Z_DATA_ERROR: Z_DATA_ERROR$2, Z_BUF_ERROR: Z_BUF_ERROR$1, + Z_DEFAULT_COMPRESSION: Z_DEFAULT_COMPRESSION$1, + Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED, Z_DEFAULT_STRATEGY: Z_DEFAULT_STRATEGY$1, + Z_UNKNOWN, + Z_DEFLATED: Z_DEFLATED$2 + } = constants$2; /*============================================================================*/ const MAX_MEM_LEVEL = 9; /* Maximum value for memLevel in deflateInit2 */ - const MAX_WBITS = 15; + const MAX_WBITS$1 = 15; /* 32K LZ77 window */ const DEF_MEM_LEVEL = 8; - const LENGTH_CODES$1 = 29; + const LENGTH_CODES = 29; /* number of length codes, not counting the special END_BLOCK code */ - const LITERALS$1 = 256; + const LITERALS = 256; /* number of literal bytes 0..255 */ - const L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1; + const L_CODES = LITERALS + 1 + LENGTH_CODES; /* number of Literal or Length codes, including the END_BLOCK code */ - const D_CODES$1 = 30; + const D_CODES = 30; /* number of distance codes */ - const BL_CODES$1 = 19; + const BL_CODES = 19; /* number of codes used to transfer the bit lengths */ - const HEAP_SIZE$1 = 2 * L_CODES$1 + 1; + const HEAP_SIZE = 2 * L_CODES + 1; /* maximum heap size */ - const MAX_BITS$1 = 15; + const MAX_BITS = 15; /* All codes must not exceed MAX_BITS bits */ - const MIN_MATCH$1 = 3; - const MAX_MATCH$1 = 258; - const MIN_LOOKAHEAD = (MAX_MATCH$1 + MIN_MATCH$1 + 1); + const MIN_MATCH = 3; + const MAX_MATCH = 258; + const MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); const PRESET_DICT = 0x20; @@ -1539,7 +1539,7 @@ return ((f) << 1) - ((f) > 4 ? 9 : 0); }; - const zero$1 = (buf) => { + const zero = (buf) => { let len = buf.length; while (--len >= 0) { buf[len] = 0; } }; @@ -1580,7 +1580,7 @@ const flush_block_only = (s, last) => { - _tr_flush_block$1(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); + _tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); s.block_start = s.strstart; flush_pending(s.strm); }; @@ -1667,7 +1667,7 @@ * we prevent matches with the string of window index 0. */ - const strend = s.strstart + MAX_MATCH$1; + const strend = s.strstart + MAX_MATCH; let scan_end1 = _win[scan + best_len - 1]; let scan_end = _win[scan + best_len]; @@ -1730,8 +1730,8 @@ // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - len = MAX_MATCH$1 - (strend - scan); - scan = strend - MAX_MATCH$1; + len = MAX_MATCH - (strend - scan); + scan = strend - MAX_MATCH; if (len > best_len) { s.match_start = cur_match; @@ -1845,7 +1845,7 @@ s.lookahead += n; /* Initialize the hash value now that we have some input: */ - if (s.lookahead + s.insert >= MIN_MATCH$1) { + if (s.lookahead + s.insert >= MIN_MATCH) { str = s.strstart - s.insert; s.ins_h = s.window[str]; @@ -1856,13 +1856,13 @@ //#endif while (s.insert) { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]); s.prev[str & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = str; str++; s.insert--; - if (s.lookahead + s.insert < MIN_MATCH$1) { + if (s.lookahead + s.insert < MIN_MATCH) { break; } } @@ -1944,7 +1944,7 @@ // } fill_window(s); - if (s.lookahead === 0 && flush === Z_NO_FLUSH) { + if (s.lookahead === 0 && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } @@ -1990,7 +1990,7 @@ s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -2032,7 +2032,7 @@ */ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } if (s.lookahead === 0) { @@ -2044,9 +2044,9 @@ * dictionary, and set hash_head to the head of the hash chain: */ hash_head = 0/*NIL*/; - if (s.lookahead >= MIN_MATCH$1) { + if (s.lookahead >= MIN_MATCH) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -2063,24 +2063,24 @@ s.match_length = longest_match(s, hash_head); /* longest_match() sets match_start */ } - if (s.match_length >= MIN_MATCH$1) { + if (s.match_length >= MIN_MATCH) { // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only /*** _tr_tally_dist(s, s.strstart - s.match_start, s.match_length - MIN_MATCH, bflush); ***/ - bflush = _tr_tally$1(s, s.strstart - s.match_start, s.match_length - MIN_MATCH$1); + bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; /* Insert new strings in the hash table only if the match length * is not too large. This saves time but degrades compression. */ - if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH$1) { + if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) { s.match_length--; /* string at strstart already in table */ do { s.strstart++; /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -2108,7 +2108,7 @@ /* No match, output a literal byte */ //Tracevv((stderr,"%c", s.window[s.strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; @@ -2122,8 +2122,8 @@ /***/ } } - s.insert = ((s.strstart < (MIN_MATCH$1 - 1)) ? s.strstart : MIN_MATCH$1 - 1); - if (flush === Z_FINISH) { + s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1); + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -2164,7 +2164,7 @@ */ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } /* flush the current block */ @@ -2174,9 +2174,9 @@ * dictionary, and set hash_head to the head of the hash chain: */ hash_head = 0/*NIL*/; - if (s.lookahead >= MIN_MATCH$1) { + if (s.lookahead >= MIN_MATCH) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -2186,7 +2186,7 @@ */ s.prev_length = s.match_length; s.prev_match = s.match_start; - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) { @@ -2198,26 +2198,26 @@ /* longest_match() sets match_start */ if (s.match_length <= 5 && - (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH$1 && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { + (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { /* If prev_match is also MIN_MATCH, match_start is garbage * but we will ignore the current match anyway. */ - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; } } /* If there was a match at the previous step and the current * match is not better, output the previous match: */ - if (s.prev_length >= MIN_MATCH$1 && s.match_length <= s.prev_length) { - max_insert = s.strstart + s.lookahead - MIN_MATCH$1; + if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { + max_insert = s.strstart + s.lookahead - MIN_MATCH; /* Do not insert strings in hash table beyond this. */ //check_match(s, s.strstart-1, s.prev_match, s.prev_length); /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH, bflush);***/ - bflush = _tr_tally$1(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH$1); + bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); /* Insert in hash table all strings up to the end of the match. * strstart-1 and strstart are already inserted. If there is not * enough lookahead, the last two strings are not inserted in @@ -2228,14 +2228,14 @@ do { if (++s.strstart <= max_insert) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ } } while (--s.prev_length !== 0); s.match_available = 0; - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; s.strstart++; if (bflush) { @@ -2254,7 +2254,7 @@ */ //Tracevv((stderr,"%c", s->window[s->strstart-1])); /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]); + bflush = _tr_tally(s, 0, s.window[s.strstart - 1]); if (bflush) { /*** FLUSH_BLOCK_ONLY(s, 0) ***/ @@ -2279,12 +2279,12 @@ if (s.match_available) { //Tracevv((stderr,"%c", s->window[s->strstart-1])); /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]); + bflush = _tr_tally(s, 0, s.window[s.strstart - 1]); s.match_available = 0; } - s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1; - if (flush === Z_FINISH) { + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -2324,9 +2324,9 @@ * at the end of the input file. We need MAX_MATCH bytes * for the longest run, plus one for the unrolled loop. */ - if (s.lookahead <= MAX_MATCH$1) { + if (s.lookahead <= MAX_MATCH) { fill_window(s); - if (s.lookahead <= MAX_MATCH$1 && flush === Z_NO_FLUSH) { + if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } /* flush the current block */ @@ -2334,11 +2334,11 @@ /* See how many times the previous byte repeats */ s.match_length = 0; - if (s.lookahead >= MIN_MATCH$1 && s.strstart > 0) { + if (s.lookahead >= MIN_MATCH && s.strstart > 0) { scan = s.strstart - 1; prev = _win[scan]; if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { - strend = s.strstart + MAX_MATCH$1; + strend = s.strstart + MAX_MATCH; do { /*jshint noempty:false*/ } while (prev === _win[++scan] && prev === _win[++scan] && @@ -2346,7 +2346,7 @@ prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend); - s.match_length = MAX_MATCH$1 - (strend - scan); + s.match_length = MAX_MATCH - (strend - scan); if (s.match_length > s.lookahead) { s.match_length = s.lookahead; } @@ -2355,11 +2355,11 @@ } /* Emit match if have run of MIN_MATCH or longer, else emit literal */ - if (s.match_length >= MIN_MATCH$1) { + if (s.match_length >= MIN_MATCH) { //check_match(s, s.strstart, s.strstart - 1, s.match_length); /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ - bflush = _tr_tally$1(s, 1, s.match_length - MIN_MATCH$1); + bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; s.strstart += s.match_length; @@ -2368,7 +2368,7 @@ /* No match, output a literal byte */ //Tracevv((stderr,"%c", s->window[s->strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; @@ -2383,7 +2383,7 @@ } } s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -2416,7 +2416,7 @@ if (s.lookahead === 0) { fill_window(s); if (s.lookahead === 0) { - if (flush === Z_NO_FLUSH) { + if (flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } break; /* flush the current block */ @@ -2427,7 +2427,7 @@ s.match_length = 0; //Tracevv((stderr,"%c", s->window[s->strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; if (bflush) { @@ -2440,7 +2440,7 @@ } } s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -2498,7 +2498,7 @@ s.window_size = 2 * s.w_size; /*** CLEAR_HASH(s); ***/ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); /* Set the default configuration parameters: */ @@ -2511,7 +2511,7 @@ s.block_start = 0; s.lookahead = 0; s.insert = 0; - s.match_length = s.prev_length = MIN_MATCH$1 - 1; + s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; s.ins_h = 0; }; @@ -2527,7 +2527,7 @@ this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ this.gzhead = null; /* gzip header information to write */ this.gzindex = 0; /* where in extra, name, or comment */ - this.method = Z_DEFLATED; /* can only be DEFLATED */ + this.method = Z_DEFLATED$2; /* can only be DEFLATED */ this.last_flush = -1; /* value of flush param for previous deflate call */ this.w_size = 0; /* LZ77 window size (32K by default) */ @@ -2620,24 +2620,24 @@ // Use flat array of DOUBLE size, with interleaved fata, // because JS does not support effective - this.dyn_ltree = new Uint16Array(HEAP_SIZE$1 * 2); - this.dyn_dtree = new Uint16Array((2 * D_CODES$1 + 1) * 2); - this.bl_tree = new Uint16Array((2 * BL_CODES$1 + 1) * 2); - zero$1(this.dyn_ltree); - zero$1(this.dyn_dtree); - zero$1(this.bl_tree); + this.dyn_ltree = new Uint16Array(HEAP_SIZE * 2); + this.dyn_dtree = new Uint16Array((2 * D_CODES + 1) * 2); + this.bl_tree = new Uint16Array((2 * BL_CODES + 1) * 2); + zero(this.dyn_ltree); + zero(this.dyn_dtree); + zero(this.bl_tree); this.l_desc = null; /* desc. for literal tree */ this.d_desc = null; /* desc. for distance tree */ this.bl_desc = null; /* desc. for bit length tree */ //ush bl_count[MAX_BITS+1]; - this.bl_count = new Uint16Array(MAX_BITS$1 + 1); + this.bl_count = new Uint16Array(MAX_BITS + 1); /* number of codes at each bit length for an optimal tree */ //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ - this.heap = new Uint16Array(2 * L_CODES$1 + 1); /* heap used to build the Huffman trees */ - zero$1(this.heap); + this.heap = new Uint16Array(2 * L_CODES + 1); /* heap used to build the Huffman trees */ + zero(this.heap); this.heap_len = 0; /* number of elements in the heap */ this.heap_max = 0; /* element of largest frequency */ @@ -2645,8 +2645,8 @@ * The same heap array is used to build all trees. */ - this.depth = new Uint16Array(2 * L_CODES$1 + 1); //uch depth[2*L_CODES+1]; - zero$1(this.depth); + this.depth = new Uint16Array(2 * L_CODES + 1); //uch depth[2*L_CODES+1]; + zero(this.depth); /* Depth of each subtree used as tie breaker for trees of equal frequency */ @@ -2709,11 +2709,11 @@ const deflateResetKeep = (strm) => { if (!strm || !strm.state) { - return err(strm, Z_STREAM_ERROR); + return err(strm, Z_STREAM_ERROR$2); } strm.total_in = strm.total_out = 0; - strm.data_type = Z_UNKNOWN$1; + strm.data_type = Z_UNKNOWN; const s = strm.state; s.pending = 0; @@ -2728,16 +2728,16 @@ 0 // crc32(0, Z_NULL, 0) : 1; // adler32(0, Z_NULL, 0) - s.last_flush = Z_NO_FLUSH; - _tr_init$1(s); - return Z_OK; + s.last_flush = Z_NO_FLUSH$2; + _tr_init(s); + return Z_OK$3; }; const deflateReset = (strm) => { const ret = deflateResetKeep(strm); - if (ret === Z_OK) { + if (ret === Z_OK$3) { lm_init(strm.state); } return ret; @@ -2746,21 +2746,21 @@ const deflateSetHeader = (strm, head) => { - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; } + if (!strm || !strm.state) { return Z_STREAM_ERROR$2; } + if (strm.state.wrap !== 2) { return Z_STREAM_ERROR$2; } strm.state.gzhead = head; - return Z_OK; + return Z_OK$3; }; const deflateInit2 = (strm, level, method, windowBits, memLevel, strategy) => { if (!strm) { // === Z_NULL - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } let wrap = 1; - if (level === Z_DEFAULT_COMPRESSION) { + if (level === Z_DEFAULT_COMPRESSION$1) { level = 6; } @@ -2775,10 +2775,10 @@ } - if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED$2 || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_FIXED$1) { - return err(strm, Z_STREAM_ERROR); + strategy < 0 || strategy > Z_FIXED) { + return err(strm, Z_STREAM_ERROR$2); } @@ -2801,7 +2801,7 @@ s.hash_bits = memLevel + 7; s.hash_size = 1 << s.hash_bits; s.hash_mask = s.hash_size - 1; - s.hash_shift = ~~((s.hash_bits + MIN_MATCH$1 - 1) / MIN_MATCH$1); + s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); s.window = new Uint8Array(s.w_size * 2); s.head = new Uint16Array(s.hash_size); @@ -2834,25 +2834,25 @@ const deflateInit = (strm, level) => { - return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); + return deflateInit2(strm, level, Z_DEFLATED$2, MAX_WBITS$1, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY$1); }; - const deflate = (strm, flush) => { + const deflate$2 = (strm, flush) => { let beg, val; // for gzip header write only if (!strm || !strm.state || - flush > Z_BLOCK || flush < 0) { - return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; + flush > Z_BLOCK$1 || flush < 0) { + return strm ? err(strm, Z_STREAM_ERROR$2) : Z_STREAM_ERROR$2; } const s = strm.state; if (!strm.output || (!strm.input && strm.avail_in !== 0) || - (s.status === FINISH_STATE && flush !== Z_FINISH)) { - return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR); + (s.status === FINISH_STATE && flush !== Z_FINISH$3)) { + return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR$1 : Z_STREAM_ERROR$2); } s.strm = strm; /* just in case */ @@ -2907,7 +2907,7 @@ } else // DEFLATE header { - let header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8; + let header = (Z_DEFLATED$2 + ((s.w_bits - 8) << 4)) << 8; let level_flags = -1; if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { @@ -3070,7 +3070,7 @@ * return OK instead of BUF_ERROR at next call of deflate: */ s.last_flush = -1; - return Z_OK; + return Z_OK$3; } /* Make sure there is something to do and avoid duplicate consecutive @@ -3078,19 +3078,19 @@ * returning Z_STREAM_END instead of Z_BUF_ERROR. */ } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && - flush !== Z_FINISH) { - return err(strm, Z_BUF_ERROR); + flush !== Z_FINISH$3) { + return err(strm, Z_BUF_ERROR$1); } /* User must not provide more input after the first FINISH: */ if (s.status === FINISH_STATE && strm.avail_in !== 0) { - return err(strm, Z_BUF_ERROR); + return err(strm, Z_BUF_ERROR$1); } /* Start a new block or continue the current one. */ if (strm.avail_in !== 0 || s.lookahead !== 0 || - (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) { + (flush !== Z_NO_FLUSH$2 && s.status !== FINISH_STATE)) { let bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) : (s.strategy === Z_RLE ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush)); @@ -3103,7 +3103,7 @@ s.last_flush = -1; /* avoid BUF_ERROR next call, see above */ } - return Z_OK; + return Z_OK$3; /* If flush != Z_NO_FLUSH && avail_out == 0, the next call * of deflate should use the same flush parameter to make sure * that the flush is complete. So we don't have to output an @@ -3114,17 +3114,17 @@ } if (bstate === BS_BLOCK_DONE) { if (flush === Z_PARTIAL_FLUSH) { - _tr_align$1(s); + _tr_align(s); } - else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ + else if (flush !== Z_BLOCK$1) { /* FULL_FLUSH or SYNC_FLUSH */ - _tr_stored_block$1(s, 0, 0, false); + _tr_stored_block(s, 0, 0, false); /* For a full flush, this empty block will be recognized * as a special marker by inflate_sync(). */ - if (flush === Z_FULL_FLUSH) { + if (flush === Z_FULL_FLUSH$1) { /*** CLEAR_HASH(s); ***/ /* forget history */ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); if (s.lookahead === 0) { s.strstart = 0; @@ -3136,15 +3136,15 @@ flush_pending(strm); if (strm.avail_out === 0) { s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ - return Z_OK; + return Z_OK$3; } } } //Assert(strm->avail_out > 0, "bug2"); //if (strm.avail_out <= 0) { throw new Error("bug2");} - if (flush !== Z_FINISH) { return Z_OK; } - if (s.wrap <= 0) { return Z_STREAM_END; } + if (flush !== Z_FINISH$3) { return Z_OK$3; } + if (s.wrap <= 0) { return Z_STREAM_END$3; } /* Write the trailer */ if (s.wrap === 2) { @@ -3169,14 +3169,14 @@ */ if (s.wrap > 0) { s.wrap = -s.wrap; } /* write the trailer only once! */ - return s.pending !== 0 ? Z_OK : Z_STREAM_END; + return s.pending !== 0 ? Z_OK$3 : Z_STREAM_END$3; }; const deflateEnd = (strm) => { if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } const status = strm.state.status; @@ -3188,12 +3188,12 @@ status !== BUSY_STATE && status !== FINISH_STATE ) { - return err(strm, Z_STREAM_ERROR); + return err(strm, Z_STREAM_ERROR$2); } strm.state = null; - return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; + return status === BUSY_STATE ? err(strm, Z_DATA_ERROR$2) : Z_OK$3; }; @@ -3206,14 +3206,14 @@ let dictLength = dictionary.length; if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } const s = strm.state; const wrap = s.wrap; if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } /* when using zlib wrappers, compute Adler-32 for provided dictionary */ @@ -3228,7 +3228,7 @@ if (dictLength >= s.w_size) { if (wrap === 0) { /* already empty otherwise */ /*** CLEAR_HASH(s); ***/ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); s.strstart = 0; s.block_start = 0; s.insert = 0; @@ -3248,12 +3248,12 @@ strm.next_in = 0; strm.input = dictionary; fill_window(s); - while (s.lookahead >= MIN_MATCH$1) { + while (s.lookahead >= MIN_MATCH) { let str = s.strstart; - let n = s.lookahead - (MIN_MATCH$1 - 1); + let n = s.lookahead - (MIN_MATCH - 1); do { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]); s.prev[str & s.w_mask] = s.head[s.ins_h]; @@ -3261,20 +3261,20 @@ str++; } while (--n); s.strstart = str; - s.lookahead = MIN_MATCH$1 - 1; + s.lookahead = MIN_MATCH - 1; fill_window(s); } s.strstart += s.lookahead; s.block_start = s.strstart; s.insert = s.lookahead; s.lookahead = 0; - s.match_length = s.prev_length = MIN_MATCH$1 - 1; + s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; strm.next_in = next; strm.input = input; strm.avail_in = avail; s.wrap = wrap; - return Z_OK; + return Z_OK$3; }; @@ -3283,7 +3283,7 @@ var deflateReset_1 = deflateReset; var deflateResetKeep_1 = deflateResetKeep; var deflateSetHeader_1 = deflateSetHeader; - var deflate_2 = deflate; + var deflate_2$1 = deflate$2; var deflateEnd_1 = deflateEnd; var deflateSetDictionary_1 = deflateSetDictionary; var deflateInfo = 'pako deflate (from Nodeca project)'; @@ -3297,13 +3297,13 @@ module.exports.deflateTune = deflateTune; */ - var deflate_1 = { + var deflate_1$2 = { deflateInit: deflateInit_1, deflateInit2: deflateInit2_1, deflateReset: deflateReset_1, deflateResetKeep: deflateResetKeep_1, deflateSetHeader: deflateSetHeader_1, - deflate: deflate_2, + deflate: deflate_2$1, deflateEnd: deflateEnd_1, deflateSetDictionary: deflateSetDictionary_1, deflateInfo: deflateInfo @@ -3385,6 +3385,10 @@ // convert string to array (typed, when possible) var string2buf = (str) => { + if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) { + return new TextEncoder().encode(str); + } + let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; // count binary size @@ -3458,9 +3462,14 @@ // convert array to string var buf2string = (buf, max) => { - let i, out; const len = max || buf.length; + if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) { + return new TextDecoder().decode(buf.subarray(0, max)); + } + + let i, out; + // Reserve max possible length (2 words per char) // NB: by unknown reasons, Array is significantly faster for // String.fromCharCode.apply than Uint16Array. @@ -3577,18 +3586,18 @@ var zstream = ZStream; - const toString = Object.prototype.toString; + const toString$1 = Object.prototype.toString; /* Public constants ==========================================================*/ /* ===========================================================================*/ const { - Z_NO_FLUSH: Z_NO_FLUSH$1, Z_SYNC_FLUSH, Z_FULL_FLUSH: Z_FULL_FLUSH$1, Z_FINISH: Z_FINISH$1, - Z_OK: Z_OK$1, Z_STREAM_END: Z_STREAM_END$1, - Z_DEFAULT_COMPRESSION: Z_DEFAULT_COMPRESSION$1, - Z_DEFAULT_STRATEGY: Z_DEFAULT_STRATEGY$1, + Z_NO_FLUSH: Z_NO_FLUSH$1, Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH: Z_FINISH$2, + Z_OK: Z_OK$2, Z_STREAM_END: Z_STREAM_END$2, + Z_DEFAULT_COMPRESSION, + Z_DEFAULT_STRATEGY, Z_DEFLATED: Z_DEFLATED$1 - } = constants; + } = constants$2; /* ===========================================================================*/ @@ -3678,14 +3687,14 @@ * console.log(deflate.result); * ``` **/ - function Deflate(options) { + function Deflate$1(options) { this.options = common.assign({ - level: Z_DEFAULT_COMPRESSION$1, + level: Z_DEFAULT_COMPRESSION, method: Z_DEFLATED$1, chunkSize: 16384, windowBits: 15, memLevel: 8, - strategy: Z_DEFAULT_STRATEGY$1 + strategy: Z_DEFAULT_STRATEGY }, options || {}); let opt = this.options; @@ -3706,7 +3715,7 @@ this.strm = new zstream(); this.strm.avail_out = 0; - let status = deflate_1.deflateInit2( + let status = deflate_1$2.deflateInit2( this.strm, opt.level, opt.method, @@ -3715,12 +3724,12 @@ opt.strategy ); - if (status !== Z_OK$1) { + if (status !== Z_OK$2) { throw new Error(messages[status]); } if (opt.header) { - deflate_1.deflateSetHeader(this.strm, opt.header); + deflate_1$2.deflateSetHeader(this.strm, opt.header); } if (opt.dictionary) { @@ -3729,15 +3738,15 @@ if (typeof opt.dictionary === 'string') { // If we need to compress text, change encoding to utf8. dict = strings.string2buf(opt.dictionary); - } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { + } else if (toString$1.call(opt.dictionary) === '[object ArrayBuffer]') { dict = new Uint8Array(opt.dictionary); } else { dict = opt.dictionary; } - status = deflate_1.deflateSetDictionary(this.strm, dict); + status = deflate_1$2.deflateSetDictionary(this.strm, dict); - if (status !== Z_OK$1) { + if (status !== Z_OK$2) { throw new Error(messages[status]); } @@ -3767,7 +3776,7 @@ * push(chunk, true); // push last chunk * ``` **/ - Deflate.prototype.push = function (data, flush_mode) { + Deflate$1.prototype.push = function (data, flush_mode) { const strm = this.strm; const chunkSize = this.options.chunkSize; let status, _flush_mode; @@ -3775,13 +3784,13 @@ if (this.ended) { return false; } if (flush_mode === ~~flush_mode) _flush_mode = flush_mode; - else _flush_mode = flush_mode === true ? Z_FINISH$1 : Z_NO_FLUSH$1; + else _flush_mode = flush_mode === true ? Z_FINISH$2 : Z_NO_FLUSH$1; // Convert data if needed if (typeof data === 'string') { // If we need to compress text, change encoding to utf8. strm.input = strings.string2buf(data); - } else if (toString.call(data) === '[object ArrayBuffer]') { + } else if (toString$1.call(data) === '[object ArrayBuffer]') { strm.input = new Uint8Array(data); } else { strm.input = data; @@ -3798,23 +3807,23 @@ } // Make sure avail_out > 6 to avoid repeating markers - if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH$1) && strm.avail_out <= 6) { + if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH) && strm.avail_out <= 6) { this.onData(strm.output.subarray(0, strm.next_out)); strm.avail_out = 0; continue; } - status = deflate_1.deflate(strm, _flush_mode); + status = deflate_1$2.deflate(strm, _flush_mode); // Ended => flush and finish - if (status === Z_STREAM_END$1) { + if (status === Z_STREAM_END$2) { if (strm.next_out > 0) { this.onData(strm.output.subarray(0, strm.next_out)); } - status = deflate_1.deflateEnd(this.strm); + status = deflate_1$2.deflateEnd(this.strm); this.onEnd(status); this.ended = true; - return status === Z_OK$1; + return status === Z_OK$2; } // Flush if out buffer full @@ -3844,7 +3853,7 @@ * By default, stores data blocks in `chunks[]` property and glue * those in `onEnd`. Override this handler, if you need another behaviour. **/ - Deflate.prototype.onData = function (chunk) { + Deflate$1.prototype.onData = function (chunk) { this.chunks.push(chunk); }; @@ -3858,9 +3867,9 @@ * complete (Z_FINISH). By default - join collected chunks, * free memory and fill `results` / `err` properties. **/ - Deflate.prototype.onEnd = function (status) { + Deflate$1.prototype.onEnd = function (status) { // On success - join - if (status === Z_OK$1) { + if (status === Z_OK$2) { this.result = common.flattenChunks(this.chunks); } this.chunks = []; @@ -3902,7 +3911,7 @@ * ``` **/ function deflate$1(input, options) { - const deflator = new Deflate(options); + const deflator = new Deflate$1(options); deflator.push(input, true); @@ -3921,7 +3930,7 @@ * The same as [[deflate]], but creates raw data, without wrapper * (header and adler32 crc). **/ - function deflateRaw(input, options) { + function deflateRaw$1(input, options) { options = options || {}; options.raw = true; return deflate$1(input, options); @@ -3936,24 +3945,24 @@ * The same as [[deflate]], but create gzip wrapper instead of * deflate one. **/ - function gzip(input, options) { + function gzip$1(input, options) { options = options || {}; options.gzip = true; return deflate$1(input, options); } - var Deflate_1 = Deflate; - var deflate_2$1 = deflate$1; - var deflateRaw_1 = deflateRaw; - var gzip_1 = gzip; - var constants$1 = constants; + var Deflate_1$1 = Deflate$1; + var deflate_2 = deflate$1; + var deflateRaw_1$1 = deflateRaw$1; + var gzip_1$1 = gzip$1; + var constants$1 = constants$2; var deflate_1$1 = { - Deflate: Deflate_1, - deflate: deflate_2$1, - deflateRaw: deflateRaw_1, - gzip: gzip_1, + Deflate: Deflate_1$1, + deflate: deflate_2, + deflateRaw: deflateRaw_1$1, + gzip: gzip_1$1, constants: constants$1 }; @@ -3977,8 +3986,8 @@ // 3. This notice may not be removed or altered from any source distribution. // See state defs from inflate.js - const BAD = 30; /* got a data error -- remain here until reset */ - const TYPE = 12; /* i: waiting for type bits, including last-flag bit */ + const BAD$1 = 30; /* got a data error -- remain here until reset */ + const TYPE$1 = 12; /* i: waiting for type bits, including last-flag bit */ /* Decode literal, length, and distance codes and write out the resulting @@ -4140,7 +4149,7 @@ //#ifdef INFLATE_STRICT if (dist > dmax) { strm.msg = 'invalid distance too far back'; - state.mode = BAD; + state.mode = BAD$1; break top; } //#endif @@ -4153,7 +4162,7 @@ if (op > whave) { if (state.sane) { strm.msg = 'invalid distance too far back'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -4258,7 +4267,7 @@ } else { strm.msg = 'invalid distance code'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -4271,12 +4280,12 @@ } else if (op & 32) { /* end-of-block */ //Tracevv((stderr, "inflate: end of block\n")); - state.mode = TYPE; + state.mode = TYPE$1; break top; } else { strm.msg = 'invalid literal/length code'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -4320,13 +4329,13 @@ // 3. This notice may not be removed or altered from any source distribution. const MAXBITS = 15; - const ENOUGH_LENS = 852; - const ENOUGH_DISTS = 592; + const ENOUGH_LENS$1 = 852; + const ENOUGH_DISTS$1 = 592; //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); - const CODES = 0; - const LENS = 1; - const DISTS = 2; + const CODES$1 = 0; + const LENS$1 = 1; + const DISTS$1 = 2; const lbase = new Uint16Array([ /* Length codes 257..285 base */ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, @@ -4458,7 +4467,7 @@ return -1; } /* over-subscribed */ } - if (left > 0 && (type === CODES || max !== 1)) { + if (left > 0 && (type === CODES$1 || max !== 1)) { return -1; /* incomplete set */ } @@ -4509,11 +4518,11 @@ /* set up for code type */ // poor man optimization - use if-else instead of switch, // to avoid deopts in old v8 - if (type === CODES) { + if (type === CODES$1) { base = extra = work; /* dummy value--not used */ end = 19; - } else if (type === LENS) { + } else if (type === LENS$1) { base = lbase; base_index -= 257; extra = lext; @@ -4538,8 +4547,8 @@ mask = used - 1; /* mask for comparing low */ /* check available table space */ - if ((type === LENS && used > ENOUGH_LENS) || - (type === DISTS && used > ENOUGH_DISTS)) { + if ((type === LENS$1 && used > ENOUGH_LENS$1) || + (type === DISTS$1 && used > ENOUGH_DISTS$1)) { return 1; } @@ -4610,8 +4619,8 @@ /* check for enough space */ used += 1 << curr; - if ((type === LENS && used > ENOUGH_LENS) || - (type === DISTS && used > ENOUGH_DISTS)) { + if ((type === LENS$1 && used > ENOUGH_LENS$1) || + (type === DISTS$1 && used > ENOUGH_DISTS$1)) { return 1; } @@ -4667,18 +4676,18 @@ - const CODES$1 = 0; - const LENS$1 = 1; - const DISTS$1 = 2; + const CODES = 0; + const LENS = 1; + const DISTS = 2; /* Public constants ==========================================================*/ /* ===========================================================================*/ const { - Z_FINISH: Z_FINISH$2, Z_BLOCK: Z_BLOCK$1, Z_TREES, - Z_OK: Z_OK$2, Z_STREAM_END: Z_STREAM_END$2, Z_NEED_DICT, Z_STREAM_ERROR: Z_STREAM_ERROR$1, Z_DATA_ERROR: Z_DATA_ERROR$1, Z_MEM_ERROR, Z_BUF_ERROR: Z_BUF_ERROR$1, - Z_DEFLATED: Z_DEFLATED$2 - } = constants; + Z_FINISH: Z_FINISH$1, Z_BLOCK, Z_TREES, + Z_OK: Z_OK$1, Z_STREAM_END: Z_STREAM_END$1, Z_NEED_DICT: Z_NEED_DICT$1, Z_STREAM_ERROR: Z_STREAM_ERROR$1, Z_DATA_ERROR: Z_DATA_ERROR$1, Z_MEM_ERROR: Z_MEM_ERROR$1, Z_BUF_ERROR, + Z_DEFLATED + } = constants$2; /* STATES ====================================================================*/ @@ -4696,7 +4705,7 @@ const HCRC = 9; /* i: waiting for header crc (gzip) */ const DICTID = 10; /* i: waiting for dictionary check value */ const DICT = 11; /* waiting for inflateSetDictionary() call */ - const TYPE$1 = 12; /* i: waiting for type bits, including last-flag bit */ + const TYPE = 12; /* i: waiting for type bits, including last-flag bit */ const TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ const STORED = 14; /* i: waiting for stored size (length and complement) */ const COPY_ = 15; /* i/o: same as COPY below, but only first time in */ @@ -4714,7 +4723,7 @@ const CHECK = 27; /* i: waiting for 32-bit check value */ const LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ const DONE = 29; /* finished check, done -- remain here until reset */ - const BAD$1 = 30; /* got a data error -- remain here until reset */ + const BAD = 30; /* got a data error -- remain here until reset */ const MEM = 31; /* got an inflate() memory error -- remain here until reset */ const SYNC = 32; /* looking for synchronization bytes to restart inflate() */ @@ -4722,13 +4731,13 @@ - const ENOUGH_LENS$1 = 852; - const ENOUGH_DISTS$1 = 592; + const ENOUGH_LENS = 852; + const ENOUGH_DISTS = 592; //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); - const MAX_WBITS$1 = 15; + const MAX_WBITS = 15; /* 32K LZ77 window */ - const DEF_WBITS = MAX_WBITS$1; + const DEF_WBITS = MAX_WBITS; const zswap32 = (q) => { @@ -4816,13 +4825,13 @@ state.hold = 0; state.bits = 0; //state.lencode = state.distcode = state.next = state.codes; - state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS$1); - state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS$1); + state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS); + state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS); state.sane = 1; state.back = -1; //Tracev((stderr, "inflate: reset\n")); - return Z_OK$2; + return Z_OK$1; }; @@ -4884,7 +4893,7 @@ strm.state = state; state.window = null/*Z_NULL*/; const ret = inflateReset2(strm, windowBits); - if (ret !== Z_OK$2) { + if (ret !== Z_OK$1) { strm.state = null/*Z_NULL*/; } return ret; @@ -4926,13 +4935,13 @@ while (sym < 280) { state.lens[sym++] = 7; } while (sym < 288) { state.lens[sym++] = 8; } - inftrees(LENS$1, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); + inftrees(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); /* distance table */ sym = 0; while (sym < 32) { state.lens[sym++] = 5; } - inftrees(DISTS$1, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); + inftrees(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); /* do this just once */ virgin = false; @@ -5003,7 +5012,7 @@ }; - const inflate = (strm, flush) => { + const inflate$2 = (strm, flush) => { let state; let input, output; // input/output buffers @@ -5037,7 +5046,7 @@ } state = strm.state; - if (state.mode === TYPE$1) { state.mode = TYPEDO; } /* skip check */ + if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ //--- LOAD() --- @@ -5053,7 +5062,7 @@ _in = have; _out = left; - ret = Z_OK$2; + ret = Z_OK$1; inf_leave: // goto emulation for (;;) { @@ -5093,12 +5102,12 @@ if (!(state.wrap & 1) || /* check if zlib header allowed */ (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) { strm.msg = 'incorrect header check'; - state.mode = BAD$1; + state.mode = BAD; break; } - if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED$2) { + if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) { strm.msg = 'unknown compression method'; - state.mode = BAD$1; + state.mode = BAD; break; } //--- DROPBITS(4) ---// @@ -5111,7 +5120,7 @@ } else if (len > state.wbits) { strm.msg = 'invalid window size'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -5122,7 +5131,7 @@ //Tracev((stderr, "inflate: zlib header ok\n")); strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; - state.mode = hold & 0x200 ? DICTID : TYPE$1; + state.mode = hold & 0x200 ? DICTID : TYPE; //=== INITBITS(); hold = 0; bits = 0; @@ -5138,14 +5147,14 @@ } //===// state.flags = hold; - if ((state.flags & 0xff) !== Z_DEFLATED$2) { + if ((state.flags & 0xff) !== Z_DEFLATED) { strm.msg = 'unknown compression method'; - state.mode = BAD$1; + state.mode = BAD; break; } if (state.flags & 0xe000) { strm.msg = 'unknown header flags set'; - state.mode = BAD$1; + state.mode = BAD; break; } if (state.head) { @@ -5348,7 +5357,7 @@ //===// if (hold !== (state.check & 0xffff)) { strm.msg = 'header crc mismatch'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -5361,7 +5370,7 @@ state.head.done = true; } strm.adler = state.check = 0; - state.mode = TYPE$1; + state.mode = TYPE; break; case DICTID: //=== NEEDBITS(32); */ @@ -5389,13 +5398,13 @@ state.hold = hold; state.bits = bits; //--- - return Z_NEED_DICT; + return Z_NEED_DICT$1; } strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; - state.mode = TYPE$1; + state.mode = TYPE; /* falls through */ - case TYPE$1: - if (flush === Z_BLOCK$1 || flush === Z_TREES) { break inf_leave; } + case TYPE: + if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } /* falls through */ case TYPEDO: if (state.last) { @@ -5446,7 +5455,7 @@ break; case 3: strm.msg = 'invalid block type'; - state.mode = BAD$1; + state.mode = BAD; } //--- DROPBITS(2) ---// hold >>>= 2; @@ -5468,7 +5477,7 @@ //===// if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { strm.msg = 'invalid stored block lengths'; - state.mode = BAD$1; + state.mode = BAD; break; } state.length = hold & 0xffff; @@ -5501,7 +5510,7 @@ break; } //Tracev((stderr, "inflate: stored end\n")); - state.mode = TYPE$1; + state.mode = TYPE; break; case TABLE: //=== NEEDBITS(14); */ @@ -5530,7 +5539,7 @@ //#ifndef PKZIP_BUG_WORKAROUND if (state.nlen > 286 || state.ndist > 30) { strm.msg = 'too many length or distance symbols'; - state.mode = BAD$1; + state.mode = BAD; break; } //#endif @@ -5565,12 +5574,12 @@ state.lenbits = 7; opts = { bits: state.lenbits }; - ret = inftrees(CODES$1, state.lens, 0, 19, state.lencode, 0, state.work, opts); + ret = inftrees(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); state.lenbits = opts.bits; if (ret) { strm.msg = 'invalid code lengths set'; - state.mode = BAD$1; + state.mode = BAD; break; } //Tracev((stderr, "inflate: code lengths ok\n")); @@ -5617,7 +5626,7 @@ //---// if (state.have === 0) { strm.msg = 'invalid bit length repeat'; - state.mode = BAD$1; + state.mode = BAD; break; } len = state.lens[state.have - 1]; @@ -5671,7 +5680,7 @@ } if (state.have + copy > state.nlen + state.ndist) { strm.msg = 'invalid bit length repeat'; - state.mode = BAD$1; + state.mode = BAD; break; } while (copy--) { @@ -5681,12 +5690,12 @@ } /* handle error breaks in while */ - if (state.mode === BAD$1) { break; } + if (state.mode === BAD) { break; } /* check for end-of-block code (better have one) */ if (state.lens[256] === 0) { strm.msg = 'invalid code -- missing end-of-block'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -5696,7 +5705,7 @@ state.lenbits = 9; opts = { bits: state.lenbits }; - ret = inftrees(LENS$1, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); + ret = inftrees(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. // state.next_index = opts.table_index; state.lenbits = opts.bits; @@ -5704,7 +5713,7 @@ if (ret) { strm.msg = 'invalid literal/lengths set'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -5713,7 +5722,7 @@ // Switch to use dynamic table state.distcode = state.distdyn; opts = { bits: state.distbits }; - ret = inftrees(DISTS$1, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); + ret = inftrees(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. // state.next_index = opts.table_index; state.distbits = opts.bits; @@ -5721,7 +5730,7 @@ if (ret) { strm.msg = 'invalid distances set'; - state.mode = BAD$1; + state.mode = BAD; break; } //Tracev((stderr, 'inflate: codes ok\n')); @@ -5753,7 +5762,7 @@ bits = state.bits; //--- - if (state.mode === TYPE$1) { + if (state.mode === TYPE) { state.back = -1; } break; @@ -5814,12 +5823,12 @@ if (here_op & 32) { //Tracevv((stderr, "inflate: end of block\n")); state.back = -1; - state.mode = TYPE$1; + state.mode = TYPE; break; } if (here_op & 64) { strm.msg = 'invalid literal/length code'; - state.mode = BAD$1; + state.mode = BAD; break; } state.extra = here_op & 15; @@ -5894,7 +5903,7 @@ state.back += here_bits; if (here_op & 64) { strm.msg = 'invalid distance code'; - state.mode = BAD$1; + state.mode = BAD; break; } state.offset = here_val; @@ -5922,7 +5931,7 @@ //#ifdef INFLATE_STRICT if (state.offset > state.dmax) { strm.msg = 'invalid distance too far back'; - state.mode = BAD$1; + state.mode = BAD; break; } //#endif @@ -5937,7 +5946,7 @@ if (copy > state.whave) { if (state.sane) { strm.msg = 'invalid distance too far back'; - state.mode = BAD$1; + state.mode = BAD; break; } // (!) This block is disabled in zlib defaults, @@ -6009,7 +6018,7 @@ // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too if ((state.flags ? hold : zswap32(hold)) !== state.check) { strm.msg = 'incorrect data check'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -6032,7 +6041,7 @@ //===// if (hold !== (state.total & 0xffffffff)) { strm.msg = 'incorrect length check'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -6044,13 +6053,13 @@ state.mode = DONE; /* falls through */ case DONE: - ret = Z_STREAM_END$2; + ret = Z_STREAM_END$1; break inf_leave; - case BAD$1: + case BAD: ret = Z_DATA_ERROR$1; break inf_leave; case MEM: - return Z_MEM_ERROR; + return Z_MEM_ERROR$1; case SYNC: /* falls through */ default: @@ -6076,8 +6085,8 @@ state.bits = bits; //--- - if (state.wsize || (_out !== strm.avail_out && state.mode < BAD$1 && - (state.mode < CHECK || flush !== Z_FINISH$2))) { + if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && + (state.mode < CHECK || flush !== Z_FINISH$1))) { if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) ; } _in -= strm.avail_in; @@ -6090,10 +6099,10 @@ (state.flags ? crc32_1(state.check, output, _out, strm.next_out - _out) : adler32_1(state.check, output, _out, strm.next_out - _out)); } strm.data_type = state.bits + (state.last ? 64 : 0) + - (state.mode === TYPE$1 ? 128 : 0) + + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); - if (((_in === 0 && _out === 0) || flush === Z_FINISH$2) && ret === Z_OK$2) { - ret = Z_BUF_ERROR$1; + if (((_in === 0 && _out === 0) || flush === Z_FINISH$1) && ret === Z_OK$1) { + ret = Z_BUF_ERROR; } return ret; }; @@ -6110,7 +6119,7 @@ state.window = null; } strm.state = null; - return Z_OK$2; + return Z_OK$1; }; @@ -6124,7 +6133,7 @@ /* save header structure */ state.head = head; head.done = false; - return Z_OK$2; + return Z_OK$1; }; @@ -6157,11 +6166,11 @@ ret = updatewindow(strm, dictionary, dictLength, dictLength); if (ret) { state.mode = MEM; - return Z_MEM_ERROR; + return Z_MEM_ERROR$1; } state.havedict = 1; // Tracev((stderr, "inflate: dictionary set\n")); - return Z_OK$2; + return Z_OK$1; }; @@ -6170,7 +6179,7 @@ var inflateResetKeep_1 = inflateResetKeep; var inflateInit_1 = inflateInit; var inflateInit2_1 = inflateInit2; - var inflate_2 = inflate; + var inflate_2$1 = inflate$2; var inflateEnd_1 = inflateEnd; var inflateGetHeader_1 = inflateGetHeader; var inflateSetDictionary_1 = inflateSetDictionary; @@ -6186,13 +6195,13 @@ module.exports.inflateUndermine = inflateUndermine; */ - var inflate_1 = { + var inflate_1$2 = { inflateReset: inflateReset_1, inflateReset2: inflateReset2_1, inflateResetKeep: inflateResetKeep_1, inflateInit: inflateInit_1, inflateInit2: inflateInit2_1, - inflate: inflate_2, + inflate: inflate_2$1, inflateEnd: inflateEnd_1, inflateGetHeader: inflateGetHeader_1, inflateSetDictionary: inflateSetDictionary_1, @@ -6256,15 +6265,15 @@ var gzheader = GZheader; - const toString$1 = Object.prototype.toString; + const toString = Object.prototype.toString; /* Public constants ==========================================================*/ /* ===========================================================================*/ const { - Z_NO_FLUSH: Z_NO_FLUSH$2, Z_FINISH: Z_FINISH$3, - Z_OK: Z_OK$3, Z_STREAM_END: Z_STREAM_END$3, Z_NEED_DICT: Z_NEED_DICT$1, Z_STREAM_ERROR: Z_STREAM_ERROR$2, Z_DATA_ERROR: Z_DATA_ERROR$2, Z_MEM_ERROR: Z_MEM_ERROR$1 - } = constants; + Z_NO_FLUSH, Z_FINISH, + Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR + } = constants$2; /* ===========================================================================*/ @@ -6346,7 +6355,7 @@ * console.log(inflate.result); * ``` **/ - function Inflate(options) { + function Inflate$1(options) { this.options = common.assign({ chunkSize: 1024 * 64, windowBits: 15, @@ -6386,30 +6395,30 @@ this.strm = new zstream(); this.strm.avail_out = 0; - let status = inflate_1.inflateInit2( + let status = inflate_1$2.inflateInit2( this.strm, opt.windowBits ); - if (status !== Z_OK$3) { + if (status !== Z_OK) { throw new Error(messages[status]); } this.header = new gzheader(); - inflate_1.inflateGetHeader(this.strm, this.header); + inflate_1$2.inflateGetHeader(this.strm, this.header); // Setup dictionary if (opt.dictionary) { // Convert data if needed if (typeof opt.dictionary === 'string') { opt.dictionary = strings.string2buf(opt.dictionary); - } else if (toString$1.call(opt.dictionary) === '[object ArrayBuffer]') { + } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { opt.dictionary = new Uint8Array(opt.dictionary); } if (opt.raw) { //In raw mode we need to set the dictionary early - status = inflate_1.inflateSetDictionary(this.strm, opt.dictionary); - if (status !== Z_OK$3) { + status = inflate_1$2.inflateSetDictionary(this.strm, opt.dictionary); + if (status !== Z_OK) { throw new Error(messages[status]); } } @@ -6441,7 +6450,7 @@ * push(chunk, true); // push last chunk * ``` **/ - Inflate.prototype.push = function (data, flush_mode) { + Inflate$1.prototype.push = function (data, flush_mode) { const strm = this.strm; const chunkSize = this.options.chunkSize; const dictionary = this.options.dictionary; @@ -6450,10 +6459,10 @@ if (this.ended) return false; if (flush_mode === ~~flush_mode) _flush_mode = flush_mode; - else _flush_mode = flush_mode === true ? Z_FINISH$3 : Z_NO_FLUSH$2; + else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH; // Convert data if needed - if (toString$1.call(data) === '[object ArrayBuffer]') { + if (toString.call(data) === '[object ArrayBuffer]') { strm.input = new Uint8Array(data); } else { strm.input = data; @@ -6469,34 +6478,34 @@ strm.avail_out = chunkSize; } - status = inflate_1.inflate(strm, _flush_mode); + status = inflate_1$2.inflate(strm, _flush_mode); - if (status === Z_NEED_DICT$1 && dictionary) { - status = inflate_1.inflateSetDictionary(strm, dictionary); + if (status === Z_NEED_DICT && dictionary) { + status = inflate_1$2.inflateSetDictionary(strm, dictionary); - if (status === Z_OK$3) { - status = inflate_1.inflate(strm, _flush_mode); - } else if (status === Z_DATA_ERROR$2) { + if (status === Z_OK) { + status = inflate_1$2.inflate(strm, _flush_mode); + } else if (status === Z_DATA_ERROR) { // Replace code with more verbose - status = Z_NEED_DICT$1; + status = Z_NEED_DICT; } } // Skip snyc markers if more data follows and not raw mode while (strm.avail_in > 0 && - status === Z_STREAM_END$3 && + status === Z_STREAM_END && strm.state.wrap > 0 && data[strm.next_in] !== 0) { - inflate_1.inflateReset(strm); - status = inflate_1.inflate(strm, _flush_mode); + inflate_1$2.inflateReset(strm); + status = inflate_1$2.inflate(strm, _flush_mode); } switch (status) { - case Z_STREAM_ERROR$2: - case Z_DATA_ERROR$2: - case Z_NEED_DICT$1: - case Z_MEM_ERROR$1: + case Z_STREAM_ERROR: + case Z_DATA_ERROR: + case Z_NEED_DICT: + case Z_MEM_ERROR: this.onEnd(status); this.ended = true; return false; @@ -6507,7 +6516,7 @@ last_avail_out = strm.avail_out; if (strm.next_out) { - if (strm.avail_out === 0 || status === Z_STREAM_END$3) { + if (strm.avail_out === 0 || status === Z_STREAM_END) { if (this.options.to === 'string') { @@ -6530,11 +6539,11 @@ } // Must repeat iteration if out buffer is full - if (status === Z_OK$3 && last_avail_out === 0) continue; + if (status === Z_OK && last_avail_out === 0) continue; // Finalize if end of stream reached. - if (status === Z_STREAM_END$3) { - status = inflate_1.inflateEnd(this.strm); + if (status === Z_STREAM_END) { + status = inflate_1$2.inflateEnd(this.strm); this.onEnd(status); this.ended = true; return true; @@ -6555,7 +6564,7 @@ * By default, stores data blocks in `chunks[]` property and glue * those in `onEnd`. Override this handler, if you need another behaviour. **/ - Inflate.prototype.onData = function (chunk) { + Inflate$1.prototype.onData = function (chunk) { this.chunks.push(chunk); }; @@ -6569,9 +6578,9 @@ * complete (Z_FINISH). By default - join collected chunks, * free memory and fill `results` / `err` properties. **/ - Inflate.prototype.onEnd = function (status) { + Inflate$1.prototype.onEnd = function (status) { // On success - join - if (status === Z_OK$3) { + if (status === Z_OK) { if (this.options.to === 'string') { this.result = this.chunks.join(''); } else { @@ -6618,13 +6627,13 @@ * * try { * output = pako.inflate(input); - * } catch (err) + * } catch (err) { * console.log(err); * } * ``` **/ function inflate$1(input, options) { - const inflator = new Inflate(options); + const inflator = new Inflate$1(options); inflator.push(input); @@ -6643,7 +6652,7 @@ * The same as [[inflate]], but creates raw data, without wrapper * (header and adler32 crc). **/ - function inflateRaw(input, options) { + function inflateRaw$1(input, options) { options = options || {}; options.raw = true; return inflate$1(input, options); @@ -6660,57 +6669,57 @@ **/ - var Inflate_1 = Inflate; - var inflate_2$1 = inflate$1; - var inflateRaw_1 = inflateRaw; - var ungzip = inflate$1; - var constants$2 = constants; + var Inflate_1$1 = Inflate$1; + var inflate_2 = inflate$1; + var inflateRaw_1$1 = inflateRaw$1; + var ungzip$1 = inflate$1; + var constants = constants$2; var inflate_1$1 = { - Inflate: Inflate_1, - inflate: inflate_2$1, - inflateRaw: inflateRaw_1, - ungzip: ungzip, - constants: constants$2 + Inflate: Inflate_1$1, + inflate: inflate_2, + inflateRaw: inflateRaw_1$1, + ungzip: ungzip$1, + constants: constants }; - const { Deflate: Deflate$1, deflate: deflate$2, deflateRaw: deflateRaw$1, gzip: gzip$1 } = deflate_1$1; + const { Deflate, deflate, deflateRaw, gzip } = deflate_1$1; - const { Inflate: Inflate$1, inflate: inflate$2, inflateRaw: inflateRaw$1, ungzip: ungzip$1 } = inflate_1$1; + const { Inflate, inflate, inflateRaw, ungzip } = inflate_1$1; - var Deflate_1$1 = Deflate$1; - var deflate_1$2 = deflate$2; - var deflateRaw_1$1 = deflateRaw$1; - var gzip_1$1 = gzip$1; - var Inflate_1$1 = Inflate$1; - var inflate_1$2 = inflate$2; - var inflateRaw_1$1 = inflateRaw$1; - var ungzip_1 = ungzip$1; - var constants_1 = constants; + var Deflate_1 = Deflate; + var deflate_1 = deflate; + var deflateRaw_1 = deflateRaw; + var gzip_1 = gzip; + var Inflate_1 = Inflate; + var inflate_1 = inflate; + var inflateRaw_1 = inflateRaw; + var ungzip_1 = ungzip; + var constants_1 = constants$2; var pako = { - Deflate: Deflate_1$1, - deflate: deflate_1$2, - deflateRaw: deflateRaw_1$1, - gzip: gzip_1$1, - Inflate: Inflate_1$1, - inflate: inflate_1$2, - inflateRaw: inflateRaw_1$1, + Deflate: Deflate_1, + deflate: deflate_1, + deflateRaw: deflateRaw_1, + gzip: gzip_1, + Inflate: Inflate_1, + inflate: inflate_1, + inflateRaw: inflateRaw_1, ungzip: ungzip_1, constants: constants_1 }; - exports.Deflate = Deflate_1$1; - exports.Inflate = Inflate_1$1; + exports.Deflate = Deflate_1; + exports.Inflate = Inflate_1; exports.constants = constants_1; - exports.default = pako; - exports.deflate = deflate_1$2; - exports.deflateRaw = deflateRaw_1$1; - exports.gzip = gzip_1$1; - exports.inflate = inflate_1$2; - exports.inflateRaw = inflateRaw_1$1; + exports['default'] = pako; + exports.deflate = deflate_1; + exports.deflateRaw = deflateRaw_1; + exports.gzip = gzip_1; + exports.inflate = inflate_1; + exports.inflateRaw = inflateRaw_1; exports.ungzip = ungzip_1; Object.defineProperty(exports, '__esModule', { value: true }); diff --git a/dist/pako.min.js b/dist/pako.min.js index 42fe791..5f0fee1 100644 --- a/dist/pako.min.js +++ b/dist/pako.min.js @@ -1,2 +1,2 @@ -/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).pako={})}(this,(function(t){"use strict";function e(t){let e=t.length;for(;--e>=0;)t[e]=0}const a=256,i=286,n=30,s=15,r=new Uint8Array([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]),l=new Uint8Array([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]),o=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=new Array(576);e(d);const _=new Array(60);e(_);const f=new Array(512);e(f);const c=new Array(256);e(c);const u=new Array(29);e(u);const w=new Array(n);function b(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let g,p,m;function k(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(w);const v=t=>t<256?f[t]:f[256+(t>>>7)],y=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<{x(t,a[2*e],a[2*e+1])},A=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},E=(t,e,a)=>{const i=new Array(16);let n,r,l=0;for(n=1;n<=s;n++)i[n]=l=l+a[n-1]<<1;for(r=0;r<=e;r++){let e=t[2*r+1];0!==e&&(t[2*r]=A(i[e]++,e))}},R=t=>{let e;for(e=0;e{t.bi_valid>8?y(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},U=(t,e,a,i)=>{const n=2*e,s=2*a;return t[n]{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n{let n,s,o,h,d=0;if(0!==t.last_lit)do{n=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===n?z(t,s,e):(o=c[s],z(t,o+a+1,e),h=r[o],0!==h&&(s-=u[o],x(t,s,h)),n--,o=v(n),z(t,o,i),h=l[o],0!==h&&(n-=w[o],x(t,n,h)))}while(d{const a=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,r=e.stat_desc.elems;let l,o,h,d=-1;for(t.heap_len=0,t.heap_max=573,l=0;l>1;l>=1;l--)S(t,a,l);h=r;do{l=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,a,1),o=t.heap[1],t.heap[--t.heap_max]=l,t.heap[--t.heap_max]=o,a[2*h]=a[2*l]+a[2*o],t.depth[h]=(t.depth[l]>=t.depth[o]?t.depth[l]:t.depth[o])+1,a[2*l+1]=a[2*o+1]=h,t.heap[1]=h++,S(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,r=e.stat_desc.has_stree,l=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,h=e.stat_desc.max_length;let d,_,f,c,u,w,b=0;for(c=0;c<=s;c++)t.bl_count[c]=0;for(a[2*t.heap[t.heap_max]+1]=0,d=t.heap_max+1;d<573;d++)_=t.heap[d],c=a[2*a[2*_+1]+1]+1,c>h&&(c=h,b++),a[2*_+1]=c,_>i||(t.bl_count[c]++,u=0,_>=o&&(u=l[_-o]),w=a[2*_],t.opt_len+=w*(c+u),r&&(t.static_len+=w*(n[2*_+1]+u)));if(0!==b){do{for(c=h-1;0===t.bl_count[c];)c--;t.bl_count[c]--,t.bl_count[c+1]+=2,t.bl_count[h]--,b-=2}while(b>0);for(c=h;0!==c;c--)for(_=t.bl_count[c];0!==_;)f=t.heap[--d],f>i||(a[2*f+1]!==c&&(t.opt_len+=(c-a[2*f+1])*a[2*f],a[2*f+1]=c),_--)}})(t,e),E(a,d,t.bl_count)},T=(t,e,a)=>{let i,n,s=-1,r=e[1],l=0,o=7,h=4;for(0===r&&(o=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=e[2*(i+1)+1],++l{let i,n,s=-1,r=e[1],l=0,o=7,h=4;for(0===r&&(o=138,h=3),i=0;i<=a;i++)if(n=r,r=e[2*(i+1)+1],!(++l{x(t,0+(i?1:0),3),((t,e,a,i)=>{Z(t),i&&(y(t,a),y(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a})(t,e,a,!0)};var N={_tr_init:t=>{F||((()=>{let t,e,a,h,k;const v=new Array(16);for(a=0,h=0;h<28;h++)for(u[h]=a,t=0;t<1<>=7;h{let s,r,l=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e{let e;for(T(t,t.dyn_ltree,t.l_desc.max_code),T(t,t.dyn_dtree,t.d_desc.max_code),O(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),s=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=s&&(s=r)):s=r=i+5,i+4<=s&&-1!==e?L(t,e,i,n):4===t.strategy||r===s?(x(t,2+(n?1:0),3),D(t,d,_)):(x(t,4+(n?1:0),3),((t,e,a,i)=>{let n;for(x(t,e-257,5),x(t,a-1,5),x(t,i-4,4),n=0;n(t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(c[i]+a+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1),_tr_align:t=>{x(t,2,3),z(t,256,d),(t=>{16===t.bi_valid?(y(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var B=(t,e,a,i)=>{let n=65535&t|0,s=t>>>16&65535|0,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+e[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16|0};const C=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var M=(t,e,a,i)=>{const n=C,s=i+a;t^=-1;for(let a=i;a>>8^n[255&(t^e[a])];return-1^t},H={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:K,_tr_stored_block:P,_tr_flush_block:Y,_tr_tally:G,_tr_align:X}=N,{Z_NO_FLUSH:W,Z_PARTIAL_FLUSH:q,Z_FULL_FLUSH:J,Z_FINISH:Q,Z_BLOCK:V,Z_OK:$,Z_STREAM_END:tt,Z_STREAM_ERROR:et,Z_DATA_ERROR:at,Z_BUF_ERROR:it,Z_DEFAULT_COMPRESSION:nt,Z_FILTERED:st,Z_HUFFMAN_ONLY:rt,Z_RLE:lt,Z_FIXED:ot,Z_DEFAULT_STRATEGY:ht,Z_UNKNOWN:dt,Z_DEFLATED:_t}=j,ft=258,ct=262,ut=103,wt=113,bt=666,gt=(t,e)=>(t.msg=H[e],e),pt=t=>(t<<1)-(t>4?9:0),mt=t=>{let e=t.length;for(;--e>=0;)t[e]=0};let kt=(t,e,a)=>(e<{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},yt=(t,e)=>{Y(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,vt(t.strm)},xt=(t,e)=>{t.pending_buf[t.pending++]=e},zt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},At=(t,e,a,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),a),1===t.state.wrap?t.adler=B(t.adler,e,n,a):2===t.state.wrap&&(t.adler=M(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)},Et=(t,e)=>{let a,i,n=t.max_chain_length,s=t.strstart,r=t.prev_length,l=t.nice_match;const o=t.strstart>t.w_size-ct?t.strstart-(t.w_size-ct):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+ft;let c=h[s+r-1],u=h[s+r];t.prev_length>=t.good_match&&(n>>=2),l>t.lookahead&&(l=t.lookahead);do{if(a=e,h[a+r]===u&&h[a+r-1]===c&&h[a]===h[s]&&h[++a]===h[s+1]){s+=2,a++;do{}while(h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&sr){if(t.match_start=e,r=i,i>=l)break;c=h[s+r-1],u=h[s+r]}}}while((e=_[e&d])>o&&0!=--n);return r<=t.lookahead?r:t.lookahead},Rt=t=>{const e=t.w_size;let a,i,n,s,r;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-ct)){t.window.set(t.window.subarray(e,e+e),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,i=t.hash_size,a=i;do{n=t.head[--a],t.head[a]=n>=e?n-e:0}while(--i);i=e,a=i;do{n=t.prev[--a],t.prev[a]=n>=e?n-e:0}while(--i);s+=e}if(0===t.strm.avail_in)break;if(i=At(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=i,t.lookahead+t.insert>=3)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=kt(t,t.ins_h,t.window[r+1]);t.insert&&(t.ins_h=kt(t,t.ins_h,t.window[r+3-1]),t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead{let a,i;for(;;){if(t.lookahead=3&&(t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ct&&(t.match_length=Et(t,a)),t.match_length>=3)if(i=G(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=kt(t,t.ins_h,t.window[t.strstart+1]);else i=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2},Ut=(t,e)=>{let a,i,n;for(;;){if(t.lookahead=3&&(t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=G(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(yt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=G(t,0,t.window[t.strstart-1]),i&&yt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=G(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2};function St(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}const Dt=[new St(0,0,0,0,((t,e)=>{let a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Rt(t),0===t.lookahead&&e===W)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const i=t.block_start+a;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,yt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-ct&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(yt(t,!1),t.strm.avail_out),1)})),new St(4,4,8,4,Zt),new St(4,5,16,8,Zt),new St(4,6,32,32,Zt),new St(4,4,16,16,Ut),new St(8,16,32,32,Ut),new St(8,16,128,128,Ut),new St(8,32,128,256,Ut),new St(32,128,258,1024,Ut),new St(32,258,258,4096,Ut)];function Ot(){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=_t,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 Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),mt(this.dyn_ltree),mt(this.dyn_dtree),mt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),mt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),mt(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}const Tt=t=>{if(!t||!t.state)return gt(t,et);t.total_in=t.total_out=0,t.data_type=dt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:wt,t.adler=2===e.wrap?0:1,e.last_flush=W,K(e),$},It=t=>{const e=Tt(t);var a;return e===$&&((a=t.state).window_size=2*a.w_size,mt(a.head),a.max_lazy_match=Dt[a.level].max_lazy,a.good_match=Dt[a.level].good_length,a.nice_match=Dt[a.level].nice_length,a.max_chain_length=Dt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Ft=(t,e,a,i,n,s)=>{if(!t)return et;let r=1;if(e===nt&&(e=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==_t||i<8||i>15||e<0||e>9||s<0||s>ot)return gt(t,et);8===i&&(i=9);const l=new Ot;return t.state=l,l.strm=t,l.wrap=r,l.gzhead=null,l.w_bits=i,l.w_size=1<Ft(t,e,_t,15,8,ht),deflateInit2:Ft,deflateReset:It,deflateResetKeep:Tt,deflateSetHeader:(t,e)=>t&&t.state?2!==t.state.wrap?et:(t.state.gzhead=e,$):et,deflate:(t,e)=>{let a,i;if(!t||!t.state||e>V||e<0)return t?gt(t,et):et;const n=t.state;if(!t.output||!t.input&&0!==t.avail_in||n.status===bt&&e!==Q)return gt(t,0===t.avail_out?it:et);n.strm=t;const s=n.last_flush;if(n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,xt(n,31),xt(n,139),xt(n,8),n.gzhead?(xt(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),xt(n,255&n.gzhead.time),xt(n,n.gzhead.time>>8&255),xt(n,n.gzhead.time>>16&255),xt(n,n.gzhead.time>>24&255),xt(n,9===n.level?2:n.strategy>=rt||n.level<2?4:0),xt(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(xt(n,255&n.gzhead.extra.length),xt(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=M(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,9===n.level?2:n.strategy>=rt||n.level<2?4:0),xt(n,3),n.status=wt);else{let e=_t+(n.w_bits-8<<4)<<8,a=-1;a=n.strategy>=rt||n.level<2?0:n.level<6?1:6===n.level?2:3,e|=a<<6,0!==n.strstart&&(e|=32),e+=31-e%31,n.status=wt,zt(n,e),0!==n.strstart&&(zt(n,t.adler>>>16),zt(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(a=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),vt(t),a=n.pending,n.pending!==n.pending_buf_size));)xt(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),vt(t),a=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexa&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),0===i&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),vt(t),a=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexa&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),0===i&&(n.status=ut)}else n.status=ut;if(n.status===ut&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&vt(t),n.pending+2<=n.pending_buf_size&&(xt(n,255&t.adler),xt(n,t.adler>>8&255),t.adler=0,n.status=wt)):n.status=wt),0!==n.pending){if(vt(t),0===t.avail_out)return n.last_flush=-1,$}else if(0===t.avail_in&&pt(e)<=pt(s)&&e!==Q)return gt(t,it);if(n.status===bt&&0!==t.avail_in)return gt(t,it);if(0!==t.avail_in||0!==n.lookahead||e!==W&&n.status!==bt){let a=n.strategy===rt?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(Rt(t),0===t.lookahead)){if(e===W)return 1;break}if(t.match_length=0,a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2})(n,e):n.strategy===lt?((t,e)=>{let a,i,n,s;const r=t.window;for(;;){if(t.lookahead<=ft){if(Rt(t),t.lookahead<=ft&&e===W)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=t.strstart+ft;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=G(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2})(n,e):Dt[n.level].func(n,e);if(3!==a&&4!==a||(n.status=bt),1===a||3===a)return 0===t.avail_out&&(n.last_flush=-1),$;if(2===a&&(e===q?X(n):e!==V&&(P(n,0,0,!1),e===J&&(mt(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),vt(t),0===t.avail_out))return n.last_flush=-1,$}return e!==Q?$:n.wrap<=0?tt:(2===n.wrap?(xt(n,255&t.adler),xt(n,t.adler>>8&255),xt(n,t.adler>>16&255),xt(n,t.adler>>24&255),xt(n,255&t.total_in),xt(n,t.total_in>>8&255),xt(n,t.total_in>>16&255),xt(n,t.total_in>>24&255)):(zt(n,t.adler>>>16),zt(n,65535&t.adler)),vt(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?$:tt)},deflateEnd:t=>{if(!t||!t.state)return et;const e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==ut&&e!==wt&&e!==bt?gt(t,et):(t.state=null,e===wt?gt(t,at):$)},deflateSetDictionary:(t,e)=>{let a=e.length;if(!t||!t.state)return et;const i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return et;if(1===n&&(t.adler=B(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(mt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(a-i.w_size,a),0),e=t,a=i.w_size}const s=t.avail_in,r=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Rt(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=kt(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,Rt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=r,t.input=l,t.avail_in=s,i.wrap=n,$},deflateInfo:"pako deflate (from Nodeca project)"};const Nt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Bt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const e in a)Nt(a,e)&&(t[e]=a[e])}}return t},Ct=t=>{let e=0;for(let a=0,i=t.length;a=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Ht[254]=Ht[254]=1;var jt=t=>{let e,a,i,n,s,r=t.length,l=0;for(n=0;n>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},Kt=(t,e)=>{let a,i;const n=e||t.length,s=new Array(2*n);for(i=0,a=0;a4)s[i++]=65533,a+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&a1?s[i++]=65533:e<65536?s[i++]=e:(e-=65536,s[i++]=55296|e>>10&1023,s[i++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Mt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a="";for(let i=0;i{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Ht[t[a]]>e?a:e};var Yt=function(){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};const Gt=Object.prototype.toString,{Z_NO_FLUSH:Xt,Z_SYNC_FLUSH:Wt,Z_FULL_FLUSH:qt,Z_FINISH:Jt,Z_OK:Qt,Z_STREAM_END:Vt,Z_DEFAULT_COMPRESSION:$t,Z_DEFAULT_STRATEGY:te,Z_DEFLATED:ee}=j;function ae(t){this.options=Bt({level:$t,method:ee,chunkSize:16384,windowBits:15,memLevel:8,strategy:te},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Yt,this.strm.avail_out=0;let a=Lt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Qt)throw new Error(H[a]);if(e.header&&Lt.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?jt(e.dictionary):"[object ArrayBuffer]"===Gt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=Lt.deflateSetDictionary(this.strm,t),a!==Qt)throw new Error(H[a]);this._dict_set=!0}}function ie(t,e){const a=new ae(e);if(a.push(t,!0),a.err)throw a.msg||H[a.err];return a.result}ae.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Jt:Xt,"string"==typeof t?a.input=jt(t):"[object ArrayBuffer]"===Gt.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===Wt||s===qt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=Lt.deflate(a,s),n===Vt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=Lt.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Qt;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},ae.prototype.onData=function(t){this.chunks.push(t)},ae.prototype.onEnd=function(t){t===Qt&&(this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var ne={Deflate:ae,deflate:ie,deflateRaw:function(t,e){return(e=e||{}).raw=!0,ie(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,ie(t,e)},constants:j};var se=function(t,e){let a,i,n,s,r,l,o,h,d,_,f,c,u,w,b,g,p,m,k,v,y,x,z,A;const E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),l=E.dmax,o=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,c=E.bits,u=E.lencode,w=E.distcode,b=(1<>>24,f>>>=m,c-=m,m=p>>>16&255,0===m)A[n++]=65535&p;else{if(!(16&m)){if(0==(64&m)){p=u[(65535&p)+(f&(1<>>=m,c-=m),c<15&&(f+=z[a++]<>>24,f>>>=m,c-=m,m=p>>>16&255,!(16&m)){if(0==(64&m)){p=w[(65535&p)+(f&(1<l){t.msg="invalid distance too far back",E.mode=30;break t}if(f>>>=m,c-=m,m=n-s,v>m){if(m=v-m,m>h&&E.sane){t.msg="invalid distance too far back",E.mode=30;break t}if(y=0,x=_,0===d){if(y+=o-m,m2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],k-=3;k&&(A[n++]=x[y++],k>1&&(A[n++]=x[y++]))}else{y=n-v;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],k-=3}while(k>2);k&&(A[n++]=A[y++],k>1&&(A[n++]=A[y++]))}break}}break}}while(a>3,a-=k,c-=k<<3,f&=(1<{const o=l.bits;let h,d,_,f,c,u,w=0,b=0,g=0,p=0,m=0,k=0,v=0,y=0,x=0,z=0,A=null,E=0;const R=new Uint16Array(16),Z=new Uint16Array(16);let U,S,D,O=null,T=0;for(w=0;w<=re;w++)R[w]=0;for(b=0;b=1&&0===R[p];p--);if(m>p&&(m=p),0===p)return n[s++]=20971520,n[s++]=20971520,l.bits=1,0;for(g=1;g0&&(0===t||1!==p))return-1;for(Z[1]=0,w=1;w852||2===t&&x>592)return 1;for(;;){U=w-v,r[b]u?(S=O[T+r[b]],D=A[E+r[b]]):(S=96,D=0),h=1<>v)+d]=U<<24|S<<16|D|0}while(0!==d);for(h=1<>=1;if(0!==h?(z&=h-1,z+=h):z=0,b++,0==--R[w]){if(w===p)break;w=e[a+r[b]]}if(w>m&&(z&f)!==_){for(0===v&&(v=m),c+=g,k=w-v,y=1<852||2===t&&x>592)return 1;_=z&f,n[_]=m<<24|k<<16|c-s|0}}return 0!==z&&(n[c+z]=w-v<<24|64<<16|0),l.bits=m,0};const{Z_FINISH:fe,Z_BLOCK:ce,Z_TREES:ue,Z_OK:we,Z_STREAM_END:be,Z_NEED_DICT:ge,Z_STREAM_ERROR:pe,Z_DATA_ERROR:me,Z_MEM_ERROR:ke,Z_BUF_ERROR:ve,Z_DEFLATED:ye}=j,xe=12,ze=30,Ae=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function Ee(){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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Re=t=>{if(!t||!t.state)return pe;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,we},Ze=t=>{if(!t||!t.state)return pe;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Re(t)},Ue=(t,e)=>{let a;if(!t||!t.state)return pe;const i=t.state;return e<0?(a=0,e=-e):(a=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?pe:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,Ze(t))},Se=(t,e)=>{if(!t)return pe;const a=new Ee;t.state=a,a.window=null;const i=Ue(t,e);return i!==we&&(t.state=null),i};let De,Oe,Te=!0;const Ie=t=>{if(Te){De=new Int32Array(512),Oe=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(_e(1,t.lens,0,288,De,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;_e(2,t.lens,0,32,Oe,0,t.work,{bits:5}),Te=!1}t.lencode=De,t.lenbits=9,t.distcode=Oe,t.distbits=5},Fe=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<=s.wsize?(s.window.set(e.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(e.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(e.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whaveSe(t,15),inflateInit2:Se,inflate:(t,e)=>{let a,i,n,s,r,l,o,h,d,_,f,c,u,w,b,g,p,m,k,v,y,x,z=0;const A=new Uint8Array(4);let E,R;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return pe;a=t.state,a.mode===xe&&(a.mode=13),r=t.next_out,n=t.output,o=t.avail_out,s=t.next_in,i=t.input,l=t.avail_in,h=a.hold,d=a.bits,_=l,f=o,x=we;t:for(;;)switch(a.mode){case 1:if(0===a.wrap){a.mode=13;break}for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>>8&255,a.check=M(a.check,A,2,0),h=0,d=0,a.mode=2;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=ze;break}if((15&h)!==ye){t.msg="unknown compression method",a.mode=ze;break}if(h>>>=4,d-=4,y=8+(15&h),0===a.wbits)a.wbits=y;else if(y>a.wbits){t.msg="invalid window size",a.mode=ze;break}a.dmax=1<>8&1),512&a.flags&&(A[0]=255&h,A[1]=h>>>8&255,a.check=M(a.check,A,2,0)),h=0,d=0,a.mode=3;case 3:for(;d<32;){if(0===l)break t;l--,h+=i[s++]<>>8&255,A[2]=h>>>16&255,A[3]=h>>>24&255,a.check=M(a.check,A,4,0)),h=0,d=0,a.mode=4;case 4:for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>8),512&a.flags&&(A[0]=255&h,A[1]=h>>>8&255,a.check=M(a.check,A,2,0)),h=0,d=0,a.mode=5;case 5:if(1024&a.flags){for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>>8&255,a.check=M(a.check,A,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=6;case 6:if(1024&a.flags&&(c=a.length,c>l&&(c=l),c&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+c),y)),512&a.flags&&(a.check=M(a.check,i,c,s)),l-=c,s+=c,a.length-=c),a.length))break t;a.length=0,a.mode=7;case 7:if(2048&a.flags){if(0===l)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&c>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=xe;break;case 10:for(;d<32;){if(0===l)break t;l--,h+=i[s++]<>>=7&d,d-=7&d,a.mode=27;break}for(;d<3;){if(0===l)break t;l--,h+=i[s++]<>>=1,d-=1,3&h){case 0:a.mode=14;break;case 1:if(Ie(a),a.mode=20,e===ue){h>>>=2,d-=2;break t}break;case 2:a.mode=17;break;case 3:t.msg="invalid block type",a.mode=ze}h>>>=2,d-=2;break;case 14:for(h>>>=7&d,d-=7&d;d<32;){if(0===l)break t;l--,h+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths",a.mode=ze;break}if(a.length=65535&h,h=0,d=0,a.mode=15,e===ue)break t;case 15:a.mode=16;case 16:if(c=a.length,c){if(c>l&&(c=l),c>o&&(c=o),0===c)break t;n.set(i.subarray(s,s+c),r),l-=c,s+=c,o-=c,r+=c,a.length-=c;break}a.mode=xe;break;case 17:for(;d<14;){if(0===l)break t;l--,h+=i[s++]<>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=ze;break}a.have=0,a.mode=18;case 18:for(;a.have>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},x=_e(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid code lengths set",a.mode=ze;break}a.have=0,a.mode=19;case 19:for(;a.have>>24,g=z>>>16&255,p=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=b,d-=b,a.lens[a.have++]=p;else{if(16===p){for(R=b+2;d>>=b,d-=b,0===a.have){t.msg="invalid bit length repeat",a.mode=ze;break}y=a.lens[a.have-1],c=3+(3&h),h>>>=2,d-=2}else if(17===p){for(R=b+3;d>>=b,d-=b,y=0,c=3+(7&h),h>>>=3,d-=3}else{for(R=b+7;d>>=b,d-=b,y=0,c=11+(127&h),h>>>=7,d-=7}if(a.have+c>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=ze;break}for(;c--;)a.lens[a.have++]=y}}if(a.mode===ze)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=ze;break}if(a.lenbits=9,E={bits:a.lenbits},x=_e(1,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid literal/lengths set",a.mode=ze;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},x=_e(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,x){t.msg="invalid distances set",a.mode=ze;break}if(a.mode=20,e===ue)break t;case 20:a.mode=21;case 21:if(l>=6&&o>=258){t.next_out=r,t.avail_out=o,t.next_in=s,t.avail_in=l,a.hold=h,a.bits=d,se(t,f),r=t.next_out,n=t.output,o=t.avail_out,s=t.next_in,i=t.input,l=t.avail_in,h=a.hold,d=a.bits,a.mode===xe&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<>>24,g=z>>>16&255,p=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>m)],b=z>>>24,g=z>>>16&255,p=65535&z,!(m+b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=m,d-=m,a.back+=m}if(h>>>=b,d-=b,a.back+=b,a.length=p,0===g){a.mode=26;break}if(32&g){a.back=-1,a.mode=xe;break}if(64&g){t.msg="invalid literal/length code",a.mode=ze;break}a.extra=15&g,a.mode=22;case 22:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=23;case 23:for(;z=a.distcode[h&(1<>>24,g=z>>>16&255,p=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>m)],b=z>>>24,g=z>>>16&255,p=65535&z,!(m+b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=m,d-=m,a.back+=m}if(h>>>=b,d-=b,a.back+=b,64&g){t.msg="invalid distance code",a.mode=ze;break}a.offset=p,a.extra=15&g,a.mode=24;case 24:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=ze;break}a.mode=25;case 25:if(0===o)break t;if(c=f-o,a.offset>c){if(c=a.offset-c,c>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=ze;break}c>a.wnext?(c-=a.wnext,u=a.wsize-c):u=a.wnext-c,c>a.length&&(c=a.length),w=a.window}else w=n,u=r-a.offset,c=a.length;c>o&&(c=o),o-=c,a.length-=c;do{n[r++]=w[u++]}while(--c);0===a.length&&(a.mode=21);break;case 26:if(0===o)break t;n[r++]=a.length,o--,a.mode=21;break;case 27:if(a.wrap){for(;d<32;){if(0===l)break t;l--,h|=i[s++]<{if(!t||!t.state)return pe;let e=t.state;return e.window&&(e.window=null),t.state=null,we},inflateGetHeader:(t,e)=>{if(!t||!t.state)return pe;const a=t.state;return 0==(2&a.wrap)?pe:(a.head=e,e.done=!1,we)},inflateSetDictionary:(t,e)=>{const a=e.length;let i,n,s;return t&&t.state?(i=t.state,0!==i.wrap&&11!==i.mode?pe:11===i.mode&&(n=1,n=B(n,e,a,0),n!==i.check)?me:(s=Fe(t,e,a,a),s?(i.mode=31,ke):(i.havedict=1,we))):pe},inflateInfo:"pako inflate (from Nodeca project)"};var Ne=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Be=Object.prototype.toString,{Z_NO_FLUSH:Ce,Z_FINISH:Me,Z_OK:He,Z_STREAM_END:je,Z_NEED_DICT:Ke,Z_STREAM_ERROR:Pe,Z_DATA_ERROR:Ye,Z_MEM_ERROR:Ge}=j;function Xe(t){this.options=Bt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Yt,this.strm.avail_out=0;let a=Le.inflateInit2(this.strm,e.windowBits);if(a!==He)throw new Error(H[a]);if(this.header=new Ne,Le.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=jt(e.dictionary):"[object ArrayBuffer]"===Be.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Le.inflateSetDictionary(this.strm,e.dictionary),a!==He)))throw new Error(H[a])}function We(t,e){const a=new Xe(e);if(a.push(t),a.err)throw a.msg||H[a.err];return a.result}Xe.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,l;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Me:Ce,"[object ArrayBuffer]"===Be.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=Le.inflate(a,r),s===Ke&&n&&(s=Le.inflateSetDictionary(a,n),s===He?s=Le.inflate(a,r):s===Ye&&(s=Ke));a.avail_in>0&&s===je&&a.state.wrap>0&&0!==t[a.next_in];)Le.inflateReset(a),s=Le.inflate(a,r);switch(s){case Pe:case Ye:case Ke:case Ge:return this.onEnd(s),this.ended=!0,!1}if(l=a.avail_out,a.next_out&&(0===a.avail_out||s===je))if("string"===this.options.to){let t=Pt(a.output,a.next_out),e=a.next_out-t,n=Kt(a.output,t);a.next_out=e,a.avail_out=i-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==He||0!==l){if(s===je)return s=Le.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},Xe.prototype.onData=function(t){this.chunks.push(t)},Xe.prototype.onEnd=function(t){t===He&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var qe={Inflate:Xe,inflate:We,inflateRaw:function(t,e){return(e=e||{}).raw=!0,We(t,e)},ungzip:We,constants:j};const{Deflate:Je,deflate:Qe,deflateRaw:Ve,gzip:$e}=ne,{Inflate:ta,inflate:ea,inflateRaw:aa,ungzip:ia}=qe;var na=Je,sa=Qe,ra=Ve,la=$e,oa=ta,ha=ea,da=aa,_a=ia,fa=j,ca={Deflate:na,deflate:sa,deflateRaw:ra,gzip:la,Inflate:oa,inflate:ha,inflateRaw:da,ungzip:_a,constants:fa};t.Deflate=na,t.Inflate=oa,t.constants=fa,t.default=ca,t.deflate=sa,t.deflateRaw=ra,t.gzip=la,t.inflate=ha,t.inflateRaw=da,t.ungzip=_a,Object.defineProperty(t,"__esModule",{value:!0})})); +/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).pako={})}(this,(function(t){"use strict";function e(t){let e=t.length;for(;--e>=0;)t[e]=0}const a=256,i=286,n=30,s=15,r=new Uint8Array([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]),l=new Uint8Array([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]),o=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=new Array(576);e(d);const _=new Array(60);e(_);const f=new Array(512);e(f);const c=new Array(256);e(c);const u=new Array(29);e(u);const w=new Array(n);function b(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let g,p,m;function k(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(w);const v=t=>t<256?f[t]:f[256+(t>>>7)],y=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<{x(t,a[2*e],a[2*e+1])},A=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},E=(t,e,a)=>{const i=new Array(16);let n,r,l=0;for(n=1;n<=s;n++)i[n]=l=l+a[n-1]<<1;for(r=0;r<=e;r++){let e=t[2*r+1];0!==e&&(t[2*r]=A(i[e]++,e))}},R=t=>{let e;for(e=0;e{t.bi_valid>8?y(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},U=(t,e,a,i)=>{const n=2*e,s=2*a;return t[n]{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n{let n,s,o,h,d=0;if(0!==t.last_lit)do{n=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===n?z(t,s,e):(o=c[s],z(t,o+a+1,e),h=r[o],0!==h&&(s-=u[o],x(t,s,h)),n--,o=v(n),z(t,o,i),h=l[o],0!==h&&(n-=w[o],x(t,n,h)))}while(d{const a=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,r=e.stat_desc.elems;let l,o,h,d=-1;for(t.heap_len=0,t.heap_max=573,l=0;l>1;l>=1;l--)S(t,a,l);h=r;do{l=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,a,1),o=t.heap[1],t.heap[--t.heap_max]=l,t.heap[--t.heap_max]=o,a[2*h]=a[2*l]+a[2*o],t.depth[h]=(t.depth[l]>=t.depth[o]?t.depth[l]:t.depth[o])+1,a[2*l+1]=a[2*o+1]=h,t.heap[1]=h++,S(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,r=e.stat_desc.has_stree,l=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,h=e.stat_desc.max_length;let d,_,f,c,u,w,b=0;for(c=0;c<=s;c++)t.bl_count[c]=0;for(a[2*t.heap[t.heap_max]+1]=0,d=t.heap_max+1;d<573;d++)_=t.heap[d],c=a[2*a[2*_+1]+1]+1,c>h&&(c=h,b++),a[2*_+1]=c,_>i||(t.bl_count[c]++,u=0,_>=o&&(u=l[_-o]),w=a[2*_],t.opt_len+=w*(c+u),r&&(t.static_len+=w*(n[2*_+1]+u)));if(0!==b){do{for(c=h-1;0===t.bl_count[c];)c--;t.bl_count[c]--,t.bl_count[c+1]+=2,t.bl_count[h]--,b-=2}while(b>0);for(c=h;0!==c;c--)for(_=t.bl_count[c];0!==_;)f=t.heap[--d],f>i||(a[2*f+1]!==c&&(t.opt_len+=(c-a[2*f+1])*a[2*f],a[2*f+1]=c),_--)}})(t,e),E(a,d,t.bl_count)},O=(t,e,a)=>{let i,n,s=-1,r=e[1],l=0,o=7,h=4;for(0===r&&(o=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=e[2*(i+1)+1],++l{let i,n,s=-1,r=e[1],l=0,o=7,h=4;for(0===r&&(o=138,h=3),i=0;i<=a;i++)if(n=r,r=e[2*(i+1)+1],!(++l{x(t,0+(i?1:0),3),((t,e,a,i)=>{Z(t),i&&(y(t,a),y(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a})(t,e,a,!0)};var N={_tr_init:t=>{F||((()=>{let t,e,a,h,k;const v=new Array(16);for(a=0,h=0;h<28;h++)for(u[h]=a,t=0;t<1<>=7;h{let s,r,l=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e{let e;for(O(t,t.dyn_ltree,t.l_desc.max_code),O(t,t.dyn_dtree,t.d_desc.max_code),T(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),s=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=s&&(s=r)):s=r=i+5,i+4<=s&&-1!==e?L(t,e,i,n):4===t.strategy||r===s?(x(t,2+(n?1:0),3),D(t,d,_)):(x(t,4+(n?1:0),3),((t,e,a,i)=>{let n;for(x(t,e-257,5),x(t,a-1,5),x(t,i-4,4),n=0;n(t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(c[i]+a+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1),_tr_align:t=>{x(t,2,3),z(t,256,d),(t=>{16===t.bi_valid?(y(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var B=(t,e,a,i)=>{let n=65535&t|0,s=t>>>16&65535|0,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+e[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16|0};const C=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var M=(t,e,a,i)=>{const n=C,s=i+a;t^=-1;for(let a=i;a>>8^n[255&(t^e[a])];return-1^t},H={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:K,_tr_stored_block:P,_tr_flush_block:Y,_tr_tally:G,_tr_align:X}=N,{Z_NO_FLUSH:W,Z_PARTIAL_FLUSH:q,Z_FULL_FLUSH:J,Z_FINISH:Q,Z_BLOCK:V,Z_OK:$,Z_STREAM_END:tt,Z_STREAM_ERROR:et,Z_DATA_ERROR:at,Z_BUF_ERROR:it,Z_DEFAULT_COMPRESSION:nt,Z_FILTERED:st,Z_HUFFMAN_ONLY:rt,Z_RLE:lt,Z_FIXED:ot,Z_DEFAULT_STRATEGY:ht,Z_UNKNOWN:dt,Z_DEFLATED:_t}=j,ft=258,ct=262,ut=103,wt=113,bt=666,gt=(t,e)=>(t.msg=H[e],e),pt=t=>(t<<1)-(t>4?9:0),mt=t=>{let e=t.length;for(;--e>=0;)t[e]=0};let kt=(t,e,a)=>(e<{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},yt=(t,e)=>{Y(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,vt(t.strm)},xt=(t,e)=>{t.pending_buf[t.pending++]=e},zt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},At=(t,e,a,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),a),1===t.state.wrap?t.adler=B(t.adler,e,n,a):2===t.state.wrap&&(t.adler=M(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)},Et=(t,e)=>{let a,i,n=t.max_chain_length,s=t.strstart,r=t.prev_length,l=t.nice_match;const o=t.strstart>t.w_size-ct?t.strstart-(t.w_size-ct):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+ft;let c=h[s+r-1],u=h[s+r];t.prev_length>=t.good_match&&(n>>=2),l>t.lookahead&&(l=t.lookahead);do{if(a=e,h[a+r]===u&&h[a+r-1]===c&&h[a]===h[s]&&h[++a]===h[s+1]){s+=2,a++;do{}while(h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&sr){if(t.match_start=e,r=i,i>=l)break;c=h[s+r-1],u=h[s+r]}}}while((e=_[e&d])>o&&0!=--n);return r<=t.lookahead?r:t.lookahead},Rt=t=>{const e=t.w_size;let a,i,n,s,r;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-ct)){t.window.set(t.window.subarray(e,e+e),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,i=t.hash_size,a=i;do{n=t.head[--a],t.head[a]=n>=e?n-e:0}while(--i);i=e,a=i;do{n=t.prev[--a],t.prev[a]=n>=e?n-e:0}while(--i);s+=e}if(0===t.strm.avail_in)break;if(i=At(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=i,t.lookahead+t.insert>=3)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=kt(t,t.ins_h,t.window[r+1]);t.insert&&(t.ins_h=kt(t,t.ins_h,t.window[r+3-1]),t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead{let a,i;for(;;){if(t.lookahead=3&&(t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ct&&(t.match_length=Et(t,a)),t.match_length>=3)if(i=G(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=kt(t,t.ins_h,t.window[t.strstart+1]);else i=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2},Ut=(t,e)=>{let a,i,n;for(;;){if(t.lookahead=3&&(t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=G(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(yt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=G(t,0,t.window[t.strstart-1]),i&&yt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=G(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2};function St(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}const Dt=[new St(0,0,0,0,((t,e)=>{let a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Rt(t),0===t.lookahead&&e===W)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const i=t.block_start+a;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,yt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-ct&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(yt(t,!1),t.strm.avail_out),1)})),new St(4,4,8,4,Zt),new St(4,5,16,8,Zt),new St(4,6,32,32,Zt),new St(4,4,16,16,Ut),new St(8,16,32,32,Ut),new St(8,16,128,128,Ut),new St(8,32,128,256,Ut),new St(32,128,258,1024,Ut),new St(32,258,258,4096,Ut)];function Tt(){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=_t,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 Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),mt(this.dyn_ltree),mt(this.dyn_dtree),mt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),mt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),mt(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}const Ot=t=>{if(!t||!t.state)return gt(t,et);t.total_in=t.total_out=0,t.data_type=dt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:wt,t.adler=2===e.wrap?0:1,e.last_flush=W,K(e),$},It=t=>{const e=Ot(t);var a;return e===$&&((a=t.state).window_size=2*a.w_size,mt(a.head),a.max_lazy_match=Dt[a.level].max_lazy,a.good_match=Dt[a.level].good_length,a.nice_match=Dt[a.level].nice_length,a.max_chain_length=Dt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Ft=(t,e,a,i,n,s)=>{if(!t)return et;let r=1;if(e===nt&&(e=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==_t||i<8||i>15||e<0||e>9||s<0||s>ot)return gt(t,et);8===i&&(i=9);const l=new Tt;return t.state=l,l.strm=t,l.wrap=r,l.gzhead=null,l.w_bits=i,l.w_size=1<Ft(t,e,_t,15,8,ht),deflateInit2:Ft,deflateReset:It,deflateResetKeep:Ot,deflateSetHeader:(t,e)=>t&&t.state?2!==t.state.wrap?et:(t.state.gzhead=e,$):et,deflate:(t,e)=>{let a,i;if(!t||!t.state||e>V||e<0)return t?gt(t,et):et;const n=t.state;if(!t.output||!t.input&&0!==t.avail_in||n.status===bt&&e!==Q)return gt(t,0===t.avail_out?it:et);n.strm=t;const s=n.last_flush;if(n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,xt(n,31),xt(n,139),xt(n,8),n.gzhead?(xt(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),xt(n,255&n.gzhead.time),xt(n,n.gzhead.time>>8&255),xt(n,n.gzhead.time>>16&255),xt(n,n.gzhead.time>>24&255),xt(n,9===n.level?2:n.strategy>=rt||n.level<2?4:0),xt(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(xt(n,255&n.gzhead.extra.length),xt(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=M(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,9===n.level?2:n.strategy>=rt||n.level<2?4:0),xt(n,3),n.status=wt);else{let e=_t+(n.w_bits-8<<4)<<8,a=-1;a=n.strategy>=rt||n.level<2?0:n.level<6?1:6===n.level?2:3,e|=a<<6,0!==n.strstart&&(e|=32),e+=31-e%31,n.status=wt,zt(n,e),0!==n.strstart&&(zt(n,t.adler>>>16),zt(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(a=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),vt(t),a=n.pending,n.pending!==n.pending_buf_size));)xt(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),vt(t),a=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexa&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),0===i&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),vt(t),a=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexa&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),0===i&&(n.status=ut)}else n.status=ut;if(n.status===ut&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&vt(t),n.pending+2<=n.pending_buf_size&&(xt(n,255&t.adler),xt(n,t.adler>>8&255),t.adler=0,n.status=wt)):n.status=wt),0!==n.pending){if(vt(t),0===t.avail_out)return n.last_flush=-1,$}else if(0===t.avail_in&&pt(e)<=pt(s)&&e!==Q)return gt(t,it);if(n.status===bt&&0!==t.avail_in)return gt(t,it);if(0!==t.avail_in||0!==n.lookahead||e!==W&&n.status!==bt){let a=n.strategy===rt?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(Rt(t),0===t.lookahead)){if(e===W)return 1;break}if(t.match_length=0,a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2})(n,e):n.strategy===lt?((t,e)=>{let a,i,n,s;const r=t.window;for(;;){if(t.lookahead<=ft){if(Rt(t),t.lookahead<=ft&&e===W)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=t.strstart+ft;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=G(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2})(n,e):Dt[n.level].func(n,e);if(3!==a&&4!==a||(n.status=bt),1===a||3===a)return 0===t.avail_out&&(n.last_flush=-1),$;if(2===a&&(e===q?X(n):e!==V&&(P(n,0,0,!1),e===J&&(mt(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),vt(t),0===t.avail_out))return n.last_flush=-1,$}return e!==Q?$:n.wrap<=0?tt:(2===n.wrap?(xt(n,255&t.adler),xt(n,t.adler>>8&255),xt(n,t.adler>>16&255),xt(n,t.adler>>24&255),xt(n,255&t.total_in),xt(n,t.total_in>>8&255),xt(n,t.total_in>>16&255),xt(n,t.total_in>>24&255)):(zt(n,t.adler>>>16),zt(n,65535&t.adler)),vt(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?$:tt)},deflateEnd:t=>{if(!t||!t.state)return et;const e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==ut&&e!==wt&&e!==bt?gt(t,et):(t.state=null,e===wt?gt(t,at):$)},deflateSetDictionary:(t,e)=>{let a=e.length;if(!t||!t.state)return et;const i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return et;if(1===n&&(t.adler=B(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(mt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(a-i.w_size,a),0),e=t,a=i.w_size}const s=t.avail_in,r=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Rt(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=kt(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,Rt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=r,t.input=l,t.avail_in=s,i.wrap=n,$},deflateInfo:"pako deflate (from Nodeca project)"};const Nt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Bt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const e in a)Nt(a,e)&&(t[e]=a[e])}}return t},Ct=t=>{let e=0;for(let a=0,i=t.length;a=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Ht[254]=Ht[254]=1;var jt=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,i,n,s,r=t.length,l=0;for(n=0;n>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},Kt=(t,e)=>{const a=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,n;const s=new Array(2*a);for(n=0,i=0;i4)s[n++]=65533,i+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&i1?s[n++]=65533:e<65536?s[n++]=e:(e-=65536,s[n++]=55296|e>>10&1023,s[n++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Mt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a="";for(let i=0;i{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Ht[t[a]]>e?a:e};var Yt=function(){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};const Gt=Object.prototype.toString,{Z_NO_FLUSH:Xt,Z_SYNC_FLUSH:Wt,Z_FULL_FLUSH:qt,Z_FINISH:Jt,Z_OK:Qt,Z_STREAM_END:Vt,Z_DEFAULT_COMPRESSION:$t,Z_DEFAULT_STRATEGY:te,Z_DEFLATED:ee}=j;function ae(t){this.options=Bt({level:$t,method:ee,chunkSize:16384,windowBits:15,memLevel:8,strategy:te},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Yt,this.strm.avail_out=0;let a=Lt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Qt)throw new Error(H[a]);if(e.header&&Lt.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?jt(e.dictionary):"[object ArrayBuffer]"===Gt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=Lt.deflateSetDictionary(this.strm,t),a!==Qt)throw new Error(H[a]);this._dict_set=!0}}function ie(t,e){const a=new ae(e);if(a.push(t,!0),a.err)throw a.msg||H[a.err];return a.result}ae.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Jt:Xt,"string"==typeof t?a.input=jt(t):"[object ArrayBuffer]"===Gt.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===Wt||s===qt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=Lt.deflate(a,s),n===Vt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=Lt.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Qt;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},ae.prototype.onData=function(t){this.chunks.push(t)},ae.prototype.onEnd=function(t){t===Qt&&(this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var ne={Deflate:ae,deflate:ie,deflateRaw:function(t,e){return(e=e||{}).raw=!0,ie(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,ie(t,e)},constants:j};var se=function(t,e){let a,i,n,s,r,l,o,h,d,_,f,c,u,w,b,g,p,m,k,v,y,x,z,A;const E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),l=E.dmax,o=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,c=E.bits,u=E.lencode,w=E.distcode,b=(1<>>24,f>>>=m,c-=m,m=p>>>16&255,0===m)A[n++]=65535&p;else{if(!(16&m)){if(0==(64&m)){p=u[(65535&p)+(f&(1<>>=m,c-=m),c<15&&(f+=z[a++]<>>24,f>>>=m,c-=m,m=p>>>16&255,!(16&m)){if(0==(64&m)){p=w[(65535&p)+(f&(1<l){t.msg="invalid distance too far back",E.mode=30;break t}if(f>>>=m,c-=m,m=n-s,v>m){if(m=v-m,m>h&&E.sane){t.msg="invalid distance too far back",E.mode=30;break t}if(y=0,x=_,0===d){if(y+=o-m,m2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],k-=3;k&&(A[n++]=x[y++],k>1&&(A[n++]=x[y++]))}else{y=n-v;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],k-=3}while(k>2);k&&(A[n++]=A[y++],k>1&&(A[n++]=A[y++]))}break}}break}}while(a>3,a-=k,c-=k<<3,f&=(1<{const o=l.bits;let h,d,_,f,c,u,w=0,b=0,g=0,p=0,m=0,k=0,v=0,y=0,x=0,z=0,A=null,E=0;const R=new Uint16Array(16),Z=new Uint16Array(16);let U,S,D,T=null,O=0;for(w=0;w<=re;w++)R[w]=0;for(b=0;b=1&&0===R[p];p--);if(m>p&&(m=p),0===p)return n[s++]=20971520,n[s++]=20971520,l.bits=1,0;for(g=1;g0&&(0===t||1!==p))return-1;for(Z[1]=0,w=1;w852||2===t&&x>592)return 1;for(;;){U=w-v,r[b]u?(S=T[O+r[b]],D=A[E+r[b]]):(S=96,D=0),h=1<>v)+d]=U<<24|S<<16|D|0}while(0!==d);for(h=1<>=1;if(0!==h?(z&=h-1,z+=h):z=0,b++,0==--R[w]){if(w===p)break;w=e[a+r[b]]}if(w>m&&(z&f)!==_){for(0===v&&(v=m),c+=g,k=w-v,y=1<852||2===t&&x>592)return 1;_=z&f,n[_]=m<<24|k<<16|c-s|0}}return 0!==z&&(n[c+z]=w-v<<24|64<<16|0),l.bits=m,0};const{Z_FINISH:fe,Z_BLOCK:ce,Z_TREES:ue,Z_OK:we,Z_STREAM_END:be,Z_NEED_DICT:ge,Z_STREAM_ERROR:pe,Z_DATA_ERROR:me,Z_MEM_ERROR:ke,Z_BUF_ERROR:ve,Z_DEFLATED:ye}=j,xe=12,ze=30,Ae=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function Ee(){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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Re=t=>{if(!t||!t.state)return pe;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,we},Ze=t=>{if(!t||!t.state)return pe;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Re(t)},Ue=(t,e)=>{let a;if(!t||!t.state)return pe;const i=t.state;return e<0?(a=0,e=-e):(a=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?pe:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,Ze(t))},Se=(t,e)=>{if(!t)return pe;const a=new Ee;t.state=a,a.window=null;const i=Ue(t,e);return i!==we&&(t.state=null),i};let De,Te,Oe=!0;const Ie=t=>{if(Oe){De=new Int32Array(512),Te=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(_e(1,t.lens,0,288,De,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;_e(2,t.lens,0,32,Te,0,t.work,{bits:5}),Oe=!1}t.lencode=De,t.lenbits=9,t.distcode=Te,t.distbits=5},Fe=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<=s.wsize?(s.window.set(e.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(e.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(e.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whaveSe(t,15),inflateInit2:Se,inflate:(t,e)=>{let a,i,n,s,r,l,o,h,d,_,f,c,u,w,b,g,p,m,k,v,y,x,z=0;const A=new Uint8Array(4);let E,R;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return pe;a=t.state,a.mode===xe&&(a.mode=13),r=t.next_out,n=t.output,o=t.avail_out,s=t.next_in,i=t.input,l=t.avail_in,h=a.hold,d=a.bits,_=l,f=o,x=we;t:for(;;)switch(a.mode){case 1:if(0===a.wrap){a.mode=13;break}for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>>8&255,a.check=M(a.check,A,2,0),h=0,d=0,a.mode=2;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=ze;break}if((15&h)!==ye){t.msg="unknown compression method",a.mode=ze;break}if(h>>>=4,d-=4,y=8+(15&h),0===a.wbits)a.wbits=y;else if(y>a.wbits){t.msg="invalid window size",a.mode=ze;break}a.dmax=1<>8&1),512&a.flags&&(A[0]=255&h,A[1]=h>>>8&255,a.check=M(a.check,A,2,0)),h=0,d=0,a.mode=3;case 3:for(;d<32;){if(0===l)break t;l--,h+=i[s++]<>>8&255,A[2]=h>>>16&255,A[3]=h>>>24&255,a.check=M(a.check,A,4,0)),h=0,d=0,a.mode=4;case 4:for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>8),512&a.flags&&(A[0]=255&h,A[1]=h>>>8&255,a.check=M(a.check,A,2,0)),h=0,d=0,a.mode=5;case 5:if(1024&a.flags){for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>>8&255,a.check=M(a.check,A,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=6;case 6:if(1024&a.flags&&(c=a.length,c>l&&(c=l),c&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+c),y)),512&a.flags&&(a.check=M(a.check,i,c,s)),l-=c,s+=c,a.length-=c),a.length))break t;a.length=0,a.mode=7;case 7:if(2048&a.flags){if(0===l)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&c>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=xe;break;case 10:for(;d<32;){if(0===l)break t;l--,h+=i[s++]<>>=7&d,d-=7&d,a.mode=27;break}for(;d<3;){if(0===l)break t;l--,h+=i[s++]<>>=1,d-=1,3&h){case 0:a.mode=14;break;case 1:if(Ie(a),a.mode=20,e===ue){h>>>=2,d-=2;break t}break;case 2:a.mode=17;break;case 3:t.msg="invalid block type",a.mode=ze}h>>>=2,d-=2;break;case 14:for(h>>>=7&d,d-=7&d;d<32;){if(0===l)break t;l--,h+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths",a.mode=ze;break}if(a.length=65535&h,h=0,d=0,a.mode=15,e===ue)break t;case 15:a.mode=16;case 16:if(c=a.length,c){if(c>l&&(c=l),c>o&&(c=o),0===c)break t;n.set(i.subarray(s,s+c),r),l-=c,s+=c,o-=c,r+=c,a.length-=c;break}a.mode=xe;break;case 17:for(;d<14;){if(0===l)break t;l--,h+=i[s++]<>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=ze;break}a.have=0,a.mode=18;case 18:for(;a.have>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},x=_e(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid code lengths set",a.mode=ze;break}a.have=0,a.mode=19;case 19:for(;a.have>>24,g=z>>>16&255,p=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=b,d-=b,a.lens[a.have++]=p;else{if(16===p){for(R=b+2;d>>=b,d-=b,0===a.have){t.msg="invalid bit length repeat",a.mode=ze;break}y=a.lens[a.have-1],c=3+(3&h),h>>>=2,d-=2}else if(17===p){for(R=b+3;d>>=b,d-=b,y=0,c=3+(7&h),h>>>=3,d-=3}else{for(R=b+7;d>>=b,d-=b,y=0,c=11+(127&h),h>>>=7,d-=7}if(a.have+c>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=ze;break}for(;c--;)a.lens[a.have++]=y}}if(a.mode===ze)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=ze;break}if(a.lenbits=9,E={bits:a.lenbits},x=_e(1,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid literal/lengths set",a.mode=ze;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},x=_e(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,x){t.msg="invalid distances set",a.mode=ze;break}if(a.mode=20,e===ue)break t;case 20:a.mode=21;case 21:if(l>=6&&o>=258){t.next_out=r,t.avail_out=o,t.next_in=s,t.avail_in=l,a.hold=h,a.bits=d,se(t,f),r=t.next_out,n=t.output,o=t.avail_out,s=t.next_in,i=t.input,l=t.avail_in,h=a.hold,d=a.bits,a.mode===xe&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<>>24,g=z>>>16&255,p=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>m)],b=z>>>24,g=z>>>16&255,p=65535&z,!(m+b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=m,d-=m,a.back+=m}if(h>>>=b,d-=b,a.back+=b,a.length=p,0===g){a.mode=26;break}if(32&g){a.back=-1,a.mode=xe;break}if(64&g){t.msg="invalid literal/length code",a.mode=ze;break}a.extra=15&g,a.mode=22;case 22:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=23;case 23:for(;z=a.distcode[h&(1<>>24,g=z>>>16&255,p=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>m)],b=z>>>24,g=z>>>16&255,p=65535&z,!(m+b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=m,d-=m,a.back+=m}if(h>>>=b,d-=b,a.back+=b,64&g){t.msg="invalid distance code",a.mode=ze;break}a.offset=p,a.extra=15&g,a.mode=24;case 24:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=ze;break}a.mode=25;case 25:if(0===o)break t;if(c=f-o,a.offset>c){if(c=a.offset-c,c>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=ze;break}c>a.wnext?(c-=a.wnext,u=a.wsize-c):u=a.wnext-c,c>a.length&&(c=a.length),w=a.window}else w=n,u=r-a.offset,c=a.length;c>o&&(c=o),o-=c,a.length-=c;do{n[r++]=w[u++]}while(--c);0===a.length&&(a.mode=21);break;case 26:if(0===o)break t;n[r++]=a.length,o--,a.mode=21;break;case 27:if(a.wrap){for(;d<32;){if(0===l)break t;l--,h|=i[s++]<{if(!t||!t.state)return pe;let e=t.state;return e.window&&(e.window=null),t.state=null,we},inflateGetHeader:(t,e)=>{if(!t||!t.state)return pe;const a=t.state;return 0==(2&a.wrap)?pe:(a.head=e,e.done=!1,we)},inflateSetDictionary:(t,e)=>{const a=e.length;let i,n,s;return t&&t.state?(i=t.state,0!==i.wrap&&11!==i.mode?pe:11===i.mode&&(n=1,n=B(n,e,a,0),n!==i.check)?me:(s=Fe(t,e,a,a),s?(i.mode=31,ke):(i.havedict=1,we))):pe},inflateInfo:"pako inflate (from Nodeca project)"};var Ne=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Be=Object.prototype.toString,{Z_NO_FLUSH:Ce,Z_FINISH:Me,Z_OK:He,Z_STREAM_END:je,Z_NEED_DICT:Ke,Z_STREAM_ERROR:Pe,Z_DATA_ERROR:Ye,Z_MEM_ERROR:Ge}=j;function Xe(t){this.options=Bt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Yt,this.strm.avail_out=0;let a=Le.inflateInit2(this.strm,e.windowBits);if(a!==He)throw new Error(H[a]);if(this.header=new Ne,Le.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=jt(e.dictionary):"[object ArrayBuffer]"===Be.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Le.inflateSetDictionary(this.strm,e.dictionary),a!==He)))throw new Error(H[a])}function We(t,e){const a=new Xe(e);if(a.push(t),a.err)throw a.msg||H[a.err];return a.result}Xe.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,l;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Me:Ce,"[object ArrayBuffer]"===Be.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=Le.inflate(a,r),s===Ke&&n&&(s=Le.inflateSetDictionary(a,n),s===He?s=Le.inflate(a,r):s===Ye&&(s=Ke));a.avail_in>0&&s===je&&a.state.wrap>0&&0!==t[a.next_in];)Le.inflateReset(a),s=Le.inflate(a,r);switch(s){case Pe:case Ye:case Ke:case Ge:return this.onEnd(s),this.ended=!0,!1}if(l=a.avail_out,a.next_out&&(0===a.avail_out||s===je))if("string"===this.options.to){let t=Pt(a.output,a.next_out),e=a.next_out-t,n=Kt(a.output,t);a.next_out=e,a.avail_out=i-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==He||0!==l){if(s===je)return s=Le.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},Xe.prototype.onData=function(t){this.chunks.push(t)},Xe.prototype.onEnd=function(t){t===He&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var qe={Inflate:Xe,inflate:We,inflateRaw:function(t,e){return(e=e||{}).raw=!0,We(t,e)},ungzip:We,constants:j};const{Deflate:Je,deflate:Qe,deflateRaw:Ve,gzip:$e}=ne,{Inflate:ta,inflate:ea,inflateRaw:aa,ungzip:ia}=qe;var na=Je,sa=Qe,ra=Ve,la=$e,oa=ta,ha=ea,da=aa,_a=ia,fa=j,ca={Deflate:na,deflate:sa,deflateRaw:ra,gzip:la,Inflate:oa,inflate:ha,inflateRaw:da,ungzip:_a,constants:fa};t.Deflate=na,t.Inflate=oa,t.constants=fa,t.default=ca,t.deflate=sa,t.deflateRaw=ra,t.gzip=la,t.inflate=ha,t.inflateRaw=da,t.ungzip=_a,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/dist/pako_deflate.es5.js b/dist/pako_deflate.es5.js index d9397ec..0aab7cc 100644 --- a/dist/pako_deflate.es5.js +++ b/dist/pako_deflate.es5.js @@ -1,5 +1,5 @@ -/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */ +/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : @@ -33,17 +33,17 @@ //const Z_HUFFMAN_ONLY = 2; //const Z_RLE = 3; - var Z_FIXED = 4; //const Z_DEFAULT_STRATEGY = 0; + var Z_FIXED$1 = 4; //const Z_DEFAULT_STRATEGY = 0; /* Possible values of the data_type field (though see inflate()) */ var Z_BINARY = 0; var Z_TEXT = 1; //const Z_ASCII = 1; // = Z_TEXT - var Z_UNKNOWN = 2; + var Z_UNKNOWN$1 = 2; /*============================================================================*/ - function zero(buf) { + function zero$1(buf) { var len = buf.length; while (--len >= 0) { @@ -57,8 +57,8 @@ var DYN_TREES = 2; /* The three kinds of block type */ - var MIN_MATCH = 3; - var MAX_MATCH = 258; + var MIN_MATCH$1 = 3; + var MAX_MATCH$1 = 258; /* The minimum and maximum match lengths */ // From deflate.h @@ -66,25 +66,25 @@ * Internal compression state. */ - var LENGTH_CODES = 29; + var LENGTH_CODES$1 = 29; /* number of length codes, not counting the special END_BLOCK code */ - var LITERALS = 256; + var LITERALS$1 = 256; /* number of literal bytes 0..255 */ - var L_CODES = LITERALS + 1 + LENGTH_CODES; + var L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1; /* number of Literal or Length codes, including the END_BLOCK code */ - var D_CODES = 30; + var D_CODES$1 = 30; /* number of distance codes */ - var BL_CODES = 19; + var BL_CODES$1 = 19; /* number of codes used to transfer the bit lengths */ - var HEAP_SIZE = 2 * L_CODES + 1; + var HEAP_SIZE$1 = 2 * L_CODES$1 + 1; /* maximum heap size */ - var MAX_BITS = 15; + var MAX_BITS$1 = 15; /* All codes must not exceed MAX_BITS bits */ var Buf_size = 16; @@ -136,39 +136,39 @@ /* see definition of array dist_code below */ // !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1 - var static_ltree = new Array((L_CODES + 2) * 2); - zero(static_ltree); + var static_ltree = new Array((L_CODES$1 + 2) * 2); + zero$1(static_ltree); /* The static literal tree. Since the bit lengths are imposed, there is no * need for the L_CODES extra codes used during heap construction. However * The codes 286 and 287 are needed to build a canonical tree (see _tr_init * below). */ - var static_dtree = new Array(D_CODES * 2); - zero(static_dtree); + var static_dtree = new Array(D_CODES$1 * 2); + zero$1(static_dtree); /* The static distance tree. (Actually a trivial tree since all codes use * 5 bits.) */ var _dist_code = new Array(DIST_CODE_LEN); - zero(_dist_code); + zero$1(_dist_code); /* Distance codes. The first 256 values correspond to the distances * 3 .. 258, the last 256 values correspond to the top 8 bits of * the 15 bit distances. */ - var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); + var _length_code = new Array(MAX_MATCH$1 - MIN_MATCH$1 + 1); - zero(_length_code); + zero$1(_length_code); /* length code for each normalized match length (0 == MIN_MATCH) */ - var base_length = new Array(LENGTH_CODES); - zero(base_length); + var base_length = new Array(LENGTH_CODES$1); + zero$1(base_length); /* First normalized length for each code (0 = MIN_MATCH) */ - var base_dist = new Array(D_CODES); - zero(base_dist); + var base_dist = new Array(D_CODES$1); + zero$1(base_dist); /* First normalized distance for each code (0 = distance of 1) */ function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) { @@ -320,7 +320,7 @@ var overflow = 0; /* number of elements with bit length too large */ - for (bits = 0; bits <= MAX_BITS; bits++) { + for (bits = 0; bits <= MAX_BITS$1; bits++) { s.bl_count[bits] = 0; } /* In a first pass, compute the optimal bit lengths (which may @@ -333,7 +333,7 @@ = 0; /* root of the heap */ - for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { + for (h = s.heap_max + 1; h < HEAP_SIZE$1; h++) { n = s.heap[h]; bits = tree[tree[n * 2 + 1] /*.Dad*/ @@ -454,7 +454,7 @@ // int max_code; /* largest code with non zero frequency */ // ushf *bl_count; /* number of codes at each bit length */ { - var next_code = new Array(MAX_BITS + 1); + var next_code = new Array(MAX_BITS$1 + 1); /* next code value for each bit length */ var code = 0; @@ -470,7 +470,7 @@ * without bit reversal. */ - for (bits = 1; bits <= MAX_BITS; bits++) { + for (bits = 1; bits <= MAX_BITS$1; bits++) { next_code[bits] = code = code + bl_count[bits - 1] << 1; } /* Check that the bit counts in bl_count are consistent. The last code @@ -519,7 +519,7 @@ var dist; /* distance index */ - var bl_count = new Array(MAX_BITS + 1); + var bl_count = new Array(MAX_BITS$1 + 1); /* number of codes at each bit length for an optimal tree */ // do check in _tr_init() //if (static_init_done) return; @@ -538,7 +538,7 @@ length = 0; - for (code = 0; code < LENGTH_CODES - 1; code++) { + for (code = 0; code < LENGTH_CODES$1 - 1; code++) { base_length[code] = length; for (n = 0; n < 1 << extra_lbits[code]; n++) { @@ -569,7 +569,7 @@ dist >>= 7; /* from now on, all distances are divided by 128 */ - for (; code < D_CODES; code++) { + for (; code < D_CODES$1; code++) { base_dist[code] = dist << 7; for (n = 0; n < 1 << extra_dbits[code] - 7; n++) { @@ -580,7 +580,7 @@ /* Construct the codes of the static literal tree */ - for (bits = 0; bits <= MAX_BITS; bits++) { + for (bits = 0; bits <= MAX_BITS$1; bits++) { bl_count[bits] = 0; } @@ -623,10 +623,10 @@ */ - gen_codes(static_ltree, L_CODES + 1, bl_count); + gen_codes(static_ltree, L_CODES$1 + 1, bl_count); /* The static distance tree is trivial: */ - for (n = 0; n < D_CODES; n++) { + for (n = 0; n < D_CODES$1; n++) { static_dtree[n * 2 + 1] /*.Len*/ = 5; @@ -636,9 +636,9 @@ } // Now data ready and we can init static trees - static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); - static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); - static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); //static_init_done = true; + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS$1 + 1, L_CODES$1, MAX_BITS$1); + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES$1, MAX_BITS$1); + static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES$1, MAX_BL_BITS); //static_init_done = true; }; /* =========================================================================== * Initialize a new block. @@ -651,19 +651,19 @@ /* Initialize the trees. */ - for (n = 0; n < L_CODES; n++) { + for (n = 0; n < L_CODES$1; n++) { s.dyn_ltree[n * 2] /*.Freq*/ = 0; } - for (n = 0; n < D_CODES; n++) { + for (n = 0; n < D_CODES$1; n++) { s.dyn_dtree[n * 2] /*.Freq*/ = 0; } - for (n = 0; n < BL_CODES; n++) { + for (n = 0; n < BL_CODES$1; n++) { s.bl_tree[n * 2] /*.Freq*/ = 0; @@ -815,7 +815,7 @@ } else { /* Here, lc is the match length - MIN_MATCH */ code = _length_code[lc]; - send_code(s, code + LITERALS + 1, ltree); + send_code(s, code + LITERALS$1 + 1, ltree); /* send the length code */ extra = extra_lbits[code]; @@ -885,7 +885,7 @@ */ s.heap_len = 0; - s.heap_max = HEAP_SIZE; + s.heap_max = HEAP_SIZE$1; for (n = 0; n < elems; n++) { if (tree[n * 2] @@ -1196,7 +1196,7 @@ * 3 but the actual value used is 4.) */ - for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { + for (max_blindex = BL_CODES$1 - 1; max_blindex >= 3; max_blindex--) { if (s.bl_tree[bl_order[max_blindex] * 2 + 1] /*.Len*/ !== 0) { @@ -1295,7 +1295,7 @@ return Z_TEXT; } - for (n = 32; n < LITERALS; n++) { + for (n = 32; n < LITERALS$1; n++) { if (s.dyn_ltree[n * 2] /*.Freq*/ !== 0) { @@ -1315,7 +1315,7 @@ * Initialize the tree data structures for a new zlib stream. */ - var _tr_init = function _tr_init(s) { + var _tr_init$1 = function _tr_init(s) { if (!static_init_done) { tr_static_init(); static_init_done = true; @@ -1335,7 +1335,7 @@ */ - var _tr_stored_block = function _tr_stored_block(s, buf, stored_len, last) //DeflateState *s; + var _tr_stored_block$1 = function _tr_stored_block(s, buf, stored_len, last) //DeflateState *s; //charf *buf; /* input block */ //ulg stored_len; /* length of input block */ //int last; /* one if this is the last block for a file */ @@ -1352,7 +1352,7 @@ */ - var _tr_align = function _tr_align(s) { + var _tr_align$1 = function _tr_align(s) { send_bits(s, STATIC_TREES << 1, 3); send_code(s, END_BLOCK, static_ltree); bi_flush(s); @@ -1363,7 +1363,7 @@ */ - var _tr_flush_block = function _tr_flush_block(s, buf, stored_len, last) //DeflateState *s; + var _tr_flush_block$1 = function _tr_flush_block(s, buf, stored_len, last) //DeflateState *s; //charf *buf; /* input block, or NULL if too old */ //ulg stored_len; /* length of input block */ //int last; /* one if this is the last block for a file */ @@ -1378,7 +1378,7 @@ if (s.level > 0) { /* Check if the file is binary or text */ - if (s.strm.data_type === Z_UNKNOWN) { + if (s.strm.data_type === Z_UNKNOWN$1) { s.strm.data_type = detect_data_type(s); } /* Construct the literal and distance trees */ @@ -1424,8 +1424,8 @@ * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to * transform a block into a stored block. */ - _tr_stored_block(s, buf, stored_len, last); - } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { + _tr_stored_block$1(s, buf, stored_len, last); + } else if (s.strategy === Z_FIXED$1 || static_lenb === opt_lenb) { send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); compress_block(s, static_ltree, static_dtree); } else { @@ -1453,7 +1453,7 @@ */ - var _tr_tally = function _tr_tally(s, dist, lc) // deflate_state *s; + var _tr_tally$1 = function _tr_tally(s, dist, lc) // deflate_state *s; // unsigned dist; /* distance of matched string */ // unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ { @@ -1476,7 +1476,7 @@ // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); - s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2] /*.Freq*/++; + s.dyn_ltree[(_length_code[lc] + LITERALS$1 + 1) * 2] /*.Freq*/++; s.dyn_dtree[d_code(dist) * 2] /*.Freq*/++; } // (!) This block is disabled in zlib defaults, // don't enable it for binary compatibility @@ -1508,11 +1508,11 @@ */ }; - var _tr_init_1 = _tr_init; - var _tr_stored_block_1 = _tr_stored_block; - var _tr_flush_block_1 = _tr_flush_block; - var _tr_tally_1 = _tr_tally; - var _tr_align_1 = _tr_align; + var _tr_init_1 = _tr_init$1; + var _tr_stored_block_1 = _tr_stored_block$1; + var _tr_flush_block_1 = _tr_flush_block$1; + var _tr_tally_1 = _tr_tally$1; + var _tr_align_1 = _tr_align$1; var trees = { _tr_init: _tr_init_1, _tr_stored_block: _tr_stored_block_1, @@ -1690,7 +1690,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. - var constants = { + var constants$1 = { /* Allowed flush values; see deflate() and inflate() below for details */ Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, @@ -1754,33 +1754,33 @@ // 3. This notice may not be removed or altered from any source distribution. - var _tr_init$1 = trees._tr_init, - _tr_stored_block$1 = trees._tr_stored_block, - _tr_flush_block$1 = trees._tr_flush_block, - _tr_tally$1 = trees._tr_tally, - _tr_align$1 = trees._tr_align; + var _tr_init = trees._tr_init, + _tr_stored_block = trees._tr_stored_block, + _tr_flush_block = trees._tr_flush_block, + _tr_tally = trees._tr_tally, + _tr_align = trees._tr_align; /* Public constants ==========================================================*/ /* ===========================================================================*/ - var Z_NO_FLUSH = constants.Z_NO_FLUSH, - Z_PARTIAL_FLUSH = constants.Z_PARTIAL_FLUSH, - Z_FULL_FLUSH = constants.Z_FULL_FLUSH, - Z_FINISH = constants.Z_FINISH, - Z_BLOCK = constants.Z_BLOCK, - Z_OK = constants.Z_OK, - Z_STREAM_END = constants.Z_STREAM_END, - Z_STREAM_ERROR = constants.Z_STREAM_ERROR, - Z_DATA_ERROR = constants.Z_DATA_ERROR, - Z_BUF_ERROR = constants.Z_BUF_ERROR, - Z_DEFAULT_COMPRESSION = constants.Z_DEFAULT_COMPRESSION, - Z_FILTERED = constants.Z_FILTERED, - Z_HUFFMAN_ONLY = constants.Z_HUFFMAN_ONLY, - Z_RLE = constants.Z_RLE, - Z_FIXED$1 = constants.Z_FIXED, - Z_DEFAULT_STRATEGY = constants.Z_DEFAULT_STRATEGY, - Z_UNKNOWN$1 = constants.Z_UNKNOWN, - Z_DEFLATED = constants.Z_DEFLATED; + var Z_NO_FLUSH$1 = constants$1.Z_NO_FLUSH, + Z_PARTIAL_FLUSH = constants$1.Z_PARTIAL_FLUSH, + Z_FULL_FLUSH$1 = constants$1.Z_FULL_FLUSH, + Z_FINISH$1 = constants$1.Z_FINISH, + Z_BLOCK = constants$1.Z_BLOCK, + Z_OK$1 = constants$1.Z_OK, + Z_STREAM_END$1 = constants$1.Z_STREAM_END, + Z_STREAM_ERROR = constants$1.Z_STREAM_ERROR, + Z_DATA_ERROR = constants$1.Z_DATA_ERROR, + Z_BUF_ERROR = constants$1.Z_BUF_ERROR, + Z_DEFAULT_COMPRESSION$1 = constants$1.Z_DEFAULT_COMPRESSION, + Z_FILTERED = constants$1.Z_FILTERED, + Z_HUFFMAN_ONLY = constants$1.Z_HUFFMAN_ONLY, + Z_RLE = constants$1.Z_RLE, + Z_FIXED = constants$1.Z_FIXED, + Z_DEFAULT_STRATEGY$1 = constants$1.Z_DEFAULT_STRATEGY, + Z_UNKNOWN = constants$1.Z_UNKNOWN, + Z_DEFLATED$1 = constants$1.Z_DEFLATED; /*============================================================================*/ var MAX_MEM_LEVEL = 9; @@ -1790,30 +1790,30 @@ /* 32K LZ77 window */ var DEF_MEM_LEVEL = 8; - var LENGTH_CODES$1 = 29; + var LENGTH_CODES = 29; /* number of length codes, not counting the special END_BLOCK code */ - var LITERALS$1 = 256; + var LITERALS = 256; /* number of literal bytes 0..255 */ - var L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1; + var L_CODES = LITERALS + 1 + LENGTH_CODES; /* number of Literal or Length codes, including the END_BLOCK code */ - var D_CODES$1 = 30; + var D_CODES = 30; /* number of distance codes */ - var BL_CODES$1 = 19; + var BL_CODES = 19; /* number of codes used to transfer the bit lengths */ - var HEAP_SIZE$1 = 2 * L_CODES$1 + 1; + var HEAP_SIZE = 2 * L_CODES + 1; /* maximum heap size */ - var MAX_BITS$1 = 15; + var MAX_BITS = 15; /* All codes must not exceed MAX_BITS bits */ - var MIN_MATCH$1 = 3; - var MAX_MATCH$1 = 258; - var MIN_LOOKAHEAD = MAX_MATCH$1 + MIN_MATCH$1 + 1; + var MIN_MATCH = 3; + var MAX_MATCH = 258; + var MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1; var PRESET_DICT = 0x20; var INIT_STATE = 42; var EXTRA_STATE = 69; @@ -1845,7 +1845,7 @@ return (f << 1) - (f > 4 ? 9 : 0); }; - var zero$1 = function zero(buf) { + var zero = function zero(buf) { var len = buf.length; while (--len >= 0) { @@ -1896,7 +1896,7 @@ }; var flush_block_only = function flush_block_only(s, last) { - _tr_flush_block$1(s, s.block_start >= 0 ? s.block_start : -1, s.strstart - s.block_start, last); + _tr_flush_block(s, s.block_start >= 0 ? s.block_start : -1, s.strstart - s.block_start, last); s.block_start = s.strstart; flush_pending(s.strm); @@ -1993,7 +1993,7 @@ * we prevent matches with the string of window index 0. */ - var strend = s.strstart + MAX_MATCH$1; + var strend = s.strstart + MAX_MATCH; var scan_end1 = _win[scan + best_len - 1]; var scan_end = _win[scan + best_len]; /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. @@ -2051,8 +2051,8 @@ } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend); // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - len = MAX_MATCH$1 - (strend - scan); - scan = strend - MAX_MATCH$1; + len = MAX_MATCH - (strend - scan); + scan = strend - MAX_MATCH; if (len > best_len) { s.match_start = cur_match; @@ -2166,7 +2166,7 @@ s.lookahead += n; /* Initialize the hash value now that we have some input: */ - if (s.lookahead + s.insert >= MIN_MATCH$1) { + if (s.lookahead + s.insert >= MIN_MATCH) { str = s.strstart - s.insert; s.ins_h = s.window[str]; /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */ @@ -2177,13 +2177,13 @@ while (s.insert) { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]); s.prev[str & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = str; str++; s.insert--; - if (s.lookahead + s.insert < MIN_MATCH$1) { + if (s.lookahead + s.insert < MIN_MATCH) { break; } } @@ -2265,7 +2265,7 @@ // } fill_window(s); - if (s.lookahead === 0 && flush === Z_NO_FLUSH) { + if (s.lookahead === 0 && flush === Z_NO_FLUSH$1) { return BS_NEED_MORE; } @@ -2317,7 +2317,7 @@ s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$1) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); @@ -2368,7 +2368,7 @@ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$1) { return BS_NEED_MORE; } @@ -2386,9 +2386,9 @@ /*NIL*/ ; - if (s.lookahead >= MIN_MATCH$1) { + if (s.lookahead >= MIN_MATCH) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -2409,12 +2409,12 @@ /* longest_match() sets match_start */ } - if (s.match_length >= MIN_MATCH$1) { + if (s.match_length >= MIN_MATCH) { // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only /*** _tr_tally_dist(s, s.strstart - s.match_start, s.match_length - MIN_MATCH, bflush); ***/ - bflush = _tr_tally$1(s, s.strstart - s.match_start, s.match_length - MIN_MATCH$1); + bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; /* Insert new strings in the hash table only if the match length * is not too large. This saves time but degrades compression. @@ -2422,7 +2422,7 @@ if (s.match_length <= s.max_lazy_match /*max_insert_length*/ - && s.lookahead >= MIN_MATCH$1) { + && s.lookahead >= MIN_MATCH) { s.match_length--; /* string at strstart already in table */ @@ -2430,7 +2430,7 @@ s.strstart++; /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -2460,7 +2460,7 @@ //Tracevv((stderr,"%c", s.window[s.strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; } @@ -2477,9 +2477,9 @@ } } - s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1; + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$1) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); @@ -2531,7 +2531,7 @@ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$1) { return BS_NEED_MORE; } @@ -2550,9 +2550,9 @@ /*NIL*/ ; - if (s.lookahead >= MIN_MATCH$1) { + if (s.lookahead >= MIN_MATCH) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -2563,43 +2563,43 @@ s.prev_length = s.match_length; s.prev_match = s.match_start; - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; if (hash_head !== 0 /*NIL*/ && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD /*MAX_DIST(s)*/ ) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - s.match_length = longest_match(s, hash_head); - /* longest_match() sets match_start */ + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s.match_length = longest_match(s, hash_head); + /* longest_match() sets match_start */ - if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH$1 && s.strstart - s.match_start > 4096 - /*TOO_FAR*/ - )) { - /* If prev_match is also MIN_MATCH, match_start is garbage - * but we will ignore the current match anyway. - */ - s.match_length = MIN_MATCH$1 - 1; - } + if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096 + /*TOO_FAR*/ + )) { + /* If prev_match is also MIN_MATCH, match_start is garbage + * but we will ignore the current match anyway. + */ + s.match_length = MIN_MATCH - 1; } + } /* If there was a match at the previous step and the current * match is not better, output the previous match: */ - if (s.prev_length >= MIN_MATCH$1 && s.match_length <= s.prev_length) { - max_insert = s.strstart + s.lookahead - MIN_MATCH$1; + if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { + max_insert = s.strstart + s.lookahead - MIN_MATCH; /* Do not insert strings in hash table beyond this. */ //check_match(s, s.strstart-1, s.prev_match, s.prev_length); /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH, bflush);***/ - bflush = _tr_tally$1(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH$1); + bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); /* Insert in hash table all strings up to the end of the match. * strstart-1 and strstart are already inserted. If there is not * enough lookahead, the last two strings are not inserted in @@ -2612,7 +2612,7 @@ do { if (++s.strstart <= max_insert) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -2620,7 +2620,7 @@ } while (--s.prev_length !== 0); s.match_available = 0; - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; s.strstart++; if (bflush) { @@ -2641,7 +2641,7 @@ //Tracevv((stderr,"%c", s->window[s->strstart-1])); /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]); + bflush = _tr_tally(s, 0, s.window[s.strstart - 1]); if (bflush) { /*** FLUSH_BLOCK_ONLY(s, 0) ***/ @@ -2670,13 +2670,13 @@ //Tracevv((stderr,"%c", s->window[s->strstart-1])); /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]); + bflush = _tr_tally(s, 0, s.window[s.strstart - 1]); s.match_available = 0; } - s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1; + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$1) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); @@ -2726,10 +2726,10 @@ * at the end of the input file. We need MAX_MATCH bytes * for the longest run, plus one for the unrolled loop. */ - if (s.lookahead <= MAX_MATCH$1) { + if (s.lookahead <= MAX_MATCH) { fill_window(s); - if (s.lookahead <= MAX_MATCH$1 && flush === Z_NO_FLUSH) { + if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH$1) { return BS_NEED_MORE; } @@ -2744,18 +2744,18 @@ s.match_length = 0; - if (s.lookahead >= MIN_MATCH$1 && s.strstart > 0) { + if (s.lookahead >= MIN_MATCH && s.strstart > 0) { scan = s.strstart - 1; prev = _win[scan]; if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { - strend = s.strstart + MAX_MATCH$1; + strend = s.strstart + MAX_MATCH; do { /*jshint noempty:false*/ } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend); - s.match_length = MAX_MATCH$1 - (strend - scan); + s.match_length = MAX_MATCH - (strend - scan); if (s.match_length > s.lookahead) { s.match_length = s.lookahead; @@ -2766,11 +2766,11 @@ /* Emit match if have run of MIN_MATCH or longer, else emit literal */ - if (s.match_length >= MIN_MATCH$1) { + if (s.match_length >= MIN_MATCH) { //check_match(s, s.strstart, s.strstart - 1, s.match_length); /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ - bflush = _tr_tally$1(s, 1, s.match_length - MIN_MATCH$1); + bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; s.strstart += s.match_length; s.match_length = 0; @@ -2779,7 +2779,7 @@ //Tracevv((stderr,"%c", s->window[s->strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; } @@ -2798,7 +2798,7 @@ s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$1) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); @@ -2840,7 +2840,7 @@ fill_window(s); if (s.lookahead === 0) { - if (flush === Z_NO_FLUSH) { + if (flush === Z_NO_FLUSH$1) { return BS_NEED_MORE; } @@ -2855,7 +2855,7 @@ /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; @@ -2873,7 +2873,7 @@ s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$1) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); @@ -2945,7 +2945,7 @@ s.window_size = 2 * s.w_size; /*** CLEAR_HASH(s); ***/ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); /* Set the default configuration parameters: */ @@ -2958,7 +2958,7 @@ s.block_start = 0; s.lookahead = 0; s.insert = 0; - s.match_length = s.prev_length = MIN_MATCH$1 - 1; + s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; s.ins_h = 0; }; @@ -2991,7 +2991,7 @@ this.gzindex = 0; /* where in extra, name, or comment */ - this.method = Z_DEFLATED; + this.method = Z_DEFLATED$1; /* can only be DEFLATED */ this.last_flush = -1; @@ -3115,12 +3115,12 @@ // Use flat array of DOUBLE size, with interleaved fata, // because JS does not support effective - this.dyn_ltree = new Uint16Array(HEAP_SIZE$1 * 2); - this.dyn_dtree = new Uint16Array((2 * D_CODES$1 + 1) * 2); - this.bl_tree = new Uint16Array((2 * BL_CODES$1 + 1) * 2); - zero$1(this.dyn_ltree); - zero$1(this.dyn_dtree); - zero$1(this.bl_tree); + this.dyn_ltree = new Uint16Array(HEAP_SIZE * 2); + this.dyn_dtree = new Uint16Array((2 * D_CODES + 1) * 2); + this.bl_tree = new Uint16Array((2 * BL_CODES + 1) * 2); + zero(this.dyn_ltree); + zero(this.dyn_dtree); + zero(this.bl_tree); this.l_desc = null; /* desc. for literal tree */ @@ -3131,14 +3131,14 @@ /* desc. for bit length tree */ //ush bl_count[MAX_BITS+1]; - this.bl_count = new Uint16Array(MAX_BITS$1 + 1); + this.bl_count = new Uint16Array(MAX_BITS + 1); /* number of codes at each bit length for an optimal tree */ //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ - this.heap = new Uint16Array(2 * L_CODES$1 + 1); + this.heap = new Uint16Array(2 * L_CODES + 1); /* heap used to build the Huffman trees */ - zero$1(this.heap); + zero(this.heap); this.heap_len = 0; /* number of elements in the heap */ @@ -3149,9 +3149,9 @@ * The same heap array is used to build all trees. */ - this.depth = new Uint16Array(2 * L_CODES$1 + 1); //uch depth[2*L_CODES+1]; + this.depth = new Uint16Array(2 * L_CODES + 1); //uch depth[2*L_CODES+1]; - zero$1(this.depth); + zero(this.depth); /* Depth of each subtree used as tie breaker for trees of equal frequency */ @@ -3225,7 +3225,7 @@ } strm.total_in = strm.total_out = 0; - strm.data_type = Z_UNKNOWN$1; + strm.data_type = Z_UNKNOWN; var s = strm.state; s.pending = 0; s.pending_out = 0; @@ -3239,17 +3239,17 @@ strm.adler = s.wrap === 2 ? 0 // crc32(0, Z_NULL, 0) : 1; // adler32(0, Z_NULL, 0) - s.last_flush = Z_NO_FLUSH; + s.last_flush = Z_NO_FLUSH$1; - _tr_init$1(s); + _tr_init(s); - return Z_OK; + return Z_OK$1; }; var deflateReset = function deflateReset(strm) { var ret = deflateResetKeep(strm); - if (ret === Z_OK) { + if (ret === Z_OK$1) { lm_init(strm.state); } @@ -3266,7 +3266,7 @@ } strm.state.gzhead = head; - return Z_OK; + return Z_OK$1; }; var deflateInit2 = function deflateInit2(strm, level, method, windowBits, memLevel, strategy) { @@ -3277,7 +3277,7 @@ var wrap = 1; - if (level === Z_DEFAULT_COMPRESSION) { + if (level === Z_DEFAULT_COMPRESSION$1) { level = 6; } @@ -3292,7 +3292,7 @@ windowBits -= 16; } - if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED$1) { + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED$1 || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) { return err(strm, Z_STREAM_ERROR); } @@ -3313,7 +3313,7 @@ s.hash_bits = memLevel + 7; s.hash_size = 1 << s.hash_bits; s.hash_mask = s.hash_size - 1; - s.hash_shift = ~~((s.hash_bits + MIN_MATCH$1 - 1) / MIN_MATCH$1); + s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); s.window = new Uint8Array(s.w_size * 2); s.head = new Uint16Array(s.hash_size); s.prev = new Uint16Array(s.w_size); // Don't need mem init magic for JS. @@ -3338,10 +3338,10 @@ }; var deflateInit = function deflateInit(strm, level) { - return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); + return deflateInit2(strm, level, Z_DEFLATED$1, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY$1); }; - var deflate = function deflate(strm, flush) { + var deflate$1 = function deflate(strm, flush) { var beg, val; // for gzip header write only if (!strm || !strm.state || flush > Z_BLOCK || flush < 0) { @@ -3350,7 +3350,7 @@ var s = strm.state; - if (!strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH) { + if (!strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH$1) { return err(strm, strm.avail_out === 0 ? Z_BUF_ERROR : Z_STREAM_ERROR); } @@ -3403,7 +3403,7 @@ } } else // DEFLATE header { - var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8; + var header = Z_DEFLATED$1 + (s.w_bits - 8 << 4) << 8; var level_flags = -1; if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { @@ -3441,36 +3441,36 @@ if (s.gzhead.extra /* != Z_NULL*/ ) { - beg = s.pending; - /* start of bytes to update crc */ + beg = s.pending; + /* start of bytes to update crc */ - while (s.gzindex < (s.gzhead.extra.length & 0xffff)) { - if (s.pending === s.pending_buf_size) { - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); - } - - flush_pending(strm); - beg = s.pending; - - if (s.pending === s.pending_buf_size) { - break; - } + while (s.gzindex < (s.gzhead.extra.length & 0xffff)) { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); } - put_byte(s, s.gzhead.extra[s.gzindex] & 0xff); - s.gzindex++; + flush_pending(strm); + beg = s.pending; + + if (s.pending === s.pending_buf_size) { + break; + } } - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); - } + put_byte(s, s.gzhead.extra[s.gzindex] & 0xff); + s.gzindex++; + } - if (s.gzindex === s.gzhead.extra.length) { - s.gzindex = 0; - s.status = NAME_STATE; - } - } else { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); + } + + if (s.gzindex === s.gzhead.extra.length) { + s.gzindex = 0; + s.status = NAME_STATE; + } + } else { s.status = NAME_STATE; } } @@ -3479,44 +3479,44 @@ if (s.gzhead.name /* != Z_NULL*/ ) { - beg = s.pending; - /* start of bytes to update crc */ - //int val; + beg = s.pending; + /* start of bytes to update crc */ + //int val; - do { - if (s.pending === s.pending_buf_size) { - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); - } - - flush_pending(strm); - beg = s.pending; - - if (s.pending === s.pending_buf_size) { - val = 1; - break; - } - } // JS specific: little magic to add zero terminator to end of string - - - if (s.gzindex < s.gzhead.name.length) { - val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff; - } else { - val = 0; + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); } - put_byte(s, val); - } while (val !== 0); + flush_pending(strm); + beg = s.pending; - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } // JS specific: little magic to add zero terminator to end of string + + + if (s.gzindex < s.gzhead.name.length) { + val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff; + } else { + val = 0; } - if (val === 0) { - s.gzindex = 0; - s.status = COMMENT_STATE; - } - } else { + put_byte(s, val); + } while (val !== 0); + + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); + } + + if (val === 0) { + s.gzindex = 0; + s.status = COMMENT_STATE; + } + } else { s.status = COMMENT_STATE; } } @@ -3525,43 +3525,43 @@ if (s.gzhead.comment /* != Z_NULL*/ ) { - beg = s.pending; - /* start of bytes to update crc */ - //int val; + beg = s.pending; + /* start of bytes to update crc */ + //int val; - do { - if (s.pending === s.pending_buf_size) { - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); - } - - flush_pending(strm); - beg = s.pending; - - if (s.pending === s.pending_buf_size) { - val = 1; - break; - } - } // JS specific: little magic to add zero terminator to end of string - - - if (s.gzindex < s.gzhead.comment.length) { - val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff; - } else { - val = 0; + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); } - put_byte(s, val); - } while (val !== 0); + flush_pending(strm); + beg = s.pending; - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } // JS specific: little magic to add zero terminator to end of string + + + if (s.gzindex < s.gzhead.comment.length) { + val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff; + } else { + val = 0; } - if (val === 0) { - s.status = HCRC_STATE; - } - } else { + put_byte(s, val); + } while (val !== 0); + + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); + } + + if (val === 0) { + s.status = HCRC_STATE; + } + } else { s.status = HCRC_STATE; } } @@ -3598,14 +3598,14 @@ * return OK instead of BUF_ERROR at next call of deflate: */ s.last_flush = -1; - return Z_OK; + return Z_OK$1; } /* Make sure there is something to do and avoid duplicate consecutive * flushes. For repeated and useless calls with Z_FINISH, we keep * returning Z_STREAM_END instead of Z_BUF_ERROR. */ - } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH) { + } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH$1) { return err(strm, Z_BUF_ERROR); } /* User must not provide more input after the first FINISH: */ @@ -3618,7 +3618,7 @@ */ - if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) { + if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH$1 && s.status !== FINISH_STATE) { var bstate = s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : s.strategy === Z_RLE ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush); if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { @@ -3631,7 +3631,7 @@ /* avoid BUF_ERROR next call, see above */ } - return Z_OK; + return Z_OK$1; /* If flush != Z_NO_FLUSH && avail_out == 0, the next call * of deflate should use the same flush parameter to make sure * that the flush is complete. So we don't have to output an @@ -3643,20 +3643,20 @@ if (bstate === BS_BLOCK_DONE) { if (flush === Z_PARTIAL_FLUSH) { - _tr_align$1(s); + _tr_align(s); } else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ - _tr_stored_block$1(s, 0, 0, false); + _tr_stored_block(s, 0, 0, false); /* For a full flush, this empty block will be recognized * as a special marker by inflate_sync(). */ - if (flush === Z_FULL_FLUSH) { + if (flush === Z_FULL_FLUSH$1) { /*** CLEAR_HASH(s); ***/ /* forget history */ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); if (s.lookahead === 0) { s.strstart = 0; @@ -3672,19 +3672,19 @@ s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ - return Z_OK; + return Z_OK$1; } } } //Assert(strm->avail_out > 0, "bug2"); //if (strm.avail_out <= 0) { throw new Error("bug2");} - if (flush !== Z_FINISH) { - return Z_OK; + if (flush !== Z_FINISH$1) { + return Z_OK$1; } if (s.wrap <= 0) { - return Z_STREAM_END; + return Z_STREAM_END$1; } /* Write the trailer */ @@ -3714,7 +3714,7 @@ /* write the trailer only once! */ - return s.pending !== 0 ? Z_OK : Z_STREAM_END; + return s.pending !== 0 ? Z_OK$1 : Z_STREAM_END$1; }; var deflateEnd = function deflateEnd(strm) { @@ -3723,8 +3723,8 @@ || !strm.state /*== Z_NULL*/ ) { - return Z_STREAM_ERROR; - } + return Z_STREAM_ERROR; + } var status = strm.state.status; @@ -3733,7 +3733,7 @@ } strm.state = null; - return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; + return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK$1; }; /* ========================================================================= * Initializes the compression dictionary from the given byte @@ -3749,8 +3749,8 @@ || !strm.state /*== Z_NULL*/ ) { - return Z_STREAM_ERROR; - } + return Z_STREAM_ERROR; + } var s = strm.state; var wrap = s.wrap; @@ -3776,7 +3776,7 @@ /* already empty otherwise */ /*** CLEAR_HASH(s); ***/ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); s.strstart = 0; s.block_start = 0; @@ -3802,20 +3802,20 @@ strm.input = dictionary; fill_window(s); - while (s.lookahead >= MIN_MATCH$1) { + while (s.lookahead >= MIN_MATCH) { var str = s.strstart; - var n = s.lookahead - (MIN_MATCH$1 - 1); + var n = s.lookahead - (MIN_MATCH - 1); do { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]); s.prev[str & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = str; str++; } while (--n); s.strstart = str; - s.lookahead = MIN_MATCH$1 - 1; + s.lookahead = MIN_MATCH - 1; fill_window(s); } @@ -3823,13 +3823,13 @@ s.block_start = s.strstart; s.insert = s.lookahead; s.lookahead = 0; - s.match_length = s.prev_length = MIN_MATCH$1 - 1; + s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; strm.next_in = next; strm.input = input; strm.avail_in = avail; s.wrap = wrap; - return Z_OK; + return Z_OK$1; }; var deflateInit_1 = deflateInit; @@ -3837,7 +3837,7 @@ var deflateReset_1 = deflateReset; var deflateResetKeep_1 = deflateResetKeep; var deflateSetHeader_1 = deflateSetHeader; - var deflate_2 = deflate; + var deflate_2$1 = deflate$1; var deflateEnd_1 = deflateEnd; var deflateSetDictionary_1 = deflateSetDictionary; var deflateInfo = 'pako deflate (from Nodeca project)'; @@ -3850,13 +3850,13 @@ module.exports.deflateTune = deflateTune; */ - var deflate_1 = { + var deflate_1$1 = { deflateInit: deflateInit_1, deflateInit2: deflateInit2_1, deflateReset: deflateReset_1, deflateResetKeep: deflateResetKeep_1, deflateSetHeader: deflateSetHeader_1, - deflate: deflate_2, + deflate: deflate_2$1, deflateEnd: deflateEnd_1, deflateSetDictionary: deflateSetDictionary_1, deflateInfo: deflateInfo @@ -3961,6 +3961,10 @@ // convert string to array (typed, when possible) var string2buf = function string2buf(str) { + if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) { + return new TextEncoder().encode(str); + } + var buf, c, c2, @@ -4045,8 +4049,13 @@ var buf2string = function buf2string(buf, max) { - var i, out; - var len = max || buf.length; // Reserve max possible length (2 words per char) + var len = max || buf.length; + + if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) { + return new TextDecoder().decode(buf.subarray(0, max)); + } + + var i, out; // Reserve max possible length (2 words per char) // NB: by unknown reasons, Array is significantly faster for // String.fromCharCode.apply than Uint16Array. @@ -4200,15 +4209,15 @@ /* ===========================================================================*/ - var Z_NO_FLUSH$1 = constants.Z_NO_FLUSH, - Z_SYNC_FLUSH = constants.Z_SYNC_FLUSH, - Z_FULL_FLUSH$1 = constants.Z_FULL_FLUSH, - Z_FINISH$1 = constants.Z_FINISH, - Z_OK$1 = constants.Z_OK, - Z_STREAM_END$1 = constants.Z_STREAM_END, - Z_DEFAULT_COMPRESSION$1 = constants.Z_DEFAULT_COMPRESSION, - Z_DEFAULT_STRATEGY$1 = constants.Z_DEFAULT_STRATEGY, - Z_DEFLATED$1 = constants.Z_DEFLATED; + var Z_NO_FLUSH = constants$1.Z_NO_FLUSH, + Z_SYNC_FLUSH = constants$1.Z_SYNC_FLUSH, + Z_FULL_FLUSH = constants$1.Z_FULL_FLUSH, + Z_FINISH = constants$1.Z_FINISH, + Z_OK = constants$1.Z_OK, + Z_STREAM_END = constants$1.Z_STREAM_END, + Z_DEFAULT_COMPRESSION = constants$1.Z_DEFAULT_COMPRESSION, + Z_DEFAULT_STRATEGY = constants$1.Z_DEFAULT_STRATEGY, + Z_DEFLATED = constants$1.Z_DEFLATED; /* ===========================================================================*/ /** @@ -4298,12 +4307,12 @@ function Deflate(options) { this.options = common.assign({ - level: Z_DEFAULT_COMPRESSION$1, - method: Z_DEFLATED$1, + level: Z_DEFAULT_COMPRESSION, + method: Z_DEFLATED, chunkSize: 16384, windowBits: 15, memLevel: 8, - strategy: Z_DEFAULT_STRATEGY$1 + strategy: Z_DEFAULT_STRATEGY }, options || {}); var opt = this.options; @@ -4323,14 +4332,14 @@ this.strm = new zstream(); this.strm.avail_out = 0; - var status = deflate_1.deflateInit2(this.strm, opt.level, opt.method, opt.windowBits, opt.memLevel, opt.strategy); + var status = deflate_1$1.deflateInit2(this.strm, opt.level, opt.method, opt.windowBits, opt.memLevel, opt.strategy); - if (status !== Z_OK$1) { + if (status !== Z_OK) { throw new Error(messages[status]); } if (opt.header) { - deflate_1.deflateSetHeader(this.strm, opt.header); + deflate_1$1.deflateSetHeader(this.strm, opt.header); } if (opt.dictionary) { @@ -4345,9 +4354,9 @@ dict = opt.dictionary; } - status = deflate_1.deflateSetDictionary(this.strm, dict); + status = deflate_1$1.deflateSetDictionary(this.strm, dict); - if (status !== Z_OK$1) { + if (status !== Z_OK) { throw new Error(messages[status]); } @@ -4388,7 +4397,7 @@ return false; } - if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;else _flush_mode = flush_mode === true ? Z_FINISH$1 : Z_NO_FLUSH$1; // Convert data if needed + if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH; // Convert data if needed if (typeof data === 'string') { // If we need to compress text, change encoding to utf8. @@ -4410,23 +4419,23 @@ } // Make sure avail_out > 6 to avoid repeating markers - if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH$1) && strm.avail_out <= 6) { + if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH) && strm.avail_out <= 6) { this.onData(strm.output.subarray(0, strm.next_out)); strm.avail_out = 0; continue; } - status = deflate_1.deflate(strm, _flush_mode); // Ended => flush and finish + status = deflate_1$1.deflate(strm, _flush_mode); // Ended => flush and finish - if (status === Z_STREAM_END$1) { + if (status === Z_STREAM_END) { if (strm.next_out > 0) { this.onData(strm.output.subarray(0, strm.next_out)); } - status = deflate_1.deflateEnd(this.strm); + status = deflate_1$1.deflateEnd(this.strm); this.onEnd(status); this.ended = true; - return status === Z_OK$1; + return status === Z_OK; } // Flush if out buffer full @@ -4472,7 +4481,7 @@ Deflate.prototype.onEnd = function (status) { // On success - join - if (status === Z_OK$1) { + if (status === Z_OK) { this.result = common.flattenChunks(this.chunks); } @@ -4514,7 +4523,7 @@ **/ - function deflate$1(input, options) { + function deflate(input, options) { var deflator = new Deflate(options); deflator.push(input, true); // That will never happens, if you don't cheat with options :) @@ -4537,7 +4546,7 @@ function deflateRaw(input, options) { options = options || {}; options.raw = true; - return deflate$1(input, options); + return deflate(input, options); } /** * gzip(data[, options]) -> Uint8Array @@ -4552,26 +4561,26 @@ function gzip(input, options) { options = options || {}; options.gzip = true; - return deflate$1(input, options); + return deflate(input, options); } var Deflate_1 = Deflate; - var deflate_2$1 = deflate$1; + var deflate_2 = deflate; var deflateRaw_1 = deflateRaw; var gzip_1 = gzip; - var constants$1 = constants; - var deflate_1$1 = { + var constants = constants$1; + var deflate_1 = { Deflate: Deflate_1, - deflate: deflate_2$1, + deflate: deflate_2, deflateRaw: deflateRaw_1, gzip: gzip_1, - constants: constants$1 + constants: constants }; exports.Deflate = Deflate_1; - exports.constants = constants$1; - exports.default = deflate_1$1; - exports.deflate = deflate_2$1; + exports.constants = constants; + exports['default'] = deflate_1; + exports.deflate = deflate_2; exports.deflateRaw = deflateRaw_1; exports.gzip = gzip_1; diff --git a/dist/pako_deflate.es5.min.js b/dist/pako_deflate.es5.min.js index bc09673..04cb7aa 100644 --- a/dist/pako_deflate.es5.min.js +++ b/dist/pako_deflate.es5.min.js @@ -1,2 +1,2 @@ -/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).pako={})}(this,(function(t){"use strict";function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,n=286,r=30,i=15,s=new Uint8Array([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]),_=new Uint8Array([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]),h=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),l=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);e(o);var d=new Array(60);e(d);var u=new Array(512);e(u);var f=new Array(256);e(f);var c=new Array(29);e(c);var p,g,b,w=new Array(r);function v(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function m(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(w);var y=function(t){return t<256?u[t]:u[256+(t>>>7)]},z=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},k=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<>>=1,a<<=1}while(--e>0);return a>>>1},E=function(t,e,a){var n,r,s=new Array(16),_=0;for(n=1;n<=i;n++)s[n]=_=_+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=A(s[h]++,h))}},Z=function(t){var e;for(e=0;e8?z(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},R=function(t,e,a,n){var r=2*e,i=2*a;return t[r]>1;a>=1;a--)U(t,s,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,s[2*r]=s[2*a]+s[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,s[2*a+1]=s[2*n+1]=r,t.heap[1]=r++,U(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,s,_,h,l=e.dyn_tree,o=e.max_code,d=e.stat_desc.static_tree,u=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(s=0;s<=i;s++)t.bl_count[s]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=l[2*l[2*(n=t.heap[a])+1]+1]+1)>p&&(s=p,g++),l[2*n+1]=s,n>o||(t.bl_count[s]++,_=0,n>=c&&(_=f[n-c]),h=l[2*n],t.opt_len+=h*(s+_),u&&(t.static_len+=h*(d[2*n+1]+_)));if(0!==g){do{for(s=p-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(s=p;0!==s;s--)for(n=t.bl_count[s];0!==n;)(r=t.heap[--a])>o||(l[2*r+1]!==s&&(t.opt_len+=(s-l[2*r+1])*l[2*r],l[2*r+1]=s),n--)}}(t,e),E(s,o,t.bl_count)},O=function(t,e,a){var n,r,i=-1,s=e[1],_=0,h=7,l=4;for(0===s&&(h=138,l=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++_>=7;l0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e=3&&0===t.bl_tree[2*l[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==e?N(t,e,n,r):4===t.strategy||s===i?(k(t,2+(r?1:0),3),L(t,o,d)):(k(t,4+(r?1:0),3),function(t,e,a,n){var r;for(k(t,e-257,5),k(t,a-1,5),k(t,n-4,4),r=0;r>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(f[n]+a+1)]++,t.dyn_dtree[2*y(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){k(t,2,3),x(t,256,o),function(t){16===t.bi_valid?(z(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},C=function(t,e,a,n){for(var r=65535&t|0,i=t>>>16&65535|0,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16|0},B=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),H=function(t,e,a,n){var r=B,i=n+a;t^=-1;for(var s=n;s>>8^r[255&(t^e[s])];return-1^t},M={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},P={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},j=I._tr_init,K=I._tr_stored_block,Y=I._tr_flush_block,G=I._tr_tally,X=I._tr_align,W=P.Z_NO_FLUSH,q=P.Z_PARTIAL_FLUSH,J=P.Z_FULL_FLUSH,Q=P.Z_FINISH,V=P.Z_BLOCK,$=P.Z_OK,tt=P.Z_STREAM_END,et=P.Z_STREAM_ERROR,at=P.Z_DATA_ERROR,nt=P.Z_BUF_ERROR,rt=P.Z_DEFAULT_COMPRESSION,it=P.Z_FILTERED,st=P.Z_HUFFMAN_ONLY,_t=P.Z_RLE,ht=P.Z_FIXED,lt=P.Z_DEFAULT_STRATEGY,ot=P.Z_UNKNOWN,dt=P.Z_DEFLATED,ut=258,ft=262,ct=103,pt=113,gt=666,bt=function(t,e){return t.msg=M[e],e},wt=function(t){return(t<<1)-(t>4?9:0)},vt=function(t){for(var e=t.length;--e>=0;)t[e]=0},mt=function(t,e,a){return(e<t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},zt=function(t,e){Y(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,yt(t.strm)},kt=function(t,e){t.pending_buf[t.pending++]=e},xt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},At=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,_=t.nice_match,h=t.strstart>t.w_size-ft?t.strstart-(t.w_size-ft):0,l=t.window,o=t.w_mask,d=t.prev,u=t.strstart+ut,f=l[i+s-1],c=l[i+s];t.prev_length>=t.good_match&&(r>>=2),_>t.lookahead&&(_=t.lookahead);do{if(l[(a=e)+s]===c&&l[a+s-1]===f&&l[a]===l[i]&&l[++a]===l[i+1]){i+=2,a++;do{}while(l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&is){if(t.match_start=e,s=n,n>=_)break;f=l[i+s-1],c=l[i+s]}}}while((e=d[e&o])>h&&0!=--r);return s<=t.lookahead?s:t.lookahead},Et=function(t){var e,a,n,r,i,s,_,h,l,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-ft)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,_=t.window,h=t.strstart+t.lookahead,l=r,o=void 0,(o=s.avail_in)>l&&(o=l),a=0===o?0:(s.avail_in-=o,_.set(s.input.subarray(s.next_in,s.next_in+o),h),1===s.state.wrap?s.adler=C(s.adler,_,o,h):2===s.state.wrap&&(s.adler=H(s.adler,_,o,h)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=mt(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=mt(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead=3&&(t.ins_h=mt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ft&&(t.match_length=At(t,a)),t.match_length>=3)if(n=G(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=mt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=mt(t,t.ins_h,t.window[t.strstart+1]);else n=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2},St=function(t,e){for(var a,n,r;;){if(t.lookahead=3&&(t.ins_h=mt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=G(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=mt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(zt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=G(t,0,t.window[t.strstart-1]))&&zt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=G(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2};function Rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var Ut=[new Rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Et(t),0===t.lookahead&&e===W)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,zt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-ft&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(zt(t,!1),t.strm.avail_out),1)})),new Rt(4,4,8,4,Zt),new Rt(4,5,16,8,Zt),new Rt(4,6,32,32,Zt),new Rt(4,4,16,16,St),new Rt(8,16,32,32,St),new Rt(8,16,128,128,St),new Rt(8,32,128,256,St),new Rt(32,128,258,1024,St),new Rt(32,258,258,4096,St)];function Lt(){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=dt,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 Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),vt(this.dyn_ltree),vt(this.dyn_dtree),vt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),vt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),vt(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}var Ft=function(t){if(!t||!t.state)return bt(t,et);t.total_in=t.total_out=0,t.data_type=ot;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:pt,t.adler=2===e.wrap?0:1,e.last_flush=W,j(e),$},Ot=function(t){var e,a=Ft(t);return a===$&&((e=t.state).window_size=2*e.w_size,vt(e.head),e.max_lazy_match=Ut[e.level].max_lazy,e.good_match=Ut[e.level].good_length,e.nice_match=Ut[e.level].nice_length,e.max_chain_length=Ut[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Tt=function(t,e,a,n,r,i){if(!t)return et;var s=1;if(e===rt&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==dt||n<8||n>15||e<0||e>9||i<0||i>ht)return bt(t,et);8===n&&(n=9);var _=new Lt;return t.state=_,_.strm=t,_.wrap=s,_.gzhead=null,_.w_bits=n,_.w_size=1<<_.w_bits,_.w_mask=_.w_size-1,_.hash_bits=r+7,_.hash_size=1<<_.hash_bits,_.hash_mask=_.hash_size-1,_.hash_shift=~~((_.hash_bits+3-1)/3),_.window=new Uint8Array(2*_.w_size),_.head=new Uint16Array(_.hash_size),_.prev=new Uint16Array(_.w_size),_.lit_bufsize=1<V||e<0)return t?bt(t,et):et;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===gt&&e!==Q)return bt(t,0===t.avail_out?nt:et);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,kt(r,31),kt(r,139),kt(r,8),r.gzhead?(kt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),kt(r,255&r.gzhead.time),kt(r,r.gzhead.time>>8&255),kt(r,r.gzhead.time>>16&255),kt(r,r.gzhead.time>>24&255),kt(r,9===r.level?2:r.strategy>=st||r.level<2?4:0),kt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(kt(r,255&r.gzhead.extra.length),kt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=H(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(kt(r,0),kt(r,0),kt(r,0),kt(r,0),kt(r,0),kt(r,9===r.level?2:r.strategy>=st||r.level<2?4:0),kt(r,3),r.status=pt);else{var s=dt+(r.w_bits-8<<4)<<8;s|=(r.strategy>=st||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(s|=32),s+=31-s%31,r.status=pt,xt(r,s),0!==r.strstart&&(xt(r,t.adler>>>16),xt(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),yt(t),a=r.pending,r.pending!==r.pending_buf_size));)kt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),yt(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindexa&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),yt(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindexa&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=ct)}else r.status=ct;if(r.status===ct&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&yt(t),r.pending+2<=r.pending_buf_size&&(kt(r,255&t.adler),kt(r,t.adler>>8&255),t.adler=0,r.status=pt)):r.status=pt),0!==r.pending){if(yt(t),0===t.avail_out)return r.last_flush=-1,$}else if(0===t.avail_in&&wt(e)<=wt(i)&&e!==Q)return bt(t,nt);if(r.status===gt&&0!==t.avail_in)return bt(t,nt);if(0!==t.avail_in||0!==r.lookahead||e!==W&&r.status!==gt){var _=r.strategy===st?function(t,e){for(var a;;){if(0===t.lookahead&&(Et(t),0===t.lookahead)){if(e===W)return 1;break}if(t.match_length=0,a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===_t?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=ut){if(Et(t),t.lookahead<=ut&&e===W)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+ut;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&rt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=G(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2}(r,e):Ut[r.level].func(r,e);if(3!==_&&4!==_||(r.status=gt),1===_||3===_)return 0===t.avail_out&&(r.last_flush=-1),$;if(2===_&&(e===q?X(r):e!==V&&(K(r,0,0,!1),e===J&&(vt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),yt(t),0===t.avail_out))return r.last_flush=-1,$}return e!==Q?$:r.wrap<=0?tt:(2===r.wrap?(kt(r,255&t.adler),kt(r,t.adler>>8&255),kt(r,t.adler>>16&255),kt(r,t.adler>>24&255),kt(r,255&t.total_in),kt(r,t.total_in>>8&255),kt(r,t.total_in>>16&255),kt(r,t.total_in>>24&255)):(xt(r,t.adler>>>16),xt(r,65535&t.adler)),yt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?$:tt)},deflateEnd:function(t){if(!t||!t.state)return et;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==ct&&e!==pt&&e!==gt?bt(t,et):(t.state=null,e===pt?bt(t,at):$)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return et;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return et;if(1===r&&(t.adler=C(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(vt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,_=t.next_in,h=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Et(n);n.lookahead>=3;){var l=n.strstart,o=n.lookahead-2;do{n.ins_h=mt(n,n.ins_h,n.window[l+3-1]),n.prev[l&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=l,l++}while(--o);n.strstart=l,n.lookahead=2,Et(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=_,t.input=h,t.avail_in=s,n.wrap=r,$},deflateInfo:"pako deflate (from Nodeca project)"};function Nt(t){return(Nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var It=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},Ct=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var a=e.shift();if(a){if("object"!==Nt(a))throw new TypeError(a+"must be non-object");for(var n in a)It(a,n)&&(t[n]=a[n])}}return t},Bt=function(t){for(var e=0,a=0,n=t.length;a=252?6:Mt>=248?5:Mt>=240?4:Mt>=224?3:Mt>=192?2:1;Ht[254]=Ht[254]=1;var Pt=function(t){var e,a,n,r,i,s=t.length,_=0;for(r=0;r>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e};var jt=function(){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},Kt=Object.prototype.toString,Yt=P.Z_NO_FLUSH,Gt=P.Z_SYNC_FLUSH,Xt=P.Z_FULL_FLUSH,Wt=P.Z_FINISH,qt=P.Z_OK,Jt=P.Z_STREAM_END,Qt=P.Z_DEFAULT_COMPRESSION,Vt=P.Z_DEFAULT_STRATEGY,$t=P.Z_DEFLATED;function te(t){this.options=Ct({level:Qt,method:$t,chunkSize:16384,windowBits:15,memLevel:8,strategy:Vt},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jt,this.strm.avail_out=0;var a=Dt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==qt)throw new Error(M[a]);if(e.header&&Dt.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(n="string"==typeof e.dictionary?Pt(e.dictionary):"[object ArrayBuffer]"===Kt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(a=Dt.deflateSetDictionary(this.strm,n))!==qt)throw new Error(M[a]);this._dict_set=!0}}function ee(t,e){var a=new te(e);if(a.push(t,!0),a.err)throw a.msg||M[a.err];return a.result}te.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?Wt:Yt,"string"==typeof t?r.input=Pt(t):"[object ArrayBuffer]"===Kt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(n===Gt||n===Xt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((a=Dt.deflate(r,n))===Jt)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=Dt.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===qt;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},te.prototype.onData=function(t){this.chunks.push(t)},te.prototype.onEnd=function(t){t===qt&&(this.result=Bt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var ae=te,ne=ee,re=function(t,e){return(e=e||{}).raw=!0,ee(t,e)},ie=function(t,e){return(e=e||{}).gzip=!0,ee(t,e)},se=P,_e={Deflate:ae,deflate:ne,deflateRaw:re,gzip:ie,constants:se};t.Deflate=ae,t.constants=se,t.default=_e,t.deflate=ne,t.deflateRaw=re,t.gzip=ie,Object.defineProperty(t,"__esModule",{value:!0})})); +/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).pako={})}(this,(function(t){"use strict";function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,n=286,r=30,i=15,s=new Uint8Array([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]),_=new Uint8Array([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]),h=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),l=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);e(o);var d=new Array(60);e(d);var u=new Array(512);e(u);var f=new Array(256);e(f);var c=new Array(29);e(c);var p,g,b,w=new Array(r);function v(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function m(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(w);var y=function(t){return t<256?u[t]:u[256+(t>>>7)]},z=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},k=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<>>=1,a<<=1}while(--e>0);return a>>>1},E=function(t,e,a){var n,r,s=new Array(16),_=0;for(n=1;n<=i;n++)s[n]=_=_+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=A(s[h]++,h))}},Z=function(t){var e;for(e=0;e8?z(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},R=function(t,e,a,n){var r=2*e,i=2*a;return t[r]>1;a>=1;a--)U(t,s,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,s[2*r]=s[2*a]+s[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,s[2*a+1]=s[2*n+1]=r,t.heap[1]=r++,U(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,s,_,h,l=e.dyn_tree,o=e.max_code,d=e.stat_desc.static_tree,u=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(s=0;s<=i;s++)t.bl_count[s]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=l[2*l[2*(n=t.heap[a])+1]+1]+1)>p&&(s=p,g++),l[2*n+1]=s,n>o||(t.bl_count[s]++,_=0,n>=c&&(_=f[n-c]),h=l[2*n],t.opt_len+=h*(s+_),u&&(t.static_len+=h*(d[2*n+1]+_)));if(0!==g){do{for(s=p-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(s=p;0!==s;s--)for(n=t.bl_count[s];0!==n;)(r=t.heap[--a])>o||(l[2*r+1]!==s&&(t.opt_len+=(s-l[2*r+1])*l[2*r],l[2*r+1]=s),n--)}}(t,e),E(s,o,t.bl_count)},F=function(t,e,a){var n,r,i=-1,s=e[1],_=0,h=7,l=4;for(0===s&&(h=138,l=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++_>=7;l0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e=3&&0===t.bl_tree[2*l[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==e?N(t,e,n,r):4===t.strategy||s===i?(k(t,2+(r?1:0),3),T(t,o,d)):(k(t,4+(r?1:0),3),function(t,e,a,n){var r;for(k(t,e-257,5),k(t,a-1,5),k(t,n-4,4),r=0;r>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(f[n]+a+1)]++,t.dyn_dtree[2*y(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){k(t,2,3),x(t,256,o),function(t){16===t.bi_valid?(z(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},C=function(t,e,a,n){for(var r=65535&t|0,i=t>>>16&65535|0,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16|0},B=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),H=function(t,e,a,n){var r=B,i=n+a;t^=-1;for(var s=n;s>>8^r[255&(t^e[s])];return-1^t},M={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},P={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},j=I._tr_init,K=I._tr_stored_block,Y=I._tr_flush_block,G=I._tr_tally,X=I._tr_align,W=P.Z_NO_FLUSH,q=P.Z_PARTIAL_FLUSH,J=P.Z_FULL_FLUSH,Q=P.Z_FINISH,V=P.Z_BLOCK,$=P.Z_OK,tt=P.Z_STREAM_END,et=P.Z_STREAM_ERROR,at=P.Z_DATA_ERROR,nt=P.Z_BUF_ERROR,rt=P.Z_DEFAULT_COMPRESSION,it=P.Z_FILTERED,st=P.Z_HUFFMAN_ONLY,_t=P.Z_RLE,ht=P.Z_FIXED,lt=P.Z_DEFAULT_STRATEGY,ot=P.Z_UNKNOWN,dt=P.Z_DEFLATED,ut=258,ft=262,ct=103,pt=113,gt=666,bt=function(t,e){return t.msg=M[e],e},wt=function(t){return(t<<1)-(t>4?9:0)},vt=function(t){for(var e=t.length;--e>=0;)t[e]=0},mt=function(t,e,a){return(e<t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},zt=function(t,e){Y(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,yt(t.strm)},kt=function(t,e){t.pending_buf[t.pending++]=e},xt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},At=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,_=t.nice_match,h=t.strstart>t.w_size-ft?t.strstart-(t.w_size-ft):0,l=t.window,o=t.w_mask,d=t.prev,u=t.strstart+ut,f=l[i+s-1],c=l[i+s];t.prev_length>=t.good_match&&(r>>=2),_>t.lookahead&&(_=t.lookahead);do{if(l[(a=e)+s]===c&&l[a+s-1]===f&&l[a]===l[i]&&l[++a]===l[i+1]){i+=2,a++;do{}while(l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&is){if(t.match_start=e,s=n,n>=_)break;f=l[i+s-1],c=l[i+s]}}}while((e=d[e&o])>h&&0!=--r);return s<=t.lookahead?s:t.lookahead},Et=function(t){var e,a,n,r,i,s,_,h,l,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-ft)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,_=t.window,h=t.strstart+t.lookahead,l=r,o=void 0,(o=s.avail_in)>l&&(o=l),a=0===o?0:(s.avail_in-=o,_.set(s.input.subarray(s.next_in,s.next_in+o),h),1===s.state.wrap?s.adler=C(s.adler,_,o,h):2===s.state.wrap&&(s.adler=H(s.adler,_,o,h)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=mt(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=mt(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead=3&&(t.ins_h=mt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ft&&(t.match_length=At(t,a)),t.match_length>=3)if(n=G(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=mt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=mt(t,t.ins_h,t.window[t.strstart+1]);else n=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2},St=function(t,e){for(var a,n,r;;){if(t.lookahead=3&&(t.ins_h=mt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=G(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=mt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(zt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=G(t,0,t.window[t.strstart-1]))&&zt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=G(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2};function Rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var Ut=[new Rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Et(t),0===t.lookahead&&e===W)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,zt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-ft&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(zt(t,!1),t.strm.avail_out),1)})),new Rt(4,4,8,4,Zt),new Rt(4,5,16,8,Zt),new Rt(4,6,32,32,Zt),new Rt(4,4,16,16,St),new Rt(8,16,32,32,St),new Rt(8,16,128,128,St),new Rt(8,32,128,256,St),new Rt(32,128,258,1024,St),new Rt(32,258,258,4096,St)];function Tt(){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=dt,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 Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),vt(this.dyn_ltree),vt(this.dyn_dtree),vt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),vt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),vt(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}var Lt=function(t){if(!t||!t.state)return bt(t,et);t.total_in=t.total_out=0,t.data_type=ot;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:pt,t.adler=2===e.wrap?0:1,e.last_flush=W,j(e),$},Ft=function(t){var e,a=Lt(t);return a===$&&((e=t.state).window_size=2*e.w_size,vt(e.head),e.max_lazy_match=Ut[e.level].max_lazy,e.good_match=Ut[e.level].good_length,e.nice_match=Ut[e.level].nice_length,e.max_chain_length=Ut[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Ot=function(t,e,a,n,r,i){if(!t)return et;var s=1;if(e===rt&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==dt||n<8||n>15||e<0||e>9||i<0||i>ht)return bt(t,et);8===n&&(n=9);var _=new Tt;return t.state=_,_.strm=t,_.wrap=s,_.gzhead=null,_.w_bits=n,_.w_size=1<<_.w_bits,_.w_mask=_.w_size-1,_.hash_bits=r+7,_.hash_size=1<<_.hash_bits,_.hash_mask=_.hash_size-1,_.hash_shift=~~((_.hash_bits+3-1)/3),_.window=new Uint8Array(2*_.w_size),_.head=new Uint16Array(_.hash_size),_.prev=new Uint16Array(_.w_size),_.lit_bufsize=1<V||e<0)return t?bt(t,et):et;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===gt&&e!==Q)return bt(t,0===t.avail_out?nt:et);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,kt(r,31),kt(r,139),kt(r,8),r.gzhead?(kt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),kt(r,255&r.gzhead.time),kt(r,r.gzhead.time>>8&255),kt(r,r.gzhead.time>>16&255),kt(r,r.gzhead.time>>24&255),kt(r,9===r.level?2:r.strategy>=st||r.level<2?4:0),kt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(kt(r,255&r.gzhead.extra.length),kt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=H(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(kt(r,0),kt(r,0),kt(r,0),kt(r,0),kt(r,0),kt(r,9===r.level?2:r.strategy>=st||r.level<2?4:0),kt(r,3),r.status=pt);else{var s=dt+(r.w_bits-8<<4)<<8;s|=(r.strategy>=st||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(s|=32),s+=31-s%31,r.status=pt,xt(r,s),0!==r.strstart&&(xt(r,t.adler>>>16),xt(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),yt(t),a=r.pending,r.pending!==r.pending_buf_size));)kt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),yt(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindexa&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),yt(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindexa&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=ct)}else r.status=ct;if(r.status===ct&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&yt(t),r.pending+2<=r.pending_buf_size&&(kt(r,255&t.adler),kt(r,t.adler>>8&255),t.adler=0,r.status=pt)):r.status=pt),0!==r.pending){if(yt(t),0===t.avail_out)return r.last_flush=-1,$}else if(0===t.avail_in&&wt(e)<=wt(i)&&e!==Q)return bt(t,nt);if(r.status===gt&&0!==t.avail_in)return bt(t,nt);if(0!==t.avail_in||0!==r.lookahead||e!==W&&r.status!==gt){var _=r.strategy===st?function(t,e){for(var a;;){if(0===t.lookahead&&(Et(t),0===t.lookahead)){if(e===W)return 1;break}if(t.match_length=0,a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===_t?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=ut){if(Et(t),t.lookahead<=ut&&e===W)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+ut;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&rt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=G(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2}(r,e):Ut[r.level].func(r,e);if(3!==_&&4!==_||(r.status=gt),1===_||3===_)return 0===t.avail_out&&(r.last_flush=-1),$;if(2===_&&(e===q?X(r):e!==V&&(K(r,0,0,!1),e===J&&(vt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),yt(t),0===t.avail_out))return r.last_flush=-1,$}return e!==Q?$:r.wrap<=0?tt:(2===r.wrap?(kt(r,255&t.adler),kt(r,t.adler>>8&255),kt(r,t.adler>>16&255),kt(r,t.adler>>24&255),kt(r,255&t.total_in),kt(r,t.total_in>>8&255),kt(r,t.total_in>>16&255),kt(r,t.total_in>>24&255)):(xt(r,t.adler>>>16),xt(r,65535&t.adler)),yt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?$:tt)},deflateEnd:function(t){if(!t||!t.state)return et;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==ct&&e!==pt&&e!==gt?bt(t,et):(t.state=null,e===pt?bt(t,at):$)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return et;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return et;if(1===r&&(t.adler=C(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(vt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,_=t.next_in,h=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Et(n);n.lookahead>=3;){var l=n.strstart,o=n.lookahead-2;do{n.ins_h=mt(n,n.ins_h,n.window[l+3-1]),n.prev[l&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=l,l++}while(--o);n.strstart=l,n.lookahead=2,Et(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=_,t.input=h,t.avail_in=s,n.wrap=r,$},deflateInfo:"pako deflate (from Nodeca project)"};function Nt(t){return(Nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var It=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},Ct=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var a=e.shift();if(a){if("object"!==Nt(a))throw new TypeError(a+"must be non-object");for(var n in a)It(a,n)&&(t[n]=a[n])}}return t},Bt=function(t){for(var e=0,a=0,n=t.length;a=252?6:Mt>=248?5:Mt>=240?4:Mt>=224?3:Mt>=192?2:1;Ht[254]=Ht[254]=1;var Pt=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,a,n,r,i,s=t.length,_=0;for(r=0;r>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e};var jt=function(){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},Kt=Object.prototype.toString,Yt=P.Z_NO_FLUSH,Gt=P.Z_SYNC_FLUSH,Xt=P.Z_FULL_FLUSH,Wt=P.Z_FINISH,qt=P.Z_OK,Jt=P.Z_STREAM_END,Qt=P.Z_DEFAULT_COMPRESSION,Vt=P.Z_DEFAULT_STRATEGY,$t=P.Z_DEFLATED;function te(t){this.options=Ct({level:Qt,method:$t,chunkSize:16384,windowBits:15,memLevel:8,strategy:Vt},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jt,this.strm.avail_out=0;var a=Dt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==qt)throw new Error(M[a]);if(e.header&&Dt.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(n="string"==typeof e.dictionary?Pt(e.dictionary):"[object ArrayBuffer]"===Kt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(a=Dt.deflateSetDictionary(this.strm,n))!==qt)throw new Error(M[a]);this._dict_set=!0}}function ee(t,e){var a=new te(e);if(a.push(t,!0),a.err)throw a.msg||M[a.err];return a.result}te.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?Wt:Yt,"string"==typeof t?r.input=Pt(t):"[object ArrayBuffer]"===Kt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(n===Gt||n===Xt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((a=Dt.deflate(r,n))===Jt)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=Dt.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===qt;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},te.prototype.onData=function(t){this.chunks.push(t)},te.prototype.onEnd=function(t){t===qt&&(this.result=Bt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var ae=te,ne=ee,re=function(t,e){return(e=e||{}).raw=!0,ee(t,e)},ie=function(t,e){return(e=e||{}).gzip=!0,ee(t,e)},se=P,_e={Deflate:ae,deflate:ne,deflateRaw:re,gzip:ie,constants:se};t.Deflate=ae,t.constants=se,t.default=_e,t.deflate=ne,t.deflateRaw=re,t.gzip=ie,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/dist/pako_deflate.js b/dist/pako_deflate.js index 79cf19e..ea3821b 100644 --- a/dist/pako_deflate.js +++ b/dist/pako_deflate.js @@ -1,5 +1,5 @@ -/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */ +/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : @@ -34,19 +34,19 @@ //const Z_FILTERED = 1; //const Z_HUFFMAN_ONLY = 2; //const Z_RLE = 3; - const Z_FIXED = 4; + const Z_FIXED$1 = 4; //const Z_DEFAULT_STRATEGY = 0; /* Possible values of the data_type field (though see inflate()) */ const Z_BINARY = 0; const Z_TEXT = 1; //const Z_ASCII = 1; // = Z_TEXT - const Z_UNKNOWN = 2; + const Z_UNKNOWN$1 = 2; /*============================================================================*/ - function zero(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } } + function zero$1(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } } // From zutil.h @@ -55,8 +55,8 @@ const DYN_TREES = 2; /* The three kinds of block type */ - const MIN_MATCH = 3; - const MAX_MATCH = 258; + const MIN_MATCH$1 = 3; + const MAX_MATCH$1 = 258; /* The minimum and maximum match lengths */ // From deflate.h @@ -64,25 +64,25 @@ * Internal compression state. */ - const LENGTH_CODES = 29; + const LENGTH_CODES$1 = 29; /* number of length codes, not counting the special END_BLOCK code */ - const LITERALS = 256; + const LITERALS$1 = 256; /* number of literal bytes 0..255 */ - const L_CODES = LITERALS + 1 + LENGTH_CODES; + const L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1; /* number of Literal or Length codes, including the END_BLOCK code */ - const D_CODES = 30; + const D_CODES$1 = 30; /* number of distance codes */ - const BL_CODES = 19; + const BL_CODES$1 = 19; /* number of codes used to transfer the bit lengths */ - const HEAP_SIZE = 2 * L_CODES + 1; + const HEAP_SIZE$1 = 2 * L_CODES$1 + 1; /* maximum heap size */ - const MAX_BITS = 15; + const MAX_BITS$1 = 15; /* All codes must not exceed MAX_BITS bits */ const Buf_size = 16; @@ -135,37 +135,37 @@ const DIST_CODE_LEN = 512; /* see definition of array dist_code below */ // !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1 - const static_ltree = new Array((L_CODES + 2) * 2); - zero(static_ltree); + const static_ltree = new Array((L_CODES$1 + 2) * 2); + zero$1(static_ltree); /* The static literal tree. Since the bit lengths are imposed, there is no * need for the L_CODES extra codes used during heap construction. However * The codes 286 and 287 are needed to build a canonical tree (see _tr_init * below). */ - const static_dtree = new Array(D_CODES * 2); - zero(static_dtree); + const static_dtree = new Array(D_CODES$1 * 2); + zero$1(static_dtree); /* The static distance tree. (Actually a trivial tree since all codes use * 5 bits.) */ const _dist_code = new Array(DIST_CODE_LEN); - zero(_dist_code); + zero$1(_dist_code); /* Distance codes. The first 256 values correspond to the distances * 3 .. 258, the last 256 values correspond to the top 8 bits of * the 15 bit distances. */ - const _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); - zero(_length_code); + const _length_code = new Array(MAX_MATCH$1 - MIN_MATCH$1 + 1); + zero$1(_length_code); /* length code for each normalized match length (0 == MIN_MATCH) */ - const base_length = new Array(LENGTH_CODES); - zero(base_length); + const base_length = new Array(LENGTH_CODES$1); + zero$1(base_length); /* First normalized length for each code (0 = MIN_MATCH) */ - const base_dist = new Array(D_CODES); - zero(base_dist); + const base_dist = new Array(D_CODES$1); + zero$1(base_dist); /* First normalized distance for each code (0 = distance of 1) */ @@ -300,7 +300,7 @@ let f; /* frequency */ let overflow = 0; /* number of elements with bit length too large */ - for (bits = 0; bits <= MAX_BITS; bits++) { + for (bits = 0; bits <= MAX_BITS$1; bits++) { s.bl_count[bits] = 0; } @@ -309,7 +309,7 @@ */ tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */ - for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { + for (h = s.heap_max + 1; h < HEAP_SIZE$1; h++) { n = s.heap[h]; bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1; if (bits > max_length) { @@ -384,7 +384,7 @@ // int max_code; /* largest code with non zero frequency */ // ushf *bl_count; /* number of codes at each bit length */ { - const next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */ + const next_code = new Array(MAX_BITS$1 + 1); /* next code value for each bit length */ let code = 0; /* running code value */ let bits; /* bit index */ let n; /* code index */ @@ -392,7 +392,7 @@ /* The distribution counts are first used to generate the code values * without bit reversal. */ - for (bits = 1; bits <= MAX_BITS; bits++) { + for (bits = 1; bits <= MAX_BITS$1; bits++) { next_code[bits] = code = (code + bl_count[bits - 1]) << 1; } /* Check that the bit counts in bl_count are consistent. The last code @@ -424,7 +424,7 @@ let length; /* length value */ let code; /* code value */ let dist; /* distance index */ - const bl_count = new Array(MAX_BITS + 1); + const bl_count = new Array(MAX_BITS$1 + 1); /* number of codes at each bit length for an optimal tree */ // do check in _tr_init() @@ -441,7 +441,7 @@ /* Initialize the mapping length (0..255) -> length code (0..28) */ length = 0; - for (code = 0; code < LENGTH_CODES - 1; code++) { + for (code = 0; code < LENGTH_CODES$1 - 1; code++) { base_length[code] = length; for (n = 0; n < (1 << extra_lbits[code]); n++) { _length_code[length++] = code; @@ -464,7 +464,7 @@ } //Assert (dist == 256, "tr_static_init: dist != 256"); dist >>= 7; /* from now on, all distances are divided by 128 */ - for (; code < D_CODES; code++) { + for (; code < D_CODES$1; code++) { base_dist[code] = dist << 7; for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) { _dist_code[256 + dist++] = code; @@ -473,7 +473,7 @@ //Assert (dist == 256, "tr_static_init: 256+dist != 512"); /* Construct the codes of the static literal tree */ - for (bits = 0; bits <= MAX_BITS; bits++) { + for (bits = 0; bits <= MAX_BITS$1; bits++) { bl_count[bits] = 0; } @@ -502,18 +502,18 @@ * tree construction to get a canonical Huffman tree (longest code * all ones) */ - gen_codes(static_ltree, L_CODES + 1, bl_count); + gen_codes(static_ltree, L_CODES$1 + 1, bl_count); /* The static distance tree is trivial: */ - for (n = 0; n < D_CODES; n++) { + for (n = 0; n < D_CODES$1; n++) { static_dtree[n * 2 + 1]/*.Len*/ = 5; static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5); } // Now data ready and we can init static trees - static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); - static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); - static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS$1 + 1, L_CODES$1, MAX_BITS$1); + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES$1, MAX_BITS$1); + static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES$1, MAX_BL_BITS); //static_init_done = true; }; @@ -527,9 +527,9 @@ let n; /* iterates over tree elements */ /* Initialize the trees. */ - for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } - for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } - for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < L_CODES$1; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < D_CODES$1; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < BL_CODES$1; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1; s.opt_len = s.static_len = 0; @@ -649,7 +649,7 @@ } else { /* Here, lc is the match length - MIN_MATCH */ code = _length_code[lc]; - send_code(s, code + LITERALS + 1, ltree); /* send the length code */ + send_code(s, code + LITERALS$1 + 1, ltree); /* send the length code */ extra = extra_lbits[code]; if (extra !== 0) { lc -= base_length[code]; @@ -703,7 +703,7 @@ * heap[0] is not used. */ s.heap_len = 0; - s.heap_max = HEAP_SIZE; + s.heap_max = HEAP_SIZE$1; for (n = 0; n < elems; n++) { if (tree[n * 2]/*.Freq*/ !== 0) { @@ -937,7 +937,7 @@ * requires that at least 4 bit length codes be sent. (appnote.txt says * 3 but the actual value used is 4.) */ - for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { + for (max_blindex = BL_CODES$1 - 1; max_blindex >= 3; max_blindex--) { if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) { break; } @@ -1016,7 +1016,7 @@ s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) { return Z_TEXT; } - for (n = 32; n < LITERALS; n++) { + for (n = 32; n < LITERALS$1; n++) { if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) { return Z_TEXT; } @@ -1034,7 +1034,7 @@ /* =========================================================================== * Initialize the tree data structures for a new zlib stream. */ - const _tr_init = (s) => + const _tr_init$1 = (s) => { if (!static_init_done) { @@ -1057,7 +1057,7 @@ /* =========================================================================== * Send a stored block */ - const _tr_stored_block = (s, buf, stored_len, last) => + const _tr_stored_block$1 = (s, buf, stored_len, last) => //DeflateState *s; //charf *buf; /* input block */ //ulg stored_len; /* length of input block */ @@ -1072,7 +1072,7 @@ * Send one empty static block to give enough lookahead for inflate. * This takes 10 bits, of which 7 may remain in the bit buffer. */ - const _tr_align = (s) => { + const _tr_align$1 = (s) => { send_bits(s, STATIC_TREES << 1, 3); send_code(s, END_BLOCK, static_ltree); bi_flush(s); @@ -1083,7 +1083,7 @@ * Determine the best encoding for the current block: dynamic trees, static * trees or store, and output the encoded block to the zip file. */ - const _tr_flush_block = (s, buf, stored_len, last) => + const _tr_flush_block$1 = (s, buf, stored_len, last) => //DeflateState *s; //charf *buf; /* input block, or NULL if too old */ //ulg stored_len; /* length of input block */ @@ -1096,7 +1096,7 @@ if (s.level > 0) { /* Check if the file is binary or text */ - if (s.strm.data_type === Z_UNKNOWN) { + if (s.strm.data_type === Z_UNKNOWN$1) { s.strm.data_type = detect_data_type(s); } @@ -1141,9 +1141,9 @@ * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to * transform a block into a stored block. */ - _tr_stored_block(s, buf, stored_len, last); + _tr_stored_block$1(s, buf, stored_len, last); - } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { + } else if (s.strategy === Z_FIXED$1 || static_lenb === opt_lenb) { send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); compress_block(s, static_ltree, static_dtree); @@ -1170,7 +1170,7 @@ * Save the match info and tally the frequency counts. Return true if * the current block must be flushed. */ - const _tr_tally = (s, dist, lc) => + const _tr_tally$1 = (s, dist, lc) => // deflate_state *s; // unsigned dist; /* distance of matched string */ // unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ @@ -1194,7 +1194,7 @@ // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); - s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++; + s.dyn_ltree[(_length_code[lc] + LITERALS$1 + 1) * 2]/*.Freq*/++; s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++; } @@ -1228,11 +1228,11 @@ */ }; - var _tr_init_1 = _tr_init; - var _tr_stored_block_1 = _tr_stored_block; - var _tr_flush_block_1 = _tr_flush_block; - var _tr_tally_1 = _tr_tally; - var _tr_align_1 = _tr_align; + var _tr_init_1 = _tr_init$1; + var _tr_stored_block_1 = _tr_stored_block$1; + var _tr_flush_block_1 = _tr_flush_block$1; + var _tr_tally_1 = _tr_tally$1; + var _tr_align_1 = _tr_align$1; var trees = { _tr_init: _tr_init_1, @@ -1400,7 +1400,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. - var constants = { + var constants$1 = { /* Allowed flush values; see deflate() and inflate() below for details */ Z_NO_FLUSH: 0, @@ -1467,7 +1467,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. - const { _tr_init: _tr_init$1, _tr_stored_block: _tr_stored_block$1, _tr_flush_block: _tr_flush_block$1, _tr_tally: _tr_tally$1, _tr_align: _tr_align$1 } = trees; + const { _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align } = trees; @@ -1476,13 +1476,13 @@ /* ===========================================================================*/ const { - Z_NO_FLUSH, Z_PARTIAL_FLUSH, Z_FULL_FLUSH, Z_FINISH, Z_BLOCK, - Z_OK, Z_STREAM_END, Z_STREAM_ERROR, Z_DATA_ERROR, Z_BUF_ERROR, - Z_DEFAULT_COMPRESSION, - Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED: Z_FIXED$1, Z_DEFAULT_STRATEGY, - Z_UNKNOWN: Z_UNKNOWN$1, - Z_DEFLATED - } = constants; + Z_NO_FLUSH: Z_NO_FLUSH$1, Z_PARTIAL_FLUSH, Z_FULL_FLUSH: Z_FULL_FLUSH$1, Z_FINISH: Z_FINISH$1, Z_BLOCK, + Z_OK: Z_OK$1, Z_STREAM_END: Z_STREAM_END$1, Z_STREAM_ERROR, Z_DATA_ERROR, Z_BUF_ERROR, + Z_DEFAULT_COMPRESSION: Z_DEFAULT_COMPRESSION$1, + Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED, Z_DEFAULT_STRATEGY: Z_DEFAULT_STRATEGY$1, + Z_UNKNOWN, + Z_DEFLATED: Z_DEFLATED$1 + } = constants$1; /*============================================================================*/ @@ -1494,24 +1494,24 @@ const DEF_MEM_LEVEL = 8; - const LENGTH_CODES$1 = 29; + const LENGTH_CODES = 29; /* number of length codes, not counting the special END_BLOCK code */ - const LITERALS$1 = 256; + const LITERALS = 256; /* number of literal bytes 0..255 */ - const L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1; + const L_CODES = LITERALS + 1 + LENGTH_CODES; /* number of Literal or Length codes, including the END_BLOCK code */ - const D_CODES$1 = 30; + const D_CODES = 30; /* number of distance codes */ - const BL_CODES$1 = 19; + const BL_CODES = 19; /* number of codes used to transfer the bit lengths */ - const HEAP_SIZE$1 = 2 * L_CODES$1 + 1; + const HEAP_SIZE = 2 * L_CODES + 1; /* maximum heap size */ - const MAX_BITS$1 = 15; + const MAX_BITS = 15; /* All codes must not exceed MAX_BITS bits */ - const MIN_MATCH$1 = 3; - const MAX_MATCH$1 = 258; - const MIN_LOOKAHEAD = (MAX_MATCH$1 + MIN_MATCH$1 + 1); + const MIN_MATCH = 3; + const MAX_MATCH = 258; + const MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); const PRESET_DICT = 0x20; @@ -1539,7 +1539,7 @@ return ((f) << 1) - ((f) > 4 ? 9 : 0); }; - const zero$1 = (buf) => { + const zero = (buf) => { let len = buf.length; while (--len >= 0) { buf[len] = 0; } }; @@ -1580,7 +1580,7 @@ const flush_block_only = (s, last) => { - _tr_flush_block$1(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); + _tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); s.block_start = s.strstart; flush_pending(s.strm); }; @@ -1667,7 +1667,7 @@ * we prevent matches with the string of window index 0. */ - const strend = s.strstart + MAX_MATCH$1; + const strend = s.strstart + MAX_MATCH; let scan_end1 = _win[scan + best_len - 1]; let scan_end = _win[scan + best_len]; @@ -1730,8 +1730,8 @@ // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - len = MAX_MATCH$1 - (strend - scan); - scan = strend - MAX_MATCH$1; + len = MAX_MATCH - (strend - scan); + scan = strend - MAX_MATCH; if (len > best_len) { s.match_start = cur_match; @@ -1845,7 +1845,7 @@ s.lookahead += n; /* Initialize the hash value now that we have some input: */ - if (s.lookahead + s.insert >= MIN_MATCH$1) { + if (s.lookahead + s.insert >= MIN_MATCH) { str = s.strstart - s.insert; s.ins_h = s.window[str]; @@ -1856,13 +1856,13 @@ //#endif while (s.insert) { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]); s.prev[str & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = str; str++; s.insert--; - if (s.lookahead + s.insert < MIN_MATCH$1) { + if (s.lookahead + s.insert < MIN_MATCH) { break; } } @@ -1944,7 +1944,7 @@ // } fill_window(s); - if (s.lookahead === 0 && flush === Z_NO_FLUSH) { + if (s.lookahead === 0 && flush === Z_NO_FLUSH$1) { return BS_NEED_MORE; } @@ -1990,7 +1990,7 @@ s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$1) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -2032,7 +2032,7 @@ */ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$1) { return BS_NEED_MORE; } if (s.lookahead === 0) { @@ -2044,9 +2044,9 @@ * dictionary, and set hash_head to the head of the hash chain: */ hash_head = 0/*NIL*/; - if (s.lookahead >= MIN_MATCH$1) { + if (s.lookahead >= MIN_MATCH) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -2063,24 +2063,24 @@ s.match_length = longest_match(s, hash_head); /* longest_match() sets match_start */ } - if (s.match_length >= MIN_MATCH$1) { + if (s.match_length >= MIN_MATCH) { // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only /*** _tr_tally_dist(s, s.strstart - s.match_start, s.match_length - MIN_MATCH, bflush); ***/ - bflush = _tr_tally$1(s, s.strstart - s.match_start, s.match_length - MIN_MATCH$1); + bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; /* Insert new strings in the hash table only if the match length * is not too large. This saves time but degrades compression. */ - if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH$1) { + if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) { s.match_length--; /* string at strstart already in table */ do { s.strstart++; /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -2108,7 +2108,7 @@ /* No match, output a literal byte */ //Tracevv((stderr,"%c", s.window[s.strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; @@ -2122,8 +2122,8 @@ /***/ } } - s.insert = ((s.strstart < (MIN_MATCH$1 - 1)) ? s.strstart : MIN_MATCH$1 - 1); - if (flush === Z_FINISH) { + s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1); + if (flush === Z_FINISH$1) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -2164,7 +2164,7 @@ */ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$1) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } /* flush the current block */ @@ -2174,9 +2174,9 @@ * dictionary, and set hash_head to the head of the hash chain: */ hash_head = 0/*NIL*/; - if (s.lookahead >= MIN_MATCH$1) { + if (s.lookahead >= MIN_MATCH) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -2186,7 +2186,7 @@ */ s.prev_length = s.match_length; s.prev_match = s.match_start; - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) { @@ -2198,26 +2198,26 @@ /* longest_match() sets match_start */ if (s.match_length <= 5 && - (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH$1 && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { + (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { /* If prev_match is also MIN_MATCH, match_start is garbage * but we will ignore the current match anyway. */ - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; } } /* If there was a match at the previous step and the current * match is not better, output the previous match: */ - if (s.prev_length >= MIN_MATCH$1 && s.match_length <= s.prev_length) { - max_insert = s.strstart + s.lookahead - MIN_MATCH$1; + if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { + max_insert = s.strstart + s.lookahead - MIN_MATCH; /* Do not insert strings in hash table beyond this. */ //check_match(s, s.strstart-1, s.prev_match, s.prev_length); /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH, bflush);***/ - bflush = _tr_tally$1(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH$1); + bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); /* Insert in hash table all strings up to the end of the match. * strstart-1 and strstart are already inserted. If there is not * enough lookahead, the last two strings are not inserted in @@ -2228,14 +2228,14 @@ do { if (++s.strstart <= max_insert) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ } } while (--s.prev_length !== 0); s.match_available = 0; - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; s.strstart++; if (bflush) { @@ -2254,7 +2254,7 @@ */ //Tracevv((stderr,"%c", s->window[s->strstart-1])); /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]); + bflush = _tr_tally(s, 0, s.window[s.strstart - 1]); if (bflush) { /*** FLUSH_BLOCK_ONLY(s, 0) ***/ @@ -2279,12 +2279,12 @@ if (s.match_available) { //Tracevv((stderr,"%c", s->window[s->strstart-1])); /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]); + bflush = _tr_tally(s, 0, s.window[s.strstart - 1]); s.match_available = 0; } - s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1; - if (flush === Z_FINISH) { + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; + if (flush === Z_FINISH$1) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -2324,9 +2324,9 @@ * at the end of the input file. We need MAX_MATCH bytes * for the longest run, plus one for the unrolled loop. */ - if (s.lookahead <= MAX_MATCH$1) { + if (s.lookahead <= MAX_MATCH) { fill_window(s); - if (s.lookahead <= MAX_MATCH$1 && flush === Z_NO_FLUSH) { + if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH$1) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } /* flush the current block */ @@ -2334,11 +2334,11 @@ /* See how many times the previous byte repeats */ s.match_length = 0; - if (s.lookahead >= MIN_MATCH$1 && s.strstart > 0) { + if (s.lookahead >= MIN_MATCH && s.strstart > 0) { scan = s.strstart - 1; prev = _win[scan]; if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { - strend = s.strstart + MAX_MATCH$1; + strend = s.strstart + MAX_MATCH; do { /*jshint noempty:false*/ } while (prev === _win[++scan] && prev === _win[++scan] && @@ -2346,7 +2346,7 @@ prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend); - s.match_length = MAX_MATCH$1 - (strend - scan); + s.match_length = MAX_MATCH - (strend - scan); if (s.match_length > s.lookahead) { s.match_length = s.lookahead; } @@ -2355,11 +2355,11 @@ } /* Emit match if have run of MIN_MATCH or longer, else emit literal */ - if (s.match_length >= MIN_MATCH$1) { + if (s.match_length >= MIN_MATCH) { //check_match(s, s.strstart, s.strstart - 1, s.match_length); /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ - bflush = _tr_tally$1(s, 1, s.match_length - MIN_MATCH$1); + bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; s.strstart += s.match_length; @@ -2368,7 +2368,7 @@ /* No match, output a literal byte */ //Tracevv((stderr,"%c", s->window[s->strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; @@ -2383,7 +2383,7 @@ } } s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$1) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -2416,7 +2416,7 @@ if (s.lookahead === 0) { fill_window(s); if (s.lookahead === 0) { - if (flush === Z_NO_FLUSH) { + if (flush === Z_NO_FLUSH$1) { return BS_NEED_MORE; } break; /* flush the current block */ @@ -2427,7 +2427,7 @@ s.match_length = 0; //Tracevv((stderr,"%c", s->window[s->strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; if (bflush) { @@ -2440,7 +2440,7 @@ } } s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$1) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -2498,7 +2498,7 @@ s.window_size = 2 * s.w_size; /*** CLEAR_HASH(s); ***/ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); /* Set the default configuration parameters: */ @@ -2511,7 +2511,7 @@ s.block_start = 0; s.lookahead = 0; s.insert = 0; - s.match_length = s.prev_length = MIN_MATCH$1 - 1; + s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; s.ins_h = 0; }; @@ -2527,7 +2527,7 @@ this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ this.gzhead = null; /* gzip header information to write */ this.gzindex = 0; /* where in extra, name, or comment */ - this.method = Z_DEFLATED; /* can only be DEFLATED */ + this.method = Z_DEFLATED$1; /* can only be DEFLATED */ this.last_flush = -1; /* value of flush param for previous deflate call */ this.w_size = 0; /* LZ77 window size (32K by default) */ @@ -2620,24 +2620,24 @@ // Use flat array of DOUBLE size, with interleaved fata, // because JS does not support effective - this.dyn_ltree = new Uint16Array(HEAP_SIZE$1 * 2); - this.dyn_dtree = new Uint16Array((2 * D_CODES$1 + 1) * 2); - this.bl_tree = new Uint16Array((2 * BL_CODES$1 + 1) * 2); - zero$1(this.dyn_ltree); - zero$1(this.dyn_dtree); - zero$1(this.bl_tree); + this.dyn_ltree = new Uint16Array(HEAP_SIZE * 2); + this.dyn_dtree = new Uint16Array((2 * D_CODES + 1) * 2); + this.bl_tree = new Uint16Array((2 * BL_CODES + 1) * 2); + zero(this.dyn_ltree); + zero(this.dyn_dtree); + zero(this.bl_tree); this.l_desc = null; /* desc. for literal tree */ this.d_desc = null; /* desc. for distance tree */ this.bl_desc = null; /* desc. for bit length tree */ //ush bl_count[MAX_BITS+1]; - this.bl_count = new Uint16Array(MAX_BITS$1 + 1); + this.bl_count = new Uint16Array(MAX_BITS + 1); /* number of codes at each bit length for an optimal tree */ //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ - this.heap = new Uint16Array(2 * L_CODES$1 + 1); /* heap used to build the Huffman trees */ - zero$1(this.heap); + this.heap = new Uint16Array(2 * L_CODES + 1); /* heap used to build the Huffman trees */ + zero(this.heap); this.heap_len = 0; /* number of elements in the heap */ this.heap_max = 0; /* element of largest frequency */ @@ -2645,8 +2645,8 @@ * The same heap array is used to build all trees. */ - this.depth = new Uint16Array(2 * L_CODES$1 + 1); //uch depth[2*L_CODES+1]; - zero$1(this.depth); + this.depth = new Uint16Array(2 * L_CODES + 1); //uch depth[2*L_CODES+1]; + zero(this.depth); /* Depth of each subtree used as tie breaker for trees of equal frequency */ @@ -2713,7 +2713,7 @@ } strm.total_in = strm.total_out = 0; - strm.data_type = Z_UNKNOWN$1; + strm.data_type = Z_UNKNOWN; const s = strm.state; s.pending = 0; @@ -2728,16 +2728,16 @@ 0 // crc32(0, Z_NULL, 0) : 1; // adler32(0, Z_NULL, 0) - s.last_flush = Z_NO_FLUSH; - _tr_init$1(s); - return Z_OK; + s.last_flush = Z_NO_FLUSH$1; + _tr_init(s); + return Z_OK$1; }; const deflateReset = (strm) => { const ret = deflateResetKeep(strm); - if (ret === Z_OK) { + if (ret === Z_OK$1) { lm_init(strm.state); } return ret; @@ -2749,7 +2749,7 @@ if (!strm || !strm.state) { return Z_STREAM_ERROR; } if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; } strm.state.gzhead = head; - return Z_OK; + return Z_OK$1; }; @@ -2760,7 +2760,7 @@ } let wrap = 1; - if (level === Z_DEFAULT_COMPRESSION) { + if (level === Z_DEFAULT_COMPRESSION$1) { level = 6; } @@ -2775,9 +2775,9 @@ } - if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED$1 || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_FIXED$1) { + strategy < 0 || strategy > Z_FIXED) { return err(strm, Z_STREAM_ERROR); } @@ -2801,7 +2801,7 @@ s.hash_bits = memLevel + 7; s.hash_size = 1 << s.hash_bits; s.hash_mask = s.hash_size - 1; - s.hash_shift = ~~((s.hash_bits + MIN_MATCH$1 - 1) / MIN_MATCH$1); + s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); s.window = new Uint8Array(s.w_size * 2); s.head = new Uint16Array(s.hash_size); @@ -2834,11 +2834,11 @@ const deflateInit = (strm, level) => { - return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); + return deflateInit2(strm, level, Z_DEFLATED$1, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY$1); }; - const deflate = (strm, flush) => { + const deflate$1 = (strm, flush) => { let beg, val; // for gzip header write only @@ -2851,7 +2851,7 @@ if (!strm.output || (!strm.input && strm.avail_in !== 0) || - (s.status === FINISH_STATE && flush !== Z_FINISH)) { + (s.status === FINISH_STATE && flush !== Z_FINISH$1)) { return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR); } @@ -2907,7 +2907,7 @@ } else // DEFLATE header { - let header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8; + let header = (Z_DEFLATED$1 + ((s.w_bits - 8) << 4)) << 8; let level_flags = -1; if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { @@ -3070,7 +3070,7 @@ * return OK instead of BUF_ERROR at next call of deflate: */ s.last_flush = -1; - return Z_OK; + return Z_OK$1; } /* Make sure there is something to do and avoid duplicate consecutive @@ -3078,7 +3078,7 @@ * returning Z_STREAM_END instead of Z_BUF_ERROR. */ } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && - flush !== Z_FINISH) { + flush !== Z_FINISH$1) { return err(strm, Z_BUF_ERROR); } @@ -3090,7 +3090,7 @@ /* Start a new block or continue the current one. */ if (strm.avail_in !== 0 || s.lookahead !== 0 || - (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) { + (flush !== Z_NO_FLUSH$1 && s.status !== FINISH_STATE)) { let bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) : (s.strategy === Z_RLE ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush)); @@ -3103,7 +3103,7 @@ s.last_flush = -1; /* avoid BUF_ERROR next call, see above */ } - return Z_OK; + return Z_OK$1; /* If flush != Z_NO_FLUSH && avail_out == 0, the next call * of deflate should use the same flush parameter to make sure * that the flush is complete. So we don't have to output an @@ -3114,17 +3114,17 @@ } if (bstate === BS_BLOCK_DONE) { if (flush === Z_PARTIAL_FLUSH) { - _tr_align$1(s); + _tr_align(s); } else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ - _tr_stored_block$1(s, 0, 0, false); + _tr_stored_block(s, 0, 0, false); /* For a full flush, this empty block will be recognized * as a special marker by inflate_sync(). */ - if (flush === Z_FULL_FLUSH) { + if (flush === Z_FULL_FLUSH$1) { /*** CLEAR_HASH(s); ***/ /* forget history */ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); if (s.lookahead === 0) { s.strstart = 0; @@ -3136,15 +3136,15 @@ flush_pending(strm); if (strm.avail_out === 0) { s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ - return Z_OK; + return Z_OK$1; } } } //Assert(strm->avail_out > 0, "bug2"); //if (strm.avail_out <= 0) { throw new Error("bug2");} - if (flush !== Z_FINISH) { return Z_OK; } - if (s.wrap <= 0) { return Z_STREAM_END; } + if (flush !== Z_FINISH$1) { return Z_OK$1; } + if (s.wrap <= 0) { return Z_STREAM_END$1; } /* Write the trailer */ if (s.wrap === 2) { @@ -3169,7 +3169,7 @@ */ if (s.wrap > 0) { s.wrap = -s.wrap; } /* write the trailer only once! */ - return s.pending !== 0 ? Z_OK : Z_STREAM_END; + return s.pending !== 0 ? Z_OK$1 : Z_STREAM_END$1; }; @@ -3193,7 +3193,7 @@ strm.state = null; - return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; + return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK$1; }; @@ -3228,7 +3228,7 @@ if (dictLength >= s.w_size) { if (wrap === 0) { /* already empty otherwise */ /*** CLEAR_HASH(s); ***/ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); s.strstart = 0; s.block_start = 0; s.insert = 0; @@ -3248,12 +3248,12 @@ strm.next_in = 0; strm.input = dictionary; fill_window(s); - while (s.lookahead >= MIN_MATCH$1) { + while (s.lookahead >= MIN_MATCH) { let str = s.strstart; - let n = s.lookahead - (MIN_MATCH$1 - 1); + let n = s.lookahead - (MIN_MATCH - 1); do { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]); s.prev[str & s.w_mask] = s.head[s.ins_h]; @@ -3261,20 +3261,20 @@ str++; } while (--n); s.strstart = str; - s.lookahead = MIN_MATCH$1 - 1; + s.lookahead = MIN_MATCH - 1; fill_window(s); } s.strstart += s.lookahead; s.block_start = s.strstart; s.insert = s.lookahead; s.lookahead = 0; - s.match_length = s.prev_length = MIN_MATCH$1 - 1; + s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; strm.next_in = next; strm.input = input; strm.avail_in = avail; s.wrap = wrap; - return Z_OK; + return Z_OK$1; }; @@ -3283,7 +3283,7 @@ var deflateReset_1 = deflateReset; var deflateResetKeep_1 = deflateResetKeep; var deflateSetHeader_1 = deflateSetHeader; - var deflate_2 = deflate; + var deflate_2$1 = deflate$1; var deflateEnd_1 = deflateEnd; var deflateSetDictionary_1 = deflateSetDictionary; var deflateInfo = 'pako deflate (from Nodeca project)'; @@ -3297,13 +3297,13 @@ module.exports.deflateTune = deflateTune; */ - var deflate_1 = { + var deflate_1$1 = { deflateInit: deflateInit_1, deflateInit2: deflateInit2_1, deflateReset: deflateReset_1, deflateResetKeep: deflateResetKeep_1, deflateSetHeader: deflateSetHeader_1, - deflate: deflate_2, + deflate: deflate_2$1, deflateEnd: deflateEnd_1, deflateSetDictionary: deflateSetDictionary_1, deflateInfo: deflateInfo @@ -3385,6 +3385,10 @@ // convert string to array (typed, when possible) var string2buf = (str) => { + if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) { + return new TextEncoder().encode(str); + } + let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; // count binary size @@ -3458,9 +3462,14 @@ // convert array to string var buf2string = (buf, max) => { - let i, out; const len = max || buf.length; + if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) { + return new TextDecoder().decode(buf.subarray(0, max)); + } + + let i, out; + // Reserve max possible length (2 words per char) // NB: by unknown reasons, Array is significantly faster for // String.fromCharCode.apply than Uint16Array. @@ -3583,12 +3592,12 @@ /* ===========================================================================*/ const { - Z_NO_FLUSH: Z_NO_FLUSH$1, Z_SYNC_FLUSH, Z_FULL_FLUSH: Z_FULL_FLUSH$1, Z_FINISH: Z_FINISH$1, - Z_OK: Z_OK$1, Z_STREAM_END: Z_STREAM_END$1, - Z_DEFAULT_COMPRESSION: Z_DEFAULT_COMPRESSION$1, - Z_DEFAULT_STRATEGY: Z_DEFAULT_STRATEGY$1, - Z_DEFLATED: Z_DEFLATED$1 - } = constants; + Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH, + Z_OK, Z_STREAM_END, + Z_DEFAULT_COMPRESSION, + Z_DEFAULT_STRATEGY, + Z_DEFLATED + } = constants$1; /* ===========================================================================*/ @@ -3680,12 +3689,12 @@ **/ function Deflate(options) { this.options = common.assign({ - level: Z_DEFAULT_COMPRESSION$1, - method: Z_DEFLATED$1, + level: Z_DEFAULT_COMPRESSION, + method: Z_DEFLATED, chunkSize: 16384, windowBits: 15, memLevel: 8, - strategy: Z_DEFAULT_STRATEGY$1 + strategy: Z_DEFAULT_STRATEGY }, options || {}); let opt = this.options; @@ -3706,7 +3715,7 @@ this.strm = new zstream(); this.strm.avail_out = 0; - let status = deflate_1.deflateInit2( + let status = deflate_1$1.deflateInit2( this.strm, opt.level, opt.method, @@ -3715,12 +3724,12 @@ opt.strategy ); - if (status !== Z_OK$1) { + if (status !== Z_OK) { throw new Error(messages[status]); } if (opt.header) { - deflate_1.deflateSetHeader(this.strm, opt.header); + deflate_1$1.deflateSetHeader(this.strm, opt.header); } if (opt.dictionary) { @@ -3735,9 +3744,9 @@ dict = opt.dictionary; } - status = deflate_1.deflateSetDictionary(this.strm, dict); + status = deflate_1$1.deflateSetDictionary(this.strm, dict); - if (status !== Z_OK$1) { + if (status !== Z_OK) { throw new Error(messages[status]); } @@ -3775,7 +3784,7 @@ if (this.ended) { return false; } if (flush_mode === ~~flush_mode) _flush_mode = flush_mode; - else _flush_mode = flush_mode === true ? Z_FINISH$1 : Z_NO_FLUSH$1; + else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH; // Convert data if needed if (typeof data === 'string') { @@ -3798,23 +3807,23 @@ } // Make sure avail_out > 6 to avoid repeating markers - if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH$1) && strm.avail_out <= 6) { + if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH) && strm.avail_out <= 6) { this.onData(strm.output.subarray(0, strm.next_out)); strm.avail_out = 0; continue; } - status = deflate_1.deflate(strm, _flush_mode); + status = deflate_1$1.deflate(strm, _flush_mode); // Ended => flush and finish - if (status === Z_STREAM_END$1) { + if (status === Z_STREAM_END) { if (strm.next_out > 0) { this.onData(strm.output.subarray(0, strm.next_out)); } - status = deflate_1.deflateEnd(this.strm); + status = deflate_1$1.deflateEnd(this.strm); this.onEnd(status); this.ended = true; - return status === Z_OK$1; + return status === Z_OK; } // Flush if out buffer full @@ -3860,7 +3869,7 @@ **/ Deflate.prototype.onEnd = function (status) { // On success - join - if (status === Z_OK$1) { + if (status === Z_OK) { this.result = common.flattenChunks(this.chunks); } this.chunks = []; @@ -3901,7 +3910,7 @@ * console.log(pako.deflate(data)); * ``` **/ - function deflate$1(input, options) { + function deflate(input, options) { const deflator = new Deflate(options); deflator.push(input, true); @@ -3924,7 +3933,7 @@ function deflateRaw(input, options) { options = options || {}; options.raw = true; - return deflate$1(input, options); + return deflate(input, options); } @@ -3939,28 +3948,28 @@ function gzip(input, options) { options = options || {}; options.gzip = true; - return deflate$1(input, options); + return deflate(input, options); } var Deflate_1 = Deflate; - var deflate_2$1 = deflate$1; + var deflate_2 = deflate; var deflateRaw_1 = deflateRaw; var gzip_1 = gzip; - var constants$1 = constants; + var constants = constants$1; - var deflate_1$1 = { + var deflate_1 = { Deflate: Deflate_1, - deflate: deflate_2$1, + deflate: deflate_2, deflateRaw: deflateRaw_1, gzip: gzip_1, - constants: constants$1 + constants: constants }; exports.Deflate = Deflate_1; - exports.constants = constants$1; - exports.default = deflate_1$1; - exports.deflate = deflate_2$1; + exports.constants = constants; + exports['default'] = deflate_1; + exports.deflate = deflate_2; exports.deflateRaw = deflateRaw_1; exports.gzip = gzip_1; diff --git a/dist/pako_deflate.min.js b/dist/pako_deflate.min.js index e944d91..5aefc9d 100644 --- a/dist/pako_deflate.min.js +++ b/dist/pako_deflate.min.js @@ -1,2 +1,2 @@ -/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).pako={})}(this,(function(t){"use strict";function e(t){let e=t.length;for(;--e>=0;)t[e]=0}const a=256,n=286,r=30,i=15,s=new Uint8Array([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]),_=new Uint8Array([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]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);e(o);const d=new Array(60);e(d);const u=new Array(512);e(u);const f=new Array(256);e(f);const c=new Array(29);e(c);const p=new Array(r);function g(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}let w,b,m;function v(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(p);const y=t=>t<256?u[t]:u[256+(t>>>7)],z=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},k=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<{k(t,a[2*e],a[2*e+1])},A=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},E=(t,e,a)=>{const n=new Array(16);let r,s,_=0;for(r=1;r<=i;r++)n[r]=_=_+a[r-1]<<1;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=A(n[e]++,e))}},Z=t=>{let e;for(e=0;e{t.bi_valid>8?z(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},U=(t,e,a,n)=>{const r=2*e,i=2*a;return t[r]{const n=t.heap[a];let r=a<<1;for(;r<=t.heap_len&&(r{let r,i,l,h,o=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],i=t.pending_buf[t.l_buf+o],o++,0===r?x(t,i,e):(l=f[i],x(t,l+a+1,e),h=s[l],0!==h&&(i-=c[l],k(t,i,h)),r--,l=y(r),x(t,l,n),h=_[l],0!==h&&(r-=p[l],k(t,r,h)))}while(o{const a=e.dyn_tree,n=e.stat_desc.static_tree,r=e.stat_desc.has_stree,s=e.stat_desc.elems;let _,l,h,o=-1;for(t.heap_len=0,t.heap_max=573,_=0;_>1;_>=1;_--)S(t,a,_);h=s;do{_=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,a,1),l=t.heap[1],t.heap[--t.heap_max]=_,t.heap[--t.heap_max]=l,a[2*h]=a[2*_]+a[2*l],t.depth[h]=(t.depth[_]>=t.depth[l]?t.depth[_]:t.depth[l])+1,a[2*_+1]=a[2*l+1]=h,t.heap[1]=h++,S(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,n=e.max_code,r=e.stat_desc.static_tree,s=e.stat_desc.has_stree,_=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,h=e.stat_desc.max_length;let o,d,u,f,c,p,g=0;for(f=0;f<=i;f++)t.bl_count[f]=0;for(a[2*t.heap[t.heap_max]+1]=0,o=t.heap_max+1;o<573;o++)d=t.heap[o],f=a[2*a[2*d+1]+1]+1,f>h&&(f=h,g++),a[2*d+1]=f,d>n||(t.bl_count[f]++,c=0,d>=l&&(c=_[d-l]),p=a[2*d],t.opt_len+=p*(f+c),s&&(t.static_len+=p*(r[2*d+1]+c)));if(0!==g){do{for(f=h-1;0===t.bl_count[f];)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[h]--,g-=2}while(g>0);for(f=h;0!==f;f--)for(d=t.bl_count[f];0!==d;)u=t.heap[--o],u>n||(a[2*u+1]!==f&&(t.opt_len+=(f-a[2*u+1])*a[2*u],a[2*u+1]=f),d--)}})(t,e),E(a,o,t.bl_count)},O=(t,e,a)=>{let n,r,i=-1,s=e[1],_=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++_{let n,r,i=-1,s=e[1],_=0,l=7,h=4;for(0===s&&(l=138,h=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++_{k(t,0+(n?1:0),3),((t,e,a,n)=>{R(t),n&&(z(t,a),z(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a})(t,e,a,!0)};var I={_tr_init:t=>{D||((()=>{let t,e,a,h,v;const y=new Array(16);for(a=0,h=0;h<28;h++)for(c[h]=a,t=0;t<1<>=7;h{let i,s,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e{let e;for(O(t,t.dyn_ltree,t.l_desc.max_code),O(t,t.dyn_dtree,t.d_desc.max_code),F(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),i=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==e?N(t,e,n,r):4===t.strategy||s===i?(k(t,2+(r?1:0),3),L(t,o,d)):(k(t,4+(r?1:0),3),((t,e,a,n)=>{let r;for(k(t,e-257,5),k(t,a-1,5),k(t,n-4,4),r=0;r(t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(f[n]+a+1)]++,t.dyn_dtree[2*y(e)]++),t.last_lit===t.lit_bufsize-1),_tr_align:t=>{k(t,2,3),x(t,256,o),(t=>{16===t.bi_valid?(z(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var C=(t,e,a,n)=>{let r=65535&t|0,i=t>>>16&65535|0,s=0;for(;0!==a;){s=a>2e3?2e3:a,a-=s;do{r=r+e[n++]|0,i=i+r|0}while(--s);r%=65521,i%=65521}return r|i<<16|0};const B=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var H=(t,e,a,n)=>{const r=B,i=n+a;t^=-1;for(let a=n;a>>8^r[255&(t^e[a])];return-1^t},M={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},P={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:j,_tr_stored_block:K,_tr_flush_block:Y,_tr_tally:G,_tr_align:X}=I,{Z_NO_FLUSH:W,Z_PARTIAL_FLUSH:q,Z_FULL_FLUSH:J,Z_FINISH:Q,Z_BLOCK:V,Z_OK:$,Z_STREAM_END:tt,Z_STREAM_ERROR:et,Z_DATA_ERROR:at,Z_BUF_ERROR:nt,Z_DEFAULT_COMPRESSION:rt,Z_FILTERED:it,Z_HUFFMAN_ONLY:st,Z_RLE:_t,Z_FIXED:lt,Z_DEFAULT_STRATEGY:ht,Z_UNKNOWN:ot,Z_DEFLATED:dt}=P,ut=258,ft=262,ct=103,pt=113,gt=666,wt=(t,e)=>(t.msg=M[e],e),bt=t=>(t<<1)-(t>4?9:0),mt=t=>{let e=t.length;for(;--e>=0;)t[e]=0};let vt=(t,e,a)=>(e<{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},zt=(t,e)=>{Y(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,yt(t.strm)},kt=(t,e)=>{t.pending_buf[t.pending++]=e},xt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},At=(t,e,a,n)=>{let r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=C(t.adler,e,r,a):2===t.state.wrap&&(t.adler=H(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},Et=(t,e)=>{let a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,_=t.nice_match;const l=t.strstart>t.w_size-ft?t.strstart-(t.w_size-ft):0,h=t.window,o=t.w_mask,d=t.prev,u=t.strstart+ut;let f=h[i+s-1],c=h[i+s];t.prev_length>=t.good_match&&(r>>=2),_>t.lookahead&&(_=t.lookahead);do{if(a=e,h[a+s]===c&&h[a+s-1]===f&&h[a]===h[i]&&h[++a]===h[i+1]){i+=2,a++;do{}while(h[++i]===h[++a]&&h[++i]===h[++a]&&h[++i]===h[++a]&&h[++i]===h[++a]&&h[++i]===h[++a]&&h[++i]===h[++a]&&h[++i]===h[++a]&&h[++i]===h[++a]&&is){if(t.match_start=e,s=n,n>=_)break;f=h[i+s-1],c=h[i+s]}}}while((e=d[e&o])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},Zt=t=>{const e=t.w_size;let a,n,r,i,s;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-ft)){t.window.set(t.window.subarray(e,e+e),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,n=t.hash_size,a=n;do{r=t.head[--a],t.head[a]=r>=e?r-e:0}while(--n);n=e,a=n;do{r=t.prev[--a],t.prev[a]=r>=e?r-e:0}while(--n);i+=e}if(0===t.strm.avail_in)break;if(n=At(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=n,t.lookahead+t.insert>=3)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=vt(t,t.ins_h,t.window[s+1]);t.insert&&(t.ins_h=vt(t,t.ins_h,t.window[s+3-1]),t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead{let a,n;for(;;){if(t.lookahead=3&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ft&&(t.match_length=Et(t,a)),t.match_length>=3)if(n=G(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=vt(t,t.ins_h,t.window[t.strstart+1]);else n=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2},Ut=(t,e)=>{let a,n,r;for(;;){if(t.lookahead=3&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=G(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(zt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(n=G(t,0,t.window[t.strstart-1]),n&&zt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=G(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2};function St(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}const Lt=[new St(0,0,0,0,((t,e)=>{let a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Zt(t),0===t.lookahead&&e===W)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,zt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-ft&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(zt(t,!1),t.strm.avail_out),1)})),new St(4,4,8,4,Rt),new St(4,5,16,8,Rt),new St(4,6,32,32,Rt),new St(4,4,16,16,Ut),new St(8,16,32,32,Ut),new St(8,16,128,128,Ut),new St(8,32,128,256,Ut),new St(32,128,258,1024,Ut),new St(32,258,258,4096,Ut)];function Ft(){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=dt,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 Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),mt(this.dyn_ltree),mt(this.dyn_dtree),mt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),mt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),mt(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}const Ot=t=>{if(!t||!t.state)return wt(t,et);t.total_in=t.total_out=0,t.data_type=ot;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:pt,t.adler=2===e.wrap?0:1,e.last_flush=W,j(e),$},Tt=t=>{const e=Ot(t);var a;return e===$&&((a=t.state).window_size=2*a.w_size,mt(a.head),a.max_lazy_match=Lt[a.level].max_lazy,a.good_match=Lt[a.level].good_length,a.nice_match=Lt[a.level].nice_length,a.max_chain_length=Lt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Dt=(t,e,a,n,r,i)=>{if(!t)return et;let s=1;if(e===rt&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==dt||n<8||n>15||e<0||e>9||i<0||i>lt)return wt(t,et);8===n&&(n=9);const _=new Ft;return t.state=_,_.strm=t,_.wrap=s,_.gzhead=null,_.w_bits=n,_.w_size=1<<_.w_bits,_.w_mask=_.w_size-1,_.hash_bits=r+7,_.hash_size=1<<_.hash_bits,_.hash_mask=_.hash_size-1,_.hash_shift=~~((_.hash_bits+3-1)/3),_.window=new Uint8Array(2*_.w_size),_.head=new Uint16Array(_.hash_size),_.prev=new Uint16Array(_.w_size),_.lit_bufsize=1<Dt(t,e,dt,15,8,ht),deflateInit2:Dt,deflateReset:Tt,deflateResetKeep:Ot,deflateSetHeader:(t,e)=>t&&t.state?2!==t.state.wrap?et:(t.state.gzhead=e,$):et,deflate:(t,e)=>{let a,n;if(!t||!t.state||e>V||e<0)return t?wt(t,et):et;const r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===gt&&e!==Q)return wt(t,0===t.avail_out?nt:et);r.strm=t;const i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,kt(r,31),kt(r,139),kt(r,8),r.gzhead?(kt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),kt(r,255&r.gzhead.time),kt(r,r.gzhead.time>>8&255),kt(r,r.gzhead.time>>16&255),kt(r,r.gzhead.time>>24&255),kt(r,9===r.level?2:r.strategy>=st||r.level<2?4:0),kt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(kt(r,255&r.gzhead.extra.length),kt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=H(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(kt(r,0),kt(r,0),kt(r,0),kt(r,0),kt(r,0),kt(r,9===r.level?2:r.strategy>=st||r.level<2?4:0),kt(r,3),r.status=pt);else{let e=dt+(r.w_bits-8<<4)<<8,a=-1;a=r.strategy>=st||r.level<2?0:r.level<6?1:6===r.level?2:3,e|=a<<6,0!==r.strstart&&(e|=32),e+=31-e%31,r.status=pt,xt(r,e),0!==r.strstart&&(xt(r,t.adler>>>16),xt(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),yt(t),a=r.pending,r.pending!==r.pending_buf_size));)kt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),yt(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindexa&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),yt(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindexa&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=ct)}else r.status=ct;if(r.status===ct&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&yt(t),r.pending+2<=r.pending_buf_size&&(kt(r,255&t.adler),kt(r,t.adler>>8&255),t.adler=0,r.status=pt)):r.status=pt),0!==r.pending){if(yt(t),0===t.avail_out)return r.last_flush=-1,$}else if(0===t.avail_in&&bt(e)<=bt(i)&&e!==Q)return wt(t,nt);if(r.status===gt&&0!==t.avail_in)return wt(t,nt);if(0!==t.avail_in||0!==r.lookahead||e!==W&&r.status!==gt){let a=r.strategy===st?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(Zt(t),0===t.lookahead)){if(e===W)return 1;break}if(t.match_length=0,a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2})(r,e):r.strategy===_t?((t,e)=>{let a,n,r,i;const s=t.window;for(;;){if(t.lookahead<=ut){if(Zt(t),t.lookahead<=ut&&e===W)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(r=t.strstart-1,n=s[r],n===s[++r]&&n===s[++r]&&n===s[++r])){i=t.strstart+ut;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&rt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=G(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2})(r,e):Lt[r.level].func(r,e);if(3!==a&&4!==a||(r.status=gt),1===a||3===a)return 0===t.avail_out&&(r.last_flush=-1),$;if(2===a&&(e===q?X(r):e!==V&&(K(r,0,0,!1),e===J&&(mt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),yt(t),0===t.avail_out))return r.last_flush=-1,$}return e!==Q?$:r.wrap<=0?tt:(2===r.wrap?(kt(r,255&t.adler),kt(r,t.adler>>8&255),kt(r,t.adler>>16&255),kt(r,t.adler>>24&255),kt(r,255&t.total_in),kt(r,t.total_in>>8&255),kt(r,t.total_in>>16&255),kt(r,t.total_in>>24&255)):(xt(r,t.adler>>>16),xt(r,65535&t.adler)),yt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?$:tt)},deflateEnd:t=>{if(!t||!t.state)return et;const e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==ct&&e!==pt&&e!==gt?wt(t,et):(t.state=null,e===pt?wt(t,at):$)},deflateSetDictionary:(t,e)=>{let a=e.length;if(!t||!t.state)return et;const n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return et;if(1===r&&(t.adler=C(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(mt(n.head),n.strstart=0,n.block_start=0,n.insert=0);let t=new Uint8Array(n.w_size);t.set(e.subarray(a-n.w_size,a),0),e=t,a=n.w_size}const i=t.avail_in,s=t.next_in,_=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Zt(n);n.lookahead>=3;){let t=n.strstart,e=n.lookahead-2;do{n.ins_h=vt(n,n.ins_h,n.window[t+3-1]),n.prev[t&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=t,t++}while(--e);n.strstart=t,n.lookahead=2,Zt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=s,t.input=_,t.avail_in=i,n.wrap=r,$},deflateInfo:"pako deflate (from Nodeca project)"};const It=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Ct=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const e in a)It(a,e)&&(t[e]=a[e])}}return t},Bt=t=>{let e=0;for(let a=0,n=t.length;a=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Mt[254]=Mt[254]=1;var Pt=t=>{let e,a,n,r,i,s=t.length,_=0;for(r=0;r>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e};var jt=function(){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};const Kt=Object.prototype.toString,{Z_NO_FLUSH:Yt,Z_SYNC_FLUSH:Gt,Z_FULL_FLUSH:Xt,Z_FINISH:Wt,Z_OK:qt,Z_STREAM_END:Jt,Z_DEFAULT_COMPRESSION:Qt,Z_DEFAULT_STRATEGY:Vt,Z_DEFLATED:$t}=P;function te(t){this.options=Ct({level:Qt,method:$t,chunkSize:16384,windowBits:15,memLevel:8,strategy:Vt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jt,this.strm.avail_out=0;let a=Nt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==qt)throw new Error(M[a]);if(e.header&&Nt.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Pt(e.dictionary):"[object ArrayBuffer]"===Kt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=Nt.deflateSetDictionary(this.strm,t),a!==qt)throw new Error(M[a]);this._dict_set=!0}}function ee(t,e){const a=new te(e);if(a.push(t,!0),a.err)throw a.msg||M[a.err];return a.result}te.prototype.push=function(t,e){const a=this.strm,n=this.options.chunkSize;let r,i;if(this.ended)return!1;for(i=e===~~e?e:!0===e?Wt:Yt,"string"==typeof t?a.input=Pt(t):"[object ArrayBuffer]"===Kt.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(n),a.next_out=0,a.avail_out=n),(i===Gt||i===Xt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(r=Nt.deflate(a,i),r===Jt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),r=Nt.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===qt;if(0!==a.avail_out){if(i>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},te.prototype.onData=function(t){this.chunks.push(t)},te.prototype.onEnd=function(t){t===qt&&(this.result=Bt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var ae=te,ne=ee,re=function(t,e){return(e=e||{}).raw=!0,ee(t,e)},ie=function(t,e){return(e=e||{}).gzip=!0,ee(t,e)},se=P,_e={Deflate:ae,deflate:ne,deflateRaw:re,gzip:ie,constants:se};t.Deflate=ae,t.constants=se,t.default=_e,t.deflate=ne,t.deflateRaw=re,t.gzip=ie,Object.defineProperty(t,"__esModule",{value:!0})})); +/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).pako={})}(this,(function(t){"use strict";function e(t){let e=t.length;for(;--e>=0;)t[e]=0}const a=256,n=286,r=30,i=15,s=new Uint8Array([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]),_=new Uint8Array([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]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);e(o);const d=new Array(60);e(d);const u=new Array(512);e(u);const f=new Array(256);e(f);const c=new Array(29);e(c);const p=new Array(r);function g(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}let w,b,m;function v(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(p);const y=t=>t<256?u[t]:u[256+(t>>>7)],z=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},k=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<{k(t,a[2*e],a[2*e+1])},A=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},E=(t,e,a)=>{const n=new Array(16);let r,s,_=0;for(r=1;r<=i;r++)n[r]=_=_+a[r-1]<<1;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=A(n[e]++,e))}},Z=t=>{let e;for(e=0;e{t.bi_valid>8?z(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},U=(t,e,a,n)=>{const r=2*e,i=2*a;return t[r]{const n=t.heap[a];let r=a<<1;for(;r<=t.heap_len&&(r{let r,i,l,h,o=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],i=t.pending_buf[t.l_buf+o],o++,0===r?x(t,i,e):(l=f[i],x(t,l+a+1,e),h=s[l],0!==h&&(i-=c[l],k(t,i,h)),r--,l=y(r),x(t,l,n),h=_[l],0!==h&&(r-=p[l],k(t,r,h)))}while(o{const a=e.dyn_tree,n=e.stat_desc.static_tree,r=e.stat_desc.has_stree,s=e.stat_desc.elems;let _,l,h,o=-1;for(t.heap_len=0,t.heap_max=573,_=0;_>1;_>=1;_--)S(t,a,_);h=s;do{_=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,a,1),l=t.heap[1],t.heap[--t.heap_max]=_,t.heap[--t.heap_max]=l,a[2*h]=a[2*_]+a[2*l],t.depth[h]=(t.depth[_]>=t.depth[l]?t.depth[_]:t.depth[l])+1,a[2*_+1]=a[2*l+1]=h,t.heap[1]=h++,S(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,n=e.max_code,r=e.stat_desc.static_tree,s=e.stat_desc.has_stree,_=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,h=e.stat_desc.max_length;let o,d,u,f,c,p,g=0;for(f=0;f<=i;f++)t.bl_count[f]=0;for(a[2*t.heap[t.heap_max]+1]=0,o=t.heap_max+1;o<573;o++)d=t.heap[o],f=a[2*a[2*d+1]+1]+1,f>h&&(f=h,g++),a[2*d+1]=f,d>n||(t.bl_count[f]++,c=0,d>=l&&(c=_[d-l]),p=a[2*d],t.opt_len+=p*(f+c),s&&(t.static_len+=p*(r[2*d+1]+c)));if(0!==g){do{for(f=h-1;0===t.bl_count[f];)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[h]--,g-=2}while(g>0);for(f=h;0!==f;f--)for(d=t.bl_count[f];0!==d;)u=t.heap[--o],u>n||(a[2*u+1]!==f&&(t.opt_len+=(f-a[2*u+1])*a[2*u],a[2*u+1]=f),d--)}})(t,e),E(a,o,t.bl_count)},F=(t,e,a)=>{let n,r,i=-1,s=e[1],_=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++_{let n,r,i=-1,s=e[1],_=0,l=7,h=4;for(0===s&&(l=138,h=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++_{k(t,0+(n?1:0),3),((t,e,a,n)=>{R(t),n&&(z(t,a),z(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a})(t,e,a,!0)};var I={_tr_init:t=>{D||((()=>{let t,e,a,h,v;const y=new Array(16);for(a=0,h=0;h<28;h++)for(c[h]=a,t=0;t<1<>=7;h{let i,s,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e{let e;for(F(t,t.dyn_ltree,t.l_desc.max_code),F(t,t.dyn_dtree,t.d_desc.max_code),L(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),i=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==e?N(t,e,n,r):4===t.strategy||s===i?(k(t,2+(r?1:0),3),T(t,o,d)):(k(t,4+(r?1:0),3),((t,e,a,n)=>{let r;for(k(t,e-257,5),k(t,a-1,5),k(t,n-4,4),r=0;r(t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(f[n]+a+1)]++,t.dyn_dtree[2*y(e)]++),t.last_lit===t.lit_bufsize-1),_tr_align:t=>{k(t,2,3),x(t,256,o),(t=>{16===t.bi_valid?(z(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var C=(t,e,a,n)=>{let r=65535&t|0,i=t>>>16&65535|0,s=0;for(;0!==a;){s=a>2e3?2e3:a,a-=s;do{r=r+e[n++]|0,i=i+r|0}while(--s);r%=65521,i%=65521}return r|i<<16|0};const B=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var H=(t,e,a,n)=>{const r=B,i=n+a;t^=-1;for(let a=n;a>>8^r[255&(t^e[a])];return-1^t},M={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},P={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:j,_tr_stored_block:K,_tr_flush_block:Y,_tr_tally:G,_tr_align:X}=I,{Z_NO_FLUSH:W,Z_PARTIAL_FLUSH:q,Z_FULL_FLUSH:J,Z_FINISH:Q,Z_BLOCK:V,Z_OK:$,Z_STREAM_END:tt,Z_STREAM_ERROR:et,Z_DATA_ERROR:at,Z_BUF_ERROR:nt,Z_DEFAULT_COMPRESSION:rt,Z_FILTERED:it,Z_HUFFMAN_ONLY:st,Z_RLE:_t,Z_FIXED:lt,Z_DEFAULT_STRATEGY:ht,Z_UNKNOWN:ot,Z_DEFLATED:dt}=P,ut=258,ft=262,ct=103,pt=113,gt=666,wt=(t,e)=>(t.msg=M[e],e),bt=t=>(t<<1)-(t>4?9:0),mt=t=>{let e=t.length;for(;--e>=0;)t[e]=0};let vt=(t,e,a)=>(e<{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},zt=(t,e)=>{Y(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,yt(t.strm)},kt=(t,e)=>{t.pending_buf[t.pending++]=e},xt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},At=(t,e,a,n)=>{let r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=C(t.adler,e,r,a):2===t.state.wrap&&(t.adler=H(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},Et=(t,e)=>{let a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,_=t.nice_match;const l=t.strstart>t.w_size-ft?t.strstart-(t.w_size-ft):0,h=t.window,o=t.w_mask,d=t.prev,u=t.strstart+ut;let f=h[i+s-1],c=h[i+s];t.prev_length>=t.good_match&&(r>>=2),_>t.lookahead&&(_=t.lookahead);do{if(a=e,h[a+s]===c&&h[a+s-1]===f&&h[a]===h[i]&&h[++a]===h[i+1]){i+=2,a++;do{}while(h[++i]===h[++a]&&h[++i]===h[++a]&&h[++i]===h[++a]&&h[++i]===h[++a]&&h[++i]===h[++a]&&h[++i]===h[++a]&&h[++i]===h[++a]&&h[++i]===h[++a]&&is){if(t.match_start=e,s=n,n>=_)break;f=h[i+s-1],c=h[i+s]}}}while((e=d[e&o])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},Zt=t=>{const e=t.w_size;let a,n,r,i,s;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-ft)){t.window.set(t.window.subarray(e,e+e),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,n=t.hash_size,a=n;do{r=t.head[--a],t.head[a]=r>=e?r-e:0}while(--n);n=e,a=n;do{r=t.prev[--a],t.prev[a]=r>=e?r-e:0}while(--n);i+=e}if(0===t.strm.avail_in)break;if(n=At(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=n,t.lookahead+t.insert>=3)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=vt(t,t.ins_h,t.window[s+1]);t.insert&&(t.ins_h=vt(t,t.ins_h,t.window[s+3-1]),t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead{let a,n;for(;;){if(t.lookahead=3&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ft&&(t.match_length=Et(t,a)),t.match_length>=3)if(n=G(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=vt(t,t.ins_h,t.window[t.strstart+1]);else n=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2},Ut=(t,e)=>{let a,n,r;for(;;){if(t.lookahead=3&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=G(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(zt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(n=G(t,0,t.window[t.strstart-1]),n&&zt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=G(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2};function St(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}const Tt=[new St(0,0,0,0,((t,e)=>{let a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Zt(t),0===t.lookahead&&e===W)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,zt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-ft&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(zt(t,!1),t.strm.avail_out),1)})),new St(4,4,8,4,Rt),new St(4,5,16,8,Rt),new St(4,6,32,32,Rt),new St(4,4,16,16,Ut),new St(8,16,32,32,Ut),new St(8,16,128,128,Ut),new St(8,32,128,256,Ut),new St(32,128,258,1024,Ut),new St(32,258,258,4096,Ut)];function Lt(){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=dt,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 Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),mt(this.dyn_ltree),mt(this.dyn_dtree),mt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),mt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),mt(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}const Ft=t=>{if(!t||!t.state)return wt(t,et);t.total_in=t.total_out=0,t.data_type=ot;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:pt,t.adler=2===e.wrap?0:1,e.last_flush=W,j(e),$},Ot=t=>{const e=Ft(t);var a;return e===$&&((a=t.state).window_size=2*a.w_size,mt(a.head),a.max_lazy_match=Tt[a.level].max_lazy,a.good_match=Tt[a.level].good_length,a.nice_match=Tt[a.level].nice_length,a.max_chain_length=Tt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Dt=(t,e,a,n,r,i)=>{if(!t)return et;let s=1;if(e===rt&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==dt||n<8||n>15||e<0||e>9||i<0||i>lt)return wt(t,et);8===n&&(n=9);const _=new Lt;return t.state=_,_.strm=t,_.wrap=s,_.gzhead=null,_.w_bits=n,_.w_size=1<<_.w_bits,_.w_mask=_.w_size-1,_.hash_bits=r+7,_.hash_size=1<<_.hash_bits,_.hash_mask=_.hash_size-1,_.hash_shift=~~((_.hash_bits+3-1)/3),_.window=new Uint8Array(2*_.w_size),_.head=new Uint16Array(_.hash_size),_.prev=new Uint16Array(_.w_size),_.lit_bufsize=1<Dt(t,e,dt,15,8,ht),deflateInit2:Dt,deflateReset:Ot,deflateResetKeep:Ft,deflateSetHeader:(t,e)=>t&&t.state?2!==t.state.wrap?et:(t.state.gzhead=e,$):et,deflate:(t,e)=>{let a,n;if(!t||!t.state||e>V||e<0)return t?wt(t,et):et;const r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===gt&&e!==Q)return wt(t,0===t.avail_out?nt:et);r.strm=t;const i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,kt(r,31),kt(r,139),kt(r,8),r.gzhead?(kt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),kt(r,255&r.gzhead.time),kt(r,r.gzhead.time>>8&255),kt(r,r.gzhead.time>>16&255),kt(r,r.gzhead.time>>24&255),kt(r,9===r.level?2:r.strategy>=st||r.level<2?4:0),kt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(kt(r,255&r.gzhead.extra.length),kt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=H(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(kt(r,0),kt(r,0),kt(r,0),kt(r,0),kt(r,0),kt(r,9===r.level?2:r.strategy>=st||r.level<2?4:0),kt(r,3),r.status=pt);else{let e=dt+(r.w_bits-8<<4)<<8,a=-1;a=r.strategy>=st||r.level<2?0:r.level<6?1:6===r.level?2:3,e|=a<<6,0!==r.strstart&&(e|=32),e+=31-e%31,r.status=pt,xt(r,e),0!==r.strstart&&(xt(r,t.adler>>>16),xt(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),yt(t),a=r.pending,r.pending!==r.pending_buf_size));)kt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),yt(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindexa&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),yt(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindexa&&(t.adler=H(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=ct)}else r.status=ct;if(r.status===ct&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&yt(t),r.pending+2<=r.pending_buf_size&&(kt(r,255&t.adler),kt(r,t.adler>>8&255),t.adler=0,r.status=pt)):r.status=pt),0!==r.pending){if(yt(t),0===t.avail_out)return r.last_flush=-1,$}else if(0===t.avail_in&&bt(e)<=bt(i)&&e!==Q)return wt(t,nt);if(r.status===gt&&0!==t.avail_in)return wt(t,nt);if(0!==t.avail_in||0!==r.lookahead||e!==W&&r.status!==gt){let a=r.strategy===st?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(Zt(t),0===t.lookahead)){if(e===W)return 1;break}if(t.match_length=0,a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2})(r,e):r.strategy===_t?((t,e)=>{let a,n,r,i;const s=t.window;for(;;){if(t.lookahead<=ut){if(Zt(t),t.lookahead<=ut&&e===W)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(r=t.strstart-1,n=s[r],n===s[++r]&&n===s[++r]&&n===s[++r])){i=t.strstart+ut;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&rt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=G(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2})(r,e):Tt[r.level].func(r,e);if(3!==a&&4!==a||(r.status=gt),1===a||3===a)return 0===t.avail_out&&(r.last_flush=-1),$;if(2===a&&(e===q?X(r):e!==V&&(K(r,0,0,!1),e===J&&(mt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),yt(t),0===t.avail_out))return r.last_flush=-1,$}return e!==Q?$:r.wrap<=0?tt:(2===r.wrap?(kt(r,255&t.adler),kt(r,t.adler>>8&255),kt(r,t.adler>>16&255),kt(r,t.adler>>24&255),kt(r,255&t.total_in),kt(r,t.total_in>>8&255),kt(r,t.total_in>>16&255),kt(r,t.total_in>>24&255)):(xt(r,t.adler>>>16),xt(r,65535&t.adler)),yt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?$:tt)},deflateEnd:t=>{if(!t||!t.state)return et;const e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==ct&&e!==pt&&e!==gt?wt(t,et):(t.state=null,e===pt?wt(t,at):$)},deflateSetDictionary:(t,e)=>{let a=e.length;if(!t||!t.state)return et;const n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return et;if(1===r&&(t.adler=C(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(mt(n.head),n.strstart=0,n.block_start=0,n.insert=0);let t=new Uint8Array(n.w_size);t.set(e.subarray(a-n.w_size,a),0),e=t,a=n.w_size}const i=t.avail_in,s=t.next_in,_=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Zt(n);n.lookahead>=3;){let t=n.strstart,e=n.lookahead-2;do{n.ins_h=vt(n,n.ins_h,n.window[t+3-1]),n.prev[t&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=t,t++}while(--e);n.strstart=t,n.lookahead=2,Zt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=s,t.input=_,t.avail_in=i,n.wrap=r,$},deflateInfo:"pako deflate (from Nodeca project)"};const It=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Ct=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const e in a)It(a,e)&&(t[e]=a[e])}}return t},Bt=t=>{let e=0;for(let a=0,n=t.length;a=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Mt[254]=Mt[254]=1;var Pt=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,_=0;for(r=0;r>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e};var jt=function(){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};const Kt=Object.prototype.toString,{Z_NO_FLUSH:Yt,Z_SYNC_FLUSH:Gt,Z_FULL_FLUSH:Xt,Z_FINISH:Wt,Z_OK:qt,Z_STREAM_END:Jt,Z_DEFAULT_COMPRESSION:Qt,Z_DEFAULT_STRATEGY:Vt,Z_DEFLATED:$t}=P;function te(t){this.options=Ct({level:Qt,method:$t,chunkSize:16384,windowBits:15,memLevel:8,strategy:Vt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jt,this.strm.avail_out=0;let a=Nt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==qt)throw new Error(M[a]);if(e.header&&Nt.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Pt(e.dictionary):"[object ArrayBuffer]"===Kt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=Nt.deflateSetDictionary(this.strm,t),a!==qt)throw new Error(M[a]);this._dict_set=!0}}function ee(t,e){const a=new te(e);if(a.push(t,!0),a.err)throw a.msg||M[a.err];return a.result}te.prototype.push=function(t,e){const a=this.strm,n=this.options.chunkSize;let r,i;if(this.ended)return!1;for(i=e===~~e?e:!0===e?Wt:Yt,"string"==typeof t?a.input=Pt(t):"[object ArrayBuffer]"===Kt.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(n),a.next_out=0,a.avail_out=n),(i===Gt||i===Xt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(r=Nt.deflate(a,i),r===Jt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),r=Nt.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===qt;if(0!==a.avail_out){if(i>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},te.prototype.onData=function(t){this.chunks.push(t)},te.prototype.onEnd=function(t){t===qt&&(this.result=Bt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var ae=te,ne=ee,re=function(t,e){return(e=e||{}).raw=!0,ee(t,e)},ie=function(t,e){return(e=e||{}).gzip=!0,ee(t,e)},se=P,_e={Deflate:ae,deflate:ne,deflateRaw:re,gzip:ie,constants:se};t.Deflate=ae,t.constants=se,t.default=_e,t.deflate=ne,t.deflateRaw=re,t.gzip=ie,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/dist/pako_inflate.es5.js b/dist/pako_inflate.es5.js index b16e179..c857e12 100644 --- a/dist/pako_inflate.es5.js +++ b/dist/pako_inflate.es5.js @@ -1,5 +1,5 @@ -/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */ +/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : @@ -128,10 +128,10 @@ // 3. This notice may not be removed or altered from any source distribution. // See state defs from inflate.js - var BAD = 30; + var BAD$1 = 30; /* got a data error -- remain here until reset */ - var TYPE = 12; + var TYPE$1 = 12; /* i: waiting for type bits, including last-flag bit */ /* @@ -362,7 +362,7 @@ if (dist > dmax) { strm.msg = 'invalid distance too far back'; - state.mode = BAD; + state.mode = BAD$1; break top; } //#endif @@ -381,7 +381,7 @@ if (op > whave) { if (state.sane) { strm.msg = 'invalid distance too far back'; - state.mode = BAD; + state.mode = BAD$1; break top; } // (!) This block is disabled in zlib defaults, // don't enable it for binary compatibility @@ -513,13 +513,11 @@ } } else if ((op & 64) === 0) { /* 2nd level distance code */ - here = dcode[(here & 0xffff) + ( - /*here.val*/ - hold & (1 << op) - 1)]; + here = dcode[(here & 0xffff) + (hold & (1 << op) - 1)]; continue dodist; } else { strm.msg = 'invalid distance code'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -527,18 +525,16 @@ } } else if ((op & 64) === 0) { /* 2nd level length code */ - here = lcode[(here & 0xffff) + ( - /*here.val*/ - hold & (1 << op) - 1)]; + here = lcode[(here & 0xffff) + (hold & (1 << op) - 1)]; continue dolen; } else if (op & 32) { /* end-of-block */ //Tracevv((stderr, "inflate: end of block\n")); - state.mode = TYPE; + state.mode = TYPE$1; break top; } else { strm.msg = 'invalid literal/length code'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -582,12 +578,12 @@ // 3. This notice may not be removed or altered from any source distribution. var MAXBITS = 15; - var ENOUGH_LENS = 852; - var ENOUGH_DISTS = 592; //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + var ENOUGH_LENS$1 = 852; + var ENOUGH_DISTS$1 = 592; //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); - var CODES = 0; - var LENS = 1; - var DISTS = 2; + var CODES$1 = 0; + var LENS$1 = 1; + var DISTS$1 = 2; var lbase = new Uint16Array([ /* Length codes 257..285 base */ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0]); @@ -754,7 +750,7 @@ } - if (left > 0 && (type === CODES || max !== 1)) { + if (left > 0 && (type === CODES$1 || max !== 1)) { return -1; /* incomplete set */ } @@ -806,12 +802,12 @@ // to avoid deopts in old v8 - if (type === CODES) { + if (type === CODES$1) { base = extra = work; /* dummy value--not used */ end = 19; - } else if (type === LENS) { + } else if (type === LENS$1) { base = lbase; base_index -= 257; extra = lext; @@ -855,7 +851,7 @@ /* check available table space */ - if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) { + if (type === LENS$1 && used > ENOUGH_LENS$1 || type === DISTS$1 && used > ENOUGH_DISTS$1) { return 1; } /* process all codes and make table entries */ @@ -950,7 +946,7 @@ used += 1 << curr; - if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) { + if (type === LENS$1 && used > ENOUGH_LENS$1 || type === DISTS$1 && used > ENOUGH_DISTS$1) { return 1; } /* point entry in root table to sub-table */ @@ -1003,7 +999,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. - var constants = { + var constants$1 = { /* Allowed flush values; see deflate() and inflate() below for details */ Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, @@ -1067,24 +1063,24 @@ // 3. This notice may not be removed or altered from any source distribution. - var CODES$1 = 0; - var LENS$1 = 1; - var DISTS$1 = 2; + var CODES = 0; + var LENS = 1; + var DISTS = 2; /* Public constants ==========================================================*/ /* ===========================================================================*/ - var Z_FINISH = constants.Z_FINISH, - Z_BLOCK = constants.Z_BLOCK, - Z_TREES = constants.Z_TREES, - Z_OK = constants.Z_OK, - Z_STREAM_END = constants.Z_STREAM_END, - Z_NEED_DICT = constants.Z_NEED_DICT, - Z_STREAM_ERROR = constants.Z_STREAM_ERROR, - Z_DATA_ERROR = constants.Z_DATA_ERROR, - Z_MEM_ERROR = constants.Z_MEM_ERROR, - Z_BUF_ERROR = constants.Z_BUF_ERROR, - Z_DEFLATED = constants.Z_DEFLATED; + var Z_FINISH$1 = constants$1.Z_FINISH, + Z_BLOCK = constants$1.Z_BLOCK, + Z_TREES = constants$1.Z_TREES, + Z_OK$1 = constants$1.Z_OK, + Z_STREAM_END$1 = constants$1.Z_STREAM_END, + Z_NEED_DICT$1 = constants$1.Z_NEED_DICT, + Z_STREAM_ERROR$1 = constants$1.Z_STREAM_ERROR, + Z_DATA_ERROR$1 = constants$1.Z_DATA_ERROR, + Z_MEM_ERROR$1 = constants$1.Z_MEM_ERROR, + Z_BUF_ERROR = constants$1.Z_BUF_ERROR, + Z_DEFLATED = constants$1.Z_DEFLATED; /* STATES ====================================================================*/ /* ===========================================================================*/ @@ -1122,7 +1118,7 @@ var DICT = 11; /* waiting for inflateSetDictionary() call */ - var TYPE$1 = 12; + var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ var TYPEDO = 13; @@ -1176,7 +1172,7 @@ var DONE = 29; /* finished check, done -- remain here until reset */ - var BAD$1 = 30; + var BAD = 30; /* got a data error -- remain here until reset */ var MEM = 31; @@ -1187,8 +1183,8 @@ /* ===========================================================================*/ - var ENOUGH_LENS$1 = 852; - var ENOUGH_DISTS$1 = 592; //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + var ENOUGH_LENS = 852; + var ENOUGH_DISTS = 592; //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); var MAX_WBITS = 15; /* 32K LZ77 window */ @@ -1327,7 +1323,7 @@ var inflateResetKeep = function inflateResetKeep(strm) { if (!strm || !strm.state) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$1; } var state = strm.state; @@ -1350,17 +1346,17 @@ state.hold = 0; state.bits = 0; //state.lencode = state.distcode = state.next = state.codes; - state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS$1); - state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS$1); + state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS); + state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS); state.sane = 1; state.back = -1; //Tracev((stderr, "inflate: reset\n")); - return Z_OK; + return Z_OK$1; }; var inflateReset = function inflateReset(strm) { if (!strm || !strm.state) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$1; } var state = strm.state; @@ -1375,7 +1371,7 @@ /* get the state */ if (!strm || !strm.state) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$1; } var state = strm.state; @@ -1395,7 +1391,7 @@ if (windowBits && (windowBits < 8 || windowBits > 15)) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$1; } if (state.window !== null && state.wbits !== windowBits) { @@ -1411,7 +1407,7 @@ var inflateInit2 = function inflateInit2(strm, windowBits) { if (!strm) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$1; } //strm.msg = Z_NULL; /* in case we return an error */ @@ -1424,7 +1420,7 @@ ; var ret = inflateReset2(strm, windowBits); - if (ret !== Z_OK) { + if (ret !== Z_OK$1) { strm.state = null /*Z_NULL*/ ; @@ -1476,7 +1472,7 @@ state.lens[sym++] = 8; } - inftrees(LENS$1, state.lens, 0, 288, lenfix, 0, state.work, { + inftrees(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); /* distance table */ @@ -1487,7 +1483,7 @@ state.lens[sym++] = 5; } - inftrees(DISTS$1, state.lens, 0, 32, distfix, 0, state.work, { + inftrees(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); /* do this just once */ @@ -1566,7 +1562,7 @@ return 0; }; - var inflate = function inflate(strm, flush) { + var inflate$1 = function inflate(strm, flush) { var state; var input, output; // input/output buffers @@ -1621,12 +1617,12 @@ new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$1; } state = strm.state; - if (state.mode === TYPE$1) { + if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ @@ -1644,7 +1640,7 @@ _in = have; _out = left; - ret = Z_OK; + ret = Z_OK$1; inf_leave: // goto emulation for (;;) { @@ -1694,19 +1690,15 @@ if (!(state.wrap & 1) || /* check if zlib header allowed */ - (((hold & 0xff) << - /*BITS(8)*/ - 8) + (hold >> 8)) % 31) { + (((hold & 0xff) << 8) + (hold >> 8)) % 31) { strm.msg = 'incorrect header check'; - state.mode = BAD$1; + state.mode = BAD; break; } - if ((hold & 0x0f) !== - /*BITS(4)*/ - Z_DEFLATED) { + if ((hold & 0x0f) !== Z_DEFLATED) { strm.msg = 'unknown compression method'; - state.mode = BAD$1; + state.mode = BAD; break; } //--- DROPBITS(4) ---// @@ -1714,15 +1706,13 @@ hold >>>= 4; bits -= 4; //---// - len = (hold & 0x0f) + - /*BITS(4)*/ - 8; + len = (hold & 0x0f) + 8; if (state.wbits === 0) { state.wbits = len; } else if (len > state.wbits) { strm.msg = 'invalid window size'; - state.mode = BAD$1; + state.mode = BAD; break; } // !!! pako patch. Force use `options.windowBits` if passed. // Required to always use max window size by default. @@ -1734,7 +1724,7 @@ strm.adler = state.check = 1 /*adler32(0L, Z_NULL, 0)*/ ; - state.mode = hold & 0x200 ? DICTID : TYPE$1; //=== INITBITS(); + state.mode = hold & 0x200 ? DICTID : TYPE; //=== INITBITS(); hold = 0; bits = 0; //===// @@ -1758,13 +1748,13 @@ if ((state.flags & 0xff) !== Z_DEFLATED) { strm.msg = 'unknown compression method'; - state.mode = BAD$1; + state.mode = BAD; break; } if (state.flags & 0xe000) { strm.msg = 'unknown header flags set'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -2031,7 +2021,7 @@ if (hold !== (state.check & 0xffff)) { strm.msg = 'header crc mismatch'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -2046,7 +2036,7 @@ } strm.adler = state.check = 0; - state.mode = TYPE$1; + state.mode = TYPE; break; case DICTID: @@ -2081,17 +2071,17 @@ state.hold = hold; state.bits = bits; //--- - return Z_NEED_DICT; + return Z_NEED_DICT$1; } strm.adler = state.check = 1 /*adler32(0L, Z_NULL, 0)*/ ; - state.mode = TYPE$1; + state.mode = TYPE; /* falls through */ - case TYPE$1: + case TYPE: if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } @@ -2128,7 +2118,6 @@ bits -= 1; //---// switch (hold & 0x03) { - /*BITS(2)*/ case 0: /* stored block */ //Tracev((stderr, "inflate: stored block%s\n", @@ -2163,7 +2152,7 @@ case 3: strm.msg = 'invalid block type'; - state.mode = BAD$1; + state.mode = BAD; } //--- DROPBITS(2) ---// @@ -2191,7 +2180,7 @@ if ((hold & 0xffff) !== (hold >>> 16 ^ 0xffff)) { strm.msg = 'invalid stored block lengths'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -2243,7 +2232,7 @@ } //Tracev((stderr, "inflate: stored end\n")); - state.mode = TYPE$1; + state.mode = TYPE; break; case TABLE: @@ -2259,23 +2248,17 @@ } //===// - state.nlen = (hold & 0x1f) + - /*BITS(5)*/ - 257; //--- DROPBITS(5) ---// + state.nlen = (hold & 0x1f) + 257; //--- DROPBITS(5) ---// hold >>>= 5; bits -= 5; //---// - state.ndist = (hold & 0x1f) + - /*BITS(5)*/ - 1; //--- DROPBITS(5) ---// + state.ndist = (hold & 0x1f) + 1; //--- DROPBITS(5) ---// hold >>>= 5; bits -= 5; //---// - state.ncode = (hold & 0x0f) + - /*BITS(4)*/ - 4; //--- DROPBITS(4) ---// + state.ncode = (hold & 0x0f) + 4; //--- DROPBITS(4) ---// hold >>>= 4; bits -= 4; //---// @@ -2283,7 +2266,7 @@ if (state.nlen > 286 || state.ndist > 30) { strm.msg = 'too many length or distance symbols'; - state.mode = BAD$1; + state.mode = BAD; break; } //#endif //Tracev((stderr, "inflate: table sizes ok\n")); @@ -2328,12 +2311,12 @@ opts = { bits: state.lenbits }; - ret = inftrees(CODES$1, state.lens, 0, 19, state.lencode, 0, state.work, opts); + ret = inftrees(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); state.lenbits = opts.bits; if (ret) { strm.msg = 'invalid code lengths set'; - state.mode = BAD$1; + state.mode = BAD; break; } //Tracev((stderr, "inflate: code lengths ok\n")); @@ -2395,7 +2378,7 @@ if (state.have === 0) { strm.msg = 'invalid bit length repeat'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -2459,7 +2442,7 @@ if (state.have + copy > state.nlen + state.ndist) { strm.msg = 'invalid bit length repeat'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -2471,7 +2454,7 @@ /* handle error breaks in while */ - if (state.mode === BAD$1) { + if (state.mode === BAD) { break; } /* check for end-of-block code (better have one) */ @@ -2479,7 +2462,7 @@ if (state.lens[256] === 0) { strm.msg = 'invalid code -- missing end-of-block'; - state.mode = BAD$1; + state.mode = BAD; break; } /* build code tables -- note: do not change the lenbits or distbits @@ -2491,14 +2474,14 @@ opts = { bits: state.lenbits }; - ret = inftrees(LENS$1, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. + ret = inftrees(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. // state.next_index = opts.table_index; state.lenbits = opts.bits; // state.lencode = state.next; if (ret) { strm.msg = 'invalid literal/lengths set'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -2509,14 +2492,14 @@ opts = { bits: state.distbits }; - ret = inftrees(DISTS$1, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. + ret = inftrees(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. // state.next_index = opts.table_index; state.distbits = opts.bits; // state.distcode = state.next; if (ret) { strm.msg = 'invalid distances set'; - state.mode = BAD$1; + state.mode = BAD; break; } //Tracev((stderr, 'inflate: codes ok\n')); @@ -2555,7 +2538,7 @@ hold = state.hold; bits = state.bits; //--- - if (state.mode === TYPE$1) { + if (state.mode === TYPE) { state.back = -1; } @@ -2592,9 +2575,7 @@ last_val = here_val; for (;;) { - here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> - /*BITS(last.bits + last.op)*/ - last_bits)]; + here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; here_bits = here >>> 24; here_op = here >>> 16 & 0xff; here_val = here & 0xffff; @@ -2638,13 +2619,13 @@ if (here_op & 32) { //Tracevv((stderr, "inflate: end of block\n")); state.back = -1; - state.mode = TYPE$1; + state.mode = TYPE; break; } if (here_op & 64) { strm.msg = 'invalid literal/length code'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -2714,9 +2695,7 @@ last_val = here_val; for (;;) { - here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> - /*BITS(last.bits + last.op)*/ - last_bits)]; + here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; here_bits = here >>> 24; here_op = here >>> 16 & 0xff; here_val = here & 0xffff; @@ -2750,7 +2729,7 @@ if (here_op & 64) { strm.msg = 'invalid distance code'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -2789,7 +2768,7 @@ if (state.offset > state.dmax) { strm.msg = 'invalid distance too far back'; - state.mode = BAD$1; + state.mode = BAD; break; } //#endif //Tracevv((stderr, "inflate: distance %u\n", state.offset)); @@ -2813,7 +2792,7 @@ if (copy > state.whave) { if (state.sane) { strm.msg = 'invalid distance too far back'; - state.mode = BAD$1; + state.mode = BAD; break; } // (!) This block is disabled in zlib defaults, // don't enable it for binary compatibility @@ -2899,16 +2878,14 @@ state.total += _out; if (_out) { - strm.adler = state.check = - /*UPDATE(state.check, put - _out, _out);*/ - state.flags ? crc32_1(state.check, output, _out, put - _out) : adler32_1(state.check, output, _out, put - _out); + strm.adler = state.check = state.flags ? crc32_1(state.check, output, _out, put - _out) : adler32_1(state.check, output, _out, put - _out); } _out = left; // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too if ((state.flags ? hold : zswap32(hold)) !== state.check) { strm.msg = 'incorrect data check'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -2938,7 +2915,7 @@ if (hold !== (state.total & 0xffffffff)) { strm.msg = 'incorrect length check'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -2953,21 +2930,21 @@ /* falls through */ case DONE: - ret = Z_STREAM_END; + ret = Z_STREAM_END$1; break inf_leave; - case BAD$1: - ret = Z_DATA_ERROR; + case BAD: + ret = Z_DATA_ERROR$1; break inf_leave; case MEM: - return Z_MEM_ERROR; + return Z_MEM_ERROR$1; case SYNC: /* falls through */ default: - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$1; } } // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave" @@ -2987,7 +2964,7 @@ state.hold = hold; state.bits = bits; //--- - if (state.wsize || _out !== strm.avail_out && state.mode < BAD$1 && (state.mode < CHECK || flush !== Z_FINISH)) { + if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH$1)) { if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) ; } @@ -2998,14 +2975,12 @@ state.total += _out; if (state.wrap && _out) { - strm.adler = state.check = - /*UPDATE(state.check, strm.next_out - _out, _out);*/ - state.flags ? crc32_1(state.check, output, _out, strm.next_out - _out) : adler32_1(state.check, output, _out, strm.next_out - _out); + strm.adler = state.check = state.flags ? crc32_1(state.check, output, _out, strm.next_out - _out) : adler32_1(state.check, output, _out, strm.next_out - _out); } - strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE$1 ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); + strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); - if ((_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK) { + if ((_in === 0 && _out === 0 || flush === Z_FINISH$1) && ret === Z_OK$1) { ret = Z_BUF_ERROR; } @@ -3016,8 +2991,8 @@ if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/ ) { - return Z_STREAM_ERROR; - } + return Z_STREAM_ERROR$1; + } var state = strm.state; @@ -3026,26 +3001,26 @@ } strm.state = null; - return Z_OK; + return Z_OK$1; }; var inflateGetHeader = function inflateGetHeader(strm, head) { /* check state */ if (!strm || !strm.state) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$1; } var state = strm.state; if ((state.wrap & 2) === 0) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$1; } /* save header structure */ state.head = head; head.done = false; - return Z_OK; + return Z_OK$1; }; var inflateSetDictionary = function inflateSetDictionary(strm, dictionary) { @@ -3060,13 +3035,13 @@ || !strm.state /* == Z_NULL */ ) { - return Z_STREAM_ERROR; - } + return Z_STREAM_ERROR$1; + } state = strm.state; if (state.wrap !== 0 && state.mode !== DICT) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$1; } /* check for correct dictionary identifier */ @@ -3080,7 +3055,7 @@ dictid = adler32_1(dictid, dictionary, dictLength, 0); if (dictid !== state.check) { - return Z_DATA_ERROR; + return Z_DATA_ERROR$1; } } /* copy dictionary to window using updatewindow(), which will amend the @@ -3091,12 +3066,12 @@ if (ret) { state.mode = MEM; - return Z_MEM_ERROR; + return Z_MEM_ERROR$1; } state.havedict = 1; // Tracev((stderr, "inflate: dictionary set\n")); - return Z_OK; + return Z_OK$1; }; var inflateReset_1 = inflateReset; @@ -3104,7 +3079,7 @@ var inflateResetKeep_1 = inflateResetKeep; var inflateInit_1 = inflateInit; var inflateInit2_1 = inflateInit2; - var inflate_2 = inflate; + var inflate_2$1 = inflate$1; var inflateEnd_1 = inflateEnd; var inflateGetHeader_1 = inflateGetHeader; var inflateSetDictionary_1 = inflateSetDictionary; @@ -3119,13 +3094,13 @@ module.exports.inflateUndermine = inflateUndermine; */ - var inflate_1 = { + var inflate_1$1 = { inflateReset: inflateReset_1, inflateReset2: inflateReset2_1, inflateResetKeep: inflateResetKeep_1, inflateInit: inflateInit_1, inflateInit2: inflateInit2_1, - inflate: inflate_2, + inflate: inflate_2$1, inflateEnd: inflateEnd_1, inflateGetHeader: inflateGetHeader_1, inflateSetDictionary: inflateSetDictionary_1, @@ -3231,6 +3206,10 @@ // convert string to array (typed, when possible) var string2buf = function string2buf(str) { + if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) { + return new TextEncoder().encode(str); + } + var buf, c, c2, @@ -3315,8 +3294,13 @@ var buf2string = function buf2string(buf, max) { - var i, out; - var len = max || buf.length; // Reserve max possible length (2 words per char) + var len = max || buf.length; + + if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) { + return new TextDecoder().decode(buf.subarray(0, max)); + } + + var i, out; // Reserve max possible length (2 words per char) // NB: by unknown reasons, Array is significantly faster for // String.fromCharCode.apply than Uint16Array. @@ -3585,14 +3569,14 @@ /* ===========================================================================*/ - var Z_NO_FLUSH = constants.Z_NO_FLUSH, - Z_FINISH$1 = constants.Z_FINISH, - Z_OK$1 = constants.Z_OK, - Z_STREAM_END$1 = constants.Z_STREAM_END, - Z_NEED_DICT$1 = constants.Z_NEED_DICT, - Z_STREAM_ERROR$1 = constants.Z_STREAM_ERROR, - Z_DATA_ERROR$1 = constants.Z_DATA_ERROR, - Z_MEM_ERROR$1 = constants.Z_MEM_ERROR; + var Z_NO_FLUSH = constants$1.Z_NO_FLUSH, + Z_FINISH = constants$1.Z_FINISH, + Z_OK = constants$1.Z_OK, + Z_STREAM_END = constants$1.Z_STREAM_END, + Z_NEED_DICT = constants$1.Z_NEED_DICT, + Z_STREAM_ERROR = constants$1.Z_STREAM_ERROR, + Z_DATA_ERROR = constants$1.Z_DATA_ERROR, + Z_MEM_ERROR = constants$1.Z_MEM_ERROR; /* ===========================================================================*/ /** @@ -3714,14 +3698,14 @@ this.strm = new zstream(); this.strm.avail_out = 0; - var status = inflate_1.inflateInit2(this.strm, opt.windowBits); + var status = inflate_1$1.inflateInit2(this.strm, opt.windowBits); - if (status !== Z_OK$1) { + if (status !== Z_OK) { throw new Error(messages[status]); } this.header = new gzheader(); - inflate_1.inflateGetHeader(this.strm, this.header); // Setup dictionary + inflate_1$1.inflateGetHeader(this.strm, this.header); // Setup dictionary if (opt.dictionary) { // Convert data if needed @@ -3733,9 +3717,9 @@ if (opt.raw) { //In raw mode we need to set the dictionary early - status = inflate_1.inflateSetDictionary(this.strm, opt.dictionary); + status = inflate_1$1.inflateSetDictionary(this.strm, opt.dictionary); - if (status !== Z_OK$1) { + if (status !== Z_OK) { throw new Error(messages[status]); } } @@ -3776,7 +3760,7 @@ var status, _flush_mode, last_avail_out; if (this.ended) return false; - if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;else _flush_mode = flush_mode === true ? Z_FINISH$1 : Z_NO_FLUSH; // Convert data if needed + if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH; // Convert data if needed if (toString.call(data) === '[object ArrayBuffer]') { strm.input = new Uint8Array(data); @@ -3794,30 +3778,30 @@ strm.avail_out = chunkSize; } - status = inflate_1.inflate(strm, _flush_mode); + status = inflate_1$1.inflate(strm, _flush_mode); - if (status === Z_NEED_DICT$1 && dictionary) { - status = inflate_1.inflateSetDictionary(strm, dictionary); + if (status === Z_NEED_DICT && dictionary) { + status = inflate_1$1.inflateSetDictionary(strm, dictionary); - if (status === Z_OK$1) { - status = inflate_1.inflate(strm, _flush_mode); - } else if (status === Z_DATA_ERROR$1) { + if (status === Z_OK) { + status = inflate_1$1.inflate(strm, _flush_mode); + } else if (status === Z_DATA_ERROR) { // Replace code with more verbose - status = Z_NEED_DICT$1; + status = Z_NEED_DICT; } } // Skip snyc markers if more data follows and not raw mode - while (strm.avail_in > 0 && status === Z_STREAM_END$1 && strm.state.wrap > 0 && data[strm.next_in] !== 0) { - inflate_1.inflateReset(strm); - status = inflate_1.inflate(strm, _flush_mode); + while (strm.avail_in > 0 && status === Z_STREAM_END && strm.state.wrap > 0 && data[strm.next_in] !== 0) { + inflate_1$1.inflateReset(strm); + status = inflate_1$1.inflate(strm, _flush_mode); } switch (status) { - case Z_STREAM_ERROR$1: - case Z_DATA_ERROR$1: - case Z_NEED_DICT$1: - case Z_MEM_ERROR$1: + case Z_STREAM_ERROR: + case Z_DATA_ERROR: + case Z_NEED_DICT: + case Z_MEM_ERROR: this.onEnd(status); this.ended = true; return false; @@ -3828,7 +3812,7 @@ last_avail_out = strm.avail_out; if (strm.next_out) { - if (strm.avail_out === 0 || status === Z_STREAM_END$1) { + if (strm.avail_out === 0 || status === Z_STREAM_END) { if (this.options.to === 'string') { var next_out_utf8 = strings.utf8border(strm.output, strm.next_out); var tail = strm.next_out - next_out_utf8; @@ -3845,10 +3829,10 @@ } // Must repeat iteration if out buffer is full - if (status === Z_OK$1 && last_avail_out === 0) continue; // Finalize if end of stream reached. + if (status === Z_OK && last_avail_out === 0) continue; // Finalize if end of stream reached. - if (status === Z_STREAM_END$1) { - status = inflate_1.inflateEnd(this.strm); + if (status === Z_STREAM_END) { + status = inflate_1$1.inflateEnd(this.strm); this.onEnd(status); this.ended = true; return true; @@ -3885,7 +3869,7 @@ Inflate.prototype.onEnd = function (status) { // On success - join - if (status === Z_OK$1) { + if (status === Z_OK) { if (this.options.to === 'string') { this.result = this.chunks.join(''); } else { @@ -3931,14 +3915,14 @@ * * try { * output = pako.inflate(input); - * } catch (err) + * } catch (err) { * console.log(err); * } * ``` **/ - function inflate$1(input, options) { + function inflate(input, options) { var inflator = new Inflate(options); inflator.push(input); // That will never happens, if you don't cheat with options :) @@ -3958,7 +3942,7 @@ function inflateRaw(input, options) { options = options || {}; options.raw = true; - return inflate$1(input, options); + return inflate(input, options); } /** * ungzip(data[, options]) -> Uint8Array|String @@ -3971,22 +3955,22 @@ var Inflate_1 = Inflate; - var inflate_2$1 = inflate$1; + var inflate_2 = inflate; var inflateRaw_1 = inflateRaw; - var ungzip = inflate$1; - var constants$1 = constants; - var inflate_1$1 = { + var ungzip = inflate; + var constants = constants$1; + var inflate_1 = { Inflate: Inflate_1, - inflate: inflate_2$1, + inflate: inflate_2, inflateRaw: inflateRaw_1, ungzip: ungzip, - constants: constants$1 + constants: constants }; exports.Inflate = Inflate_1; - exports.constants = constants$1; - exports.default = inflate_1$1; - exports.inflate = inflate_2$1; + exports.constants = constants; + exports['default'] = inflate_1; + exports.inflate = inflate_2; exports.inflateRaw = inflateRaw_1; exports.ungzip = ungzip; diff --git a/dist/pako_inflate.es5.min.js b/dist/pako_inflate.es5.min.js index 5bbc77b..59219f5 100644 --- a/dist/pako_inflate.es5.min.js +++ b/dist/pako_inflate.es5.min.js @@ -1,2 +1,2 @@ -/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).pako={})}(this,(function(e){"use strict";var t=function(e,t,i,a){for(var n=65535&e|0,r=e>>>16&65535|0,o=0;0!==i;){i-=o=i>2e3?2e3:i;do{r=r+(n=n+t[a++]|0)|0}while(--o);n%=65521,r%=65521}return n|r<<16|0},i=new Uint32Array(function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var a=0;a<8;a++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}()),a=function(e,t,a,n){var r=i,o=n+a;e^=-1;for(var s=n;s>>8^r[255&(e^t[s])];return-1^e},n=function(e,t){var i,a,n,r,o,s,l,f,d,h,c,u,w,b,m,k,_,v,g,p,y,x,E,R,A=e.state;i=e.next_in,E=e.input,a=i+(e.avail_in-5),n=e.next_out,R=e.output,r=n-(t-e.avail_out),o=n+(e.avail_out-257),s=A.dmax,l=A.wsize,f=A.whave,d=A.wnext,h=A.window,c=A.hold,u=A.bits,w=A.lencode,b=A.distcode,m=(1<>>=v=_>>>24,u-=v,0===(v=_>>>16&255))R[n++]=65535&_;else{if(!(16&v)){if(0==(64&v)){_=w[(65535&_)+(c&(1<>>=v,u-=v),u<15&&(c+=E[i++]<>>=v=_>>>24,u-=v,!(16&(v=_>>>16&255))){if(0==(64&v)){_=b[(65535&_)+(c&(1<s){e.msg="invalid distance too far back",A.mode=30;break e}if(c>>>=v,u-=v,p>(v=n-r)){if((v=p-v)>f&&A.sane){e.msg="invalid distance too far back",A.mode=30;break e}if(y=0,x=h,0===d){if(y+=l-v,v2;)R[n++]=x[y++],R[n++]=x[y++],R[n++]=x[y++],g-=3;g&&(R[n++]=x[y++],g>1&&(R[n++]=x[y++]))}else{y=n-p;do{R[n++]=R[y++],R[n++]=R[y++],R[n++]=R[y++],g-=3}while(g>2);g&&(R[n++]=R[y++],g>1&&(R[n++]=R[y++]))}break}}break}}while(i>3,c&=(1<<(u-=g<<3))-1,e.next_in=i,e.next_out=n,e.avail_in=i=1&&0===N[A];A--);if(Z>A&&(Z=A),0===A)return n[d++]=20971520,n[d++]=20971520,c.bits=1,0;for(R=1;R0&&(0===e||1!==A))return-1;for(C[1]=0,x=1;x852||2===e&&T>592)return 1;for(;;){v=x-O,h[E]<_?(g=0,p=h[E]):h[E]>_?(g=z[F+h[E]],p=I[B+h[E]]):(g=96,p=0),u=1<>O)+(w-=u)]=v<<24|g<<16|p|0}while(0!==w);for(u=1<>=1;if(0!==u?(D&=u-1,D+=u):D=0,E++,0==--N[x]){if(x===A)break;x=t[i+h[E]]}if(x>Z&&(D&m)!==b){for(0===O&&(O=Z),k+=R,U=1<<(S=x-O);S+O852||2===e&&T>592)return 1;n[b=D&m]=Z<<24|S<<16|k-d|0}}return 0!==D&&(n[k+D]=x-O<<24|64<<16|0),c.bits=Z,0},h={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},c=h.Z_FINISH,u=h.Z_BLOCK,w=h.Z_TREES,b=h.Z_OK,m=h.Z_STREAM_END,k=h.Z_NEED_DICT,_=h.Z_STREAM_ERROR,v=h.Z_DATA_ERROR,g=h.Z_MEM_ERROR,p=h.Z_BUF_ERROR,y=h.Z_DEFLATED,x=12,E=30,R=function(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)};function A(){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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var Z,S,O=function(e){if(!e||!e.state)return _;var t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,b},U=function(e){if(!e||!e.state)return _;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,O(e)},T=function(e,t){var i;if(!e||!e.state)return _;var a=e.state;return t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?_:(null!==a.window&&a.wbits!==t&&(a.window=null),a.wrap=i,a.wbits=t,U(e))},D=function(e,t){if(!e)return _;var i=new A;e.state=i,i.window=null;var a=T(e,t);return a!==b&&(e.state=null),a},I=!0,B=function(e){if(I){Z=new Int32Array(512),S=new Int32Array(32);for(var t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(d(1,e.lens,0,288,Z,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;d(2,e.lens,0,32,S,0,e.work,{bits:5}),I=!1}e.lencode=Z,e.lenbits=9,e.distcode=S,e.distbits=5},N=function(e,t,i,a){var n,r=e.state;return null===r.window&&(r.wsize=1<=r.wsize?(r.window.set(t.subarray(i-r.wsize,i),0),r.wnext=0,r.whave=r.wsize):((n=r.wsize-r.wnext)>a&&(n=a),r.window.set(t.subarray(i-a,i-a+n),r.wnext),(a-=n)?(r.window.set(t.subarray(i-a,i),0),r.wnext=a,r.whave=r.wsize):(r.wnext+=n,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,r.check=a(r.check,X,2,0),Z=0,S=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&Z)<<8)+(Z>>8))%31){e.msg="incorrect header check",r.mode=E;break}if((15&Z)!==y){e.msg="unknown compression method",r.mode=E;break}if(S-=4,j=8+(15&(Z>>>=4)),0===r.wbits)r.wbits=j;else if(j>r.wbits){e.msg="invalid window size",r.mode=E;break}r.dmax=1<>8&1),512&r.flags&&(X[0]=255&Z,X[1]=Z>>>8&255,r.check=a(r.check,X,2,0)),Z=0,S=0,r.mode=3;case 3:for(;S<32;){if(0===h)break e;h--,Z+=o[l++]<>>8&255,X[2]=Z>>>16&255,X[3]=Z>>>24&255,r.check=a(r.check,X,4,0)),Z=0,S=0,r.mode=4;case 4:for(;S<16;){if(0===h)break e;h--,Z+=o[l++]<>8),512&r.flags&&(X[0]=255&Z,X[1]=Z>>>8&255,r.check=a(r.check,X,2,0)),Z=0,S=0,r.mode=5;case 5:if(1024&r.flags){for(;S<16;){if(0===h)break e;h--,Z+=o[l++]<>>8&255,r.check=a(r.check,X,2,0)),Z=0,S=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((T=r.length)>h&&(T=h),T&&(r.head&&(j=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(o.subarray(l,l+T),j)),512&r.flags&&(r.check=a(r.check,o,T,l)),h-=T,l+=T,r.length-=T),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===h)break e;T=0;do{j=o[l+T++],r.head&&j&&r.length<65536&&(r.head.name+=String.fromCharCode(j))}while(j&&T>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=x;break;case 10:for(;S<32;){if(0===h)break e;h--,Z+=o[l++]<>>=7&S,S-=7&S,r.mode=27;break}for(;S<3;){if(0===h)break e;h--,Z+=o[l++]<>>=1)){case 0:r.mode=14;break;case 1:if(B(r),r.mode=20,i===w){Z>>>=2,S-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=E}Z>>>=2,S-=2;break;case 14:for(Z>>>=7&S,S-=7&S;S<32;){if(0===h)break e;h--,Z+=o[l++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=E;break}if(r.length=65535&Z,Z=0,S=0,r.mode=15,i===w)break e;case 15:r.mode=16;case 16:if(T=r.length){if(T>h&&(T=h),T>A&&(T=A),0===T)break e;s.set(o.subarray(l,l+T),f),h-=T,l+=T,A-=T,f+=T,r.length-=T;break}r.mode=x;break;case 17:for(;S<14;){if(0===h)break e;h--,Z+=o[l++]<>>=5,S-=5,r.ndist=1+(31&Z),Z>>>=5,S-=5,r.ncode=4+(15&Z),Z>>>=4,S-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=E;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,S-=3}for(;r.have<19;)r.lens[W[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},K=d(0,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,K){e.msg="invalid code lengths set",r.mode=E;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,F=65535&G,!((C=G>>>24)<=S);){if(0===h)break e;h--,Z+=o[l++]<>>=C,S-=C,r.lens[r.have++]=F;else{if(16===F){for(Y=C+2;S>>=C,S-=C,0===r.have){e.msg="invalid bit length repeat",r.mode=E;break}j=r.lens[r.have-1],T=3+(3&Z),Z>>>=2,S-=2}else if(17===F){for(Y=C+3;S>>=C)),Z>>>=3,S-=3}else{for(Y=C+7;S>>=C)),Z>>>=7,S-=7}if(r.have+T>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=E;break}for(;T--;)r.lens[r.have++]=j}}if(r.mode===E)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=E;break}if(r.lenbits=9,P={bits:r.lenbits},K=d(1,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,K){e.msg="invalid literal/lengths set",r.mode=E;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},K=d(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,K){e.msg="invalid distances set",r.mode=E;break}if(r.mode=20,i===w)break e;case 20:r.mode=21;case 21:if(h>=6&&A>=258){e.next_out=f,e.avail_out=A,e.next_in=l,e.avail_in=h,r.hold=Z,r.bits=S,n(e,U),f=e.next_out,s=e.output,A=e.avail_out,l=e.next_in,o=e.input,h=e.avail_in,Z=r.hold,S=r.bits,r.mode===x&&(r.back=-1);break}for(r.back=0;z=(G=r.lencode[Z&(1<>>16&255,F=65535&G,!((C=G>>>24)<=S);){if(0===h)break e;h--,Z+=o[l++]<>L)])>>>16&255,F=65535&G,!(L+(C=G>>>24)<=S);){if(0===h)break e;h--,Z+=o[l++]<>>=L,S-=L,r.back+=L}if(Z>>>=C,S-=C,r.back+=C,r.length=F,0===z){r.mode=26;break}if(32&z){r.back=-1,r.mode=x;break}if(64&z){e.msg="invalid literal/length code",r.mode=E;break}r.extra=15&z,r.mode=22;case 22:if(r.extra){for(Y=r.extra;S>>=r.extra,S-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;z=(G=r.distcode[Z&(1<>>16&255,F=65535&G,!((C=G>>>24)<=S);){if(0===h)break e;h--,Z+=o[l++]<>L)])>>>16&255,F=65535&G,!(L+(C=G>>>24)<=S);){if(0===h)break e;h--,Z+=o[l++]<>>=L,S-=L,r.back+=L}if(Z>>>=C,S-=C,r.back+=C,64&z){e.msg="invalid distance code",r.mode=E;break}r.offset=F,r.extra=15&z,r.mode=24;case 24:if(r.extra){for(Y=r.extra;S>>=r.extra,S-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=E;break}r.mode=25;case 25:if(0===A)break e;if(T=U-A,r.offset>T){if((T=r.offset-T)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=E;break}T>r.wnext?(T-=r.wnext,D=r.wsize-T):D=r.wnext-T,T>r.length&&(T=r.length),I=r.window}else I=s,D=f-r.offset,T=r.length;T>A&&(T=A),A-=T,r.length-=T;do{s[f++]=I[D++]}while(--T);0===r.length&&(r.mode=21);break;case 26:if(0===A)break e;s[f++]=r.length,A--,r.mode=21;break;case 27:if(r.wrap){for(;S<32;){if(0===h)break e;h--,Z|=o[l++]<=252?6:K>=248?5:K>=240?4:K>=224?3:K>=192?2:1;j[254]=j[254]=1;var P=function(e){var t,i,a,n,r,o=e.length,s=0;for(n=0;n>>6,t[r++]=128|63&i):i<65536?(t[r++]=224|i>>>12,t[r++]=128|i>>>6&63,t[r++]=128|63&i):(t[r++]=240|i>>>18,t[r++]=128|i>>>12&63,t[r++]=128|i>>>6&63,t[r++]=128|63&i);return t},Y=function(e,t){var i,a,n=t||e.length,r=new Array(2*n);for(a=0,i=0;i4)r[a++]=65533,i+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&i1?r[a++]=65533:o<65536?r[a++]=o:(o-=65536,r[a++]=55296|o>>10&1023,r[a++]=56320|1023&o)}}}return function(e,t){if(t<65534&&e.subarray&&H)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));for(var i="",a=0;ae.length&&(t=e.length);for(var i=t-1;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+j[e[i]]>t?i:t},X={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};var W=function(){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};var q=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},J=Object.prototype.toString,Q=h.Z_NO_FLUSH,V=h.Z_FINISH,$=h.Z_OK,ee=h.Z_STREAM_END,te=h.Z_NEED_DICT,ie=h.Z_STREAM_ERROR,ae=h.Z_DATA_ERROR,ne=h.Z_MEM_ERROR;function re(e){this.options=L({chunkSize:65536,windowBits:15,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new W,this.strm.avail_out=0;var i=C.inflateInit2(this.strm,t.windowBits);if(i!==$)throw new Error(X[i]);if(this.header=new q,C.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=P(t.dictionary):"[object ArrayBuffer]"===J.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=C.inflateSetDictionary(this.strm,t.dictionary))!==$))throw new Error(X[i])}function oe(e,t){var i=new re(t);if(i.push(e),i.err)throw i.msg||X[i.err];return i.result}re.prototype.push=function(e,t){var i,a,n,r=this.strm,o=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(a=t===~~t?t:!0===t?V:Q,"[object ArrayBuffer]"===J.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(o),r.next_out=0,r.avail_out=o),(i=C.inflate(r,a))===te&&s&&((i=C.inflateSetDictionary(r,s))===$?i=C.inflate(r,a):i===ae&&(i=te));r.avail_in>0&&i===ee&&r.state.wrap>0&&0!==e[r.next_in];)C.inflateReset(r),i=C.inflate(r,a);switch(i){case ie:case ae:case te:case ne:return this.onEnd(i),this.ended=!0,!1}if(n=r.avail_out,r.next_out&&(0===r.avail_out||i===ee))if("string"===this.options.to){var l=G(r.output,r.next_out),f=r.next_out-l,d=Y(r.output,l);r.next_out=f,r.avail_out=o-f,f&&r.output.set(r.output.subarray(l,l+f),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(i!==$||0!==n){if(i===ee)return i=C.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},re.prototype.onData=function(e){this.chunks.push(e)},re.prototype.onEnd=function(e){e===$&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=M(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var se=re,le=oe,fe=function(e,t){return(t=t||{}).raw=!0,oe(e,t)},de=oe,he=h,ce={Inflate:se,inflate:le,inflateRaw:fe,ungzip:de,constants:he};e.Inflate=se,e.constants=he,e.default=ce,e.inflate=le,e.inflateRaw=fe,e.ungzip=de,Object.defineProperty(e,"__esModule",{value:!0})})); +/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).pako={})}(this,(function(e){"use strict";var t=function(e,t,i,n){for(var a=65535&e|0,r=e>>>16&65535|0,o=0;0!==i;){i-=o=i>2e3?2e3:i;do{r=r+(a=a+t[n++]|0)|0}while(--o);a%=65521,r%=65521}return a|r<<16|0},i=new Uint32Array(function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}()),n=function(e,t,n,a){var r=i,o=a+n;e^=-1;for(var s=a;s>>8^r[255&(e^t[s])];return-1^e},a=function(e,t){var i,n,a,r,o,s,l,f,d,h,c,u,w,b,m,k,_,v,g,p,y,x,E,R,A=e.state;i=e.next_in,E=e.input,n=i+(e.avail_in-5),a=e.next_out,R=e.output,r=a-(t-e.avail_out),o=a+(e.avail_out-257),s=A.dmax,l=A.wsize,f=A.whave,d=A.wnext,h=A.window,c=A.hold,u=A.bits,w=A.lencode,b=A.distcode,m=(1<>>=v=_>>>24,u-=v,0===(v=_>>>16&255))R[a++]=65535&_;else{if(!(16&v)){if(0==(64&v)){_=w[(65535&_)+(c&(1<>>=v,u-=v),u<15&&(c+=E[i++]<>>=v=_>>>24,u-=v,!(16&(v=_>>>16&255))){if(0==(64&v)){_=b[(65535&_)+(c&(1<s){e.msg="invalid distance too far back",A.mode=30;break e}if(c>>>=v,u-=v,p>(v=a-r)){if((v=p-v)>f&&A.sane){e.msg="invalid distance too far back",A.mode=30;break e}if(y=0,x=h,0===d){if(y+=l-v,v2;)R[a++]=x[y++],R[a++]=x[y++],R[a++]=x[y++],g-=3;g&&(R[a++]=x[y++],g>1&&(R[a++]=x[y++]))}else{y=a-p;do{R[a++]=R[y++],R[a++]=R[y++],R[a++]=R[y++],g-=3}while(g>2);g&&(R[a++]=R[y++],g>1&&(R[a++]=R[y++]))}break}}break}}while(i>3,c&=(1<<(u-=g<<3))-1,e.next_in=i,e.next_out=a,e.avail_in=i=1&&0===N[A];A--);if(Z>A&&(Z=A),0===A)return a[d++]=20971520,a[d++]=20971520,c.bits=1,0;for(R=1;R0&&(0===e||1!==A))return-1;for(C[1]=0,x=1;x852||2===e&&U>592)return 1;for(;;){v=x-T,h[E]<_?(g=0,p=h[E]):h[E]>_?(g=z[F+h[E]],p=I[B+h[E]]):(g=96,p=0),u=1<>T)+(w-=u)]=v<<24|g<<16|p|0}while(0!==w);for(u=1<>=1;if(0!==u?(D&=u-1,D+=u):D=0,E++,0==--N[x]){if(x===A)break;x=t[i+h[E]]}if(x>Z&&(D&m)!==b){for(0===T&&(T=Z),k+=R,O=1<<(S=x-T);S+T852||2===e&&U>592)return 1;a[b=D&m]=Z<<24|S<<16|k-d|0}}return 0!==D&&(a[k+D]=x-T<<24|64<<16|0),c.bits=Z,0},h={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},c=h.Z_FINISH,u=h.Z_BLOCK,w=h.Z_TREES,b=h.Z_OK,m=h.Z_STREAM_END,k=h.Z_NEED_DICT,_=h.Z_STREAM_ERROR,v=h.Z_DATA_ERROR,g=h.Z_MEM_ERROR,p=h.Z_BUF_ERROR,y=h.Z_DEFLATED,x=12,E=30,R=function(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)};function A(){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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var Z,S,T=function(e){if(!e||!e.state)return _;var t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,b},O=function(e){if(!e||!e.state)return _;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,T(e)},U=function(e,t){var i;if(!e||!e.state)return _;var n=e.state;return t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?_:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,O(e))},D=function(e,t){if(!e)return _;var i=new A;e.state=i,i.window=null;var n=U(e,t);return n!==b&&(e.state=null),n},I=!0,B=function(e){if(I){Z=new Int32Array(512),S=new Int32Array(32);for(var t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(d(1,e.lens,0,288,Z,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;d(2,e.lens,0,32,S,0,e.work,{bits:5}),I=!1}e.lencode=Z,e.lenbits=9,e.distcode=S,e.distbits=5},N=function(e,t,i,n){var a,r=e.state;return null===r.window&&(r.wsize=1<=r.wsize?(r.window.set(t.subarray(i-r.wsize,i),0),r.wnext=0,r.whave=r.wsize):((a=r.wsize-r.wnext)>n&&(a=n),r.window.set(t.subarray(i-n,i-n+a),r.wnext),(n-=a)?(r.window.set(t.subarray(i-n,i),0),r.wnext=n,r.whave=r.wsize):(r.wnext+=a,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,r.check=n(r.check,X,2,0),Z=0,S=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&Z)<<8)+(Z>>8))%31){e.msg="incorrect header check",r.mode=E;break}if((15&Z)!==y){e.msg="unknown compression method",r.mode=E;break}if(S-=4,j=8+(15&(Z>>>=4)),0===r.wbits)r.wbits=j;else if(j>r.wbits){e.msg="invalid window size",r.mode=E;break}r.dmax=1<>8&1),512&r.flags&&(X[0]=255&Z,X[1]=Z>>>8&255,r.check=n(r.check,X,2,0)),Z=0,S=0,r.mode=3;case 3:for(;S<32;){if(0===h)break e;h--,Z+=o[l++]<>>8&255,X[2]=Z>>>16&255,X[3]=Z>>>24&255,r.check=n(r.check,X,4,0)),Z=0,S=0,r.mode=4;case 4:for(;S<16;){if(0===h)break e;h--,Z+=o[l++]<>8),512&r.flags&&(X[0]=255&Z,X[1]=Z>>>8&255,r.check=n(r.check,X,2,0)),Z=0,S=0,r.mode=5;case 5:if(1024&r.flags){for(;S<16;){if(0===h)break e;h--,Z+=o[l++]<>>8&255,r.check=n(r.check,X,2,0)),Z=0,S=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((U=r.length)>h&&(U=h),U&&(r.head&&(j=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(o.subarray(l,l+U),j)),512&r.flags&&(r.check=n(r.check,o,U,l)),h-=U,l+=U,r.length-=U),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===h)break e;U=0;do{j=o[l+U++],r.head&&j&&r.length<65536&&(r.head.name+=String.fromCharCode(j))}while(j&&U>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=x;break;case 10:for(;S<32;){if(0===h)break e;h--,Z+=o[l++]<>>=7&S,S-=7&S,r.mode=27;break}for(;S<3;){if(0===h)break e;h--,Z+=o[l++]<>>=1)){case 0:r.mode=14;break;case 1:if(B(r),r.mode=20,i===w){Z>>>=2,S-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=E}Z>>>=2,S-=2;break;case 14:for(Z>>>=7&S,S-=7&S;S<32;){if(0===h)break e;h--,Z+=o[l++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=E;break}if(r.length=65535&Z,Z=0,S=0,r.mode=15,i===w)break e;case 15:r.mode=16;case 16:if(U=r.length){if(U>h&&(U=h),U>A&&(U=A),0===U)break e;s.set(o.subarray(l,l+U),f),h-=U,l+=U,A-=U,f+=U,r.length-=U;break}r.mode=x;break;case 17:for(;S<14;){if(0===h)break e;h--,Z+=o[l++]<>>=5,S-=5,r.ndist=1+(31&Z),Z>>>=5,S-=5,r.ncode=4+(15&Z),Z>>>=4,S-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=E;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,S-=3}for(;r.have<19;)r.lens[W[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},K=d(0,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,K){e.msg="invalid code lengths set",r.mode=E;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,F=65535&G,!((C=G>>>24)<=S);){if(0===h)break e;h--,Z+=o[l++]<>>=C,S-=C,r.lens[r.have++]=F;else{if(16===F){for(Y=C+2;S>>=C,S-=C,0===r.have){e.msg="invalid bit length repeat",r.mode=E;break}j=r.lens[r.have-1],U=3+(3&Z),Z>>>=2,S-=2}else if(17===F){for(Y=C+3;S>>=C)),Z>>>=3,S-=3}else{for(Y=C+7;S>>=C)),Z>>>=7,S-=7}if(r.have+U>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=E;break}for(;U--;)r.lens[r.have++]=j}}if(r.mode===E)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=E;break}if(r.lenbits=9,P={bits:r.lenbits},K=d(1,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,K){e.msg="invalid literal/lengths set",r.mode=E;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},K=d(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,K){e.msg="invalid distances set",r.mode=E;break}if(r.mode=20,i===w)break e;case 20:r.mode=21;case 21:if(h>=6&&A>=258){e.next_out=f,e.avail_out=A,e.next_in=l,e.avail_in=h,r.hold=Z,r.bits=S,a(e,O),f=e.next_out,s=e.output,A=e.avail_out,l=e.next_in,o=e.input,h=e.avail_in,Z=r.hold,S=r.bits,r.mode===x&&(r.back=-1);break}for(r.back=0;z=(G=r.lencode[Z&(1<>>16&255,F=65535&G,!((C=G>>>24)<=S);){if(0===h)break e;h--,Z+=o[l++]<>L)])>>>16&255,F=65535&G,!(L+(C=G>>>24)<=S);){if(0===h)break e;h--,Z+=o[l++]<>>=L,S-=L,r.back+=L}if(Z>>>=C,S-=C,r.back+=C,r.length=F,0===z){r.mode=26;break}if(32&z){r.back=-1,r.mode=x;break}if(64&z){e.msg="invalid literal/length code",r.mode=E;break}r.extra=15&z,r.mode=22;case 22:if(r.extra){for(Y=r.extra;S>>=r.extra,S-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;z=(G=r.distcode[Z&(1<>>16&255,F=65535&G,!((C=G>>>24)<=S);){if(0===h)break e;h--,Z+=o[l++]<>L)])>>>16&255,F=65535&G,!(L+(C=G>>>24)<=S);){if(0===h)break e;h--,Z+=o[l++]<>>=L,S-=L,r.back+=L}if(Z>>>=C,S-=C,r.back+=C,64&z){e.msg="invalid distance code",r.mode=E;break}r.offset=F,r.extra=15&z,r.mode=24;case 24:if(r.extra){for(Y=r.extra;S>>=r.extra,S-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=E;break}r.mode=25;case 25:if(0===A)break e;if(U=O-A,r.offset>U){if((U=r.offset-U)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=E;break}U>r.wnext?(U-=r.wnext,D=r.wsize-U):D=r.wnext-U,U>r.length&&(U=r.length),I=r.window}else I=s,D=f-r.offset,U=r.length;U>A&&(U=A),A-=U,r.length-=U;do{s[f++]=I[D++]}while(--U);0===r.length&&(r.mode=21);break;case 26:if(0===A)break e;s[f++]=r.length,A--,r.mode=21;break;case 27:if(r.wrap){for(;S<32;){if(0===h)break e;h--,Z|=o[l++]<=252?6:K>=248?5:K>=240?4:K>=224?3:K>=192?2:1;j[254]=j[254]=1;var P=function(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);var t,i,n,a,r,o=e.length,s=0;for(a=0;a>>6,t[r++]=128|63&i):i<65536?(t[r++]=224|i>>>12,t[r++]=128|i>>>6&63,t[r++]=128|63&i):(t[r++]=240|i>>>18,t[r++]=128|i>>>12&63,t[r++]=128|i>>>6&63,t[r++]=128|63&i);return t},Y=function(e,t){var i,n,a=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));var r=new Array(2*a);for(n=0,i=0;i4)r[n++]=65533,i+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&i1?r[n++]=65533:o<65536?r[n++]=o:(o-=65536,r[n++]=55296|o>>10&1023,r[n++]=56320|1023&o)}}}return function(e,t){if(t<65534&&e.subarray&&H)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));for(var i="",n=0;ne.length&&(t=e.length);for(var i=t-1;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+j[e[i]]>t?i:t},X={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};var W=function(){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};var q=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},J=Object.prototype.toString,Q=h.Z_NO_FLUSH,V=h.Z_FINISH,$=h.Z_OK,ee=h.Z_STREAM_END,te=h.Z_NEED_DICT,ie=h.Z_STREAM_ERROR,ne=h.Z_DATA_ERROR,ae=h.Z_MEM_ERROR;function re(e){this.options=L({chunkSize:65536,windowBits:15,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new W,this.strm.avail_out=0;var i=C.inflateInit2(this.strm,t.windowBits);if(i!==$)throw new Error(X[i]);if(this.header=new q,C.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=P(t.dictionary):"[object ArrayBuffer]"===J.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=C.inflateSetDictionary(this.strm,t.dictionary))!==$))throw new Error(X[i])}function oe(e,t){var i=new re(t);if(i.push(e),i.err)throw i.msg||X[i.err];return i.result}re.prototype.push=function(e,t){var i,n,a,r=this.strm,o=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(n=t===~~t?t:!0===t?V:Q,"[object ArrayBuffer]"===J.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(o),r.next_out=0,r.avail_out=o),(i=C.inflate(r,n))===te&&s&&((i=C.inflateSetDictionary(r,s))===$?i=C.inflate(r,n):i===ne&&(i=te));r.avail_in>0&&i===ee&&r.state.wrap>0&&0!==e[r.next_in];)C.inflateReset(r),i=C.inflate(r,n);switch(i){case ie:case ne:case te:case ae:return this.onEnd(i),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||i===ee))if("string"===this.options.to){var l=G(r.output,r.next_out),f=r.next_out-l,d=Y(r.output,l);r.next_out=f,r.avail_out=o-f,f&&r.output.set(r.output.subarray(l,l+f),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(i!==$||0!==a){if(i===ee)return i=C.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},re.prototype.onData=function(e){this.chunks.push(e)},re.prototype.onEnd=function(e){e===$&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=M(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var se=re,le=oe,fe=function(e,t){return(t=t||{}).raw=!0,oe(e,t)},de=oe,he=h,ce={Inflate:se,inflate:le,inflateRaw:fe,ungzip:de,constants:he};e.Inflate=se,e.constants=he,e.default=ce,e.inflate=le,e.inflateRaw=fe,e.ungzip=de,Object.defineProperty(e,"__esModule",{value:!0})})); diff --git a/dist/pako_inflate.js b/dist/pako_inflate.js index 116e7ef..346cd38 100644 --- a/dist/pako_inflate.js +++ b/dist/pako_inflate.js @@ -1,5 +1,5 @@ -/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */ +/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : @@ -134,8 +134,8 @@ // 3. This notice may not be removed or altered from any source distribution. // See state defs from inflate.js - const BAD = 30; /* got a data error -- remain here until reset */ - const TYPE = 12; /* i: waiting for type bits, including last-flag bit */ + const BAD$1 = 30; /* got a data error -- remain here until reset */ + const TYPE$1 = 12; /* i: waiting for type bits, including last-flag bit */ /* Decode literal, length, and distance codes and write out the resulting @@ -297,7 +297,7 @@ //#ifdef INFLATE_STRICT if (dist > dmax) { strm.msg = 'invalid distance too far back'; - state.mode = BAD; + state.mode = BAD$1; break top; } //#endif @@ -310,7 +310,7 @@ if (op > whave) { if (state.sane) { strm.msg = 'invalid distance too far back'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -415,7 +415,7 @@ } else { strm.msg = 'invalid distance code'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -428,12 +428,12 @@ } else if (op & 32) { /* end-of-block */ //Tracevv((stderr, "inflate: end of block\n")); - state.mode = TYPE; + state.mode = TYPE$1; break top; } else { strm.msg = 'invalid literal/length code'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -477,13 +477,13 @@ // 3. This notice may not be removed or altered from any source distribution. const MAXBITS = 15; - const ENOUGH_LENS = 852; - const ENOUGH_DISTS = 592; + const ENOUGH_LENS$1 = 852; + const ENOUGH_DISTS$1 = 592; //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); - const CODES = 0; - const LENS = 1; - const DISTS = 2; + const CODES$1 = 0; + const LENS$1 = 1; + const DISTS$1 = 2; const lbase = new Uint16Array([ /* Length codes 257..285 base */ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, @@ -615,7 +615,7 @@ return -1; } /* over-subscribed */ } - if (left > 0 && (type === CODES || max !== 1)) { + if (left > 0 && (type === CODES$1 || max !== 1)) { return -1; /* incomplete set */ } @@ -666,11 +666,11 @@ /* set up for code type */ // poor man optimization - use if-else instead of switch, // to avoid deopts in old v8 - if (type === CODES) { + if (type === CODES$1) { base = extra = work; /* dummy value--not used */ end = 19; - } else if (type === LENS) { + } else if (type === LENS$1) { base = lbase; base_index -= 257; extra = lext; @@ -695,8 +695,8 @@ mask = used - 1; /* mask for comparing low */ /* check available table space */ - if ((type === LENS && used > ENOUGH_LENS) || - (type === DISTS && used > ENOUGH_DISTS)) { + if ((type === LENS$1 && used > ENOUGH_LENS$1) || + (type === DISTS$1 && used > ENOUGH_DISTS$1)) { return 1; } @@ -767,8 +767,8 @@ /* check for enough space */ used += 1 << curr; - if ((type === LENS && used > ENOUGH_LENS) || - (type === DISTS && used > ENOUGH_DISTS)) { + if ((type === LENS$1 && used > ENOUGH_LENS$1) || + (type === DISTS$1 && used > ENOUGH_DISTS$1)) { return 1; } @@ -819,7 +819,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. - var constants = { + var constants$1 = { /* Allowed flush values; see deflate() and inflate() below for details */ Z_NO_FLUSH: 0, @@ -891,18 +891,18 @@ - const CODES$1 = 0; - const LENS$1 = 1; - const DISTS$1 = 2; + const CODES = 0; + const LENS = 1; + const DISTS = 2; /* Public constants ==========================================================*/ /* ===========================================================================*/ const { - Z_FINISH, Z_BLOCK, Z_TREES, - Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR, Z_BUF_ERROR, + Z_FINISH: Z_FINISH$1, Z_BLOCK, Z_TREES, + Z_OK: Z_OK$1, Z_STREAM_END: Z_STREAM_END$1, Z_NEED_DICT: Z_NEED_DICT$1, Z_STREAM_ERROR: Z_STREAM_ERROR$1, Z_DATA_ERROR: Z_DATA_ERROR$1, Z_MEM_ERROR: Z_MEM_ERROR$1, Z_BUF_ERROR, Z_DEFLATED - } = constants; + } = constants$1; /* STATES ====================================================================*/ @@ -920,7 +920,7 @@ const HCRC = 9; /* i: waiting for header crc (gzip) */ const DICTID = 10; /* i: waiting for dictionary check value */ const DICT = 11; /* waiting for inflateSetDictionary() call */ - const TYPE$1 = 12; /* i: waiting for type bits, including last-flag bit */ + const TYPE = 12; /* i: waiting for type bits, including last-flag bit */ const TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ const STORED = 14; /* i: waiting for stored size (length and complement) */ const COPY_ = 15; /* i/o: same as COPY below, but only first time in */ @@ -938,7 +938,7 @@ const CHECK = 27; /* i: waiting for 32-bit check value */ const LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ const DONE = 29; /* finished check, done -- remain here until reset */ - const BAD$1 = 30; /* got a data error -- remain here until reset */ + const BAD = 30; /* got a data error -- remain here until reset */ const MEM = 31; /* got an inflate() memory error -- remain here until reset */ const SYNC = 32; /* looking for synchronization bytes to restart inflate() */ @@ -946,8 +946,8 @@ - const ENOUGH_LENS$1 = 852; - const ENOUGH_DISTS$1 = 592; + const ENOUGH_LENS = 852; + const ENOUGH_DISTS = 592; //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); const MAX_WBITS = 15; @@ -1025,7 +1025,7 @@ const inflateResetKeep = (strm) => { - if (!strm || !strm.state) { return Z_STREAM_ERROR; } + if (!strm || !strm.state) { return Z_STREAM_ERROR$1; } const state = strm.state; strm.total_in = strm.total_out = state.total = 0; strm.msg = ''; /*Z_NULL*/ @@ -1040,19 +1040,19 @@ state.hold = 0; state.bits = 0; //state.lencode = state.distcode = state.next = state.codes; - state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS$1); - state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS$1); + state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS); + state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS); state.sane = 1; state.back = -1; //Tracev((stderr, "inflate: reset\n")); - return Z_OK; + return Z_OK$1; }; const inflateReset = (strm) => { - if (!strm || !strm.state) { return Z_STREAM_ERROR; } + if (!strm || !strm.state) { return Z_STREAM_ERROR$1; } const state = strm.state; state.wsize = 0; state.whave = 0; @@ -1066,7 +1066,7 @@ let wrap; /* get the state */ - if (!strm || !strm.state) { return Z_STREAM_ERROR; } + if (!strm || !strm.state) { return Z_STREAM_ERROR$1; } const state = strm.state; /* extract wrap request from windowBits parameter */ @@ -1083,7 +1083,7 @@ /* set number of window bits, free window if different */ if (windowBits && (windowBits < 8 || windowBits > 15)) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$1; } if (state.window !== null && state.wbits !== windowBits) { state.window = null; @@ -1098,7 +1098,7 @@ const inflateInit2 = (strm, windowBits) => { - if (!strm) { return Z_STREAM_ERROR; } + if (!strm) { return Z_STREAM_ERROR$1; } //strm.msg = Z_NULL; /* in case we return an error */ const state = new InflateState(); @@ -1108,7 +1108,7 @@ strm.state = state; state.window = null/*Z_NULL*/; const ret = inflateReset2(strm, windowBits); - if (ret !== Z_OK) { + if (ret !== Z_OK$1) { strm.state = null/*Z_NULL*/; } return ret; @@ -1150,13 +1150,13 @@ while (sym < 280) { state.lens[sym++] = 7; } while (sym < 288) { state.lens[sym++] = 8; } - inftrees(LENS$1, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); + inftrees(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); /* distance table */ sym = 0; while (sym < 32) { state.lens[sym++] = 5; } - inftrees(DISTS$1, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); + inftrees(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); /* do this just once */ virgin = false; @@ -1227,7 +1227,7 @@ }; - const inflate = (strm, flush) => { + const inflate$1 = (strm, flush) => { let state; let input, output; // input/output buffers @@ -1257,11 +1257,11 @@ if (!strm || !strm.state || !strm.output || (!strm.input && strm.avail_in !== 0)) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$1; } state = strm.state; - if (state.mode === TYPE$1) { state.mode = TYPEDO; } /* skip check */ + if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ //--- LOAD() --- @@ -1277,7 +1277,7 @@ _in = have; _out = left; - ret = Z_OK; + ret = Z_OK$1; inf_leave: // goto emulation for (;;) { @@ -1317,12 +1317,12 @@ if (!(state.wrap & 1) || /* check if zlib header allowed */ (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) { strm.msg = 'incorrect header check'; - state.mode = BAD$1; + state.mode = BAD; break; } if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) { strm.msg = 'unknown compression method'; - state.mode = BAD$1; + state.mode = BAD; break; } //--- DROPBITS(4) ---// @@ -1335,7 +1335,7 @@ } else if (len > state.wbits) { strm.msg = 'invalid window size'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -1346,7 +1346,7 @@ //Tracev((stderr, "inflate: zlib header ok\n")); strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; - state.mode = hold & 0x200 ? DICTID : TYPE$1; + state.mode = hold & 0x200 ? DICTID : TYPE; //=== INITBITS(); hold = 0; bits = 0; @@ -1364,12 +1364,12 @@ state.flags = hold; if ((state.flags & 0xff) !== Z_DEFLATED) { strm.msg = 'unknown compression method'; - state.mode = BAD$1; + state.mode = BAD; break; } if (state.flags & 0xe000) { strm.msg = 'unknown header flags set'; - state.mode = BAD$1; + state.mode = BAD; break; } if (state.head) { @@ -1572,7 +1572,7 @@ //===// if (hold !== (state.check & 0xffff)) { strm.msg = 'header crc mismatch'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -1585,7 +1585,7 @@ state.head.done = true; } strm.adler = state.check = 0; - state.mode = TYPE$1; + state.mode = TYPE; break; case DICTID: //=== NEEDBITS(32); */ @@ -1613,12 +1613,12 @@ state.hold = hold; state.bits = bits; //--- - return Z_NEED_DICT; + return Z_NEED_DICT$1; } strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; - state.mode = TYPE$1; + state.mode = TYPE; /* falls through */ - case TYPE$1: + case TYPE: if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } /* falls through */ case TYPEDO: @@ -1670,7 +1670,7 @@ break; case 3: strm.msg = 'invalid block type'; - state.mode = BAD$1; + state.mode = BAD; } //--- DROPBITS(2) ---// hold >>>= 2; @@ -1692,7 +1692,7 @@ //===// if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { strm.msg = 'invalid stored block lengths'; - state.mode = BAD$1; + state.mode = BAD; break; } state.length = hold & 0xffff; @@ -1725,7 +1725,7 @@ break; } //Tracev((stderr, "inflate: stored end\n")); - state.mode = TYPE$1; + state.mode = TYPE; break; case TABLE: //=== NEEDBITS(14); */ @@ -1754,7 +1754,7 @@ //#ifndef PKZIP_BUG_WORKAROUND if (state.nlen > 286 || state.ndist > 30) { strm.msg = 'too many length or distance symbols'; - state.mode = BAD$1; + state.mode = BAD; break; } //#endif @@ -1789,12 +1789,12 @@ state.lenbits = 7; opts = { bits: state.lenbits }; - ret = inftrees(CODES$1, state.lens, 0, 19, state.lencode, 0, state.work, opts); + ret = inftrees(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); state.lenbits = opts.bits; if (ret) { strm.msg = 'invalid code lengths set'; - state.mode = BAD$1; + state.mode = BAD; break; } //Tracev((stderr, "inflate: code lengths ok\n")); @@ -1841,7 +1841,7 @@ //---// if (state.have === 0) { strm.msg = 'invalid bit length repeat'; - state.mode = BAD$1; + state.mode = BAD; break; } len = state.lens[state.have - 1]; @@ -1895,7 +1895,7 @@ } if (state.have + copy > state.nlen + state.ndist) { strm.msg = 'invalid bit length repeat'; - state.mode = BAD$1; + state.mode = BAD; break; } while (copy--) { @@ -1905,12 +1905,12 @@ } /* handle error breaks in while */ - if (state.mode === BAD$1) { break; } + if (state.mode === BAD) { break; } /* check for end-of-block code (better have one) */ if (state.lens[256] === 0) { strm.msg = 'invalid code -- missing end-of-block'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -1920,7 +1920,7 @@ state.lenbits = 9; opts = { bits: state.lenbits }; - ret = inftrees(LENS$1, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); + ret = inftrees(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. // state.next_index = opts.table_index; state.lenbits = opts.bits; @@ -1928,7 +1928,7 @@ if (ret) { strm.msg = 'invalid literal/lengths set'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -1937,7 +1937,7 @@ // Switch to use dynamic table state.distcode = state.distdyn; opts = { bits: state.distbits }; - ret = inftrees(DISTS$1, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); + ret = inftrees(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. // state.next_index = opts.table_index; state.distbits = opts.bits; @@ -1945,7 +1945,7 @@ if (ret) { strm.msg = 'invalid distances set'; - state.mode = BAD$1; + state.mode = BAD; break; } //Tracev((stderr, 'inflate: codes ok\n')); @@ -1977,7 +1977,7 @@ bits = state.bits; //--- - if (state.mode === TYPE$1) { + if (state.mode === TYPE) { state.back = -1; } break; @@ -2038,12 +2038,12 @@ if (here_op & 32) { //Tracevv((stderr, "inflate: end of block\n")); state.back = -1; - state.mode = TYPE$1; + state.mode = TYPE; break; } if (here_op & 64) { strm.msg = 'invalid literal/length code'; - state.mode = BAD$1; + state.mode = BAD; break; } state.extra = here_op & 15; @@ -2118,7 +2118,7 @@ state.back += here_bits; if (here_op & 64) { strm.msg = 'invalid distance code'; - state.mode = BAD$1; + state.mode = BAD; break; } state.offset = here_val; @@ -2146,7 +2146,7 @@ //#ifdef INFLATE_STRICT if (state.offset > state.dmax) { strm.msg = 'invalid distance too far back'; - state.mode = BAD$1; + state.mode = BAD; break; } //#endif @@ -2161,7 +2161,7 @@ if (copy > state.whave) { if (state.sane) { strm.msg = 'invalid distance too far back'; - state.mode = BAD$1; + state.mode = BAD; break; } // (!) This block is disabled in zlib defaults, @@ -2233,7 +2233,7 @@ // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too if ((state.flags ? hold : zswap32(hold)) !== state.check) { strm.msg = 'incorrect data check'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -2256,7 +2256,7 @@ //===// if (hold !== (state.total & 0xffffffff)) { strm.msg = 'incorrect length check'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -2268,17 +2268,17 @@ state.mode = DONE; /* falls through */ case DONE: - ret = Z_STREAM_END; + ret = Z_STREAM_END$1; break inf_leave; - case BAD$1: - ret = Z_DATA_ERROR; + case BAD: + ret = Z_DATA_ERROR$1; break inf_leave; case MEM: - return Z_MEM_ERROR; + return Z_MEM_ERROR$1; case SYNC: /* falls through */ default: - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$1; } } @@ -2300,8 +2300,8 @@ state.bits = bits; //--- - if (state.wsize || (_out !== strm.avail_out && state.mode < BAD$1 && - (state.mode < CHECK || flush !== Z_FINISH))) { + if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && + (state.mode < CHECK || flush !== Z_FINISH$1))) { if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) ; } _in -= strm.avail_in; @@ -2314,9 +2314,9 @@ (state.flags ? crc32_1(state.check, output, _out, strm.next_out - _out) : adler32_1(state.check, output, _out, strm.next_out - _out)); } strm.data_type = state.bits + (state.last ? 64 : 0) + - (state.mode === TYPE$1 ? 128 : 0) + + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); - if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) { + if (((_in === 0 && _out === 0) || flush === Z_FINISH$1) && ret === Z_OK$1) { ret = Z_BUF_ERROR; } return ret; @@ -2326,7 +2326,7 @@ const inflateEnd = (strm) => { if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$1; } let state = strm.state; @@ -2334,21 +2334,21 @@ state.window = null; } strm.state = null; - return Z_OK; + return Z_OK$1; }; const inflateGetHeader = (strm, head) => { /* check state */ - if (!strm || !strm.state) { return Z_STREAM_ERROR; } + if (!strm || !strm.state) { return Z_STREAM_ERROR$1; } const state = strm.state; - if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; } + if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR$1; } /* save header structure */ state.head = head; head.done = false; - return Z_OK; + return Z_OK$1; }; @@ -2360,11 +2360,11 @@ let ret; /* check state */ - if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; } + if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR$1; } state = strm.state; if (state.wrap !== 0 && state.mode !== DICT) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$1; } /* check for correct dictionary identifier */ @@ -2373,7 +2373,7 @@ /* dictid = adler32(dictid, dictionary, dictLength); */ dictid = adler32_1(dictid, dictionary, dictLength, 0); if (dictid !== state.check) { - return Z_DATA_ERROR; + return Z_DATA_ERROR$1; } } /* copy dictionary to window using updatewindow(), which will amend the @@ -2381,11 +2381,11 @@ ret = updatewindow(strm, dictionary, dictLength, dictLength); if (ret) { state.mode = MEM; - return Z_MEM_ERROR; + return Z_MEM_ERROR$1; } state.havedict = 1; // Tracev((stderr, "inflate: dictionary set\n")); - return Z_OK; + return Z_OK$1; }; @@ -2394,7 +2394,7 @@ var inflateResetKeep_1 = inflateResetKeep; var inflateInit_1 = inflateInit; var inflateInit2_1 = inflateInit2; - var inflate_2 = inflate; + var inflate_2$1 = inflate$1; var inflateEnd_1 = inflateEnd; var inflateGetHeader_1 = inflateGetHeader; var inflateSetDictionary_1 = inflateSetDictionary; @@ -2410,13 +2410,13 @@ module.exports.inflateUndermine = inflateUndermine; */ - var inflate_1 = { + var inflate_1$1 = { inflateReset: inflateReset_1, inflateReset2: inflateReset2_1, inflateResetKeep: inflateResetKeep_1, inflateInit: inflateInit_1, inflateInit2: inflateInit2_1, - inflate: inflate_2, + inflate: inflate_2$1, inflateEnd: inflateEnd_1, inflateGetHeader: inflateGetHeader_1, inflateSetDictionary: inflateSetDictionary_1, @@ -2499,6 +2499,10 @@ // convert string to array (typed, when possible) var string2buf = (str) => { + if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) { + return new TextEncoder().encode(str); + } + let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; // count binary size @@ -2572,9 +2576,14 @@ // convert array to string var buf2string = (buf, max) => { - let i, out; const len = max || buf.length; + if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) { + return new TextDecoder().decode(buf.subarray(0, max)); + } + + let i, out; + // Reserve max possible length (2 words per char) // NB: by unknown reasons, Array is significantly faster for // String.fromCharCode.apply than Uint16Array. @@ -2785,9 +2794,9 @@ /* ===========================================================================*/ const { - Z_NO_FLUSH, Z_FINISH: Z_FINISH$1, - Z_OK: Z_OK$1, Z_STREAM_END: Z_STREAM_END$1, Z_NEED_DICT: Z_NEED_DICT$1, Z_STREAM_ERROR: Z_STREAM_ERROR$1, Z_DATA_ERROR: Z_DATA_ERROR$1, Z_MEM_ERROR: Z_MEM_ERROR$1 - } = constants; + Z_NO_FLUSH, Z_FINISH, + Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR + } = constants$1; /* ===========================================================================*/ @@ -2909,18 +2918,18 @@ this.strm = new zstream(); this.strm.avail_out = 0; - let status = inflate_1.inflateInit2( + let status = inflate_1$1.inflateInit2( this.strm, opt.windowBits ); - if (status !== Z_OK$1) { + if (status !== Z_OK) { throw new Error(messages[status]); } this.header = new gzheader(); - inflate_1.inflateGetHeader(this.strm, this.header); + inflate_1$1.inflateGetHeader(this.strm, this.header); // Setup dictionary if (opt.dictionary) { @@ -2931,8 +2940,8 @@ opt.dictionary = new Uint8Array(opt.dictionary); } if (opt.raw) { //In raw mode we need to set the dictionary early - status = inflate_1.inflateSetDictionary(this.strm, opt.dictionary); - if (status !== Z_OK$1) { + status = inflate_1$1.inflateSetDictionary(this.strm, opt.dictionary); + if (status !== Z_OK) { throw new Error(messages[status]); } } @@ -2973,7 +2982,7 @@ if (this.ended) return false; if (flush_mode === ~~flush_mode) _flush_mode = flush_mode; - else _flush_mode = flush_mode === true ? Z_FINISH$1 : Z_NO_FLUSH; + else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH; // Convert data if needed if (toString.call(data) === '[object ArrayBuffer]') { @@ -2992,34 +3001,34 @@ strm.avail_out = chunkSize; } - status = inflate_1.inflate(strm, _flush_mode); + status = inflate_1$1.inflate(strm, _flush_mode); - if (status === Z_NEED_DICT$1 && dictionary) { - status = inflate_1.inflateSetDictionary(strm, dictionary); + if (status === Z_NEED_DICT && dictionary) { + status = inflate_1$1.inflateSetDictionary(strm, dictionary); - if (status === Z_OK$1) { - status = inflate_1.inflate(strm, _flush_mode); - } else if (status === Z_DATA_ERROR$1) { + if (status === Z_OK) { + status = inflate_1$1.inflate(strm, _flush_mode); + } else if (status === Z_DATA_ERROR) { // Replace code with more verbose - status = Z_NEED_DICT$1; + status = Z_NEED_DICT; } } // Skip snyc markers if more data follows and not raw mode while (strm.avail_in > 0 && - status === Z_STREAM_END$1 && + status === Z_STREAM_END && strm.state.wrap > 0 && data[strm.next_in] !== 0) { - inflate_1.inflateReset(strm); - status = inflate_1.inflate(strm, _flush_mode); + inflate_1$1.inflateReset(strm); + status = inflate_1$1.inflate(strm, _flush_mode); } switch (status) { - case Z_STREAM_ERROR$1: - case Z_DATA_ERROR$1: - case Z_NEED_DICT$1: - case Z_MEM_ERROR$1: + case Z_STREAM_ERROR: + case Z_DATA_ERROR: + case Z_NEED_DICT: + case Z_MEM_ERROR: this.onEnd(status); this.ended = true; return false; @@ -3030,7 +3039,7 @@ last_avail_out = strm.avail_out; if (strm.next_out) { - if (strm.avail_out === 0 || status === Z_STREAM_END$1) { + if (strm.avail_out === 0 || status === Z_STREAM_END) { if (this.options.to === 'string') { @@ -3053,11 +3062,11 @@ } // Must repeat iteration if out buffer is full - if (status === Z_OK$1 && last_avail_out === 0) continue; + if (status === Z_OK && last_avail_out === 0) continue; // Finalize if end of stream reached. - if (status === Z_STREAM_END$1) { - status = inflate_1.inflateEnd(this.strm); + if (status === Z_STREAM_END) { + status = inflate_1$1.inflateEnd(this.strm); this.onEnd(status); this.ended = true; return true; @@ -3094,7 +3103,7 @@ **/ Inflate.prototype.onEnd = function (status) { // On success - join - if (status === Z_OK$1) { + if (status === Z_OK) { if (this.options.to === 'string') { this.result = this.chunks.join(''); } else { @@ -3141,12 +3150,12 @@ * * try { * output = pako.inflate(input); - * } catch (err) + * } catch (err) { * console.log(err); * } * ``` **/ - function inflate$1(input, options) { + function inflate(input, options) { const inflator = new Inflate(options); inflator.push(input); @@ -3169,7 +3178,7 @@ function inflateRaw(input, options) { options = options || {}; options.raw = true; - return inflate$1(input, options); + return inflate(input, options); } @@ -3184,23 +3193,23 @@ var Inflate_1 = Inflate; - var inflate_2$1 = inflate$1; + var inflate_2 = inflate; var inflateRaw_1 = inflateRaw; - var ungzip = inflate$1; - var constants$1 = constants; + var ungzip = inflate; + var constants = constants$1; - var inflate_1$1 = { + var inflate_1 = { Inflate: Inflate_1, - inflate: inflate_2$1, + inflate: inflate_2, inflateRaw: inflateRaw_1, ungzip: ungzip, - constants: constants$1 + constants: constants }; exports.Inflate = Inflate_1; - exports.constants = constants$1; - exports.default = inflate_1$1; - exports.inflate = inflate_2$1; + exports.constants = constants; + exports['default'] = inflate_1; + exports.inflate = inflate_2; exports.inflateRaw = inflateRaw_1; exports.ungzip = ungzip; diff --git a/dist/pako_inflate.min.js b/dist/pako_inflate.min.js index f575bf3..3431269 100644 --- a/dist/pako_inflate.min.js +++ b/dist/pako_inflate.min.js @@ -1,2 +1,2 @@ -/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).pako={})}(this,(function(e){"use strict";var t=(e,t,i,n)=>{let a=65535&e|0,r=e>>>16&65535|0,s=0;for(;0!==i;){s=i>2e3?2e3:i,i-=s;do{a=a+t[n++]|0,r=r+a|0}while(--s);a%=65521,r%=65521}return a|r<<16|0};const i=new Uint32Array((()=>{let e,t=[];for(var i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t})());var n=(e,t,n,a)=>{const r=i,s=a+n;e^=-1;for(let i=a;i>>8^r[255&(e^t[i])];return-1^e};var a=function(e,t){let i,n,a,r,s,o,l,d,f,h,c,u,w,b,k,m,_,g,v,p,y,x,E,R;const A=e.state;i=e.next_in,E=e.input,n=i+(e.avail_in-5),a=e.next_out,R=e.output,r=a-(t-e.avail_out),s=a+(e.avail_out-257),o=A.dmax,l=A.wsize,d=A.whave,f=A.wnext,h=A.window,c=A.hold,u=A.bits,w=A.lencode,b=A.distcode,k=(1<>>24,c>>>=g,u-=g,g=_>>>16&255,0===g)R[a++]=65535&_;else{if(!(16&g)){if(0==(64&g)){_=w[(65535&_)+(c&(1<>>=g,u-=g),u<15&&(c+=E[i++]<>>24,c>>>=g,u-=g,g=_>>>16&255,!(16&g)){if(0==(64&g)){_=b[(65535&_)+(c&(1<o){e.msg="invalid distance too far back",A.mode=30;break e}if(c>>>=g,u-=g,g=a-r,p>g){if(g=p-g,g>d&&A.sane){e.msg="invalid distance too far back",A.mode=30;break e}if(y=0,x=h,0===f){if(y+=l-g,g2;)R[a++]=x[y++],R[a++]=x[y++],R[a++]=x[y++],v-=3;v&&(R[a++]=x[y++],v>1&&(R[a++]=x[y++]))}else{y=a-p;do{R[a++]=R[y++],R[a++]=R[y++],R[a++]=R[y++],v-=3}while(v>2);v&&(R[a++]=R[y++],v>1&&(R[a++]=R[y++]))}break}}break}}while(i>3,i-=v,u-=v<<3,c&=(1<{const u=c.bits;let w,b,k,m,_,g,v=0,p=0,y=0,x=0,E=0,R=0,A=0,Z=0,S=0,O=0,U=null,T=0;const D=new Uint16Array(16),I=new Uint16Array(16);let B,N,C,z=null,F=0;for(v=0;v<=r;v++)D[v]=0;for(p=0;p=1&&0===D[x];x--);if(E>x&&(E=x),0===x)return a[f++]=20971520,a[f++]=20971520,c.bits=1,0;for(y=1;y0&&(0===e||1!==x))return-1;for(I[1]=0,v=1;v852||2===e&&S>592)return 1;for(;;){B=v-A,h[p]g?(N=z[F+h[p]],C=U[T+h[p]]):(N=96,C=0),w=1<>A)+b]=B<<24|N<<16|C|0}while(0!==b);for(w=1<>=1;if(0!==w?(O&=w-1,O+=w):O=0,p++,0==--D[v]){if(v===x)break;v=t[i+h[p]]}if(v>E&&(O&m)!==k){for(0===A&&(A=E),_+=y,R=v-A,Z=1<852||2===e&&S>592)return 1;k=O&m,a[k]=E<<24|R<<16|_-f|0}}return 0!==O&&(a[_+O]=v-A<<24|64<<16|0),c.bits=E,0},h={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{Z_FINISH:c,Z_BLOCK:u,Z_TREES:w,Z_OK:b,Z_STREAM_END:k,Z_NEED_DICT:m,Z_STREAM_ERROR:_,Z_DATA_ERROR:g,Z_MEM_ERROR:v,Z_BUF_ERROR:p,Z_DEFLATED:y}=h,x=12,E=30,R=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function A(){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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Z=e=>{if(!e||!e.state)return _;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,b},S=e=>{if(!e||!e.state)return _;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Z(e)},O=(e,t)=>{let i;if(!e||!e.state)return _;const n=e.state;return t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?_:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,S(e))},U=(e,t)=>{if(!e)return _;const i=new A;e.state=i,i.window=null;const n=O(e,t);return n!==b&&(e.state=null),n};let T,D,I=!0;const B=e=>{if(I){T=new Int32Array(512),D=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(f(1,e.lens,0,288,T,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;f(2,e.lens,0,32,D,0,e.work,{bits:5}),I=!1}e.lencode=T,e.lenbits=9,e.distcode=D,e.distbits=5},N=(e,t,i,n)=>{let a;const r=e.state;return null===r.window&&(r.wsize=1<=r.wsize?(r.window.set(t.subarray(i-r.wsize,i),0),r.wnext=0,r.whave=r.wsize):(a=r.wsize-r.wnext,a>n&&(a=n),r.window.set(t.subarray(i-n,i-n+a),r.wnext),(n-=a)?(r.window.set(t.subarray(i-n,i),0),r.wnext=n,r.whave=r.wsize):(r.wnext+=a,r.wnext===r.wsize&&(r.wnext=0),r.whaveU(e,15),inflateInit2:U,inflate:(e,i)=>{let r,s,o,l,d,h,A,Z,S,O,U,T,D,I,C,z,F,L,M,H,j,K,P=0;const Y=new Uint8Array(4);let G,X;const W=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return _;r=e.state,r.mode===x&&(r.mode=13),d=e.next_out,o=e.output,A=e.avail_out,l=e.next_in,s=e.input,h=e.avail_in,Z=r.hold,S=r.bits,O=h,U=A,K=b;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;S<16;){if(0===h)break e;h--,Z+=s[l++]<>>8&255,r.check=n(r.check,Y,2,0),Z=0,S=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&Z)<<8)+(Z>>8))%31){e.msg="incorrect header check",r.mode=E;break}if((15&Z)!==y){e.msg="unknown compression method",r.mode=E;break}if(Z>>>=4,S-=4,j=8+(15&Z),0===r.wbits)r.wbits=j;else if(j>r.wbits){e.msg="invalid window size",r.mode=E;break}r.dmax=1<>8&1),512&r.flags&&(Y[0]=255&Z,Y[1]=Z>>>8&255,r.check=n(r.check,Y,2,0)),Z=0,S=0,r.mode=3;case 3:for(;S<32;){if(0===h)break e;h--,Z+=s[l++]<>>8&255,Y[2]=Z>>>16&255,Y[3]=Z>>>24&255,r.check=n(r.check,Y,4,0)),Z=0,S=0,r.mode=4;case 4:for(;S<16;){if(0===h)break e;h--,Z+=s[l++]<>8),512&r.flags&&(Y[0]=255&Z,Y[1]=Z>>>8&255,r.check=n(r.check,Y,2,0)),Z=0,S=0,r.mode=5;case 5:if(1024&r.flags){for(;S<16;){if(0===h)break e;h--,Z+=s[l++]<>>8&255,r.check=n(r.check,Y,2,0)),Z=0,S=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(T=r.length,T>h&&(T=h),T&&(r.head&&(j=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(s.subarray(l,l+T),j)),512&r.flags&&(r.check=n(r.check,s,T,l)),h-=T,l+=T,r.length-=T),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===h)break e;T=0;do{j=s[l+T++],r.head&&j&&r.length<65536&&(r.head.name+=String.fromCharCode(j))}while(j&&T>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=x;break;case 10:for(;S<32;){if(0===h)break e;h--,Z+=s[l++]<>>=7&S,S-=7&S,r.mode=27;break}for(;S<3;){if(0===h)break e;h--,Z+=s[l++]<>>=1,S-=1,3&Z){case 0:r.mode=14;break;case 1:if(B(r),r.mode=20,i===w){Z>>>=2,S-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=E}Z>>>=2,S-=2;break;case 14:for(Z>>>=7&S,S-=7&S;S<32;){if(0===h)break e;h--,Z+=s[l++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=E;break}if(r.length=65535&Z,Z=0,S=0,r.mode=15,i===w)break e;case 15:r.mode=16;case 16:if(T=r.length,T){if(T>h&&(T=h),T>A&&(T=A),0===T)break e;o.set(s.subarray(l,l+T),d),h-=T,l+=T,A-=T,d+=T,r.length-=T;break}r.mode=x;break;case 17:for(;S<14;){if(0===h)break e;h--,Z+=s[l++]<>>=5,S-=5,r.ndist=1+(31&Z),Z>>>=5,S-=5,r.ncode=4+(15&Z),Z>>>=4,S-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=E;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,S-=3}for(;r.have<19;)r.lens[W[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,G={bits:r.lenbits},K=f(0,r.lens,0,19,r.lencode,0,r.work,G),r.lenbits=G.bits,K){e.msg="invalid code lengths set",r.mode=E;break}r.have=0,r.mode=19;case 19:for(;r.have>>24,z=P>>>16&255,F=65535&P,!(C<=S);){if(0===h)break e;h--,Z+=s[l++]<>>=C,S-=C,r.lens[r.have++]=F;else{if(16===F){for(X=C+2;S>>=C,S-=C,0===r.have){e.msg="invalid bit length repeat",r.mode=E;break}j=r.lens[r.have-1],T=3+(3&Z),Z>>>=2,S-=2}else if(17===F){for(X=C+3;S>>=C,S-=C,j=0,T=3+(7&Z),Z>>>=3,S-=3}else{for(X=C+7;S>>=C,S-=C,j=0,T=11+(127&Z),Z>>>=7,S-=7}if(r.have+T>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=E;break}for(;T--;)r.lens[r.have++]=j}}if(r.mode===E)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=E;break}if(r.lenbits=9,G={bits:r.lenbits},K=f(1,r.lens,0,r.nlen,r.lencode,0,r.work,G),r.lenbits=G.bits,K){e.msg="invalid literal/lengths set",r.mode=E;break}if(r.distbits=6,r.distcode=r.distdyn,G={bits:r.distbits},K=f(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,G),r.distbits=G.bits,K){e.msg="invalid distances set",r.mode=E;break}if(r.mode=20,i===w)break e;case 20:r.mode=21;case 21:if(h>=6&&A>=258){e.next_out=d,e.avail_out=A,e.next_in=l,e.avail_in=h,r.hold=Z,r.bits=S,a(e,U),d=e.next_out,o=e.output,A=e.avail_out,l=e.next_in,s=e.input,h=e.avail_in,Z=r.hold,S=r.bits,r.mode===x&&(r.back=-1);break}for(r.back=0;P=r.lencode[Z&(1<>>24,z=P>>>16&255,F=65535&P,!(C<=S);){if(0===h)break e;h--,Z+=s[l++]<>L)],C=P>>>24,z=P>>>16&255,F=65535&P,!(L+C<=S);){if(0===h)break e;h--,Z+=s[l++]<>>=L,S-=L,r.back+=L}if(Z>>>=C,S-=C,r.back+=C,r.length=F,0===z){r.mode=26;break}if(32&z){r.back=-1,r.mode=x;break}if(64&z){e.msg="invalid literal/length code",r.mode=E;break}r.extra=15&z,r.mode=22;case 22:if(r.extra){for(X=r.extra;S>>=r.extra,S-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;P=r.distcode[Z&(1<>>24,z=P>>>16&255,F=65535&P,!(C<=S);){if(0===h)break e;h--,Z+=s[l++]<>L)],C=P>>>24,z=P>>>16&255,F=65535&P,!(L+C<=S);){if(0===h)break e;h--,Z+=s[l++]<>>=L,S-=L,r.back+=L}if(Z>>>=C,S-=C,r.back+=C,64&z){e.msg="invalid distance code",r.mode=E;break}r.offset=F,r.extra=15&z,r.mode=24;case 24:if(r.extra){for(X=r.extra;S>>=r.extra,S-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=E;break}r.mode=25;case 25:if(0===A)break e;if(T=U-A,r.offset>T){if(T=r.offset-T,T>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=E;break}T>r.wnext?(T-=r.wnext,D=r.wsize-T):D=r.wnext-T,T>r.length&&(T=r.length),I=r.window}else I=o,D=d-r.offset,T=r.length;T>A&&(T=A),A-=T,r.length-=T;do{o[d++]=I[D++]}while(--T);0===r.length&&(r.mode=21);break;case 26:if(0===A)break e;o[d++]=r.length,A--,r.mode=21;break;case 27:if(r.wrap){for(;S<32;){if(0===h)break e;h--,Z|=s[l++]<{if(!e||!e.state)return _;let t=e.state;return t.window&&(t.window=null),e.state=null,b},inflateGetHeader:(e,t)=>{if(!e||!e.state)return _;const i=e.state;return 0==(2&i.wrap)?_:(i.head=t,t.done=!1,b)},inflateSetDictionary:(e,i)=>{const n=i.length;let a,r,s;return e&&e.state?(a=e.state,0!==a.wrap&&11!==a.mode?_:11===a.mode&&(r=1,r=t(r,i,n,0),r!==a.check)?g:(s=N(e,i,n,n),s?(a.mode=31,v):(a.havedict=1,b))):_},inflateInfo:"pako inflate (from Nodeca project)"};const z=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var F=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const t in i)z(i,t)&&(e[t]=i[t])}}return e},L=e=>{let t=0;for(let i=0,n=e.length;i=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;H[254]=H[254]=1;var j=e=>{let t,i,n,a,r,s=e.length,o=0;for(a=0;a>>6,t[r++]=128|63&i):i<65536?(t[r++]=224|i>>>12,t[r++]=128|i>>>6&63,t[r++]=128|63&i):(t[r++]=240|i>>>18,t[r++]=128|i>>>12&63,t[r++]=128|i>>>6&63,t[r++]=128|63&i);return t},K=(e,t)=>{let i,n;const a=t||e.length,r=new Array(2*a);for(n=0,i=0;i4)r[n++]=65533,i+=s-1;else{for(t&=2===s?31:3===s?15:7;s>1&&i1?r[n++]=65533:t<65536?r[n++]=t:(t-=65536,r[n++]=55296|t>>10&1023,r[n++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&M)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let i="";for(let n=0;n{(t=t||e.length)>e.length&&(t=e.length);let i=t-1;for(;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+H[e[i]]>t?i:t},Y={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};var G=function(){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};var X=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const W=Object.prototype.toString,{Z_NO_FLUSH:q,Z_FINISH:J,Z_OK:Q,Z_STREAM_END:V,Z_NEED_DICT:$,Z_STREAM_ERROR:ee,Z_DATA_ERROR:te,Z_MEM_ERROR:ie}=h;function ne(e){this.options=F({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new G,this.strm.avail_out=0;let i=C.inflateInit2(this.strm,t.windowBits);if(i!==Q)throw new Error(Y[i]);if(this.header=new X,C.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=j(t.dictionary):"[object ArrayBuffer]"===W.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=C.inflateSetDictionary(this.strm,t.dictionary),i!==Q)))throw new Error(Y[i])}function ae(e,t){const i=new ne(t);if(i.push(e),i.err)throw i.msg||Y[i.err];return i.result}ne.prototype.push=function(e,t){const i=this.strm,n=this.options.chunkSize,a=this.options.dictionary;let r,s,o;if(this.ended)return!1;for(s=t===~~t?t:!0===t?J:q,"[object ArrayBuffer]"===W.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(n),i.next_out=0,i.avail_out=n),r=C.inflate(i,s),r===$&&a&&(r=C.inflateSetDictionary(i,a),r===Q?r=C.inflate(i,s):r===te&&(r=$));i.avail_in>0&&r===V&&i.state.wrap>0&&0!==e[i.next_in];)C.inflateReset(i),r=C.inflate(i,s);switch(r){case ee:case te:case $:case ie:return this.onEnd(r),this.ended=!0,!1}if(o=i.avail_out,i.next_out&&(0===i.avail_out||r===V))if("string"===this.options.to){let e=P(i.output,i.next_out),t=i.next_out-e,a=K(i.output,e);i.next_out=t,i.avail_out=n-t,t&&i.output.set(i.output.subarray(e,e+t),0),this.onData(a)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out));if(r!==Q||0!==o){if(r===V)return r=C.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(0===i.avail_in)break}}return!0},ne.prototype.onData=function(e){this.chunks.push(e)},ne.prototype.onEnd=function(e){e===Q&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=L(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var re=ne,se=ae,oe=function(e,t){return(t=t||{}).raw=!0,ae(e,t)},le=ae,de=h,fe={Inflate:re,inflate:se,inflateRaw:oe,ungzip:le,constants:de};e.Inflate=re,e.constants=de,e.default=fe,e.inflate=se,e.inflateRaw=oe,e.ungzip=le,Object.defineProperty(e,"__esModule",{value:!0})})); +/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).pako={})}(this,(function(e){"use strict";var t=(e,t,i,n)=>{let a=65535&e|0,r=e>>>16&65535|0,o=0;for(;0!==i;){o=i>2e3?2e3:i,i-=o;do{a=a+t[n++]|0,r=r+a|0}while(--o);a%=65521,r%=65521}return a|r<<16|0};const i=new Uint32Array((()=>{let e,t=[];for(var i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t})());var n=(e,t,n,a)=>{const r=i,o=a+n;e^=-1;for(let i=a;i>>8^r[255&(e^t[i])];return-1^e};var a=function(e,t){let i,n,a,r,o,s,l,d,f,c,h,u,w,b,k,m,_,g,p,v,x,y,E,R;const A=e.state;i=e.next_in,E=e.input,n=i+(e.avail_in-5),a=e.next_out,R=e.output,r=a-(t-e.avail_out),o=a+(e.avail_out-257),s=A.dmax,l=A.wsize,d=A.whave,f=A.wnext,c=A.window,h=A.hold,u=A.bits,w=A.lencode,b=A.distcode,k=(1<>>24,h>>>=g,u-=g,g=_>>>16&255,0===g)R[a++]=65535&_;else{if(!(16&g)){if(0==(64&g)){_=w[(65535&_)+(h&(1<>>=g,u-=g),u<15&&(h+=E[i++]<>>24,h>>>=g,u-=g,g=_>>>16&255,!(16&g)){if(0==(64&g)){_=b[(65535&_)+(h&(1<s){e.msg="invalid distance too far back",A.mode=30;break e}if(h>>>=g,u-=g,g=a-r,v>g){if(g=v-g,g>d&&A.sane){e.msg="invalid distance too far back",A.mode=30;break e}if(x=0,y=c,0===f){if(x+=l-g,g2;)R[a++]=y[x++],R[a++]=y[x++],R[a++]=y[x++],p-=3;p&&(R[a++]=y[x++],p>1&&(R[a++]=y[x++]))}else{x=a-v;do{R[a++]=R[x++],R[a++]=R[x++],R[a++]=R[x++],p-=3}while(p>2);p&&(R[a++]=R[x++],p>1&&(R[a++]=R[x++]))}break}}break}}while(i>3,i-=p,u-=p<<3,h&=(1<{const u=h.bits;let w,b,k,m,_,g,p=0,v=0,x=0,y=0,E=0,R=0,A=0,Z=0,S=0,T=0,O=null,U=0;const D=new Uint16Array(16),I=new Uint16Array(16);let B,N,C,z=null,F=0;for(p=0;p<=r;p++)D[p]=0;for(v=0;v=1&&0===D[y];y--);if(E>y&&(E=y),0===y)return a[f++]=20971520,a[f++]=20971520,h.bits=1,0;for(x=1;x0&&(0===e||1!==y))return-1;for(I[1]=0,p=1;p852||2===e&&S>592)return 1;for(;;){B=p-A,c[v]g?(N=z[F+c[v]],C=O[U+c[v]]):(N=96,C=0),w=1<>A)+b]=B<<24|N<<16|C|0}while(0!==b);for(w=1<>=1;if(0!==w?(T&=w-1,T+=w):T=0,v++,0==--D[p]){if(p===y)break;p=t[i+c[v]]}if(p>E&&(T&m)!==k){for(0===A&&(A=E),_+=x,R=p-A,Z=1<852||2===e&&S>592)return 1;k=T&m,a[k]=E<<24|R<<16|_-f|0}}return 0!==T&&(a[_+T]=p-A<<24|64<<16|0),h.bits=E,0},c={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{Z_FINISH:h,Z_BLOCK:u,Z_TREES:w,Z_OK:b,Z_STREAM_END:k,Z_NEED_DICT:m,Z_STREAM_ERROR:_,Z_DATA_ERROR:g,Z_MEM_ERROR:p,Z_BUF_ERROR:v,Z_DEFLATED:x}=c,y=12,E=30,R=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function A(){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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Z=e=>{if(!e||!e.state)return _;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,b},S=e=>{if(!e||!e.state)return _;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Z(e)},T=(e,t)=>{let i;if(!e||!e.state)return _;const n=e.state;return t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?_:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,S(e))},O=(e,t)=>{if(!e)return _;const i=new A;e.state=i,i.window=null;const n=T(e,t);return n!==b&&(e.state=null),n};let U,D,I=!0;const B=e=>{if(I){U=new Int32Array(512),D=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(f(1,e.lens,0,288,U,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;f(2,e.lens,0,32,D,0,e.work,{bits:5}),I=!1}e.lencode=U,e.lenbits=9,e.distcode=D,e.distbits=5},N=(e,t,i,n)=>{let a;const r=e.state;return null===r.window&&(r.wsize=1<=r.wsize?(r.window.set(t.subarray(i-r.wsize,i),0),r.wnext=0,r.whave=r.wsize):(a=r.wsize-r.wnext,a>n&&(a=n),r.window.set(t.subarray(i-n,i-n+a),r.wnext),(n-=a)?(r.window.set(t.subarray(i-n,i),0),r.wnext=n,r.whave=r.wsize):(r.wnext+=a,r.wnext===r.wsize&&(r.wnext=0),r.whaveO(e,15),inflateInit2:O,inflate:(e,i)=>{let r,o,s,l,d,c,A,Z,S,T,O,U,D,I,C,z,F,L,M,H,j,K,P=0;const Y=new Uint8Array(4);let G,X;const W=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return _;r=e.state,r.mode===y&&(r.mode=13),d=e.next_out,s=e.output,A=e.avail_out,l=e.next_in,o=e.input,c=e.avail_in,Z=r.hold,S=r.bits,T=c,O=A,K=b;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;S<16;){if(0===c)break e;c--,Z+=o[l++]<>>8&255,r.check=n(r.check,Y,2,0),Z=0,S=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&Z)<<8)+(Z>>8))%31){e.msg="incorrect header check",r.mode=E;break}if((15&Z)!==x){e.msg="unknown compression method",r.mode=E;break}if(Z>>>=4,S-=4,j=8+(15&Z),0===r.wbits)r.wbits=j;else if(j>r.wbits){e.msg="invalid window size",r.mode=E;break}r.dmax=1<>8&1),512&r.flags&&(Y[0]=255&Z,Y[1]=Z>>>8&255,r.check=n(r.check,Y,2,0)),Z=0,S=0,r.mode=3;case 3:for(;S<32;){if(0===c)break e;c--,Z+=o[l++]<>>8&255,Y[2]=Z>>>16&255,Y[3]=Z>>>24&255,r.check=n(r.check,Y,4,0)),Z=0,S=0,r.mode=4;case 4:for(;S<16;){if(0===c)break e;c--,Z+=o[l++]<>8),512&r.flags&&(Y[0]=255&Z,Y[1]=Z>>>8&255,r.check=n(r.check,Y,2,0)),Z=0,S=0,r.mode=5;case 5:if(1024&r.flags){for(;S<16;){if(0===c)break e;c--,Z+=o[l++]<>>8&255,r.check=n(r.check,Y,2,0)),Z=0,S=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(U=r.length,U>c&&(U=c),U&&(r.head&&(j=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(o.subarray(l,l+U),j)),512&r.flags&&(r.check=n(r.check,o,U,l)),c-=U,l+=U,r.length-=U),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===c)break e;U=0;do{j=o[l+U++],r.head&&j&&r.length<65536&&(r.head.name+=String.fromCharCode(j))}while(j&&U>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=y;break;case 10:for(;S<32;){if(0===c)break e;c--,Z+=o[l++]<>>=7&S,S-=7&S,r.mode=27;break}for(;S<3;){if(0===c)break e;c--,Z+=o[l++]<>>=1,S-=1,3&Z){case 0:r.mode=14;break;case 1:if(B(r),r.mode=20,i===w){Z>>>=2,S-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=E}Z>>>=2,S-=2;break;case 14:for(Z>>>=7&S,S-=7&S;S<32;){if(0===c)break e;c--,Z+=o[l++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=E;break}if(r.length=65535&Z,Z=0,S=0,r.mode=15,i===w)break e;case 15:r.mode=16;case 16:if(U=r.length,U){if(U>c&&(U=c),U>A&&(U=A),0===U)break e;s.set(o.subarray(l,l+U),d),c-=U,l+=U,A-=U,d+=U,r.length-=U;break}r.mode=y;break;case 17:for(;S<14;){if(0===c)break e;c--,Z+=o[l++]<>>=5,S-=5,r.ndist=1+(31&Z),Z>>>=5,S-=5,r.ncode=4+(15&Z),Z>>>=4,S-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=E;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,S-=3}for(;r.have<19;)r.lens[W[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,G={bits:r.lenbits},K=f(0,r.lens,0,19,r.lencode,0,r.work,G),r.lenbits=G.bits,K){e.msg="invalid code lengths set",r.mode=E;break}r.have=0,r.mode=19;case 19:for(;r.have>>24,z=P>>>16&255,F=65535&P,!(C<=S);){if(0===c)break e;c--,Z+=o[l++]<>>=C,S-=C,r.lens[r.have++]=F;else{if(16===F){for(X=C+2;S>>=C,S-=C,0===r.have){e.msg="invalid bit length repeat",r.mode=E;break}j=r.lens[r.have-1],U=3+(3&Z),Z>>>=2,S-=2}else if(17===F){for(X=C+3;S>>=C,S-=C,j=0,U=3+(7&Z),Z>>>=3,S-=3}else{for(X=C+7;S>>=C,S-=C,j=0,U=11+(127&Z),Z>>>=7,S-=7}if(r.have+U>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=E;break}for(;U--;)r.lens[r.have++]=j}}if(r.mode===E)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=E;break}if(r.lenbits=9,G={bits:r.lenbits},K=f(1,r.lens,0,r.nlen,r.lencode,0,r.work,G),r.lenbits=G.bits,K){e.msg="invalid literal/lengths set",r.mode=E;break}if(r.distbits=6,r.distcode=r.distdyn,G={bits:r.distbits},K=f(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,G),r.distbits=G.bits,K){e.msg="invalid distances set",r.mode=E;break}if(r.mode=20,i===w)break e;case 20:r.mode=21;case 21:if(c>=6&&A>=258){e.next_out=d,e.avail_out=A,e.next_in=l,e.avail_in=c,r.hold=Z,r.bits=S,a(e,O),d=e.next_out,s=e.output,A=e.avail_out,l=e.next_in,o=e.input,c=e.avail_in,Z=r.hold,S=r.bits,r.mode===y&&(r.back=-1);break}for(r.back=0;P=r.lencode[Z&(1<>>24,z=P>>>16&255,F=65535&P,!(C<=S);){if(0===c)break e;c--,Z+=o[l++]<>L)],C=P>>>24,z=P>>>16&255,F=65535&P,!(L+C<=S);){if(0===c)break e;c--,Z+=o[l++]<>>=L,S-=L,r.back+=L}if(Z>>>=C,S-=C,r.back+=C,r.length=F,0===z){r.mode=26;break}if(32&z){r.back=-1,r.mode=y;break}if(64&z){e.msg="invalid literal/length code",r.mode=E;break}r.extra=15&z,r.mode=22;case 22:if(r.extra){for(X=r.extra;S>>=r.extra,S-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;P=r.distcode[Z&(1<>>24,z=P>>>16&255,F=65535&P,!(C<=S);){if(0===c)break e;c--,Z+=o[l++]<>L)],C=P>>>24,z=P>>>16&255,F=65535&P,!(L+C<=S);){if(0===c)break e;c--,Z+=o[l++]<>>=L,S-=L,r.back+=L}if(Z>>>=C,S-=C,r.back+=C,64&z){e.msg="invalid distance code",r.mode=E;break}r.offset=F,r.extra=15&z,r.mode=24;case 24:if(r.extra){for(X=r.extra;S>>=r.extra,S-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=E;break}r.mode=25;case 25:if(0===A)break e;if(U=O-A,r.offset>U){if(U=r.offset-U,U>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=E;break}U>r.wnext?(U-=r.wnext,D=r.wsize-U):D=r.wnext-U,U>r.length&&(U=r.length),I=r.window}else I=s,D=d-r.offset,U=r.length;U>A&&(U=A),A-=U,r.length-=U;do{s[d++]=I[D++]}while(--U);0===r.length&&(r.mode=21);break;case 26:if(0===A)break e;s[d++]=r.length,A--,r.mode=21;break;case 27:if(r.wrap){for(;S<32;){if(0===c)break e;c--,Z|=o[l++]<{if(!e||!e.state)return _;let t=e.state;return t.window&&(t.window=null),e.state=null,b},inflateGetHeader:(e,t)=>{if(!e||!e.state)return _;const i=e.state;return 0==(2&i.wrap)?_:(i.head=t,t.done=!1,b)},inflateSetDictionary:(e,i)=>{const n=i.length;let a,r,o;return e&&e.state?(a=e.state,0!==a.wrap&&11!==a.mode?_:11===a.mode&&(r=1,r=t(r,i,n,0),r!==a.check)?g:(o=N(e,i,n,n),o?(a.mode=31,p):(a.havedict=1,b))):_},inflateInfo:"pako inflate (from Nodeca project)"};const z=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var F=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const t in i)z(i,t)&&(e[t]=i[t])}}return e},L=e=>{let t=0;for(let i=0,n=e.length;i=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;H[254]=H[254]=1;var j=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,i,n,a,r,o=e.length,s=0;for(a=0;a>>6,t[r++]=128|63&i):i<65536?(t[r++]=224|i>>>12,t[r++]=128|i>>>6&63,t[r++]=128|63&i):(t[r++]=240|i>>>18,t[r++]=128|i>>>12&63,t[r++]=128|i>>>6&63,t[r++]=128|63&i);return t},K=(e,t)=>{const i=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let n,a;const r=new Array(2*i);for(a=0,n=0;n4)r[a++]=65533,n+=o-1;else{for(t&=2===o?31:3===o?15:7;o>1&&n1?r[a++]=65533:t<65536?r[a++]=t:(t-=65536,r[a++]=55296|t>>10&1023,r[a++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&M)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let i="";for(let n=0;n{(t=t||e.length)>e.length&&(t=e.length);let i=t-1;for(;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+H[e[i]]>t?i:t},Y={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};var G=function(){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};var X=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const W=Object.prototype.toString,{Z_NO_FLUSH:q,Z_FINISH:J,Z_OK:Q,Z_STREAM_END:V,Z_NEED_DICT:$,Z_STREAM_ERROR:ee,Z_DATA_ERROR:te,Z_MEM_ERROR:ie}=c;function ne(e){this.options=F({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new G,this.strm.avail_out=0;let i=C.inflateInit2(this.strm,t.windowBits);if(i!==Q)throw new Error(Y[i]);if(this.header=new X,C.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=j(t.dictionary):"[object ArrayBuffer]"===W.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=C.inflateSetDictionary(this.strm,t.dictionary),i!==Q)))throw new Error(Y[i])}function ae(e,t){const i=new ne(t);if(i.push(e),i.err)throw i.msg||Y[i.err];return i.result}ne.prototype.push=function(e,t){const i=this.strm,n=this.options.chunkSize,a=this.options.dictionary;let r,o,s;if(this.ended)return!1;for(o=t===~~t?t:!0===t?J:q,"[object ArrayBuffer]"===W.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(n),i.next_out=0,i.avail_out=n),r=C.inflate(i,o),r===$&&a&&(r=C.inflateSetDictionary(i,a),r===Q?r=C.inflate(i,o):r===te&&(r=$));i.avail_in>0&&r===V&&i.state.wrap>0&&0!==e[i.next_in];)C.inflateReset(i),r=C.inflate(i,o);switch(r){case ee:case te:case $:case ie:return this.onEnd(r),this.ended=!0,!1}if(s=i.avail_out,i.next_out&&(0===i.avail_out||r===V))if("string"===this.options.to){let e=P(i.output,i.next_out),t=i.next_out-e,a=K(i.output,e);i.next_out=t,i.avail_out=n-t,t&&i.output.set(i.output.subarray(e,e+t),0),this.onData(a)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out));if(r!==Q||0!==s){if(r===V)return r=C.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(0===i.avail_in)break}}return!0},ne.prototype.onData=function(e){this.chunks.push(e)},ne.prototype.onEnd=function(e){e===Q&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=L(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var re=ne,oe=ae,se=function(e,t){return(t=t||{}).raw=!0,ae(e,t)},le=ae,de=c,fe={Inflate:re,inflate:oe,inflateRaw:se,ungzip:le,constants:de};e.Inflate=re,e.constants=de,e.default=fe,e.inflate=oe,e.inflateRaw=se,e.ungzip=le,Object.defineProperty(e,"__esModule",{value:!0})}));