Socket
Socket
Sign inDemoInstall

@syncfusion/ej2-compression

Package Overview
Dependencies
Maintainers
3
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@syncfusion/ej2-compression - npm Package Compare versions

Comparing version 25.2.3 to 26.1.35

5

.eslintrc.json

@@ -18,3 +18,4 @@ {

"sourceType": "module"
},
},
"ignorePatterns": ["*.d.ts", "*.js"],
"plugins": [

@@ -188,3 +189,3 @@ "@typescript-eslint",

],
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-explicit-any": "warn",
"no-cond-assign": [

@@ -191,0 +192,0 @@ "error",

4

dist/ej2-compression.min.js
/*!
* filename: ej2-compression.min.js
* version : 25.2.3
* version : 26.1.35
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.

@@ -10,2 +10,2 @@ * Use of this code is subject to the terms of our license.

*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("SyncfusionFileUtils")):"function"==typeof define&&define.amd?define(["SyncfusionFileUtils"],e):"object"==typeof exports?exports.SyncfusionCompression=e(require("SyncfusionFileUtils")):t.SyncfusionCompression=e(t.SyncfusionFileUtils)}(this,function(t){return function(t){function e(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var i={};return e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,r){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=1)}([function(t,e,i){"use strict";i.d(e,"a",function(){return r});var r=function(){function t(){}return t.bitReverse=function(e){return t.reverseBits[15&e]<<12|t.reverseBits[e>>4&15]<<8|t.reverseBits[e>>8&15]<<4|t.reverseBits[e>>12]},t.bitConverterToInt32=function(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24},t.bitConverterToInt16=function(t,e){return t[e]|t[e+1]<<8},t.bitConverterToUInt32=function(t){var e=new Uint32Array(1);return e[0]=t,e[0]},t.bitConverterToUInt16=function(t,e){var i=new Uint16Array(1);return i[0]=t[e]|t[e+1]<<8,i[0]},t.bitConverterUintToInt32=function(t){var e=new Int32Array(1);return e[0]=t,e[0]},t.bitConverterInt32ToUint=function(t){var e=new Uint32Array(1);return e[0]=t,e[0]},t.bitConverterInt32ToInt16=function(t){var e=new Int16Array(1);return e[0]=t,e[0]},t.byteToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},t.byteIntToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},t.arrayCopy=function(t,e,i,r,n){var s=new Uint8Array(t.buffer,e),o=s.subarray(0,n);i.set(o,r)},t.mergeArray=function(t,e){var i=new Uint8Array(t.length+e.length);return i.set(t),i.set(e,t.length),i},t.encodedString=function(t){var e,i,r,n,s,o,a,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f=0,u=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");var c=3*t.length/4;if(t.charAt(t.length-1)===h.charAt(64)&&c--,t.charAt(t.length-2)===h.charAt(64)&&c--,c%1!=0)throw new Error("Invalid base64 input, bad content length.");for(var d=new Uint8Array(0|c);f<t.length;)n=h.indexOf(t.charAt(f++)),s=h.indexOf(t.charAt(f++)),o=h.indexOf(t.charAt(f++)),a=h.indexOf(t.charAt(f++)),e=n<<2|s>>4,i=(15&s)<<4|o>>2,r=(3&o)<<6|a,d[u++]=e,64!==o&&(d[u++]=i),64!==a&&(d[u++]=r);return d},t.reverseBits=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],t.huffCodeLengthOrders=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],t}()},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(6);i.d(e,"ZipArchive",function(){return r.a}),i.d(e,"ZipArchiveItemHelper",function(){return r.b}),i.d(e,"ZipArchiveItem",function(){return r.c});var n=i(5);i.d(e,"CompressedStreamWriter",function(){return n.a}),i.d(e,"CompressorHuffmanTree",function(){return n.b}),i.d(e,"ChecksumCalculator",function(){return n.c});var s=i(0);i.d(e,"Utils",function(){return s.a});var o=i(2);i.d(e,"DecompressorHuffmanTree",function(){return o.a});var a=i(4);i.d(e,"CompressedStreamReader",function(){return a.a}),i.d(e,"Stream",function(){return a.b})},function(t,e,i){"use strict";i.d(e,"a",function(){return n});var r=i(1),n=function(){function t(t){this.buildTree(t)}return t.init=function(){var e,i;for(e=new Uint8Array(288),i=0;i<144;)e[i++]=8;for(;i<256;)e[i++]=9;for(;i<280;)e[i++]=7;for(;i<288;)e[i++]=8;for(t.m_LengthTree=new t(e),e=new Uint8Array(32),i=0;i<32;)e[i++]=5;t.m_DistanceTree=new t(e)},t.prototype.prepareData=function(e,i,r){for(var n=0,s=512,o=0;o<r.length;o++){var a=r[o];a>0&&e[a]++}for(var h=1;h<=t.MAX_BITLEN;h++)if(i[h]=n,n+=e[h]<<16-h,h>=10){var f=130944&i[h],u=130944&n;s+=u-f>>16-h}return{code:n,treeSize:s}},t.prototype.treeFromData=function(e,i,n,s,o){for(var a=new Int16Array(o),h=512,f=t.MAX_BITLEN;f>=10;f--){var u=130944&s;s-=e[f]<<16-f;for(var c=130944&s,d=c;d<u;d+=128)a[r.Utils.bitReverse(d)]=r.Utils.bitConverterInt32ToInt16(-h<<4|f),h+=1<<f-9}for(var d=0;d<n.length;d++){var f=n[d];if(0!=f){s=i[f];var p=r.Utils.bitReverse(s);if(f<=9)do{a[p]=r.Utils.bitConverterInt32ToInt16(d<<4|f),p+=1<<f}while(p<512);else{var l=a[511&p],m=1<<(15&l);l=-(l>>4);do{a[l|p>>9]=r.Utils.bitConverterInt32ToInt16(d<<4|f),p+=1<<f}while(p<m)}i[f]=s+(1<<16-f)}}return a},t.prototype.buildTree=function(t){var e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=this.prepareData(e,i,t);this.m_Tree=this.treeFromData(e,i,t,r.code,r.treeSize)},t.prototype.unpackSymbol=function(t){var e,i;if((e=t.peekBits(9))>=0){if((i=this.m_Tree[e])>=0)return t.skipBits(15&i),i>>4;var r=-(i>>4),n=15&i;if((e=t.peekBits(n))>=0)return i=this.m_Tree[r|e>>9],t.skipBits(15&i),i>>4;var s=t.availableBits;return e=t.peekBits(s),i=this.m_Tree[r|e>>9],(15&i)<=s?(t.skipBits(15&i),i>>4):-1}var s=t.availableBits;return e=t.peekBits(s),i=this.m_Tree[e],i>=0&&(15&i)<=s?(t.skipBits(15&i),i>>4):-1},Object.defineProperty(t,"lengthTree",{get:function(){return this.m_LengthTree},enumerable:!0,configurable:!0}),Object.defineProperty(t,"distanceTree",{get:function(){return this.m_DistanceTree},enumerable:!0,configurable:!0}),t.MAX_BITLEN=15,t}()},function(e,i){e.exports=t},function(t,e,i){"use strict";i.d(e,"a",function(){return o}),i.d(e,"b",function(){return a});var r=i(2),n=i(0),s=i(7),o=function(){function t(t,e){if(this.defaultHuffmanDynamicTree=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],this.DEF_HEADER_METHOD_MASK=3840,this.DEF_HEADER_INFO_MASK=61440,this.DEF_HEADER_FLAGS_FCHECK=31,this.DEF_HEADER_FLAGS_FDICT=32,this.DEF_HEADER_FLAGS_FLEVEL=192,this.DEF_MAX_WINDOW_SIZE=65535,this.DEF_HUFFMAN_REPEATE_MAX=258,this.DEF_HUFFMAN_END_BLOCK=256,this.DEF_HUFFMAN_LENGTH_MINIMUMCODE=257,this.DEF_HUFFMAN_LENGTH_MAXIMUMCODE=285,this.DEF_HUFFMAN_DISTANCE_MAXIMUMCODE=29,this.mCheckSum=1,this.tBuffer=0,this.mBufferedBits=0,this.mTempBuffer=new Uint8Array(4),this.mBlockBuffer=new Uint8Array(this.DEF_MAX_WINDOW_SIZE),this.mbNoWrap=!1,this.mWindowSize=0,this.mCurrentPosition=0,this.mDataLength=0,this.mbCanReadNextBlock=!0,this.mbCanReadMoreData=!0,this.mbCheckSumRead=!1,null==t)throw new DOMException("stream");if(0===t.length)throw new DOMException("stream - string can not be empty");r.a.init(),this.mInputStream=new a(t),this.mbNoWrap=e,this.mbNoWrap||this.readZLibHeader(),this.decodeBlockHeader()}return Object.defineProperty(t.prototype,"mBuffer",{get:function(){return this.tBuffer},set:function(t){this.tBuffer=t},enumerable:!0,configurable:!0}),t.prototype.peekBits=function(t){if(t<0)throw new DOMException("count","Bits count can not be less than zero.");if(t>32)throw new DOMException("count","Count of bits is too large.");if(this.mBufferedBits<t&&this.fillBuffer(),this.mBufferedBits<t)return-1;var e=~(4294967295<<t);return n.a.bitConverterUintToInt32(this.mBuffer&e)},t.prototype.fillBuffer=function(){var t=4-(this.mBufferedBits>>3)-(0!=(7&this.mBufferedBits)?1:0);if(0!==t)for(var e=this.mInputStream.read(this.mTempBuffer,0,t),i=0;i<e;i++)this.mBuffer=n.a.bitConverterInt32ToUint(this.mBuffer|n.a.bitConverterInt32ToUint(this.mTempBuffer[i]<<this.mBufferedBits)),this.mBufferedBits+=8},t.prototype.skipBits=function(t){if(t<0)throw new DOMException("count","Bits count can not be less than zero.");0!==t&&(t>=this.mBufferedBits?(t-=this.mBufferedBits,this.mBufferedBits=0,this.mBuffer=0,t>0&&(this.mInputStream.position+=t>>3,(t&=7)>0&&(this.fillBuffer(),this.mBufferedBits-=t,this.mBuffer=n.a.bitConverterInt32ToUint(this.mBuffer>>>t)))):(this.mBufferedBits-=t,this.mBuffer=n.a.bitConverterInt32ToUint(this.mBuffer>>>t)))},Object.defineProperty(t.prototype,"availableBits",{get:function(){return this.mBufferedBits},enumerable:!0,configurable:!0}),t.prototype.readZLibHeader=function(){var t=this.readInt16();if(-1===t)throw new DOMException("Header of the stream can not be read.");if(t%31!=0)throw new DOMException("Header checksum illegal");if(2048!=(t&this.DEF_HEADER_METHOD_MASK))throw new DOMException("Unsupported compression method.");if(this.mWindowSize=Math.pow(2,8+((t&this.DEF_HEADER_INFO_MASK)>>12)),this.mWindowSize>65535)throw new DOMException("Unsupported window size for deflate compression method.");if((t&this.DEF_HEADER_FLAGS_FDICT)>>5==1)throw new DOMException("Custom dictionary is not supported at the moment.")},t.prototype.readInt16=function(){var t=this.readBits(8)<<8;return t|=this.readBits(8)},t.prototype.readBits=function(t){var e=this.peekBits(t);return-1===e?-1:(this.mBufferedBits-=t,this.mBuffer=n.a.bitConverterInt32ToUint(this.mBuffer>>>t),e)},t.prototype.decodeBlockHeader=function(){if(!this.mbCanReadNextBlock)return!1;var t=this.readBits(1);if(-1===t)return!1;var e=this.readBits(2);if(-1===e)return!1;switch(this.mbCanReadNextBlock=0===t,e){case 0:this.mbReadingUncompressed=!0,this.skipToBoundary();var i=this.readInt16Inverted();if(i!==(65535^this.readInt16Inverted()))throw new DOMException("Wrong block length.");if(i>65535)throw new DOMException("Uncompressed block length can not be more than 65535.");this.mUncompressedDataLength=i,this.mCurrentLengthTree=null,this.mCurrentDistanceTree=null;break;case 1:this.mbReadingUncompressed=!1,this.mUncompressedDataLength=-1,this.mCurrentLengthTree=r.a.lengthTree,this.mCurrentDistanceTree=r.a.distanceTree;break;case 2:this.mbReadingUncompressed=!1,this.mUncompressedDataLength=-1;var n=this.decodeDynamicHeader(this.mCurrentLengthTree,this.mCurrentDistanceTree);this.mCurrentLengthTree=n.lengthTree,this.mCurrentDistanceTree=n.distanceTree;break;default:throw new DOMException("Wrong block type.")}return!0},t.prototype.skipToBoundary=function(){this.mBuffer=n.a.bitConverterInt32ToUint(this.mBuffer>>>(7&this.mBufferedBits)),this.mBufferedBits&=-8},t.prototype.readInt16Inverted=function(){var t=this.readBits(8);return t|=this.readBits(8)<<8},t.prototype.decodeDynamicHeader=function(e,i){var n=0,s=this.readBits(5),o=this.readBits(5),a=this.readBits(4);if(s<0||o<0||a<0)throw new DOMException("Wrong dynamic huffman codes.");s+=257,o+=1;var h=s+o,f=new Uint8Array(h),u=new Uint8Array(19);a+=4;for(var c=0;c<a;){var d=this.readBits(3);if(d<0)throw new DOMException("Wrong dynamic huffman codes.");u[this.defaultHuffmanDynamicTree[c++]]=d}var p=new r.a(u);for(c=0;;){var l=void 0,m=!1;for(l=p.unpackSymbol(this);0==(-16&l);){if(f[c++]=n=l,c===h){m=!0;break}l=p.unpackSymbol(this)}if(m)break;if(l<0)throw new DOMException("Wrong dynamic huffman codes.");if(l>=17)n=0;else if(0===c)throw new DOMException("Wrong dynamic huffman codes.");var g=l-16,v=t.DEF_HUFFMAN_DYNTREE_REPEAT_BITS[g],y=this.readBits(v);if(y<0)throw new DOMException("Wrong dynamic huffman codes.");if(y+=t.DEF_HUFFMAN_DYNTREE_REPEAT_MINIMUMS[g],c+y>h)throw new DOMException("Wrong dynamic huffman codes.");for(;y-- >0;)f[c++]=n;if(c===h)break}var B=new Uint8Array(s);return B.set(f.subarray(0,s),0),e=new r.a(B),B=f.slice(s,s+o),i=new r.a(B),{lengthTree:e,distanceTree:i}},t.prototype.readHuffman=function(){for(var e=this.DEF_MAX_WINDOW_SIZE-(this.mDataLength-this.mCurrentPosition),i=!1,r={};e>=this.DEF_HUFFMAN_REPEATE_MAX;){var n=void 0;for(n=this.mCurrentLengthTree.unpackSymbol(this);0==(-256&n);){if(r[(this.mDataLength+1)%this.DEF_MAX_WINDOW_SIZE]=n,this.mBlockBuffer[this.mDataLength++%this.DEF_MAX_WINDOW_SIZE]=n,i=!0,--e<this.DEF_HUFFMAN_REPEATE_MAX)return!0;n=this.mCurrentLengthTree.unpackSymbol(this)}if(n<this.DEF_HUFFMAN_LENGTH_MINIMUMCODE){if(n<this.DEF_HUFFMAN_END_BLOCK)throw new DOMException("Illegal code.");var s=i?1:0;this.mbCanReadMoreData=this.decodeBlockHeader();return!!(s|(this.mbCanReadMoreData?1:0))}if(n>this.DEF_HUFFMAN_LENGTH_MAXIMUMCODE)throw new DOMException("Illegal repeat code length.");var o=t.DEF_HUFFMAN_REPEAT_LENGTH_BASE[n-this.DEF_HUFFMAN_LENGTH_MINIMUMCODE],a=t.DEF_HUFFMAN_REPEAT_LENGTH_EXTENSION[n-this.DEF_HUFFMAN_LENGTH_MINIMUMCODE];if(a>0){var h=this.readBits(a);if(h<0)throw new DOMException("Wrong data.");o+=h}if((n=this.mCurrentDistanceTree.unpackSymbol(this))<0||n>t.DEF_HUFFMAN_REPEAT_DISTANCE_BASE.length)throw new DOMException("Wrong distance code.");var f=t.DEF_HUFFMAN_REPEAT_DISTANCE_BASE[n];if((a=t.DEF_HUFFMAN_REPEAT_DISTANCE_EXTENSION[n])>0){var h=this.readBits(a);if(h<0)throw new DOMException("Wrong data.");f+=h}for(var u=0;u<o;u++)this.mBlockBuffer[this.mDataLength%this.DEF_MAX_WINDOW_SIZE]=this.mBlockBuffer[(this.mDataLength-f)%this.DEF_MAX_WINDOW_SIZE],this.mDataLength++,e--;i=!0}return i},t.prototype.read=function(t,e,i){if(null==t)throw new DOMException("buffer");if(e<0||e>t.length-1)throw new DOMException("offset","Offset does not belong to specified buffer.");if(i<0||i>t.length-e)throw new DOMException("length","Length is illegal.");for(var r=i;i>0;)if(this.mCurrentPosition<this.mDataLength){var s=this.mCurrentPosition%this.DEF_MAX_WINDOW_SIZE,o=Math.min(this.DEF_MAX_WINDOW_SIZE-s,this.mDataLength-this.mCurrentPosition);o=Math.min(o,i),n.a.arrayCopy(this.mBlockBuffer,s,t,e,o),this.mCurrentPosition+=o,e+=o,i-=o}else{if(!this.mbCanReadMoreData)break;var a=this.mDataLength;if(this.mbReadingUncompressed)if(0===this.mUncompressedDataLength){if(this.mbCanReadMoreData=this.decodeBlockHeader(),!this.mbCanReadMoreData)break}else{var s=this.mDataLength%this.DEF_MAX_WINDOW_SIZE,h=Math.min(this.mUncompressedDataLength,this.DEF_MAX_WINDOW_SIZE-s),f=this.readPackedBytes(this.mBlockBuffer,s,h);if(h!==f)throw new DOMException("Not enough data in stream.");this.mUncompressedDataLength-=f,this.mDataLength+=f}else if(!this.readHuffman())break;if(a<this.mDataLength){var u=a%this.DEF_MAX_WINDOW_SIZE,c=this.mDataLength%this.DEF_MAX_WINDOW_SIZE;u<c?this.checksumUpdate(this.mBlockBuffer,u,c-u):(this.checksumUpdate(this.mBlockBuffer,u,this.DEF_MAX_WINDOW_SIZE-u),c>0&&this.checksumUpdate(this.mBlockBuffer,0,c))}}if(!this.mbCanReadMoreData&&!this.mbCheckSumRead&&!this.mbNoWrap){this.skipToBoundary();if(this.readInt32()!==this.mCheckSum)throw new DOMException("Checksum check failed.");this.mbCheckSumRead=!0}return r-i},t.prototype.readPackedBytes=function(t,e,i){if(null==t)throw new DOMException("buffer");if(e<0||e>t.length-1)throw new DOMException('offset", "Offset can not be less than zero or greater than buffer length - 1.');if(i<0)throw new DOMException('length", "Length can not be less than zero.');if(i>t.length-e)throw new DOMException('length", "Length is too large.');if(0!=(7&this.mBufferedBits))throw new DOMException("Reading of unalligned data is not supported.");if(0===i)return 0;for(var r=0;this.mBufferedBits>0&&i>0;)t[e++]=this.mBuffer,this.mBufferedBits-=8,this.mBuffer=n.a.bitConverterInt32ToUint(this.mBuffer>>>8),i--,r++;return i>0&&(r+=this.mInputStream.read(t,e,i)),r},t.prototype.readInt32=function(){var t=this.readBits(8)<<24;return t|=this.readBits(8)<<16,t|=this.readBits(8)<<8,t|=this.readBits(8)},t.prototype.checksumUpdate=function(t,e,i){s.a.ChecksumUpdate(this.mCheckSum,t,e,i)},t.DEF_REVERSE_BITS=new Uint8Array([0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15]),t.DEF_HUFFMAN_DYNTREE_REPEAT_MINIMUMS=[3,3,11],t.DEF_HUFFMAN_DYNTREE_REPEAT_BITS=[2,3,7],t.DEF_HUFFMAN_REPEAT_LENGTH_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],t.DEF_HUFFMAN_REPEAT_LENGTH_EXTENSION=[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],t.DEF_HUFFMAN_REPEAT_DISTANCE_BASE=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],t.DEF_HUFFMAN_REPEAT_DISTANCE_EXTENSION=[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],t}(),a=function(){function t(t){this.position=0,this.inputStream=new Uint8Array(t.buffer)}return Object.defineProperty(t.prototype,"length",{get:function(){return this.inputStream.buffer.byteLength},enumerable:!0,configurable:!0}),t.prototype.read=function(t,e,i){var r=new Uint8Array(this.inputStream.buffer,this.position+e),n=r.subarray(0,i);return t.set(n,0),this.position+=n.byteLength,n.byteLength},t.prototype.readByte=function(){return this.inputStream[this.position++]},t.prototype.write=function(t,e,i){n.a.arrayCopy(t,0,this.inputStream,this.position+e,i),this.position+=i},t.prototype.toByteArray=function(){return new Uint8Array(this.inputStream.buffer)},t}()},function(t,e,i){"use strict";i.d(e,"a",function(){return h}),i.d(e,"b",function(){return f}),i.d(e,"c",function(){return u});var r=i(3),n=(i.n(r),new Int16Array(286)),s=new Uint8Array(286),o=new Int16Array(30),a=new Uint8Array(30),h=function(){function t(e){this.pendingBuffer=new Uint8Array(65536),this.pendingBufLength=0,this.pendingBufCache=0,this.pendingBufBitsInCache=0,this.bufferPosition=0,this.extraBits=0,this.currentHash=0,this.matchStart=0,this.matchLength=0,this.matchPrevAvail=!1,this.blockStart=0,this.stringStart=0,this.lookAhead=0,this.totalBytesIn=0,this.inputOffset=0,this.inputEnd=0,this.windowSize=32768,this.windowMask=this.windowSize-1,this.hashSize=32768,this.hashMask=this.hashSize-1,this.hashShift=Math.floor(17/3),this.maxDist=this.windowSize-262,this.checkSum=1,this.noWrap=!1,t.isHuffmanTreeInitiated||(t.initHuffmanTree(),t.isHuffmanTreeInitiated=!0),this.treeLiteral=new f(this,286,257,15),this.treeDistances=new f(this,30,1,15),this.treeCodeLengths=new f(this,19,4,7),this.arrDistances=new Uint16Array(16384),this.arrLiterals=new Uint8Array(16384),this.stream=[],this.dataWindow=new Uint8Array(2*this.windowSize),this.hashHead=new Int16Array(this.hashSize),this.hashPrevious=new Int16Array(this.windowSize),this.blockStart=this.stringStart=1,this.noWrap=e,e||this.writeZLibHeader()}return Object.defineProperty(t.prototype,"compressedData",{get:function(){return this.stream},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"getCompressedString",{get:function(){var t="";if(void 0!==this.stream)for(var e=0;e<this.stream.length;e++)t+=String.fromCharCode.apply(null,this.stream[e]);return t},enumerable:!0,configurable:!0}),t.prototype.write=function(t,e,i){if(void 0===t||null===t)throw new Error("ArgumentException: data cannot null or undefined");var n=e+i;if(0>e||e>n||n>t.length)throw new Error("ArgumentOutOfRangeException: Offset or length is incorrect");if("string"==typeof t){var s=new r.Encoding(!1);s.type="Utf8",t=new Uint8Array(s.getBytes(t,0,t.length)),n=e+t.length}for(this.inputBuffer=t,this.inputOffset=e,this.inputEnd=n,this.noWrap||(this.checkSum=u.checksumUpdate(this.checkSum,this.inputBuffer,this.inputOffset,n));this.inputEnd!==this.inputOffset||0!==this.pendingBufLength;)this.pendingBufferFlush(),this.compressData(!1)},t.prototype.writeZLibHeader=function(){var t=30720;t|=64,t+=31-t%31,this.pendingBufferWriteShortBytes(t)},t.prototype.pendingBufferWriteShortBytes=function(t){this.pendingBuffer[this.pendingBufLength++]=t>>8,this.pendingBuffer[this.pendingBufLength++]=t},t.prototype.compressData=function(t){var e;do{this.fillWindow();var i=t&&this.inputEnd===this.inputOffset;e=this.compressSlow(i,t)}while(0===this.pendingBufLength&&e);return e},t.prototype.compressSlow=function(t,e){if(this.lookAhead<262&&!t)return!1;for(;this.lookAhead>=262||t;){if(0===this.lookAhead)return this.lookAheadCompleted(e);this.stringStart>=2*this.windowSize-262&&this.slideWindow();var i=this.matchStart,r=this.matchLength;if(this.lookAhead>=3&&this.discardMatch(),r>=3&&this.matchLength<=r?r=this.matchPreviousBest(i,r):this.matchPreviousAvailable(),this.bufferPosition>=16384)return this.huffmanIsFull(e)}return!0},t.prototype.discardMatch=function(){var t=this.insertString();0!==t&&this.stringStart-t<=this.maxDist&&this.findLongestMatch(t)&&this.matchLength<=5&&3===this.matchLength&&this.stringStart-this.matchStart>4096&&(this.matchLength=2)},t.prototype.matchPreviousAvailable=function(){this.matchPrevAvail&&this.huffmanTallyLit(255&this.dataWindow[this.stringStart-1]),this.matchPrevAvail=!0,this.stringStart++,this.lookAhead--},t.prototype.matchPreviousBest=function(t,e){this.huffmanTallyDist(this.stringStart-1-t,e),e-=2;do{this.stringStart++,--this.lookAhead>=3&&this.insertString()}while(--e>0);return this.stringStart++,this.lookAhead--,this.matchPrevAvail=!1,this.matchLength=2,e},t.prototype.lookAheadCompleted=function(t){return this.matchPrevAvail&&this.huffmanTallyLit(255&this.dataWindow[this.stringStart-1]),this.matchPrevAvail=!1,this.huffmanFlushBlock(this.dataWindow,this.blockStart,this.stringStart-this.blockStart,t),this.blockStart=this.stringStart,!1},t.prototype.huffmanIsFull=function(t){var e=this.stringStart-this.blockStart;this.matchPrevAvail&&e--;var i=t&&0===this.lookAhead&&!this.matchPrevAvail;return this.huffmanFlushBlock(this.dataWindow,this.blockStart,e,i),this.blockStart+=e,!i},t.prototype.fillWindow=function(){for(this.stringStart>=this.windowSize+this.maxDist&&this.slideWindow();this.lookAhead<262&&this.inputOffset<this.inputEnd;){var t=2*this.windowSize-this.lookAhead-this.stringStart;t>this.inputEnd-this.inputOffset&&(t=this.inputEnd-this.inputOffset),this.dataWindow.set(this.inputBuffer.subarray(this.inputOffset,this.inputOffset+t),this.stringStart+this.lookAhead),this.inputOffset+=t,this.totalBytesIn+=t,this.lookAhead+=t}this.lookAhead>=3&&this.updateHash()},t.prototype.slideWindow=function(){this.dataWindow.set(this.dataWindow.subarray(this.windowSize,this.windowSize+this.windowSize),0),this.matchStart-=this.windowSize,this.stringStart-=this.windowSize,this.blockStart-=this.windowSize;for(var t=0;t<this.hashSize;++t){var e=65535&this.hashHead[t];this.hashHead[t]=e>=this.windowSize?e-this.windowSize:0}for(var t=0;t<this.windowSize;t++){var e=65535&this.hashPrevious[t];this.hashPrevious[t]=e>=this.windowSize?e-this.windowSize:0}},t.prototype.insertString=function(){var t,e=(this.currentHash<<this.hashShift^this.dataWindow[this.stringStart+2])&this.hashMask;return this.hashPrevious[this.stringStart&this.windowMask]=t=this.hashHead[e],this.hashHead[e]=this.stringStart,this.currentHash=e,65535&t},t.prototype.findLongestMatch=function(t){var e,i=4096,r=258,n=this.stringStart,s=this.stringStart+this.matchLength,o=Math.max(this.matchLength,2),a=Math.max(this.stringStart-this.maxDist,0),h=this.stringStart+258-1,f=this.dataWindow[s-1],u=this.dataWindow[s],c=this.dataWindow;o>=32&&(i>>=2),r>this.lookAhead&&(r=this.lookAhead);do{if(c[t+o]===u&&c[t+o-1]===f&&c[t]===c[n]&&c[t+1]===c[n+1]){for(e=t+2,n+=2;c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&n<h;);if(n>s){if(this.matchStart=t,s=n,(o=n-this.stringStart)>=r)break;f=c[s-1],u=c[s]}n=this.stringStart}}while((t=65535&this.hashPrevious[t&this.windowMask])>a&&0!=--i);return this.matchLength=Math.min(o,this.lookAhead),this.matchLength>=3},t.prototype.updateHash=function(){this.currentHash=this.dataWindow[this.stringStart]<<this.hashShift^this.dataWindow[this.stringStart+1]},t.prototype.huffmanTallyLit=function(t){return this.arrDistances[this.bufferPosition]=0,this.arrLiterals[this.bufferPosition++]=t,this.treeLiteral.codeFrequencies[t]++,this.bufferPosition>=16384},t.prototype.huffmanTallyDist=function(t,e){this.arrDistances[this.bufferPosition]=t,this.arrLiterals[this.bufferPosition++]=e-3;var i=this.huffmanLengthCode(e-3);this.treeLiteral.codeFrequencies[i]++,i>=265&&i<285&&(this.extraBits+=Math.floor((i-261)/4));var r=this.huffmanDistanceCode(t-1);return this.treeDistances.codeFrequencies[r]++,r>=4&&(this.extraBits+=Math.floor(r/2-1)),this.bufferPosition>=16384},t.prototype.huffmanFlushBlock=function(t,e,i,r){this.treeLiteral.codeFrequencies[256]++,this.treeLiteral.buildTree(),this.treeDistances.buildTree(),this.treeLiteral.calculateBLFreq(this.treeCodeLengths),this.treeDistances.calculateBLFreq(this.treeCodeLengths),this.treeCodeLengths.buildTree();for(var h=4,u=18;u>h;u--)this.treeCodeLengths.codeLengths[f.huffCodeLengthOrders[u]]>0&&(h=u+1);for(var c=14+3*h+this.treeCodeLengths.getEncodedLength()+this.treeLiteral.getEncodedLength()+this.treeDistances.getEncodedLength()+this.extraBits,d=this.extraBits,u=0;u<286;u++)d+=this.treeLiteral.codeFrequencies[u]*s[u];for(var u=0;u<30;u++)d+=this.treeDistances.codeFrequencies[u]*a[u];c>=d&&(c=d),e>=0&&i+4<c>>3?this.huffmanFlushStoredBlock(t,e,i,r):c==d?(this.pendingBufferWriteBits(2+(r?1:0),3),this.treeLiteral.setStaticCodes(n,s),this.treeDistances.setStaticCodes(o,a),this.huffmanCompressBlock(),this.huffmanReset()):(this.pendingBufferWriteBits(4+(r?1:0),3),this.huffmanSendAllTrees(h),this.huffmanCompressBlock(),this.huffmanReset())},t.prototype.huffmanFlushStoredBlock=function(t,e,i,r){this.pendingBufferWriteBits(0+(r?1:0),3),this.pendingBufferAlignToByte(),this.pendingBufferWriteShort(i),this.pendingBufferWriteShort(~i),this.pendingBufferWriteByteBlock(t,e,i),this.huffmanReset()},t.prototype.huffmanLengthCode=function(t){if(255===t)return 285;for(var e=257;t>=8;)e+=4,t>>=1;return e+t},t.prototype.huffmanDistanceCode=function(t){for(var e=0;t>=4;)e+=2,t>>=1;return e+t},t.prototype.huffmanSendAllTrees=function(t){this.treeCodeLengths.buildCodes(),this.treeLiteral.buildCodes(),this.treeDistances.buildCodes(),this.pendingBufferWriteBits(this.treeLiteral.treeLength-257,5),this.pendingBufferWriteBits(this.treeDistances.treeLength-1,5),this.pendingBufferWriteBits(t-4,4);for(var e=0;e<t;e++)this.pendingBufferWriteBits(this.treeCodeLengths.codeLengths[f.huffCodeLengthOrders[e]],3);this.treeLiteral.writeTree(this.treeCodeLengths),this.treeDistances.writeTree(this.treeCodeLengths)},t.prototype.huffmanReset=function(){this.bufferPosition=0,this.extraBits=0,this.treeLiteral.reset(),this.treeDistances.reset(),this.treeCodeLengths.reset()},t.prototype.huffmanCompressBlock=function(){for(var t=0;t<this.bufferPosition;t++){var e=255&this.arrLiterals[t],i=this.arrDistances[t];if(0!=i--){var r=this.huffmanLengthCode(e);this.treeLiteral.writeCodeToStream(r);var n=Math.floor((r-261)/4);n>0&&n<=5&&this.pendingBufferWriteBits(e&(1<<n)-1,n);var s=this.huffmanDistanceCode(i);this.treeDistances.writeCodeToStream(s),n=Math.floor(s/2-1),n>0&&this.pendingBufferWriteBits(i&(1<<n)-1,n)}else this.treeLiteral.writeCodeToStream(e)}this.treeLiteral.writeCodeToStream(256)},t.prototype.pendingBufferWriteBits=function(t,e){var i=new Uint32Array(1);i[0]=this.pendingBufCache|t<<this.pendingBufBitsInCache,this.pendingBufCache=i[0],this.pendingBufBitsInCache+=e,this.pendingBufferFlushBits()},t.prototype.pendingBufferFlush=function(t){if(this.pendingBufferFlushBits(),this.pendingBufLength>0){var e=new Uint8Array(this.pendingBufLength);e.set(this.pendingBuffer.subarray(0,this.pendingBufLength),0),this.stream.push(e)}this.pendingBufLength=0},t.prototype.pendingBufferFlushBits=function(){for(var t=0;this.pendingBufBitsInCache>=8&&this.pendingBufLength<65536;)this.pendingBuffer[this.pendingBufLength++]=this.pendingBufCache,this.pendingBufCache>>=8,this.pendingBufBitsInCache-=8,t++;return t},t.prototype.pendingBufferWriteByteBlock=function(t,e,i){var r=t.subarray(e,e+i);this.pendingBuffer.set(r,this.pendingBufLength),this.pendingBufLength+=i},t.prototype.pendingBufferWriteShort=function(t){this.pendingBuffer[this.pendingBufLength++]=t,this.pendingBuffer[this.pendingBufLength++]=t>>8},t.prototype.pendingBufferAlignToByte=function(){this.pendingBufBitsInCache>0&&(this.pendingBuffer[this.pendingBufLength++]=this.pendingBufCache),this.pendingBufCache=0,this.pendingBufBitsInCache=0},t.initHuffmanTree=function(){for(var t=0;t<144;)n[t]=f.bitReverse(48+t<<8),s[t++]=8;for(;t<256;)n[t]=f.bitReverse(256+t<<7),s[t++]=9;for(;t<280;)n[t]=f.bitReverse(-256+t<<9),s[t++]=7;for(;t<286;)n[t]=f.bitReverse(-88+t<<8),s[t++]=8;for(t=0;t<30;t++)o[t]=f.bitReverse(t<<11),a[t]=5},t.prototype.close=function(){do{this.pendingBufferFlush(!0),this.compressData(!0)||(this.pendingBufferFlush(!0),this.pendingBufferAlignToByte(),this.noWrap||(this.pendingBufferWriteShortBytes(this.checkSum>>16),this.pendingBufferWriteShortBytes(65535&this.checkSum)),this.pendingBufferFlush(!0))}while(this.inputEnd!==this.inputOffset||0!==this.pendingBufLength)},t.prototype.destroy=function(){this.stream=[],this.stream=void 0,this.pendingBuffer=void 0,this.treeLiteral=void 0,this.treeDistances=void 0,this.treeCodeLengths=void 0,this.arrLiterals=void 0,this.arrDistances=void 0,this.hashHead=void 0,this.hashPrevious=void 0,this.dataWindow=void 0,this.inputBuffer=void 0,this.pendingBufLength=void 0,this.pendingBufCache=void 0,this.pendingBufBitsInCache=void 0,this.bufferPosition=void 0,this.extraBits=void 0,this.currentHash=void 0,this.matchStart=void 0,this.matchLength=void 0,this.matchPrevAvail=void 0,this.blockStart=void 0,this.stringStart=void 0,this.lookAhead=void 0,this.totalBytesIn=void 0,this.inputOffset=void 0,this.inputEnd=void 0,this.windowSize=void 0,this.windowMask=void 0,this.hashSize=void 0,this.hashMask=void 0,this.hashShift=void 0,this.maxDist=void 0,this.checkSum=void 0,this.noWrap=void 0},t.isHuffmanTreeInitiated=!1,t}(),f=function(){function t(t,e,i,r){this.writer=t,this.codeMinCount=i,this.maxLength=r,this.codeFrequency=new Uint16Array(e),this.lengthCount=new Int32Array(r)}return Object.defineProperty(t.prototype,"treeLength",{get:function(){return this.codeCount},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"codeLengths",{get:function(){return this.codeLength},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"codeFrequencies",{get:function(){return this.codeFrequency},enumerable:!0,configurable:!0}),t.prototype.setStaticCodes=function(t,e){var i=new Int16Array(t.length);i.set(t,0),this.codes=i;var r=new Uint8Array(e.length);r.set(e,0),this.codeLength=r},t.prototype.reset=function(){for(var t=0;t<this.codeFrequency.length;t++)this.codeFrequency[t]=0;this.codes=void 0,this.codeLength=void 0},t.prototype.writeCodeToStream=function(t){this.writer.pendingBufferWriteBits(65535&this.codes[t],this.codeLength[t])},t.prototype.buildCodes=function(){var e=new Int32Array(this.maxLength);this.codes=new Int16Array(this.codeCount);for(var i=0,r=0;r<this.maxLength;r++)e[r]=i,i+=this.lengthCount[r]<<15-r;for(var n=0;n<this.codeCount;n++){var s=this.codeLength[n];s>0&&(this.codes[n]=t.bitReverse(e[s-1]),e[s-1]+=1<<16-s)}},t.bitReverse=function(e){return t.reverseBits[15&e]<<12|t.reverseBits[e>>4&15]<<8|t.reverseBits[e>>8&15]<<4|t.reverseBits[e>>12]},t.prototype.getEncodedLength=function(){for(var t=0,e=0;e<this.codeFrequency.length;e++)t+=this.codeFrequency[e]*this.codeLength[e];return t},t.prototype.calculateBLFreq=function(t){for(var e,i,r,n=-1,s=0;s<this.codeCount;){r=1;var o=this.codeLength[s];for(0===o?(e=138,i=3):(e=6,i=3,n!==o&&(t.codeFrequency[o]++,r=0)),n=o,s++;s<this.codeCount&&n===this.codeLength[s]&&(s++,!(++r>=e)););r<i?t.codeFrequency[n]+=r:0!==n?t.codeFrequency[16]++:r<=10?t.codeFrequency[17]++:t.codeFrequency[18]++}},t.prototype.writeTree=function(t){for(var e,i,r,n=-1,s=0;s<this.codeCount;){r=1;var o=this.codeLength[s];for(0===o?(e=138,i=3):(e=6,i=3,n!==o&&(t.writeCodeToStream(o),r=0)),n=o,s++;s<this.codeCount&&n===this.codeLength[s]&&(s++,!(++r>=e)););if(r<i)for(;r-- >0;)t.writeCodeToStream(n);else 0!==n?(t.writeCodeToStream(16),this.writer.pendingBufferWriteBits(r-3,2)):r<=10?(t.writeCodeToStream(17),this.writer.pendingBufferWriteBits(r-3,3)):(t.writeCodeToStream(18),this.writer.pendingBufferWriteBits(r-11,7))}},t.prototype.buildTree=function(){for(var t=this.codeFrequency.length,e=new Int32Array(t),i=0,r=0,n=0;n<t;n++){var s=this.codeFrequency[n];if(0!==s){for(var o=i++,a=0;o>0&&this.codeFrequency[e[a=Math.floor((o-1)/2)]]>s;)e[o]=e[a],o=a;e[o]=n,r=n}}for(;i<2;)e[i++]=r<2?++r:0;this.codeCount=Math.max(r+1,this.codeMinCount);for(var h=i,f=h,u=new Int32Array(4*i-2),c=new Int32Array(2*i-1),d=0;d<i;d++){var p=e[d],l=2*d;u[l]=p,u[l+1]=-1,c[d]=this.codeFrequency[p]<<8,e[d]=d}this.constructHuffmanTree(e,i,c,f,u),this.buildLength(u)},t.prototype.constructHuffmanTree=function(t,e,i,r,n){do{for(var s=t[0],o=t[--e],a=i[o],h=0,f=1;f<e;)f+1<e&&i[t[f]]>i[t[f+1]]&&f++,t[h]=t[f],h=f,f=2*h+1;for(;(f=h)>0&&i[t[h=Math.floor((f-1)/2)]]>a;)t[f]=t[h];t[f]=o;var u=t[0];o=r++,n[2*o]=s,n[2*o+1]=u;var c=Math.min(255&i[s],255&i[u]);for(i[o]=a=i[s]+i[u]-c+1,h=0,f=1;f<e;)f+1<e&&i[t[f]]>i[t[f+1]]&&f++,t[h]=t[f],h=f,f=2*h+1;for(;(f=h)>0&&i[t[h=Math.floor((f-1)/2)]]>a;)t[f]=t[h];t[f]=o}while(e>1)},t.prototype.buildLength=function(t){this.codeLength=new Uint8Array(this.codeFrequency.length);for(var e=Math.floor(t.length/2),i=Math.floor((e+1)/2),r=0,n=0;n<this.maxLength;n++)this.lengthCount[n]=0;if(0!==(r=this.calculateOptimalCodeLength(t,r,e))){var s=this.maxLength-1;do{for(;0===this.lengthCount[--s];);do{this.lengthCount[s]--,this.lengthCount[++s]++,r-=1<<this.maxLength-1-s}while(r>0&&s<this.maxLength-1)}while(r>0);this.recreateTree(t,r,i)}},t.prototype.recreateTree=function(t,e,i){this.lengthCount[this.maxLength-1]+=e,this.lengthCount[this.maxLength-2]-=e;for(var r=2*i,n=this.maxLength;0!==n;n--)for(var s=this.lengthCount[n-1];s>0;){var o=2*t[r++];-1===t[o+1]&&(this.codeLength[t[o]]=n,s--)}},t.prototype.calculateOptimalCodeLength=function(t,e,i){var r=new Int32Array(i);r[i-1]=0;for(var n=i-1;n>=0;n--){var s=2*n+1;if(-1!==t[s]){var o=r[n]+1;o>this.maxLength&&(o=this.maxLength,e++),r[t[s-1]]=r[t[s]]=o}else{var o=r[n];this.lengthCount[o-1]++,this.codeLength[t[s-1]]=r[n]}}return e},t.reverseBits=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],t.huffCodeLengthOrders=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],t}(),u=function(){function t(){}return t.checksumUpdate=function(e,i,r,n){var s=new Uint32Array(1);s[0]=e;for(var o=s[0],a=s[0]=65535&o,h=s[0]=o>>t.checkSumBitOffset;n>0;){var f=Math.min(n,t.checksumIterationCount);for(n-=f;--f>=0;)a+=s[0]=255&i[r++],h+=a;a%=t.checksumBase,h%=t.checksumBase}return o=h<<t.checkSumBitOffset|a},t.checkSumBitOffset=16,t.checksumBase=65521,t.checksumIterationCount=3800,t}()},function(t,e,i){"use strict";i.d(e,"a",function(){return a}),i.d(e,"b",function(){return h}),i.d(e,"c",function(){return f});var r=i(1),n=i(3),s=(i.n(n),i(0)),o=[],a=function(){function t(){0===o.length&&t.initCrc32Table(),this.files=[],this.level="Normal",n.Save.isMicrosoftBrowser=!!navigator.msSaveBlob}return Object.defineProperty(t.prototype,"items",{get:function(){return this.files},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"compressionLevel",{get:function(){return this.level},set:function(t){this.level=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return void 0===this.files?0:this.files.length},enumerable:!0,configurable:!0}),t.prototype.addItem=function(t){if(null===t||void 0===t)throw new Error("ArgumentException: item cannot be null or undefined");for(var e=0;e<this.files.length;e++){var i=this.files[e];if(i instanceof f&&i.name===t.name)throw new Error("item with same name already exist")}this.files.push(t)},t.prototype.addDirectory=function(t){if(null===t||void 0===t)throw new Error("ArgumentException: string cannot be null or undefined");if(0===t.length)throw new Error("ArgumentException: string cannot be empty");if("/"!==t.slice(-1)&&(t+="/"),-1!==this.files.indexOf(t))throw new Error("item with same name already exist");this.files.push(t)},t.prototype.getItem=function(t){if(t>=0&&t<this.files.length)return this.files[t]},t.prototype.contains=function(t){return-1!==this.files.indexOf(t)},t.prototype.open=function(e){var i=s.a.encodedString(e);if(0==i.length)throw new DOMException("stream");var n=new r.Stream(i),o=t.findValueFromEnd(n,101010256,65557);if(o<0)throw new DOMException("Can't locate end of central directory record. Possible wrong file format or archive is corrupt.");n.position=o+12;var a=t.ReadInt32(n),h=o-a;n.position=h,this.readCentralDirectoryDataAndExtractItems(n)},t.prototype.readCentralDirectoryDataAndExtractItems=function(e){if(null==e)throw new DOMException("stream");for(var i;33639248==t.ReadInt32(e);)i=new h,i.readCentralDirectoryData(e);i.readData(e,i.checkCrc),i.decompressData(),this.files.push(new f(i.unCompressedStream.buffer,i.name))},t.prototype.save=function(t){if(null===t||void 0===t||0===t.length)throw new Error("ArgumentException: fileName cannot be null or undefined");if(0===this.files.length)throw new Error("InvalidOperation");var e=this;return new Promise(function(i,r){e.saveInternal(t,!1).then(function(){i(e)})})},t.prototype.saveAsBlob=function(){var t=this;return new Promise(function(e,i){t.saveInternal("",!0).then(function(t){e(t)})})},t.prototype.saveInternal=function(t,e){var i=this,r=this;return new Promise(function(n,s){for(var o=[],a=0,h=0;h<r.files.length;h++){i.getCompressedData(i.files[h]).then(function(i){if(a=r.constructZippedObject(o,i,a,i.isDirectory),o.length===r.files.length){var s=r.writeZippedContent(t,o,a,e);n(s)}})}})},t.prototype.destroy=function(){if(void 0!==this.files&&this.files.length>0){for(var t=0;t<this.files.length;t++){var e=this.files[t];e instanceof f&&e.destroy(),e=void 0}this.files=[]}this.files=void 0,this.level=void 0},t.prototype.getCompressedData=function(t){var e=this;return new Promise(function(i,r){if(t instanceof f){var n=new FileReader;n.onload=function(){var r=new Uint8Array(n.result),s={fileName:t.name,crc32Value:0,compressedData:[],compressedSize:void 0,uncompressedDataSize:r.length,compressionType:void 0,isDirectory:!1};if("Normal"===e.level){e.compressData(r,s,o);for(var a=0,h=0;h<s.compressedData.length;h++)a+=s.compressedData[h].length;s.compressedSize=a,s.compressionType="\b\0"}else s.compressedSize=r.length,s.crc32Value=e.calculateCrc32Value(0,r,o),s.compressionType="\0\0",s.compressedData.push(r);i(s)},n.readAsArrayBuffer(t.data)}else{i({fileName:t,crc32Value:0,compressedData:"",compressedSize:0,uncompressedDataSize:0,compressionType:"\0\0",isDirectory:!0})}})},t.prototype.compressData=function(t,e,i){var n=new r.CompressedStreamWriter(!0),s=0,o=0;do{if(s>=t.length){n.close();break}o=Math.min(t.length,s+16384);var a=t.subarray(s,o);e.crc32Value=this.calculateCrc32Value(e.crc32Value,a,i),n.write(a,0,o-s),s=o}while(s<=t.length);e.compressedData=n.compressedData,n.destroy()},t.prototype.constructZippedObject=function(t,e,i,r){var n=0,s=new Date;r&&(n|=16),n|=0;var o=this.writeHeader(e,s),a="PK"+o+e.fileName,h=this.writeCentralDirectory(e,o,i,n);return t.push({localHeader:a,centralDir:h,compressedData:e}),i+a.length+e.compressedSize},t.prototype.writeHeader=function(t,e){var i="";return i+="\n\0\0\0",i+=t.compressionType,i+=this.getBytes(this.getModifiedTime(e),2),i+=this.getBytes(this.getModifiedDate(e),2),i+=this.getBytes(t.crc32Value,4),i+=this.getBytes(t.compressedSize,4),i+=this.getBytes(t.uncompressedDataSize,4),i+=this.getBytes(t.fileName.length,2),i+=this.getBytes(0,2)},t.prototype.writeZippedContent=function(t,e,i,r){for(var s=0,o=[],a=0;a<e.length;a++){var h=e[a];for(s+=h.centralDir.length,o.push(this.getArrayBuffer(h.localHeader));h.compressedData.compressedData.length;)o.push(h.compressedData.compressedData.shift().buffer)}for(var a=0;a<e.length;a++)o.push(this.getArrayBuffer(e[a].centralDir));o.push(this.getArrayBuffer(this.writeFooter(e,s,i)));var f=new Blob(o,{type:"application/zip"});return r||n.Save.save(t,f),f},t.prototype.writeCentralDirectory=function(t,e,i,r){return"PK"+this.getBytes(20,2)+e+this.getBytes(0,2)+"\0\0\0\0"+this.getBytes(r,4)+this.getBytes(i,4)+t.fileName},t.prototype.writeFooter=function(t,e,i){return"PK\0\0\0\0"+this.getBytes(t.length,2)+this.getBytes(t.length,2)+this.getBytes(e,4)+this.getBytes(i,4)+this.getBytes(0,2)},t.prototype.getArrayBuffer=function(t){for(var e=new Uint8Array(t.length),i=0;i<t.length;++i)e[i]=255&t.charCodeAt(i);return e.buffer},t.prototype.getBytes=function(t,e){for(var i="",r=0;r<e;r++)i+=String.fromCharCode(255&t),t>>>=8;return i},t.prototype.getModifiedTime=function(t){var e=t.getHours();return e<<=6,e|=t.getMinutes(),e<<=5,e|=t.getSeconds()/2},t.prototype.getModifiedDate=function(t){var e=t.getFullYear()-1980;return e<<=4,e|=t.getMonth()+1,e<<=5,e|=t.getDate()},t.prototype.calculateCrc32Value=function(t,e,i){t^=-1;for(var r=0;r<e.length;r++)t=t>>>8^i[255&(t^e[r])];return-1^t},t.initCrc32Table=function(){for(var t,e=0;e<256;e++){t=e;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;o[e]=t}},t.findValueFromEnd=function(t,e,i){if(null==t)throw new DOMException("stream");var r=t.inputStream.buffer.byteLength;if(r<4)return-1;var n=new Uint8Array(4),s=Math.max(0,r-i),o=r-1-4;t.position=o,t.read(n,0,4);var a=n[0],h=a==e;if(!h)for(;o>s;)if(a<<=8,o--,t.position=o,(a+=t.readByte())==e){h=!0;break}return h?o:-1},t.ReadInt32=function(t){var e=new Uint8Array(4);if(4!=t.read(e,0,4))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return s.a.bitConverterToInt32(e,0)},t.ReadInt16=function(t){var e=new Uint8Array(2);if(2!=t.read(e,0,2))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return s.a.bitConverterToInt16(e,0)},t.ReadUInt16=function(t){var e=new Uint8Array(2);if(2!=t.read(e,0,2))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return s.a.bitConverterToInt16(e,0)},t}(),h=function(){function t(){this.headerSignature=67324752,this.checkCrc=!0,this.crc32=0}return t.prototype.readCentralDirectoryData=function(t){t.position+=4,this.options=a.ReadInt16(t),this.compressionMethod=a.ReadInt16(t),this.checkCrc=99!=this.compressionMethod;a.ReadInt32(t);this.crc32=s.a.bitConverterToUInt32(a.ReadInt32(t)),this.compressedSize=a.ReadInt32(t),this.originalSize=a.ReadInt32(t);var e=a.ReadInt16(t),i=a.ReadInt16(t),r=a.ReadInt16(t);t.position+=4,this.externalAttributes=a.ReadInt32(t),this.localHeaderOffset=a.ReadInt32(t);var n=new Uint8Array(e);t.read(n,0,e);var o=s.a.byteToString(n);o=o.replace("\\","/"),this.name=o,t.position+=i+r,0!=this.options&&(this.options=0)},t.prototype.readData=function(t,e){if(0==t.length)throw new DOMException("stream");t.position=this.localHeaderOffset,this.checkCrc=e,this.readLocalHeader(t),this.readCompressedData(t)},t.prototype.decompressData=function(){8==this.compressionMethod&&this.originalSize>0&&this.decompressDataOld()},t.prototype.decompressDataOld=function(){var t,e=new r.CompressedStreamReader(this.compressedStream,!0);this.originalSize>0&&(t=new r.Stream(new Uint8Array(this.originalSize)));var i,n=new Uint8Array(4096);for(new Uint8Array(0);(i=e.read(n,0,4096))>0;)t.write(n.subarray(0,i),0,i);this.unCompressedStream=t.toByteArray(),this.checkCrc},t.prototype.readLocalHeader=function(t){if(0==t.length)throw new DOMException("stream");if(a.ReadInt32(t)!=this.headerSignature)throw new DOMException("Can't find local header signature - wrong file format or file is corrupt.");t.position+=22;var e=a.ReadInt16(t),i=a.ReadUInt16(t);if(99==this.compressionMethod);else if(i>2){t.position+=e;var r=a.ReadInt16(t);if(23==r)throw new DOMException("UnSupported");t.position+=i-2}else t.position+=e+i},t.prototype.readCompressedData=function(t){var e;if(this.compressedSize>0){var i=this.compressedSize;e=new r.Stream(new Uint8Array(i));for(var n=new Uint8Array(4096);i>0;){var s=Math.min(i,4096);if(t.read(n,0,s)!=s)throw new DOMException("End of file reached - wrong file format or file is corrupt.");e.write(n.subarray(0,s),0,s),i-=s}this.compressedStream=new Uint8Array(e.inputStream)}else this.compressedSize<0||this.compressedSize},t}(),f=function(){function t(t,e){if(null===t||void 0===t)throw new Error("ArgumentException: data cannot be null or undefined");if(null===e||void 0===e)throw new Error("ArgumentException: string cannot be null or undefined");if(0===e.length)throw new Error("string cannot be empty");this.data=t,this.name=e}return Object.defineProperty(t.prototype,"dataStream",{get:function(){return this.decompressedStream},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.fileName},set:function(t){this.fileName=t},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this.fileName=void 0,this.data=void 0},t}()},function(t,e,i){"use strict";i.d(e,"a",function(){return r});var r=function(){function t(){}return t.ChecksumUpdate=function(t,e,i,r){for(var n=t,s=65535&n,o=n>>this.DEF_CHECKSUM_BIT_OFFSET;r>0;){var a=Math.min(r,this.DEF_CHECKSUM_ITERATIONSCOUNT);for(r-=a;--a>=0;)s+=255&e[i++],o+=s;s%=this.DEF_CHECKSUM_BASE,o%=this.DEF_CHECKSUM_BASE}n=o<<this.DEF_CHECKSUM_BIT_OFFSET|s,t=n},t.ChecksumGenerate=function(e,i,r){return t.ChecksumUpdate(1,e,i,r),1},t.DEF_CHECKSUM_BIT_OFFSET=16,t.DEF_CHECKSUM_BASE=65521,t.DEF_CHECKSUM_ITERATIONSCOUNT=3800,t}()}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("SyncfusionFileUtils")):"function"==typeof define&&define.amd?define(["SyncfusionFileUtils"],e):"object"==typeof exports?exports.SyncfusionCompression=e(require("SyncfusionFileUtils")):t.SyncfusionCompression=e(t.SyncfusionFileUtils)}(self,(t=>(()=>{"use strict";var e={115:e=>{e.exports=t}},i={};function r(t){var n=i[t];if(void 0!==n)return n.exports;var s=i[t]={exports:{}};return e[t](s,s.exports,r),s.exports}r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{r.r(n),r.d(n,{ChecksumCalculator:()=>m,CompressedStreamReader:()=>B,CompressedStreamWriter:()=>p,CompressorHuffmanTree:()=>l,DecompressorHuffmanTree:()=>g,Stream:()=>v,Utils:()=>e,ZipArchive:()=>o,ZipArchiveItem:()=>a,ZipArchiveItemHelper:()=>h});var t=r(115),e=function(){function t(){}return t.bitReverse=function(e){return t.reverseBits[15&e]<<12|t.reverseBits[e>>4&15]<<8|t.reverseBits[e>>8&15]<<4|t.reverseBits[e>>12]},t.bitConverterToInt32=function(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24},t.bitConverterToInt16=function(t,e){return t[e]|t[e+1]<<8},t.bitConverterToUInt32=function(t){var e=new Uint32Array(1);return e[0]=t,e[0]},t.bitConverterToUInt16=function(t,e){var i=new Uint16Array(1);return i[0]=t[e]|t[e+1]<<8,i[0]},t.bitConverterUintToInt32=function(t){var e=new Int32Array(1);return e[0]=t,e[0]},t.bitConverterInt32ToUint=function(t){var e=new Uint32Array(1);return e[0]=t,e[0]},t.bitConverterInt32ToInt16=function(t){var e=new Int16Array(1);return e[0]=t,e[0]},t.byteToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},t.byteIntToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},t.arrayCopy=function(t,e,i,r,n){var s=new Uint8Array(t.buffer,e).subarray(0,n);i.set(s,r)},t.mergeArray=function(t,e){var i=new Uint8Array(t.length+e.length);return i.set(t),i.set(e,t.length),i},t.encodedString=function(t){var e,i,r,n,s,o,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,f=0,u=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(t.charAt(t.length-1)===h.charAt(64)&&u--,t.charAt(t.length-2)===h.charAt(64)&&u--,u%1!=0)throw new Error("Invalid base64 input, bad content length.");for(var c=new Uint8Array(0|u);a<t.length;)e=h.indexOf(t.charAt(a++))<<2|(n=h.indexOf(t.charAt(a++)))>>4,i=(15&n)<<4|(s=h.indexOf(t.charAt(a++)))>>2,r=(3&s)<<6|(o=h.indexOf(t.charAt(a++))),c[f++]=e,64!==s&&(c[f++]=i),64!==o&&(c[f++]=r);return c},t.reverseBits=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],t.huffCodeLengthOrders=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],t}(),i=[],s=4096,o=function(){function r(){0===i.length&&r.initCrc32Table(),this.files=[],this.level="Normal",t.Save.isMicrosoftBrowser=!!navigator.msSaveBlob}return Object.defineProperty(r.prototype,"items",{get:function(){return this.files},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"compressionLevel",{get:function(){return this.level},set:function(t){this.level=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"length",{get:function(){return void 0===this.files?0:this.files.length},enumerable:!0,configurable:!0}),r.prototype.addItem=function(t){if(null==t)throw new Error("ArgumentException: item cannot be null or undefined");for(var e=0;e<this.files.length;e++){var i=this.files[e];if(i instanceof a&&i.name===t.name)throw new Error("item with same name already exist")}this.files.push(t)},r.prototype.addDirectory=function(t){if(null==t)throw new Error("ArgumentException: string cannot be null or undefined");if(0===t.length)throw new Error("ArgumentException: string cannot be empty");if("/"!==t.slice(-1)&&(t+="/"),-1!==this.files.indexOf(t))throw new Error("item with same name already exist");this.files.push(t)},r.prototype.getItem=function(t){if(t>=0&&t<this.files.length)return this.files[t]},r.prototype.contains=function(t){return-1!==this.files.indexOf(t)},r.prototype.open=function(t){var i=e.encodedString(t);if(0==i.length)throw new DOMException("stream");var n=new v(i),s=r.findValueFromEnd(n,101010256,65557);if(s<0)throw new DOMException("Can't locate end of central directory record. Possible wrong file format or archive is corrupt.");n.position=s+12;var o=s-r.ReadInt32(n);n.position=o,this.readCentralDirectoryDataAndExtractItems(n)},r.prototype.readCentralDirectoryDataAndExtractItems=function(t){if(null==t)throw new DOMException("stream");for(var e;33639248==r.ReadInt32(t);)(e=new h).readCentralDirectoryData(t);e.readData(t,e.checkCrc),e.decompressData(),this.files.push(new a(e.unCompressedStream.buffer,e.name))},r.prototype.save=function(t){if(null==t||0===t.length)throw new Error("ArgumentException: fileName cannot be null or undefined");if(0===this.files.length)throw new Error("InvalidOperation");var e=this;return new Promise((function(i,r){e.saveInternal(t,!1).then((function(){i(e)}))}))},r.prototype.saveAsBlob=function(){var t=this;return new Promise((function(e,i){t.saveInternal("",!0).then((function(t){e(t)}))}))},r.prototype.saveInternal=function(t,e){var i=this,r=this;return new Promise((function(n,s){for(var o=[],h=0,a=0;a<r.files.length;a++){i.getCompressedData(i.files[a]).then((function(i){if(h=r.constructZippedObject(o,i,h,i.isDirectory),o.length===r.files.length){var s=r.writeZippedContent(t,o,h,e);n(s)}}))}}))},r.prototype.destroy=function(){if(void 0!==this.files&&this.files.length>0){for(var t=0;t<this.files.length;t++){var e=this.files[t];e instanceof a&&e.destroy(),e=void 0}this.files=[]}this.files=void 0,this.level=void 0},r.prototype.getCompressedData=function(t){var e=this;return new Promise((function(r,n){if(t instanceof a){var s=new FileReader;s.onload=function(){var n=new Uint8Array(s.result),o={fileName:t.name,crc32Value:0,compressedData:[],compressedSize:void 0,uncompressedDataSize:n.length,compressionType:void 0,isDirectory:!1};if("Normal"===e.level){e.compressData(n,o,i);for(var h=0,a=0;a<o.compressedData.length;a++)h+=o.compressedData[a].length;o.compressedSize=h,o.compressionType="\b\0"}else o.compressedSize=n.length,o.crc32Value=e.calculateCrc32Value(0,n,i),o.compressionType="\0\0",o.compressedData.push(n);r(o)},s.readAsArrayBuffer(t.data)}else{r({fileName:t,crc32Value:0,compressedData:"",compressedSize:0,uncompressedDataSize:0,compressionType:"\0\0",isDirectory:!0})}}))},r.prototype.compressData=function(t,e,i){var r=new p(!0),n=0,s=0;do{if(n>=t.length){r.close();break}s=Math.min(t.length,n+16384);var o=t.subarray(n,s);e.crc32Value=this.calculateCrc32Value(e.crc32Value,o,i),r.write(o,0,s-n),n=s}while(n<=t.length);e.compressedData=r.compressedData,r.destroy()},r.prototype.constructZippedObject=function(t,e,i,r){var n=0,s=new Date;r&&(n|=16),n|=0;var o=this.writeHeader(e,s),h="PK"+o+e.fileName,a=this.writeCentralDirectory(e,o,i,n);return t.push({localHeader:h,centralDir:a,compressedData:e}),i+h.length+e.compressedSize},r.prototype.writeHeader=function(t,e){var i="";return i+="\n\0\0\0",i+=t.compressionType,i+=this.getBytes(this.getModifiedTime(e),2),i+=this.getBytes(this.getModifiedDate(e),2),i+=this.getBytes(t.crc32Value,4),i+=this.getBytes(t.compressedSize,4),i+=this.getBytes(t.uncompressedDataSize,4),i+=this.getBytes(t.fileName.length,2),i+=this.getBytes(0,2)},r.prototype.writeZippedContent=function(e,i,r,n){for(var s=0,o=[],h=0;h<i.length;h++){var a=i[h];for(s+=a.centralDir.length,o.push(this.getArrayBuffer(a.localHeader));a.compressedData.compressedData.length;)o.push(a.compressedData.compressedData.shift().buffer)}for(h=0;h<i.length;h++)o.push(this.getArrayBuffer(i[h].centralDir));o.push(this.getArrayBuffer(this.writeFooter(i,s,r)));var f=new Blob(o,{type:"application/zip"});return n||t.Save.save(e,f),f},r.prototype.writeCentralDirectory=function(t,e,i,r){return"PK"+this.getBytes(20,2)+e+this.getBytes(0,2)+"\0\0\0\0"+this.getBytes(r,4)+this.getBytes(i,4)+t.fileName},r.prototype.writeFooter=function(t,e,i){return"PK\0\0\0\0"+this.getBytes(t.length,2)+this.getBytes(t.length,2)+this.getBytes(e,4)+this.getBytes(i,4)+this.getBytes(0,2)},r.prototype.getArrayBuffer=function(t){for(var e=new Uint8Array(t.length),i=0;i<t.length;++i)e[i]=255&t.charCodeAt(i);return e.buffer},r.prototype.getBytes=function(t,e){for(var i="",r=0;r<e;r++)i+=String.fromCharCode(255&t),t>>>=8;return i},r.prototype.getModifiedTime=function(t){var e=t.getHours();return e<<=6,e|=t.getMinutes(),(e<<=5)|t.getSeconds()/2},r.prototype.getModifiedDate=function(t){var e=t.getFullYear()-1980;return e<<=4,e|=t.getMonth()+1,(e<<=5)|t.getDate()},r.prototype.calculateCrc32Value=function(t,e,i){t^=-1;for(var r=0;r<e.length;r++)t=t>>>8^i[255&(t^e[r])];return~t},r.initCrc32Table=function(){for(var t,e=0;e<256;e++){t=e;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;i[e]=t}},r.findValueFromEnd=function(t,e,i){if(null==t)throw new DOMException("stream");var r=t.inputStream.buffer.byteLength;if(r<4)return-1;var n=new Uint8Array(4),s=Math.max(0,r-i),o=r-1-4;t.position=o,t.read(n,0,4);var h=n[0],a=h==e;if(!a)for(;o>s;)if(h<<=8,o--,t.position=o,(h+=t.readByte())==e){a=!0;break}return a?o:-1},r.ReadInt32=function(t){var i=new Uint8Array(4);if(4!=t.read(i,0,4))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return e.bitConverterToInt32(i,0)},r.ReadInt16=function(t){var i=new Uint8Array(2);if(2!=t.read(i,0,2))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return e.bitConverterToInt16(i,0)},r.ReadUInt16=function(t){var i=new Uint8Array(2);if(2!=t.read(i,0,2))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return e.bitConverterToInt16(i,0)},r}(),h=function(){function t(){this.headerSignature=67324752,this.checkCrc=!0,this.crc32=0}return t.prototype.readCentralDirectoryData=function(t){t.position+=4,this.options=o.ReadInt16(t),this.compressionMethod=o.ReadInt16(t),this.checkCrc=99!=this.compressionMethod;o.ReadInt32(t);this.crc32=e.bitConverterToUInt32(o.ReadInt32(t)),this.compressedSize=o.ReadInt32(t),this.originalSize=o.ReadInt32(t);var i=o.ReadInt16(t),r=o.ReadInt16(t),n=o.ReadInt16(t);t.position+=4,this.externalAttributes=o.ReadInt32(t),this.localHeaderOffset=o.ReadInt32(t);var s=new Uint8Array(i);t.read(s,0,i);var h=e.byteToString(s);h=h.replace("\\","/"),this.name=h,t.position+=r+n,0!=this.options&&(this.options=0)},t.prototype.readData=function(t,e){if(0==t.length)throw new DOMException("stream");t.position=this.localHeaderOffset,this.checkCrc=e,this.readLocalHeader(t),this.readCompressedData(t)},t.prototype.decompressData=function(){8==this.compressionMethod&&this.originalSize>0&&this.decompressDataOld()},t.prototype.decompressDataOld=function(){var t,e=new B(this.compressedStream,!0);this.originalSize>0&&(t=new v(new Uint8Array(this.originalSize)));var i,r=new Uint8Array(s);for(new Uint8Array(0);(i=e.read(r,0,s))>0;)t.write(r.subarray(0,i),0,i);this.unCompressedStream=t.toByteArray(),this.checkCrc},t.prototype.readLocalHeader=function(t){if(0==t.length)throw new DOMException("stream");if(o.ReadInt32(t)!=this.headerSignature)throw new DOMException("Can't find local header signature - wrong file format or file is corrupt.");t.position+=22;var e=o.ReadInt16(t),i=o.ReadUInt16(t);if(99==this.compressionMethod);else if(i>2){if(t.position+=e,23==o.ReadInt16(t))throw new DOMException("UnSupported");t.position+=i-2}else t.position+=e+i},t.prototype.readCompressedData=function(t){var e;if(this.compressedSize>0){var i=this.compressedSize;e=new v(new Uint8Array(i));for(var r=new Uint8Array(s);i>0;){var n=Math.min(i,s);if(t.read(r,0,n)!=n)throw new DOMException("End of file reached - wrong file format or file is corrupt.");e.write(r.subarray(0,n),0,n),i-=n}this.compressedStream=new Uint8Array(e.inputStream)}else this.compressedSize<0||this.compressedSize},t}(),a=function(){function t(t,e){if(null==t)throw new Error("ArgumentException: data cannot be null or undefined");if(null==e)throw new Error("ArgumentException: string cannot be null or undefined");if(0===e.length)throw new Error("string cannot be empty");this.data=t,this.name=e}return Object.defineProperty(t.prototype,"dataStream",{get:function(){return this.decompressedStream},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.fileName},set:function(t){this.fileName=t},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this.fileName=void 0,this.data=void 0},t}(),f=new Int16Array(286),u=new Uint8Array(286),c=new Int16Array(30),d=new Uint8Array(30),p=function(){function e(t){this.pendingBuffer=new Uint8Array(65536),this.pendingBufLength=0,this.pendingBufCache=0,this.pendingBufBitsInCache=0,this.bufferPosition=0,this.extraBits=0,this.currentHash=0,this.matchStart=0,this.matchLength=0,this.matchPrevAvail=!1,this.blockStart=0,this.stringStart=0,this.lookAhead=0,this.totalBytesIn=0,this.inputOffset=0,this.inputEnd=0,this.windowSize=32768,this.windowMask=this.windowSize-1,this.hashSize=32768,this.hashMask=this.hashSize-1,this.hashShift=Math.floor(17/3),this.maxDist=this.windowSize-262,this.checkSum=1,this.noWrap=!1,e.isHuffmanTreeInitiated||(e.initHuffmanTree(),e.isHuffmanTreeInitiated=!0),this.treeLiteral=new l(this,286,257,15),this.treeDistances=new l(this,30,1,15),this.treeCodeLengths=new l(this,19,4,7),this.arrDistances=new Uint16Array(16384),this.arrLiterals=new Uint8Array(16384),this.stream=[],this.dataWindow=new Uint8Array(2*this.windowSize),this.hashHead=new Int16Array(this.hashSize),this.hashPrevious=new Int16Array(this.windowSize),this.blockStart=this.stringStart=1,this.noWrap=t,t||this.writeZLibHeader()}return Object.defineProperty(e.prototype,"compressedData",{get:function(){return this.stream},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"getCompressedString",{get:function(){var t="";if(void 0!==this.stream)for(var e=0;e<this.stream.length;e++)t+=String.fromCharCode.apply(null,this.stream[e]);return t},enumerable:!0,configurable:!0}),e.prototype.write=function(e,i,r){if(null==e)throw new Error("ArgumentException: data cannot null or undefined");var n=i+r;if(0>i||i>n||n>e.length)throw new Error("ArgumentOutOfRangeException: Offset or length is incorrect");if("string"==typeof e){var s=new t.Encoding(!1);s.type="Utf8",n=i+(e=new Uint8Array(s.getBytes(e,0,e.length))).length}for(this.inputBuffer=e,this.inputOffset=i,this.inputEnd=n,this.noWrap||(this.checkSum=m.checksumUpdate(this.checkSum,this.inputBuffer,this.inputOffset,n));this.inputEnd!==this.inputOffset||0!==this.pendingBufLength;)this.pendingBufferFlush(),this.compressData(!1)},e.prototype.writeZLibHeader=function(){var t=30720;t|=64,t+=31-t%31,this.pendingBufferWriteShortBytes(t)},e.prototype.pendingBufferWriteShortBytes=function(t){this.pendingBuffer[this.pendingBufLength++]=t>>8,this.pendingBuffer[this.pendingBufLength++]=t},e.prototype.compressData=function(t){var e;do{this.fillWindow();var i=t&&this.inputEnd===this.inputOffset;e=this.compressSlow(i,t)}while(0===this.pendingBufLength&&e);return e},e.prototype.compressSlow=function(t,e){if(this.lookAhead<262&&!t)return!1;for(;this.lookAhead>=262||t;){if(0===this.lookAhead)return this.lookAheadCompleted(e);this.stringStart>=2*this.windowSize-262&&this.slideWindow();var i=this.matchStart,r=this.matchLength;if(this.lookAhead>=3&&this.discardMatch(),r>=3&&this.matchLength<=r?r=this.matchPreviousBest(i,r):this.matchPreviousAvailable(),this.bufferPosition>=16384)return this.huffmanIsFull(e)}return!0},e.prototype.discardMatch=function(){var t=this.insertString();0!==t&&this.stringStart-t<=this.maxDist&&this.findLongestMatch(t)&&this.matchLength<=5&&3===this.matchLength&&this.stringStart-this.matchStart>4096&&(this.matchLength=2)},e.prototype.matchPreviousAvailable=function(){this.matchPrevAvail&&this.huffmanTallyLit(255&this.dataWindow[this.stringStart-1]),this.matchPrevAvail=!0,this.stringStart++,this.lookAhead--},e.prototype.matchPreviousBest=function(t,e){this.huffmanTallyDist(this.stringStart-1-t,e),e-=2;do{this.stringStart++,this.lookAhead--,this.lookAhead>=3&&this.insertString()}while(--e>0);return this.stringStart++,this.lookAhead--,this.matchPrevAvail=!1,this.matchLength=2,e},e.prototype.lookAheadCompleted=function(t){return this.matchPrevAvail&&this.huffmanTallyLit(255&this.dataWindow[this.stringStart-1]),this.matchPrevAvail=!1,this.huffmanFlushBlock(this.dataWindow,this.blockStart,this.stringStart-this.blockStart,t),this.blockStart=this.stringStart,!1},e.prototype.huffmanIsFull=function(t){var e=this.stringStart-this.blockStart;this.matchPrevAvail&&e--;var i=t&&0===this.lookAhead&&!this.matchPrevAvail;return this.huffmanFlushBlock(this.dataWindow,this.blockStart,e,i),this.blockStart+=e,!i},e.prototype.fillWindow=function(){for(this.stringStart>=this.windowSize+this.maxDist&&this.slideWindow();this.lookAhead<262&&this.inputOffset<this.inputEnd;){var t=2*this.windowSize-this.lookAhead-this.stringStart;t>this.inputEnd-this.inputOffset&&(t=this.inputEnd-this.inputOffset),this.dataWindow.set(this.inputBuffer.subarray(this.inputOffset,this.inputOffset+t),this.stringStart+this.lookAhead),this.inputOffset+=t,this.totalBytesIn+=t,this.lookAhead+=t}this.lookAhead>=3&&this.updateHash()},e.prototype.slideWindow=function(){this.dataWindow.set(this.dataWindow.subarray(this.windowSize,this.windowSize+this.windowSize),0),this.matchStart-=this.windowSize,this.stringStart-=this.windowSize,this.blockStart-=this.windowSize;for(var t=0;t<this.hashSize;++t){var e=65535&this.hashHead[t];this.hashHead[t]=e>=this.windowSize?e-this.windowSize:0}for(t=0;t<this.windowSize;t++){e=65535&this.hashPrevious[t];this.hashPrevious[t]=e>=this.windowSize?e-this.windowSize:0}},e.prototype.insertString=function(){var t,e=(this.currentHash<<this.hashShift^this.dataWindow[this.stringStart+2])&this.hashMask;return this.hashPrevious[this.stringStart&this.windowMask]=t=this.hashHead[e],this.hashHead[e]=this.stringStart,this.currentHash=e,65535&t},e.prototype.findLongestMatch=function(t){var e,i=4096,r=258,n=this.stringStart,s=this.stringStart+this.matchLength,o=Math.max(this.matchLength,2),h=Math.max(this.stringStart-this.maxDist,0),a=this.stringStart+258-1,f=this.dataWindow[s-1],u=this.dataWindow[s],c=this.dataWindow;o>=32&&(i>>=2),r>this.lookAhead&&(r=this.lookAhead);do{if(c[t+o]===u&&c[t+o-1]===f&&c[t]===c[n]&&c[t+1]===c[n+1]){for(e=t+2,n+=2;c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&n<a;);if(n>s){if(this.matchStart=t,s=n,(o=n-this.stringStart)>=r)break;f=c[s-1],u=c[s]}n=this.stringStart}}while((t=65535&this.hashPrevious[t&this.windowMask])>h&&0!=--i);return this.matchLength=Math.min(o,this.lookAhead),this.matchLength>=3},e.prototype.updateHash=function(){this.currentHash=this.dataWindow[this.stringStart]<<this.hashShift^this.dataWindow[this.stringStart+1]},e.prototype.huffmanTallyLit=function(t){return this.arrDistances[this.bufferPosition]=0,this.arrLiterals[this.bufferPosition++]=t,this.treeLiteral.codeFrequencies[t]++,this.bufferPosition>=16384},e.prototype.huffmanTallyDist=function(t,e){this.arrDistances[this.bufferPosition]=t,this.arrLiterals[this.bufferPosition++]=e-3;var i=this.huffmanLengthCode(e-3);this.treeLiteral.codeFrequencies[i]++,i>=265&&i<285&&(this.extraBits+=Math.floor((i-261)/4));var r=this.huffmanDistanceCode(t-1);return this.treeDistances.codeFrequencies[r]++,r>=4&&(this.extraBits+=Math.floor(r/2-1)),this.bufferPosition>=16384},e.prototype.huffmanFlushBlock=function(t,e,i,r){this.treeLiteral.codeFrequencies[256]++,this.treeLiteral.buildTree(),this.treeDistances.buildTree(),this.treeLiteral.calculateBLFreq(this.treeCodeLengths),this.treeDistances.calculateBLFreq(this.treeCodeLengths),this.treeCodeLengths.buildTree();for(var n=4,s=18;s>n;s--)this.treeCodeLengths.codeLengths[l.huffCodeLengthOrders[s]]>0&&(n=s+1);var o=14+3*n+this.treeCodeLengths.getEncodedLength()+this.treeLiteral.getEncodedLength()+this.treeDistances.getEncodedLength()+this.extraBits,h=this.extraBits;for(s=0;s<286;s++)h+=this.treeLiteral.codeFrequencies[s]*u[s];for(s=0;s<30;s++)h+=this.treeDistances.codeFrequencies[s]*d[s];o>=h&&(o=h),e>=0&&i+4<o>>3?this.huffmanFlushStoredBlock(t,e,i,r):o==h?(this.pendingBufferWriteBits(2+(r?1:0),3),this.treeLiteral.setStaticCodes(f,u),this.treeDistances.setStaticCodes(c,d),this.huffmanCompressBlock(),this.huffmanReset()):(this.pendingBufferWriteBits(4+(r?1:0),3),this.huffmanSendAllTrees(n),this.huffmanCompressBlock(),this.huffmanReset())},e.prototype.huffmanFlushStoredBlock=function(t,e,i,r){this.pendingBufferWriteBits(0+(r?1:0),3),this.pendingBufferAlignToByte(),this.pendingBufferWriteShort(i),this.pendingBufferWriteShort(~i),this.pendingBufferWriteByteBlock(t,e,i),this.huffmanReset()},e.prototype.huffmanLengthCode=function(t){if(255===t)return 285;for(var e=257;t>=8;)e+=4,t>>=1;return e+t},e.prototype.huffmanDistanceCode=function(t){for(var e=0;t>=4;)e+=2,t>>=1;return e+t},e.prototype.huffmanSendAllTrees=function(t){this.treeCodeLengths.buildCodes(),this.treeLiteral.buildCodes(),this.treeDistances.buildCodes(),this.pendingBufferWriteBits(this.treeLiteral.treeLength-257,5),this.pendingBufferWriteBits(this.treeDistances.treeLength-1,5),this.pendingBufferWriteBits(t-4,4);for(var e=0;e<t;e++)this.pendingBufferWriteBits(this.treeCodeLengths.codeLengths[l.huffCodeLengthOrders[e]],3);this.treeLiteral.writeTree(this.treeCodeLengths),this.treeDistances.writeTree(this.treeCodeLengths)},e.prototype.huffmanReset=function(){this.bufferPosition=0,this.extraBits=0,this.treeLiteral.reset(),this.treeDistances.reset(),this.treeCodeLengths.reset()},e.prototype.huffmanCompressBlock=function(){for(var t=0;t<this.bufferPosition;t++){var e=255&this.arrLiterals[t],i=this.arrDistances[t];if(0!=i--){var r=this.huffmanLengthCode(e);this.treeLiteral.writeCodeToStream(r);var n=Math.floor((r-261)/4);n>0&&n<=5&&this.pendingBufferWriteBits(e&(1<<n)-1,n);var s=this.huffmanDistanceCode(i);this.treeDistances.writeCodeToStream(s),(n=Math.floor(s/2-1))>0&&this.pendingBufferWriteBits(i&(1<<n)-1,n)}else this.treeLiteral.writeCodeToStream(e)}this.treeLiteral.writeCodeToStream(256)},e.prototype.pendingBufferWriteBits=function(t,e){var i=new Uint32Array(1);i[0]=this.pendingBufCache|t<<this.pendingBufBitsInCache,this.pendingBufCache=i[0],this.pendingBufBitsInCache+=e,this.pendingBufferFlushBits()},e.prototype.pendingBufferFlush=function(t){if(this.pendingBufferFlushBits(),this.pendingBufLength>0){var e=new Uint8Array(this.pendingBufLength);e.set(this.pendingBuffer.subarray(0,this.pendingBufLength),0),this.stream.push(e)}this.pendingBufLength=0},e.prototype.pendingBufferFlushBits=function(){for(var t=0;this.pendingBufBitsInCache>=8&&this.pendingBufLength<65536;)this.pendingBuffer[this.pendingBufLength++]=this.pendingBufCache,this.pendingBufCache>>=8,this.pendingBufBitsInCache-=8,t++;return t},e.prototype.pendingBufferWriteByteBlock=function(t,e,i){var r=t.subarray(e,e+i);this.pendingBuffer.set(r,this.pendingBufLength),this.pendingBufLength+=i},e.prototype.pendingBufferWriteShort=function(t){this.pendingBuffer[this.pendingBufLength++]=t,this.pendingBuffer[this.pendingBufLength++]=t>>8},e.prototype.pendingBufferAlignToByte=function(){this.pendingBufBitsInCache>0&&(this.pendingBuffer[this.pendingBufLength++]=this.pendingBufCache),this.pendingBufCache=0,this.pendingBufBitsInCache=0},e.initHuffmanTree=function(){for(var t=0;t<144;)f[t]=l.bitReverse(48+t<<8),u[t++]=8;for(;t<256;)f[t]=l.bitReverse(256+t<<7),u[t++]=9;for(;t<280;)f[t]=l.bitReverse(-256+t<<9),u[t++]=7;for(;t<286;)f[t]=l.bitReverse(-88+t<<8),u[t++]=8;for(t=0;t<30;t++)c[t]=l.bitReverse(t<<11),d[t]=5},e.prototype.close=function(){do{this.pendingBufferFlush(!0),this.compressData(!0)||(this.pendingBufferFlush(!0),this.pendingBufferAlignToByte(),this.noWrap||(this.pendingBufferWriteShortBytes(this.checkSum>>16),this.pendingBufferWriteShortBytes(65535&this.checkSum)),this.pendingBufferFlush(!0))}while(this.inputEnd!==this.inputOffset||0!==this.pendingBufLength)},e.prototype.destroy=function(){this.stream=[],this.stream=void 0,this.pendingBuffer=void 0,this.treeLiteral=void 0,this.treeDistances=void 0,this.treeCodeLengths=void 0,this.arrLiterals=void 0,this.arrDistances=void 0,this.hashHead=void 0,this.hashPrevious=void 0,this.dataWindow=void 0,this.inputBuffer=void 0,this.pendingBufLength=void 0,this.pendingBufCache=void 0,this.pendingBufBitsInCache=void 0,this.bufferPosition=void 0,this.extraBits=void 0,this.currentHash=void 0,this.matchStart=void 0,this.matchLength=void 0,this.matchPrevAvail=void 0,this.blockStart=void 0,this.stringStart=void 0,this.lookAhead=void 0,this.totalBytesIn=void 0,this.inputOffset=void 0,this.inputEnd=void 0,this.windowSize=void 0,this.windowMask=void 0,this.hashSize=void 0,this.hashMask=void 0,this.hashShift=void 0,this.maxDist=void 0,this.checkSum=void 0,this.noWrap=void 0},e.isHuffmanTreeInitiated=!1,e}(),l=function(){function t(t,e,i,r){this.writer=t,this.codeMinCount=i,this.maxLength=r,this.codeFrequency=new Uint16Array(e),this.lengthCount=new Int32Array(r)}return Object.defineProperty(t.prototype,"treeLength",{get:function(){return this.codeCount},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"codeLengths",{get:function(){return this.codeLength},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"codeFrequencies",{get:function(){return this.codeFrequency},enumerable:!0,configurable:!0}),t.prototype.setStaticCodes=function(t,e){var i=new Int16Array(t.length);i.set(t,0),this.codes=i;var r=new Uint8Array(e.length);r.set(e,0),this.codeLength=r},t.prototype.reset=function(){for(var t=0;t<this.codeFrequency.length;t++)this.codeFrequency[t]=0;this.codes=void 0,this.codeLength=void 0},t.prototype.writeCodeToStream=function(t){this.writer.pendingBufferWriteBits(65535&this.codes[t],this.codeLength[t])},t.prototype.buildCodes=function(){var e=new Int32Array(this.maxLength);this.codes=new Int16Array(this.codeCount);for(var i=0,r=0;r<this.maxLength;r++)e[r]=i,i+=this.lengthCount[r]<<15-r;for(var n=0;n<this.codeCount;n++){var s=this.codeLength[n];s>0&&(this.codes[n]=t.bitReverse(e[s-1]),e[s-1]+=1<<16-s)}},t.bitReverse=function(e){return t.reverseBits[15&e]<<12|t.reverseBits[e>>4&15]<<8|t.reverseBits[e>>8&15]<<4|t.reverseBits[e>>12]},t.prototype.getEncodedLength=function(){for(var t=0,e=0;e<this.codeFrequency.length;e++)t+=this.codeFrequency[e]*this.codeLength[e];return t},t.prototype.calculateBLFreq=function(t){for(var e,i,r,n=-1,s=0;s<this.codeCount;){r=1;var o=this.codeLength[s];for(0===o?(e=138,i=3):(e=6,i=3,n!==o&&(t.codeFrequency[o]++,r=0)),n=o,s++;s<this.codeCount&&n===this.codeLength[s]&&(s++,!(++r>=e)););r<i?t.codeFrequency[n]+=r:0!==n?t.codeFrequency[16]++:r<=10?t.codeFrequency[17]++:t.codeFrequency[18]++}},t.prototype.writeTree=function(t){for(var e,i,r,n=-1,s=0;s<this.codeCount;){r=1;var o=this.codeLength[s];for(0===o?(e=138,i=3):(e=6,i=3,n!==o&&(t.writeCodeToStream(o),r=0)),n=o,s++;s<this.codeCount&&n===this.codeLength[s]&&(s++,!(++r>=e)););if(r<i)for(;r-- >0;)t.writeCodeToStream(n);else 0!==n?(t.writeCodeToStream(16),this.writer.pendingBufferWriteBits(r-3,2)):r<=10?(t.writeCodeToStream(17),this.writer.pendingBufferWriteBits(r-3,3)):(t.writeCodeToStream(18),this.writer.pendingBufferWriteBits(r-11,7))}},t.prototype.buildTree=function(){for(var t=this.codeFrequency.length,e=new Int32Array(t),i=0,r=0,n=0;n<t;n++){var s=this.codeFrequency[n];if(0!==s){for(var o=i++,h=0;o>0&&this.codeFrequency[e[h=Math.floor((o-1)/2)]]>s;)e[o]=e[h],o=h;e[o]=n,r=n}}for(;i<2;)e[i++]=r<2?++r:0;this.codeCount=Math.max(r+1,this.codeMinCount);for(var a=i,f=new Int32Array(4*i-2),u=new Int32Array(2*i-1),c=0;c<i;c++){var d=e[c],p=2*c;f[p]=d,f[p+1]=-1,u[c]=this.codeFrequency[d]<<8,e[c]=c}this.constructHuffmanTree(e,i,u,a,f),this.buildLength(f)},t.prototype.constructHuffmanTree=function(t,e,i,r,n){do{for(var s=t[0],o=t[--e],h=i[o],a=0,f=1;f<e;)f+1<e&&i[t[f]]>i[t[f+1]]&&f++,t[a]=t[f],f=2*(a=f)+1;for(;(f=a)>0&&i[t[a=Math.floor((f-1)/2)]]>h;)t[f]=t[a];t[f]=o;var u=t[0];n[2*(o=r++)]=s,n[2*o+1]=u;var c=Math.min(255&i[s],255&i[u]);for(i[o]=h=i[s]+i[u]-c+1,a=0,f=1;f<e;)f+1<e&&i[t[f]]>i[t[f+1]]&&f++,t[a]=t[f],f=2*(a=f)+1;for(;(f=a)>0&&i[t[a=Math.floor((f-1)/2)]]>h;)t[f]=t[a];t[f]=o}while(e>1)},t.prototype.buildLength=function(t){this.codeLength=new Uint8Array(this.codeFrequency.length);for(var e=Math.floor(t.length/2),i=Math.floor((e+1)/2),r=0,n=0;n<this.maxLength;n++)this.lengthCount[n]=0;if(0!==(r=this.calculateOptimalCodeLength(t,r,e))){var s=this.maxLength-1;do{for(;0===this.lengthCount[--s];);do{this.lengthCount[s]--,this.lengthCount[++s]++,r-=1<<this.maxLength-1-s}while(r>0&&s<this.maxLength-1)}while(r>0);this.recreateTree(t,r,i)}},t.prototype.recreateTree=function(t,e,i){this.lengthCount[this.maxLength-1]+=e,this.lengthCount[this.maxLength-2]-=e;for(var r=2*i,n=this.maxLength;0!==n;n--)for(var s=this.lengthCount[n-1];s>0;){var o=2*t[r++];-1===t[o+1]&&(this.codeLength[t[o]]=n,s--)}},t.prototype.calculateOptimalCodeLength=function(t,e,i){var r=new Int32Array(i);r[i-1]=0;for(var n=i-1;n>=0;n--){var s=2*n+1;if(-1!==t[s]){(o=r[n]+1)>this.maxLength&&(o=this.maxLength,e++),r[t[s-1]]=r[t[s]]=o}else{var o=r[n];this.lengthCount[o-1]++,this.codeLength[t[s-1]]=r[n]}}return e},t.reverseBits=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],t.huffCodeLengthOrders=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],t}(),m=function(){function t(){}return t.checksumUpdate=function(e,i,r,n){var s=new Uint32Array(1);s[0]=e;for(var o=s[0],h=s[0]=65535&o,a=s[0]=o>>t.checkSumBitOffset;n>0;){var f=Math.min(n,t.checksumIterationCount);for(n-=f;--f>=0;)a+=h+=s[0]=255&i[r++];h%=t.checksumBase,a%=t.checksumBase}return o=a<<t.checkSumBitOffset|h},t.checkSumBitOffset=16,t.checksumBase=65521,t.checksumIterationCount=3800,t}(),g=function(){function t(t){this.buildTree(t)}return t.init=function(){var e,i;for(e=new Uint8Array(288),i=0;i<144;)e[i++]=8;for(;i<256;)e[i++]=9;for(;i<280;)e[i++]=7;for(;i<288;)e[i++]=8;for(t.m_LengthTree=new t(e),e=new Uint8Array(32),i=0;i<32;)e[i++]=5;t.m_DistanceTree=new t(e)},t.prototype.prepareData=function(e,i,r){for(var n=0,s=512,o=0;o<r.length;o++){var h=r[o];h>0&&e[h]++}for(var a=1;a<=t.MAX_BITLEN;a++){if(i[a]=n,n+=e[a]<<16-a,a>=10)s+=(130944&n)-(130944&i[a])>>16-a}return{code:n,treeSize:s}},t.prototype.treeFromData=function(i,r,n,s,o){for(var h=new Int16Array(o),a=512,f=t.MAX_BITLEN;f>=10;f--)for(var u=130944&s,c=130944&(s-=i[f]<<16-f);c<u;c+=128)h[e.bitReverse(c)]=e.bitConverterInt32ToInt16(-a<<4|f),a+=1<<f-9;for(c=0;c<n.length;c++){if(0!=(f=n[c])){s=r[f];var d=e.bitReverse(s);if(f<=9)do{h[d]=e.bitConverterInt32ToInt16(c<<4|f),d+=1<<f}while(d<512);else{var p=h[511&d],l=1<<(15&p);p=-(p>>4);do{h[p|d>>9]=e.bitConverterInt32ToInt16(c<<4|f),d+=1<<f}while(d<l)}r[f]=s+(1<<16-f)}}return h},t.prototype.buildTree=function(t){var e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=this.prepareData(e,i,t);this.m_Tree=this.treeFromData(e,i,t,r.code,r.treeSize)},t.prototype.unpackSymbol=function(t){var e,i;if((e=t.peekBits(9))>=0){if((i=this.m_Tree[e])>=0)return t.skipBits(15&i),i>>4;var r=-(i>>4),n=15&i;if((e=t.peekBits(n))>=0)return i=this.m_Tree[r|e>>9],t.skipBits(15&i),i>>4;var s=t.availableBits;return e=t.peekBits(s),(15&(i=this.m_Tree[r|e>>9]))<=s?(t.skipBits(15&i),i>>4):-1}s=t.availableBits;return e=t.peekBits(s),(i=this.m_Tree[e])>=0&&(15&i)<=s?(t.skipBits(15&i),i>>4):-1},Object.defineProperty(t,"lengthTree",{get:function(){return this.m_LengthTree},enumerable:!0,configurable:!0}),Object.defineProperty(t,"distanceTree",{get:function(){return this.m_DistanceTree},enumerable:!0,configurable:!0}),t.MAX_BITLEN=15,t}(),y=function(){function t(){}return t.ChecksumUpdate=function(t,e,i,r){for(var n=t,s=65535&n,o=n>>this.DEF_CHECKSUM_BIT_OFFSET;r>0;){var h=Math.min(r,this.DEF_CHECKSUM_ITERATIONSCOUNT);for(r-=h;--h>=0;)o+=s+=255&e[i++];s%=this.DEF_CHECKSUM_BASE,o%=this.DEF_CHECKSUM_BASE}t=n=o<<this.DEF_CHECKSUM_BIT_OFFSET|s},t.ChecksumGenerate=function(e,i,r){return t.ChecksumUpdate(1,e,i,r),1},t.DEF_CHECKSUM_BIT_OFFSET=16,t.DEF_CHECKSUM_BASE=65521,t.DEF_CHECKSUM_ITERATIONSCOUNT=3800,t}(),B=function(){function t(t,e){if(this.defaultHuffmanDynamicTree=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],this.DEF_HEADER_METHOD_MASK=3840,this.DEF_HEADER_INFO_MASK=61440,this.DEF_HEADER_FLAGS_FCHECK=31,this.DEF_HEADER_FLAGS_FDICT=32,this.DEF_HEADER_FLAGS_FLEVEL=192,this.DEF_MAX_WINDOW_SIZE=65535,this.DEF_HUFFMAN_REPEATE_MAX=258,this.DEF_HUFFMAN_END_BLOCK=256,this.DEF_HUFFMAN_LENGTH_MINIMUMCODE=257,this.DEF_HUFFMAN_LENGTH_MAXIMUMCODE=285,this.DEF_HUFFMAN_DISTANCE_MAXIMUMCODE=29,this.mCheckSum=1,this.tBuffer=0,this.mBufferedBits=0,this.mTempBuffer=new Uint8Array(4),this.mBlockBuffer=new Uint8Array(this.DEF_MAX_WINDOW_SIZE),this.mbNoWrap=!1,this.mWindowSize=0,this.mCurrentPosition=0,this.mDataLength=0,this.mbCanReadNextBlock=!0,this.mbCanReadMoreData=!0,this.mbCheckSumRead=!1,null==t)throw new DOMException("stream");if(0===t.length)throw new DOMException("stream - string can not be empty");g.init(),this.mInputStream=new v(t),this.mbNoWrap=e,this.mbNoWrap||this.readZLibHeader(),this.decodeBlockHeader()}return Object.defineProperty(t.prototype,"mBuffer",{get:function(){return this.tBuffer},set:function(t){this.tBuffer=t},enumerable:!0,configurable:!0}),t.prototype.peekBits=function(t){if(t<0)throw new DOMException("count","Bits count can not be less than zero.");if(t>32)throw new DOMException("count","Count of bits is too large.");if(this.mBufferedBits<t&&this.fillBuffer(),this.mBufferedBits<t)return-1;var i=~(4294967295<<t);return e.bitConverterUintToInt32(this.mBuffer&i)},t.prototype.fillBuffer=function(){var t=4-(this.mBufferedBits>>3)-(7&this.mBufferedBits?1:0);if(0!==t)for(var i=this.mInputStream.read(this.mTempBuffer,0,t),r=0;r<i;r++)this.mBuffer=e.bitConverterInt32ToUint(this.mBuffer|e.bitConverterInt32ToUint(this.mTempBuffer[r]<<this.mBufferedBits)),this.mBufferedBits+=8},t.prototype.skipBits=function(t){if(t<0)throw new DOMException("count","Bits count can not be less than zero.");0!==t&&(t>=this.mBufferedBits?(t-=this.mBufferedBits,this.mBufferedBits=0,this.mBuffer=0,t>0&&(this.mInputStream.position+=t>>3,(t&=7)>0&&(this.fillBuffer(),this.mBufferedBits-=t,this.mBuffer=e.bitConverterInt32ToUint(this.mBuffer>>>t)))):(this.mBufferedBits-=t,this.mBuffer=e.bitConverterInt32ToUint(this.mBuffer>>>t)))},Object.defineProperty(t.prototype,"availableBits",{get:function(){return this.mBufferedBits},enumerable:!0,configurable:!0}),t.prototype.readZLibHeader=function(){var t=this.readInt16();if(-1===t)throw new DOMException("Header of the stream can not be read.");if(t%31!=0)throw new DOMException("Header checksum illegal");if(2048!=(t&this.DEF_HEADER_METHOD_MASK))throw new DOMException("Unsupported compression method.");if(this.mWindowSize=Math.pow(2,8+((t&this.DEF_HEADER_INFO_MASK)>>12)),this.mWindowSize>65535)throw new DOMException("Unsupported window size for deflate compression method.");if((t&this.DEF_HEADER_FLAGS_FDICT)>>5==1)throw new DOMException("Custom dictionary is not supported at the moment.")},t.prototype.readInt16=function(){var t=this.readBits(8)<<8;return t|=this.readBits(8)},t.prototype.readBits=function(t){var i=this.peekBits(t);return-1===i?-1:(this.mBufferedBits-=t,this.mBuffer=e.bitConverterInt32ToUint(this.mBuffer>>>t),i)},t.prototype.decodeBlockHeader=function(){if(!this.mbCanReadNextBlock)return!1;var t=this.readBits(1);if(-1===t)return!1;var e=this.readBits(2);if(-1===e)return!1;switch(this.mbCanReadNextBlock=0===t,e){case 0:this.mbReadingUncompressed=!0,this.skipToBoundary();var i=this.readInt16Inverted();if(i!==(65535^this.readInt16Inverted()))throw new DOMException("Wrong block length.");if(i>65535)throw new DOMException("Uncompressed block length can not be more than 65535.");this.mUncompressedDataLength=i,this.mCurrentLengthTree=null,this.mCurrentDistanceTree=null;break;case 1:this.mbReadingUncompressed=!1,this.mUncompressedDataLength=-1,this.mCurrentLengthTree=g.lengthTree,this.mCurrentDistanceTree=g.distanceTree;break;case 2:this.mbReadingUncompressed=!1,this.mUncompressedDataLength=-1;var r=this.decodeDynamicHeader(this.mCurrentLengthTree,this.mCurrentDistanceTree);this.mCurrentLengthTree=r.lengthTree,this.mCurrentDistanceTree=r.distanceTree;break;default:throw new DOMException("Wrong block type.")}return!0},t.prototype.skipToBoundary=function(){this.mBuffer=e.bitConverterInt32ToUint(this.mBuffer>>>(7&this.mBufferedBits)),this.mBufferedBits&=-8},t.prototype.readInt16Inverted=function(){var t=this.readBits(8);return t|=this.readBits(8)<<8},t.prototype.decodeDynamicHeader=function(e,i){var r=0,n=this.readBits(5),s=this.readBits(5),o=this.readBits(4);if(n<0||s<0||o<0)throw new DOMException("Wrong dynamic huffman codes.");var h=(n+=257)+(s+=1),a=new Uint8Array(h),f=new Uint8Array(19);o+=4;for(var u=0;u<o;){var c=this.readBits(3);if(c<0)throw new DOMException("Wrong dynamic huffman codes.");f[this.defaultHuffmanDynamicTree[u++]]=c}var d=new g(f);for(u=0;;){var p=void 0,l=!1;for(p=d.unpackSymbol(this);!(-16&p);){if(a[u++]=r=p,u===h){l=!0;break}p=d.unpackSymbol(this)}if(l)break;if(p<0)throw new DOMException("Wrong dynamic huffman codes.");if(p>=17)r=0;else if(0===u)throw new DOMException("Wrong dynamic huffman codes.");var m=p-16,y=t.DEF_HUFFMAN_DYNTREE_REPEAT_BITS[m],B=this.readBits(y);if(B<0)throw new DOMException("Wrong dynamic huffman codes.");if(u+(B+=t.DEF_HUFFMAN_DYNTREE_REPEAT_MINIMUMS[m])>h)throw new DOMException("Wrong dynamic huffman codes.");for(;B-- >0;)a[u++]=r;if(u===h)break}var v=new Uint8Array(n);return v.set(a.subarray(0,n),0),e=new g(v),v=a.slice(n,n+s),{lengthTree:e,distanceTree:new g(v)}},t.prototype.readHuffman=function(){for(var e=this.DEF_MAX_WINDOW_SIZE-(this.mDataLength-this.mCurrentPosition),i=!1,r={};e>=this.DEF_HUFFMAN_REPEATE_MAX;){var n=void 0;for(n=this.mCurrentLengthTree.unpackSymbol(this);!(-256&n);){if(r[(this.mDataLength+1)%this.DEF_MAX_WINDOW_SIZE]=n,this.mBlockBuffer[this.mDataLength++%this.DEF_MAX_WINDOW_SIZE]=n,i=!0,--e<this.DEF_HUFFMAN_REPEATE_MAX)return!0;n=this.mCurrentLengthTree.unpackSymbol(this)}if(n<this.DEF_HUFFMAN_LENGTH_MINIMUMCODE){if(n<this.DEF_HUFFMAN_END_BLOCK)throw new DOMException("Illegal code.");var s=i?1:0;return this.mbCanReadMoreData=this.decodeBlockHeader(),!!(s|(this.mbCanReadMoreData?1:0))}if(n>this.DEF_HUFFMAN_LENGTH_MAXIMUMCODE)throw new DOMException("Illegal repeat code length.");var o=t.DEF_HUFFMAN_REPEAT_LENGTH_BASE[n-this.DEF_HUFFMAN_LENGTH_MINIMUMCODE],h=t.DEF_HUFFMAN_REPEAT_LENGTH_EXTENSION[n-this.DEF_HUFFMAN_LENGTH_MINIMUMCODE];if(h>0){if((f=this.readBits(h))<0)throw new DOMException("Wrong data.");o+=f}if((n=this.mCurrentDistanceTree.unpackSymbol(this))<0||n>t.DEF_HUFFMAN_REPEAT_DISTANCE_BASE.length)throw new DOMException("Wrong distance code.");var a=t.DEF_HUFFMAN_REPEAT_DISTANCE_BASE[n];if((h=t.DEF_HUFFMAN_REPEAT_DISTANCE_EXTENSION[n])>0){var f;if((f=this.readBits(h))<0)throw new DOMException("Wrong data.");a+=f}for(var u=0;u<o;u++)this.mBlockBuffer[this.mDataLength%this.DEF_MAX_WINDOW_SIZE]=this.mBlockBuffer[(this.mDataLength-a)%this.DEF_MAX_WINDOW_SIZE],this.mDataLength++,e--;i=!0}return i},t.prototype.read=function(t,i,r){if(null==t)throw new DOMException("buffer");if(i<0||i>t.length-1)throw new DOMException("offset","Offset does not belong to specified buffer.");if(r<0||r>t.length-i)throw new DOMException("length","Length is illegal.");for(var n=r;r>0;)if(this.mCurrentPosition<this.mDataLength){var s=this.mCurrentPosition%this.DEF_MAX_WINDOW_SIZE,o=Math.min(this.DEF_MAX_WINDOW_SIZE-s,this.mDataLength-this.mCurrentPosition);o=Math.min(o,r),e.arrayCopy(this.mBlockBuffer,s,t,i,o),this.mCurrentPosition+=o,i+=o,r-=o}else{if(!this.mbCanReadMoreData)break;var h=this.mDataLength;if(this.mbReadingUncompressed)if(0===this.mUncompressedDataLength){if(this.mbCanReadMoreData=this.decodeBlockHeader(),!this.mbCanReadMoreData)break}else{s=this.mDataLength%this.DEF_MAX_WINDOW_SIZE;var a=Math.min(this.mUncompressedDataLength,this.DEF_MAX_WINDOW_SIZE-s),f=this.readPackedBytes(this.mBlockBuffer,s,a);if(a!==f)throw new DOMException("Not enough data in stream.");this.mUncompressedDataLength-=f,this.mDataLength+=f}else if(!this.readHuffman())break;if(h<this.mDataLength){var u=h%this.DEF_MAX_WINDOW_SIZE,c=this.mDataLength%this.DEF_MAX_WINDOW_SIZE;u<c?this.checksumUpdate(this.mBlockBuffer,u,c-u):(this.checksumUpdate(this.mBlockBuffer,u,this.DEF_MAX_WINDOW_SIZE-u),c>0&&this.checksumUpdate(this.mBlockBuffer,0,c))}}if(!this.mbCanReadMoreData&&!this.mbCheckSumRead&&!this.mbNoWrap){if(this.skipToBoundary(),this.readInt32()!==this.mCheckSum)throw new DOMException("Checksum check failed.");this.mbCheckSumRead=!0}return n-r},t.prototype.readPackedBytes=function(t,i,r){if(null==t)throw new DOMException("buffer");if(i<0||i>t.length-1)throw new DOMException('offset", "Offset can not be less than zero or greater than buffer length - 1.');if(r<0)throw new DOMException('length", "Length can not be less than zero.');if(r>t.length-i)throw new DOMException('length", "Length is too large.');if(7&this.mBufferedBits)throw new DOMException("Reading of unalligned data is not supported.");if(0===r)return 0;for(var n=0;this.mBufferedBits>0&&r>0;)t[i++]=this.mBuffer,this.mBufferedBits-=8,this.mBuffer=e.bitConverterInt32ToUint(this.mBuffer>>>8),r--,n++;return r>0&&(n+=this.mInputStream.read(t,i,r)),n},t.prototype.readInt32=function(){var t=this.readBits(8)<<24;return t|=this.readBits(8)<<16,t|=this.readBits(8)<<8,t|=this.readBits(8)},t.prototype.checksumUpdate=function(t,e,i){y.ChecksumUpdate(this.mCheckSum,t,e,i)},t.DEF_REVERSE_BITS=new Uint8Array([0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15]),t.DEF_HUFFMAN_DYNTREE_REPEAT_MINIMUMS=[3,3,11],t.DEF_HUFFMAN_DYNTREE_REPEAT_BITS=[2,3,7],t.DEF_HUFFMAN_REPEAT_LENGTH_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],t.DEF_HUFFMAN_REPEAT_LENGTH_EXTENSION=[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],t.DEF_HUFFMAN_REPEAT_DISTANCE_BASE=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],t.DEF_HUFFMAN_REPEAT_DISTANCE_EXTENSION=[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],t}(),v=function(){function t(t){this.position=0,this.inputStream=new Uint8Array(t.buffer)}return Object.defineProperty(t.prototype,"length",{get:function(){return this.inputStream.buffer.byteLength},enumerable:!0,configurable:!0}),t.prototype.read=function(t,e,i){var r=new Uint8Array(this.inputStream.buffer,this.position+e).subarray(0,i);return t.set(r,0),this.position+=r.byteLength,r.byteLength},t.prototype.readByte=function(){return this.inputStream[this.position++]},t.prototype.write=function(t,i,r){e.arrayCopy(t,0,this.inputStream,this.position+i,r),this.position+=r},t.prototype.toByteArray=function(){return new Uint8Array(this.inputStream.buffer)},t}()})(),n})()));
/*!
* filename: ej2-compression.umd.min.js
* version : 25.2.3
* version : 26.1.35
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.

@@ -10,3 +10,3 @@ * Use of this code is subject to the terms of our license.

*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-file-utils")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-file-utils"],e):e(t.ej={},t.ej2FileUtils)}(this,function(t,e){"use strict";var i=function(){function t(){}return t.bitReverse=function(e){return t.reverseBits[15&e]<<12|t.reverseBits[e>>4&15]<<8|t.reverseBits[e>>8&15]<<4|t.reverseBits[e>>12]},t.bitConverterToInt32=function(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24},t.bitConverterToInt16=function(t,e){return t[e]|t[e+1]<<8},t.bitConverterToUInt32=function(t){var e=new Uint32Array(1);return e[0]=t,e[0]},t.bitConverterToUInt16=function(t,e){var i=new Uint16Array(1);return i[0]=t[e]|t[e+1]<<8,i[0]},t.bitConverterUintToInt32=function(t){var e=new Int32Array(1);return e[0]=t,e[0]},t.bitConverterInt32ToUint=function(t){var e=new Uint32Array(1);return e[0]=t,e[0]},t.bitConverterInt32ToInt16=function(t){var e=new Int16Array(1);return e[0]=t,e[0]},t.byteToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},t.byteIntToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},t.arrayCopy=function(t,e,i,r,n){var s=new Uint8Array(t.buffer,e).subarray(0,n);i.set(s,r)},t.mergeArray=function(t,e){var i=new Uint8Array(t.length+e.length);return i.set(t),i.set(e,t.length),i},t.encodedString=function(t){var e,i,r,n,s,o,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,f=0,u=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(t.charAt(t.length-1)===h.charAt(64)&&u--,t.charAt(t.length-2)===h.charAt(64)&&u--,u%1!=0)throw new Error("Invalid base64 input, bad content length.");for(var c=new Uint8Array(0|u);a<t.length;)e=h.indexOf(t.charAt(a++))<<2|(n=h.indexOf(t.charAt(a++)))>>4,i=(15&n)<<4|(s=h.indexOf(t.charAt(a++)))>>2,r=(3&s)<<6|(o=h.indexOf(t.charAt(a++))),c[f++]=e,64!==s&&(c[f++]=i),64!==o&&(c[f++]=r);return c},t.reverseBits=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],t.huffCodeLengthOrders=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],t}(),r=[],n=function(){function t(){0===r.length&&t.initCrc32Table(),this.files=[],this.level="Normal",e.Save.isMicrosoftBrowser=!!navigator.msSaveBlob}return Object.defineProperty(t.prototype,"items",{get:function(){return this.files},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"compressionLevel",{get:function(){return this.level},set:function(t){this.level=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return void 0===this.files?0:this.files.length},enumerable:!0,configurable:!0}),t.prototype.addItem=function(t){if(null===t||void 0===t)throw new Error("ArgumentException: item cannot be null or undefined");for(var e=0;e<this.files.length;e++){var i=this.files[e];if(i instanceof o&&i.name===t.name)throw new Error("item with same name already exist")}this.files.push(t)},t.prototype.addDirectory=function(t){if(null===t||void 0===t)throw new Error("ArgumentException: string cannot be null or undefined");if(0===t.length)throw new Error("ArgumentException: string cannot be empty");if("/"!==t.slice(-1)&&(t+="/"),-1!==this.files.indexOf(t))throw new Error("item with same name already exist");this.files.push(t)},t.prototype.getItem=function(t){if(t>=0&&t<this.files.length)return this.files[t]},t.prototype.contains=function(t){return-1!==this.files.indexOf(t)},t.prototype.open=function(e){var r=i.encodedString(e);if(0==r.length)throw new DOMException("stream");var n=new B(r),s=t.findValueFromEnd(n,101010256,65557);if(s<0)throw new DOMException("Can't locate end of central directory record. Possible wrong file format or archive is corrupt.");n.position=s+12;var o=s-t.ReadInt32(n);n.position=o,this.readCentralDirectoryDataAndExtractItems(n)},t.prototype.readCentralDirectoryDataAndExtractItems=function(e){if(null==e)throw new DOMException("stream");for(var i;33639248==t.ReadInt32(e);)(i=new s).readCentralDirectoryData(e);i.readData(e,i.checkCrc),i.decompressData(),this.files.push(new o(i.unCompressedStream.buffer,i.name))},t.prototype.save=function(t){if(null===t||void 0===t||0===t.length)throw new Error("ArgumentException: fileName cannot be null or undefined");if(0===this.files.length)throw new Error("InvalidOperation");var e=this;return new Promise(function(i,r){e.saveInternal(t,!1).then(function(){i(e)})})},t.prototype.saveAsBlob=function(){var t=this;return new Promise(function(e,i){t.saveInternal("",!0).then(function(t){e(t)})})},t.prototype.saveInternal=function(t,e){var i=this,r=this;return new Promise(function(n,s){for(var o=[],h=0,a=0;a<r.files.length;a++){i.getCompressedData(i.files[a]).then(function(i){if(h=r.constructZippedObject(o,i,h,i.isDirectory),o.length===r.files.length){var s=r.writeZippedContent(t,o,h,e);n(s)}})}})},t.prototype.destroy=function(){if(void 0!==this.files&&this.files.length>0){for(var t=0;t<this.files.length;t++){var e=this.files[t];e instanceof o&&e.destroy(),e=void 0}this.files=[]}this.files=void 0,this.level=void 0},t.prototype.getCompressedData=function(t){var e=this;return new Promise(function(i,n){if(t instanceof o){var s=new FileReader;s.onload=function(){var n=new Uint8Array(s.result),o={fileName:t.name,crc32Value:0,compressedData:[],compressedSize:void 0,uncompressedDataSize:n.length,compressionType:void 0,isDirectory:!1};if("Normal"===e.level){e.compressData(n,o,r);for(var h=0,a=0;a<o.compressedData.length;a++)h+=o.compressedData[a].length;o.compressedSize=h,o.compressionType="\b\0"}else o.compressedSize=n.length,o.crc32Value=e.calculateCrc32Value(0,n,r),o.compressionType="\0\0",o.compressedData.push(n);i(o)},s.readAsArrayBuffer(t.data)}else{i({fileName:t,crc32Value:0,compressedData:"",compressedSize:0,uncompressedDataSize:0,compressionType:"\0\0",isDirectory:!0})}})},t.prototype.compressData=function(t,e,i){var r=new c(!0),n=0,s=0;do{if(n>=t.length){r.close();break}s=Math.min(t.length,n+16384);var o=t.subarray(n,s);e.crc32Value=this.calculateCrc32Value(e.crc32Value,o,i),r.write(o,0,s-n),n=s}while(n<=t.length);e.compressedData=r.compressedData,r.destroy()},t.prototype.constructZippedObject=function(t,e,i,r){var n=0,s=new Date;r&&(n|=16),n|=0;var o=this.writeHeader(e,s),h="PK"+o+e.fileName,a=this.writeCentralDirectory(e,o,i,n);return t.push({localHeader:h,centralDir:a,compressedData:e}),i+h.length+e.compressedSize},t.prototype.writeHeader=function(t,e){var i="";return i+="\n\0\0\0",i+=t.compressionType,i+=this.getBytes(this.getModifiedTime(e),2),i+=this.getBytes(this.getModifiedDate(e),2),i+=this.getBytes(t.crc32Value,4),i+=this.getBytes(t.compressedSize,4),i+=this.getBytes(t.uncompressedDataSize,4),i+=this.getBytes(t.fileName.length,2),i+=this.getBytes(0,2)},t.prototype.writeZippedContent=function(t,i,r,n){for(var s=0,o=[],h=0;h<i.length;h++){var a=i[h];for(s+=a.centralDir.length,o.push(this.getArrayBuffer(a.localHeader));a.compressedData.compressedData.length;)o.push(a.compressedData.compressedData.shift().buffer)}for(h=0;h<i.length;h++)o.push(this.getArrayBuffer(i[h].centralDir));o.push(this.getArrayBuffer(this.writeFooter(i,s,r)));var f=new Blob(o,{type:"application/zip"});return n||e.Save.save(t,f),f},t.prototype.writeCentralDirectory=function(t,e,i,r){return"PK"+this.getBytes(20,2)+e+this.getBytes(0,2)+"\0\0\0\0"+this.getBytes(r,4)+this.getBytes(i,4)+t.fileName},t.prototype.writeFooter=function(t,e,i){return"PK\0\0\0\0"+this.getBytes(t.length,2)+this.getBytes(t.length,2)+this.getBytes(e,4)+this.getBytes(i,4)+this.getBytes(0,2)},t.prototype.getArrayBuffer=function(t){for(var e=new Uint8Array(t.length),i=0;i<t.length;++i)e[i]=255&t.charCodeAt(i);return e.buffer},t.prototype.getBytes=function(t,e){for(var i="",r=0;r<e;r++)i+=String.fromCharCode(255&t),t>>>=8;return i},t.prototype.getModifiedTime=function(t){var e=t.getHours();return e<<=6,e|=t.getMinutes(),e<<=5,e|=t.getSeconds()/2},t.prototype.getModifiedDate=function(t){var e=t.getFullYear()-1980;return e<<=4,e|=t.getMonth()+1,e<<=5,e|=t.getDate()},t.prototype.calculateCrc32Value=function(t,e,i){t^=-1;for(var r=0;r<e.length;r++)t=t>>>8^i[255&(t^e[r])];return-1^t},t.initCrc32Table=function(){for(var t,e=0;e<256;e++){t=e;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;r[e]=t}},t.findValueFromEnd=function(t,e,i){if(null==t)throw new DOMException("stream");var r=t.inputStream.buffer.byteLength;if(r<4)return-1;var n=new Uint8Array(4),s=Math.max(0,r-i),o=r-1-4;t.position=o,t.read(n,0,4);var h=n[0],a=h==e;if(!a)for(;o>s;)if(h<<=8,o--,t.position=o,(h+=t.readByte())==e){a=!0;break}return a?o:-1},t.ReadInt32=function(t){var e=new Uint8Array(4);if(4!=t.read(e,0,4))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return i.bitConverterToInt32(e,0)},t.ReadInt16=function(t){var e=new Uint8Array(2);if(2!=t.read(e,0,2))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return i.bitConverterToInt16(e,0)},t.ReadUInt16=function(t){var e=new Uint8Array(2);if(2!=t.read(e,0,2))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return i.bitConverterToInt16(e,0)},t}(),s=function(){function t(){this.headerSignature=67324752,this.checkCrc=!0,this.crc32=0}return t.prototype.readCentralDirectoryData=function(t){t.position+=4,this.options=n.ReadInt16(t),this.compressionMethod=n.ReadInt16(t),this.checkCrc=99!=this.compressionMethod;n.ReadInt32(t);this.crc32=i.bitConverterToUInt32(n.ReadInt32(t)),this.compressedSize=n.ReadInt32(t),this.originalSize=n.ReadInt32(t);var e=n.ReadInt16(t),r=n.ReadInt16(t),s=n.ReadInt16(t);t.position+=4,this.externalAttributes=n.ReadInt32(t),this.localHeaderOffset=n.ReadInt32(t);var o=new Uint8Array(e);t.read(o,0,e);var h=i.byteToString(o);h=h.replace("\\","/"),this.name=h,t.position+=r+s,0!=this.options&&(this.options=0)},t.prototype.readData=function(t,e){if(0==t.length)throw new DOMException("stream");t.position=this.localHeaderOffset,this.checkCrc=e,this.readLocalHeader(t),this.readCompressedData(t)},t.prototype.decompressData=function(){8==this.compressionMethod&&this.originalSize>0&&this.decompressDataOld()},t.prototype.decompressDataOld=function(){var t,e=new g(this.compressedStream,!0);this.originalSize>0&&(t=new B(new Uint8Array(this.originalSize)));for(var i,r=new Uint8Array(4096);(i=e.read(r,0,4096))>0;)t.write(r.subarray(0,i),0,i);this.unCompressedStream=t.toByteArray(),this.checkCrc},t.prototype.readLocalHeader=function(t){if(0==t.length)throw new DOMException("stream");if(n.ReadInt32(t)!=this.headerSignature)throw new DOMException("Can't find local header signature - wrong file format or file is corrupt.");t.position+=22;var e=n.ReadInt16(t),i=n.ReadUInt16(t);if(99==this.compressionMethod);else if(i>2){t.position+=e;if(23==n.ReadInt16(t))throw new DOMException("UnSupported");t.position+=i-2}else t.position+=e+i},t.prototype.readCompressedData=function(t){var e;if(this.compressedSize>0){var i=this.compressedSize;e=new B(new Uint8Array(i));for(var r=new Uint8Array(4096);i>0;){var n=Math.min(i,4096);if(t.read(r,0,n)!=n)throw new DOMException("End of file reached - wrong file format or file is corrupt.");e.write(r.subarray(0,n),0,n),i-=n}this.compressedStream=new Uint8Array(e.inputStream)}else this.compressedSize<0||this.compressedSize},t}(),o=function(){function t(t,e){if(null===t||void 0===t)throw new Error("ArgumentException: data cannot be null or undefined");if(null===e||void 0===e)throw new Error("ArgumentException: string cannot be null or undefined");if(0===e.length)throw new Error("string cannot be empty");this.data=t,this.name=e}return Object.defineProperty(t.prototype,"dataStream",{get:function(){return this.decompressedStream},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.fileName},set:function(t){this.fileName=t},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this.fileName=void 0,this.data=void 0},t}(),h=new Int16Array(286),a=new Uint8Array(286),f=new Int16Array(30),u=new Uint8Array(30),c=function(){function t(e){this.pendingBuffer=new Uint8Array(65536),this.pendingBufLength=0,this.pendingBufCache=0,this.pendingBufBitsInCache=0,this.bufferPosition=0,this.extraBits=0,this.currentHash=0,this.matchStart=0,this.matchLength=0,this.matchPrevAvail=!1,this.blockStart=0,this.stringStart=0,this.lookAhead=0,this.totalBytesIn=0,this.inputOffset=0,this.inputEnd=0,this.windowSize=32768,this.windowMask=this.windowSize-1,this.hashSize=32768,this.hashMask=this.hashSize-1,this.hashShift=Math.floor(17/3),this.maxDist=this.windowSize-262,this.checkSum=1,this.noWrap=!1,t.isHuffmanTreeInitiated||(t.initHuffmanTree(),t.isHuffmanTreeInitiated=!0),this.treeLiteral=new d(this,286,257,15),this.treeDistances=new d(this,30,1,15),this.treeCodeLengths=new d(this,19,4,7),this.arrDistances=new Uint16Array(16384),this.arrLiterals=new Uint8Array(16384),this.stream=[],this.dataWindow=new Uint8Array(2*this.windowSize),this.hashHead=new Int16Array(this.hashSize),this.hashPrevious=new Int16Array(this.windowSize),this.blockStart=this.stringStart=1,this.noWrap=e,e||this.writeZLibHeader()}return Object.defineProperty(t.prototype,"compressedData",{get:function(){return this.stream},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"getCompressedString",{get:function(){var t="";if(void 0!==this.stream)for(var e=0;e<this.stream.length;e++)t+=String.fromCharCode.apply(null,this.stream[e]);return t},enumerable:!0,configurable:!0}),t.prototype.write=function(t,i,r){if(void 0===t||null===t)throw new Error("ArgumentException: data cannot null or undefined");var n=i+r;if(0>i||i>n||n>t.length)throw new Error("ArgumentOutOfRangeException: Offset or length is incorrect");if("string"==typeof t){var s=new e.Encoding(!1);s.type="Utf8",n=i+(t=new Uint8Array(s.getBytes(t,0,t.length))).length}for(this.inputBuffer=t,this.inputOffset=i,this.inputEnd=n,this.noWrap||(this.checkSum=p.checksumUpdate(this.checkSum,this.inputBuffer,this.inputOffset,n));this.inputEnd!==this.inputOffset||0!==this.pendingBufLength;)this.pendingBufferFlush(),this.compressData(!1)},t.prototype.writeZLibHeader=function(){var t=30720;t|=64,t+=31-t%31,this.pendingBufferWriteShortBytes(t)},t.prototype.pendingBufferWriteShortBytes=function(t){this.pendingBuffer[this.pendingBufLength++]=t>>8,this.pendingBuffer[this.pendingBufLength++]=t},t.prototype.compressData=function(t){var e;do{this.fillWindow();var i=t&&this.inputEnd===this.inputOffset;e=this.compressSlow(i,t)}while(0===this.pendingBufLength&&e);return e},t.prototype.compressSlow=function(t,e){if(this.lookAhead<262&&!t)return!1;for(;this.lookAhead>=262||t;){if(0===this.lookAhead)return this.lookAheadCompleted(e);this.stringStart>=2*this.windowSize-262&&this.slideWindow();var i=this.matchStart,r=this.matchLength;if(this.lookAhead>=3&&this.discardMatch(),r>=3&&this.matchLength<=r?r=this.matchPreviousBest(i,r):this.matchPreviousAvailable(),this.bufferPosition>=16384)return this.huffmanIsFull(e)}return!0},t.prototype.discardMatch=function(){var t=this.insertString();0!==t&&this.stringStart-t<=this.maxDist&&this.findLongestMatch(t)&&this.matchLength<=5&&3===this.matchLength&&this.stringStart-this.matchStart>4096&&(this.matchLength=2)},t.prototype.matchPreviousAvailable=function(){this.matchPrevAvail&&this.huffmanTallyLit(255&this.dataWindow[this.stringStart-1]),this.matchPrevAvail=!0,this.stringStart++,this.lookAhead--},t.prototype.matchPreviousBest=function(t,e){this.huffmanTallyDist(this.stringStart-1-t,e),e-=2;do{this.stringStart++,this.lookAhead--,this.lookAhead>=3&&this.insertString()}while(--e>0);return this.stringStart++,this.lookAhead--,this.matchPrevAvail=!1,this.matchLength=2,e},t.prototype.lookAheadCompleted=function(t){return this.matchPrevAvail&&this.huffmanTallyLit(255&this.dataWindow[this.stringStart-1]),this.matchPrevAvail=!1,this.huffmanFlushBlock(this.dataWindow,this.blockStart,this.stringStart-this.blockStart,t),this.blockStart=this.stringStart,!1},t.prototype.huffmanIsFull=function(t){var e=this.stringStart-this.blockStart;this.matchPrevAvail&&e--;var i=t&&0===this.lookAhead&&!this.matchPrevAvail;return this.huffmanFlushBlock(this.dataWindow,this.blockStart,e,i),this.blockStart+=e,!i},t.prototype.fillWindow=function(){for(this.stringStart>=this.windowSize+this.maxDist&&this.slideWindow();this.lookAhead<262&&this.inputOffset<this.inputEnd;){var t=2*this.windowSize-this.lookAhead-this.stringStart;t>this.inputEnd-this.inputOffset&&(t=this.inputEnd-this.inputOffset),this.dataWindow.set(this.inputBuffer.subarray(this.inputOffset,this.inputOffset+t),this.stringStart+this.lookAhead),this.inputOffset+=t,this.totalBytesIn+=t,this.lookAhead+=t}this.lookAhead>=3&&this.updateHash()},t.prototype.slideWindow=function(){this.dataWindow.set(this.dataWindow.subarray(this.windowSize,this.windowSize+this.windowSize),0),this.matchStart-=this.windowSize,this.stringStart-=this.windowSize,this.blockStart-=this.windowSize;for(var t=0;t<this.hashSize;++t){var e=65535&this.hashHead[t];this.hashHead[t]=e>=this.windowSize?e-this.windowSize:0}for(t=0;t<this.windowSize;t++){e=65535&this.hashPrevious[t];this.hashPrevious[t]=e>=this.windowSize?e-this.windowSize:0}},t.prototype.insertString=function(){var t,e=(this.currentHash<<this.hashShift^this.dataWindow[this.stringStart+2])&this.hashMask;return this.hashPrevious[this.stringStart&this.windowMask]=t=this.hashHead[e],this.hashHead[e]=this.stringStart,this.currentHash=e,65535&t},t.prototype.findLongestMatch=function(t){var e,i=4096,r=258,n=this.stringStart,s=this.stringStart+this.matchLength,o=Math.max(this.matchLength,2),h=Math.max(this.stringStart-this.maxDist,0),a=this.stringStart+258-1,f=this.dataWindow[s-1],u=this.dataWindow[s],c=this.dataWindow;o>=32&&(i>>=2),r>this.lookAhead&&(r=this.lookAhead);do{if(c[t+o]===u&&c[t+o-1]===f&&c[t]===c[n]&&c[t+1]===c[n+1]){for(e=t+2,n+=2;c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&n<a;);if(n>s){if(this.matchStart=t,s=n,(o=n-this.stringStart)>=r)break;f=c[s-1],u=c[s]}n=this.stringStart}}while((t=65535&this.hashPrevious[t&this.windowMask])>h&&0!=--i);return this.matchLength=Math.min(o,this.lookAhead),this.matchLength>=3},t.prototype.updateHash=function(){this.currentHash=this.dataWindow[this.stringStart]<<this.hashShift^this.dataWindow[this.stringStart+1]},t.prototype.huffmanTallyLit=function(t){return this.arrDistances[this.bufferPosition]=0,this.arrLiterals[this.bufferPosition++]=t,this.treeLiteral.codeFrequencies[t]++,this.bufferPosition>=16384},t.prototype.huffmanTallyDist=function(t,e){this.arrDistances[this.bufferPosition]=t,this.arrLiterals[this.bufferPosition++]=e-3;var i=this.huffmanLengthCode(e-3);this.treeLiteral.codeFrequencies[i]++,i>=265&&i<285&&(this.extraBits+=Math.floor((i-261)/4));var r=this.huffmanDistanceCode(t-1);return this.treeDistances.codeFrequencies[r]++,r>=4&&(this.extraBits+=Math.floor(r/2-1)),this.bufferPosition>=16384},t.prototype.huffmanFlushBlock=function(t,e,i,r){this.treeLiteral.codeFrequencies[256]++,this.treeLiteral.buildTree(),this.treeDistances.buildTree(),this.treeLiteral.calculateBLFreq(this.treeCodeLengths),this.treeDistances.calculateBLFreq(this.treeCodeLengths),this.treeCodeLengths.buildTree();for(var n=4,s=18;s>n;s--)this.treeCodeLengths.codeLengths[d.huffCodeLengthOrders[s]]>0&&(n=s+1);var o=14+3*n+this.treeCodeLengths.getEncodedLength()+this.treeLiteral.getEncodedLength()+this.treeDistances.getEncodedLength()+this.extraBits,c=this.extraBits;for(s=0;s<286;s++)c+=this.treeLiteral.codeFrequencies[s]*a[s];for(s=0;s<30;s++)c+=this.treeDistances.codeFrequencies[s]*u[s];o>=c&&(o=c),e>=0&&i+4<o>>3?this.huffmanFlushStoredBlock(t,e,i,r):o==c?(this.pendingBufferWriteBits(2+(r?1:0),3),this.treeLiteral.setStaticCodes(h,a),this.treeDistances.setStaticCodes(f,u),this.huffmanCompressBlock(),this.huffmanReset()):(this.pendingBufferWriteBits(4+(r?1:0),3),this.huffmanSendAllTrees(n),this.huffmanCompressBlock(),this.huffmanReset())},t.prototype.huffmanFlushStoredBlock=function(t,e,i,r){this.pendingBufferWriteBits(0+(r?1:0),3),this.pendingBufferAlignToByte(),this.pendingBufferWriteShort(i),this.pendingBufferWriteShort(~i),this.pendingBufferWriteByteBlock(t,e,i),this.huffmanReset()},t.prototype.huffmanLengthCode=function(t){if(255===t)return 285;for(var e=257;t>=8;)e+=4,t>>=1;return e+t},t.prototype.huffmanDistanceCode=function(t){for(var e=0;t>=4;)e+=2,t>>=1;return e+t},t.prototype.huffmanSendAllTrees=function(t){this.treeCodeLengths.buildCodes(),this.treeLiteral.buildCodes(),this.treeDistances.buildCodes(),this.pendingBufferWriteBits(this.treeLiteral.treeLength-257,5),this.pendingBufferWriteBits(this.treeDistances.treeLength-1,5),this.pendingBufferWriteBits(t-4,4);for(var e=0;e<t;e++)this.pendingBufferWriteBits(this.treeCodeLengths.codeLengths[d.huffCodeLengthOrders[e]],3);this.treeLiteral.writeTree(this.treeCodeLengths),this.treeDistances.writeTree(this.treeCodeLengths)},t.prototype.huffmanReset=function(){this.bufferPosition=0,this.extraBits=0,this.treeLiteral.reset(),this.treeDistances.reset(),this.treeCodeLengths.reset()},t.prototype.huffmanCompressBlock=function(){for(var t=0;t<this.bufferPosition;t++){var e=255&this.arrLiterals[t],i=this.arrDistances[t];if(0!=i--){var r=this.huffmanLengthCode(e);this.treeLiteral.writeCodeToStream(r);var n=Math.floor((r-261)/4);n>0&&n<=5&&this.pendingBufferWriteBits(e&(1<<n)-1,n);var s=this.huffmanDistanceCode(i);this.treeDistances.writeCodeToStream(s),(n=Math.floor(s/2-1))>0&&this.pendingBufferWriteBits(i&(1<<n)-1,n)}else this.treeLiteral.writeCodeToStream(e)}this.treeLiteral.writeCodeToStream(256)},t.prototype.pendingBufferWriteBits=function(t,e){var i=new Uint32Array(1);i[0]=this.pendingBufCache|t<<this.pendingBufBitsInCache,this.pendingBufCache=i[0],this.pendingBufBitsInCache+=e,this.pendingBufferFlushBits()},t.prototype.pendingBufferFlush=function(t){if(this.pendingBufferFlushBits(),this.pendingBufLength>0){var e=new Uint8Array(this.pendingBufLength);e.set(this.pendingBuffer.subarray(0,this.pendingBufLength),0),this.stream.push(e)}this.pendingBufLength=0},t.prototype.pendingBufferFlushBits=function(){for(var t=0;this.pendingBufBitsInCache>=8&&this.pendingBufLength<65536;)this.pendingBuffer[this.pendingBufLength++]=this.pendingBufCache,this.pendingBufCache>>=8,this.pendingBufBitsInCache-=8,t++;return t},t.prototype.pendingBufferWriteByteBlock=function(t,e,i){var r=t.subarray(e,e+i);this.pendingBuffer.set(r,this.pendingBufLength),this.pendingBufLength+=i},t.prototype.pendingBufferWriteShort=function(t){this.pendingBuffer[this.pendingBufLength++]=t,this.pendingBuffer[this.pendingBufLength++]=t>>8},t.prototype.pendingBufferAlignToByte=function(){this.pendingBufBitsInCache>0&&(this.pendingBuffer[this.pendingBufLength++]=this.pendingBufCache),this.pendingBufCache=0,this.pendingBufBitsInCache=0},t.initHuffmanTree=function(){for(var t=0;t<144;)h[t]=d.bitReverse(48+t<<8),a[t++]=8;for(;t<256;)h[t]=d.bitReverse(256+t<<7),a[t++]=9;for(;t<280;)h[t]=d.bitReverse(-256+t<<9),a[t++]=7;for(;t<286;)h[t]=d.bitReverse(-88+t<<8),a[t++]=8;for(t=0;t<30;t++)f[t]=d.bitReverse(t<<11),u[t]=5},t.prototype.close=function(){do{this.pendingBufferFlush(!0),this.compressData(!0)||(this.pendingBufferFlush(!0),this.pendingBufferAlignToByte(),this.noWrap||(this.pendingBufferWriteShortBytes(this.checkSum>>16),this.pendingBufferWriteShortBytes(65535&this.checkSum)),this.pendingBufferFlush(!0))}while(this.inputEnd!==this.inputOffset||0!==this.pendingBufLength)},t.prototype.destroy=function(){this.stream=[],this.stream=void 0,this.pendingBuffer=void 0,this.treeLiteral=void 0,this.treeDistances=void 0,this.treeCodeLengths=void 0,this.arrLiterals=void 0,this.arrDistances=void 0,this.hashHead=void 0,this.hashPrevious=void 0,this.dataWindow=void 0,this.inputBuffer=void 0,this.pendingBufLength=void 0,this.pendingBufCache=void 0,this.pendingBufBitsInCache=void 0,this.bufferPosition=void 0,this.extraBits=void 0,this.currentHash=void 0,this.matchStart=void 0,this.matchLength=void 0,this.matchPrevAvail=void 0,this.blockStart=void 0,this.stringStart=void 0,this.lookAhead=void 0,this.totalBytesIn=void 0,this.inputOffset=void 0,this.inputEnd=void 0,this.windowSize=void 0,this.windowMask=void 0,this.hashSize=void 0,this.hashMask=void 0,this.hashShift=void 0,this.maxDist=void 0,this.checkSum=void 0,this.noWrap=void 0},t.isHuffmanTreeInitiated=!1,t}(),d=function(){function t(t,e,i,r){this.writer=t,this.codeMinCount=i,this.maxLength=r,this.codeFrequency=new Uint16Array(e),this.lengthCount=new Int32Array(r)}return Object.defineProperty(t.prototype,"treeLength",{get:function(){return this.codeCount},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"codeLengths",{get:function(){return this.codeLength},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"codeFrequencies",{get:function(){return this.codeFrequency},enumerable:!0,configurable:!0}),t.prototype.setStaticCodes=function(t,e){var i=new Int16Array(t.length);i.set(t,0),this.codes=i;var r=new Uint8Array(e.length);r.set(e,0),this.codeLength=r},t.prototype.reset=function(){for(var t=0;t<this.codeFrequency.length;t++)this.codeFrequency[t]=0;this.codes=void 0,this.codeLength=void 0},t.prototype.writeCodeToStream=function(t){this.writer.pendingBufferWriteBits(65535&this.codes[t],this.codeLength[t])},t.prototype.buildCodes=function(){var e=new Int32Array(this.maxLength);this.codes=new Int16Array(this.codeCount);for(var i=0,r=0;r<this.maxLength;r++)e[r]=i,i+=this.lengthCount[r]<<15-r;for(var n=0;n<this.codeCount;n++){var s=this.codeLength[n];s>0&&(this.codes[n]=t.bitReverse(e[s-1]),e[s-1]+=1<<16-s)}},t.bitReverse=function(e){return t.reverseBits[15&e]<<12|t.reverseBits[e>>4&15]<<8|t.reverseBits[e>>8&15]<<4|t.reverseBits[e>>12]},t.prototype.getEncodedLength=function(){for(var t=0,e=0;e<this.codeFrequency.length;e++)t+=this.codeFrequency[e]*this.codeLength[e];return t},t.prototype.calculateBLFreq=function(t){for(var e,i,r,n=-1,s=0;s<this.codeCount;){r=1;var o=this.codeLength[s];for(0===o?(e=138,i=3):(e=6,i=3,n!==o&&(t.codeFrequency[o]++,r=0)),n=o,s++;s<this.codeCount&&n===this.codeLength[s]&&(s++,!(++r>=e)););r<i?t.codeFrequency[n]+=r:0!==n?t.codeFrequency[16]++:r<=10?t.codeFrequency[17]++:t.codeFrequency[18]++}},t.prototype.writeTree=function(t){for(var e,i,r,n=-1,s=0;s<this.codeCount;){r=1;var o=this.codeLength[s];for(0===o?(e=138,i=3):(e=6,i=3,n!==o&&(t.writeCodeToStream(o),r=0)),n=o,s++;s<this.codeCount&&n===this.codeLength[s]&&(s++,!(++r>=e)););if(r<i)for(;r-- >0;)t.writeCodeToStream(n);else 0!==n?(t.writeCodeToStream(16),this.writer.pendingBufferWriteBits(r-3,2)):r<=10?(t.writeCodeToStream(17),this.writer.pendingBufferWriteBits(r-3,3)):(t.writeCodeToStream(18),this.writer.pendingBufferWriteBits(r-11,7))}},t.prototype.buildTree=function(){for(var t=this.codeFrequency.length,e=new Int32Array(t),i=0,r=0,n=0;n<t;n++){var s=this.codeFrequency[n];if(0!==s){for(var o=i++,h=0;o>0&&this.codeFrequency[e[h=Math.floor((o-1)/2)]]>s;)e[o]=e[h],o=h;e[o]=n,r=n}}for(;i<2;)e[i++]=r<2?++r:0;this.codeCount=Math.max(r+1,this.codeMinCount);for(var a=i,f=new Int32Array(4*i-2),u=new Int32Array(2*i-1),c=0;c<i;c++){var d=e[c],p=2*c;f[p]=d,f[p+1]=-1,u[c]=this.codeFrequency[d]<<8,e[c]=c}this.constructHuffmanTree(e,i,u,a,f),this.buildLength(f)},t.prototype.constructHuffmanTree=function(t,e,i,r,n){do{for(var s=t[0],o=t[--e],h=i[o],a=0,f=1;f<e;)f+1<e&&i[t[f]]>i[t[f+1]]&&f++,t[a]=t[f],f=2*(a=f)+1;for(;(f=a)>0&&i[t[a=Math.floor((f-1)/2)]]>h;)t[f]=t[a];t[f]=o;var u=t[0];n[2*(o=r++)]=s,n[2*o+1]=u;var c=Math.min(255&i[s],255&i[u]);for(i[o]=h=i[s]+i[u]-c+1,a=0,f=1;f<e;)f+1<e&&i[t[f]]>i[t[f+1]]&&f++,t[a]=t[f],f=2*(a=f)+1;for(;(f=a)>0&&i[t[a=Math.floor((f-1)/2)]]>h;)t[f]=t[a];t[f]=o}while(e>1)},t.prototype.buildLength=function(t){this.codeLength=new Uint8Array(this.codeFrequency.length);for(var e=Math.floor(t.length/2),i=Math.floor((e+1)/2),r=0,n=0;n<this.maxLength;n++)this.lengthCount[n]=0;if(0!==(r=this.calculateOptimalCodeLength(t,r,e))){var s=this.maxLength-1;do{for(;0===this.lengthCount[--s];);do{this.lengthCount[s]--,this.lengthCount[++s]++,r-=1<<this.maxLength-1-s}while(r>0&&s<this.maxLength-1)}while(r>0);this.recreateTree(t,r,i)}},t.prototype.recreateTree=function(t,e,i){this.lengthCount[this.maxLength-1]+=e,this.lengthCount[this.maxLength-2]-=e;for(var r=2*i,n=this.maxLength;0!==n;n--)for(var s=this.lengthCount[n-1];s>0;){var o=2*t[r++];-1===t[o+1]&&(this.codeLength[t[o]]=n,s--)}},t.prototype.calculateOptimalCodeLength=function(t,e,i){var r=new Int32Array(i);r[i-1]=0;for(var n=i-1;n>=0;n--){var s=2*n+1;if(-1!==t[s]){(o=r[n]+1)>this.maxLength&&(o=this.maxLength,e++),r[t[s-1]]=r[t[s]]=o}else{var o=r[n];this.lengthCount[o-1]++,this.codeLength[t[s-1]]=r[n]}}return e},t.reverseBits=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],t.huffCodeLengthOrders=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],t}(),p=function(){function t(){}return t.checksumUpdate=function(e,i,r,n){var s=new Uint32Array(1);s[0]=e;for(var o=s[0],h=s[0]=65535&o,a=s[0]=o>>t.checkSumBitOffset;n>0;){var f=Math.min(n,t.checksumIterationCount);for(n-=f;--f>=0;)a+=h+=s[0]=255&i[r++];h%=t.checksumBase,a%=t.checksumBase}return o=a<<t.checkSumBitOffset|h},t.checkSumBitOffset=16,t.checksumBase=65521,t.checksumIterationCount=3800,t}(),l=function(){function t(t){this.buildTree(t)}return t.init=function(){var e,i;for(e=new Uint8Array(288),i=0;i<144;)e[i++]=8;for(;i<256;)e[i++]=9;for(;i<280;)e[i++]=7;for(;i<288;)e[i++]=8;for(t.m_LengthTree=new t(e),e=new Uint8Array(32),i=0;i<32;)e[i++]=5;t.m_DistanceTree=new t(e)},t.prototype.prepareData=function(e,i,r){for(var n=0,s=512,o=0;o<r.length;o++){var h=r[o];h>0&&e[h]++}for(var a=1;a<=t.MAX_BITLEN;a++)if(i[a]=n,n+=e[a]<<16-a,a>=10){s+=(130944&n)-(130944&i[a])>>16-a}return{code:n,treeSize:s}},t.prototype.treeFromData=function(e,r,n,s,o){for(var h=new Int16Array(o),a=512,f=t.MAX_BITLEN;f>=10;f--)for(var u=130944&s,c=130944&(s-=e[f]<<16-f);c<u;c+=128)h[i.bitReverse(c)]=i.bitConverterInt32ToInt16(-a<<4|f),a+=1<<f-9;for(c=0;c<n.length;c++){if(0!=(f=n[c])){s=r[f];var d=i.bitReverse(s);if(f<=9)do{h[d]=i.bitConverterInt32ToInt16(c<<4|f),d+=1<<f}while(d<512);else{var p=h[511&d],l=1<<(15&p);p=-(p>>4);do{h[p|d>>9]=i.bitConverterInt32ToInt16(c<<4|f),d+=1<<f}while(d<l)}r[f]=s+(1<<16-f)}}return h},t.prototype.buildTree=function(t){var e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=this.prepareData(e,i,t);this.m_Tree=this.treeFromData(e,i,t,r.code,r.treeSize)},t.prototype.unpackSymbol=function(t){var e,i;if((e=t.peekBits(9))>=0){if((i=this.m_Tree[e])>=0)return t.skipBits(15&i),i>>4;var r=-(i>>4),n=15&i;if((e=t.peekBits(n))>=0)return i=this.m_Tree[r|e>>9],t.skipBits(15&i),i>>4;var s=t.availableBits;return e=t.peekBits(s),(15&(i=this.m_Tree[r|e>>9]))<=s?(t.skipBits(15&i),i>>4):-1}s=t.availableBits;return e=t.peekBits(s),(i=this.m_Tree[e])>=0&&(15&i)<=s?(t.skipBits(15&i),i>>4):-1},Object.defineProperty(t,"lengthTree",{get:function(){return this.m_LengthTree},enumerable:!0,configurable:!0}),Object.defineProperty(t,"distanceTree",{get:function(){return this.m_DistanceTree},enumerable:!0,configurable:!0}),t.MAX_BITLEN=15,t}(),m=function(){function t(){}return t.ChecksumUpdate=function(t,e,i,r){for(var n=t,s=65535&n,o=n>>this.DEF_CHECKSUM_BIT_OFFSET;r>0;){var h=Math.min(r,this.DEF_CHECKSUM_ITERATIONSCOUNT);for(r-=h;--h>=0;)o+=s+=255&e[i++];s%=this.DEF_CHECKSUM_BASE,o%=this.DEF_CHECKSUM_BASE}t=n=o<<this.DEF_CHECKSUM_BIT_OFFSET|s},t.ChecksumGenerate=function(e,i,r){return t.ChecksumUpdate(1,e,i,r),1},t.DEF_CHECKSUM_BIT_OFFSET=16,t.DEF_CHECKSUM_BASE=65521,t.DEF_CHECKSUM_ITERATIONSCOUNT=3800,t}(),g=function(){function t(t,e){if(this.defaultHuffmanDynamicTree=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],this.DEF_HEADER_METHOD_MASK=3840,this.DEF_HEADER_INFO_MASK=61440,this.DEF_HEADER_FLAGS_FCHECK=31,this.DEF_HEADER_FLAGS_FDICT=32,this.DEF_HEADER_FLAGS_FLEVEL=192,this.DEF_MAX_WINDOW_SIZE=65535,this.DEF_HUFFMAN_REPEATE_MAX=258,this.DEF_HUFFMAN_END_BLOCK=256,this.DEF_HUFFMAN_LENGTH_MINIMUMCODE=257,this.DEF_HUFFMAN_LENGTH_MAXIMUMCODE=285,this.DEF_HUFFMAN_DISTANCE_MAXIMUMCODE=29,this.mCheckSum=1,this.tBuffer=0,this.mBufferedBits=0,this.mTempBuffer=new Uint8Array(4),this.mBlockBuffer=new Uint8Array(this.DEF_MAX_WINDOW_SIZE),this.mbNoWrap=!1,this.mWindowSize=0,this.mCurrentPosition=0,this.mDataLength=0,this.mbCanReadNextBlock=!0,this.mbCanReadMoreData=!0,this.mbCheckSumRead=!1,null==t)throw new DOMException("stream");if(0===t.length)throw new DOMException("stream - string can not be empty");l.init(),this.mInputStream=new B(t),this.mbNoWrap=e,this.mbNoWrap||this.readZLibHeader(),this.decodeBlockHeader()}return Object.defineProperty(t.prototype,"mBuffer",{get:function(){return this.tBuffer},set:function(t){this.tBuffer=t},enumerable:!0,configurable:!0}),t.prototype.peekBits=function(t){if(t<0)throw new DOMException("count","Bits count can not be less than zero.");if(t>32)throw new DOMException("count","Count of bits is too large.");if(this.mBufferedBits<t&&this.fillBuffer(),this.mBufferedBits<t)return-1;var e=~(4294967295<<t);return i.bitConverterUintToInt32(this.mBuffer&e)},t.prototype.fillBuffer=function(){var t=4-(this.mBufferedBits>>3)-(0!=(7&this.mBufferedBits)?1:0);if(0!==t)for(var e=this.mInputStream.read(this.mTempBuffer,0,t),r=0;r<e;r++)this.mBuffer=i.bitConverterInt32ToUint(this.mBuffer|i.bitConverterInt32ToUint(this.mTempBuffer[r]<<this.mBufferedBits)),this.mBufferedBits+=8},t.prototype.skipBits=function(t){if(t<0)throw new DOMException("count","Bits count can not be less than zero.");0!==t&&(t>=this.mBufferedBits?(t-=this.mBufferedBits,this.mBufferedBits=0,this.mBuffer=0,t>0&&(this.mInputStream.position+=t>>3,(t&=7)>0&&(this.fillBuffer(),this.mBufferedBits-=t,this.mBuffer=i.bitConverterInt32ToUint(this.mBuffer>>>t)))):(this.mBufferedBits-=t,this.mBuffer=i.bitConverterInt32ToUint(this.mBuffer>>>t)))},Object.defineProperty(t.prototype,"availableBits",{get:function(){return this.mBufferedBits},enumerable:!0,configurable:!0}),t.prototype.readZLibHeader=function(){var t=this.readInt16();if(-1===t)throw new DOMException("Header of the stream can not be read.");if(t%31!=0)throw new DOMException("Header checksum illegal");if(2048!=(t&this.DEF_HEADER_METHOD_MASK))throw new DOMException("Unsupported compression method.");if(this.mWindowSize=Math.pow(2,8+((t&this.DEF_HEADER_INFO_MASK)>>12)),this.mWindowSize>65535)throw new DOMException("Unsupported window size for deflate compression method.");if((t&this.DEF_HEADER_FLAGS_FDICT)>>5==1)throw new DOMException("Custom dictionary is not supported at the moment.")},t.prototype.readInt16=function(){var t=this.readBits(8)<<8;return t|=this.readBits(8)},t.prototype.readBits=function(t){var e=this.peekBits(t);return-1===e?-1:(this.mBufferedBits-=t,this.mBuffer=i.bitConverterInt32ToUint(this.mBuffer>>>t),e)},t.prototype.decodeBlockHeader=function(){if(!this.mbCanReadNextBlock)return!1;var t=this.readBits(1);if(-1===t)return!1;var e=this.readBits(2);if(-1===e)return!1;switch(this.mbCanReadNextBlock=0===t,e){case 0:this.mbReadingUncompressed=!0,this.skipToBoundary();var i=this.readInt16Inverted();if(i!==(65535^this.readInt16Inverted()))throw new DOMException("Wrong block length.");if(i>65535)throw new DOMException("Uncompressed block length can not be more than 65535.");this.mUncompressedDataLength=i,this.mCurrentLengthTree=null,this.mCurrentDistanceTree=null;break;case 1:this.mbReadingUncompressed=!1,this.mUncompressedDataLength=-1,this.mCurrentLengthTree=l.lengthTree,this.mCurrentDistanceTree=l.distanceTree;break;case 2:this.mbReadingUncompressed=!1,this.mUncompressedDataLength=-1;var r=this.decodeDynamicHeader(this.mCurrentLengthTree,this.mCurrentDistanceTree);this.mCurrentLengthTree=r.lengthTree,this.mCurrentDistanceTree=r.distanceTree;break;default:throw new DOMException("Wrong block type.")}return!0},t.prototype.skipToBoundary=function(){this.mBuffer=i.bitConverterInt32ToUint(this.mBuffer>>>(7&this.mBufferedBits)),this.mBufferedBits&=-8},t.prototype.readInt16Inverted=function(){var t=this.readBits(8);return t|=this.readBits(8)<<8},t.prototype.decodeDynamicHeader=function(e,i){var r=0,n=this.readBits(5),s=this.readBits(5),o=this.readBits(4);if(n<0||s<0||o<0)throw new DOMException("Wrong dynamic huffman codes.");var h=(n+=257)+(s+=1),a=new Uint8Array(h),f=new Uint8Array(19);o+=4;for(var u=0;u<o;){var c=this.readBits(3);if(c<0)throw new DOMException("Wrong dynamic huffman codes.");f[this.defaultHuffmanDynamicTree[u++]]=c}var d=new l(f);for(u=0;;){var p=void 0,m=!1;for(p=d.unpackSymbol(this);0==(-16&p);){if(a[u++]=r=p,u===h){m=!0;break}p=d.unpackSymbol(this)}if(m)break;if(p<0)throw new DOMException("Wrong dynamic huffman codes.");if(p>=17)r=0;else if(0===u)throw new DOMException("Wrong dynamic huffman codes.");var g=p-16,B=t.DEF_HUFFMAN_DYNTREE_REPEAT_BITS[g],v=this.readBits(B);if(v<0)throw new DOMException("Wrong dynamic huffman codes.");if(v+=t.DEF_HUFFMAN_DYNTREE_REPEAT_MINIMUMS[g],u+v>h)throw new DOMException("Wrong dynamic huffman codes.");for(;v-- >0;)a[u++]=r;if(u===h)break}var w=new Uint8Array(n);return w.set(a.subarray(0,n),0),e=new l(w),w=a.slice(n,n+s),i=new l(w),{lengthTree:e,distanceTree:i}},t.prototype.readHuffman=function(){for(var e=this.DEF_MAX_WINDOW_SIZE-(this.mDataLength-this.mCurrentPosition),i=!1,r={};e>=this.DEF_HUFFMAN_REPEATE_MAX;){var n=void 0;for(n=this.mCurrentLengthTree.unpackSymbol(this);0==(-256&n);){if(r[(this.mDataLength+1)%this.DEF_MAX_WINDOW_SIZE]=n,this.mBlockBuffer[this.mDataLength++%this.DEF_MAX_WINDOW_SIZE]=n,i=!0,--e<this.DEF_HUFFMAN_REPEATE_MAX)return!0;n=this.mCurrentLengthTree.unpackSymbol(this)}if(n<this.DEF_HUFFMAN_LENGTH_MINIMUMCODE){if(n<this.DEF_HUFFMAN_END_BLOCK)throw new DOMException("Illegal code.");var s=i?1:0;this.mbCanReadMoreData=this.decodeBlockHeader();return!!(s|(this.mbCanReadMoreData?1:0))}if(n>this.DEF_HUFFMAN_LENGTH_MAXIMUMCODE)throw new DOMException("Illegal repeat code length.");var o=t.DEF_HUFFMAN_REPEAT_LENGTH_BASE[n-this.DEF_HUFFMAN_LENGTH_MINIMUMCODE],h=t.DEF_HUFFMAN_REPEAT_LENGTH_EXTENSION[n-this.DEF_HUFFMAN_LENGTH_MINIMUMCODE];if(h>0){if((f=this.readBits(h))<0)throw new DOMException("Wrong data.");o+=f}if((n=this.mCurrentDistanceTree.unpackSymbol(this))<0||n>t.DEF_HUFFMAN_REPEAT_DISTANCE_BASE.length)throw new DOMException("Wrong distance code.");var a=t.DEF_HUFFMAN_REPEAT_DISTANCE_BASE[n];if((h=t.DEF_HUFFMAN_REPEAT_DISTANCE_EXTENSION[n])>0){var f;if((f=this.readBits(h))<0)throw new DOMException("Wrong data.");a+=f}for(var u=0;u<o;u++)this.mBlockBuffer[this.mDataLength%this.DEF_MAX_WINDOW_SIZE]=this.mBlockBuffer[(this.mDataLength-a)%this.DEF_MAX_WINDOW_SIZE],this.mDataLength++,e--;i=!0}return i},t.prototype.read=function(t,e,r){if(null==t)throw new DOMException("buffer");if(e<0||e>t.length-1)throw new DOMException("offset","Offset does not belong to specified buffer.");if(r<0||r>t.length-e)throw new DOMException("length","Length is illegal.");for(var n=r;r>0;)if(this.mCurrentPosition<this.mDataLength){var s=this.mCurrentPosition%this.DEF_MAX_WINDOW_SIZE,o=Math.min(this.DEF_MAX_WINDOW_SIZE-s,this.mDataLength-this.mCurrentPosition);o=Math.min(o,r),i.arrayCopy(this.mBlockBuffer,s,t,e,o),this.mCurrentPosition+=o,e+=o,r-=o}else{if(!this.mbCanReadMoreData)break;var h=this.mDataLength;if(this.mbReadingUncompressed)if(0===this.mUncompressedDataLength){if(this.mbCanReadMoreData=this.decodeBlockHeader(),!this.mbCanReadMoreData)break}else{s=this.mDataLength%this.DEF_MAX_WINDOW_SIZE;var a=Math.min(this.mUncompressedDataLength,this.DEF_MAX_WINDOW_SIZE-s),f=this.readPackedBytes(this.mBlockBuffer,s,a);if(a!==f)throw new DOMException("Not enough data in stream.");this.mUncompressedDataLength-=f,this.mDataLength+=f}else if(!this.readHuffman())break;if(h<this.mDataLength){var u=h%this.DEF_MAX_WINDOW_SIZE,c=this.mDataLength%this.DEF_MAX_WINDOW_SIZE;u<c?this.checksumUpdate(this.mBlockBuffer,u,c-u):(this.checksumUpdate(this.mBlockBuffer,u,this.DEF_MAX_WINDOW_SIZE-u),c>0&&this.checksumUpdate(this.mBlockBuffer,0,c))}}if(!this.mbCanReadMoreData&&!this.mbCheckSumRead&&!this.mbNoWrap){this.skipToBoundary();if(this.readInt32()!==this.mCheckSum)throw new DOMException("Checksum check failed.");this.mbCheckSumRead=!0}return n-r},t.prototype.readPackedBytes=function(t,e,r){if(null==t)throw new DOMException("buffer");if(e<0||e>t.length-1)throw new DOMException('offset", "Offset can not be less than zero or greater than buffer length - 1.');if(r<0)throw new DOMException('length", "Length can not be less than zero.');if(r>t.length-e)throw new DOMException('length", "Length is too large.');if(0!=(7&this.mBufferedBits))throw new DOMException("Reading of unalligned data is not supported.");if(0===r)return 0;for(var n=0;this.mBufferedBits>0&&r>0;)t[e++]=this.mBuffer,this.mBufferedBits-=8,this.mBuffer=i.bitConverterInt32ToUint(this.mBuffer>>>8),r--,n++;return r>0&&(n+=this.mInputStream.read(t,e,r)),n},t.prototype.readInt32=function(){var t=this.readBits(8)<<24;return t|=this.readBits(8)<<16,t|=this.readBits(8)<<8,t|=this.readBits(8)},t.prototype.checksumUpdate=function(t,e,i){m.ChecksumUpdate(this.mCheckSum,t,e,i)},t.DEF_REVERSE_BITS=new Uint8Array([0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15]),t.DEF_HUFFMAN_DYNTREE_REPEAT_MINIMUMS=[3,3,11],t.DEF_HUFFMAN_DYNTREE_REPEAT_BITS=[2,3,7],t.DEF_HUFFMAN_REPEAT_LENGTH_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],t.DEF_HUFFMAN_REPEAT_LENGTH_EXTENSION=[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],t.DEF_HUFFMAN_REPEAT_DISTANCE_BASE=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],t.DEF_HUFFMAN_REPEAT_DISTANCE_EXTENSION=[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],t}(),B=function(){function t(t){this.position=0,this.inputStream=new Uint8Array(t.buffer)}return Object.defineProperty(t.prototype,"length",{get:function(){return this.inputStream.buffer.byteLength},enumerable:!0,configurable:!0}),t.prototype.read=function(t,e,i){var r=new Uint8Array(this.inputStream.buffer,this.position+e).subarray(0,i);return t.set(r,0),this.position+=r.byteLength,r.byteLength},t.prototype.readByte=function(){return this.inputStream[this.position++]},t.prototype.write=function(t,e,r){i.arrayCopy(t,0,this.inputStream,this.position+e,r),this.position+=r},t.prototype.toByteArray=function(){return new Uint8Array(this.inputStream.buffer)},t}();t.ZipArchive=n,t.ZipArchiveItemHelper=s,t.ZipArchiveItem=o,t.CompressedStreamWriter=c,t.CompressorHuffmanTree=d,t.ChecksumCalculator=p,t.Utils=i,t.DecompressorHuffmanTree=l,t.CompressedStreamReader=g,t.Stream=B,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-file-utils")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-file-utils"],e):e((t=t||self).ej={},t.ej2FileUtils)}(this,function(t,a){"use strict";e.bitReverse=function(t){return e.reverseBits[15&t]<<12|e.reverseBits[t>>4&15]<<8|e.reverseBits[t>>8&15]<<4|e.reverseBits[t>>12]},e.bitConverterToInt32=function(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24},e.bitConverterToInt16=function(t,e){return t[e]|t[e+1]<<8},e.bitConverterToUInt32=function(t){var e=new Uint32Array(1);return e[0]=t,e[0]},e.bitConverterToUInt16=function(t,e){var i=new Uint16Array(1);return i[0]=t[e]|t[e+1]<<8,i[0]},e.bitConverterUintToInt32=function(t){var e=new Int32Array(1);return e[0]=t,e[0]},e.bitConverterInt32ToUint=function(t){var e=new Uint32Array(1);return e[0]=t,e[0]},e.bitConverterInt32ToInt16=function(t){var e=new Int16Array(1);return e[0]=t,e[0]},e.byteToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},e.byteIntToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},e.arrayCopy=function(t,e,i,r,n){t=new Uint8Array(t.buffer,e).subarray(0,n);i.set(t,r)},e.mergeArray=function(t,e){var i=new Uint8Array(t.length+e.length);return i.set(t),i.set(e,t.length),i},e.encodedString=function(t){var e,i,r,n,s,o,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,f=0,u=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(t.charAt(t.length-1)===h.charAt(64)&&u--,t.charAt(t.length-2)===h.charAt(64)&&u--,u%1!=0)throw new Error("Invalid base64 input, bad content length.");for(var c=new Uint8Array(0|u);a<t.length;)r=h.indexOf(t.charAt(a++)),e=(15&(n=h.indexOf(t.charAt(a++))))<<4|(s=h.indexOf(t.charAt(a++)))>>2,i=(3&s)<<6|(o=h.indexOf(t.charAt(a++))),c[f++]=r<<2|n>>4,64!==s&&(c[f++]=e),64!==o&&(c[f++]=i);return c},e.reverseBits=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],e.huffCodeLengthOrders=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var p=e;function e(){}var f=[],s=4096,o=(Object.defineProperty(r.prototype,"items",{get:function(){return this.files},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"compressionLevel",{get:function(){return this.level},set:function(t){this.level=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"length",{get:function(){return void 0===this.files?0:this.files.length},enumerable:!0,configurable:!0}),r.prototype.addItem=function(t){if(null==t)throw new Error("ArgumentException: item cannot be null or undefined");for(var e=0;e<this.files.length;e++){var i=this.files[e];if(i instanceof u&&i.name===t.name)throw new Error("item with same name already exist")}this.files.push(t)},r.prototype.addDirectory=function(t){if(null==t)throw new Error("ArgumentException: string cannot be null or undefined");if(0===t.length)throw new Error("ArgumentException: string cannot be empty");if("/"!==t.slice(-1)&&(t+="/"),-1!==this.files.indexOf(t))throw new Error("item with same name already exist");this.files.push(t)},r.prototype.getItem=function(t){if(0<=t&&t<this.files.length)return this.files[t]},r.prototype.contains=function(t){return-1!==this.files.indexOf(t)},r.prototype.open=function(t){t=p.encodedString(t);if(0==t.length)throw new DOMException("stream");var t=new _(t),e=r.findValueFromEnd(t,101010256,65557);if(e<0)throw new DOMException("Can't locate end of central directory record. Possible wrong file format or archive is corrupt.");t.position=e+12;var i=r.ReadInt32(t);t.position=e-i,this.readCentralDirectoryDataAndExtractItems(t)},r.prototype.readCentralDirectoryDataAndExtractItems=function(t){if(null==t)throw new DOMException("stream");for(var e;33639248==r.ReadInt32(t);)(e=new i).readCentralDirectoryData(t);e.readData(t,e.checkCrc),e.decompressData(),this.files.push(new u(e.unCompressedStream.buffer,e.name))},r.prototype.save=function(i){if(null==i||0===i.length)throw new Error("ArgumentException: fileName cannot be null or undefined");if(0===this.files.length)throw new Error("InvalidOperation");var r=this;return new Promise(function(t,e){r.saveInternal(i,!1).then(function(){t(r)})})},r.prototype.saveAsBlob=function(){var i=this;return new Promise(function(e,t){i.saveInternal("",!0).then(function(t){e(t)})})},r.prototype.saveInternal=function(s,o){var h=this,a=this;return new Promise(function(e,t){for(var i=[],r=0,n=0;n<a.files.length;n++)h.getCompressedData(h.files[n]).then(function(t){r=a.constructZippedObject(i,t,r,t.isDirectory),i.length===a.files.length&&(t=a.writeZippedContent(s,i,r,o),e(t))})})},r.prototype.destroy=function(){if(void 0!==this.files&&0<this.files.length){for(var t=0;t<this.files.length;t++){var e=this.files[t];e instanceof u&&e.destroy(),e=void 0}this.files=[]}this.files=void 0,this.level=void 0},r.prototype.getCompressedData=function(o){var h=this;return new Promise(function(n,t){var s;o instanceof u?((s=new FileReader).onload=function(){var t=new Uint8Array(s.result),e={fileName:o.name,crc32Value:0,compressedData:[],compressedSize:void 0,uncompressedDataSize:t.length,compressionType:void 0,isDirectory:!1};if("Normal"===h.level){h.compressData(t,e,f);for(var i=0,r=0;r<e.compressedData.length;r++)i+=e.compressedData[r].length;e.compressedSize=i,e.compressionType="\b\0"}else e.compressedSize=t.length,e.crc32Value=h.calculateCrc32Value(0,t,f),e.compressionType="\0\0",e.compressedData.push(t);n(e)},s.readAsArrayBuffer(o.data)):n({fileName:o,crc32Value:0,compressedData:"",compressedSize:0,uncompressedDataSize:0,compressionType:"\0\0",isDirectory:!0})})},r.prototype.compressData=function(t,e,i){var r=new g(!0),n=0;do{if(n>=t.length){r.close();break}var s=Math.min(t.length,n+16384),o=t.subarray(n,s)}while(e.crc32Value=this.calculateCrc32Value(e.crc32Value,o,i),r.write(o,0,s-n),(n=s)<=t.length);e.compressedData=r.compressedData,r.destroy()},r.prototype.constructZippedObject=function(t,e,i,r){var n=0,s=new Date,r=(r&&(n|=16),n|=0,this.writeHeader(e,s)),s="PK"+r+e.fileName,r=this.writeCentralDirectory(e,r,i,n);return t.push({localHeader:s,centralDir:r,compressedData:e}),i+s.length+e.compressedSize},r.prototype.writeHeader=function(t,e){var i="";return i+"\n\0\0\0"+t.compressionType+this.getBytes(this.getModifiedTime(e),2)+this.getBytes(this.getModifiedDate(e),2)+this.getBytes(t.crc32Value,4)+this.getBytes(t.compressedSize,4)+this.getBytes(t.uncompressedDataSize,4)+this.getBytes(t.fileName.length,2)+this.getBytes(0,2)},r.prototype.writeZippedContent=function(t,e,i,r){for(var n=0,s=[],o=0;o<e.length;o++){var h=e[o];for(n+=h.centralDir.length,s.push(this.getArrayBuffer(h.localHeader));h.compressedData.compressedData.length;)s.push(h.compressedData.compressedData.shift().buffer)}for(o=0;o<e.length;o++)s.push(this.getArrayBuffer(e[o].centralDir));s.push(this.getArrayBuffer(this.writeFooter(e,n,i)));i=new Blob(s,{type:"application/zip"});return r||a.Save.save(t,i),i},r.prototype.writeCentralDirectory=function(t,e,i,r){return"PK"+this.getBytes(20,2)+e+this.getBytes(0,2)+"\0\0\0\0"+this.getBytes(r,4)+this.getBytes(i,4)+t.fileName},r.prototype.writeFooter=function(t,e,i){return"PK\0\0\0\0"+this.getBytes(t.length,2)+this.getBytes(t.length,2)+this.getBytes(e,4)+this.getBytes(i,4)+this.getBytes(0,2)},r.prototype.getArrayBuffer=function(t){for(var e=new Uint8Array(t.length),i=0;i<t.length;++i)e[i]=255&t.charCodeAt(i);return e.buffer},r.prototype.getBytes=function(t,e){for(var i="",r=0;r<e;r++)i+=String.fromCharCode(255&t),t>>>=8;return i},r.prototype.getModifiedTime=function(t){var e=t.getHours();return(e=((e<<=6)|t.getMinutes())<<5)|t.getSeconds()/2},r.prototype.getModifiedDate=function(t){var e=t.getFullYear()-1980;return(e=((e<<=4)|t.getMonth()+1)<<5)|t.getDate()},r.prototype.calculateCrc32Value=function(t,e,i){t^=-1;for(var r=0;r<e.length;r++)t=t>>>8^i[255&(t^e[r])];return-1^t},r.initCrc32Table=function(){for(var t=0;t<256;t++){for(var e=t,i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;f[t]=e}},r.findValueFromEnd=function(t,e,i){if(null==t)throw new DOMException("stream");var r=t.inputStream.buffer.byteLength;if(r<4)return-1;var n=new Uint8Array(4),s=Math.max(0,r-i),o=r-1-4,h=(t.position=o,t.read(n,0,4),n[0]),a=h==e;if(!a)for(;s<o;)if(h<<=8,t.position=--o,(h+=t.readByte())==e){a=!0;break}return a?o:-1},r.ReadInt32=function(t){var e=new Uint8Array(4);if(4!=t.read(e,0,4))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return p.bitConverterToInt32(e,0)},r.ReadInt16=function(t){var e=new Uint8Array(2);if(2!=t.read(e,0,2))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return p.bitConverterToInt16(e,0)},r.ReadUInt16=function(t){var e=new Uint8Array(2);if(2!=t.read(e,0,2))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return p.bitConverterToInt16(e,0)},r);function r(){0===f.length&&r.initCrc32Table(),this.files=[],this.level="Normal",a.Save.isMicrosoftBrowser=!!navigator.msSaveBlob}n.prototype.readCentralDirectoryData=function(t){t.position+=4,this.options=o.ReadInt16(t),this.compressionMethod=o.ReadInt16(t),this.checkCrc=99!=this.compressionMethod;o.ReadInt32(t);this.crc32=p.bitConverterToUInt32(o.ReadInt32(t)),this.compressedSize=o.ReadInt32(t),this.originalSize=o.ReadInt32(t);var e=o.ReadInt16(t),i=o.ReadInt16(t),r=o.ReadInt16(t),n=(t.position+=4,this.externalAttributes=o.ReadInt32(t),this.localHeaderOffset=o.ReadInt32(t),new Uint8Array(e));t.read(n,0,e);e=(e=p.byteToString(n)).replace("\\","/");this.name=e,t.position+=i+r,0!=this.options&&(this.options=0)},n.prototype.readData=function(t,e){if(0==t.length)throw new DOMException("stream");t.position=this.localHeaderOffset,this.checkCrc=e,this.readLocalHeader(t),this.readCompressedData(t)},n.prototype.decompressData=function(){8==this.compressionMethod&&0<this.originalSize&&this.decompressDataOld()},n.prototype.decompressDataOld=function(){for(var t,e,i=new A(this.compressedStream,!0),r=(0<this.originalSize&&(t=new _(new Uint8Array(this.originalSize))),new Uint8Array(s));0<(e=i.read(r,0,s));)t.write(r.subarray(0,e),0,e);this.unCompressedStream=t.toByteArray(),this.checkCrc},n.prototype.readLocalHeader=function(t){if(0==t.length)throw new DOMException("stream");if(o.ReadInt32(t)!=this.headerSignature)throw new DOMException("Can't find local header signature - wrong file format or file is corrupt.");t.position+=22;var e=o.ReadInt16(t),i=o.ReadUInt16(t);if(99!=this.compressionMethod)if(2<i){if(t.position+=e,23==o.ReadInt16(t))throw new DOMException("UnSupported");t.position+=i-2}else t.position+=e+i},n.prototype.readCompressedData=function(t){if(0<this.compressedSize){for(var e=this.compressedSize,i=new _(new Uint8Array(e)),r=new Uint8Array(s);0<e;){var n=Math.min(e,s);if(t.read(r,0,n)!=n)throw new DOMException("End of file reached - wrong file format or file is corrupt.");i.write(r.subarray(0,n),0,n),e-=n}this.compressedStream=new Uint8Array(i.inputStream)}else this.compressedSize<0||this.compressedSize};var i=n;function n(){this.headerSignature=67324752,this.checkCrc=!0,this.crc32=0}Object.defineProperty(h.prototype,"dataStream",{get:function(){return this.decompressedStream},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"name",{get:function(){return this.fileName},set:function(t){this.fileName=t},enumerable:!0,configurable:!0}),h.prototype.destroy=function(){this.fileName=void 0,this.data=void 0};var u=h;function h(t,e){if(null==t)throw new Error("ArgumentException: data cannot be null or undefined");if(null==e)throw new Error("ArgumentException: string cannot be null or undefined");if(0===e.length)throw new Error("string cannot be empty");this.data=t,this.name=e}var c=new Int16Array(286),d=new Uint8Array(286),l=new Int16Array(30),m=new Uint8Array(30),g=(Object.defineProperty(B.prototype,"compressedData",{get:function(){return this.stream},enumerable:!0,configurable:!0}),Object.defineProperty(B.prototype,"getCompressedString",{get:function(){var t="";if(void 0!==this.stream)for(var e=0;e<this.stream.length;e++)t+=String.fromCharCode.apply(null,this.stream[e]);return t},enumerable:!0,configurable:!0}),B.prototype.write=function(t,e,i){if(null==t)throw new Error("ArgumentException: data cannot null or undefined");var r,i=e+i;if(e<0||i<e||i>t.length)throw new Error("ArgumentOutOfRangeException: Offset or length is incorrect");for("string"==typeof t&&((r=new a.Encoding(!1)).type="Utf8",i=e+(t=new Uint8Array(r.getBytes(t,0,t.length))).length),this.inputBuffer=t,this.inputOffset=e,this.inputEnd=i,this.noWrap||(this.checkSum=v.checksumUpdate(this.checkSum,this.inputBuffer,this.inputOffset,i));this.inputEnd!==this.inputOffset||0!==this.pendingBufLength;)this.pendingBufferFlush(),this.compressData(!1)},B.prototype.writeZLibHeader=function(){this.pendingBufferWriteShortBytes(30814)},B.prototype.pendingBufferWriteShortBytes=function(t){this.pendingBuffer[this.pendingBufLength++]=t>>8,this.pendingBuffer[this.pendingBufLength++]=t},B.prototype.compressData=function(t){do{this.fillWindow();var e=t&&this.inputEnd===this.inputOffset,i=this.compressSlow(e,t)}while(0===this.pendingBufLength&&i);return i},B.prototype.compressSlow=function(t,e){if(this.lookAhead<262&&!t)return!1;for(;262<=this.lookAhead||t;){if(0===this.lookAhead)return this.lookAheadCompleted(e);this.stringStart>=2*this.windowSize-262&&this.slideWindow();var i=this.matchStart,r=this.matchLength;if(3<=this.lookAhead&&this.discardMatch(),3<=r&&this.matchLength<=r?this.matchPreviousBest(i,r):this.matchPreviousAvailable(),16384<=this.bufferPosition)return this.huffmanIsFull(e)}return!0},B.prototype.discardMatch=function(){var t=this.insertString();0!==t&&this.stringStart-t<=this.maxDist&&this.findLongestMatch(t)&&this.matchLength<=5&&3===this.matchLength&&4096<this.stringStart-this.matchStart&&(this.matchLength=2)},B.prototype.matchPreviousAvailable=function(){this.matchPrevAvail&&this.huffmanTallyLit(255&this.dataWindow[this.stringStart-1]),this.matchPrevAvail=!0,this.stringStart++,this.lookAhead--},B.prototype.matchPreviousBest=function(t,e){for(this.huffmanTallyDist(this.stringStart-1-t,e),e-=2;this.stringStart++,this.lookAhead--,3<=this.lookAhead&&this.insertString(),0<--e;);return this.stringStart++,this.lookAhead--,this.matchPrevAvail=!1,this.matchLength=2,e},B.prototype.lookAheadCompleted=function(t){return this.matchPrevAvail&&this.huffmanTallyLit(255&this.dataWindow[this.stringStart-1]),this.matchPrevAvail=!1,this.huffmanFlushBlock(this.dataWindow,this.blockStart,this.stringStart-this.blockStart,t),this.blockStart=this.stringStart,!1},B.prototype.huffmanIsFull=function(t){var e=this.stringStart-this.blockStart,t=(this.matchPrevAvail&&e--,t&&0===this.lookAhead&&!this.matchPrevAvail);return this.huffmanFlushBlock(this.dataWindow,this.blockStart,e,t),this.blockStart+=e,!t},B.prototype.fillWindow=function(){for(this.stringStart>=this.windowSize+this.maxDist&&this.slideWindow();this.lookAhead<262&&this.inputOffset<this.inputEnd;){var t=2*this.windowSize-this.lookAhead-this.stringStart;t>this.inputEnd-this.inputOffset&&(t=this.inputEnd-this.inputOffset),this.dataWindow.set(this.inputBuffer.subarray(this.inputOffset,this.inputOffset+t),this.stringStart+this.lookAhead),this.inputOffset+=t,this.totalBytesIn+=t,this.lookAhead+=t}3<=this.lookAhead&&this.updateHash()},B.prototype.slideWindow=function(){this.dataWindow.set(this.dataWindow.subarray(this.windowSize,this.windowSize+this.windowSize),0),this.matchStart-=this.windowSize,this.stringStart-=this.windowSize,this.blockStart-=this.windowSize;for(var t=0;t<this.hashSize;++t){var e=65535&this.hashHead[t];this.hashHead[t]=e>=this.windowSize?e-this.windowSize:0}for(t=0;t<this.windowSize;t++){e=65535&this.hashPrevious[t];this.hashPrevious[t]=e>=this.windowSize?e-this.windowSize:0}},B.prototype.insertString=function(){var t,e=(this.currentHash<<this.hashShift^this.dataWindow[this.stringStart+2])&this.hashMask;return this.hashPrevious[this.stringStart&this.windowMask]=t=this.hashHead[e],this.hashHead[e]=this.stringStart,this.currentHash=e,65535&t},B.prototype.findLongestMatch=function(t){var e,i=4096,r=258,n=this.stringStart,s=this.stringStart+this.matchLength,o=Math.max(this.matchLength,2),h=Math.max(this.stringStart-this.maxDist,0),a=this.stringStart+258-1,f=this.dataWindow[s-1],u=this.dataWindow[s],c=this.dataWindow;32<=o&&(i>>=2),r>this.lookAhead&&(r=this.lookAhead);do{if(c[t+o]===u&&c[t+o-1]===f&&c[t]===c[n]&&c[t+1]===c[n+1]){for(e=t+2,n+=2;c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&n<a;);if(s<n){if(this.matchStart=t,r<=(o=(s=n)-this.stringStart))break;f=c[s-1],u=c[s]}n=this.stringStart}}while((t=65535&this.hashPrevious[t&this.windowMask])>h&&0!=--i);return this.matchLength=Math.min(o,this.lookAhead),3<=this.matchLength},B.prototype.updateHash=function(){this.currentHash=this.dataWindow[this.stringStart]<<this.hashShift^this.dataWindow[this.stringStart+1]},B.prototype.huffmanTallyLit=function(t){return this.arrDistances[this.bufferPosition]=0,this.arrLiterals[this.bufferPosition++]=t,this.treeLiteral.codeFrequencies[t]++,16384<=this.bufferPosition},B.prototype.huffmanTallyDist=function(t,e){this.arrDistances[this.bufferPosition]=t,this.arrLiterals[this.bufferPosition++]=e-3;e=this.huffmanLengthCode(e-3),this.treeLiteral.codeFrequencies[e]++,265<=e&&e<285&&(this.extraBits+=Math.floor((e-261)/4)),e=this.huffmanDistanceCode(t-1);return this.treeDistances.codeFrequencies[e]++,4<=e&&(this.extraBits+=Math.floor(e/2-1)),16384<=this.bufferPosition},B.prototype.huffmanFlushBlock=function(t,e,i,r){this.treeLiteral.codeFrequencies[256]++,this.treeLiteral.buildTree(),this.treeDistances.buildTree(),this.treeLiteral.calculateBLFreq(this.treeCodeLengths),this.treeDistances.calculateBLFreq(this.treeCodeLengths),this.treeCodeLengths.buildTree();for(var n=4,s=18;n<s;s--)0<this.treeCodeLengths.codeLengths[y.huffCodeLengthOrders[s]]&&(n=s+1);for(var o=14+3*n+this.treeCodeLengths.getEncodedLength()+this.treeLiteral.getEncodedLength()+this.treeDistances.getEncodedLength()+this.extraBits,h=this.extraBits,s=0;s<286;s++)h+=this.treeLiteral.codeFrequencies[s]*d[s];for(s=0;s<30;s++)h+=this.treeDistances.codeFrequencies[s]*m[s];h<=o&&(o=h),0<=e&&i+4<o>>3?this.huffmanFlushStoredBlock(t,e,i,r):(o==h?(this.pendingBufferWriteBits(2+(r?1:0),3),this.treeLiteral.setStaticCodes(c,d),this.treeDistances.setStaticCodes(l,m)):(this.pendingBufferWriteBits(4+(r?1:0),3),this.huffmanSendAllTrees(n)),this.huffmanCompressBlock(),this.huffmanReset())},B.prototype.huffmanFlushStoredBlock=function(t,e,i,r){this.pendingBufferWriteBits(0+(r?1:0),3),this.pendingBufferAlignToByte(),this.pendingBufferWriteShort(i),this.pendingBufferWriteShort(~i),this.pendingBufferWriteByteBlock(t,e,i),this.huffmanReset()},B.prototype.huffmanLengthCode=function(t){if(255===t)return 285;for(var e=257;8<=t;)e+=4,t>>=1;return e+t},B.prototype.huffmanDistanceCode=function(t){for(var e=0;4<=t;)e+=2,t>>=1;return e+t},B.prototype.huffmanSendAllTrees=function(t){this.treeCodeLengths.buildCodes(),this.treeLiteral.buildCodes(),this.treeDistances.buildCodes(),this.pendingBufferWriteBits(this.treeLiteral.treeLength-257,5),this.pendingBufferWriteBits(this.treeDistances.treeLength-1,5),this.pendingBufferWriteBits(t-4,4);for(var e=0;e<t;e++)this.pendingBufferWriteBits(this.treeCodeLengths.codeLengths[y.huffCodeLengthOrders[e]],3);this.treeLiteral.writeTree(this.treeCodeLengths),this.treeDistances.writeTree(this.treeCodeLengths)},B.prototype.huffmanReset=function(){this.bufferPosition=0,this.extraBits=0,this.treeLiteral.reset(),this.treeDistances.reset(),this.treeCodeLengths.reset()},B.prototype.huffmanCompressBlock=function(){for(var t=0;t<this.bufferPosition;t++){var e,i,r=255&this.arrLiterals[t],n=this.arrDistances[t];0!=n--?(e=this.huffmanLengthCode(r),this.treeLiteral.writeCodeToStream(e),0<(e=Math.floor((e-261)/4))&&e<=5&&this.pendingBufferWriteBits(r&(1<<e)-1,e),i=this.huffmanDistanceCode(n),this.treeDistances.writeCodeToStream(i),0<(e=Math.floor(i/2-1))&&this.pendingBufferWriteBits(n&(1<<e)-1,e)):this.treeLiteral.writeCodeToStream(r)}this.treeLiteral.writeCodeToStream(256)},B.prototype.pendingBufferWriteBits=function(t,e){var i=new Uint32Array(1);i[0]=this.pendingBufCache|t<<this.pendingBufBitsInCache,this.pendingBufCache=i[0],this.pendingBufBitsInCache+=e,this.pendingBufferFlushBits()},B.prototype.pendingBufferFlush=function(t){var e;this.pendingBufferFlushBits(),0<this.pendingBufLength&&((e=new Uint8Array(this.pendingBufLength)).set(this.pendingBuffer.subarray(0,this.pendingBufLength),0),this.stream.push(e)),this.pendingBufLength=0},B.prototype.pendingBufferFlushBits=function(){for(var t=0;8<=this.pendingBufBitsInCache&&this.pendingBufLength<65536;)this.pendingBuffer[this.pendingBufLength++]=this.pendingBufCache,this.pendingBufCache>>=8,this.pendingBufBitsInCache-=8,t++;return t},B.prototype.pendingBufferWriteByteBlock=function(t,e,i){t=t.subarray(e,e+i);this.pendingBuffer.set(t,this.pendingBufLength),this.pendingBufLength+=i},B.prototype.pendingBufferWriteShort=function(t){this.pendingBuffer[this.pendingBufLength++]=t,this.pendingBuffer[this.pendingBufLength++]=t>>8},B.prototype.pendingBufferAlignToByte=function(){0<this.pendingBufBitsInCache&&(this.pendingBuffer[this.pendingBufLength++]=this.pendingBufCache),this.pendingBufCache=0,this.pendingBufBitsInCache=0},B.initHuffmanTree=function(){for(var t=0;t<144;)c[t]=y.bitReverse(48+t<<8),d[t++]=8;for(;t<256;)c[t]=y.bitReverse(256+t<<7),d[t++]=9;for(;t<280;)c[t]=y.bitReverse(-256+t<<9),d[t++]=7;for(;t<286;)c[t]=y.bitReverse(-88+t<<8),d[t++]=8;for(t=0;t<30;t++)l[t]=y.bitReverse(t<<11),m[t]=5},B.prototype.close=function(){for(;this.pendingBufferFlush(!0),this.compressData(!0)||(this.pendingBufferFlush(!0),this.pendingBufferAlignToByte(),this.noWrap||(this.pendingBufferWriteShortBytes(this.checkSum>>16),this.pendingBufferWriteShortBytes(65535&this.checkSum)),this.pendingBufferFlush(!0)),this.inputEnd!==this.inputOffset||0!==this.pendingBufLength;);},B.prototype.destroy=function(){this.stream=[],this.stream=void 0,this.pendingBuffer=void 0,this.treeLiteral=void 0,this.treeDistances=void 0,this.treeCodeLengths=void 0,this.arrLiterals=void 0,this.arrDistances=void 0,this.hashHead=void 0,this.hashPrevious=void 0,this.dataWindow=void 0,this.inputBuffer=void 0,this.pendingBufLength=void 0,this.pendingBufCache=void 0,this.pendingBufBitsInCache=void 0,this.bufferPosition=void 0,this.extraBits=void 0,this.currentHash=void 0,this.matchStart=void 0,this.matchLength=void 0,this.matchPrevAvail=void 0,this.blockStart=void 0,this.stringStart=void 0,this.lookAhead=void 0,this.totalBytesIn=void 0,this.inputOffset=void 0,this.inputEnd=void 0,this.windowSize=void 0,this.windowMask=void 0,this.hashSize=void 0,this.hashMask=void 0,this.hashShift=void 0,this.maxDist=void 0,this.checkSum=void 0,this.noWrap=void 0},B.isHuffmanTreeInitiated=!1,B);function B(t){this.pendingBuffer=new Uint8Array(65536),this.pendingBufLength=0,this.pendingBufCache=0,this.pendingBufBitsInCache=0,this.bufferPosition=0,this.extraBits=0,this.currentHash=0,this.matchStart=0,this.matchLength=0,this.matchPrevAvail=!1,this.blockStart=0,this.stringStart=0,this.lookAhead=0,this.totalBytesIn=0,this.inputOffset=0,this.inputEnd=0,this.windowSize=32768,this.windowMask=this.windowSize-1,this.hashSize=32768,this.hashMask=this.hashSize-1,this.hashShift=Math.floor(17/3),this.maxDist=this.windowSize-262,this.checkSum=1,this.noWrap=!1,B.isHuffmanTreeInitiated||(B.initHuffmanTree(),B.isHuffmanTreeInitiated=!0),this.treeLiteral=new y(this,286,257,15),this.treeDistances=new y(this,30,1,15),this.treeCodeLengths=new y(this,19,4,7),this.arrDistances=new Uint16Array(16384),this.arrLiterals=new Uint8Array(16384),this.stream=[],this.dataWindow=new Uint8Array(2*this.windowSize),this.hashHead=new Int16Array(this.hashSize),this.hashPrevious=new Int16Array(this.windowSize),this.blockStart=this.stringStart=1,(this.noWrap=t)||this.writeZLibHeader()}Object.defineProperty(w.prototype,"treeLength",{get:function(){return this.codeCount},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"codeLengths",{get:function(){return this.codeLength},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"codeFrequencies",{get:function(){return this.codeFrequency},enumerable:!0,configurable:!0}),w.prototype.setStaticCodes=function(t,e){var i=new Int16Array(t.length),t=(i.set(t,0),this.codes=i,new Uint8Array(e.length));t.set(e,0),this.codeLength=t},w.prototype.reset=function(){for(var t=0;t<this.codeFrequency.length;t++)this.codeFrequency[t]=0;this.codes=void 0,this.codeLength=void 0},w.prototype.writeCodeToStream=function(t){this.writer.pendingBufferWriteBits(65535&this.codes[t],this.codeLength[t])},w.prototype.buildCodes=function(){for(var t=new Int32Array(this.maxLength),e=(this.codes=new Int16Array(this.codeCount),0),i=0;i<this.maxLength;i++)t[i]=e,e+=this.lengthCount[i]<<15-i;for(var r=0;r<this.codeCount;r++){var n=this.codeLength[r];0<n&&(this.codes[r]=w.bitReverse(t[n-1]),t[n-1]+=1<<16-n)}},w.bitReverse=function(t){return w.reverseBits[15&t]<<12|w.reverseBits[t>>4&15]<<8|w.reverseBits[t>>8&15]<<4|w.reverseBits[t>>12]},w.prototype.getEncodedLength=function(){for(var t=0,e=0;e<this.codeFrequency.length;e++)t+=this.codeFrequency[e]*this.codeLength[e];return t},w.prototype.calculateBLFreq=function(t){for(var e,i,r=-1,n=0;n<this.codeCount;){var s=1,o=this.codeLength[n];for(0===o?(e=138,i=3):(e=6,i=3,r!==o&&(t.codeFrequency[o]++,s=0)),r=o,n++;n<this.codeCount&&r===this.codeLength[n]&&(n++,!(++s>=e)););s<i?t.codeFrequency[r]+=s:0!==r?t.codeFrequency[16]++:s<=10?t.codeFrequency[17]++:t.codeFrequency[18]++}},w.prototype.writeTree=function(t){for(var e,i,r=-1,n=0;n<this.codeCount;){var s=1,o=this.codeLength[n];for(0===o?(e=138,i=3):(e=6,i=3,r!==o&&(t.writeCodeToStream(o),s=0)),r=o,n++;n<this.codeCount&&r===this.codeLength[n]&&(n++,!(++s>=e)););if(s<i)for(;0<s--;)t.writeCodeToStream(r);else 0!==r?(t.writeCodeToStream(16),this.writer.pendingBufferWriteBits(s-3,2)):s<=10?(t.writeCodeToStream(17),this.writer.pendingBufferWriteBits(s-3,3)):(t.writeCodeToStream(18),this.writer.pendingBufferWriteBits(s-11,7))}},w.prototype.buildTree=function(){for(var t=this.codeFrequency.length,e=new Int32Array(t),i=0,r=0,n=0;n<t;n++){var s=this.codeFrequency[n];if(0!==s){for(var o=i++,h=0;0<o&&this.codeFrequency[e[h=Math.floor((o-1)/2)]]>s;)e[o]=e[h],o=h;r=e[o]=n}}for(;i<2;)e[i++]=r<2?++r:0;this.codeCount=Math.max(r+1,this.codeMinCount);for(var a=i,f=new Int32Array(4*i-2),u=new Int32Array(2*i-1),c=0;c<i;c++){var d=e[c],p=2*c;f[p]=d,f[1+p]=-1,u[c]=this.codeFrequency[d]<<8,e[c]=c}this.constructHuffmanTree(e,i,u,a,f),this.buildLength(f)},w.prototype.constructHuffmanTree=function(t,e,i,r,n){do{for(var s=t[0],o=t[--e],h=i[o],a=0,f=1;f<e;)f+1<e&&i[t[f]]>i[t[f+1]]&&f++,t[a]=t[f],f=2*(a=f)+1;for(;0<(f=a)&&i[t[a=Math.floor((f-1)/2)]]>h;)t[f]=t[a];t[f]=o;var u=t[0],c=(n[2*(o=r++)]=s,n[2*o+1]=u,Math.min(255&i[s],255&i[u]));for(i[o]=h=i[s]+i[u]-c+1,a=0,f=1;f<e;)f+1<e&&i[t[f]]>i[t[f+1]]&&f++,t[a]=t[f],f=2*(a=f)+1;for(;0<(f=a)&&i[t[a=Math.floor((f-1)/2)]]>h;)t[f]=t[a]}while(t[f]=o,1<e)},w.prototype.buildLength=function(t){this.codeLength=new Uint8Array(this.codeFrequency.length);for(var e=Math.floor(t.length/2),i=Math.floor((e+1)/2),r=0,n=0;n<this.maxLength;n++)this.lengthCount[n]=0;if(0!==(r=this.calculateOptimalCodeLength(t,r,e))){var s=this.maxLength-1;do{for(;0===this.lengthCount[--s];);for(;this.lengthCount[s]--,this.lengthCount[++s]++,0<(r-=1<<this.maxLength-1-s)&&s<this.maxLength-1;);}while(0<r);this.recreateTree(t,r,i)}},w.prototype.recreateTree=function(t,e,i){this.lengthCount[this.maxLength-1]+=e,this.lengthCount[this.maxLength-2]-=e;for(var r=2*i,n=this.maxLength;0!==n;n--)for(var s=this.lengthCount[n-1];0<s;){var o=2*t[r++];-1===t[1+o]&&(this.codeLength[t[o]]=n,s--)}},w.prototype.calculateOptimalCodeLength=function(t,e,i){var r=new Int32Array(i);r[i-1]=0;for(var n=i-1;0<=n;n--){var s,o=2*n+1;-1!==t[o]?((s=r[n]+1)>this.maxLength&&(s=this.maxLength,e++),r[t[o-1]]=r[t[o]]=s):(s=r[n],this.lengthCount[s-1]++,this.codeLength[t[o-1]]=r[n])}return e},w.reverseBits=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],w.huffCodeLengthOrders=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var y=w;function w(t,e,i,r){this.writer=t,this.codeMinCount=i,this.maxLength=r,this.codeFrequency=new Uint16Array(e),this.lengthCount=new Int32Array(r)}E.checksumUpdate=function(t,e,i,r){for(var n=new Uint32Array(1),t=(n[0]=t,n[0]),s=n[0]=65535&t,o=n[0]=t>>E.checkSumBitOffset;0<r;){var h=Math.min(r,E.checksumIterationCount);for(r-=h;0<=--h;)o+=s+=n[0]=255&e[i++];s%=E.checksumBase,o%=E.checksumBase}return o<<E.checkSumBitOffset|s},E.checkSumBitOffset=16,E.checksumBase=65521,E.checksumIterationCount=3800;var v=E;function E(){}S.init=function(){for(var t=new Uint8Array(288),e=0;e<144;)t[e++]=8;for(;e<256;)t[e++]=9;for(;e<280;)t[e++]=7;for(;e<288;)t[e++]=8;for(S.m_LengthTree=new S(t),t=new Uint8Array(32),e=0;e<32;)t[e++]=5;S.m_DistanceTree=new S(t)},S.prototype.prepareData=function(t,e,i){for(var r=0,n=512,s=0;s<i.length;s++){var o=i[s];0<o&&t[o]++}for(var h=1;h<=S.MAX_BITLEN;h++)e[h]=r,r+=t[h]<<16-h,10<=h&&(n+=(130944&r)-(130944&e[h])>>16-h);return{code:r,treeSize:n}},S.prototype.treeFromData=function(t,e,i,r,n){for(var s=new Int16Array(n),o=512,h=S.MAX_BITLEN;10<=h;h--)for(var a=130944&r,f=130944&(r-=t[h]<<16-h);f<a;f+=128)s[p.bitReverse(f)]=p.bitConverterInt32ToInt16(-o<<4|h),o+=1<<h-9;for(f=0;f<i.length;f++){h=i[f];if(0!=h){r=e[h];var u=p.bitReverse(r);if(h<=9)for(;s[u]=p.bitConverterInt32ToInt16(f<<4|h),(u+=1<<h)<512;);else for(var c=1<<(15&(d=s[511&u])),d=-(d>>4);s[d|u>>9]=p.bitConverterInt32ToInt16(f<<4|h),(u+=1<<h)<c;);e[h]=r+(1<<16-h)}}return s},S.prototype.buildTree=function(t){var e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=this.prepareData(e,i,t);this.m_Tree=this.treeFromData(e,i,t,r.code,r.treeSize)},S.prototype.unpackSymbol=function(t){var e,i,r,n;return 0<=(i=t.peekBits(9))?0<=(r=this.m_Tree[i])?(t.skipBits(15&r),r>>4):(e=-(r>>4),0<=(i=t.peekBits(15&r))?(r=this.m_Tree[e|i>>9],t.skipBits(15&r),r>>4):(n=t.availableBits,i=t.peekBits(n),(15&(r=this.m_Tree[e|i>>9]))<=n?(t.skipBits(15&r),r>>4):-1)):(n=t.availableBits,i=t.peekBits(n),0<=(r=this.m_Tree[i])&&(15&r)<=n?(t.skipBits(15&r),r>>4):-1)},Object.defineProperty(S,"lengthTree",{get:function(){return this.m_LengthTree},enumerable:!0,configurable:!0}),Object.defineProperty(S,"distanceTree",{get:function(){return this.m_DistanceTree},enumerable:!0,configurable:!0}),S.MAX_BITLEN=15;var D=S;function S(t){this.buildTree(t)}b.ChecksumUpdate=function(t,e,i,r){for(var n=65535&t,s=t>>this.DEF_CHECKSUM_BIT_OFFSET;0<r;){var o=Math.min(r,this.DEF_CHECKSUM_ITERATIONSCOUNT);for(r-=o;0<=--o;)s+=n+=255&e[i++];n%=this.DEF_CHECKSUM_BASE,s%=this.DEF_CHECKSUM_BASE}this.DEF_CHECKSUM_BIT_OFFSET},b.ChecksumGenerate=function(t,e,i){return b.ChecksumUpdate(1,t,e,i),1},b.DEF_CHECKSUM_BIT_OFFSET=16,b.DEF_CHECKSUM_BASE=65521,b.DEF_CHECKSUM_ITERATIONSCOUNT=3800;var C=b;function b(){}Object.defineProperty(M.prototype,"mBuffer",{get:function(){return this.tBuffer},set:function(t){this.tBuffer=t},enumerable:!0,configurable:!0}),M.prototype.peekBits=function(t){if(t<0)throw new DOMException("count","Bits count can not be less than zero.");if(32<t)throw new DOMException("count","Count of bits is too large.");return this.mBufferedBits<t&&this.fillBuffer(),this.mBufferedBits<t?-1:p.bitConverterUintToInt32(this.mBuffer&~(4294967295<<t))},M.prototype.fillBuffer=function(){var t=4-(this.mBufferedBits>>3)-(0!=(7&this.mBufferedBits)?1:0);if(0!=t)for(var e=this.mInputStream.read(this.mTempBuffer,0,t),i=0;i<e;i++)this.mBuffer=p.bitConverterInt32ToUint(this.mBuffer|p.bitConverterInt32ToUint(this.mTempBuffer[i]<<this.mBufferedBits)),this.mBufferedBits+=8},M.prototype.skipBits=function(t){if(t<0)throw new DOMException("count","Bits count can not be less than zero.");0!==t&&(t>=this.mBufferedBits?(t-=this.mBufferedBits,this.mBufferedBits=0,(this.mBuffer=0)<t&&(this.mInputStream.position+=t>>3,0<(t&=7))&&(this.fillBuffer(),this.mBufferedBits-=t,this.mBuffer=p.bitConverterInt32ToUint(this.mBuffer>>>t))):(this.mBufferedBits-=t,this.mBuffer=p.bitConverterInt32ToUint(this.mBuffer>>>t)))},Object.defineProperty(M.prototype,"availableBits",{get:function(){return this.mBufferedBits},enumerable:!0,configurable:!0}),M.prototype.readZLibHeader=function(){var t=this.readInt16();if(-1===t)throw new DOMException("Header of the stream can not be read.");if(t%31!=0)throw new DOMException("Header checksum illegal");if(2048!=(t&this.DEF_HEADER_METHOD_MASK))throw new DOMException("Unsupported compression method.");if(this.mWindowSize=Math.pow(2,8+((t&this.DEF_HEADER_INFO_MASK)>>12)),65535<this.mWindowSize)throw new DOMException("Unsupported window size for deflate compression method.");if((t&this.DEF_HEADER_FLAGS_FDICT)>>5==1)throw new DOMException("Custom dictionary is not supported at the moment.")},M.prototype.readInt16=function(){var t=this.readBits(8)<<8;return t|=this.readBits(8)},M.prototype.readBits=function(t){var e=this.peekBits(t);return-1===e?-1:(this.mBufferedBits-=t,this.mBuffer=p.bitConverterInt32ToUint(this.mBuffer>>>t),e)},M.prototype.decodeBlockHeader=function(){if(!this.mbCanReadNextBlock)return!1;var t=this.readBits(1);if(-1===t)return!1;var e=this.readBits(2);if(-1===e)return!1;switch(this.mbCanReadNextBlock=0===t,e){case 0:this.mbReadingUncompressed=!0,this.skipToBoundary();var i=this.readInt16Inverted();if(i!==(65535^this.readInt16Inverted()))throw new DOMException("Wrong block length.");if(65535<i)throw new DOMException("Uncompressed block length can not be more than 65535.");this.mUncompressedDataLength=i,this.mCurrentLengthTree=null,this.mCurrentDistanceTree=null;break;case 1:this.mbReadingUncompressed=!1,this.mUncompressedDataLength=-1,this.mCurrentLengthTree=D.lengthTree,this.mCurrentDistanceTree=D.distanceTree;break;case 2:this.mbReadingUncompressed=!1,this.mUncompressedDataLength=-1;i=this.decodeDynamicHeader(this.mCurrentLengthTree,this.mCurrentDistanceTree);this.mCurrentLengthTree=i.lengthTree,this.mCurrentDistanceTree=i.distanceTree;break;default:throw new DOMException("Wrong block type.")}return!0},M.prototype.skipToBoundary=function(){this.mBuffer=p.bitConverterInt32ToUint(this.mBuffer>>>(7&this.mBufferedBits)),this.mBufferedBits&=-8},M.prototype.readInt16Inverted=function(){var t=this.readBits(8);return t|=this.readBits(8)<<8},M.prototype.decodeDynamicHeader=function(t,e){var i=0,r=this.readBits(5),n=this.readBits(5),s=this.readBits(4);if(r<0||n<0||s<0)throw new DOMException("Wrong dynamic huffman codes.");for(var o=(r+=257)+(n+=1),h=new Uint8Array(o),a=new Uint8Array(19),f=(s+=4,0);f<s;){var u=this.readBits(3);if(u<0)throw new DOMException("Wrong dynamic huffman codes.");a[this.defaultHuffmanDynamicTree[f++]]=u}for(var c=new D(a),f=0;;){for(var d=void 0,p=!1,d=c.unpackSymbol(this);0==(-16&d);){if(h[f++]=i=d,f===o){p=!0;break}d=c.unpackSymbol(this)}if(p)break;if(d<0)throw new DOMException("Wrong dynamic huffman codes.");if(17<=d)i=0;else if(0===f)throw new DOMException("Wrong dynamic huffman codes.");var l=d-16,m=M.DEF_HUFFMAN_DYNTREE_REPEAT_BITS[l],g=this.readBits(m);if(g<0)throw new DOMException("Wrong dynamic huffman codes.");if(o<f+(g+=M.DEF_HUFFMAN_DYNTREE_REPEAT_MINIMUMS[l]))throw new DOMException("Wrong dynamic huffman codes.");for(;0<g--;)h[f++]=i;if(f===o)break}var B=new Uint8Array(r);return B.set(h.subarray(0,r),0),t=new D(B),B=h.slice(r,r+n),{lengthTree:t,distanceTree:new D(B)}},M.prototype.readHuffman=function(){for(var t=this.DEF_MAX_WINDOW_SIZE-(this.mDataLength-this.mCurrentPosition),e=!1;t>=this.DEF_HUFFMAN_REPEATE_MAX;){for(var i=void 0,i=this.mCurrentLengthTree.unpackSymbol(this);0==(-256&i);){if((this.mDataLength+1)%this.DEF_MAX_WINDOW_SIZE,this.mBlockBuffer[this.mDataLength++%this.DEF_MAX_WINDOW_SIZE]=i,e=!0,--t<this.DEF_HUFFMAN_REPEATE_MAX)return!0;i=this.mCurrentLengthTree.unpackSymbol(this)}if(i<this.DEF_HUFFMAN_LENGTH_MINIMUMCODE){if(i<this.DEF_HUFFMAN_END_BLOCK)throw new DOMException("Illegal code.");var r=e?1:0;return this.mbCanReadMoreData=this.decodeBlockHeader(),!!(r|(this.mbCanReadMoreData?1:0))}if(i>this.DEF_HUFFMAN_LENGTH_MAXIMUMCODE)throw new DOMException("Illegal repeat code length.");var n=M.DEF_HUFFMAN_REPEAT_LENGTH_BASE[i-this.DEF_HUFFMAN_LENGTH_MINIMUMCODE],r=M.DEF_HUFFMAN_REPEAT_LENGTH_EXTENSION[i-this.DEF_HUFFMAN_LENGTH_MINIMUMCODE];if(0<r){if((s=this.readBits(r))<0)throw new DOMException("Wrong data.");n+=s}if((i=this.mCurrentDistanceTree.unpackSymbol(this))<0||i>M.DEF_HUFFMAN_REPEAT_DISTANCE_BASE.length)throw new DOMException("Wrong distance code.");var s,o=M.DEF_HUFFMAN_REPEAT_DISTANCE_BASE[i];if(0<(r=M.DEF_HUFFMAN_REPEAT_DISTANCE_EXTENSION[i])){if((s=this.readBits(r))<0)throw new DOMException("Wrong data.");o+=s}for(var h=0;h<n;h++)this.mBlockBuffer[this.mDataLength%this.DEF_MAX_WINDOW_SIZE]=this.mBlockBuffer[(this.mDataLength-o)%this.DEF_MAX_WINDOW_SIZE],this.mDataLength++,t--;e=!0}return e},M.prototype.read=function(t,e,i){if(null==t)throw new DOMException("buffer");if(e<0||e>t.length-1)throw new DOMException("offset","Offset does not belong to specified buffer.");if(i<0||i>t.length-e)throw new DOMException("length","Length is illegal.");for(var r=i;0<i;)if(this.mCurrentPosition<this.mDataLength){var n=this.mCurrentPosition%this.DEF_MAX_WINDOW_SIZE,s=Math.min(this.DEF_MAX_WINDOW_SIZE-n,this.mDataLength-this.mCurrentPosition),s=Math.min(s,i);p.arrayCopy(this.mBlockBuffer,n,t,e,s),this.mCurrentPosition+=s,e+=s,i-=s}else{if(!this.mbCanReadMoreData)break;s=this.mDataLength;if(this.mbReadingUncompressed)if(0===this.mUncompressedDataLength){if(this.mbCanReadMoreData=this.decodeBlockHeader(),!this.mbCanReadMoreData)break}else{var n=this.mDataLength%this.DEF_MAX_WINDOW_SIZE,o=Math.min(this.mUncompressedDataLength,this.DEF_MAX_WINDOW_SIZE-n),h=this.readPackedBytes(this.mBlockBuffer,n,o);if(o!==h)throw new DOMException("Not enough data in stream.");this.mUncompressedDataLength-=h,this.mDataLength+=h}else if(!this.readHuffman())break;s<this.mDataLength&&((o=s%this.DEF_MAX_WINDOW_SIZE)<(h=this.mDataLength%this.DEF_MAX_WINDOW_SIZE)?this.checksumUpdate(this.mBlockBuffer,o,h-o):(this.checksumUpdate(this.mBlockBuffer,o,this.DEF_MAX_WINDOW_SIZE-o),0<h&&this.checksumUpdate(this.mBlockBuffer,0,h)))}if(!this.mbCanReadMoreData&&!this.mbCheckSumRead&&!this.mbNoWrap){if(this.skipToBoundary(),this.readInt32()!==this.mCheckSum)throw new DOMException("Checksum check failed.");this.mbCheckSumRead=!0}return r-i},M.prototype.readPackedBytes=function(t,e,i){if(null==t)throw new DOMException("buffer");if(e<0||e>t.length-1)throw new DOMException('offset", "Offset can not be less than zero or greater than buffer length - 1.');if(i<0)throw new DOMException('length", "Length can not be less than zero.');if(i>t.length-e)throw new DOMException('length", "Length is too large.');if(0!=(7&this.mBufferedBits))throw new DOMException("Reading of unalligned data is not supported.");if(0===i)return 0;for(var r=0;0<this.mBufferedBits&&0<i;)t[e++]=this.mBuffer,this.mBufferedBits-=8,this.mBuffer=p.bitConverterInt32ToUint(this.mBuffer>>>8),i--,r++;return 0<i&&(r+=this.mInputStream.read(t,e,i)),r},M.prototype.readInt32=function(){var t=this.readBits(8)<<24;return(t|=this.readBits(8)<<16)|this.readBits(8)<<8|this.readBits(8)},M.prototype.checksumUpdate=function(t,e,i){C.ChecksumUpdate(this.mCheckSum,t,e,i)},M.DEF_REVERSE_BITS=new Uint8Array([0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15]),M.DEF_HUFFMAN_DYNTREE_REPEAT_MINIMUMS=[3,3,11],M.DEF_HUFFMAN_DYNTREE_REPEAT_BITS=[2,3,7],M.DEF_HUFFMAN_REPEAT_LENGTH_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],M.DEF_HUFFMAN_REPEAT_LENGTH_EXTENSION=[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],M.DEF_HUFFMAN_REPEAT_DISTANCE_BASE=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],M.DEF_HUFFMAN_REPEAT_DISTANCE_EXTENSION=[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];var A=M;function M(t,e){if(this.defaultHuffmanDynamicTree=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],this.DEF_HEADER_METHOD_MASK=3840,this.DEF_HEADER_INFO_MASK=61440,this.DEF_HEADER_FLAGS_FCHECK=31,this.DEF_HEADER_FLAGS_FDICT=32,this.DEF_HEADER_FLAGS_FLEVEL=192,this.DEF_MAX_WINDOW_SIZE=65535,this.DEF_HUFFMAN_REPEATE_MAX=258,this.DEF_HUFFMAN_END_BLOCK=256,this.DEF_HUFFMAN_LENGTH_MINIMUMCODE=257,this.DEF_HUFFMAN_LENGTH_MAXIMUMCODE=285,this.DEF_HUFFMAN_DISTANCE_MAXIMUMCODE=29,this.mCheckSum=1,this.tBuffer=0,this.mBufferedBits=0,this.mTempBuffer=new Uint8Array(4),this.mBlockBuffer=new Uint8Array(this.DEF_MAX_WINDOW_SIZE),this.mbNoWrap=!1,this.mWindowSize=0,this.mCurrentPosition=0,this.mDataLength=0,this.mbCanReadNextBlock=!0,this.mbCanReadMoreData=!0,this.mbCheckSumRead=!1,null==t)throw new DOMException("stream");if(0===t.length)throw new DOMException("stream - string can not be empty");D.init(),this.mInputStream=new _(t),this.mbNoWrap=e,this.mbNoWrap||this.readZLibHeader(),this.decodeBlockHeader()}Object.defineProperty(L.prototype,"length",{get:function(){return this.inputStream.buffer.byteLength},enumerable:!0,configurable:!0}),L.prototype.read=function(t,e,i){e=new Uint8Array(this.inputStream.buffer,this.position+e).subarray(0,i);return t.set(e,0),this.position+=e.byteLength,e.byteLength},L.prototype.readByte=function(){return this.inputStream[this.position++]},L.prototype.write=function(t,e,i){p.arrayCopy(t,0,this.inputStream,this.position+e,i),this.position+=i},L.prototype.toByteArray=function(){return new Uint8Array(this.inputStream.buffer)};var _=L;function L(t){this.position=0,this.inputStream=new Uint8Array(t.buffer)}t.ChecksumCalculator=v,t.CompressedStreamReader=A,t.CompressedStreamWriter=g,t.CompressorHuffmanTree=y,t.DecompressorHuffmanTree=D,t.Stream=_,t.Utils=p,t.ZipArchive=o,t.ZipArchiveItem=u,t.ZipArchiveItemHelper=i,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=ej2-compression.umd.min.js.map
/*!
* filename: ej2-compression.min.js
* version : 25.2.3
* version : 26.1.35
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.

@@ -10,3 +10,3 @@ * Use of this code is subject to the terms of our license.

*/
this.ej=this.ej||{},this.ej.compression=function(t,e){"use strict";var i=function(){function t(){}return t.bitReverse=function(e){return t.reverseBits[15&e]<<12|t.reverseBits[e>>4&15]<<8|t.reverseBits[e>>8&15]<<4|t.reverseBits[e>>12]},t.bitConverterToInt32=function(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24},t.bitConverterToInt16=function(t,e){return t[e]|t[e+1]<<8},t.bitConverterToUInt32=function(t){var e=new Uint32Array(1);return e[0]=t,e[0]},t.bitConverterToUInt16=function(t,e){var i=new Uint16Array(1);return i[0]=t[e]|t[e+1]<<8,i[0]},t.bitConverterUintToInt32=function(t){var e=new Int32Array(1);return e[0]=t,e[0]},t.bitConverterInt32ToUint=function(t){var e=new Uint32Array(1);return e[0]=t,e[0]},t.bitConverterInt32ToInt16=function(t){var e=new Int16Array(1);return e[0]=t,e[0]},t.byteToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},t.byteIntToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},t.arrayCopy=function(t,e,i,r,n){var s=new Uint8Array(t.buffer,e).subarray(0,n);i.set(s,r)},t.mergeArray=function(t,e){var i=new Uint8Array(t.length+e.length);return i.set(t),i.set(e,t.length),i},t.encodedString=function(t){var e,i,r,n,s,o,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,f=0,u=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(t.charAt(t.length-1)===h.charAt(64)&&u--,t.charAt(t.length-2)===h.charAt(64)&&u--,u%1!=0)throw new Error("Invalid base64 input, bad content length.");for(var c=new Uint8Array(0|u);a<t.length;)e=h.indexOf(t.charAt(a++))<<2|(n=h.indexOf(t.charAt(a++)))>>4,i=(15&n)<<4|(s=h.indexOf(t.charAt(a++)))>>2,r=(3&s)<<6|(o=h.indexOf(t.charAt(a++))),c[f++]=e,64!==s&&(c[f++]=i),64!==o&&(c[f++]=r);return c},t.reverseBits=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],t.huffCodeLengthOrders=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],t}(),r=[],n=function(){function t(){0===r.length&&t.initCrc32Table(),this.files=[],this.level="Normal",e.Save.isMicrosoftBrowser=!!navigator.msSaveBlob}return Object.defineProperty(t.prototype,"items",{get:function(){return this.files},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"compressionLevel",{get:function(){return this.level},set:function(t){this.level=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return void 0===this.files?0:this.files.length},enumerable:!0,configurable:!0}),t.prototype.addItem=function(t){if(null===t||void 0===t)throw new Error("ArgumentException: item cannot be null or undefined");for(var e=0;e<this.files.length;e++){var i=this.files[e];if(i instanceof o&&i.name===t.name)throw new Error("item with same name already exist")}this.files.push(t)},t.prototype.addDirectory=function(t){if(null===t||void 0===t)throw new Error("ArgumentException: string cannot be null or undefined");if(0===t.length)throw new Error("ArgumentException: string cannot be empty");if("/"!==t.slice(-1)&&(t+="/"),-1!==this.files.indexOf(t))throw new Error("item with same name already exist");this.files.push(t)},t.prototype.getItem=function(t){if(t>=0&&t<this.files.length)return this.files[t]},t.prototype.contains=function(t){return-1!==this.files.indexOf(t)},t.prototype.open=function(e){var r=i.encodedString(e);if(0==r.length)throw new DOMException("stream");var n=new B(r),s=t.findValueFromEnd(n,101010256,65557);if(s<0)throw new DOMException("Can't locate end of central directory record. Possible wrong file format or archive is corrupt.");n.position=s+12;var o=s-t.ReadInt32(n);n.position=o,this.readCentralDirectoryDataAndExtractItems(n)},t.prototype.readCentralDirectoryDataAndExtractItems=function(e){if(null==e)throw new DOMException("stream");for(var i;33639248==t.ReadInt32(e);)(i=new s).readCentralDirectoryData(e);i.readData(e,i.checkCrc),i.decompressData(),this.files.push(new o(i.unCompressedStream.buffer,i.name))},t.prototype.save=function(t){if(null===t||void 0===t||0===t.length)throw new Error("ArgumentException: fileName cannot be null or undefined");if(0===this.files.length)throw new Error("InvalidOperation");var e=this;return new Promise(function(i,r){e.saveInternal(t,!1).then(function(){i(e)})})},t.prototype.saveAsBlob=function(){var t=this;return new Promise(function(e,i){t.saveInternal("",!0).then(function(t){e(t)})})},t.prototype.saveInternal=function(t,e){var i=this,r=this;return new Promise(function(n,s){for(var o=[],h=0,a=0;a<r.files.length;a++)i.getCompressedData(i.files[a]).then(function(i){if(h=r.constructZippedObject(o,i,h,i.isDirectory),o.length===r.files.length){var s=r.writeZippedContent(t,o,h,e);n(s)}})})},t.prototype.destroy=function(){if(void 0!==this.files&&this.files.length>0){for(var t=0;t<this.files.length;t++){var e=this.files[t];e instanceof o&&e.destroy(),e=void 0}this.files=[]}this.files=void 0,this.level=void 0},t.prototype.getCompressedData=function(t){var e=this;return new Promise(function(i,n){if(t instanceof o){var s=new FileReader;s.onload=function(){var n=new Uint8Array(s.result),o={fileName:t.name,crc32Value:0,compressedData:[],compressedSize:void 0,uncompressedDataSize:n.length,compressionType:void 0,isDirectory:!1};if("Normal"===e.level){e.compressData(n,o,r);for(var h=0,a=0;a<o.compressedData.length;a++)h+=o.compressedData[a].length;o.compressedSize=h,o.compressionType="\b\0"}else o.compressedSize=n.length,o.crc32Value=e.calculateCrc32Value(0,n,r),o.compressionType="\0\0",o.compressedData.push(n);i(o)},s.readAsArrayBuffer(t.data)}else i({fileName:t,crc32Value:0,compressedData:"",compressedSize:0,uncompressedDataSize:0,compressionType:"\0\0",isDirectory:!0})})},t.prototype.compressData=function(t,e,i){var r=new c(!0),n=0,s=0;do{if(n>=t.length){r.close();break}s=Math.min(t.length,n+16384);var o=t.subarray(n,s);e.crc32Value=this.calculateCrc32Value(e.crc32Value,o,i),r.write(o,0,s-n),n=s}while(n<=t.length);e.compressedData=r.compressedData,r.destroy()},t.prototype.constructZippedObject=function(t,e,i,r){var n=0,s=new Date;r&&(n|=16),n|=0;var o=this.writeHeader(e,s),h="PK"+o+e.fileName,a=this.writeCentralDirectory(e,o,i,n);return t.push({localHeader:h,centralDir:a,compressedData:e}),i+h.length+e.compressedSize},t.prototype.writeHeader=function(t,e){var i="";return i+="\n\0\0\0",i+=t.compressionType,i+=this.getBytes(this.getModifiedTime(e),2),i+=this.getBytes(this.getModifiedDate(e),2),i+=this.getBytes(t.crc32Value,4),i+=this.getBytes(t.compressedSize,4),i+=this.getBytes(t.uncompressedDataSize,4),i+=this.getBytes(t.fileName.length,2),i+=this.getBytes(0,2)},t.prototype.writeZippedContent=function(t,i,r,n){for(var s=0,o=[],h=0;h<i.length;h++){var a=i[h];for(s+=a.centralDir.length,o.push(this.getArrayBuffer(a.localHeader));a.compressedData.compressedData.length;)o.push(a.compressedData.compressedData.shift().buffer)}for(h=0;h<i.length;h++)o.push(this.getArrayBuffer(i[h].centralDir));o.push(this.getArrayBuffer(this.writeFooter(i,s,r)));var f=new Blob(o,{type:"application/zip"});return n||e.Save.save(t,f),f},t.prototype.writeCentralDirectory=function(t,e,i,r){return"PK"+this.getBytes(20,2)+e+this.getBytes(0,2)+"\0\0\0\0"+this.getBytes(r,4)+this.getBytes(i,4)+t.fileName},t.prototype.writeFooter=function(t,e,i){return"PK\0\0\0\0"+this.getBytes(t.length,2)+this.getBytes(t.length,2)+this.getBytes(e,4)+this.getBytes(i,4)+this.getBytes(0,2)},t.prototype.getArrayBuffer=function(t){for(var e=new Uint8Array(t.length),i=0;i<t.length;++i)e[i]=255&t.charCodeAt(i);return e.buffer},t.prototype.getBytes=function(t,e){for(var i="",r=0;r<e;r++)i+=String.fromCharCode(255&t),t>>>=8;return i},t.prototype.getModifiedTime=function(t){var e=t.getHours();return e<<=6,e|=t.getMinutes(),e<<=5,e|=t.getSeconds()/2},t.prototype.getModifiedDate=function(t){var e=t.getFullYear()-1980;return e<<=4,e|=t.getMonth()+1,e<<=5,e|=t.getDate()},t.prototype.calculateCrc32Value=function(t,e,i){t^=-1;for(var r=0;r<e.length;r++)t=t>>>8^i[255&(t^e[r])];return-1^t},t.initCrc32Table=function(){for(var t,e=0;e<256;e++){t=e;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;r[e]=t}},t.findValueFromEnd=function(t,e,i){if(null==t)throw new DOMException("stream");var r=t.inputStream.buffer.byteLength;if(r<4)return-1;var n=new Uint8Array(4),s=Math.max(0,r-i),o=r-1-4;t.position=o,t.read(n,0,4);var h=n[0],a=h==e;if(!a)for(;o>s;)if(h<<=8,o--,t.position=o,(h+=t.readByte())==e){a=!0;break}return a?o:-1},t.ReadInt32=function(t){var e=new Uint8Array(4);if(4!=t.read(e,0,4))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return i.bitConverterToInt32(e,0)},t.ReadInt16=function(t){var e=new Uint8Array(2);if(2!=t.read(e,0,2))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return i.bitConverterToInt16(e,0)},t.ReadUInt16=function(t){var e=new Uint8Array(2);if(2!=t.read(e,0,2))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return i.bitConverterToInt16(e,0)},t}(),s=function(){function t(){this.headerSignature=67324752,this.checkCrc=!0,this.crc32=0}return t.prototype.readCentralDirectoryData=function(t){t.position+=4,this.options=n.ReadInt16(t),this.compressionMethod=n.ReadInt16(t),this.checkCrc=99!=this.compressionMethod;n.ReadInt32(t);this.crc32=i.bitConverterToUInt32(n.ReadInt32(t)),this.compressedSize=n.ReadInt32(t),this.originalSize=n.ReadInt32(t);var e=n.ReadInt16(t),r=n.ReadInt16(t),s=n.ReadInt16(t);t.position+=4,this.externalAttributes=n.ReadInt32(t),this.localHeaderOffset=n.ReadInt32(t);var o=new Uint8Array(e);t.read(o,0,e);var h=i.byteToString(o);h=h.replace("\\","/"),this.name=h,t.position+=r+s,0!=this.options&&(this.options=0)},t.prototype.readData=function(t,e){if(0==t.length)throw new DOMException("stream");t.position=this.localHeaderOffset,this.checkCrc=e,this.readLocalHeader(t),this.readCompressedData(t)},t.prototype.decompressData=function(){8==this.compressionMethod&&this.originalSize>0&&this.decompressDataOld()},t.prototype.decompressDataOld=function(){var t,e=new g(this.compressedStream,!0);this.originalSize>0&&(t=new B(new Uint8Array(this.originalSize)));for(var i,r=new Uint8Array(4096);(i=e.read(r,0,4096))>0;)t.write(r.subarray(0,i),0,i);this.unCompressedStream=t.toByteArray(),this.checkCrc},t.prototype.readLocalHeader=function(t){if(0==t.length)throw new DOMException("stream");if(n.ReadInt32(t)!=this.headerSignature)throw new DOMException("Can't find local header signature - wrong file format or file is corrupt.");t.position+=22;var e=n.ReadInt16(t),i=n.ReadUInt16(t);if(99==this.compressionMethod);else if(i>2){if(t.position+=e,23==n.ReadInt16(t))throw new DOMException("UnSupported");t.position+=i-2}else t.position+=e+i},t.prototype.readCompressedData=function(t){var e;if(this.compressedSize>0){var i=this.compressedSize;e=new B(new Uint8Array(i));for(var r=new Uint8Array(4096);i>0;){var n=Math.min(i,4096);if(t.read(r,0,n)!=n)throw new DOMException("End of file reached - wrong file format or file is corrupt.");e.write(r.subarray(0,n),0,n),i-=n}this.compressedStream=new Uint8Array(e.inputStream)}else this.compressedSize<0||this.compressedSize},t}(),o=function(){function t(t,e){if(null===t||void 0===t)throw new Error("ArgumentException: data cannot be null or undefined");if(null===e||void 0===e)throw new Error("ArgumentException: string cannot be null or undefined");if(0===e.length)throw new Error("string cannot be empty");this.data=t,this.name=e}return Object.defineProperty(t.prototype,"dataStream",{get:function(){return this.decompressedStream},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.fileName},set:function(t){this.fileName=t},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this.fileName=void 0,this.data=void 0},t}(),h=new Int16Array(286),a=new Uint8Array(286),f=new Int16Array(30),u=new Uint8Array(30),c=function(){function t(e){this.pendingBuffer=new Uint8Array(65536),this.pendingBufLength=0,this.pendingBufCache=0,this.pendingBufBitsInCache=0,this.bufferPosition=0,this.extraBits=0,this.currentHash=0,this.matchStart=0,this.matchLength=0,this.matchPrevAvail=!1,this.blockStart=0,this.stringStart=0,this.lookAhead=0,this.totalBytesIn=0,this.inputOffset=0,this.inputEnd=0,this.windowSize=32768,this.windowMask=this.windowSize-1,this.hashSize=32768,this.hashMask=this.hashSize-1,this.hashShift=Math.floor(17/3),this.maxDist=this.windowSize-262,this.checkSum=1,this.noWrap=!1,t.isHuffmanTreeInitiated||(t.initHuffmanTree(),t.isHuffmanTreeInitiated=!0),this.treeLiteral=new d(this,286,257,15),this.treeDistances=new d(this,30,1,15),this.treeCodeLengths=new d(this,19,4,7),this.arrDistances=new Uint16Array(16384),this.arrLiterals=new Uint8Array(16384),this.stream=[],this.dataWindow=new Uint8Array(2*this.windowSize),this.hashHead=new Int16Array(this.hashSize),this.hashPrevious=new Int16Array(this.windowSize),this.blockStart=this.stringStart=1,this.noWrap=e,e||this.writeZLibHeader()}return Object.defineProperty(t.prototype,"compressedData",{get:function(){return this.stream},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"getCompressedString",{get:function(){var t="";if(void 0!==this.stream)for(var e=0;e<this.stream.length;e++)t+=String.fromCharCode.apply(null,this.stream[e]);return t},enumerable:!0,configurable:!0}),t.prototype.write=function(t,i,r){if(void 0===t||null===t)throw new Error("ArgumentException: data cannot null or undefined");var n=i+r;if(0>i||i>n||n>t.length)throw new Error("ArgumentOutOfRangeException: Offset or length is incorrect");if("string"==typeof t){var s=new e.Encoding(!1);s.type="Utf8",n=i+(t=new Uint8Array(s.getBytes(t,0,t.length))).length}for(this.inputBuffer=t,this.inputOffset=i,this.inputEnd=n,this.noWrap||(this.checkSum=p.checksumUpdate(this.checkSum,this.inputBuffer,this.inputOffset,n));this.inputEnd!==this.inputOffset||0!==this.pendingBufLength;)this.pendingBufferFlush(),this.compressData(!1)},t.prototype.writeZLibHeader=function(){var t=30720;t|=64,t+=31-t%31,this.pendingBufferWriteShortBytes(t)},t.prototype.pendingBufferWriteShortBytes=function(t){this.pendingBuffer[this.pendingBufLength++]=t>>8,this.pendingBuffer[this.pendingBufLength++]=t},t.prototype.compressData=function(t){var e;do{this.fillWindow();var i=t&&this.inputEnd===this.inputOffset;e=this.compressSlow(i,t)}while(0===this.pendingBufLength&&e);return e},t.prototype.compressSlow=function(t,e){if(this.lookAhead<262&&!t)return!1;for(;this.lookAhead>=262||t;){if(0===this.lookAhead)return this.lookAheadCompleted(e);this.stringStart>=2*this.windowSize-262&&this.slideWindow();var i=this.matchStart,r=this.matchLength;if(this.lookAhead>=3&&this.discardMatch(),r>=3&&this.matchLength<=r?r=this.matchPreviousBest(i,r):this.matchPreviousAvailable(),this.bufferPosition>=16384)return this.huffmanIsFull(e)}return!0},t.prototype.discardMatch=function(){var t=this.insertString();0!==t&&this.stringStart-t<=this.maxDist&&this.findLongestMatch(t)&&this.matchLength<=5&&3===this.matchLength&&this.stringStart-this.matchStart>4096&&(this.matchLength=2)},t.prototype.matchPreviousAvailable=function(){this.matchPrevAvail&&this.huffmanTallyLit(255&this.dataWindow[this.stringStart-1]),this.matchPrevAvail=!0,this.stringStart++,this.lookAhead--},t.prototype.matchPreviousBest=function(t,e){this.huffmanTallyDist(this.stringStart-1-t,e),e-=2;do{this.stringStart++,--this.lookAhead>=3&&this.insertString()}while(--e>0);return this.stringStart++,this.lookAhead--,this.matchPrevAvail=!1,this.matchLength=2,e},t.prototype.lookAheadCompleted=function(t){return this.matchPrevAvail&&this.huffmanTallyLit(255&this.dataWindow[this.stringStart-1]),this.matchPrevAvail=!1,this.huffmanFlushBlock(this.dataWindow,this.blockStart,this.stringStart-this.blockStart,t),this.blockStart=this.stringStart,!1},t.prototype.huffmanIsFull=function(t){var e=this.stringStart-this.blockStart;this.matchPrevAvail&&e--;var i=t&&0===this.lookAhead&&!this.matchPrevAvail;return this.huffmanFlushBlock(this.dataWindow,this.blockStart,e,i),this.blockStart+=e,!i},t.prototype.fillWindow=function(){for(this.stringStart>=this.windowSize+this.maxDist&&this.slideWindow();this.lookAhead<262&&this.inputOffset<this.inputEnd;){var t=2*this.windowSize-this.lookAhead-this.stringStart;t>this.inputEnd-this.inputOffset&&(t=this.inputEnd-this.inputOffset),this.dataWindow.set(this.inputBuffer.subarray(this.inputOffset,this.inputOffset+t),this.stringStart+this.lookAhead),this.inputOffset+=t,this.totalBytesIn+=t,this.lookAhead+=t}this.lookAhead>=3&&this.updateHash()},t.prototype.slideWindow=function(){this.dataWindow.set(this.dataWindow.subarray(this.windowSize,this.windowSize+this.windowSize),0),this.matchStart-=this.windowSize,this.stringStart-=this.windowSize,this.blockStart-=this.windowSize;for(t=0;t<this.hashSize;++t){e=65535&this.hashHead[t];this.hashHead[t]=e>=this.windowSize?e-this.windowSize:0}for(var t=0;t<this.windowSize;t++){var e=65535&this.hashPrevious[t];this.hashPrevious[t]=e>=this.windowSize?e-this.windowSize:0}},t.prototype.insertString=function(){var t,e=(this.currentHash<<this.hashShift^this.dataWindow[this.stringStart+2])&this.hashMask;return this.hashPrevious[this.stringStart&this.windowMask]=t=this.hashHead[e],this.hashHead[e]=this.stringStart,this.currentHash=e,65535&t},t.prototype.findLongestMatch=function(t){var e,i=4096,r=258,n=this.stringStart,s=this.stringStart+this.matchLength,o=Math.max(this.matchLength,2),h=Math.max(this.stringStart-this.maxDist,0),a=this.stringStart+258-1,f=this.dataWindow[s-1],u=this.dataWindow[s],c=this.dataWindow;o>=32&&(i>>=2),r>this.lookAhead&&(r=this.lookAhead);do{if(c[t+o]===u&&c[t+o-1]===f&&c[t]===c[n]&&c[t+1]===c[n+1]){for(e=t+2,n+=2;c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&n<a;);if(n>s){if(this.matchStart=t,s=n,(o=n-this.stringStart)>=r)break;f=c[s-1],u=c[s]}n=this.stringStart}}while((t=65535&this.hashPrevious[t&this.windowMask])>h&&0!=--i);return this.matchLength=Math.min(o,this.lookAhead),this.matchLength>=3},t.prototype.updateHash=function(){this.currentHash=this.dataWindow[this.stringStart]<<this.hashShift^this.dataWindow[this.stringStart+1]},t.prototype.huffmanTallyLit=function(t){return this.arrDistances[this.bufferPosition]=0,this.arrLiterals[this.bufferPosition++]=t,this.treeLiteral.codeFrequencies[t]++,this.bufferPosition>=16384},t.prototype.huffmanTallyDist=function(t,e){this.arrDistances[this.bufferPosition]=t,this.arrLiterals[this.bufferPosition++]=e-3;var i=this.huffmanLengthCode(e-3);this.treeLiteral.codeFrequencies[i]++,i>=265&&i<285&&(this.extraBits+=Math.floor((i-261)/4));var r=this.huffmanDistanceCode(t-1);return this.treeDistances.codeFrequencies[r]++,r>=4&&(this.extraBits+=Math.floor(r/2-1)),this.bufferPosition>=16384},t.prototype.huffmanFlushBlock=function(t,e,i,r){this.treeLiteral.codeFrequencies[256]++,this.treeLiteral.buildTree(),this.treeDistances.buildTree(),this.treeLiteral.calculateBLFreq(this.treeCodeLengths),this.treeDistances.calculateBLFreq(this.treeCodeLengths),this.treeCodeLengths.buildTree();for(var n=4,s=18;s>n;s--)this.treeCodeLengths.codeLengths[d.huffCodeLengthOrders[s]]>0&&(n=s+1);for(var o=14+3*n+this.treeCodeLengths.getEncodedLength()+this.treeLiteral.getEncodedLength()+this.treeDistances.getEncodedLength()+this.extraBits,c=this.extraBits,s=0;s<286;s++)c+=this.treeLiteral.codeFrequencies[s]*a[s];for(s=0;s<30;s++)c+=this.treeDistances.codeFrequencies[s]*u[s];o>=c&&(o=c),e>=0&&i+4<o>>3?this.huffmanFlushStoredBlock(t,e,i,r):o==c?(this.pendingBufferWriteBits(2+(r?1:0),3),this.treeLiteral.setStaticCodes(h,a),this.treeDistances.setStaticCodes(f,u),this.huffmanCompressBlock(),this.huffmanReset()):(this.pendingBufferWriteBits(4+(r?1:0),3),this.huffmanSendAllTrees(n),this.huffmanCompressBlock(),this.huffmanReset())},t.prototype.huffmanFlushStoredBlock=function(t,e,i,r){this.pendingBufferWriteBits(0+(r?1:0),3),this.pendingBufferAlignToByte(),this.pendingBufferWriteShort(i),this.pendingBufferWriteShort(~i),this.pendingBufferWriteByteBlock(t,e,i),this.huffmanReset()},t.prototype.huffmanLengthCode=function(t){if(255===t)return 285;for(var e=257;t>=8;)e+=4,t>>=1;return e+t},t.prototype.huffmanDistanceCode=function(t){for(var e=0;t>=4;)e+=2,t>>=1;return e+t},t.prototype.huffmanSendAllTrees=function(t){this.treeCodeLengths.buildCodes(),this.treeLiteral.buildCodes(),this.treeDistances.buildCodes(),this.pendingBufferWriteBits(this.treeLiteral.treeLength-257,5),this.pendingBufferWriteBits(this.treeDistances.treeLength-1,5),this.pendingBufferWriteBits(t-4,4);for(var e=0;e<t;e++)this.pendingBufferWriteBits(this.treeCodeLengths.codeLengths[d.huffCodeLengthOrders[e]],3);this.treeLiteral.writeTree(this.treeCodeLengths),this.treeDistances.writeTree(this.treeCodeLengths)},t.prototype.huffmanReset=function(){this.bufferPosition=0,this.extraBits=0,this.treeLiteral.reset(),this.treeDistances.reset(),this.treeCodeLengths.reset()},t.prototype.huffmanCompressBlock=function(){for(var t=0;t<this.bufferPosition;t++){var e=255&this.arrLiterals[t],i=this.arrDistances[t];if(0!=i--){var r=this.huffmanLengthCode(e);this.treeLiteral.writeCodeToStream(r);var n=Math.floor((r-261)/4);n>0&&n<=5&&this.pendingBufferWriteBits(e&(1<<n)-1,n);var s=this.huffmanDistanceCode(i);this.treeDistances.writeCodeToStream(s),(n=Math.floor(s/2-1))>0&&this.pendingBufferWriteBits(i&(1<<n)-1,n)}else this.treeLiteral.writeCodeToStream(e)}this.treeLiteral.writeCodeToStream(256)},t.prototype.pendingBufferWriteBits=function(t,e){var i=new Uint32Array(1);i[0]=this.pendingBufCache|t<<this.pendingBufBitsInCache,this.pendingBufCache=i[0],this.pendingBufBitsInCache+=e,this.pendingBufferFlushBits()},t.prototype.pendingBufferFlush=function(t){if(this.pendingBufferFlushBits(),this.pendingBufLength>0){var e=new Uint8Array(this.pendingBufLength);e.set(this.pendingBuffer.subarray(0,this.pendingBufLength),0),this.stream.push(e)}this.pendingBufLength=0},t.prototype.pendingBufferFlushBits=function(){for(var t=0;this.pendingBufBitsInCache>=8&&this.pendingBufLength<65536;)this.pendingBuffer[this.pendingBufLength++]=this.pendingBufCache,this.pendingBufCache>>=8,this.pendingBufBitsInCache-=8,t++;return t},t.prototype.pendingBufferWriteByteBlock=function(t,e,i){var r=t.subarray(e,e+i);this.pendingBuffer.set(r,this.pendingBufLength),this.pendingBufLength+=i},t.prototype.pendingBufferWriteShort=function(t){this.pendingBuffer[this.pendingBufLength++]=t,this.pendingBuffer[this.pendingBufLength++]=t>>8},t.prototype.pendingBufferAlignToByte=function(){this.pendingBufBitsInCache>0&&(this.pendingBuffer[this.pendingBufLength++]=this.pendingBufCache),this.pendingBufCache=0,this.pendingBufBitsInCache=0},t.initHuffmanTree=function(){for(var t=0;t<144;)h[t]=d.bitReverse(48+t<<8),a[t++]=8;for(;t<256;)h[t]=d.bitReverse(256+t<<7),a[t++]=9;for(;t<280;)h[t]=d.bitReverse(-256+t<<9),a[t++]=7;for(;t<286;)h[t]=d.bitReverse(-88+t<<8),a[t++]=8;for(t=0;t<30;t++)f[t]=d.bitReverse(t<<11),u[t]=5},t.prototype.close=function(){do{this.pendingBufferFlush(!0),this.compressData(!0)||(this.pendingBufferFlush(!0),this.pendingBufferAlignToByte(),this.noWrap||(this.pendingBufferWriteShortBytes(this.checkSum>>16),this.pendingBufferWriteShortBytes(65535&this.checkSum)),this.pendingBufferFlush(!0))}while(this.inputEnd!==this.inputOffset||0!==this.pendingBufLength)},t.prototype.destroy=function(){this.stream=[],this.stream=void 0,this.pendingBuffer=void 0,this.treeLiteral=void 0,this.treeDistances=void 0,this.treeCodeLengths=void 0,this.arrLiterals=void 0,this.arrDistances=void 0,this.hashHead=void 0,this.hashPrevious=void 0,this.dataWindow=void 0,this.inputBuffer=void 0,this.pendingBufLength=void 0,this.pendingBufCache=void 0,this.pendingBufBitsInCache=void 0,this.bufferPosition=void 0,this.extraBits=void 0,this.currentHash=void 0,this.matchStart=void 0,this.matchLength=void 0,this.matchPrevAvail=void 0,this.blockStart=void 0,this.stringStart=void 0,this.lookAhead=void 0,this.totalBytesIn=void 0,this.inputOffset=void 0,this.inputEnd=void 0,this.windowSize=void 0,this.windowMask=void 0,this.hashSize=void 0,this.hashMask=void 0,this.hashShift=void 0,this.maxDist=void 0,this.checkSum=void 0,this.noWrap=void 0},t.isHuffmanTreeInitiated=!1,t}(),d=function(){function t(t,e,i,r){this.writer=t,this.codeMinCount=i,this.maxLength=r,this.codeFrequency=new Uint16Array(e),this.lengthCount=new Int32Array(r)}return Object.defineProperty(t.prototype,"treeLength",{get:function(){return this.codeCount},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"codeLengths",{get:function(){return this.codeLength},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"codeFrequencies",{get:function(){return this.codeFrequency},enumerable:!0,configurable:!0}),t.prototype.setStaticCodes=function(t,e){var i=new Int16Array(t.length);i.set(t,0),this.codes=i;var r=new Uint8Array(e.length);r.set(e,0),this.codeLength=r},t.prototype.reset=function(){for(var t=0;t<this.codeFrequency.length;t++)this.codeFrequency[t]=0;this.codes=void 0,this.codeLength=void 0},t.prototype.writeCodeToStream=function(t){this.writer.pendingBufferWriteBits(65535&this.codes[t],this.codeLength[t])},t.prototype.buildCodes=function(){var e=new Int32Array(this.maxLength);this.codes=new Int16Array(this.codeCount);for(var i=0,r=0;r<this.maxLength;r++)e[r]=i,i+=this.lengthCount[r]<<15-r;for(var n=0;n<this.codeCount;n++){var s=this.codeLength[n];s>0&&(this.codes[n]=t.bitReverse(e[s-1]),e[s-1]+=1<<16-s)}},t.bitReverse=function(e){return t.reverseBits[15&e]<<12|t.reverseBits[e>>4&15]<<8|t.reverseBits[e>>8&15]<<4|t.reverseBits[e>>12]},t.prototype.getEncodedLength=function(){for(var t=0,e=0;e<this.codeFrequency.length;e++)t+=this.codeFrequency[e]*this.codeLength[e];return t},t.prototype.calculateBLFreq=function(t){for(var e,i,r,n=-1,s=0;s<this.codeCount;){r=1;var o=this.codeLength[s];for(0===o?(e=138,i=3):(e=6,i=3,n!==o&&(t.codeFrequency[o]++,r=0)),n=o,s++;s<this.codeCount&&n===this.codeLength[s]&&(s++,!(++r>=e)););r<i?t.codeFrequency[n]+=r:0!==n?t.codeFrequency[16]++:r<=10?t.codeFrequency[17]++:t.codeFrequency[18]++}},t.prototype.writeTree=function(t){for(var e,i,r,n=-1,s=0;s<this.codeCount;){r=1;var o=this.codeLength[s];for(0===o?(e=138,i=3):(e=6,i=3,n!==o&&(t.writeCodeToStream(o),r=0)),n=o,s++;s<this.codeCount&&n===this.codeLength[s]&&(s++,!(++r>=e)););if(r<i)for(;r-- >0;)t.writeCodeToStream(n);else 0!==n?(t.writeCodeToStream(16),this.writer.pendingBufferWriteBits(r-3,2)):r<=10?(t.writeCodeToStream(17),this.writer.pendingBufferWriteBits(r-3,3)):(t.writeCodeToStream(18),this.writer.pendingBufferWriteBits(r-11,7))}},t.prototype.buildTree=function(){for(var t=this.codeFrequency.length,e=new Int32Array(t),i=0,r=0,n=0;n<t;n++){var s=this.codeFrequency[n];if(0!==s){for(var o=i++,h=0;o>0&&this.codeFrequency[e[h=Math.floor((o-1)/2)]]>s;)e[o]=e[h],o=h;e[o]=n,r=n}}for(;i<2;)e[i++]=r<2?++r:0;this.codeCount=Math.max(r+1,this.codeMinCount);for(var a=i,f=new Int32Array(4*i-2),u=new Int32Array(2*i-1),c=0;c<i;c++){var d=e[c],p=2*c;f[p]=d,f[p+1]=-1,u[c]=this.codeFrequency[d]<<8,e[c]=c}this.constructHuffmanTree(e,i,u,a,f),this.buildLength(f)},t.prototype.constructHuffmanTree=function(t,e,i,r,n){do{for(var s=t[0],o=t[--e],h=i[o],a=0,f=1;f<e;)f+1<e&&i[t[f]]>i[t[f+1]]&&f++,t[a]=t[f],f=2*(a=f)+1;for(;(f=a)>0&&i[t[a=Math.floor((f-1)/2)]]>h;)t[f]=t[a];t[f]=o;var u=t[0];n[2*(o=r++)]=s,n[2*o+1]=u;var c=Math.min(255&i[s],255&i[u]);for(i[o]=h=i[s]+i[u]-c+1,a=0,f=1;f<e;)f+1<e&&i[t[f]]>i[t[f+1]]&&f++,t[a]=t[f],f=2*(a=f)+1;for(;(f=a)>0&&i[t[a=Math.floor((f-1)/2)]]>h;)t[f]=t[a];t[f]=o}while(e>1)},t.prototype.buildLength=function(t){this.codeLength=new Uint8Array(this.codeFrequency.length);for(var e=Math.floor(t.length/2),i=Math.floor((e+1)/2),r=0,n=0;n<this.maxLength;n++)this.lengthCount[n]=0;if(0!==(r=this.calculateOptimalCodeLength(t,r,e))){var s=this.maxLength-1;do{for(;0===this.lengthCount[--s];);do{this.lengthCount[s]--,this.lengthCount[++s]++,r-=1<<this.maxLength-1-s}while(r>0&&s<this.maxLength-1)}while(r>0);this.recreateTree(t,r,i)}},t.prototype.recreateTree=function(t,e,i){this.lengthCount[this.maxLength-1]+=e,this.lengthCount[this.maxLength-2]-=e;for(var r=2*i,n=this.maxLength;0!==n;n--)for(var s=this.lengthCount[n-1];s>0;){var o=2*t[r++];-1===t[o+1]&&(this.codeLength[t[o]]=n,s--)}},t.prototype.calculateOptimalCodeLength=function(t,e,i){var r=new Int32Array(i);r[i-1]=0;for(var n=i-1;n>=0;n--){var s=2*n+1;if(-1!==t[s])(o=r[n]+1)>this.maxLength&&(o=this.maxLength,e++),r[t[s-1]]=r[t[s]]=o;else{var o=r[n];this.lengthCount[o-1]++,this.codeLength[t[s-1]]=r[n]}}return e},t.reverseBits=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],t.huffCodeLengthOrders=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],t}(),p=function(){function t(){}return t.checksumUpdate=function(e,i,r,n){var s=new Uint32Array(1);s[0]=e;for(var o=s[0],h=s[0]=65535&o,a=s[0]=o>>t.checkSumBitOffset;n>0;){var f=Math.min(n,t.checksumIterationCount);for(n-=f;--f>=0;)a+=h+=s[0]=255&i[r++];h%=t.checksumBase,a%=t.checksumBase}return o=a<<t.checkSumBitOffset|h},t.checkSumBitOffset=16,t.checksumBase=65521,t.checksumIterationCount=3800,t}(),l=function(){function t(t){this.buildTree(t)}return t.init=function(){var e,i;for(e=new Uint8Array(288),i=0;i<144;)e[i++]=8;for(;i<256;)e[i++]=9;for(;i<280;)e[i++]=7;for(;i<288;)e[i++]=8;for(t.m_LengthTree=new t(e),e=new Uint8Array(32),i=0;i<32;)e[i++]=5;t.m_DistanceTree=new t(e)},t.prototype.prepareData=function(e,i,r){for(var n=0,s=512,o=0;o<r.length;o++){var h=r[o];h>0&&e[h]++}for(var a=1;a<=t.MAX_BITLEN;a++)i[a]=n,n+=e[a]<<16-a,a>=10&&(s+=(130944&n)-(130944&i[a])>>16-a);return{code:n,treeSize:s}},t.prototype.treeFromData=function(e,r,n,s,o){for(var h=new Int16Array(o),a=512,f=t.MAX_BITLEN;f>=10;f--)for(var u=130944&s,c=130944&(s-=e[f]<<16-f);c<u;c+=128)h[i.bitReverse(c)]=i.bitConverterInt32ToInt16(-a<<4|f),a+=1<<f-9;for(c=0;c<n.length;c++)if(0!=(f=n[c])){s=r[f];var d=i.bitReverse(s);if(f<=9)do{h[d]=i.bitConverterInt32ToInt16(c<<4|f),d+=1<<f}while(d<512);else{var p=h[511&d],l=1<<(15&p);p=-(p>>4);do{h[p|d>>9]=i.bitConverterInt32ToInt16(c<<4|f),d+=1<<f}while(d<l)}r[f]=s+(1<<16-f)}return h},t.prototype.buildTree=function(t){var e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=this.prepareData(e,i,t);this.m_Tree=this.treeFromData(e,i,t,r.code,r.treeSize)},t.prototype.unpackSymbol=function(t){var e,i;if((e=t.peekBits(9))>=0){if((i=this.m_Tree[e])>=0)return t.skipBits(15&i),i>>4;var r=-(i>>4),n=15&i;if((e=t.peekBits(n))>=0)return i=this.m_Tree[r|e>>9],t.skipBits(15&i),i>>4;s=t.availableBits;return e=t.peekBits(s),i=this.m_Tree[r|e>>9],(15&i)<=s?(t.skipBits(15&i),i>>4):-1}var s=t.availableBits;return e=t.peekBits(s),i=this.m_Tree[e],i>=0&&(15&i)<=s?(t.skipBits(15&i),i>>4):-1},Object.defineProperty(t,"lengthTree",{get:function(){return this.m_LengthTree},enumerable:!0,configurable:!0}),Object.defineProperty(t,"distanceTree",{get:function(){return this.m_DistanceTree},enumerable:!0,configurable:!0}),t.MAX_BITLEN=15,t}(),m=function(){function t(){}return t.ChecksumUpdate=function(t,e,i,r){for(var n=t,s=65535&n,o=n>>this.DEF_CHECKSUM_BIT_OFFSET;r>0;){var h=Math.min(r,this.DEF_CHECKSUM_ITERATIONSCOUNT);for(r-=h;--h>=0;)o+=s+=255&e[i++];s%=this.DEF_CHECKSUM_BASE,o%=this.DEF_CHECKSUM_BASE}t=n=o<<this.DEF_CHECKSUM_BIT_OFFSET|s},t.ChecksumGenerate=function(e,i,r){return t.ChecksumUpdate(1,e,i,r),1},t.DEF_CHECKSUM_BIT_OFFSET=16,t.DEF_CHECKSUM_BASE=65521,t.DEF_CHECKSUM_ITERATIONSCOUNT=3800,t}(),g=function(){function t(t,e){if(this.defaultHuffmanDynamicTree=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],this.DEF_HEADER_METHOD_MASK=3840,this.DEF_HEADER_INFO_MASK=61440,this.DEF_HEADER_FLAGS_FCHECK=31,this.DEF_HEADER_FLAGS_FDICT=32,this.DEF_HEADER_FLAGS_FLEVEL=192,this.DEF_MAX_WINDOW_SIZE=65535,this.DEF_HUFFMAN_REPEATE_MAX=258,this.DEF_HUFFMAN_END_BLOCK=256,this.DEF_HUFFMAN_LENGTH_MINIMUMCODE=257,this.DEF_HUFFMAN_LENGTH_MAXIMUMCODE=285,this.DEF_HUFFMAN_DISTANCE_MAXIMUMCODE=29,this.mCheckSum=1,this.tBuffer=0,this.mBufferedBits=0,this.mTempBuffer=new Uint8Array(4),this.mBlockBuffer=new Uint8Array(this.DEF_MAX_WINDOW_SIZE),this.mbNoWrap=!1,this.mWindowSize=0,this.mCurrentPosition=0,this.mDataLength=0,this.mbCanReadNextBlock=!0,this.mbCanReadMoreData=!0,this.mbCheckSumRead=!1,null==t)throw new DOMException("stream");if(0===t.length)throw new DOMException("stream - string can not be empty");l.init(),this.mInputStream=new B(t),this.mbNoWrap=e,this.mbNoWrap||this.readZLibHeader(),this.decodeBlockHeader()}return Object.defineProperty(t.prototype,"mBuffer",{get:function(){return this.tBuffer},set:function(t){this.tBuffer=t},enumerable:!0,configurable:!0}),t.prototype.peekBits=function(t){if(t<0)throw new DOMException("count","Bits count can not be less than zero.");if(t>32)throw new DOMException("count","Count of bits is too large.");if(this.mBufferedBits<t&&this.fillBuffer(),this.mBufferedBits<t)return-1;var e=~(4294967295<<t);return i.bitConverterUintToInt32(this.mBuffer&e)},t.prototype.fillBuffer=function(){var t=4-(this.mBufferedBits>>3)-(0!=(7&this.mBufferedBits)?1:0);if(0!==t)for(var e=this.mInputStream.read(this.mTempBuffer,0,t),r=0;r<e;r++)this.mBuffer=i.bitConverterInt32ToUint(this.mBuffer|i.bitConverterInt32ToUint(this.mTempBuffer[r]<<this.mBufferedBits)),this.mBufferedBits+=8},t.prototype.skipBits=function(t){if(t<0)throw new DOMException("count","Bits count can not be less than zero.");0!==t&&(t>=this.mBufferedBits?(t-=this.mBufferedBits,this.mBufferedBits=0,this.mBuffer=0,t>0&&(this.mInputStream.position+=t>>3,(t&=7)>0&&(this.fillBuffer(),this.mBufferedBits-=t,this.mBuffer=i.bitConverterInt32ToUint(this.mBuffer>>>t)))):(this.mBufferedBits-=t,this.mBuffer=i.bitConverterInt32ToUint(this.mBuffer>>>t)))},Object.defineProperty(t.prototype,"availableBits",{get:function(){return this.mBufferedBits},enumerable:!0,configurable:!0}),t.prototype.readZLibHeader=function(){var t=this.readInt16();if(-1===t)throw new DOMException("Header of the stream can not be read.");if(t%31!=0)throw new DOMException("Header checksum illegal");if(2048!=(t&this.DEF_HEADER_METHOD_MASK))throw new DOMException("Unsupported compression method.");if(this.mWindowSize=Math.pow(2,8+((t&this.DEF_HEADER_INFO_MASK)>>12)),this.mWindowSize>65535)throw new DOMException("Unsupported window size for deflate compression method.");if((t&this.DEF_HEADER_FLAGS_FDICT)>>5==1)throw new DOMException("Custom dictionary is not supported at the moment.")},t.prototype.readInt16=function(){var t=this.readBits(8)<<8;return t|=this.readBits(8)},t.prototype.readBits=function(t){var e=this.peekBits(t);return-1===e?-1:(this.mBufferedBits-=t,this.mBuffer=i.bitConverterInt32ToUint(this.mBuffer>>>t),e)},t.prototype.decodeBlockHeader=function(){if(!this.mbCanReadNextBlock)return!1;var t=this.readBits(1);if(-1===t)return!1;var e=this.readBits(2);if(-1===e)return!1;switch(this.mbCanReadNextBlock=0===t,e){case 0:this.mbReadingUncompressed=!0,this.skipToBoundary();var i=this.readInt16Inverted();if(i!==(65535^this.readInt16Inverted()))throw new DOMException("Wrong block length.");if(i>65535)throw new DOMException("Uncompressed block length can not be more than 65535.");this.mUncompressedDataLength=i,this.mCurrentLengthTree=null,this.mCurrentDistanceTree=null;break;case 1:this.mbReadingUncompressed=!1,this.mUncompressedDataLength=-1,this.mCurrentLengthTree=l.lengthTree,this.mCurrentDistanceTree=l.distanceTree;break;case 2:this.mbReadingUncompressed=!1,this.mUncompressedDataLength=-1;var r=this.decodeDynamicHeader(this.mCurrentLengthTree,this.mCurrentDistanceTree);this.mCurrentLengthTree=r.lengthTree,this.mCurrentDistanceTree=r.distanceTree;break;default:throw new DOMException("Wrong block type.")}return!0},t.prototype.skipToBoundary=function(){this.mBuffer=i.bitConverterInt32ToUint(this.mBuffer>>>(7&this.mBufferedBits)),this.mBufferedBits&=-8},t.prototype.readInt16Inverted=function(){var t=this.readBits(8);return t|=this.readBits(8)<<8},t.prototype.decodeDynamicHeader=function(e,i){var r=0,n=this.readBits(5),s=this.readBits(5),o=this.readBits(4);if(n<0||s<0||o<0)throw new DOMException("Wrong dynamic huffman codes.");var h=(n+=257)+(s+=1),a=new Uint8Array(h),f=new Uint8Array(19);o+=4;for(var u=0;u<o;){var c=this.readBits(3);if(c<0)throw new DOMException("Wrong dynamic huffman codes.");f[this.defaultHuffmanDynamicTree[u++]]=c}var d=new l(f);for(u=0;;){var p=void 0,m=!1;for(p=d.unpackSymbol(this);0==(-16&p);){if(a[u++]=r=p,u===h){m=!0;break}p=d.unpackSymbol(this)}if(m)break;if(p<0)throw new DOMException("Wrong dynamic huffman codes.");if(p>=17)r=0;else if(0===u)throw new DOMException("Wrong dynamic huffman codes.");var g=p-16,B=t.DEF_HUFFMAN_DYNTREE_REPEAT_BITS[g],v=this.readBits(B);if(v<0)throw new DOMException("Wrong dynamic huffman codes.");if(v+=t.DEF_HUFFMAN_DYNTREE_REPEAT_MINIMUMS[g],u+v>h)throw new DOMException("Wrong dynamic huffman codes.");for(;v-- >0;)a[u++]=r;if(u===h)break}var w=new Uint8Array(n);return w.set(a.subarray(0,n),0),e=new l(w),w=a.slice(n,n+s),i=new l(w),{lengthTree:e,distanceTree:i}},t.prototype.readHuffman=function(){for(var e=this.DEF_MAX_WINDOW_SIZE-(this.mDataLength-this.mCurrentPosition),i=!1,r={};e>=this.DEF_HUFFMAN_REPEATE_MAX;){var n=void 0;for(n=this.mCurrentLengthTree.unpackSymbol(this);0==(-256&n);){if(r[(this.mDataLength+1)%this.DEF_MAX_WINDOW_SIZE]=n,this.mBlockBuffer[this.mDataLength++%this.DEF_MAX_WINDOW_SIZE]=n,i=!0,--e<this.DEF_HUFFMAN_REPEATE_MAX)return!0;n=this.mCurrentLengthTree.unpackSymbol(this)}if(n<this.DEF_HUFFMAN_LENGTH_MINIMUMCODE){if(n<this.DEF_HUFFMAN_END_BLOCK)throw new DOMException("Illegal code.");var s=i?1:0;return this.mbCanReadMoreData=this.decodeBlockHeader(),!!(s|(this.mbCanReadMoreData?1:0))}if(n>this.DEF_HUFFMAN_LENGTH_MAXIMUMCODE)throw new DOMException("Illegal repeat code length.");var o=t.DEF_HUFFMAN_REPEAT_LENGTH_BASE[n-this.DEF_HUFFMAN_LENGTH_MINIMUMCODE],h=t.DEF_HUFFMAN_REPEAT_LENGTH_EXTENSION[n-this.DEF_HUFFMAN_LENGTH_MINIMUMCODE];if(h>0){if((f=this.readBits(h))<0)throw new DOMException("Wrong data.");o+=f}if((n=this.mCurrentDistanceTree.unpackSymbol(this))<0||n>t.DEF_HUFFMAN_REPEAT_DISTANCE_BASE.length)throw new DOMException("Wrong distance code.");var a=t.DEF_HUFFMAN_REPEAT_DISTANCE_BASE[n];if((h=t.DEF_HUFFMAN_REPEAT_DISTANCE_EXTENSION[n])>0){var f=this.readBits(h);if(f<0)throw new DOMException("Wrong data.");a+=f}for(var u=0;u<o;u++)this.mBlockBuffer[this.mDataLength%this.DEF_MAX_WINDOW_SIZE]=this.mBlockBuffer[(this.mDataLength-a)%this.DEF_MAX_WINDOW_SIZE],this.mDataLength++,e--;i=!0}return i},t.prototype.read=function(t,e,r){if(null==t)throw new DOMException("buffer");if(e<0||e>t.length-1)throw new DOMException("offset","Offset does not belong to specified buffer.");if(r<0||r>t.length-e)throw new DOMException("length","Length is illegal.");for(var n=r;r>0;)if(this.mCurrentPosition<this.mDataLength){var s=this.mCurrentPosition%this.DEF_MAX_WINDOW_SIZE,o=Math.min(this.DEF_MAX_WINDOW_SIZE-s,this.mDataLength-this.mCurrentPosition);o=Math.min(o,r),i.arrayCopy(this.mBlockBuffer,s,t,e,o),this.mCurrentPosition+=o,e+=o,r-=o}else{if(!this.mbCanReadMoreData)break;var h=this.mDataLength;if(this.mbReadingUncompressed)if(0===this.mUncompressedDataLength){if(this.mbCanReadMoreData=this.decodeBlockHeader(),!this.mbCanReadMoreData)break}else{var s=this.mDataLength%this.DEF_MAX_WINDOW_SIZE,a=Math.min(this.mUncompressedDataLength,this.DEF_MAX_WINDOW_SIZE-s),f=this.readPackedBytes(this.mBlockBuffer,s,a);if(a!==f)throw new DOMException("Not enough data in stream.");this.mUncompressedDataLength-=f,this.mDataLength+=f}else if(!this.readHuffman())break;if(h<this.mDataLength){var u=h%this.DEF_MAX_WINDOW_SIZE,c=this.mDataLength%this.DEF_MAX_WINDOW_SIZE;u<c?this.checksumUpdate(this.mBlockBuffer,u,c-u):(this.checksumUpdate(this.mBlockBuffer,u,this.DEF_MAX_WINDOW_SIZE-u),c>0&&this.checksumUpdate(this.mBlockBuffer,0,c))}}if(!this.mbCanReadMoreData&&!this.mbCheckSumRead&&!this.mbNoWrap){if(this.skipToBoundary(),this.readInt32()!==this.mCheckSum)throw new DOMException("Checksum check failed.");this.mbCheckSumRead=!0}return n-r},t.prototype.readPackedBytes=function(t,e,r){if(null==t)throw new DOMException("buffer");if(e<0||e>t.length-1)throw new DOMException('offset", "Offset can not be less than zero or greater than buffer length - 1.');if(r<0)throw new DOMException('length", "Length can not be less than zero.');if(r>t.length-e)throw new DOMException('length", "Length is too large.');if(0!=(7&this.mBufferedBits))throw new DOMException("Reading of unalligned data is not supported.");if(0===r)return 0;for(var n=0;this.mBufferedBits>0&&r>0;)t[e++]=this.mBuffer,this.mBufferedBits-=8,this.mBuffer=i.bitConverterInt32ToUint(this.mBuffer>>>8),r--,n++;return r>0&&(n+=this.mInputStream.read(t,e,r)),n},t.prototype.readInt32=function(){var t=this.readBits(8)<<24;return t|=this.readBits(8)<<16,t|=this.readBits(8)<<8,t|=this.readBits(8)},t.prototype.checksumUpdate=function(t,e,i){m.ChecksumUpdate(this.mCheckSum,t,e,i)},t.DEF_REVERSE_BITS=new Uint8Array([0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15]),t.DEF_HUFFMAN_DYNTREE_REPEAT_MINIMUMS=[3,3,11],t.DEF_HUFFMAN_DYNTREE_REPEAT_BITS=[2,3,7],t.DEF_HUFFMAN_REPEAT_LENGTH_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],t.DEF_HUFFMAN_REPEAT_LENGTH_EXTENSION=[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],t.DEF_HUFFMAN_REPEAT_DISTANCE_BASE=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],t.DEF_HUFFMAN_REPEAT_DISTANCE_EXTENSION=[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],t}(),B=function(){function t(t){this.position=0,this.inputStream=new Uint8Array(t.buffer)}return Object.defineProperty(t.prototype,"length",{get:function(){return this.inputStream.buffer.byteLength},enumerable:!0,configurable:!0}),t.prototype.read=function(t,e,i){var r=new Uint8Array(this.inputStream.buffer,this.position+e).subarray(0,i);return t.set(r,0),this.position+=r.byteLength,r.byteLength},t.prototype.readByte=function(){return this.inputStream[this.position++]},t.prototype.write=function(t,e,r){i.arrayCopy(t,0,this.inputStream,this.position+e,r),this.position+=r},t.prototype.toByteArray=function(){return new Uint8Array(this.inputStream.buffer)},t}();return t.ZipArchive=n,t.ZipArchiveItemHelper=s,t.ZipArchiveItem=o,t.CompressedStreamWriter=c,t.CompressorHuffmanTree=d,t.ChecksumCalculator=p,t.Utils=i,t.DecompressorHuffmanTree=l,t.CompressedStreamReader=g,t.Stream=B,t}({},ej.fileutils),this.ejs=ej;
this.ej=this.ej||{},this.ej.compression=function(t,e){"use strict";var i=function(){function t(){}return t.bitReverse=function(e){return t.reverseBits[15&e]<<12|t.reverseBits[e>>4&15]<<8|t.reverseBits[e>>8&15]<<4|t.reverseBits[e>>12]},t.bitConverterToInt32=function(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24},t.bitConverterToInt16=function(t,e){return t[e]|t[e+1]<<8},t.bitConverterToUInt32=function(t){var e=new Uint32Array(1);return e[0]=t,e[0]},t.bitConverterToUInt16=function(t,e){var i=new Uint16Array(1);return i[0]=t[e]|t[e+1]<<8,i[0]},t.bitConverterUintToInt32=function(t){var e=new Int32Array(1);return e[0]=t,e[0]},t.bitConverterInt32ToUint=function(t){var e=new Uint32Array(1);return e[0]=t,e[0]},t.bitConverterInt32ToInt16=function(t){var e=new Int16Array(1);return e[0]=t,e[0]},t.byteToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},t.byteIntToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},t.arrayCopy=function(t,e,i,r,n){var s=new Uint8Array(t.buffer,e).subarray(0,n);i.set(s,r)},t.mergeArray=function(t,e){var i=new Uint8Array(t.length+e.length);return i.set(t),i.set(e,t.length),i},t.encodedString=function(t){var e,i,r,n,s,o,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,f=0,u=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(t.charAt(t.length-1)===h.charAt(64)&&u--,t.charAt(t.length-2)===h.charAt(64)&&u--,u%1!=0)throw new Error("Invalid base64 input, bad content length.");for(var c=new Uint8Array(0|u);a<t.length;)e=h.indexOf(t.charAt(a++))<<2|(n=h.indexOf(t.charAt(a++)))>>4,i=(15&n)<<4|(s=h.indexOf(t.charAt(a++)))>>2,r=(3&s)<<6|(o=h.indexOf(t.charAt(a++))),c[f++]=e,64!==s&&(c[f++]=i),64!==o&&(c[f++]=r);return c},t.reverseBits=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],t.huffCodeLengthOrders=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],t}(),r=[],n=function(){function t(){0===r.length&&t.initCrc32Table(),this.files=[],this.level="Normal",e.Save.isMicrosoftBrowser=!!navigator.msSaveBlob}return Object.defineProperty(t.prototype,"items",{get:function(){return this.files},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"compressionLevel",{get:function(){return this.level},set:function(t){this.level=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return void 0===this.files?0:this.files.length},enumerable:!0,configurable:!0}),t.prototype.addItem=function(t){if(null===t||void 0===t)throw new Error("ArgumentException: item cannot be null or undefined");for(var e=0;e<this.files.length;e++){var i=this.files[e];if(i instanceof o&&i.name===t.name)throw new Error("item with same name already exist")}this.files.push(t)},t.prototype.addDirectory=function(t){if(null===t||void 0===t)throw new Error("ArgumentException: string cannot be null or undefined");if(0===t.length)throw new Error("ArgumentException: string cannot be empty");if("/"!==t.slice(-1)&&(t+="/"),-1!==this.files.indexOf(t))throw new Error("item with same name already exist");this.files.push(t)},t.prototype.getItem=function(t){if(t>=0&&t<this.files.length)return this.files[t]},t.prototype.contains=function(t){return-1!==this.files.indexOf(t)},t.prototype.open=function(e){var r=i.encodedString(e);if(0==r.length)throw new DOMException("stream");var n=new B(r),s=t.findValueFromEnd(n,101010256,65557);if(s<0)throw new DOMException("Can't locate end of central directory record. Possible wrong file format or archive is corrupt.");n.position=s+12;var o=s-t.ReadInt32(n);n.position=o,this.readCentralDirectoryDataAndExtractItems(n)},t.prototype.readCentralDirectoryDataAndExtractItems=function(e){if(null==e)throw new DOMException("stream");for(var i;33639248==t.ReadInt32(e);)(i=new s).readCentralDirectoryData(e);i.readData(e,i.checkCrc),i.decompressData(),this.files.push(new o(i.unCompressedStream.buffer,i.name))},t.prototype.save=function(t){if(null===t||void 0===t||0===t.length)throw new Error("ArgumentException: fileName cannot be null or undefined");if(0===this.files.length)throw new Error("InvalidOperation");var e=this;return new Promise(function(i,r){e.saveInternal(t,!1).then(function(){i(e)})})},t.prototype.saveAsBlob=function(){var t=this;return new Promise(function(e,i){t.saveInternal("",!0).then(function(t){e(t)})})},t.prototype.saveInternal=function(t,e){var i=this,r=this;return new Promise(function(n,s){for(var o=[],h=0,a=0;a<r.files.length;a++)i.getCompressedData(i.files[a]).then(function(i){if(h=r.constructZippedObject(o,i,h,i.isDirectory),o.length===r.files.length){var s=r.writeZippedContent(t,o,h,e);n(s)}})})},t.prototype.destroy=function(){if(void 0!==this.files&&this.files.length>0){for(var t=0;t<this.files.length;t++){var e=this.files[t];e instanceof o&&e.destroy(),e=void 0}this.files=[]}this.files=void 0,this.level=void 0},t.prototype.getCompressedData=function(t){var e=this;return new Promise(function(i,n){if(t instanceof o){var s=new FileReader;s.onload=function(){var n=new Uint8Array(s.result),o={fileName:t.name,crc32Value:0,compressedData:[],compressedSize:void 0,uncompressedDataSize:n.length,compressionType:void 0,isDirectory:!1};if("Normal"===e.level){e.compressData(n,o,r);for(var h=0,a=0;a<o.compressedData.length;a++)h+=o.compressedData[a].length;o.compressedSize=h,o.compressionType="\b\0"}else o.compressedSize=n.length,o.crc32Value=e.calculateCrc32Value(0,n,r),o.compressionType="\0\0",o.compressedData.push(n);i(o)},s.readAsArrayBuffer(t.data)}else i({fileName:t,crc32Value:0,compressedData:"",compressedSize:0,uncompressedDataSize:0,compressionType:"\0\0",isDirectory:!0})})},t.prototype.compressData=function(t,e,i){var r=new c(!0),n=0,s=0;do{if(n>=t.length){r.close();break}s=Math.min(t.length,n+16384);var o=t.subarray(n,s);e.crc32Value=this.calculateCrc32Value(e.crc32Value,o,i),r.write(o,0,s-n),n=s}while(n<=t.length);e.compressedData=r.compressedData,r.destroy()},t.prototype.constructZippedObject=function(t,e,i,r){var n=0,s=new Date;r&&(n|=16),n|=0;var o=this.writeHeader(e,s),h="PK"+o+e.fileName,a=this.writeCentralDirectory(e,o,i,n);return t.push({localHeader:h,centralDir:a,compressedData:e}),i+h.length+e.compressedSize},t.prototype.writeHeader=function(t,e){var i="";return i+="\n\0\0\0",i+=t.compressionType,i+=this.getBytes(this.getModifiedTime(e),2),i+=this.getBytes(this.getModifiedDate(e),2),i+=this.getBytes(t.crc32Value,4),i+=this.getBytes(t.compressedSize,4),i+=this.getBytes(t.uncompressedDataSize,4),i+=this.getBytes(t.fileName.length,2),i+=this.getBytes(0,2)},t.prototype.writeZippedContent=function(t,i,r,n){for(var s=0,o=[],h=0;h<i.length;h++){var a=i[h];for(s+=a.centralDir.length,o.push(this.getArrayBuffer(a.localHeader));a.compressedData.compressedData.length;)o.push(a.compressedData.compressedData.shift().buffer)}for(h=0;h<i.length;h++)o.push(this.getArrayBuffer(i[h].centralDir));o.push(this.getArrayBuffer(this.writeFooter(i,s,r)));var f=new Blob(o,{type:"application/zip"});return n||e.Save.save(t,f),f},t.prototype.writeCentralDirectory=function(t,e,i,r){return"PK"+this.getBytes(20,2)+e+this.getBytes(0,2)+"\0\0\0\0"+this.getBytes(r,4)+this.getBytes(i,4)+t.fileName},t.prototype.writeFooter=function(t,e,i){return"PK\0\0\0\0"+this.getBytes(t.length,2)+this.getBytes(t.length,2)+this.getBytes(e,4)+this.getBytes(i,4)+this.getBytes(0,2)},t.prototype.getArrayBuffer=function(t){for(var e=new Uint8Array(t.length),i=0;i<t.length;++i)e[i]=255&t.charCodeAt(i);return e.buffer},t.prototype.getBytes=function(t,e){for(var i="",r=0;r<e;r++)i+=String.fromCharCode(255&t),t>>>=8;return i},t.prototype.getModifiedTime=function(t){var e=t.getHours();return e<<=6,e|=t.getMinutes(),e<<=5,e|=t.getSeconds()/2},t.prototype.getModifiedDate=function(t){var e=t.getFullYear()-1980;return e<<=4,e|=t.getMonth()+1,e<<=5,e|=t.getDate()},t.prototype.calculateCrc32Value=function(t,e,i){t^=-1;for(var r=0;r<e.length;r++)t=t>>>8^i[255&(t^e[r])];return-1^t},t.initCrc32Table=function(){for(var t,e=0;e<256;e++){t=e;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;r[e]=t}},t.findValueFromEnd=function(t,e,i){if(null==t)throw new DOMException("stream");var r=t.inputStream.buffer.byteLength;if(r<4)return-1;var n=new Uint8Array(4),s=Math.max(0,r-i),o=r-1-4;t.position=o,t.read(n,0,4);var h=n[0],a=h==e;if(!a)for(;o>s;)if(h<<=8,o--,t.position=o,(h+=t.readByte())==e){a=!0;break}return a?o:-1},t.ReadInt32=function(t){var e=new Uint8Array(4);if(4!=t.read(e,0,4))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return i.bitConverterToInt32(e,0)},t.ReadInt16=function(t){var e=new Uint8Array(2);if(2!=t.read(e,0,2))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return i.bitConverterToInt16(e,0)},t.ReadUInt16=function(t){var e=new Uint8Array(2);if(2!=t.read(e,0,2))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return i.bitConverterToInt16(e,0)},t}(),s=function(){function t(){this.headerSignature=67324752,this.checkCrc=!0,this.crc32=0}return t.prototype.readCentralDirectoryData=function(t){t.position+=4,this.options=n.ReadInt16(t),this.compressionMethod=n.ReadInt16(t),this.checkCrc=99!=this.compressionMethod;n.ReadInt32(t);this.crc32=i.bitConverterToUInt32(n.ReadInt32(t)),this.compressedSize=n.ReadInt32(t),this.originalSize=n.ReadInt32(t);var e=n.ReadInt16(t),r=n.ReadInt16(t),s=n.ReadInt16(t);t.position+=4,this.externalAttributes=n.ReadInt32(t),this.localHeaderOffset=n.ReadInt32(t);var o=new Uint8Array(e);t.read(o,0,e);var h=i.byteToString(o);h=h.replace("\\","/"),this.name=h,t.position+=r+s,0!=this.options&&(this.options=0)},t.prototype.readData=function(t,e){if(0==t.length)throw new DOMException("stream");t.position=this.localHeaderOffset,this.checkCrc=e,this.readLocalHeader(t),this.readCompressedData(t)},t.prototype.decompressData=function(){8==this.compressionMethod&&this.originalSize>0&&this.decompressDataOld()},t.prototype.decompressDataOld=function(){var t,e=new g(this.compressedStream,!0);this.originalSize>0&&(t=new B(new Uint8Array(this.originalSize)));for(var i,r=new Uint8Array(4096);(i=e.read(r,0,4096))>0;)t.write(r.subarray(0,i),0,i);this.unCompressedStream=t.toByteArray(),this.checkCrc},t.prototype.readLocalHeader=function(t){if(0==t.length)throw new DOMException("stream");if(n.ReadInt32(t)!=this.headerSignature)throw new DOMException("Can't find local header signature - wrong file format or file is corrupt.");t.position+=22;var e=n.ReadInt16(t),i=n.ReadUInt16(t);if(99==this.compressionMethod);else if(i>2){if(t.position+=e,23==n.ReadInt16(t))throw new DOMException("UnSupported");t.position+=i-2}else t.position+=e+i},t.prototype.readCompressedData=function(t){var e;if(this.compressedSize>0){var i=this.compressedSize;e=new B(new Uint8Array(i));for(var r=new Uint8Array(4096);i>0;){var n=Math.min(i,4096);if(t.read(r,0,n)!=n)throw new DOMException("End of file reached - wrong file format or file is corrupt.");e.write(r.subarray(0,n),0,n),i-=n}this.compressedStream=new Uint8Array(e.inputStream)}else this.compressedSize<0||this.compressedSize},t}(),o=function(){function t(t,e){if(null===t||void 0===t)throw new Error("ArgumentException: data cannot be null or undefined");if(null===e||void 0===e)throw new Error("ArgumentException: string cannot be null or undefined");if(0===e.length)throw new Error("string cannot be empty");this.data=t,this.name=e}return Object.defineProperty(t.prototype,"dataStream",{get:function(){return this.decompressedStream},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.fileName},set:function(t){this.fileName=t},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this.fileName=void 0,this.data=void 0},t}(),h=new Int16Array(286),a=new Uint8Array(286),f=new Int16Array(30),u=new Uint8Array(30),c=function(){function t(e){this.pendingBuffer=new Uint8Array(65536),this.pendingBufLength=0,this.pendingBufCache=0,this.pendingBufBitsInCache=0,this.bufferPosition=0,this.extraBits=0,this.currentHash=0,this.matchStart=0,this.matchLength=0,this.matchPrevAvail=!1,this.blockStart=0,this.stringStart=0,this.lookAhead=0,this.totalBytesIn=0,this.inputOffset=0,this.inputEnd=0,this.windowSize=32768,this.windowMask=this.windowSize-1,this.hashSize=32768,this.hashMask=this.hashSize-1,this.hashShift=Math.floor(17/3),this.maxDist=this.windowSize-262,this.checkSum=1,this.noWrap=!1,t.isHuffmanTreeInitiated||(t.initHuffmanTree(),t.isHuffmanTreeInitiated=!0),this.treeLiteral=new d(this,286,257,15),this.treeDistances=new d(this,30,1,15),this.treeCodeLengths=new d(this,19,4,7),this.arrDistances=new Uint16Array(16384),this.arrLiterals=new Uint8Array(16384),this.stream=[],this.dataWindow=new Uint8Array(2*this.windowSize),this.hashHead=new Int16Array(this.hashSize),this.hashPrevious=new Int16Array(this.windowSize),this.blockStart=this.stringStart=1,this.noWrap=e,e||this.writeZLibHeader()}return Object.defineProperty(t.prototype,"compressedData",{get:function(){return this.stream},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"getCompressedString",{get:function(){var t="";if(void 0!==this.stream)for(var e=0;e<this.stream.length;e++)t+=String.fromCharCode.apply(null,this.stream[e]);return t},enumerable:!0,configurable:!0}),t.prototype.write=function(t,i,r){if(void 0===t||null===t)throw new Error("ArgumentException: data cannot null or undefined");var n=i+r;if(0>i||i>n||n>t.length)throw new Error("ArgumentOutOfRangeException: Offset or length is incorrect");if("string"==typeof t){var s=new e.Encoding(!1);s.type="Utf8",n=i+(t=new Uint8Array(s.getBytes(t,0,t.length))).length}for(this.inputBuffer=t,this.inputOffset=i,this.inputEnd=n,this.noWrap||(this.checkSum=p.checksumUpdate(this.checkSum,this.inputBuffer,this.inputOffset,n));this.inputEnd!==this.inputOffset||0!==this.pendingBufLength;)this.pendingBufferFlush(),this.compressData(!1)},t.prototype.writeZLibHeader=function(){var t=30720;t|=64,t+=31-t%31,this.pendingBufferWriteShortBytes(t)},t.prototype.pendingBufferWriteShortBytes=function(t){this.pendingBuffer[this.pendingBufLength++]=t>>8,this.pendingBuffer[this.pendingBufLength++]=t},t.prototype.compressData=function(t){var e;do{this.fillWindow();var i=t&&this.inputEnd===this.inputOffset;e=this.compressSlow(i,t)}while(0===this.pendingBufLength&&e);return e},t.prototype.compressSlow=function(t,e){if(this.lookAhead<262&&!t)return!1;for(;this.lookAhead>=262||t;){if(0===this.lookAhead)return this.lookAheadCompleted(e);this.stringStart>=2*this.windowSize-262&&this.slideWindow();var i=this.matchStart,r=this.matchLength;if(this.lookAhead>=3&&this.discardMatch(),r>=3&&this.matchLength<=r?r=this.matchPreviousBest(i,r):this.matchPreviousAvailable(),this.bufferPosition>=16384)return this.huffmanIsFull(e)}return!0},t.prototype.discardMatch=function(){var t=this.insertString();0!==t&&this.stringStart-t<=this.maxDist&&this.findLongestMatch(t)&&this.matchLength<=5&&3===this.matchLength&&this.stringStart-this.matchStart>4096&&(this.matchLength=2)},t.prototype.matchPreviousAvailable=function(){this.matchPrevAvail&&this.huffmanTallyLit(255&this.dataWindow[this.stringStart-1]),this.matchPrevAvail=!0,this.stringStart++,this.lookAhead--},t.prototype.matchPreviousBest=function(t,e){this.huffmanTallyDist(this.stringStart-1-t,e),e-=2;do{this.stringStart++,--this.lookAhead>=3&&this.insertString()}while(--e>0);return this.stringStart++,this.lookAhead--,this.matchPrevAvail=!1,this.matchLength=2,e},t.prototype.lookAheadCompleted=function(t){return this.matchPrevAvail&&this.huffmanTallyLit(255&this.dataWindow[this.stringStart-1]),this.matchPrevAvail=!1,this.huffmanFlushBlock(this.dataWindow,this.blockStart,this.stringStart-this.blockStart,t),this.blockStart=this.stringStart,!1},t.prototype.huffmanIsFull=function(t){var e=this.stringStart-this.blockStart;this.matchPrevAvail&&e--;var i=t&&0===this.lookAhead&&!this.matchPrevAvail;return this.huffmanFlushBlock(this.dataWindow,this.blockStart,e,i),this.blockStart+=e,!i},t.prototype.fillWindow=function(){for(this.stringStart>=this.windowSize+this.maxDist&&this.slideWindow();this.lookAhead<262&&this.inputOffset<this.inputEnd;){var t=2*this.windowSize-this.lookAhead-this.stringStart;t>this.inputEnd-this.inputOffset&&(t=this.inputEnd-this.inputOffset),this.dataWindow.set(this.inputBuffer.subarray(this.inputOffset,this.inputOffset+t),this.stringStart+this.lookAhead),this.inputOffset+=t,this.totalBytesIn+=t,this.lookAhead+=t}this.lookAhead>=3&&this.updateHash()},t.prototype.slideWindow=function(){this.dataWindow.set(this.dataWindow.subarray(this.windowSize,this.windowSize+this.windowSize),0),this.matchStart-=this.windowSize,this.stringStart-=this.windowSize,this.blockStart-=this.windowSize;for(t=0;t<this.hashSize;++t){e=65535&this.hashHead[t];this.hashHead[t]=e>=this.windowSize?e-this.windowSize:0}for(var t=0;t<this.windowSize;t++){var e=65535&this.hashPrevious[t];this.hashPrevious[t]=e>=this.windowSize?e-this.windowSize:0}},t.prototype.insertString=function(){var t,e=(this.currentHash<<this.hashShift^this.dataWindow[this.stringStart+2])&this.hashMask;return this.hashPrevious[this.stringStart&this.windowMask]=t=this.hashHead[e],this.hashHead[e]=this.stringStart,this.currentHash=e,65535&t},t.prototype.findLongestMatch=function(t){var e,i=4096,r=258,n=this.stringStart,s=this.stringStart+this.matchLength,o=Math.max(this.matchLength,2),h=Math.max(this.stringStart-this.maxDist,0),a=this.stringStart+258-1,f=this.dataWindow[s-1],u=this.dataWindow[s],c=this.dataWindow;o>=32&&(i>>=2),r>this.lookAhead&&(r=this.lookAhead);do{if(c[t+o]===u&&c[t+o-1]===f&&c[t]===c[n]&&c[t+1]===c[n+1]){for(e=t+2,n+=2;c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&c[++n]===c[++e]&&n<a;);if(n>s){if(this.matchStart=t,s=n,(o=n-this.stringStart)>=r)break;f=c[s-1],u=c[s]}n=this.stringStart}}while((t=65535&this.hashPrevious[t&this.windowMask])>h&&0!=--i);return this.matchLength=Math.min(o,this.lookAhead),this.matchLength>=3},t.prototype.updateHash=function(){this.currentHash=this.dataWindow[this.stringStart]<<this.hashShift^this.dataWindow[this.stringStart+1]},t.prototype.huffmanTallyLit=function(t){return this.arrDistances[this.bufferPosition]=0,this.arrLiterals[this.bufferPosition++]=t,this.treeLiteral.codeFrequencies[t]++,this.bufferPosition>=16384},t.prototype.huffmanTallyDist=function(t,e){this.arrDistances[this.bufferPosition]=t,this.arrLiterals[this.bufferPosition++]=e-3;var i=this.huffmanLengthCode(e-3);this.treeLiteral.codeFrequencies[i]++,i>=265&&i<285&&(this.extraBits+=Math.floor((i-261)/4));var r=this.huffmanDistanceCode(t-1);return this.treeDistances.codeFrequencies[r]++,r>=4&&(this.extraBits+=Math.floor(r/2-1)),this.bufferPosition>=16384},t.prototype.huffmanFlushBlock=function(t,e,i,r){this.treeLiteral.codeFrequencies[256]++,this.treeLiteral.buildTree(),this.treeDistances.buildTree(),this.treeLiteral.calculateBLFreq(this.treeCodeLengths),this.treeDistances.calculateBLFreq(this.treeCodeLengths),this.treeCodeLengths.buildTree();for(var n=4,s=18;s>n;s--)this.treeCodeLengths.codeLengths[d.huffCodeLengthOrders[s]]>0&&(n=s+1);for(var o=14+3*n+this.treeCodeLengths.getEncodedLength()+this.treeLiteral.getEncodedLength()+this.treeDistances.getEncodedLength()+this.extraBits,c=this.extraBits,s=0;s<286;s++)c+=this.treeLiteral.codeFrequencies[s]*a[s];for(s=0;s<30;s++)c+=this.treeDistances.codeFrequencies[s]*u[s];o>=c&&(o=c),e>=0&&i+4<o>>3?this.huffmanFlushStoredBlock(t,e,i,r):o==c?(this.pendingBufferWriteBits(2+(r?1:0),3),this.treeLiteral.setStaticCodes(h,a),this.treeDistances.setStaticCodes(f,u),this.huffmanCompressBlock(),this.huffmanReset()):(this.pendingBufferWriteBits(4+(r?1:0),3),this.huffmanSendAllTrees(n),this.huffmanCompressBlock(),this.huffmanReset())},t.prototype.huffmanFlushStoredBlock=function(t,e,i,r){this.pendingBufferWriteBits(0+(r?1:0),3),this.pendingBufferAlignToByte(),this.pendingBufferWriteShort(i),this.pendingBufferWriteShort(~i),this.pendingBufferWriteByteBlock(t,e,i),this.huffmanReset()},t.prototype.huffmanLengthCode=function(t){if(255===t)return 285;for(var e=257;t>=8;)e+=4,t>>=1;return e+t},t.prototype.huffmanDistanceCode=function(t){for(var e=0;t>=4;)e+=2,t>>=1;return e+t},t.prototype.huffmanSendAllTrees=function(t){this.treeCodeLengths.buildCodes(),this.treeLiteral.buildCodes(),this.treeDistances.buildCodes(),this.pendingBufferWriteBits(this.treeLiteral.treeLength-257,5),this.pendingBufferWriteBits(this.treeDistances.treeLength-1,5),this.pendingBufferWriteBits(t-4,4);for(var e=0;e<t;e++)this.pendingBufferWriteBits(this.treeCodeLengths.codeLengths[d.huffCodeLengthOrders[e]],3);this.treeLiteral.writeTree(this.treeCodeLengths),this.treeDistances.writeTree(this.treeCodeLengths)},t.prototype.huffmanReset=function(){this.bufferPosition=0,this.extraBits=0,this.treeLiteral.reset(),this.treeDistances.reset(),this.treeCodeLengths.reset()},t.prototype.huffmanCompressBlock=function(){for(var t=0;t<this.bufferPosition;t++){var e=255&this.arrLiterals[t],i=this.arrDistances[t];if(0!=i--){var r=this.huffmanLengthCode(e);this.treeLiteral.writeCodeToStream(r);var n=Math.floor((r-261)/4);n>0&&n<=5&&this.pendingBufferWriteBits(e&(1<<n)-1,n);var s=this.huffmanDistanceCode(i);this.treeDistances.writeCodeToStream(s),(n=Math.floor(s/2-1))>0&&this.pendingBufferWriteBits(i&(1<<n)-1,n)}else this.treeLiteral.writeCodeToStream(e)}this.treeLiteral.writeCodeToStream(256)},t.prototype.pendingBufferWriteBits=function(t,e){var i=new Uint32Array(1);i[0]=this.pendingBufCache|t<<this.pendingBufBitsInCache,this.pendingBufCache=i[0],this.pendingBufBitsInCache+=e,this.pendingBufferFlushBits()},t.prototype.pendingBufferFlush=function(t){if(this.pendingBufferFlushBits(),this.pendingBufLength>0){var e=new Uint8Array(this.pendingBufLength);e.set(this.pendingBuffer.subarray(0,this.pendingBufLength),0),this.stream.push(e)}this.pendingBufLength=0},t.prototype.pendingBufferFlushBits=function(){for(var t=0;this.pendingBufBitsInCache>=8&&this.pendingBufLength<65536;)this.pendingBuffer[this.pendingBufLength++]=this.pendingBufCache,this.pendingBufCache>>=8,this.pendingBufBitsInCache-=8,t++;return t},t.prototype.pendingBufferWriteByteBlock=function(t,e,i){var r=t.subarray(e,e+i);this.pendingBuffer.set(r,this.pendingBufLength),this.pendingBufLength+=i},t.prototype.pendingBufferWriteShort=function(t){this.pendingBuffer[this.pendingBufLength++]=t,this.pendingBuffer[this.pendingBufLength++]=t>>8},t.prototype.pendingBufferAlignToByte=function(){this.pendingBufBitsInCache>0&&(this.pendingBuffer[this.pendingBufLength++]=this.pendingBufCache),this.pendingBufCache=0,this.pendingBufBitsInCache=0},t.initHuffmanTree=function(){for(var t=0;t<144;)h[t]=d.bitReverse(48+t<<8),a[t++]=8;for(;t<256;)h[t]=d.bitReverse(256+t<<7),a[t++]=9;for(;t<280;)h[t]=d.bitReverse(-256+t<<9),a[t++]=7;for(;t<286;)h[t]=d.bitReverse(-88+t<<8),a[t++]=8;for(t=0;t<30;t++)f[t]=d.bitReverse(t<<11),u[t]=5},t.prototype.close=function(){do{this.pendingBufferFlush(!0),this.compressData(!0)||(this.pendingBufferFlush(!0),this.pendingBufferAlignToByte(),this.noWrap||(this.pendingBufferWriteShortBytes(this.checkSum>>16),this.pendingBufferWriteShortBytes(65535&this.checkSum)),this.pendingBufferFlush(!0))}while(this.inputEnd!==this.inputOffset||0!==this.pendingBufLength)},t.prototype.destroy=function(){this.stream=[],this.stream=void 0,this.pendingBuffer=void 0,this.treeLiteral=void 0,this.treeDistances=void 0,this.treeCodeLengths=void 0,this.arrLiterals=void 0,this.arrDistances=void 0,this.hashHead=void 0,this.hashPrevious=void 0,this.dataWindow=void 0,this.inputBuffer=void 0,this.pendingBufLength=void 0,this.pendingBufCache=void 0,this.pendingBufBitsInCache=void 0,this.bufferPosition=void 0,this.extraBits=void 0,this.currentHash=void 0,this.matchStart=void 0,this.matchLength=void 0,this.matchPrevAvail=void 0,this.blockStart=void 0,this.stringStart=void 0,this.lookAhead=void 0,this.totalBytesIn=void 0,this.inputOffset=void 0,this.inputEnd=void 0,this.windowSize=void 0,this.windowMask=void 0,this.hashSize=void 0,this.hashMask=void 0,this.hashShift=void 0,this.maxDist=void 0,this.checkSum=void 0,this.noWrap=void 0},t.isHuffmanTreeInitiated=!1,t}(),d=function(){function t(t,e,i,r){this.writer=t,this.codeMinCount=i,this.maxLength=r,this.codeFrequency=new Uint16Array(e),this.lengthCount=new Int32Array(r)}return Object.defineProperty(t.prototype,"treeLength",{get:function(){return this.codeCount},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"codeLengths",{get:function(){return this.codeLength},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"codeFrequencies",{get:function(){return this.codeFrequency},enumerable:!0,configurable:!0}),t.prototype.setStaticCodes=function(t,e){var i=new Int16Array(t.length);i.set(t,0),this.codes=i;var r=new Uint8Array(e.length);r.set(e,0),this.codeLength=r},t.prototype.reset=function(){for(var t=0;t<this.codeFrequency.length;t++)this.codeFrequency[t]=0;this.codes=void 0,this.codeLength=void 0},t.prototype.writeCodeToStream=function(t){this.writer.pendingBufferWriteBits(65535&this.codes[t],this.codeLength[t])},t.prototype.buildCodes=function(){var e=new Int32Array(this.maxLength);this.codes=new Int16Array(this.codeCount);for(var i=0,r=0;r<this.maxLength;r++)e[r]=i,i+=this.lengthCount[r]<<15-r;for(var n=0;n<this.codeCount;n++){var s=this.codeLength[n];s>0&&(this.codes[n]=t.bitReverse(e[s-1]),e[s-1]+=1<<16-s)}},t.bitReverse=function(e){return t.reverseBits[15&e]<<12|t.reverseBits[e>>4&15]<<8|t.reverseBits[e>>8&15]<<4|t.reverseBits[e>>12]},t.prototype.getEncodedLength=function(){for(var t=0,e=0;e<this.codeFrequency.length;e++)t+=this.codeFrequency[e]*this.codeLength[e];return t},t.prototype.calculateBLFreq=function(t){for(var e,i,r,n=-1,s=0;s<this.codeCount;){r=1;var o=this.codeLength[s];for(0===o?(e=138,i=3):(e=6,i=3,n!==o&&(t.codeFrequency[o]++,r=0)),n=o,s++;s<this.codeCount&&n===this.codeLength[s]&&(s++,!(++r>=e)););r<i?t.codeFrequency[n]+=r:0!==n?t.codeFrequency[16]++:r<=10?t.codeFrequency[17]++:t.codeFrequency[18]++}},t.prototype.writeTree=function(t){for(var e,i,r,n=-1,s=0;s<this.codeCount;){r=1;var o=this.codeLength[s];for(0===o?(e=138,i=3):(e=6,i=3,n!==o&&(t.writeCodeToStream(o),r=0)),n=o,s++;s<this.codeCount&&n===this.codeLength[s]&&(s++,!(++r>=e)););if(r<i)for(;r-- >0;)t.writeCodeToStream(n);else 0!==n?(t.writeCodeToStream(16),this.writer.pendingBufferWriteBits(r-3,2)):r<=10?(t.writeCodeToStream(17),this.writer.pendingBufferWriteBits(r-3,3)):(t.writeCodeToStream(18),this.writer.pendingBufferWriteBits(r-11,7))}},t.prototype.buildTree=function(){for(var t=this.codeFrequency.length,e=new Int32Array(t),i=0,r=0,n=0;n<t;n++){var s=this.codeFrequency[n];if(0!==s){for(var o=i++,h=0;o>0&&this.codeFrequency[e[h=Math.floor((o-1)/2)]]>s;)e[o]=e[h],o=h;e[o]=n,r=n}}for(;i<2;)e[i++]=r<2?++r:0;this.codeCount=Math.max(r+1,this.codeMinCount);for(var a=i,f=new Int32Array(4*i-2),u=new Int32Array(2*i-1),c=0;c<i;c++){var d=e[c],p=2*c;f[p]=d,f[p+1]=-1,u[c]=this.codeFrequency[d]<<8,e[c]=c}this.constructHuffmanTree(e,i,u,a,f),this.buildLength(f)},t.prototype.constructHuffmanTree=function(t,e,i,r,n){do{for(var s=t[0],o=t[--e],h=i[o],a=0,f=1;f<e;)f+1<e&&i[t[f]]>i[t[f+1]]&&f++,t[a]=t[f],f=2*(a=f)+1;for(;(f=a)>0&&i[t[a=Math.floor((f-1)/2)]]>h;)t[f]=t[a];t[f]=o;var u=t[0];n[2*(o=r++)]=s,n[2*o+1]=u;var c=Math.min(255&i[s],255&i[u]);for(i[o]=h=i[s]+i[u]-c+1,a=0,f=1;f<e;)f+1<e&&i[t[f]]>i[t[f+1]]&&f++,t[a]=t[f],f=2*(a=f)+1;for(;(f=a)>0&&i[t[a=Math.floor((f-1)/2)]]>h;)t[f]=t[a];t[f]=o}while(e>1)},t.prototype.buildLength=function(t){this.codeLength=new Uint8Array(this.codeFrequency.length);for(var e=Math.floor(t.length/2),i=Math.floor((e+1)/2),r=0,n=0;n<this.maxLength;n++)this.lengthCount[n]=0;if(0!==(r=this.calculateOptimalCodeLength(t,r,e))){var s=this.maxLength-1;do{for(;0===this.lengthCount[--s];);do{this.lengthCount[s]--,this.lengthCount[++s]++,r-=1<<this.maxLength-1-s}while(r>0&&s<this.maxLength-1)}while(r>0);this.recreateTree(t,r,i)}},t.prototype.recreateTree=function(t,e,i){this.lengthCount[this.maxLength-1]+=e,this.lengthCount[this.maxLength-2]-=e;for(var r=2*i,n=this.maxLength;0!==n;n--)for(var s=this.lengthCount[n-1];s>0;){var o=2*t[r++];-1===t[o+1]&&(this.codeLength[t[o]]=n,s--)}},t.prototype.calculateOptimalCodeLength=function(t,e,i){var r=new Int32Array(i);r[i-1]=0;for(var n=i-1;n>=0;n--){var s=2*n+1;if(-1!==t[s])(o=r[n]+1)>this.maxLength&&(o=this.maxLength,e++),r[t[s-1]]=r[t[s]]=o;else{var o=r[n];this.lengthCount[o-1]++,this.codeLength[t[s-1]]=r[n]}}return e},t.reverseBits=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],t.huffCodeLengthOrders=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],t}(),p=function(){function t(){}return t.checksumUpdate=function(e,i,r,n){var s=new Uint32Array(1);s[0]=e;for(var o=s[0],h=s[0]=65535&o,a=s[0]=o>>t.checkSumBitOffset;n>0;){var f=Math.min(n,t.checksumIterationCount);for(n-=f;--f>=0;)a+=h+=s[0]=255&i[r++];h%=t.checksumBase,a%=t.checksumBase}return o=a<<t.checkSumBitOffset|h},t.checkSumBitOffset=16,t.checksumBase=65521,t.checksumIterationCount=3800,t}(),l=function(){function t(t){this.buildTree(t)}return t.init=function(){var e,i;for(e=new Uint8Array(288),i=0;i<144;)e[i++]=8;for(;i<256;)e[i++]=9;for(;i<280;)e[i++]=7;for(;i<288;)e[i++]=8;for(t.m_LengthTree=new t(e),e=new Uint8Array(32),i=0;i<32;)e[i++]=5;t.m_DistanceTree=new t(e)},t.prototype.prepareData=function(e,i,r){for(var n=0,s=512,o=0;o<r.length;o++){var h=r[o];h>0&&e[h]++}for(var a=1;a<=t.MAX_BITLEN;a++)i[a]=n,n+=e[a]<<16-a,a>=10&&(s+=(130944&n)-(130944&i[a])>>16-a);return{code:n,treeSize:s}},t.prototype.treeFromData=function(e,r,n,s,o){for(var h=new Int16Array(o),a=512,f=t.MAX_BITLEN;f>=10;f--)for(var u=130944&s,c=130944&(s-=e[f]<<16-f);c<u;c+=128)h[i.bitReverse(c)]=i.bitConverterInt32ToInt16(-a<<4|f),a+=1<<f-9;for(c=0;c<n.length;c++)if(0!=(f=n[c])){s=r[f];var d=i.bitReverse(s);if(f<=9)do{h[d]=i.bitConverterInt32ToInt16(c<<4|f),d+=1<<f}while(d<512);else{var p=h[511&d],l=1<<(15&p);p=-(p>>4);do{h[p|d>>9]=i.bitConverterInt32ToInt16(c<<4|f),d+=1<<f}while(d<l)}r[f]=s+(1<<16-f)}return h},t.prototype.buildTree=function(t){var e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=this.prepareData(e,i,t);this.m_Tree=this.treeFromData(e,i,t,r.code,r.treeSize)},t.prototype.unpackSymbol=function(t){var e,i;if((e=t.peekBits(9))>=0){if((i=this.m_Tree[e])>=0)return t.skipBits(15&i),i>>4;var r=-(i>>4),n=15&i;if((e=t.peekBits(n))>=0)return i=this.m_Tree[r|e>>9],t.skipBits(15&i),i>>4;s=t.availableBits;return e=t.peekBits(s),i=this.m_Tree[r|e>>9],(15&i)<=s?(t.skipBits(15&i),i>>4):-1}var s=t.availableBits;return e=t.peekBits(s),i=this.m_Tree[e],i>=0&&(15&i)<=s?(t.skipBits(15&i),i>>4):-1},Object.defineProperty(t,"lengthTree",{get:function(){return this.m_LengthTree},enumerable:!0,configurable:!0}),Object.defineProperty(t,"distanceTree",{get:function(){return this.m_DistanceTree},enumerable:!0,configurable:!0}),t.MAX_BITLEN=15,t}(),m=function(){function t(){}return t.ChecksumUpdate=function(t,e,i,r){for(var n=t,s=65535&n,o=n>>this.DEF_CHECKSUM_BIT_OFFSET;r>0;){var h=Math.min(r,this.DEF_CHECKSUM_ITERATIONSCOUNT);for(r-=h;--h>=0;)o+=s+=255&e[i++];s%=this.DEF_CHECKSUM_BASE,o%=this.DEF_CHECKSUM_BASE}t=n=o<<this.DEF_CHECKSUM_BIT_OFFSET|s},t.ChecksumGenerate=function(e,i,r){return t.ChecksumUpdate(1,e,i,r),1},t.DEF_CHECKSUM_BIT_OFFSET=16,t.DEF_CHECKSUM_BASE=65521,t.DEF_CHECKSUM_ITERATIONSCOUNT=3800,t}(),g=function(){function t(t,e){if(this.defaultHuffmanDynamicTree=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],this.DEF_HEADER_METHOD_MASK=3840,this.DEF_HEADER_INFO_MASK=61440,this.DEF_HEADER_FLAGS_FCHECK=31,this.DEF_HEADER_FLAGS_FDICT=32,this.DEF_HEADER_FLAGS_FLEVEL=192,this.DEF_MAX_WINDOW_SIZE=65535,this.DEF_HUFFMAN_REPEATE_MAX=258,this.DEF_HUFFMAN_END_BLOCK=256,this.DEF_HUFFMAN_LENGTH_MINIMUMCODE=257,this.DEF_HUFFMAN_LENGTH_MAXIMUMCODE=285,this.DEF_HUFFMAN_DISTANCE_MAXIMUMCODE=29,this.mCheckSum=1,this.tBuffer=0,this.mBufferedBits=0,this.mTempBuffer=new Uint8Array(4),this.mBlockBuffer=new Uint8Array(this.DEF_MAX_WINDOW_SIZE),this.mbNoWrap=!1,this.mWindowSize=0,this.mCurrentPosition=0,this.mDataLength=0,this.mbCanReadNextBlock=!0,this.mbCanReadMoreData=!0,this.mbCheckSumRead=!1,null==t)throw new DOMException("stream");if(0===t.length)throw new DOMException("stream - string can not be empty");l.init(),this.mInputStream=new B(t),this.mbNoWrap=e,this.mbNoWrap||this.readZLibHeader(),this.decodeBlockHeader()}return Object.defineProperty(t.prototype,"mBuffer",{get:function(){return this.tBuffer},set:function(t){this.tBuffer=t},enumerable:!0,configurable:!0}),t.prototype.peekBits=function(t){if(t<0)throw new DOMException("count","Bits count can not be less than zero.");if(t>32)throw new DOMException("count","Count of bits is too large.");if(this.mBufferedBits<t&&this.fillBuffer(),this.mBufferedBits<t)return-1;var e=~(4294967295<<t);return i.bitConverterUintToInt32(this.mBuffer&e)},t.prototype.fillBuffer=function(){var t=4-(this.mBufferedBits>>3)-(0!=(7&this.mBufferedBits)?1:0);if(0!==t)for(var e=this.mInputStream.read(this.mTempBuffer,0,t),r=0;r<e;r++)this.mBuffer=i.bitConverterInt32ToUint(this.mBuffer|i.bitConverterInt32ToUint(this.mTempBuffer[r]<<this.mBufferedBits)),this.mBufferedBits+=8},t.prototype.skipBits=function(t){if(t<0)throw new DOMException("count","Bits count can not be less than zero.");0!==t&&(t>=this.mBufferedBits?(t-=this.mBufferedBits,this.mBufferedBits=0,this.mBuffer=0,t>0&&(this.mInputStream.position+=t>>3,(t&=7)>0&&(this.fillBuffer(),this.mBufferedBits-=t,this.mBuffer=i.bitConverterInt32ToUint(this.mBuffer>>>t)))):(this.mBufferedBits-=t,this.mBuffer=i.bitConverterInt32ToUint(this.mBuffer>>>t)))},Object.defineProperty(t.prototype,"availableBits",{get:function(){return this.mBufferedBits},enumerable:!0,configurable:!0}),t.prototype.readZLibHeader=function(){var t=this.readInt16();if(-1===t)throw new DOMException("Header of the stream can not be read.");if(t%31!=0)throw new DOMException("Header checksum illegal");if(2048!=(t&this.DEF_HEADER_METHOD_MASK))throw new DOMException("Unsupported compression method.");if(this.mWindowSize=Math.pow(2,8+((t&this.DEF_HEADER_INFO_MASK)>>12)),this.mWindowSize>65535)throw new DOMException("Unsupported window size for deflate compression method.");if((t&this.DEF_HEADER_FLAGS_FDICT)>>5==1)throw new DOMException("Custom dictionary is not supported at the moment.")},t.prototype.readInt16=function(){var t=this.readBits(8)<<8;return t|=this.readBits(8)},t.prototype.readBits=function(t){var e=this.peekBits(t);return-1===e?-1:(this.mBufferedBits-=t,this.mBuffer=i.bitConverterInt32ToUint(this.mBuffer>>>t),e)},t.prototype.decodeBlockHeader=function(){if(!this.mbCanReadNextBlock)return!1;var t=this.readBits(1);if(-1===t)return!1;var e=this.readBits(2);if(-1===e)return!1;switch(this.mbCanReadNextBlock=0===t,e){case 0:this.mbReadingUncompressed=!0,this.skipToBoundary();var i=this.readInt16Inverted();if(i!==(65535^this.readInt16Inverted()))throw new DOMException("Wrong block length.");if(i>65535)throw new DOMException("Uncompressed block length can not be more than 65535.");this.mUncompressedDataLength=i,this.mCurrentLengthTree=null,this.mCurrentDistanceTree=null;break;case 1:this.mbReadingUncompressed=!1,this.mUncompressedDataLength=-1,this.mCurrentLengthTree=l.lengthTree,this.mCurrentDistanceTree=l.distanceTree;break;case 2:this.mbReadingUncompressed=!1,this.mUncompressedDataLength=-1;var r=this.decodeDynamicHeader(this.mCurrentLengthTree,this.mCurrentDistanceTree);this.mCurrentLengthTree=r.lengthTree,this.mCurrentDistanceTree=r.distanceTree;break;default:throw new DOMException("Wrong block type.")}return!0},t.prototype.skipToBoundary=function(){this.mBuffer=i.bitConverterInt32ToUint(this.mBuffer>>>(7&this.mBufferedBits)),this.mBufferedBits&=-8},t.prototype.readInt16Inverted=function(){var t=this.readBits(8);return t|=this.readBits(8)<<8},t.prototype.decodeDynamicHeader=function(e,i){var r=0,n=this.readBits(5),s=this.readBits(5),o=this.readBits(4);if(n<0||s<0||o<0)throw new DOMException("Wrong dynamic huffman codes.");var h=(n+=257)+(s+=1),a=new Uint8Array(h),f=new Uint8Array(19);o+=4;for(var u=0;u<o;){var c=this.readBits(3);if(c<0)throw new DOMException("Wrong dynamic huffman codes.");f[this.defaultHuffmanDynamicTree[u++]]=c}var d=new l(f);for(u=0;;){var p=void 0,m=!1;for(p=d.unpackSymbol(this);0==(-16&p);){if(a[u++]=r=p,u===h){m=!0;break}p=d.unpackSymbol(this)}if(m)break;if(p<0)throw new DOMException("Wrong dynamic huffman codes.");if(p>=17)r=0;else if(0===u)throw new DOMException("Wrong dynamic huffman codes.");var g=p-16,B=t.DEF_HUFFMAN_DYNTREE_REPEAT_BITS[g],v=this.readBits(B);if(v<0)throw new DOMException("Wrong dynamic huffman codes.");if(v+=t.DEF_HUFFMAN_DYNTREE_REPEAT_MINIMUMS[g],u+v>h)throw new DOMException("Wrong dynamic huffman codes.");for(;v-- >0;)a[u++]=r;if(u===h)break}var w=new Uint8Array(n);return w.set(a.subarray(0,n),0),e=new l(w),w=a.slice(n,n+s),i=new l(w),{lengthTree:e,distanceTree:i}},t.prototype.readHuffman=function(){for(var e=this.DEF_MAX_WINDOW_SIZE-(this.mDataLength-this.mCurrentPosition),i=!1,r={};e>=this.DEF_HUFFMAN_REPEATE_MAX;){var n=void 0;for(n=this.mCurrentLengthTree.unpackSymbol(this);0==(-256&n);){if(r[(this.mDataLength+1)%this.DEF_MAX_WINDOW_SIZE]=n,this.mBlockBuffer[this.mDataLength++%this.DEF_MAX_WINDOW_SIZE]=n,i=!0,--e<this.DEF_HUFFMAN_REPEATE_MAX)return!0;n=this.mCurrentLengthTree.unpackSymbol(this)}if(n<this.DEF_HUFFMAN_LENGTH_MINIMUMCODE){if(n<this.DEF_HUFFMAN_END_BLOCK)throw new DOMException("Illegal code.");var s=i?1:0;return this.mbCanReadMoreData=this.decodeBlockHeader(),!!(s|(this.mbCanReadMoreData?1:0))}if(n>this.DEF_HUFFMAN_LENGTH_MAXIMUMCODE)throw new DOMException("Illegal repeat code length.");var o=t.DEF_HUFFMAN_REPEAT_LENGTH_BASE[n-this.DEF_HUFFMAN_LENGTH_MINIMUMCODE],h=t.DEF_HUFFMAN_REPEAT_LENGTH_EXTENSION[n-this.DEF_HUFFMAN_LENGTH_MINIMUMCODE];if(h>0){if((f=this.readBits(h))<0)throw new DOMException("Wrong data.");o+=f}if((n=this.mCurrentDistanceTree.unpackSymbol(this))<0||n>t.DEF_HUFFMAN_REPEAT_DISTANCE_BASE.length)throw new DOMException("Wrong distance code.");var a=t.DEF_HUFFMAN_REPEAT_DISTANCE_BASE[n];if((h=t.DEF_HUFFMAN_REPEAT_DISTANCE_EXTENSION[n])>0){var f=this.readBits(h);if(f<0)throw new DOMException("Wrong data.");a+=f}for(var u=0;u<o;u++)this.mBlockBuffer[this.mDataLength%this.DEF_MAX_WINDOW_SIZE]=this.mBlockBuffer[(this.mDataLength-a)%this.DEF_MAX_WINDOW_SIZE],this.mDataLength++,e--;i=!0}return i},t.prototype.read=function(t,e,r){if(null==t)throw new DOMException("buffer");if(e<0||e>t.length-1)throw new DOMException("offset","Offset does not belong to specified buffer.");if(r<0||r>t.length-e)throw new DOMException("length","Length is illegal.");for(var n=r;r>0;)if(this.mCurrentPosition<this.mDataLength){var s=this.mCurrentPosition%this.DEF_MAX_WINDOW_SIZE,o=Math.min(this.DEF_MAX_WINDOW_SIZE-s,this.mDataLength-this.mCurrentPosition);o=Math.min(o,r),i.arrayCopy(this.mBlockBuffer,s,t,e,o),this.mCurrentPosition+=o,e+=o,r-=o}else{if(!this.mbCanReadMoreData)break;var h=this.mDataLength;if(this.mbReadingUncompressed)if(0===this.mUncompressedDataLength){if(this.mbCanReadMoreData=this.decodeBlockHeader(),!this.mbCanReadMoreData)break}else{var s=this.mDataLength%this.DEF_MAX_WINDOW_SIZE,a=Math.min(this.mUncompressedDataLength,this.DEF_MAX_WINDOW_SIZE-s),f=this.readPackedBytes(this.mBlockBuffer,s,a);if(a!==f)throw new DOMException("Not enough data in stream.");this.mUncompressedDataLength-=f,this.mDataLength+=f}else if(!this.readHuffman())break;if(h<this.mDataLength){var u=h%this.DEF_MAX_WINDOW_SIZE,c=this.mDataLength%this.DEF_MAX_WINDOW_SIZE;u<c?this.checksumUpdate(this.mBlockBuffer,u,c-u):(this.checksumUpdate(this.mBlockBuffer,u,this.DEF_MAX_WINDOW_SIZE-u),c>0&&this.checksumUpdate(this.mBlockBuffer,0,c))}}if(!this.mbCanReadMoreData&&!this.mbCheckSumRead&&!this.mbNoWrap){if(this.skipToBoundary(),this.readInt32()!==this.mCheckSum)throw new DOMException("Checksum check failed.");this.mbCheckSumRead=!0}return n-r},t.prototype.readPackedBytes=function(t,e,r){if(null==t)throw new DOMException("buffer");if(e<0||e>t.length-1)throw new DOMException('offset", "Offset can not be less than zero or greater than buffer length - 1.');if(r<0)throw new DOMException('length", "Length can not be less than zero.');if(r>t.length-e)throw new DOMException('length", "Length is too large.');if(0!=(7&this.mBufferedBits))throw new DOMException("Reading of unalligned data is not supported.");if(0===r)return 0;for(var n=0;this.mBufferedBits>0&&r>0;)t[e++]=this.mBuffer,this.mBufferedBits-=8,this.mBuffer=i.bitConverterInt32ToUint(this.mBuffer>>>8),r--,n++;return r>0&&(n+=this.mInputStream.read(t,e,r)),n},t.prototype.readInt32=function(){var t=this.readBits(8)<<24;return t|=this.readBits(8)<<16,t|=this.readBits(8)<<8,t|=this.readBits(8)},t.prototype.checksumUpdate=function(t,e,i){m.ChecksumUpdate(this.mCheckSum,t,e,i)},t.DEF_REVERSE_BITS=new Uint8Array([0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15]),t.DEF_HUFFMAN_DYNTREE_REPEAT_MINIMUMS=[3,3,11],t.DEF_HUFFMAN_DYNTREE_REPEAT_BITS=[2,3,7],t.DEF_HUFFMAN_REPEAT_LENGTH_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],t.DEF_HUFFMAN_REPEAT_LENGTH_EXTENSION=[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],t.DEF_HUFFMAN_REPEAT_DISTANCE_BASE=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],t.DEF_HUFFMAN_REPEAT_DISTANCE_EXTENSION=[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],t}(),B=function(){function t(t){this.position=0,this.inputStream=new Uint8Array(t.buffer)}return Object.defineProperty(t.prototype,"length",{get:function(){return this.inputStream.buffer.byteLength},enumerable:!0,configurable:!0}),t.prototype.read=function(t,e,i){var r=new Uint8Array(this.inputStream.buffer,this.position+e).subarray(0,i);return t.set(r,0),this.position+=r.byteLength,r.byteLength},t.prototype.readByte=function(){return this.inputStream[this.position++]},t.prototype.write=function(t,e,r){i.arrayCopy(t,0,this.inputStream,this.position+e,r),this.position+=r},t.prototype.toByteArray=function(){return new Uint8Array(this.inputStream.buffer)},t}();return t.ChecksumCalculator=p,t.CompressedStreamReader=g,t.CompressedStreamWriter=c,t.CompressorHuffmanTree=d,t.DecompressorHuffmanTree=l,t.Stream=B,t.Utils=i,t.ZipArchive=n,t.ZipArchiveItem=o,t.ZipArchiveItemHelper=s,t}({},ej.fileutils),this.ejs=ej;
//# sourceMappingURL=ej2-compression.min.js.map
/*!
* filename: index.d.ts
* version : 25.2.3
* version : 26.1.35
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.

@@ -5,0 +5,0 @@ * Use of this code is subject to the terms of our license.

@@ -5,3 +5,3 @@ {

"_inBundle": false,
"_integrity": "sha512-Uj121Sywj1hRMGvViO3wp/W+9g9cgwIPTr5otcof0emm+JjqGUtdFci5ZTR2o3lRoGfbX7FMG11ozCgC1yXLzg==",
"_integrity": "sha512-9qdlzzw6UbwWuBGVmUxNOYHU2fhq7rveS0CT+VTkHmUShkJqNAvBvYi1bPbN0KT6nRUl0H8X9ir2+0aoKgeSJw==",
"_location": "/@syncfusion/ej2-compression",

@@ -34,6 +34,6 @@ "_phantomChildren": {},

],
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-compression/-/ej2-compression-0.17.0.tgz",
"_shasum": "9fe322dc1d42c06920fc8e7dc269485dc8bf1f33",
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-release/@syncfusion/ej2-compression/-/ej2-compression-0.17.0.tgz",
"_shasum": "caba943061b2602b527ad7f38e0a9f3d3e49666f",
"_spec": "@syncfusion/ej2-compression@*",
"_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
"_where": "/jenkins/workspace/elease-automation_release_26.1.1/packages/included",
"author": {

@@ -44,3 +44,3 @@ "name": "Syncfusion Inc."

"dependencies": {
"@syncfusion/ej2-file-utils": "~25.2.3"
"@syncfusion/ej2-file-utils": "~26.1.35"
},

@@ -56,5 +56,5 @@ "deprecated": false,

"typings": "index.d.ts",
"version": "25.2.3",
"version": "26.1.35",
"sideEffects": false,
"homepage": "https://www.syncfusion.com/javascript-ui-controls"
}

@@ -1,1 +0,1 @@

A common package of Essential JS 2 compression libraries, methods and class definitions.
A common package of Essential JS 2 compression libraries, methods and class definitions.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc