var B=Uint8Array,Q=Uint16Array,kr=Int32Array,or=new B([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,0,0,0]),ur=new B([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,0,0]),gr=new B([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Sr=function(r,a){for(var n=new Q(31),e=0;e<31;++e)n[e]=a+=1<>1|(g&21845)<<1;L=(L&52428)>>2|(L&13107)<<2,L=(L&61680)>>4|(L&3855)<<4,xr[g]=((L&65280)>>8|(L&255)<<8)>>1}var Z=function(r,a,n){for(var e=r.length,v=0,f=new Q(a);v>t]=F}else for(w=new Q(e),v=0;v>15-r[v]);return w},m=new B(288);for(var g=0;g<144;++g)m[g]=8;for(var g=144;g<256;++g)m[g]=9;for(var g=256;g<280;++g)m[g]=7;for(var g=280;g<288;++g)m[g]=8;var fr=new B(32);for(var g=0;g<32;++g)fr[g]=5;var Gr=Z(m,9,0),Hr=Z(m,9,1),Jr=Z(fr,5,0),Kr=Z(fr,5,1),hr=function(r){for(var a=r[0],n=1;na&&(a=r[n]);return a},W=function(r,a,n){var e=a/8|0;return(r[e]|r[e+1]<<8)>>(a&7)&n},wr=function(r,a){var n=a/8|0;return(r[n]|r[n+1]<<8|r[n+2]<<16)>>(a&7)},Fr=function(r){return(r+7)/8|0},Ur=function(r,a,n){return(a==null||a<0)&&(a=0),(n==null||n>r.length)&&(n=r.length),new B(r.subarray(a,n))},Nr=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],X=function(r,a,n){var e=new Error(a||Nr[r]);if(e.code=r,Error.captureStackTrace&&Error.captureStackTrace(e,X),!n)throw e;return e},Pr=function(r,a,n,e){var v=r.length,f=e?e.length:0;if(!v||a.f&&!a.l)return n||new B(0);var o=!n,w=o||a.i!=2,t=a.i;o&&(n=new B(v*3));var F=function(ar){var nr=n.length;if(ar>nr){var d=new B(Math.max(nr*2,ar));d.set(n),n=d}},i=a.f||0,l=a.p||0,c=a.b||0,M=a.l,E=a.d,x=a.m,D=a.n,V=v*8;do{if(!M){i=W(r,l,1);var J=W(r,l+1,3);if(l+=3,J)if(J==1)M=Hr,E=Kr,x=9,D=5;else if(J==2){var O=W(r,l,31)+257,A=W(r,l+10,15)+4,h=O+W(r,l+5,31)+1;l+=14;for(var u=new B(h),S=new B(19),y=0;y>4;if(z<16)u[y++]=z;else{var T=0,b=0;for(z==16?(b=3+W(r,l,3),l+=2,T=u[y-1]):z==17?(b=3+W(r,l,7),l+=3):z==18&&(b=11+W(r,l,127),l+=7);b--;)u[y++]=T}}var H=u.subarray(0,O),C=u.subarray(O);x=hr(H),D=hr(C),M=Z(H,x,1),E=Z(C,D,1)}else X(1);else{var z=Fr(l)+4,I=r[z-4]|r[z-3]<<8,U=z+I;if(U>v){t&&X(0);break}w&&F(c+I),n.set(r.subarray(z,U),c),a.b=c+=I,a.p=l=U*8,a.f=i;continue}if(l>V){t&&X(0);break}}w&&F(c+131072);for(var rr=(1<>4;if(l+=T&15,l>V){t&&X(0);break}if(T||X(2),N<256)n[c++]=N;else if(N==256){$=l,M=null;break}else{var P=N-254;if(N>264){var y=N-257,k=or[y];P=W(r,l,(1<>4;Y||X(3),l+=Y&15;var C=Dr[s];if(s>3){var k=ur[s];C+=wr(r,l)&(1<V){t&&X(0);break}w&&F(c+131072);var p=c+P;if(c>8},er=function(r,a,n){n<<=a&7;var e=a/8|0;r[e]|=n,r[e+1]|=n>>8,r[e+2]|=n>>16},tr=function(r,a){for(var n=[],e=0;ec&&(c=f[e].s);var M=new Q(c+1),E=br(n[i-1],M,0);if(E>a){var e=0,x=0,D=E-a,V=1<a)x+=V-(1<>=D;x>0;){var z=f[e].s;M[z]=0&&x;--e){var I=f[e].s;M[I]==a&&(--M[I],++x)}E=a}return{t:new B(M),l:E}},br=function(r,a,n){return r.s==-1?Math.max(br(r.l,a,n+1),br(r.r,a,n+1)):a[r.s]=n},zr=function(r){for(var a=r.length;a&&!r[--a];);for(var n=new Q(++a),e=0,v=r[0],f=1,o=function(t){n[e++]=t},w=1;w<=a;++w)if(r[w]==v&&w!=a)++f;else{if(!v&&f>2){for(;f>138;f-=138)o(32754);f>2&&(o(f>10?f-11<<5|28690:f-3<<5|12305),f=0)}else if(f>3){for(o(v),--f;f>6;f-=6)o(8304);f>2&&(o(f-3<<5|8208),f=0)}for(;f--;)o(v);f=1,v=r[w]}return{c:n.subarray(0,e),n:a}},vr=function(r,a){for(var n=0,e=0;e>8,r[v+2]=r[v]^255,r[v+3]=r[v+1]^255;for(var f=0;f4&&!S[gr[q-1]];--q);var j=F+5<<3,K=vr(v,m)+vr(f,fr)+o,G=vr(v,c)+vr(f,x)+o+14+3*q+vr(A,S)+2*A[16]+3*A[17]+7*A[18];if(t>=0&&j<=K&&j<=G)return qr(a,i,r.subarray(t,t+F));var T,b,H,C;if(_(a,i,1+(G15&&(_(a,i,N[h]>>5&127),i+=N[h]>>12)}}else T=Gr,b=m,H=Jr,C=fr;for(var h=0;h255){var P=k>>18&31;er(a,i,T[P+257]),i+=b[P+257],P>7&&(_(a,i,k>>23&31),i+=or[P]);var Y=k&31;er(a,i,H[Y]),i+=C[Y],Y>3&&(er(a,i,k>>5&8191),i+=ur[Y])}else er(a,i,T[k]),i+=b[k]}return er(a,i,T[256]),i+b[256]},Qr=new kr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Br=new B(0),Rr=function(r,a,n,e,v,f){var o=f.z||r.length,w=new B(e+o+5*(1+Math.ceil(o/7e3))+v),t=w.subarray(e,w.length-v),F=f.l,i=(f.r||0)&7;if(a){i&&(t[0]=f.r>>3);for(var l=Qr[a-1],c=l>>13,M=l&8191,E=(1<7e3||S>24576)&&(T>423||!F)){i=Ar(r,t,0,I,U,O,h,S,q,u-q,i),S=A=h=0,q=u;for(var b=0;b<286;++b)U[b]=0;for(var b=0;b<30;++b)O[b]=0}var H=2,C=0,rr=M,R=K-G&32767;if(T>2&&j==z(u-R))for(var $=Math.min(c,T)-1,N=Math.min(32767,u),P=Math.min(258,T);R<=N&&--rr&&K!=G;){if(r[u+H]==r[u+H-R]){for(var k=0;kH){if(H=k,C=R,k>$)break;for(var Y=Math.min(R,k-2),s=0,b=0;bs&&(s=lr,G=p)}}}K=G,G=x[K],R+=K-G&32767}if(C){I[S++]=268435456|Mr[H]<<18|yr[C];var ar=Mr[H]&31,nr=yr[C]&31;h+=or[ar]+ur[nr],++U[257+ar],++O[nr],y=u+H,++A}else I[S++]=r[u],++U[r[u]]}}for(u=Math.max(u,y);u=o&&(t[i/8|0]=F,d=o),i=qr(t,i+1,r.subarray(u,d))}f.i=o}return Ur(w,0,e+Fr(i)+v)},Ir=function(){var r=1,a=0;return{p:function(n){for(var e=r,v=a,f=n.length|0,o=0;o!=f;){for(var w=Math.min(o+2655,f);o>16),v=(v&65535)+15*(v>>16)}r=e,a=v},d:function(){return r%=65521,a%=65521,(r&255)<<24|(r&65280)<<8|(a&255)<<8|a>>8}}},Vr=function(r,a,n,e,v){if(!v&&(v={l:1},a.dictionary)){var f=a.dictionary.subarray(-32768),o=new B(f.length+r.length);o.set(f),o.set(r,f.length),r=o,v.w=f.length}return Rr(r,a.level==null?6:a.level,a.mem==null?v.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+a.mem,n,e,v)},Or=function(r,a,n){for(;n;++a)r[a]=n,n>>>=8},Wr=function(r,a){var n=a.level,e=n==0?0:n<6?1:n==9?3:2;if(r[0]=120,r[1]=e<<6|(a.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,a.dictionary){var v=Ir();v.p(a.dictionary),Or(r,2,v.d())}},Xr=function(r,a){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&X(6,"invalid zlib data"),(r[1]>>5&1)==+!a&&X(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function $r(r,a){a||(a={});var n=Ir();n.p(r);var e=Vr(r,a,a.dictionary?6:2,4);return Wr(e,a),Or(e,e.length-4,n.d()),e}function _r(r,a){return Pr(r.subarray(Xr(r,a&&a.dictionary),-4),{i:2},a&&a.out,a&&a.dictionary)}var Yr=typeof TextDecoder<"u"&&new TextDecoder,Zr=0;try{Yr.decode(Br,{stream:!0}),Zr=1}catch{}export{_r as u,$r as z};