@mhg/blog
Version:
3 lines (2 loc) • 27.4 kB
JavaScript
async function FetchUntgz(e){return fetch(e).then(progress).then(e=>e.blob()).then(untgz)}async function progress(e){return new Response(await e.arrayBuffer(),{status:e.status,headers:e.headers})}async function untgz(e){return new Promise(async(t,i)=>{try{untar(pako.inflate(await e.arrayBuffer()).buffer).then(async e=>{t(e)})}catch(n){i(n)}})}function untar(e){return new Promise(function(t,i){let n=[];try{let i=new UntarFileStream(e);for(;i.hasNext();){let e=i.next();e=decorateExtractedFile(e),n.push(e)}t(n)}catch(r){i(r)}})}!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pako=e()}(function(){return function e(t,i,n){function r(o,s){if(!i[o]){if(!t[o]){var f="function"==typeof require&&require;if(!s&&f)return f(o,!0);if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var d=i[o]={exports:{}};t[o][0].call(d.exports,function(e){return r(t[o][1][e]||e)},d,d.exports,e,t,i,n)}return i[o].exports}for(var a="function"==typeof require&&require,o=0;o<n.length;o++)r(n[o]);return r}({1:[function(e,t,i){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;i.assign=function(e){for(var t,i,n=Array.prototype.slice.call(arguments,1);n.length;){var r=n.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var a in r)t=r,i=a,Object.prototype.hasOwnProperty.call(t,i)&&(e[a]=r[a])}}return e},i.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,i,n,r){if(t.subarray&&e.subarray)e.set(t.subarray(i,i+n),r);else for(var a=0;a<n;a++)e[r+a]=t[i+a]},flattenChunks:function(e){var t,i,n,r,a,o;for(t=n=0,i=e.length;t<i;t++)n+=e[t].length;for(o=new Uint8Array(n),t=r=0,i=e.length;t<i;t++)a=e[t],o.set(a,r),r+=a.length;return o}},a={arraySet:function(e,t,i,n,r){for(var a=0;a<n;a++)e[r+a]=t[i+a]},flattenChunks:function(e){return[].concat.apply([],e)}};i.setTyped=function(e){e?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,r)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,a))},i.setTyped(n)},{}],2:[function(e,t,i){"use strict";var n=e("./common"),r=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(e){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){a=!1}for(var o=new n.Buf8(256),s=0;s<256;s++)o[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function f(e,t){if(t<65534&&(e.subarray&&a||!e.subarray&&r))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var i="",o=0;o<t;o++)i+=String.fromCharCode(e[o]);return i}o[254]=o[254]=1,i.string2buf=function(e){var t,i,r,a,o,s=e.length,f=0;for(a=0;a<s;a++)55296==(64512&(i=e.charCodeAt(a)))&&a+1<s&&56320==(64512&(r=e.charCodeAt(a+1)))&&(i=65536+(i-55296<<10)+(r-56320),a++),f+=i<128?1:i<2048?2:i<65536?3:4;for(t=new n.Buf8(f),a=o=0;o<f;a++)55296==(64512&(i=e.charCodeAt(a)))&&a+1<s&&56320==(64512&(r=e.charCodeAt(a+1)))&&(i=65536+(i-55296<<10)+(r-56320),a++),i<128?t[o++]=i:(i<2048?t[o++]=192|i>>>6:(i<65536?t[o++]=224|i>>>12:(t[o++]=240|i>>>18,t[o++]=128|i>>>12&63),t[o++]=128|i>>>6&63),t[o++]=128|63&i);return t},i.buf2binstring=function(e){return f(e,e.length)},i.binstring2buf=function(e){for(var t=new n.Buf8(e.length),i=0,r=t.length;i<r;i++)t[i]=e.charCodeAt(i);return t},i.buf2string=function(e,t){var i,n,r,a,s=t||e.length,l=new Array(2*s);for(i=n=0;i<s;)if((r=e[i++])<128)l[n++]=r;else if(4<(a=o[r]))l[n++]=65533,i+=a-1;else{for(r&=2===a?31:3===a?15:7;1<a&&i<s;)r=r<<6|63&e[i++],a--;1<a?l[n++]=65533:r<65536?l[n++]=r:(r-=65536,l[n++]=55296|r>>10&1023,l[n++]=56320|1023&r)}return f(l,n)},i.utf8border=function(e,t){var i;for((t=t||e.length)>e.length&&(t=e.length),i=t-1;0<=i&&128==(192&e[i]);)i--;return i<0||0===i?t:i+o[e[i]]>t?i:t}},{"./common":1}],3:[function(e,t,i){"use strict";t.exports=function(e,t,i,n){for(var r=65535&e,a=e>>>16&65535,o=0;0!==i;){for(i-=o=2e3<i?2e3:i;a=a+(r=r+t[n++]|0)|0,--o;);r%=65521,a%=65521}return r|a<<16}},{}],4:[function(e,t,i){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,i){"use strict";var n=function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}();t.exports=function(e,t,i,r){var a=n,o=r+i;e^=-1;for(var s=r;s<o;s++)e=e>>>8^a[255&(e^t[s])];return-1^e}},{}],6:[function(e,t,i){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],7:[function(e,t,i){"use strict";t.exports=function(e,t){var i,n,r,a,o,s,f,l,d,u,c,h,b,m,w,g,_,p,k,v,y,x,S,B,E;i=e.state,n=e.next_in,B=e.input,r=n+(e.avail_in-5),a=e.next_out,E=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),f=i.dmax,l=i.wsize,d=i.whave,u=i.wnext,c=i.window,h=i.hold,b=i.bits,m=i.lencode,w=i.distcode,g=(1<<i.lenbits)-1,_=(1<<i.distbits)-1;e:do{b<15&&(h+=B[n++]<<b,b+=8,h+=B[n++]<<b,b+=8),p=m[h&g];t:for(;;){if(h>>>=k=p>>>24,b-=k,0==(k=p>>>16&255))E[a++]=65535&p;else{if(!(16&k)){if(!(64&k)){p=m[(65535&p)+(h&(1<<k)-1)];continue t}if(32&k){i.mode=12;break e}e.msg="invalid literal/length code",i.mode=30;break e}v=65535&p,(k&=15)&&(b<k&&(h+=B[n++]<<b,b+=8),v+=h&(1<<k)-1,h>>>=k,b-=k),b<15&&(h+=B[n++]<<b,b+=8,h+=B[n++]<<b,b+=8),p=w[h&_];i:for(;;){if(h>>>=k=p>>>24,b-=k,!(16&(k=p>>>16&255))){if(!(64&k)){p=w[(65535&p)+(h&(1<<k)-1)];continue i}e.msg="invalid distance code",i.mode=30;break e}if(y=65535&p,b<(k&=15)&&(h+=B[n++]<<b,(b+=8)<k&&(h+=B[n++]<<b,b+=8)),f<(y+=h&(1<<k)-1)){e.msg="invalid distance too far back",i.mode=30;break e}if(h>>>=k,b-=k,(k=a-o)<y){if(d<(k=y-k)&&i.sane){e.msg="invalid distance too far back",i.mode=30;break e}if(S=c,(x=0)===u){if(x+=l-k,k<v){for(v-=k;E[a++]=c[x++],--k;);x=a-y,S=E}}else if(u<k){if(x+=l+u-k,(k-=u)<v){for(v-=k;E[a++]=c[x++],--k;);if(x=0,u<v){for(v-=k=u;E[a++]=c[x++],--k;);x=a-y,S=E}}}else if(x+=u-k,k<v){for(v-=k;E[a++]=c[x++],--k;);x=a-y,S=E}for(;2<v;)E[a++]=S[x++],E[a++]=S[x++],E[a++]=S[x++],v-=3;v&&(E[a++]=S[x++],1<v&&(E[a++]=S[x++]))}else{for(x=a-y;E[a++]=E[x++],E[a++]=E[x++],E[a++]=E[x++],2<(v-=3););v&&(E[a++]=E[x++],1<v&&(E[a++]=E[x++]))}break}}break}}while(n<r&&a<s);n-=v=b>>3,h&=(1<<(b-=v<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n<r?r-n+5:5-(n-r),e.avail_out=a<s?s-a+257:257-(a-s),i.hold=h,i.bits=b}},{}],8:[function(e,t,i){"use strict";var n=e("../utils/common"),r=e("./adler32"),a=e("./crc32"),o=e("./inffast"),s=e("./inftrees"),f=-2;function l(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function d(){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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function u(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=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):f}function c(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,u(e)):f}function h(e,t){var i,n;return e&&e.state?(n=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?f:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,c(e))):f}function b(e,t){var i,n;return e?(n=new d,(e.state=n).window=null,0!==(i=h(e,t))&&(e.state=null),i):f}var m,w,g=!0;function _(e){if(g){var t;for(m=new n.Buf32(512),w=new n.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(s(1,e.lens,0,288,m,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,w,0,e.work,{bits:5}),g=!1}e.lencode=m,e.lenbits=9,e.distcode=w,e.distbits=5}function p(e,t,i,r){var a,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new n.Buf8(o.wsize)),r>=o.wsize?(n.arraySet(o.window,t,i-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(r<(a=o.wsize-o.wnext)&&(a=r),n.arraySet(o.window,t,i-r,a,o.wnext),(r-=a)?(n.arraySet(o.window,t,i-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}i.inflateReset=c,i.inflateReset2=h,i.inflateResetKeep=u,i.inflateInit=function(e){return b(e,15)},i.inflateInit2=b,i.inflate=function(e,t){var i,d,u,c,h,b,m,w,g,k,v,y,x,S,B,E,U,A,F,Z,z,C,N,O,I=0,R=new n.Buf8(4),T=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return f;12===(i=e.state).mode&&(i.mode=13),h=e.next_out,u=e.output,m=e.avail_out,c=e.next_in,d=e.input,b=e.avail_in,w=i.hold,g=i.bits,k=b,v=m,C=0;e:for(;;)switch(i.mode){case 1:if(0===i.wrap){i.mode=13;break}for(;g<16;){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}if(2&i.wrap&&35615===w){R[i.check=0]=255&w,R[1]=w>>>8&255,i.check=a(i.check,R,2,0),g=w=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&w)<<8)+(w>>8))%31){e.msg="incorrect header check",i.mode=30;break}if(8!=(15&w)){e.msg="unknown compression method",i.mode=30;break}if(g-=4,z=8+(15&(w>>>=4)),0===i.wbits)i.wbits=z;else if(z>i.wbits){e.msg="invalid window size",i.mode=30;break}i.dmax=1<<z,e.adler=i.check=1,i.mode=512&w?10:12,g=w=0;break;case 2:for(;g<16;){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}if(i.flags=w,8!=(255&i.flags)){e.msg="unknown compression method",i.mode=30;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=30;break}i.head&&(i.head.text=w>>8&1),512&i.flags&&(R[0]=255&w,R[1]=w>>>8&255,i.check=a(i.check,R,2,0)),g=w=0,i.mode=3;case 3:for(;g<32;){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}i.head&&(i.head.time=w),512&i.flags&&(R[0]=255&w,R[1]=w>>>8&255,R[2]=w>>>16&255,R[3]=w>>>24&255,i.check=a(i.check,R,4,0)),g=w=0,i.mode=4;case 4:for(;g<16;){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}i.head&&(i.head.xflags=255&w,i.head.os=w>>8),512&i.flags&&(R[0]=255&w,R[1]=w>>>8&255,i.check=a(i.check,R,2,0)),g=w=0,i.mode=5;case 5:if(1024&i.flags){for(;g<16;){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}i.length=w,i.head&&(i.head.extra_len=w),512&i.flags&&(R[0]=255&w,R[1]=w>>>8&255,i.check=a(i.check,R,2,0)),g=w=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(b<(y=i.length)&&(y=b),y&&(i.head&&(z=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),n.arraySet(i.head.extra,d,c,y,z)),512&i.flags&&(i.check=a(i.check,d,y,c)),b-=y,c+=y,i.length-=y),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===b)break e;for(y=0;z=d[c+y++],i.head&&z&&i.length<65536&&(i.head.name+=String.fromCharCode(z)),z&&y<b;);if(512&i.flags&&(i.check=a(i.check,d,y,c)),b-=y,c+=y,z)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===b)break e;for(y=0;z=d[c+y++],i.head&&z&&i.length<65536&&(i.head.comment+=String.fromCharCode(z)),z&&y<b;);if(512&i.flags&&(i.check=a(i.check,d,y,c)),b-=y,c+=y,z)break e}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;g<16;){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}if(w!==(65535&i.check)){e.msg="header crc mismatch",i.mode=30;break}g=w=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=12;break;case 10:for(;g<32;){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}e.adler=i.check=l(w),g=w=0,i.mode=11;case 11:if(0===i.havedict)return e.next_out=h,e.avail_out=m,e.next_in=c,e.avail_in=b,i.hold=w,i.bits=g,2;e.adler=i.check=1,i.mode=12;case 12:if(5===t||6===t)break e;case 13:if(i.last){w>>>=7&g,g-=7&g,i.mode=27;break}for(;g<3;){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}switch(i.last=1&w,g-=1,3&(w>>>=1)){case 0:i.mode=14;break;case 1:if(_(i),i.mode=20,6!==t)break;w>>>=2,g-=2;break e;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=30}w>>>=2,g-=2;break;case 14:for(w>>>=7&g,g-=7&g;g<32;){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}if((65535&w)!=(w>>>16^65535)){e.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&w,g=w=0,i.mode=15,6===t)break e;case 15:i.mode=16;case 16:if(y=i.length){if(b<y&&(y=b),m<y&&(y=m),0===y)break e;n.arraySet(u,d,c,y,h),b-=y,c+=y,m-=y,h+=y,i.length-=y;break}i.mode=12;break;case 17:for(;g<14;){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}if(i.nlen=257+(31&w),w>>>=5,g-=5,i.ndist=1+(31&w),w>>>=5,g-=5,i.ncode=4+(15&w),w>>>=4,g-=4,286<i.nlen||30<i.ndist){e.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;g<3;){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}i.lens[T[i.have++]]=7&w,w>>>=3,g-=3}for(;i.have<19;)i.lens[T[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,N={bits:i.lenbits},C=s(0,i.lens,0,19,i.lencode,0,i.work,N),i.lenbits=N.bits,C){e.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;E=(I=i.lencode[w&(1<<i.lenbits)-1])>>>16&255,U=65535&I,!((B=I>>>24)<=g);){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}if(U<16)w>>>=B,g-=B,i.lens[i.have++]=U;else{if(16===U){for(O=B+2;g<O;){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}if(w>>>=B,g-=B,0===i.have){e.msg="invalid bit length repeat",i.mode=30;break}z=i.lens[i.have-1],y=3+(3&w),w>>>=2,g-=2}else if(17===U){for(O=B+3;g<O;){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}g-=B,z=0,y=3+(7&(w>>>=B)),w>>>=3,g-=3}else{for(O=B+7;g<O;){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}g-=B,z=0,y=11+(127&(w>>>=B)),w>>>=7,g-=7}if(i.have+y>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=30;break}for(;y--;)i.lens[i.have++]=z}}if(30===i.mode)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,N={bits:i.lenbits},C=s(1,i.lens,0,i.nlen,i.lencode,0,i.work,N),i.lenbits=N.bits,C){e.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,N={bits:i.distbits},C=s(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,N),i.distbits=N.bits,C){e.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===t)break e;case 20:i.mode=21;case 21:if(6<=b&&258<=m){e.next_out=h,e.avail_out=m,e.next_in=c,e.avail_in=b,i.hold=w,i.bits=g,o(e,v),h=e.next_out,u=e.output,m=e.avail_out,c=e.next_in,d=e.input,b=e.avail_in,w=i.hold,g=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;E=(I=i.lencode[w&(1<<i.lenbits)-1])>>>16&255,U=65535&I,!((B=I>>>24)<=g);){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}if(E&&!(240&E)){for(A=B,F=E,Z=U;E=(I=i.lencode[Z+((w&(1<<A+F)-1)>>A)])>>>16&255,U=65535&I,!(A+(B=I>>>24)<=g);){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}w>>>=A,g-=A,i.back+=A}if(w>>>=B,g-=B,i.back+=B,i.length=U,0===E){i.mode=26;break}if(32&E){i.back=-1,i.mode=12;break}if(64&E){e.msg="invalid literal/length code",i.mode=30;break}i.extra=15&E,i.mode=22;case 22:if(i.extra){for(O=i.extra;g<O;){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}i.length+=w&(1<<i.extra)-1,w>>>=i.extra,g-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;E=(I=i.distcode[w&(1<<i.distbits)-1])>>>16&255,U=65535&I,!((B=I>>>24)<=g);){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}if(!(240&E)){for(A=B,F=E,Z=U;E=(I=i.distcode[Z+((w&(1<<A+F)-1)>>A)])>>>16&255,U=65535&I,!(A+(B=I>>>24)<=g);){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}w>>>=A,g-=A,i.back+=A}if(w>>>=B,g-=B,i.back+=B,64&E){e.msg="invalid distance code",i.mode=30;break}i.offset=U,i.extra=15&E,i.mode=24;case 24:if(i.extra){for(O=i.extra;g<O;){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}i.offset+=w&(1<<i.extra)-1,w>>>=i.extra,g-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===m)break e;if(y=v-m,i.offset>y){if((y=i.offset-y)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=30;break}y>i.wnext?(y-=i.wnext,x=i.wsize-y):x=i.wnext-y,y>i.length&&(y=i.length),S=i.window}else S=u,x=h-i.offset,y=i.length;for(m<y&&(y=m),m-=y,i.length-=y;u[h++]=S[x++],--y;);0===i.length&&(i.mode=21);break;case 26:if(0===m)break e;u[h++]=i.length,m--,i.mode=21;break;case 27:if(i.wrap){for(;g<32;){if(0===b)break e;b--,w|=d[c++]<<g,g+=8}if(v-=m,e.total_out+=v,i.total+=v,v&&(e.adler=i.check=i.flags?a(i.check,u,v,h-v):r(i.check,u,v,h-v)),v=m,(i.flags?w:l(w))!==i.check){e.msg="incorrect data check",i.mode=30;break}g=w=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;g<32;){if(0===b)break e;b--,w+=d[c++]<<g,g+=8}if(w!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=30;break}g=w=0}i.mode=29;case 29:C=1;break e;case 30:C=-3;break e;case 31:return-4;default:return f}return e.next_out=h,e.avail_out=m,e.next_in=c,e.avail_in=b,i.hold=w,i.bits=g,(i.wsize||v!==e.avail_out&&i.mode<30&&(i.mode<27||4!==t))&&p(e,e.output,e.next_out,v-e.avail_out)?(i.mode=31,-4):(k-=e.avail_in,v-=e.avail_out,e.total_in+=k,e.total_out+=v,i.total+=v,i.wrap&&v&&(e.adler=i.check=i.flags?a(i.check,u,v,e.next_out-v):r(i.check,u,v,e.next_out-v)),e.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),(0===k&&0===v||4===t)&&0===C&&(C=-5),C)},i.inflateEnd=function(e){if(!e||!e.state)return f;var t=e.state;return t.window&&(t.window=null),e.state=null,0},i.inflateGetHeader=function(e,t){var i;return e&&e.state&&2&(i=e.state).wrap?((i.head=t).done=!1,0):f},i.inflateSetDictionary=function(e,t){var i,n=t.length;return e&&e.state?0!==(i=e.state).wrap&&11!==i.mode?f:11===i.mode&&r(1,t,n,0)!==i.check?-3:p(e,t,n,n)?(i.mode=31,-4):(i.havedict=1,0):f},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,i){"use strict";var n=e("../utils/common"),r=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[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,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,i,f,l,d,u,c){var h,b,m,w,g,_,p,k,v,y=c.bits,x=0,S=0,B=0,E=0,U=0,A=0,F=0,Z=0,z=0,C=0,N=null,O=0,I=new n.Buf16(16),R=new n.Buf16(16),T=null,H=0;for(x=0;x<=15;x++)I[x]=0;for(S=0;S<f;S++)I[t[i+S]]++;for(U=y,E=15;1<=E&&0===I[E];E--);if(E<U&&(U=E),0===E)return l[d++]=20971520,l[d++]=20971520,c.bits=1,0;for(B=1;B<E&&0===I[B];B++);for(U<B&&(U=B),x=Z=1;x<=15;x++)if(Z<<=1,(Z-=I[x])<0)return-1;if(0<Z&&(0===e||1!==E))return-1;for(R[1]=0,x=1;x<15;x++)R[x+1]=R[x]+I[x];for(S=0;S<f;S++)0!==t[i+S]&&(u[R[t[i+S]]++]=S);if(0===e?(N=T=u,_=19):1===e?(N=r,O-=257,T=a,H-=257,_=256):(N=o,T=s,_=-1),x=B,g=d,F=S=C=0,m=-1,w=(z=1<<(A=U))-1,1===e&&852<z||2===e&&592<z)return 1;for(;;){for(p=x-F,u[S]<_?(k=0,v=u[S]):u[S]>_?(k=T[H+u[S]],v=N[O+u[S]]):(k=96,v=0),h=1<<x-F,B=b=1<<A;l[g+(C>>F)+(b-=h)]=p<<24|k<<16|v,0!==b;);for(h=1<<x-1;C&h;)h>>=1;if(0!==h?(C&=h-1,C+=h):C=0,S++,0==--I[x]){if(x===E)break;x=t[i+u[S]]}if(U<x&&(C&w)!==m){for(0===F&&(F=U),g+=B,Z=1<<(A=x-F);A+F<E&&!((Z-=I[A+F])<=0);)A++,Z<<=1;if(z+=1<<A,1===e&&852<z||2===e&&592<z)return 1;l[m=C&w]=U<<24|A<<16|g-d}}return 0!==C&&(l[g+C]=x-F<<24|64<<16),c.bits=U,0}},{"../utils/common":1}],10:[function(e,t,i){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,i){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/inflate.js":[function(e,t,i){"use strict";var n=e("./zlib/inflate"),r=e("./utils/common"),a=e("./utils/strings"),o=e("./zlib/constants"),s=e("./zlib/messages"),f=e("./zlib/zstream"),l=e("./zlib/gzheader"),d=Object.prototype.toString;function u(e){if(!(this instanceof u))return new u(e);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&!(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var i=n.inflateInit2(this.strm,t.windowBits);if(i!==o.Z_OK)throw new Error(s[i]);if(this.header=new l,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=a.string2buf(t.dictionary):"[object ArrayBuffer]"===d.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=n.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(s[i])}function c(e,t){var i=new u(t);if(i.push(e,!0),i.err)throw i.msg||s[i.err];return i.result}u.prototype.push=function(e,t){var i,s,f,l,u,c=this.strm,h=this.options.chunkSize,b=this.options.dictionary,m=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof e?c.input=a.binstring2buf(e):"[object ArrayBuffer]"===d.call(e)?c.input=new Uint8Array(e):c.input=e,c.next_in=0,c.avail_in=c.input.length;do{if(0===c.avail_out&&(c.output=new r.Buf8(h),c.next_out=0,c.avail_out=h),(i=n.inflate(c,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&b&&(i=n.inflateSetDictionary(this.strm,b)),i===o.Z_BUF_ERROR&&!0===m&&(i=o.Z_OK,m=!1),i!==o.Z_STREAM_END&&i!==o.Z_OK)return this.onEnd(i),!(this.ended=!0);c.next_out&&(0!==c.avail_out&&i!==o.Z_STREAM_END&&(0!==c.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(f=a.utf8border(c.output,c.next_out),l=c.next_out-f,u=a.buf2string(c.output,f),c.next_out=l,c.avail_out=h-l,l&&r.arraySet(c.output,c.output,f,l,0),this.onData(u)):this.onData(r.shrinkBuf(c.output,c.next_out)))),0===c.avail_in&&0===c.avail_out&&(m=!0)}while((0<c.avail_in||0===c.avail_out)&&i!==o.Z_STREAM_END);return i===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(i=n.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(c.avail_out=0))},u.prototype.onData=function(e){this.chunks.push(e)},u.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},i.Inflate=u,i.inflate=c,i.inflateRaw=function(e,t){return(t=t||{}).raw=!0,c(e,t)},i.ungzip=c},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")});let decoratedFileProps={blob:{get:function(){return this._blob||(this._blob=new Blob([this.buffer]))}},getBlobUrl:{value:function(){return this._blobUrl||(this._blobUrl=URL.createObjectURL(this.blob))}},readAsString:{value:function(){let e=this.buffer,t=e.byteLength,i=new DataView(e),n=[];for(let r=0;r<t;++r){let e=i.getUint8(1*r,!0);n.push(e)}return this._string=String.fromCharCode.apply(null,n)}},readAsJSON:{value:function(){return JSON.parse(this.readAsString())}}};function decorateExtractedFile(e){return Object.defineProperties(e,decoratedFileProps),e}function decodeUTF8(e){let t="",i=0;for(;i<e.length;){let n=e[i++];if(n>127){if(n>191&&n<224){if(i>=e.length)throw"UTF-8 decode: incomplete 2-byte sequence";n=(31&n)<<6|63&e[i]}else if(n>223&&n<240){if(i+1>=e.length)throw"UTF-8 decode: incomplete 3-byte sequence";n=(15&n)<<12|(63&e[i])<<6|63&e[++i]}else{if(!(n>239&&n<248))throw"UTF-8 decode: unknown multibyte start 0x"+n.toString(16)+" at index "+(i-1);if(i+2>=e.length)throw"UTF-8 decode: incomplete 4-byte sequence";n=(7&n)<<18|(63&e[i])<<12|(63&e[++i])<<6|63&e[++i]}++i}if(n<=65535)t+=String.fromCharCode(n);else{if(!(n<=1114111))throw"UTF-8 decode: code point 0x"+n.toString(16)+" exceeds UTF-16 reach";n-=65536,t+=String.fromCharCode(n>>10|55296),t+=String.fromCharCode(1023&n|56320)}}return t}function PaxHeader(e){this._fields=e}function TarFile(){}function UntarStream(e){this._bufferView=new DataView(e),this._position=0}function UntarFileStream(e){this._stream=new UntarStream(e),this._globalPaxHeader=null}PaxHeader.parse=function(e){let t=new Uint8Array(e),i=[];for(;t.length>0;){let e=parseInt(decodeUTF8(t.subarray(0,t.indexOf(32)))),n=decodeUTF8(t.subarray(0,e)).match(/^\d+ ([^=]+)=(.*)\n$/);if(null===n)throw new Error("Invalid PAX header data format.");let r=n[1],a=n[2];0===a.length?a=null:null!==a.match(/^\d+$/)&&(a=parseInt(a));let o={name:r,value:a};i.push(o),t=t.subarray(e)}return new PaxHeader(i)},PaxHeader.prototype={applyHeader:function(e){this._fields.forEach(function(t){let i=t.name,n=t.value;"path"===i?(i="name",e.prefix!==undefined&&delete e.prefix):"linkpath"===i&&(i="linkname"),null===n?delete e[i]:e[i]=n})}},UntarStream.prototype={readString:function(e){let t=1*e,i=[];for(let n=0;n<e;++n){let e=this._bufferView.getUint8(this.position()+1*n,!0);if(0===e)break;i.push(e)}return this.seek(t),String.fromCharCode.apply(null,i)},readBuffer:function(e){let t;if("function"==typeof ArrayBuffer.prototype.slice)t=this._bufferView.buffer.slice(this.position(),this.position()+e);else{t=new ArrayBuffer(e);let i=new Uint8Array(t),n=new Uint8Array(this._bufferView.buffer,this.position(),e);i.set(n)}return this.seek(e),t},seek:function(e){this._position+=e},peekUint32:function(){return this._bufferView.getUint32(this.position(),!0)},position:function(e){if(e===undefined)return this._position;this._position=e},size:function(){return this._bufferView.byteLength}},UntarFileStream.prototype={hasNext:function(){return this._stream.position()+4<this._stream.size()&&0!==this._stream.peekUint32()},next:function(){return this._readNextFile()},_readNextFile:function(){let e=this._stream,t=new TarFile,i=!1,n=null,r=e.position()+512;switch(t.name=e.readString(100),t.mode=e.readString(8),t.uid=parseInt(e.readString(8)),t.gid=parseInt(e.readString(8)),t.size=parseInt(e.readString(12),8),t.mtime=parseInt(e.readString(12),8),t.checksum=parseInt(e.readString(8)),t.type=e.readString(1),t.linkname=e.readString(100),t.ustarFormat=e.readString(6),t.ustarFormat.indexOf("ustar")>-1&&(t.version=e.readString(2),t.uname=e.readString(32),t.gname=e.readString(32),t.devmajor=parseInt(e.readString(8)),t.devminor=parseInt(e.readString(8)),t.namePrefix=e.readString(155),t.namePrefix.length>0&&(t.name=t.namePrefix+"/"+t.name)),e.position(r),t.type){case"0":case"":t.buffer=e.readBuffer(t.size);break;case"g":i=!0,this._globalPaxHeader=PaxHeader.parse(e.readBuffer(t.size));break;case"x":i=!0,n=PaxHeader.parse(e.readBuffer(t.size))}t.buffer===undefined&&(t.buffer=new ArrayBuffer(0));let a=r+t.size;return t.size%512!=0&&(a+=512-t.size%512),e.position(a),i&&(t=this._readNextFile()),null!==this._globalPaxHeader&&this._globalPaxHeader.applyHeader(t),null!==n&&n.applyHeader(t),t}};
//# sourceMappingURL=maps/untgz.js.map