>>=_=w>>>24,p-=_,0===(_=w>>>16&255))A[a++]=65535&w;else{if(!(16&_)){if(0==(64&_)){w=m[(65535&w)+(d&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}b=65535&w,(_&=15)&&(p<_&&(d+=E[n++]<>>=_,p-=_),p<15&&(d+=E[n++]<
>>=_=w>>>24,p-=_,!(16&(_=w>>>16&255))){if(0==(64&_)){w=g[(65535&w)+(d&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&w,p<(_&=15)&&(d+=E[n++]<
h){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=_,p-=_,k>(_=a-o)){if((_=k-_)>f&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(x=0,S=c,0===l){if(x+=u-_,_2;)A[a++]=S[x++],A[a++]=S[x++],A[a++]=S[x++],b-=3;b&&(A[a++]=S[x++],b>1&&(A[a++]=S[x++]))}else{x=a-k;do{A[a++]=A[x++],A[a++]=A[x++],A[a++]=A[x++],b-=3}while(b>2);b&&(A[a++]=A[x++],b>1&&(A[a++]=A[x++]))}break}}break}}while(n>3,d&=(1<<(p-=b<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n=1&&0===T[b];b--);if(k>b&&(k=b),0===b)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(_=1;_0&&(0===e||1!==b))return-1;for(B[1]=0,y=1;y<15;y++)B[y+1]=B[y]+T[y];for(w=0;w852||2===e&&A>592)return 1;for(;;){p=y-S,o[w]d?(m=O[I+o[w]],g=R[z+o[w]]):(m=96,g=0),h=1<>S)+(u-=h)]=p<<24|m<<16|g|0}while(0!==u);for(h=1<>=1;if(0!==h?(C&=h-1,C+=h):C=0,w++,0==--T[y]){if(y===b)break;y=t[r+o[w]]}if(y>k&&(C&l)!==f){for(0===S&&(S=k),c+=_,E=1<<(x=y-S);x+S852||2===e&&A>592)return 1;i[f=C&l]=k<<24|x<<16|c-a|0}}return 0!==C&&(i[c+C]=y-S<<24|64<<16|0),s.bits=k,0},no=0,io=1,ao=2,oo=4,so=5,ho=6,uo=0,fo=1,lo=2,co=-2,po=-3,mo=-4,go=-5,vo=8,yo=1,wo=2,_o=3,bo=4,ko=5,xo=6,So=7,Eo=8,Ao=9,Co=10,Ro=11,zo=12,To=13,Bo=14,Oo=15,Io=16,Lo=17,Po=18,Uo=19,Do=20,Mo=21,jo=22,Fo=23,No=24,Zo=25,Wo=26,Yo=27,qo=28,Ho=29,Ko=30,Xo=31,Vo=32,Go=852,Jo=592,$o=15;function Qo(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function es(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=yo,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Cn.Buf32(Go),t.distcode=t.distdyn=new Cn.Buf32(Jo),t.sane=1,t.back=-1,uo):co}function ts(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,es(e)):co}function rs(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?co:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,ts(e))):co}function ns(e,t){var r,n;return e?(n=new function(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Cn.Buf16(320),this.work=new Cn.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0},e.state=n,n.window=null,(r=rs(e,t))!==uo&&(e.state=null),r):co}var is,as,os=!0;function ss(e){if(os){var t;for(is=new Cn.Buf32(512),as=new Cn.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ro(io,e.lens,0,288,is,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ro(ao,e.lens,0,32,as,0,e.work,{bits:5}),os=!1}e.lencode=is,e.lenbits=9,e.distcode=as,e.distbits=5}function hs(e,t,r,n){var i,a=e.state;return null===a.window&&(a.wsize=1<=a.wsize?(Cn.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>n&&(i=n),Cn.arraySet(a.window,t,r-n,i,a.wnext),(n-=i)?(Cn.arraySet(a.window,t,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=Ti(r.check,C,2,0),u=0,f=0,r.mode=wo;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=Ko;break}if((15&u)!==vo){e.msg="unknown compression method",r.mode=Ko;break}if(f-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=Ko;break}r.dmax=1<>8&1),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=Ti(r.check,C,2,0)),u=0,f=0,r.mode=_o;case _o:for(;f<32;){if(0===s)break e;s--,u+=n[a++]<>>8&255,C[2]=u>>>16&255,C[3]=u>>>24&255,r.check=Ti(r.check,C,4,0)),u=0,f=0,r.mode=bo;case bo:for(;f<16;){if(0===s)break e;s--,u+=n[a++]<>8),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=Ti(r.check,C,2,0)),u=0,f=0,r.mode=ko;case ko:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,u+=n[a++]<>>8&255,r.check=Ti(r.check,C,2,0)),u=0,f=0}else r.head&&(r.head.extra=null);r.mode=xo;case xo:if(1024&r.flags&&((d=r.length)>s&&(d=s),d&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Cn.arraySet(r.head.extra,n,a,d,k)),512&r.flags&&(r.check=Ti(r.check,n,d,a)),s-=d,a+=d,r.length-=d),r.length))break e;r.length=0,r.mode=So;case So:if(2048&r.flags){if(0===s)break e;d=0;do{k=n[a+d++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k))}while(k&&d>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=zo;break;case Co:for(;f<32;){if(0===s)break e;s--,u+=n[a++]<>>=7&f,f-=7&f,r.mode=Yo;break}for(;f<3;){if(0===s)break e;s--,u+=n[a++]<>>=1)){case 0:r.mode=Bo;break;case 1:if(ss(r),r.mode=Do,t===ho){u>>>=2,f-=2;break e}break;case 2:r.mode=Lo;break;case 3:e.msg="invalid block type",r.mode=Ko}u>>>=2,f-=2;break;case Bo:for(u>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,u+=n[a++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=Ko;break}if(r.length=65535&u,u=0,f=0,r.mode=Oo,t===ho)break e;case Oo:r.mode=Io;case Io:if(d=r.length){if(d>s&&(d=s),d>h&&(d=h),0===d)break e;Cn.arraySet(i,n,a,d,o),s-=d,a+=d,h-=d,o+=d,r.length-=d;break}r.mode=zo;break;case Lo:for(;f<14;){if(0===s)break e;s--,u+=n[a++]<>>=5,f-=5,r.ndist=1+(31&u),u>>>=5,f-=5,r.ncode=4+(15&u),u>>>=4,f-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Ko;break}r.have=0,r.mode=Po;case Po:for(;r.have>>=3,f-=3}for(;r.have<19;)r.lens[R[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=ro(no,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=Ko;break}r.have=0,r.mode=Uo;case Uo:for(;r.have>>16&255,y=65535&A,!((g=A>>>24)<=f);){if(0===s)break e;s--,u+=n[a++]<>>=g,f-=g,r.lens[r.have++]=y;else{if(16===y){for(E=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=Ko;break}k=r.lens[r.have-1],d=3+(3&u),u>>>=2,f-=2}else if(17===y){for(E=g+3;f>>=g)),u>>>=3,f-=3}else{for(E=g+7;f>>=g)),u>>>=7,f-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Ko;break}for(;d--;)r.lens[r.have++]=k}}if(r.mode===Ko)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=Ko;break}if(r.lenbits=9,S={bits:r.lenbits},x=ro(io,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=Ko;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=ro(ao,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=Ko;break}if(r.mode=Do,t===ho)break e;case Do:r.mode=Mo;case Mo:if(s>=6&&h>=258){e.next_out=o,e.avail_out=h,e.next_in=a,e.avail_in=s,r.hold=u,r.bits=f,Ja(e,c),o=e.next_out,i=e.output,h=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,u=r.hold,f=r.bits,r.mode===zo&&(r.back=-1);break}for(r.back=0;v=(A=r.lencode[u&(1<>>16&255,y=65535&A,!((g=A>>>24)<=f);){if(0===s)break e;s--,u+=n[a++]<>w)])>>>16&255,y=65535&A,!(w+(g=A>>>24)<=f);){if(0===s)break e;s--,u+=n[a++]<>>=w,f-=w,r.back+=w}if(u>>>=g,f-=g,r.back+=g,r.length=y,0===v){r.mode=Wo;break}if(32&v){r.back=-1,r.mode=zo;break}if(64&v){e.msg="invalid literal/length code",r.mode=Ko;break}r.extra=15&v,r.mode=jo;case jo:if(r.extra){for(E=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Fo;case Fo:for(;v=(A=r.distcode[u&(1<>>16&255,y=65535&A,!((g=A>>>24)<=f);){if(0===s)break e;s--,u+=n[a++]<>w)])>>>16&255,y=65535&A,!(w+(g=A>>>24)<=f);){if(0===s)break e;s--,u+=n[a++]<>>=w,f-=w,r.back+=w}if(u>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=Ko;break}r.offset=y,r.extra=15&v,r.mode=No;case No:if(r.extra){for(E=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Ko;break}r.mode=Zo;case Zo:if(0===h)break e;if(d=c-h,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Ko;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=i,p=o-r.offset,d=r.length;d>h&&(d=h),h-=d,r.length-=d;do{i[o++]=m[p++]}while(--d);0===r.length&&(r.mode=Mo);break;case Wo:if(0===h)break e;i[o++]=r.length,h--,r.mode=Mo;break;case Yo:if(r.wrap){for(;f<32;){if(0===s)break e;s--,u|=n[a++]<=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Za,this.strm.avail_out=0;var r=us.inflateInit2(this.strm,t.windowBits);if(r!==fs.Z_OK)throw new Error(Bi[r]);this.header=new ls,us.inflateGetHeader(this.strm,this.header)}function ps(e,t){var r=new ds(t);if(r.push(e,!0),r.err)throw r.msg||Bi[r.err];return r.result}ds.prototype.push=function(e,t){var r,n,i,a,o,s,h=this.strm,u=this.options.chunkSize,f=this.options.dictionary,l=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?fs.Z_FINISH:fs.Z_NO_FLUSH,"string"==typeof e?h.input=Na.binstring2buf(e):"[object ArrayBuffer]"===cs.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new Cn.Buf8(u),h.next_out=0,h.avail_out=u),(r=us.inflate(h,fs.Z_NO_FLUSH))===fs.Z_NEED_DICT&&f&&(s="string"==typeof f?Na.string2buf(f):"[object ArrayBuffer]"===cs.call(f)?new Uint8Array(f):f,r=us.inflateSetDictionary(this.strm,s)),r===fs.Z_BUF_ERROR&&!0===l&&(r=fs.Z_OK,l=!1),r!==fs.Z_STREAM_END&&r!==fs.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==fs.Z_STREAM_END&&(0!==h.avail_in||n!==fs.Z_FINISH&&n!==fs.Z_SYNC_FLUSH)||("string"===this.options.to?(i=Na.utf8border(h.output,h.next_out),a=h.next_out-i,o=Na.buf2string(h.output,i),h.next_out=a,h.avail_out=u-a,a&&Cn.arraySet(h.output,h.output,i,a,0),this.onData(o)):this.onData(Cn.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(l=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==fs.Z_STREAM_END);return r===fs.Z_STREAM_END&&(n=fs.Z_FINISH),n===fs.Z_FINISH?(r=us.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===fs.Z_OK):n!==fs.Z_SYNC_FLUSH||(this.onEnd(fs.Z_OK),h.avail_out=0,!0)},ds.prototype.onData=function(e){this.chunks.push(e)},ds.prototype.onEnd=function(e){e===fs.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Cn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ms={Inflate:ds,inflate:ps,inflateRaw:function(e,t){return(t=t||{}).raw=!0,ps(e,t)},ungzip:ps},gs={};(0,Cn.assign)(gs,Ga,ms,fs);var vs=gs,ys="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array?"uint8array":"array";function ws(e,t){Qr.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}Jr.inherits(ws,Qr),ws.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(Jr.transformTo(ys,e.data),!1)},ws.prototype.flush=function(){Qr.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},ws.prototype.cleanUp=function(){Qr.prototype.cleanUp.call(this),this._pako=null},ws.prototype._createPako=function(){this._pako=new vs[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}};var _s={STORE:{magic:"\0\0",compressWorker:function(e){return new Qr("STORE compression")},uncompressWorker:function(){return new Qr("STORE decompression")}},DEFLATE:{magic:"\b\0",compressWorker:function(e){return new ws("Deflate",e)},uncompressWorker:function(){return new ws("Inflate",{})}}},bs="PK",ks="PK",xs="PK",Ss="PK",Es="PK",As="PK\b",Cs=function(e,t){var r,n="";for(r=0;r>>=8;return n},Rs=function(e,t,r,n,i,a){var o,s,h=e.file,u=e.compression,f=a!==en.utf8encode,l=Jr.transformTo("string",a(h.name)),c=Jr.transformTo("string",en.utf8encode(h.name)),d=h.comment,p=Jr.transformTo("string",a(d)),m=Jr.transformTo("string",en.utf8encode(d)),g=c.length!==h.name.length,v=m.length!==d.length,y="",w="",_="",b=h.dir,k=h.date,x={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(x.crc32=e.crc32,x.compressedSize=e.compressedSize,x.uncompressedSize=e.uncompressedSize);var S=0;t&&(S|=8),f||!g&&!v||(S|=2048);var E,A,C=0,R=0;b&&(C|=16),"UNIX"===i?(R=798,C|=(E=h.unixPermissions,A=E,E||(A=b?16893:33204),(65535&A)<<16)):(R=20,C|=63&(h.dosPermissions||0)),o=k.getUTCHours(),o<<=6,o|=k.getUTCMinutes(),o<<=5,o|=k.getUTCSeconds()/2,s=k.getUTCFullYear()-1980,s<<=4,s|=k.getUTCMonth()+1,s<<=5,s|=k.getUTCDate(),g&&(w=Cs(1,1)+Cs(vn(l),4)+c,y+="up"+Cs(w.length,2)+w),v&&(_=Cs(1,1)+Cs(vn(p),4)+m,y+="uc"+Cs(_.length,2)+_);var z="";return z+="\n\0",z+=Cs(S,2),z+=u.magic,z+=Cs(o,2),z+=Cs(s,2),z+=Cs(x.crc32,4),z+=Cs(x.compressedSize,4),z+=Cs(x.uncompressedSize,4),z+=Cs(l.length,2),z+=Cs(y.length,2),{fileRecord:bs+z+l+y,dirRecord:ks+Cs(R,2)+z+Cs(p.length,2)+"\0\0\0\0"+Cs(C,4)+Cs(n,4)+l+y+p}};function zs(e,t,r,n){Qr.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}Jr.inherits(zs,Qr),zs.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,Qr.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},zs.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=Rs(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},zs.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=Rs(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return As+Cs(e.crc32,4)+Cs(e.compressedSize,4)+Cs(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},zs.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t0?e.substring(0,t):""},Us=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},Ds=function(e,t){return t=void 0!==t?t:ln.createFolders,e=Us(e),this.files[e]||Ls.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function Ms(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var js={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,n;for(t in this.files)this.files.hasOwnProperty(t)&&(n=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,n))},filter:function(e){var t=[];return this.forEach(function(r,n){e(r,n)&&t.push(n)}),t},file:function(e,t,r){if(1===arguments.length){if(Ms(e)){var n=e;return this.filter(function(e,t){return!t.dir&&n.test(e)})}var i=this.files[this.root+e];return i&&!i.dir?i:null}return e=this.root+e,Ls.call(this,e,t,r),this},folder:function(e){if(!e)return this;if(Ms(e))return this.filter(function(t,r){return r.dir&&e.test(t)});var t=this.root+e,r=Ds.call(this,t),n=this.clone();return n.root=r.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter(function(t,r){return r.name.slice(0,e.length)===e}),n=0;n=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return Jr.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}};var Ns=Fs;function Zs(e){Ns.call(this,e);for(var t=0;t=0;--a)if(this.data[a]===t&&this.data[a+1]===r&&this.data[a+2]===n&&this.data[a+3]===i)return a-this.zero;return-1},Zs.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&r===a[1]&&n===a[2]&&i===a[3]},Zs.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Ws=Zs;function Ys(e){Ns.call(this,e)}Jr.inherits(Ys,Ns),Ys.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},Ys.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},Ys.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},Ys.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var qs=Ys;function Hs(e){Ws.call(this,e)}Jr.inherits(Hs,Ws),Hs.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Ks=Hs;function Xs(e){Ks.call(this,e)}Jr.inherits(Xs,Ks),Xs.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Vs=Xs,Gs=function(e){var t=Jr.getTypeOf(e);return Jr.checkSupport(t),"string"!==t||Zt.uint8array?"nodebuffer"===t?new Vs(e):Zt.uint8array?new Ks(Jr.transformTo("uint8array",e)):new Ws(Jr.transformTo("array",e)):new qs(e)};function Js(e,t){this.options=e,this.loadOptions=t}Js.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in _s)if(_s.hasOwnProperty(t)&&_s[t].magic===e)return _s[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+Jr.pretty(this.compressionMethod)+" unknown (inner file : "+Jr.transformTo("string",this.fileName)+")");this.decompressed=new bn(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===e&&(this.dosPermissions=63&this.externalFileAttributes),3===e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=Gs(this.extraFields[1].value);this.uncompressedSize===Jr.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===Jr.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===Jr.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===Jr.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e0)this.isSignature(t,ks)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=Gs(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};var eh=Qs;function th(e){return new Gr.Promise(function(t,r){var n=e.decompressed.getContentWorker().pipe(new wn);n.on("error",function(e){r(e)}).on("end",function(){n.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t()}).resume()})}function rh(){if(!(this instanceof rh))return new rh;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var e=new rh;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}rh.prototype=js,rh.prototype.loadAsync=function(e,t){var r=this;return t=Jr.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:en.utf8decode}),qt&&Vt(e)?Gr.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):Jr.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(e){var r=new eh(t);return r.load(e),r}).then(function(e){var r=[Gr.Promise.resolve(e)],n=e.files;if(t.checkCRC32)for(var i=0;i=t.status}function i(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof t&&t.global===t?t:void 0,o=a.saveAs||"object"!=typeof window||window!==a?function(){}:"download"in HTMLAnchorElement.prototype?function(e,t,o){var s=a.URL||a.webkitURL,h=document.createElement("a");t=t||e.name||"download",h.download=t,h.rel="noopener","string"==typeof e?(h.href=e,h.origin===location.origin?i(h):n(h.href)?r(e,t,o):i(h,h.target="_blank")):(h.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(h.href)},4e4),setTimeout(function(){i(h)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,a){if(t=t||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Depricated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,a),t);else if(n(e))r(e,t,a);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){i(o)})}}:function(e,t,n,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof e)return r(e,t,n);var o="application/octet-stream"===e.type,s=/constructor/i.test(a.HTMLElement)||a.safari,h=/CriOS\/[\d]+/.test(navigator.userAgent);if((h||o&&s)&&"object"==typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=h?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var f=a.URL||a.webkitURL,l=f.createObjectURL(e);i?i.location=l:location.href=l,i=null,setTimeout(function(){f.revokeObjectURL(l)},4e4)}};a.saveAs=o.saveAs=o,e.exports=o})()}),ah=["string","number"],oh=function(e){return e.filename?"string"!=typeof e.filename?(console.error("Zipclex filename can only be of type string"),!1):Array.isArray(e.sheet.data)?!!e.sheet.data.every(function(e){return Array.isArray(e)})||(console.error("Zipclex sheet data childs is not of type array"),!1):(console.error("Zipcelx sheet data is not of type array"),!1):(console.error("Zipclex config missing property filename"),!1)},sh=1/0,hh="[object Symbol]",uh=/[&<>"'`]/g,fh=RegExp(uh.source),lh="object"==typeof t&&t&&t.Object===Object&&t,ch="object"==typeof self&&self&&self.Object===Object&&self,dh=lh||ch||Function("return this")();var ph=function(e){return function(t){return null==e?void 0:e[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"}),mh=Object.prototype.toString,gh=dh.Symbol,vh=gh?gh.prototype:void 0,yh=vh?vh.toString:void 0;function wh(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&mh.call(e)==hh}(e))return yh?yh.call(e):"";var t=e+"";return"0"==t&&1/e==-sh?"-0":t}var _h=function(e){var t;return(e=null==(t=e)?"":wh(t))&&fh.test(e)?e.replace(uh,ph):e},bh=function(e,t){return""+function e(t){if("number"!=typeof t)return"";var r=Math.floor(t/26),n=String.fromCharCode(97+t%26).toUpperCase();return 0===r?n:e(r-1)+n}(e)+t},kh=function(e,t,r){return-1===ah.indexOf(e.type)&&(console.warn('Invalid type supplied in cell config, falling back to "string"'),e.type="string"),"string"===e.type?function(e,t,r){return''+_h(t)+""}(t,e.value,r):function(e,t,r){return''+t+""}(t,e.value,r)},xh=function(e){return e.map(function(e,t){return function(e,t){var r=t+1,n=e.map(function(e,t){return kh(e,t,r)}).join("");return''+n+"
"}(e,t)}).join("")};e.zipcelx=function(e){if(!oh(e))throw new Error("Validation failed.");var t=new nh,r=t.folder("xl");r.file("workbook.xml",'\n'),r.file("_rels/workbook.xml.rels",'\n\n\n'),t.file("_rels/.rels",'\n'),t.file("[Content_Types].xml",'\n\n\n\n\n\n');var n,i,a=(n=e.sheet.data,i=xh(n),'\n{placeholder}'.replace("{placeholder}",i));return r.file("worksheets/sheet1.xml",a),t.generateAsync({type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}).then(function(t){ih.saveAs(t,e.filename+".xlsx")})}});
diff --git a/package.json b/package.json
index e48e74e..b61e36d 100644
--- a/package.json
+++ b/package.json
@@ -45,6 +45,7 @@
"jest": "^22.4.2",
"rimraf": "^2.6.2",
"rollup": "^0.56.4",
+ "rollup-plugin-babel": "^3.0.7",
"rollup-plugin-commonjs": "^8.4.0",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-node-globals": "^1.1.0",
diff --git a/rollup.config.js b/rollup.config.js
index ae94168..4c7f959 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -1,3 +1,4 @@
+import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import builtins from 'rollup-plugin-node-builtins';
import globals from 'rollup-plugin-node-globals';
@@ -5,6 +6,14 @@ import resolve from 'rollup-plugin-node-resolve';
import uglify from 'rollup-plugin-uglify';
import pkg from './package.json';
+function instantiateBabelPlugin() {
+ return babel({
+ babelrc: false,
+ exclude: 'node_modules/**',
+ presets: [['env', { modules: false }]]
+ });
+}
+
export default [
// browser-friendly UMD build
{
@@ -27,6 +36,7 @@ export default [
}),
globals(),
builtins(),
+ instantiateBabelPlugin(),
uglify()
]
},
@@ -44,6 +54,7 @@ export default [
{ file: pkg.main, format: 'cjs' }
],
plugins: [
+ instantiateBabelPlugin(),
uglify()
]
},
@@ -52,6 +63,9 @@ export default [
external: Object.keys(pkg.dependencies),
output: [
{ file: pkg.module, format: 'es' }
+ ],
+ plugins: [
+ instantiateBabelPlugin()
]
}
];
diff --git a/yarn.lock b/yarn.lock
index 500bfad..cd29d87 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4126,6 +4126,13 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
hash-base "^2.0.0"
inherits "^2.0.1"
+rollup-plugin-babel@^3.0.7:
+ version "3.0.7"
+ resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-3.0.7.tgz#5b13611f1ab8922497e9d15197ae5d8a23fe3b1e"
+ integrity sha512-bVe2y0z/V5Ax1qU8NX/0idmzIwJPdUGu8Xx3vXH73h0yGjxfv2gkFI82MBVg49SlsFlLTBadBHb67zy4TWM3hA==
+ dependencies:
+ rollup-pluginutils "^1.5.0"
+
rollup-plugin-commonjs@^8.4.0:
version "8.4.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.4.0.tgz#07c3b5a7555171a58cf3b376b812013de8a631e4"
@@ -4169,7 +4176,7 @@ rollup-plugin-uglify@^3.0.0:
dependencies:
uglify-es "^3.3.7"
-rollup-pluginutils@^1.5.2:
+rollup-pluginutils@^1.5.0, rollup-pluginutils@^1.5.2:
version "1.5.2"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408"
dependencies: