/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/svga-web@2.4.3/dist/svga-web.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
class Downloader{constructor(){this.request=null}get(e){if(!e)throw new Error("download link undefined");return new Promise(((t,r)=>{const i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onloadend=()=>{!i.response||200!==i.status&&304!==i.status?r(i):t(i.response)},i.onerror=()=>r(i.response),i.send(),this.request=i}))}cancel(){this.request?.abort()}destroy(){this.request?.abort()}}const jsContent='(function(){"use strict";function zero$1(a){let r=a.length;for(;--r>=0;)a[r]=0}const MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,DIST_CODE_LEN=512,static_ltree=new Array((L_CODES$1+2)*2);zero$1(static_ltree);const static_dtree=new Array(D_CODES$1*2);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);zero$1(base_dist);const adler32=(a,r,t,s)=>{let f=a&65535|0,e=a>>>16&65535|0,n=0;for(;t!==0;){n=t>2e3?2e3:t,t-=n;do f=f+r[s++]|0,e=e+f|0;while(--n);f%=65521,e%=65521}return f|e<<16|0};var adler32_1=adler32;const makeTable=()=>{let a,r=[];for(var t=0;t<256;t++){a=t;for(var s=0;s<8;s++)a=a&1?3988292384^a>>>1:a>>>1;r[t]=a}return r},crcTable=new Uint32Array(makeTable()),crc32=(a,r,t,s)=>{const f=crcTable,e=s+t;a^=-1;for(let n=s;n<e;n++)a=a>>>8^f[(a^r[n])&255];return a^-1};var crc32_1=crc32,messages={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"},constants$2={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const _has=(a,r)=>Object.prototype.hasOwnProperty.call(a,r);var assign=function(a){const r=Array.prototype.slice.call(arguments,1);for(;r.length;){const t=r.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const s in t)_has(t,s)&&(a[s]=t[s])}}return a},flattenChunks=a=>{let r=0;for(let s=0,f=a.length;s<f;s++)r+=a[s].length;const t=new Uint8Array(r);for(let s=0,f=0,e=a.length;s<e;s++){let n=a[s];t.set(n,f),f+=n.length}return t},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(a){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let a=0;a<256;a++)_utf8len[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=a=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(a);let r,t,s,f,e,n=a.length,i=0;for(f=0;f<n;f++)t=a.charCodeAt(f),(t&64512)===55296&&f+1<n&&(s=a.charCodeAt(f+1),(s&64512)===56320&&(t=65536+(t-55296<<10)+(s-56320),f++)),i+=t<128?1:t<2048?2:t<65536?3:4;for(r=new Uint8Array(i),e=0,f=0;e<i;f++)t=a.charCodeAt(f),(t&64512)===55296&&f+1<n&&(s=a.charCodeAt(f+1),(s&64512)===56320&&(t=65536+(t-55296<<10)+(s-56320),f++)),t<128?r[e++]=t:t<2048?(r[e++]=192|t>>>6,r[e++]=128|t&63):t<65536?(r[e++]=224|t>>>12,r[e++]=128|t>>>6&63,r[e++]=128|t&63):(r[e++]=240|t>>>18,r[e++]=128|t>>>12&63,r[e++]=128|t>>>6&63,r[e++]=128|t&63);return r};const buf2binstring=(a,r)=>{if(r<65534&&a.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,a.length===r?a:a.subarray(0,r));let t="";for(let s=0;s<r;s++)t+=String.fromCharCode(a[s]);return t};var buf2string=(a,r)=>{const t=r||a.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(a.subarray(0,r));let s,f;const e=new Array(t*2);for(f=0,s=0;s<t;){let n=a[s++];if(n<128){e[f++]=n;continue}let i=_utf8len[n];if(i>4){e[f++]=65533,s+=i-1;continue}for(n&=i===2?31:i===3?15:7;i>1&&s<t;)n=n<<6|a[s++]&63,i--;if(i>1){e[f++]=65533;continue}n<65536?e[f++]=n:(n-=65536,e[f++]=55296|n>>10&1023,e[f++]=56320|n&1023)}return buf2binstring(e,f)},utf8border=(a,r)=>{r=r||a.length,r>a.length&&(r=a.length);let t=r-1;for(;t>=0&&(a[t]&192)===128;)t--;return t<0||t===0?r:t+_utf8len[a[t]]>r?t:r},strings={string2buf,buf2string,utf8border};function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var zstream=ZStream;const BAD$1=16209,TYPE$1=16191;var inffast=function(r,t){let s,f,e,n,i,u,o,l,d,c,h,p,b,y,_,g,w,m,k,A,E,x,S,v;const R=r.state;s=r.next_in,S=r.input,f=s+(r.avail_in-5),e=r.next_out,v=r.output,n=e-(t-r.avail_out),i=e+(r.avail_out-257),u=R.dmax,o=R.wsize,l=R.whave,d=R.wnext,c=R.window,h=R.hold,p=R.bits,b=R.lencode,y=R.distcode,_=(1<<R.lenbits)-1,g=(1<<R.distbits)-1;e:do{p<15&&(h+=S[s++]<<p,p+=8,h+=S[s++]<<p,p+=8),w=b[h&_];t:for(;;){if(m=w>>>24,h>>>=m,p-=m,m=w>>>16&255,m===0)v[e++]=w&65535;else if(m&16){k=w&65535,m&=15,m&&(p<m&&(h+=S[s++]<<p,p+=8),k+=h&(1<<m)-1,h>>>=m,p-=m),p<15&&(h+=S[s++]<<p,p+=8,h+=S[s++]<<p,p+=8),w=y[h&g];i:for(;;){if(m=w>>>24,h>>>=m,p-=m,m=w>>>16&255,m&16){if(A=w&65535,m&=15,p<m&&(h+=S[s++]<<p,p+=8,p<m&&(h+=S[s++]<<p,p+=8)),A+=h&(1<<m)-1,A>u){r.msg="invalid distance too far back",R.mode=BAD$1;break e}if(h>>>=m,p-=m,m=e-n,A>m){if(m=A-m,m>l&&R.sane){r.msg="invalid distance too far back",R.mode=BAD$1;break e}if(E=0,x=c,d===0){if(E+=o-m,m<k){k-=m;do v[e++]=c[E++];while(--m);E=e-A,x=v}}else if(d<m){if(E+=o+d-m,m-=d,m<k){k-=m;do v[e++]=c[E++];while(--m);if(E=0,d<k){m=d,k-=m;do v[e++]=c[E++];while(--m);E=e-A,x=v}}}else if(E+=d-m,m<k){k-=m;do v[e++]=c[E++];while(--m);E=e-A,x=v}for(;k>2;)v[e++]=x[E++],v[e++]=x[E++],v[e++]=x[E++],k-=3;k&&(v[e++]=x[E++],k>1&&(v[e++]=x[E++]))}else{E=e-A;do v[e++]=v[E++],v[e++]=v[E++],v[e++]=v[E++],k-=3;while(k>2);k&&(v[e++]=v[E++],k>1&&(v[e++]=v[E++]))}}else if((m&64)===0){w=y[(w&65535)+(h&(1<<m)-1)];continue i}else{r.msg="invalid distance code",R.mode=BAD$1;break e}break}}else if((m&64)===0){w=b[(w&65535)+(h&(1<<m)-1)];continue t}else if(m&32){R.mode=TYPE$1;break e}else{r.msg="invalid literal/length code",R.mode=BAD$1;break e}break}}while(s<f&&e<i);k=p>>3,s-=k,p-=k<<3,h&=(1<<p)-1,r.next_in=s,r.next_out=e,r.avail_in=s<f?5+(f-s):5-(s-f),r.avail_out=e<i?257+(i-e):257-(e-i),R.hold=h,R.bits=p};const MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=new Uint16Array([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]),lext=new Uint8Array([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]),dbase=new Uint16Array([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]),dext=new Uint8Array([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]),inflate_table=(a,r,t,s,f,e,n,i)=>{const u=i.bits;let o=0,l=0,d=0,c=0,h=0,p=0,b=0,y=0,_=0,g=0,w,m,k,A,E,x=null,S;const v=new Uint16Array(MAXBITS+1),R=new Uint16Array(MAXBITS+1);let T=null,B,D,O;for(o=0;o<=MAXBITS;o++)v[o]=0;for(l=0;l<s;l++)v[r[t+l]]++;for(h=u,c=MAXBITS;c>=1&&v[c]===0;c--);if(h>c&&(h=c),c===0)return f[e++]=1<<24|64<<16|0,f[e++]=1<<24|64<<16|0,i.bits=1,0;for(d=1;d<c&&v[d]===0;d++);for(h<d&&(h=d),y=1,o=1;o<=MAXBITS;o++)if(y<<=1,y-=v[o],y<0)return-1;if(y>0&&(a===CODES$1||c!==1))return-1;for(R[1]=0,o=1;o<MAXBITS;o++)R[o+1]=R[o]+v[o];for(l=0;l<s;l++)r[t+l]!==0&&(n[R[r[t+l]]++]=l);if(a===CODES$1?(x=T=n,S=20):a===LENS$1?(x=lbase,T=lext,S=257):(x=dbase,T=dext,S=0),g=0,l=0,o=d,E=e,p=h,b=0,k=-1,_=1<<h,A=_-1,a===LENS$1&&_>ENOUGH_LENS$1||a===DISTS$1&&_>ENOUGH_DISTS$1)return 1;for(;;){B=o-b,n[l]+1<S?(D=0,O=n[l]):n[l]>=S?(D=T[n[l]-S],O=x[n[l]-S]):(D=96,O=0),w=1<<o-b,m=1<<p,d=m;do m-=w,f[E+(g>>b)+m]=B<<24|D<<16|O|0;while(m!==0);for(w=1<<o-1;g&w;)w>>=1;if(w!==0?(g&=w-1,g+=w):g=0,l++,--v[o]===0){if(o===c)break;o=r[t+n[l]]}if(o>h&&(g&A)!==k){for(b===0&&(b=h),E+=d,p=o-b,y=1<<p;p+b<c&&(y-=v[p+b],!(y<=0));)p++,y<<=1;if(_+=1<<p,a===LENS$1&&_>ENOUGH_LENS$1||a===DISTS$1&&_>ENOUGH_DISTS$1)return 1;k=g&A,f[k]=h<<24|p<<16|E-e|0}}return g!==0&&(f[E+g]=o-b<<24|64<<16|0),i.bits=h,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=a=>(a>>>24&255)+(a>>>8&65280)+((a&65280)<<8)+((a&255)<<24);function InflateState(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const inflateStateCheck=a=>{if(!a)return 1;const r=a.state;return!r||r.strm!==a||r.mode<HEAD||r.mode>SYNC?1:0},inflateResetKeep=a=>{if(inflateStateCheck(a))return Z_STREAM_ERROR$1;const r=a.state;return a.total_in=a.total_out=r.total=0,a.msg="",r.wrap&&(a.adler=r.wrap&1),r.mode=HEAD,r.last=0,r.havedict=0,r.flags=-1,r.dmax=32768,r.head=null,r.hold=0,r.bits=0,r.lencode=r.lendyn=new Int32Array(ENOUGH_LENS),r.distcode=r.distdyn=new Int32Array(ENOUGH_DISTS),r.sane=1,r.back=-1,Z_OK$1},inflateReset=a=>{if(inflateStateCheck(a))return Z_STREAM_ERROR$1;const r=a.state;return r.wsize=0,r.whave=0,r.wnext=0,inflateResetKeep(a)},inflateReset2=(a,r)=>{let t;if(inflateStateCheck(a))return Z_STREAM_ERROR$1;const s=a.state;return r<0?(t=0,r=-r):(t=(r>>4)+5,r<48&&(r&=15)),r&&(r<8||r>15)?Z_STREAM_ERROR$1:(s.window!==null&&s.wbits!==r&&(s.window=null),s.wrap=t,s.wbits=r,inflateReset(a))},inflateInit2=(a,r)=>{if(!a)return Z_STREAM_ERROR$1;const t=new InflateState;a.state=t,t.strm=a,t.window=null,t.mode=HEAD;const s=inflateReset2(a,r);return s!==Z_OK$1&&(a.state=null),s},inflateInit=a=>inflateInit2(a,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=a=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let r=0;for(;r<144;)a.lens[r++]=8;for(;r<256;)a.lens[r++]=9;for(;r<280;)a.lens[r++]=7;for(;r<288;)a.lens[r++]=8;for(inftrees(LENS,a.lens,0,288,lenfix,0,a.work,{bits:9}),r=0;r<32;)a.lens[r++]=5;inftrees(DISTS,a.lens,0,32,distfix,0,a.work,{bits:5}),virgin=!1}a.lencode=lenfix,a.lenbits=9,a.distcode=distfix,a.distbits=5},updatewindow=(a,r,t,s)=>{let f;const e=a.state;return e.window===null&&(e.wsize=1<<e.wbits,e.wnext=0,e.whave=0,e.window=new Uint8Array(e.wsize)),s>=e.wsize?(e.window.set(r.subarray(t-e.wsize,t),0),e.wnext=0,e.whave=e.wsize):(f=e.wsize-e.wnext,f>s&&(f=s),e.window.set(r.subarray(t-s,t-s+f),e.wnext),s-=f,s?(e.window.set(r.subarray(t-s,t),0),e.wnext=s,e.whave=e.wsize):(e.wnext+=f,e.wnext===e.wsize&&(e.wnext=0),e.whave<e.wsize&&(e.whave+=f))),0},inflate$2=(a,r)=>{let t,s,f,e,n,i,u,o,l,d,c,h,p,b,y=0,_,g,w,m,k,A,E,x;const S=new Uint8Array(4);let v,R;const T=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(a)||!a.output||!a.input&&a.avail_in!==0)return Z_STREAM_ERROR$1;t=a.state,t.mode===TYPE&&(t.mode=TYPEDO),n=a.next_out,f=a.output,u=a.avail_out,e=a.next_in,s=a.input,i=a.avail_in,o=t.hold,l=t.bits,d=i,c=u,x=Z_OK$1;e:for(;;)switch(t.mode){case HEAD:if(t.wrap===0){t.mode=TYPEDO;break}for(;l<16;){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}if(t.wrap&2&&o===35615){t.wbits===0&&(t.wbits=15),t.check=0,S[0]=o&255,S[1]=o>>>8&255,t.check=crc32_1(t.check,S,2,0),o=0,l=0,t.mode=FLAGS;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((o&255)<<8)+(o>>8))%31){a.msg="incorrect header check",t.mode=BAD;break}if((o&15)!==Z_DEFLATED){a.msg="unknown compression method",t.mode=BAD;break}if(o>>>=4,l-=4,E=(o&15)+8,t.wbits===0&&(t.wbits=E),E>15||E>t.wbits){a.msg="invalid window size",t.mode=BAD;break}t.dmax=1<<t.wbits,t.flags=0,a.adler=t.check=1,t.mode=o&512?DICTID:TYPE,o=0,l=0;break;case FLAGS:for(;l<16;){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}if(t.flags=o,(t.flags&255)!==Z_DEFLATED){a.msg="unknown compression method",t.mode=BAD;break}if(t.flags&57344){a.msg="unknown header flags set",t.mode=BAD;break}t.head&&(t.head.text=o>>8&1),t.flags&512&&t.wrap&4&&(S[0]=o&255,S[1]=o>>>8&255,t.check=crc32_1(t.check,S,2,0)),o=0,l=0,t.mode=TIME;case TIME:for(;l<32;){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}t.head&&(t.head.time=o),t.flags&512&&t.wrap&4&&(S[0]=o&255,S[1]=o>>>8&255,S[2]=o>>>16&255,S[3]=o>>>24&255,t.check=crc32_1(t.check,S,4,0)),o=0,l=0,t.mode=OS;case OS:for(;l<16;){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}t.head&&(t.head.xflags=o&255,t.head.os=o>>8),t.flags&512&&t.wrap&4&&(S[0]=o&255,S[1]=o>>>8&255,t.check=crc32_1(t.check,S,2,0)),o=0,l=0,t.mode=EXLEN;case EXLEN:if(t.flags&1024){for(;l<16;){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}t.length=o,t.head&&(t.head.extra_len=o),t.flags&512&&t.wrap&4&&(S[0]=o&255,S[1]=o>>>8&255,t.check=crc32_1(t.check,S,2,0)),o=0,l=0}else t.head&&(t.head.extra=null);t.mode=EXTRA;case EXTRA:if(t.flags&1024&&(h=t.length,h>i&&(h=i),h&&(t.head&&(E=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(s.subarray(e,e+h),E)),t.flags&512&&t.wrap&4&&(t.check=crc32_1(t.check,s,h,e)),i-=h,e+=h,t.length-=h),t.length))break e;t.length=0,t.mode=NAME;case NAME:if(t.flags&2048){if(i===0)break e;h=0;do E=s[e+h++],t.head&&E&&t.length<65536&&(t.head.name+=String.fromCharCode(E));while(E&&h<i);if(t.flags&512&&t.wrap&4&&(t.check=crc32_1(t.check,s,h,e)),i-=h,e+=h,E)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=COMMENT;case COMMENT:if(t.flags&4096){if(i===0)break e;h=0;do E=s[e+h++],t.head&&E&&t.length<65536&&(t.head.comment+=String.fromCharCode(E));while(E&&h<i);if(t.flags&512&&t.wrap&4&&(t.check=crc32_1(t.check,s,h,e)),i-=h,e+=h,E)break e}else t.head&&(t.head.comment=null);t.mode=HCRC;case HCRC:if(t.flags&512){for(;l<16;){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}if(t.wrap&4&&o!==(t.check&65535)){a.msg="header crc mismatch",t.mode=BAD;break}o=0,l=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),a.adler=t.check=0,t.mode=TYPE;break;case DICTID:for(;l<32;){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}a.adler=t.check=zswap32(o),o=0,l=0,t.mode=DICT;case DICT:if(t.havedict===0)return a.next_out=n,a.avail_out=u,a.next_in=e,a.avail_in=i,t.hold=o,t.bits=l,Z_NEED_DICT$1;a.adler=t.check=1,t.mode=TYPE;case TYPE:if(r===Z_BLOCK||r===Z_TREES)break e;case TYPEDO:if(t.last){o>>>=l&7,l-=l&7,t.mode=CHECK;break}for(;l<3;){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}switch(t.last=o&1,o>>>=1,l-=1,o&3){case 0:t.mode=STORED;break;case 1:if(fixedtables(t),t.mode=LEN_,r===Z_TREES){o>>>=2,l-=2;break e}break;case 2:t.mode=TABLE;break;case 3:a.msg="invalid block type",t.mode=BAD}o>>>=2,l-=2;break;case STORED:for(o>>>=l&7,l-=l&7;l<32;){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}if((o&65535)!==(o>>>16^65535)){a.msg="invalid stored block lengths",t.mode=BAD;break}if(t.length=o&65535,o=0,l=0,t.mode=COPY_,r===Z_TREES)break e;case COPY_:t.mode=COPY;case COPY:if(h=t.length,h){if(h>i&&(h=i),h>u&&(h=u),h===0)break e;f.set(s.subarray(e,e+h),n),i-=h,e+=h,u-=h,n+=h,t.length-=h;break}t.mode=TYPE;break;case TABLE:for(;l<14;){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}if(t.nlen=(o&31)+257,o>>>=5,l-=5,t.ndist=(o&31)+1,o>>>=5,l-=5,t.ncode=(o&15)+4,o>>>=4,l-=4,t.nlen>286||t.ndist>30){a.msg="too many length or distance symbols",t.mode=BAD;break}t.have=0,t.mode=LENLENS;case LENLENS:for(;t.have<t.ncode;){for(;l<3;){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}t.lens[T[t.have++]]=o&7,o>>>=3,l-=3}for(;t.have<19;)t.lens[T[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,v={bits:t.lenbits},x=inftrees(CODES,t.lens,0,19,t.lencode,0,t.work,v),t.lenbits=v.bits,x){a.msg="invalid code lengths set",t.mode=BAD;break}t.have=0,t.mode=CODELENS;case CODELENS:for(;t.have<t.nlen+t.ndist;){for(;y=t.lencode[o&(1<<t.lenbits)-1],_=y>>>24,g=y>>>16&255,w=y&65535,!(_<=l);){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}if(w<16)o>>>=_,l-=_,t.lens[t.have++]=w;else{if(w===16){for(R=_+2;l<R;){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}if(o>>>=_,l-=_,t.have===0){a.msg="invalid bit length repeat",t.mode=BAD;break}E=t.lens[t.have-1],h=3+(o&3),o>>>=2,l-=2}else if(w===17){for(R=_+3;l<R;){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}o>>>=_,l-=_,E=0,h=3+(o&7),o>>>=3,l-=3}else{for(R=_+7;l<R;){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}o>>>=_,l-=_,E=0,h=11+(o&127),o>>>=7,l-=7}if(t.have+h>t.nlen+t.ndist){a.msg="invalid bit length repeat",t.mode=BAD;break}for(;h--;)t.lens[t.have++]=E}}if(t.mode===BAD)break;if(t.lens[256]===0){a.msg="invalid code -- missing end-of-block",t.mode=BAD;break}if(t.lenbits=9,v={bits:t.lenbits},x=inftrees(LENS,t.lens,0,t.nlen,t.lencode,0,t.work,v),t.lenbits=v.bits,x){a.msg="invalid literal/lengths set",t.mode=BAD;break}if(t.distbits=6,t.distcode=t.distdyn,v={bits:t.distbits},x=inftrees(DISTS,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,v),t.distbits=v.bits,x){a.msg="invalid distances set",t.mode=BAD;break}if(t.mode=LEN_,r===Z_TREES)break e;case LEN_:t.mode=LEN;case LEN:if(i>=6&&u>=258){a.next_out=n,a.avail_out=u,a.next_in=e,a.avail_in=i,t.hold=o,t.bits=l,inffast(a,c),n=a.next_out,f=a.output,u=a.avail_out,e=a.next_in,s=a.input,i=a.avail_in,o=t.hold,l=t.bits,t.mode===TYPE&&(t.back=-1);break}for(t.back=0;y=t.lencode[o&(1<<t.lenbits)-1],_=y>>>24,g=y>>>16&255,w=y&65535,!(_<=l);){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}if(g&&(g&240)===0){for(m=_,k=g,A=w;y=t.lencode[A+((o&(1<<m+k)-1)>>m)],_=y>>>24,g=y>>>16&255,w=y&65535,!(m+_<=l);){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}o>>>=m,l-=m,t.back+=m}if(o>>>=_,l-=_,t.back+=_,t.length=w,g===0){t.mode=LIT;break}if(g&32){t.back=-1,t.mode=TYPE;break}if(g&64){a.msg="invalid literal/length code",t.mode=BAD;break}t.extra=g&15,t.mode=LENEXT;case LENEXT:if(t.extra){for(R=t.extra;l<R;){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}t.length+=o&(1<<t.extra)-1,o>>>=t.extra,l-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=DIST;case DIST:for(;y=t.distcode[o&(1<<t.distbits)-1],_=y>>>24,g=y>>>16&255,w=y&65535,!(_<=l);){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}if((g&240)===0){for(m=_,k=g,A=w;y=t.distcode[A+((o&(1<<m+k)-1)>>m)],_=y>>>24,g=y>>>16&255,w=y&65535,!(m+_<=l);){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}o>>>=m,l-=m,t.back+=m}if(o>>>=_,l-=_,t.back+=_,g&64){a.msg="invalid distance code",t.mode=BAD;break}t.offset=w,t.extra=g&15,t.mode=DISTEXT;case DISTEXT:if(t.extra){for(R=t.extra;l<R;){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}t.offset+=o&(1<<t.extra)-1,o>>>=t.extra,l-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){a.msg="invalid distance too far back",t.mode=BAD;break}t.mode=MATCH;case MATCH:if(u===0)break e;if(h=c-u,t.offset>h){if(h=t.offset-h,h>t.whave&&t.sane){a.msg="invalid distance too far back",t.mode=BAD;break}h>t.wnext?(h-=t.wnext,p=t.wsize-h):p=t.wnext-h,h>t.length&&(h=t.length),b=t.window}else b=f,p=n-t.offset,h=t.length;h>u&&(h=u),u-=h,t.length-=h;do f[n++]=b[p++];while(--h);t.length===0&&(t.mode=LEN);break;case LIT:if(u===0)break e;f[n++]=t.length,u--,t.mode=LEN;break;case CHECK:if(t.wrap){for(;l<32;){if(i===0)break e;i--,o|=s[e++]<<l,l+=8}if(c-=u,a.total_out+=c,t.total+=c,t.wrap&4&&c&&(a.adler=t.check=t.flags?crc32_1(t.check,f,c,n-c):adler32_1(t.check,f,c,n-c)),c=u,t.wrap&4&&(t.flags?o:zswap32(o))!==t.check){a.msg="incorrect data check",t.mode=BAD;break}o=0,l=0}t.mode=LENGTH;case LENGTH:if(t.wrap&&t.flags){for(;l<32;){if(i===0)break e;i--,o+=s[e++]<<l,l+=8}if(t.wrap&4&&o!==(t.total&4294967295)){a.msg="incorrect length check",t.mode=BAD;break}o=0,l=0}t.mode=DONE;case DONE:x=Z_STREAM_END$1;break e;case BAD:x=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return a.next_out=n,a.avail_out=u,a.next_in=e,a.avail_in=i,t.hold=o,t.bits=l,(t.wsize||c!==a.avail_out&&t.mode<BAD&&(t.mode<CHECK||r!==Z_FINISH$1))&&updatewindow(a,a.output,a.next_out,c-a.avail_out),d-=a.avail_in,c-=a.avail_out,a.total_in+=d,a.total_out+=c,t.total+=c,t.wrap&4&&c&&(a.adler=t.check=t.flags?crc32_1(t.check,f,c,a.next_out-c):adler32_1(t.check,f,c,a.next_out-c)),a.data_type=t.bits+(t.last?64:0)+(t.mode===TYPE?128:0)+(t.mode===LEN_||t.mode===COPY_?256:0),(d===0&&c===0||r===Z_FINISH$1)&&x===Z_OK$1&&(x=Z_BUF_ERROR),x},inflateEnd=a=>{if(inflateStateCheck(a))return Z_STREAM_ERROR$1;let r=a.state;return r.window&&(r.window=null),a.state=null,Z_OK$1},inflateGetHeader=(a,r)=>{if(inflateStateCheck(a))return Z_STREAM_ERROR$1;const t=a.state;return(t.wrap&2)===0?Z_STREAM_ERROR$1:(t.head=r,r.done=!1,Z_OK$1)},inflateSetDictionary=(a,r)=>{const t=r.length;let s,f,e;return inflateStateCheck(a)||(s=a.state,s.wrap!==0&&s.mode!==DICT)?Z_STREAM_ERROR$1:s.mode===DICT&&(f=1,f=adler32_1(f,r,t,0),f!==s.check)?Z_DATA_ERROR$1:(e=updatewindow(a,r,t,t),e?(s.mode=MEM,Z_MEM_ERROR$1):(s.havedict=1,Z_OK$1))};var inflateReset_1=inflateReset,inflateReset2_1=inflateReset2,inflateResetKeep_1=inflateResetKeep,inflateInit_1=inflateInit,inflateInit2_1=inflateInit2,inflate_2$1=inflate$2,inflateEnd_1=inflateEnd,inflateGetHeader_1=inflateGetHeader,inflateSetDictionary_1=inflateSetDictionary,inflateInfo="pako inflate (from Nodeca project)",inflate_1$2={inflateReset:inflateReset_1,inflateReset2:inflateReset2_1,inflateResetKeep:inflateResetKeep_1,inflateInit:inflateInit_1,inflateInit2:inflateInit2_1,inflate:inflate_2$1,inflateEnd:inflateEnd_1,inflateGetHeader:inflateGetHeader_1,inflateSetDictionary:inflateSetDictionary_1,inflateInfo};function GZheader(){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}var gzheader=GZheader;const toString=Object.prototype.toString,{Z_NO_FLUSH,Z_FINISH,Z_OK,Z_STREAM_END,Z_NEED_DICT,Z_STREAM_ERROR,Z_DATA_ERROR,Z_MEM_ERROR}=constants$2;function Inflate$1(a){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},a||{});const r=this.options;r.raw&&r.windowBits>=0&&r.windowBits<16&&(r.windowBits=-r.windowBits,r.windowBits===0&&(r.windowBits=-15)),r.windowBits>=0&&r.windowBits<16&&!(a&&a.windowBits)&&(r.windowBits+=32),r.windowBits>15&&r.windowBits<48&&(r.windowBits&15)===0&&(r.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let t=inflate_1$2.inflateInit2(this.strm,r.windowBits);if(t!==Z_OK)throw new Error(messages[t]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),r.dictionary&&(typeof r.dictionary=="string"?r.dictionary=strings.string2buf(r.dictionary):toString.call(r.dictionary)==="[object ArrayBuffer]"&&(r.dictionary=new Uint8Array(r.dictionary)),r.raw&&(t=inflate_1$2.inflateSetDictionary(this.strm,r.dictionary),t!==Z_OK)))throw new Error(messages[t])}Inflate$1.prototype.push=function(a,r){const t=this.strm,s=this.options.chunkSize,f=this.options.dictionary;let e,n,i;if(this.ended)return!1;for(r===~~r?n=r:n=r===!0?Z_FINISH:Z_NO_FLUSH,toString.call(a)==="[object ArrayBuffer]"?t.input=new Uint8Array(a):t.input=a,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(s),t.next_out=0,t.avail_out=s),e=inflate_1$2.inflate(t,n),e===Z_NEED_DICT&&f&&(e=inflate_1$2.inflateSetDictionary(t,f),e===Z_OK?e=inflate_1$2.inflate(t,n):e===Z_DATA_ERROR&&(e=Z_NEED_DICT));t.avail_in>0&&e===Z_STREAM_END&&t.state.wrap>0&&a[t.next_in]!==0;)inflate_1$2.inflateReset(t),e=inflate_1$2.inflate(t,n);switch(e){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(e),this.ended=!0,!1}if(i=t.avail_out,t.next_out&&(t.avail_out===0||e===Z_STREAM_END))if(this.options.to==="string"){let u=strings.utf8border(t.output,t.next_out),o=t.next_out-u,l=strings.buf2string(t.output,u);t.next_out=o,t.avail_out=s-o,o&&t.output.set(t.output.subarray(u,u+o),0),this.onData(l)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(e===Z_OK&&i===0)){if(e===Z_STREAM_END)return e=inflate_1$2.inflateEnd(this.strm),this.onEnd(e),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(a){this.chunks.push(a)},Inflate$1.prototype.onEnd=function(a){a===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg};function inflate$1(a,r){const t=new Inflate$1(r);if(t.push(a),t.err)throw t.msg||messages[t.err];return t.result}var inflate_2=inflate$1,inflate_1$1={inflate:inflate_2};const{inflate}=inflate_1$1;var inflate_1=inflate,commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=a;function a(r,t){for(var s=new Array(arguments.length-1),f=0,e=2,n=!0;e<arguments.length;)s[f++]=arguments[e++];return new Promise(function(u,o){s[f]=function(d){if(n)if(n=!1,d)o(d);else{for(var c=new Array(arguments.length-1),h=0;h<c.length;)c[h++]=arguments[h];u.apply(null,c)}};try{r.apply(t||null,s)}catch(l){n&&(n=!1,o(l))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,(function(a){var r=a;r.length=function(i){var u=i.length;if(!u)return 0;for(var o=0;--u%4>1&&i.charAt(u)==="=";)++o;return Math.ceil(i.length*3)/4-o};for(var t=new Array(64),s=new Array(123),f=0;f<64;)s[t[f]=f<26?f+65:f<52?f+71:f<62?f-4:f-59|43]=f++;r.encode=function(i,u,o){for(var l=null,d=[],c=0,h=0,p;u<o;){var b=i[u++];switch(h){case 0:d[c++]=t[b>>2],p=(b&3)<<4,h=1;break;case 1:d[c++]=t[p|b>>4],p=(b&15)<<2,h=2;break;case 2:d[c++]=t[p|b>>6],d[c++]=t[b&63],h=0;break}c>8191&&((l||(l=[])).push(String.fromCharCode.apply(String,d)),c=0)}return h&&(d[c++]=t[p],d[c++]=61,h===1&&(d[c++]=61)),l?(c&&l.push(String.fromCharCode.apply(String,d.slice(0,c))),l.join("")):String.fromCharCode.apply(String,d.slice(0,c))};var e="invalid encoding";r.decode=function(i,u,o){for(var l=o,d=0,c,h=0;h<i.length;){var p=i.charCodeAt(h++);if(p===61&&d>1)break;if((p=s[p])===void 0)throw Error(e);switch(d){case 0:c=p,d=1;break;case 1:u[o++]=c<<2|(p&48)>>4,c=p,d=2;break;case 2:u[o++]=(c&15)<<4|(p&60)>>2,c=p,d=3;break;case 3:u[o++]=(c&3)<<6|p,d=0;break}}if(d===1)throw Error(e);return o-l},r.test=function(i){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(i)}})(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=a;function a(){this._listeners={}}return a.prototype.on=function(t,s,f){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:s,ctx:f||this}),this},a.prototype.off=function(t,s){if(t===void 0)this._listeners={};else if(s===void 0)this._listeners[t]=[];else for(var f=this._listeners[t],e=0;e<f.length;)f[e].fn===s?f.splice(e,1):++e;return this},a.prototype.emit=function(t){var s=this._listeners[t];if(s){for(var f=[],e=1;e<arguments.length;)f.push(arguments[e++]);for(e=0;e<s.length;)s[e].fn.apply(s[e++].ctx,f)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=a(a);function a(e){return typeof Float32Array<"u"?(function(){var n=new Float32Array([-0]),i=new Uint8Array(n.buffer),u=i[3]===128;function o(h,p,b){n[0]=h,p[b]=i[0],p[b+1]=i[1],p[b+2]=i[2],p[b+3]=i[3]}function l(h,p,b){n[0]=h,p[b]=i[3],p[b+1]=i[2],p[b+2]=i[1],p[b+3]=i[0]}e.writeFloatLE=u?o:l,e.writeFloatBE=u?l:o;function d(h,p){return i[0]=h[p],i[1]=h[p+1],i[2]=h[p+2],i[3]=h[p+3],n[0]}function c(h,p){return i[3]=h[p],i[2]=h[p+1],i[1]=h[p+2],i[0]=h[p+3],n[0]}e.readFloatLE=u?d:c,e.readFloatBE=u?c:d})():(function(){function n(u,o,l,d){var c=o<0?1:0;if(c&&(o=-o),o===0)u(1/o>0?0:2147483648,l,d);else if(isNaN(o))u(2143289344,l,d);else if(o>34028234663852886e22)u((c<<31|2139095040)>>>0,l,d);else if(o<11754943508222875e-54)u((c<<31|Math.round(o/1401298464324817e-60))>>>0,l,d);else{var h=Math.floor(Math.log(o)/Math.LN2),p=Math.round(o*Math.pow(2,-h)*8388608)&8388607;u((c<<31|h+127<<23|p)>>>0,l,d)}}e.writeFloatLE=n.bind(null,r),e.writeFloatBE=n.bind(null,t);function i(u,o,l){var d=u(o,l),c=(d>>31)*2+1,h=d>>>23&255,p=d&8388607;return h===255?p?NaN:c*(1/0):h===0?c*1401298464324817e-60*p:c*Math.pow(2,h-150)*(p+8388608)}e.readFloatLE=i.bind(null,s),e.readFloatBE=i.bind(null,f)})(),typeof Float64Array<"u"?(function(){var n=new Float64Array([-0]),i=new Uint8Array(n.buffer),u=i[7]===128;function o(h,p,b){n[0]=h,p[b]=i[0],p[b+1]=i[1],p[b+2]=i[2],p[b+3]=i[3],p[b+4]=i[4],p[b+5]=i[5],p[b+6]=i[6],p[b+7]=i[7]}function l(h,p,b){n[0]=h,p[b]=i[7],p[b+1]=i[6],p[b+2]=i[5],p[b+3]=i[4],p[b+4]=i[3],p[b+5]=i[2],p[b+6]=i[1],p[b+7]=i[0]}e.writeDoubleLE=u?o:l,e.writeDoubleBE=u?l:o;function d(h,p){return i[0]=h[p],i[1]=h[p+1],i[2]=h[p+2],i[3]=h[p+3],i[4]=h[p+4],i[5]=h[p+5],i[6]=h[p+6],i[7]=h[p+7],n[0]}function c(h,p){return i[7]=h[p],i[6]=h[p+1],i[5]=h[p+2],i[4]=h[p+3],i[3]=h[p+4],i[2]=h[p+5],i[1]=h[p+6],i[0]=h[p+7],n[0]}e.readDoubleLE=u?d:c,e.readDoubleBE=u?c:d})():(function(){function n(u,o,l,d,c,h){var p=d<0?1:0;if(p&&(d=-d),d===0)u(0,c,h+o),u(1/d>0?0:2147483648,c,h+l);else if(isNaN(d))u(0,c,h+o),u(2146959360,c,h+l);else if(d>17976931348623157e292)u(0,c,h+o),u((p<<31|2146435072)>>>0,c,h+l);else{var b;if(d<22250738585072014e-324)b=d/5e-324,u(b>>>0,c,h+o),u((p<<31|b/4294967296)>>>0,c,h+l);else{var y=Math.floor(Math.log(d)/Math.LN2);y===1024&&(y=1023),b=d*Math.pow(2,-y),u(b*4503599627370496>>>0,c,h+o),u((p<<31|y+1023<<20|b*1048576&1048575)>>>0,c,h+l)}}}e.writeDoubleLE=n.bind(null,r,0,4),e.writeDoubleBE=n.bind(null,t,4,0);function i(u,o,l,d,c){var h=u(d,c+o),p=u(d,c+l),b=(p>>31)*2+1,y=p>>>20&2047,_=4294967296*(p&1048575)+h;return y===2047?_?NaN:b*(1/0):y===0?b*5e-324*_:b*Math.pow(2,y-1075)*(_+4503599627370496)}e.readDoubleLE=i.bind(null,s,0,4),e.readDoubleBE=i.bind(null,f,4,0)})(),e}function r(e,n,i){n[i]=e&255,n[i+1]=e>>>8&255,n[i+2]=e>>>16&255,n[i+3]=e>>>24}function t(e,n,i){n[i]=e>>>24,n[i+1]=e>>>16&255,n[i+2]=e>>>8&255,n[i+3]=e&255}function s(e,n){return(e[n]|e[n+1]<<8|e[n+2]<<16|e[n+3]<<24)>>>0}function f(e,n){return(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])>>>0}return float}var inquire_1,hasRequiredInquire;function requireInquire(){if(hasRequiredInquire)return inquire_1;hasRequiredInquire=1,inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(a){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,(function(a){var r=a;r.length=function(s){for(var f=0,e=0,n=0;n<s.length;++n)e=s.charCodeAt(n),e<128?f+=1:e<2048?f+=2:(e&64512)===55296&&(s.charCodeAt(n+1)&64512)===56320?(++n,f+=4):f+=3;return f},r.read=function(s,f,e){var n=e-f;if(n<1)return"";for(var i=null,u=[],o=0,l;f<e;)l=s[f++],l<128?u[o++]=l:l>191&&l<224?u[o++]=(l&31)<<6|s[f++]&63:l>239&&l<365?(l=((l&7)<<18|(s[f++]&63)<<12|(s[f++]&63)<<6|s[f++]&63)-65536,u[o++]=55296+(l>>10),u[o++]=56320+(l&1023)):u[o++]=(l&15)<<12|(s[f++]&63)<<6|s[f++]&63,o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,u)),o=0);return i?(o&&i.push(String.fromCharCode.apply(String,u.slice(0,o))),i.join("")):String.fromCharCode.apply(String,u.slice(0,o))},r.write=function(s,f,e){for(var n=e,i,u,o=0;o<s.length;++o)i=s.charCodeAt(o),i<128?f[e++]=i:i<2048?(f[e++]=i>>6|192,f[e++]=i&63|128):(i&64512)===55296&&((u=s.charCodeAt(o+1))&64512)===56320?(i=65536+((i&1023)<<10)+(u&1023),++o,f[e++]=i>>18|240,f[e++]=i>>12&63|128,f[e++]=i>>6&63|128,f[e++]=i&63|128):(f[e++]=i>>12|224,f[e++]=i>>6&63|128,f[e++]=i&63|128);return e-n}})(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=a;function a(r,t,s){var f=s||8192,e=f>>>1,n=null,i=f;return function(o){if(o<1||o>e)return r(o);i+o>f&&(n=r(f),i=0);var l=t.call(n,i,i+=o);return i&7&&(i=(i|7)+1),l}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=r;var a=requireMinimal$1();function r(e,n){this.lo=e>>>0,this.hi=n>>>0}var t=r.zero=new r(0,0);t.toNumber=function(){return 0},t.zzEncode=t.zzDecode=function(){return this},t.length=function(){return 1};var s=r.zeroHash="\\0\\0\\0\\0\\0\\0\\0\\0";r.fromNumber=function(n){if(n===0)return t;var i=n<0;i&&(n=-n);var u=n>>>0,o=(n-u)/4294967296>>>0;return i&&(o=~o>>>0,u=~u>>>0,++u>4294967295&&(u=0,++o>4294967295&&(o=0))),new r(u,o)},r.from=function(n){if(typeof n=="number")return r.fromNumber(n);if(a.isString(n))if(a.Long)n=a.Long.fromString(n);else return r.fromNumber(parseInt(n,10));return n.low||n.high?new r(n.low>>>0,n.high>>>0):t},r.prototype.toNumber=function(n){if(!n&&this.hi>>>31){var i=~this.lo+1>>>0,u=~this.hi>>>0;return i||(u=u+1>>>0),-(i+u*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(n){return a.Long?new a.Long(this.lo|0,this.hi|0,!!n):{low:this.lo|0,high:this.hi|0,unsigned:!!n}};var f=String.prototype.charCodeAt;return r.fromHash=function(n){return n===s?t:new r((f.call(n,0)|f.call(n,1)<<8|f.call(n,2)<<16|f.call(n,3)<<24)>>>0,(f.call(n,4)|f.call(n,5)<<8|f.call(n,6)<<16|f.call(n,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var n=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^n)>>>0,this.lo=(this.lo<<1^n)>>>0,this},r.prototype.zzDecode=function(){var n=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^n)>>>0,this.hi=(this.hi>>>1^n)>>>0,this},r.prototype.length=function(){var n=this.lo,i=(this.lo>>>28|this.hi<<4)>>>0,u=this.hi>>>24;return u===0?i===0?n<16384?n<128?1:2:n<2097152?3:4:i<16384?i<128?5:6:i<2097152?7:8:u<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,(function(a){var r=a;r.asPromise=requireAspromise(),r.base64=requireBase64(),r.EventEmitter=requireEventemitter(),r.float=requireFloat(),r.inquire=requireInquire(),r.utf8=requireUtf8(),r.pool=requirePool(),r.LongBits=requireLongbits(),r.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),r.global=r.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return typeof e=="string"||e instanceof String},r.isObject=function(e){return e&&typeof e=="object"},r.isset=r.isSet=function(e,n){var i=e[n];return i!=null&&e.hasOwnProperty(n)?typeof i!="object"||(Array.isArray(i)?i.length:Object.keys(i).length)>0:!1},r.Buffer=(function(){try{var f=r.inquire("buffer").Buffer;return f.prototype.utf8Write?f:null}catch{return null}})(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return typeof e=="number"?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)},r.Array=typeof Uint8Array<"u"?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,n){var i=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(i.lo,i.hi,n):i.toNumber(!!n)};function t(f,e,n){for(var i=Object.keys(e),u=0;u<i.length;++u)(f[i[u]]===void 0||!n)&&(f[i[u]]=e[i[u]]);return f}r.merge=t,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function s(f){function e(n,i){if(!(this instanceof e))return new e(n,i);Object.defineProperty(this,"message",{get:function(){return n}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),i&&t(this,i)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return f},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}r.newError=s,r.ProtocolError=s("ProtocolError"),r.oneOfGetter=function(e){for(var n={},i=0;i<e.length;++i)n[e[i]]=1;return function(){for(var u=Object.keys(this),o=u.length-1;o>-1;--o)if(n[u[o]]===1&&this[u[o]]!==void 0&&this[u[o]]!==null)return u[o]}},r.oneOfSetter=function(e){return function(n){for(var i=0;i<e.length;++i)e[i]!==n&&delete this[e[i]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var f=r.Buffer;if(!f){r._Buffer_from=r._Buffer_allocUnsafe=null;return}r._Buffer_from=f.from!==Uint8Array.from&&f.from||function(n,i){return new f(n,i)},r._Buffer_allocUnsafe=f.allocUnsafe||function(n){return new f(n)}}})(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=u;var a=requireMinimal$1(),r,t=a.LongBits,s=a.base64,f=a.utf8;function e(y,_,g){this.fn=y,this.len=_,this.next=void 0,this.val=g}function n(){}function i(y){this.head=y.head,this.tail=y.tail,this.len=y.len,this.next=y.states}function u(){this.len=0,this.head=new e(n,0,0),this.tail=this.head,this.states=null}var o=function(){return a.Buffer?function(){return(u.create=function(){return new r})()}:function(){return new u}};u.create=o(),u.alloc=function(_){return new a.Array(_)},a.Array!==Array&&(u.alloc=a.pool(u.alloc,a.Array.prototype.subarray)),u.prototype._push=function(_,g,w){return this.tail=this.tail.next=new e(_,g,w),this.len+=g,this};function l(y,_,g){_[g]=y&255}function d(y,_,g){for(;y>127;)_[g++]=y&127|128,y>>>=7;_[g]=y}function c(y,_){this.len=y,this.next=void 0,this.val=_}c.prototype=Object.create(e.prototype),c.prototype.fn=d,u.prototype.uint32=function(_){return this.len+=(this.tail=this.tail.next=new c((_=_>>>0)<128?1:_<16384?2:_<2097152?3:_<268435456?4:5,_)).len,this},u.prototype.int32=function(_){return _<0?this._push(h,10,t.fromNumber(_)):this.uint32(_)},u.prototype.sint32=function(_){return this.uint32((_<<1^_>>31)>>>0)};function h(y,_,g){for(;y.hi;)_[g++]=y.lo&127|128,y.lo=(y.lo>>>7|y.hi<<25)>>>0,y.hi>>>=7;for(;y.lo>127;)_[g++]=y.lo&127|128,y.lo=y.lo>>>7;_[g++]=y.lo}u.prototype.uint64=function(_){var g=t.from(_);return this._push(h,g.length(),g)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(_){var g=t.from(_).zzEncode();return this._push(h,g.length(),g)},u.prototype.bool=function(_){return this._push(l,1,_?1:0)};function p(y,_,g){_[g]=y&255,_[g+1]=y>>>8&255,_[g+2]=y>>>16&255,_[g+3]=y>>>24}u.prototype.fixed32=function(_){return this._push(p,4,_>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(_){var g=t.from(_);return this._push(p,4,g.lo)._push(p,4,g.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(_){return this._push(a.float.writeFloatLE,4,_)},u.prototype.double=function(_){return this._push(a.float.writeDoubleLE,8,_)};var b=a.Array.prototype.set?function(_,g,w){g.set(_,w)}:function(_,g,w){for(var m=0;m<_.length;++m)g[w+m]=_[m]};return u.prototype.bytes=function(_){var g=_.length>>>0;if(!g)return this._push(l,1,0);if(a.isString(_)){var w=u.alloc(g=s.length(_));s.decode(_,w,0),_=w}return this.uint32(g)._push(b,g,_)},u.prototype.string=function(_){var g=f.length(_);return g?this.uint32(g)._push(f.write,g,_):this._push(l,1,0)},u.prototype.fork=function(){return this.states=new i(this),this.head=this.tail=new e(n,0,0),this.len=0,this},u.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new e(n,0,0),this.len=0),this},u.prototype.ldelim=function(){var _=this.head,g=this.tail,w=this.len;return this.reset().uint32(w),w&&(this.tail.next=_.next,this.tail=g,this.len+=w),this},u.prototype.finish=function(){for(var _=this.head.next,g=this.constructor.alloc(this.len),w=0;_;)_.fn(_.val,g,w),w+=_.len,_=_.next;return g},u._configure=function(y){r=y,u.create=o(),r._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=t;var a=requireWriter();(t.prototype=Object.create(a.prototype)).constructor=t;var r=requireMinimal$1();function t(){a.call(this)}t._configure=function(){t.alloc=r._Buffer_allocUnsafe,t.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name==="set"?function(e,n,i){n.set(e,i)}:function(e,n,i){if(e.copy)e.copy(n,i,0,e.length);else for(var u=0;u<e.length;)n[i++]=e[u++]}},t.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,"base64"));var n=e.length>>>0;return this.uint32(n),n&&this._push(t.writeBytesBuffer,n,e),this};function s(f,e,n){f.length<40?r.utf8.write(f,e,n):e.utf8Write?e.utf8Write(f,n):e.write(f,n)}return t.prototype.string=function(e){var n=r.Buffer.byteLength(e);return this.uint32(n),n&&this._push(s,n,e),this},t._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=e;var a=requireMinimal$1(),r,t=a.LongBits,s=a.utf8;function f(d,c){return RangeError("index out of range: "+d.pos+" + "+(c||1)+" > "+d.len)}function e(d){this.buf=d,this.pos=0,this.len=d.length}var n=typeof Uint8Array<"u"?function(c){if(c instanceof Uint8Array||Array.isArray(c))return new e(c);throw Error("illegal buffer")}:function(c){if(Array.isArray(c))return new e(c);throw Error("illegal buffer")},i=function(){return a.Buffer?function(h){return(e.create=function(b){return a.Buffer.isBuffer(b)?new r(b):n(b)})(h)}:n};e.create=i(),e.prototype._slice=a.Array.prototype.subarray||a.Array.prototype.slice,e.prototype.uint32=(function(){var c=4294967295;return function(){if(c=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(c=(c|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(c=(c|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(c=(c|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(c=(c|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return c;if((this.pos+=5)>this.len)throw this.pos=this.len,f(this,10);return c}})(),e.prototype.int32=function(){return this.uint32()|0},e.prototype.sint32=function(){var c=this.uint32();return c>>>1^-(c&1)|0};function u(){var d=new t(0,0),c=0;if(this.len-this.pos>4){for(;c<4;++c)if(d.lo=(d.lo|(this.buf[this.pos]&127)<<c*7)>>>0,this.buf[this.pos++]<128)return d;if(d.lo=(d.lo|(this.buf[this.pos]&127)<<28)>>>0,d.hi=(d.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return d;c=0}else{for(;c<3;++c){if(this.pos>=this.len)throw f(this);if(d.lo=(d.lo|(this.buf[this.pos]&127)<<c*7)>>>0,this.buf[this.pos++]<128)return d}return d.lo=(d.lo|(this.buf[this.pos++]&127)<<c*7)>>>0,d}if(this.len-this.pos>4){for(;c<5;++c)if(d.hi=(d.hi|(this.buf[this.pos]&127)<<c*7+3)>>>0,this.buf[this.pos++]<128)return d}else for(;c<5;++c){if(this.pos>=this.len)throw f(this);if(d.hi=(d.hi|(this.buf[this.pos]&127)<<c*7+3)>>>0,this.buf[this.pos++]<128)return d}throw Error("invalid varint encoding")}e.prototype.bool=function(){return this.uint32()!==0};function o(d,c){return(d[c-4]|d[c-3]<<8|d[c-2]<<16|d[c-1]<<24)>>>0}e.prototype.fixed32=function(){if(this.pos+4>this.len)throw f(this,4);return o(this.buf,this.pos+=4)},e.prototype.sfixed32=function(){if(this.pos+4>this.len)throw f(this,4);return o(this.buf,this.pos+=4)|0};function l(){if(this.pos+8>this.len)throw f(this,8);return new t(o(this.buf,this.pos+=4),o(this.buf,this.pos+=4))}return e.prototype.float=function(){if(this.pos+4>this.len)throw f(this,4);var c=a.float.readFloatLE(this.buf,this.pos);return this.pos+=4,c},e.prototype.double=function(){if(this.pos+8>this.len)throw f(this,4);var c=a.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,c},e.prototype.bytes=function(){var c=this.uint32(),h=this.pos,p=this.pos+c;if(p>this.len)throw f(this,c);if(this.pos+=c,Array.isArray(this.buf))return this.buf.slice(h,p);if(h===p){var b=a.Buffer;return b?b.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,h,p)},e.prototype.string=function(){var c=this.bytes();return s.read(c,0,c.length)},e.prototype.skip=function(c){if(typeof c=="number"){if(this.pos+c>this.len)throw f(this,c);this.pos+=c}else do if(this.pos>=this.len)throw f(this);while(this.buf[this.pos++]&128);return this},e.prototype.skipType=function(d){switch(d){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(d=this.uint32()&7)!==4;)this.skipType(d);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+d+" at offset "+this.pos)}return this},e._configure=function(d){r=d,e.create=i(),r._configure();var c=a.Long?"toLong":"toNumber";a.merge(e.prototype,{int64:function(){return u.call(this)[c](!1)},uint64:function(){return u.call(this)[c](!0)},sint64:function(){return u.call(this).zzDecode()[c](!1)},fixed64:function(){return l.call(this)[c](!0)},sfixed64:function(){return l.call(this)[c](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=t;var a=requireReader();(t.prototype=Object.create(a.prototype)).constructor=t;var r=requireMinimal$1();function t(s){a.call(this,s)}return t._configure=function(){r.Buffer&&(t.prototype._slice=r.Buffer.prototype.slice)},t.prototype.string=function(){var f=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+f,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+f,this.len))},t._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=r;var a=requireMinimal$1();(r.prototype=Object.create(a.EventEmitter.prototype)).constructor=r;function r(t,s,f){if(typeof t!="function")throw TypeError("rpcImpl must be a function");a.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!s,this.responseDelimited=!!f}return r.prototype.rpcCall=function t(s,f,e,n,i){if(!n)throw TypeError("request must be specified");var u=this;if(!i)return a.asPromise(t,u,s,f,e,n);if(!u.rpcImpl){setTimeout(function(){i(Error("already ended"))},0);return}try{return u.rpcImpl(s,f[u.requestDelimited?"encodeDelimited":"encode"](n).finish(),function(l,d){if(l)return u.emit("error",l,s),i(l);if(d===null){u.end(!0);return}if(!(d instanceof e))try{d=e[u.responseDelimited?"decodeDelimited":"decode"](d)}catch(c){return u.emit("error",c,s),i(c)}return u.emit("data",d,s),i(null,d)})}catch(o){u.emit("error",o,s),setTimeout(function(){i(o)},0);return}},r.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,(function(a){var r=a;r.Service=requireService()})(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,(function(a){var r=a;r.build="minimal",r.Writer=requireWriter(),r.BufferWriter=requireWriter_buffer(),r.Reader=requireReader(),r.BufferReader=requireReader_buffer(),r.util=requireMinimal$1(),r.rpc=requireRpc(),r.roots=requireRoots(),r.configure=t;function t(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}t()})(indexMinimal)),indexMinimal}var minimal,hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,minimal=requireIndexMinimal()),minimal}var minimalExports=requireMinimal();const $Reader=minimalExports.Reader,$util=minimalExports.util,$root=minimalExports.roots.default||(minimalExports.roots.default={}),com=$root.com=(()=>{const a={};return a.opensource=(function(){const r={};return r.svga=(function(){const t={};return t.MovieParams=(function(){function s(f){if(f)for(var e=Object.keys(f),n=0;n<e.length;++n)f[e[n]]!=null&&(this[e[n]]=f[e[n]])}return s.prototype.viewBoxWidth=0,s.prototype.viewBoxHeight=0,s.prototype.fps=0,s.prototype.frames=0,s.decode=function(e,n,i){e instanceof $Reader||(e=$Reader.create(e));for(var u=n===void 0?e.len:e.pos+n,o=new $root.com.opensource.svga.MovieParams;e.pos<u;){var l=e.uint32();if(l===i)break;switch(l>>>3){case 1:{o.viewBoxWidth=e.float();break}case 2:{o.viewBoxHeight=e.float();break}case 3:{o.fps=e.int32();break}case 4:{o.frames=e.int32();break}default:e.skipType(l&7);break}}return o},s.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.opensource.svga.MovieParams"},s})(),t.SpriteEntity=(function(){function s(f){if(this.frames=[],f)for(var e=Object.keys(f),n=0;n<e.length;++n)f[e[n]]!=null&&(this[e[n]]=f[e[n]])}return s.prototype.imageKey="",s.prototype.frames=$util.emptyArray,s.prototype.matteKey="",s.decode=function(e,n,i){e instanceof $Reader||(e=$Reader.create(e));for(var u=n===void 0?e.len:e.pos+n,o=new $root.com.opensource.svga.SpriteEntity;e.pos<u;){var l=e.uint32();if(l===i)break;switch(l>>>3){case 1:{o.imageKey=e.string();break}case 2:{o.frames&&o.frames.length||(o.frames=[]),o.frames.push($root.com.opensource.svga.FrameEntity.decode(e,e.uint32()));break}case 3:{o.matteKey=e.string();break}default:e.skipType(l&7);break}}return o},s.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.opensource.svga.SpriteEntity"},s})(),t.AudioEntity=(function(){function s(f){if(f)for(var e=Object.keys(f),n=0;n<e.length;++n)f[e[n]]!=null&&(this[e[n]]=f[e[n]])}return s.prototype.audioKey="",s.prototype.startFrame=0,s.prototype.endFrame=0,s.prototype.startTime=0,s.prototype.totalTime=0,s.decode=function(e,n,i){e instanceof $Reader||(e=$Reader.create(e));for(var u=n===void 0?e.len:e.pos+n,o=new $root.com.opensource.svga.AudioEntity;e.pos<u;){var l=e.uint32();if(l===i)break;switch(l>>>3){case 1:{o.audioKey=e.string();break}case 2:{o.startFrame=e.int32();break}case 3:{o.endFrame=e.int32();break}case 4:{o.startTime=e.int32();break}case 5:{o.totalTime=e.int32();break}default:e.skipType(l&7);break}}return o},s.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.opensource.svga.AudioEntity"},s})(),t.Layout=(function(){function s(f){if(f)for(var e=Object.keys(f),n=0;n<e.length;++n)f[e[n]]!=null&&(this[e[n]]=f[e[n]])}return s.prototype.x=0,s.prototype.y=0,s.prototype.width=0,s.prototype.height=0,s.decode=function(e,n,i){e instanceof $Reader||(e=$Reader.create(e));for(var u=n===void 0?e.len:e.pos+n,o=new $root.com.opensource.svga.Layout;e.pos<u;){var l=e.uint32();if(l===i)break;switch(l>>>3){case 1:{o.x=e.float();break}case 2:{o.y=e.float();break}case 3:{o.width=e.float();break}case 4:{o.height=e.float();break}default:e.skipType(l&7);break}}return o},s.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.opensource.svga.Layout"},s})(),t.Transform=(function(){function s(f){if(f)for(var e=Object.keys(f),n=0;n<e.length;++n)f[e[n]]!=null&&(this[e[n]]=f[e[n]])}return s.prototype.a=0,s.prototype.b=0,s.prototype.c=0,s.prototype.d=0,s.prototype.tx=0,s.prototype.ty=0,s.decode=function(e,n,i){e instanceof $Reader||(e=$Reader.create(e));for(var u=n===void 0?e.len:e.pos+n,o=new $root.com.opensource.svga.Transform;e.pos<u;){var l=e.uint32();if(l===i)break;switch(l>>>3){case 1:{o.a=e.float();break}case 2:{o.b=e.float();break}case 3:{o.c=e.float();break}case 4:{o.d=e.float();break}case 5:{o.tx=e.float();break}case 6:{o.ty=e.float();break}default:e.skipType(l&7);break}}return o},s.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.opensource.svga.Transform"},s})(),t.ShapeEntity=(function(){function s(e){if(e)for(var n=Object.keys(e),i=0;i<n.length;++i)e[n[i]]!=null&&(this[n[i]]=e[n[i]])}s.prototype.type=0,s.prototype.shape=null,s.prototype.rect=null,s.prototype.ellipse=null,s.prototype.styles=null,s.prototype.transform=null;let f;return Object.defineProperty(s.prototype,"args",{get:$util.oneOfGetter(f=["shape","rect","ellipse"]),set:$util.oneOfSetter(f)}),s.decode=function(n,i,u){n instanceof $Reader||(n=$Reader.create(n));for(var o=i===void 0?n.len:n.pos+i,l=new $root.com.opensource.svga.ShapeEntity;n.pos<o;){var d=n.uint32();if(d===u)break;switch(d>>>3){case 1:{l.type=n.int32();break}case 2:{l.shape=$root.com.opensource.svga.ShapeEntity.ShapeArgs.decode(n,n.uint32());break}case 3:{l.rect=$root.com.opensource.svga.ShapeEntity.RectArgs.decode(n,n.uint32());break}case 4:{l.ellipse=$root.com.opensource.svga.ShapeEntity.EllipseArgs.decode(n,n.uint32());break}case 10:{l.styles=$root.com.opensource.svga.ShapeEntity.ShapeStyle.decode(n,n.uint32());break}case 11:{l.transform=$root.com.opensource.svga.Transform.decode(n,n.uint32());break}default:n.skipType(d&7);break}}return l},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.opensource.svga.ShapeEntity"},s.ShapeType=(function(){const e={},n=Object.create(e);return n[e[0]="SHAPE"]=0,n[e[1]="RECT"]=1,n[e[2]="ELLIPSE"]=2,n[e[3]="KEEP"]=3,n})(),s.ShapeArgs=(function(){function e(n){if(n)for(var i=Object.keys(n),u=0;u<i.length;++u)n[i[u]]!=null&&(this[i[u]]=n[i[u]])}return e.prototype.d="",e.decode=function(i,u,o){i instanceof $Reader||(i=$Reader.create(i));for(var l=u===void 0?i.len:i.pos+u,d=new $root.com.opensource.svga.ShapeEntity.ShapeArgs;i.pos<l;){var c=i.uint32();if(c===o)break;c>>>3===1?d.d=i.string():i.skipType(c&7)}return d},e.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.opensource.svga.ShapeEntity.ShapeArgs"},e})(),s.RectArgs=(function(){function e(n){if(n)for(var i=Object.keys(n),u=0;u<i.length;++u)n[i[u]]!=null&&(this[i[u]]=n[i[u]])}return e.prototype.x=0,e.prototype.y=0,e.prototype.width=0,e.prototype.height=0,e.prototype.cornerRadius=0,e.decode=function(i,u,o){i instanceof $Reader||(i=$Reader.create(i));for(var l=u===void 0?i.len:i.pos+u,d=new $root.com.opensource.svga.ShapeEntity.RectArgs;i.pos<l;){var c=i.uint32();if(c===o)break;switch(c>>>3){case 1:{d.x=i.float();break}case 2:{d.y=i.float();break}case 3:{d.width=i.float();break}case 4:{d.height=i.float();break}case 5:{d.cornerRadius=i.float();break}default:i.skipType(c&7);break}}return d},e.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.opensource.svga.ShapeEntity.RectArgs"},e})(),s.EllipseArgs=(function(){function e(n){if(n)for(var i=Object.keys(n),u=0;u<i.length;++u)n[i[u]]!=null&&(this[i[u]]=n[i[u]])}return e.prototype.x=0,e.prototype.y=0,e.prototype.radiusX=0,e.prototype.radiusY=0,e.decode=function(i,u,o){i instanceof $Reader||(i=$Reader.create(i));for(var l=u===void 0?i.len:i.pos+u,d=new $root.com.opensource.svga.ShapeEntity.EllipseArgs;i.pos<l;){var c=i.uint32();if(c===o)break;switch(c>>>3){case 1:{d.x=i.float();break}case 2:{d.y=i.float();break}case 3:{d.radiusX=i.float();break}case 4:{d.radiusY=i.float();break}default:i.skipType(c&7);break}}return d},e.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.opensource.svga.ShapeEntity.EllipseArgs"},e})(),s.ShapeStyle=(function(){function e(n){if(n)for(var i=Object.keys(n),u=0;u<i.length;++u)n[i[u]]!=null&&(this[i[u]]=n[i[u]])}return e.prototype.fill=null,e.prototype.stroke=null,e.prototype.strokeWidth=0,e.prototype.lineCap=0,e.prototype.lineJoin=0,e.prototype.miterLimit=0,e.prototype.lineDashI=0,e.prototype.lineDashII=0,e.prototype.lineDashIII=0,e.decode=function(i,u,o){i instanceof $Reader||(i=$Reader.create(i));for(var l=u===void 0?i.len:i.pos+u,d=new $root.com.opensource.svga.ShapeEntity.ShapeStyle;i.pos<l;){var c=i.uint32();if(c===o)break;switch(c>>>3){case 1:{d.fill=$root.com.opensource.svga.ShapeEntity.ShapeStyle.RGBAColor.decode(i,i.uint32());break}case 2:{d.stroke=$root.com.opensource.svga.ShapeEntity.ShapeStyle.RGBAColor.decode(i,i.uint32());break}case 3:{d.strokeWidth=i.float();break}case 4:{d.lineCap=i.int32();break}case 5:{d.lineJoin=i.int32();break}case 6:{d.miterLimit=i.float();break}case 7:{d.lineDashI=i.float();break}case 8:{d.lineDashII=i.float();break}case 9:{d.lineDashIII=i.float();break}default:i.skipType(c&7);break}}return d},e.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.opensource.svga.ShapeEntity.ShapeStyle"},e.RGBAColor=(function(){function n(i){if(i)for(var u=Object.keys(i),o=0;o<u.length;++o)i[u[o]]!=null&&(this[u[o]]=i[u[o]])}return n.prototype.r=0,n.prototype.g=0,n.prototype.b=0,n.prototype.a=0,n.decode=function(u,o,l){u instanceof $Reader||(u=$Reader.create(u));for(var d=o===void 0?u.len:u.pos+o,c=new $root.com.opensource.svga.ShapeEntity.ShapeStyle.RGBAColor;u.pos<d;){var h=u.uint32();if(h===l)break;switch(h>>>3){case 1:{c.r=u.float();break}case 2:{c.g=u.float();break}case 3:{c.b=u.float();break}case 4:{c.a=u.float();break}default:u.skipType(h&7);break}}return c},n.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.opensource.svga.ShapeEntity.ShapeStyle.RGBAColor"},n})(),e.LineCap=(function(){const n={},i=Object.create(n);return i[n[0]="LineCap_BUTT"]=0,i[n[1]="LineCap_ROUND"]=1,i[n[2]="LineCap_SQUARE"]=2,i})(),e.LineJoin=(function(){const n={},i=Object.create(n);return i[n[0]="LineJoin_MITER"]=0,i[n[1]="LineJoin_ROUND"]=1,i[n[2]="LineJoin_BEVEL"]=2,i})(),e})(),s})(),t.FrameEntity=(function(){function s(f){if(this.shapes=[],f)for(var e=Object.keys(f),n=0;n<e.length;++n)f[e[n]]!=null&&(this[e[n]]=f[e[n]])}return s.prototype.alpha=0,s.prototype.layout=null,s.prototype.transform=null,s.prototype.clipPath="",s.prototype.shapes=$util.emptyArray,s.decode=function(e,n,i){e instanceof $Reader||(e=$Reader.create(e));for(var u=n===void 0?e.len:e.pos+n,o=new $root.com.opensource.svga.FrameEntity;e.pos<u;){var l=e.uint32();if(l===i)break;switch(l>>>3){case 1:{o.alpha=e.float();break}case 2:{o.layout=$root.com.opensource.svga.Layout.decode(e,e.uint32());break}case 3:{o.transform=$root.com.opensource.svga.Transform.decode(e,e.uint32());break}case 4:{o.clipPath=e.string();break}case 5:{o.shapes&&o.shapes.length||(o.shapes=[]),o.shapes.push($root.com.opensource.svga.ShapeEntity.decode(e,e.uint32()));break}default:e.skipType(l&7);break}}return o},s.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.opensource.svga.FrameEntity"},s})(),t.MovieEntity=(function(){function s(f){if(this.images={},this.sprites=[],this.audios=[],f)for(var e=Object.keys(f),n=0;n<e.length;++n)f[e[n]]!=null&&(this[e[n]]=f[e[n]])}return s.prototype.version="",s.prototype.params=null,s.prototype.images=$util.emptyObject,s.prototype.sprites=$util.emptyArray,s.prototype.audios=$util.emptyArray,s.decode=function(e,n,i){e instanceof $Reader||(e=$Reader.create(e));for(var u=n===void 0?e.len:e.pos+n,o=new $root.com.opensource.svga.MovieEntity,l,d;e.pos<u;){var c=e.uint32();if(c===i)break;switch(c>>>3){case 1:{o.version=e.string();break}case 2:{o.params=$root.com.opensource.svga.MovieParams.decode(e,e.uint32());break}case 3:{o.images===$util.emptyObject&&(o.images={});var h=e.uint32()+e.pos;for(l="",d=[];e.pos<h;){var p=e.uint32();switch(p>>>3){case 1:l=e.string();break;case 2:d=e.bytes();break;default:e.skipType(p&7);break}}o.images[l]=d;break}case 4:{o.sprites&&o.sprites.length||(o.sprites=[]),o.sprites.push($root.com.opensource.svga.SpriteEntity.decode(e,e.uint32()));break}case 5:{o.audios&&o.audios.length||(o.audios=[]),o.audios.push($root.com.opensource.svga.AudioEntity.decode(e,e.uint32()));break}default:e.skipType(c&7);break}}return o},s.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.opensource.svga.MovieEntity"},s})(),t})(),r})(),a})(),svga$1=com.opensource.svga,$=class ${constructor(r){if(this.shapes=[],this.alpha=r.alpha||0,this.layout={x:r.layout?.x||0,y:r.layout?.y||0,width:r.layout?.width||0,height:r.layout?.height||0},this.transform={a:r.transform?.a||1,b:r.transform?.b||0,c:r.transform?.c||0,d:r.transform?.d||1,tx:r.transform?.tx||0,ty:r.transform?.ty||0},this.clipPath=r.clipPath||null,r.shapes)if(r.shapes[0]&&r.shapes[0].type===svga$1.ShapeEntity.ShapeType.KEEP)this.shapes=$.lastShapes;else{const t=r.shapes.map(s=>{if(Object.prototype.hasOwnProperty.call(s,"type")||Object.defineProperty(s,"type",{value:s.type,enumerable:!0}),s.styles){if(s.styles.fill){const{r:f,g:e,b:n,a:i}=s.styles.fill;s.styles.fillStr=`rgba(${parseInt((f*255).toString())}, ${parseInt((e*255).toString())}, ${parseInt((n*255).toString())}, ${i})`}if(s.styles.stroke){const{r:f,g:e,b:n,a:i}=s.styles.stroke;s.styles.strokeStr=`rgba(${parseInt((f*255).toString())}, ${parseInt((e*255).toString())}, ${parseInt((n*255).toString())}, ${i})`}switch(s.styles.lineJoin){case svga$1.ShapeEntity.ShapeStyle.LineJoin.LineJoin_MITER:s.styles.lineJoinStr="miter";break;case svga$1.ShapeEntity.ShapeStyle.LineJoin.LineJoin_ROUND:s.styles.lineJoinStr="round";break;case svga$1.ShapeEntity.ShapeStyle.LineJoin.LineJoin_BEVEL:s.styles.lineJoinStr="bevel";break}switch(s.styles.lineCap){case svga$1.ShapeEntity.ShapeStyle.LineCap.LineCap_BUTT:s.styles.lineCapStr="butt";break;case svga$1.ShapeEntity.ShapeStyle.LineCap.LineCap_ROUND:s.styles.lineCapStr="round";break;case svga$1.ShapeEntity.ShapeStyle.LineCap.LineCap_SQUARE:s.styles.lineCapStr="square";break}}return s});$.lastShapes=t,this.shapes=t}}};$.lastShapes=[];let FrameEntity=$;class VideoEntity{constructor(r,t,s){this.videoSize={width:0,height:0},this.images={},this.audios={},this.dynamicElements={},this.sprites=[],this.version=r.version,this.videoSize.width=r.params?.viewBoxWidth||0,this.videoSize.height=r.params?.viewBoxHeight||0,this.FPS=r.params?.fps||20,this.frames=r.params?.frames||0,this.sprites=r.sprites.map(({imageKey:f=null,frames:e})=>({imageKey:f,frames:(e||[]).map(n=>new FrameEntity(n))})),this.images=t,this.audios=s}}const svga=com.opensource.svga,toTransferableBuffer=a=>{const r=new Uint8Array(a.byteLength);return r.set(a),r.buffer};onmessage=function(a){const r=inflate_1(new Uint8Array(a.data.data)),t=svga.MovieEntity.decode(r),s={},f={},e=new Set;t.audios.forEach(u=>{const{audioKey:o,endFrame:l,startFrame:d,startTime:c,totalTime:h}=u,p=t.images[o];if(!p)return;const b=toTransferableBuffer(p);e.add(b),f[o]={audioKey:o,source:b,startFrame:d,endFrame:l,startTime:c,totalTime:h}});for(const u in t.images){const o=t.images[u];if(o[0]===73)continue;if(o[0]!==137){console.warn("unrecognized svga image source",o,t);continue}const l=toTransferableBuffer(o);s[u]=l,e.add(l)}const n=new VideoEntity(t,s,f),i=Array.from(e);postMessage({result:n,id:a.data.id},i)}})();\n',blob=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",jsContent],{type:"text/javascript;charset=utf-8"});function WorkerWrapper(e){let t;try{if(t=blob&&(self.URL||self.webkitURL).createObjectURL(blob),!t)throw"";const r=new Worker(t,{name:e?.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(jsContent),{name:e?.name})}}var Version=(e=>(e[e.VERSION_1=1]="VERSION_1",e[e.VERSION_2=2]="VERSION_2",e))(Version||{});function getVersion(e){return 80==e[0]&&75==e[1]&&3==e[2]&&4==e[3]?1:2}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;return hasRequiredAspromise=1,aspromise=function(e,t){for(var r=new Array(arguments.length-1),i=0,n=2,o=!0;n<arguments.length;)r[i++]=arguments[n++];return new Promise((function(n,s){r[i]=function(e){if(o)if(o=!1,e)s(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];n.apply(null,t)}};try{e.apply(t||null,r)}catch(e){o&&(o=!1,s(e))}}))},aspromise}var base64={},hasRequiredBase64,eventemitter,hasRequiredEventemitter,float,hasRequiredFloat,inquire_1,hasRequiredInquire;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(){var e=base64;e.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var t=new Array(64),r=new Array(123),i=0;i<64;)r[t[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;e.encode=function(e,r,i){for(var n,o=null,s=[],a=0,u=0;r<i;){var l=e[r++];switch(u){case 0:s[a++]=t[l>>2],n=(3&l)<<4,u=1;break;case 1:s[a++]=t[n|l>>4],n=(15&l)<<2,u=2;break;case 2:s[a++]=t[n|l>>6],s[a++]=t[63&l],u=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),a=0)}return u&&(s[a++]=t[n],s[a++]=61,1===u&&(s[a++]=61)),o?(a&&o.push(String.fromCharCode.apply(String,s.slice(0,a))),o.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var n="invalid encoding";e.decode=function(e,t,i){for(var o,s=i,a=0,u=0;u<e.length;){var l=e.charCodeAt(u++);if(61===l&&a>1)break;if(void 0===(l=r[l]))throw Error(n);switch(a){case 0:o=l,a=1;break;case 1:t[i++]=o<<2|(48&l)>>4,o=l,a=2;break;case 2:t[i++]=(15&o)<<4|(60&l)>>2,o=l,a=3;break;case 3:t[i++]=(3&o)<<6|l,a=0}}if(1===a)throw Error(n);return i-s},e.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}()),base64}function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;function e(){this._listeners={}}return hasRequiredEventemitter=1,eventemitter=e,e.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},e.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],i=0;i<r.length;)r[i].fn===t?r.splice(i,1):++i;return this},e.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],i=1;i<arguments.length;)r.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,r)}return this},eventemitter}function requireFloat(){if(hasRequiredFloat)return float;function e(e){return typeof Float32Array<"u"?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),i=128===r[3];function n(e,i,n){t[0]=e,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3]}function o(e,i,n){t[0]=e,i[n]=r[3],i[n+1]=r[2],i[n+2]=r[1],i[n+3]=r[0]}function s(e,i){return r[0]=e[i],r[1]=e[i+1],r[2]=e[i+2],r[3]=e[i+3],t[0]}function a(e,i){return r[3]=e[i],r[2]=e[i+1],r[1]=e[i+2],r[0]=e[i+3],t[0]}e.writeFloatLE=i?n:o,e.writeFloatBE=i?o:n,e.readFloatLE=i?s:a,e.readFloatBE=i?a:s}():function(){function o(e,t,r,i){var n=t<0?1:0;if(n&&(t=-t),0===t)e(1/t>0?0:2147483648,r,i);else if(isNaN(t))e(2143289344,r,i);else if(t>34028234663852886e22)e((n<<31|2139095040)>>>0,r,i);else if(t<11754943508222875e-54)e((n<<31|Math.round(t/1401298464324817e-60))>>>0,r,i);else{var o=Math.floor(Math.log(t)/Math.LN2);e((n<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,r,i)}}function s(e,t,r){var i=e(t,r),n=2*(i>>31)+1,o=i>>>23&255,s=8388607&i;return 255===o?s?NaN:n*(1/0):0===o?1401298464324817e-60*n*s:n*Math.pow(2,o-150)*(s+8388608)}e.writeFloatLE=o.bind(null,t),e.writeFloatBE=o.bind(null,r),e.readFloatLE=s.bind(null,i),e.readFloatBE=s.bind(null,n)}(),typeof Float64Array<"u"?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),i=128===r[7];function n(e,i,n){t[0]=e,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3],i[n+4]=r[4],i[n+5]=r[5],i[n+6]=r[6],i[n+7]=r[7]}function o(e,i,n){t[0]=e,i[n]=r[7],i[n+1]=r[6],i[n+2]=r[5],i[n+3]=r[4],i[n+4]=r[3],i[n+5]=r[2],i[n+6]=r[1],i[n+7]=r[0]}function s(e,i){return r[0]=e[i],r[1]=e[i+1],r[2]=e[i+2],r[3]=e[i+3],r[4]=e[i+4],r[5]=e[i+5],r[6]=e[i+6],r[7]=e[i+7],t[0]}function a(e,i){return r[7]=e[i],r[6]=e[i+1],r[5]=e[i+2],r[4]=e[i+3],r[3]=e[i+4],r[2]=e[i+5],r[1]=e[i+6],r[0]=e[i+7],t[0]}e.writeDoubleLE=i?n:o,e.writeDoubleBE=i?o:n,e.readDoubleLE=i?s:a,e.readDoubleBE=i?a:s}():function(){function o(e,t,r,i,n,o){var s=i<0?1:0;if(s&&(i=-i),0===i)e(0,n,o+t),e(1/i>0?0:2147483648,n,o+r);else if(isNaN(i))e(0,n,o+t),e(2146959360,n,o+r);else if(i>17976931348623157e292)e(0,n,o+t),e((s<<31|2146435072)>>>0,n,o+r);else{var a;if(i<22250738585072014e-324)e((a=i/5e-324)>>>0,n,o+t),e((s<<31|a/4294967296)>>>0,n,o+r);else{var u=Math.floor(Math.log(i)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(a=i*Math.pow(2,-u))>>>0,n,o+t),e((s<<31|u+1023<<20|1048576*a&1048575)>>>0,n,o+r)}}}function s(e,t,r,i,n){var o=e(i,n+t),s=e(i,n+r),a=2*(s>>31)+1,u=s>>>20&2047,l=4294967296*(1048575&s)+o;return 2047===u?l?NaN:a*(1/0):0===u?5e-324*a*l:a*Math.pow(2,u-1075)*(l+4503599627370496)}e.writeDoubleLE=o.bind(null,t,0,4),e.writeDoubleBE=o.bind(null,r,4,0),e.readDoubleLE=s.bind(null,i,0,4),e.readDoubleBE=s.bind(null,n,4,0)}(),e}function t(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function r(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function n(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}return hasRequiredFloat=1,float=e(e)}function requireInquire(){if(hasRequiredInquire)return inquire_1;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}return hasRequiredInquire=1,inquire_1=inquire,inquire_1}var utf8={},hasRequiredUtf8,pool_1,hasRequiredPool,longbits,hasRequiredLongbits,hasRequiredMinimal$1,writer,hasRequiredWriter,writer_buffer,hasRequiredWriter_buffer,reader,hasRequiredReader,reader_buffer,hasRequiredReader_buffer;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,(e=utf8).length=function(e){for(var t=0,r=0,i=0;i<e.length;++i)(r=e.charCodeAt(i))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(i+1))?(++i,t+=4):t+=3;return t},e.read=function(e,t,r){if(r-t<1)return"";for(var i,n=null,o=[],s=0;t<r;)(i=e[t++])<128?o[s++]=i:i>191&&i<224?o[s++]=(31&i)<<6|63&e[t++]:i>239&&i<365?(i=((7&i)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[s++]=55296+(i>>10),o[s++]=56320+(1023&i)):o[s++]=(15&i)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,o)),s=0);return n?(s&&n.push(String.fromCharCode.apply(String,o.slice(0,s))),n.join("")):String.fromCharCode.apply(String,o.slice(0,s))},e.write=function(e,t,r){for(var i,n,o=r,s=0;s<e.length;++s)(i=e.charCodeAt(s))<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&56320==(64512&(n=e.charCodeAt(s+1)))?(i=65536+((1023&i)<<10)+(1023&n),++s,t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128);return r-o}),utf8;var e}function requirePool(){if(hasRequiredPool)return pool_1;return hasRequiredPool=1,pool_1=function(e,t,r){var i=r||8192,n=i>>>1,o=null,s=i;return function(r){if(r<1||r>n)return e(r);s+r>i&&(o=e(i),s=0);var a=t.call(o,s,s+=r);return 7&s&&(s=1+(7|s)),a}}}function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var e=requireMinimal$1();function t(e,t){this.lo=e>>>0,this.hi=t>>>0}var r=t.zero=new t(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var i=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(e){if(0===e)return r;var i=e<0;i&&(e=-e);var n=e>>>0,o=(e-n)/4294967296>>>0;return i&&(o=~o>>>0,n=~n>>>0,++n>4294967295&&(n=0,++o>4294967295&&(o=0))),new t(n,o)},t.from=function(i){if("number"==typeof i)return t.fromNumber(i);if(e.isString(i)){if(!e.Long)return t.fromNumber(parseInt(i,10));i=e.Long.fromString(i)}return i.low||i.high?new t(i.low>>>0,i.high>>>0):r},t.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},t.prototype.toLong=function(t){return e.Long?new e.Long(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}};var n=String.prototype.charCodeAt;return t.fromHash=function(e){return e===i?r:new t((n.call(e,0)|n.call(e,1)<<8|n.call(e,2)<<16|n.call(e,3)<<24)>>>0,(n.call(e,4)|n.call(e,5)<<8|n.call(e,6)<<16|n.call(e,7)<<24)>>>0)},t.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},t.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},t.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},t.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10},longbits}function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(){var e=minimal$1;function t(e,t,r){for(var i=Object.keys(t),n=0;n<i.length;++n)(void 0===e[i[n]]||!r)&&(e[i[n]]=t[i[n]]);return e}function r(e){function r(e,i){if(!(this instanceof r))return new r(e,i);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,r):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),i&&t(this,i)}return r.prototype=Object.create(Error.prototype,{constructor:{value:r,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),r}e.asPromise=requireAspromise(),e.base64=requireBase64(),e.EventEmitter=requireEventemitter(),e.float=requireFloat(),e.inquire=requireInquire(),e.utf8=requireUtf8(),e.pool=requirePool(),e.LongBits=requireLongbits(),e.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),e.global=e.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,e.emptyArray=Object.freeze?Object.freeze([]):[],e.emptyObject=Object.freeze?Object.freeze({}):{},e.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},e.isString=function(e){return"string"==typeof e||e instanceof String},e.isObject=function(e){return e&&"object"==typeof e},e.isset=e.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},e.Buffer=function(){try{var t=e.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch{return null}}(),e._Buffer_from=null,e._Buffer_allocUnsafe=null,e.newBuffer=function(t){return"number"==typeof t?e.Buffer?e._Buffer_allocUnsafe(t):new e.Array(t):e.Buffer?e._Buffer_from(t):typeof Uint8Array>"u"?t:new Uint8Array(t)},e.Array=typeof Uint8Array<"u"?Uint8Array:Array,e.Long=e.global.dcodeIO&&e.global.dcodeIO.Long||e.global.Long||e.inquire("long"),e.key2Re=/^true|false|0|1$/,e.key32Re=/^-?(?:0|[1-9][0-9]*)$/,e.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,e.longToHash=function(t){return t?e.LongBits.from(t).toHash():e.LongBits.zeroHash},e.longFromHash=function(t,r){var i=e.LongBits.fromHash(t);return e.Long?e.Long.fromBits(i.lo,i.hi,r):i.toNumber(!!r)},e.merge=t,e.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},e.newError=r,e.ProtocolError=r("ProtocolError"),e.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},e.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},e.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},e._configure=function(){var t=e.Buffer;t?(e._Buffer_from=t.from!==Uint8Array.from&&t.from||function(e,r){return new t(e,r)},e._Buffer_allocUnsafe=t.allocUnsafe||function(e){return new t(e)}):e._Buffer_from=e._Buffer_allocUnsafe=null}}()),minimal$1}function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=u;var e,t=requireMinimal$1(),r=t.LongBits,i=t.base64,n=t.utf8;function o(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function s(){}function a(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function u(){this.len=0,this.head=new o(s,0,0),this.tail=this.head,this.states=null}var l=function(){return t.Buffer?function(){return(u.create=function(){return new e})()}:function(){return new u}};function f(e,t,r){t[r]=255&e}function c(e,t){this.len=e,this.next=void 0,this.val=t}function h(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function p(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}u.create=l(),u.alloc=function(e){return new t.Array(e)},t.Array!==Array&&(u.alloc=t.pool(u.alloc,t.Array.prototype.subarray)),u.prototype._push=function(e,t,r){return this.tail=this.tail.next=new o(e,t,r),this.len+=t,this},c.prototype=Object.create(o.prototype),c.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},u.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new c((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},u.prototype.int32=function(e){return e<0?this._push(h,10,r.fromNumber(e)):this.uint32(e)},u.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},u.prototype.uint64=function(e){var t=r.from(e);return this._push(h,t.length(),t)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(e){var t=r.from(e).zzEncode();return this._push(h,t.length(),t)},u.prototype.bool=function(e){return this._push(f,1,e?1:0)},u.prototype.fixed32=function(e){return this._push(p,4,e>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(e){var t=r.from(e);return this._push(p,4,t.lo)._push(p,4,t.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(e){return this._push(t.float.writeFloatLE,4,e)},u.prototype.double=function(e){return this._push(t.float.writeDoubleLE,8,e)};var d=t.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var i=0;i<e.length;++i)t[r+i]=e[i]};return u.prototype.bytes=function(e){var r=e.length>>>0;if(!r)return this._push(f,1,0);if(t.isString(e)){var n=u.alloc(r=i.length(e));i.decode(e,n,0),e=n}return this.uint32(r)._push(d,r,e)},u.prototype.string=function(e){var t=n.length(e);return t?this.uint32(t)._push(n.write,t,e):this._push(f,1,0)},u.prototype.fork=function(){return this.states=new a(this),this.head=this.tail=new o(s,0,0),this.len=0,this},u.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new o(s,0,0),this.len=0),this},u.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},u.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},u._configure=function(t){e=t,u.create=l(),e._configure()},writer}function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=r;var e=requireWriter();(r.prototype=Object.create(e.prototype)).constructor=r;var t=requireMinimal$1();function r(){e.call(this)}function i(e,r,i){e.length<40?t.utf8.write(e,r,i):r.utf8Write?r.utf8Write(e,i):r.write(e,i)}return r._configure=function(){r.alloc=t._Buffer_allocUnsafe,r.writeBytesBuffer=t.Buffer&&t.Buffer.prototype instanceof Uint8Array&&"set"===t.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var i=0;i<e.length;)t[r++]=e[i++]}},r.prototype.bytes=function(e){t.isString(e)&&(e=t._Buffer_from(e,"base64"));var i=e.length>>>0;return this.uint32(i),i&&this._push(r.writeBytesBuffer,i,e),this},r.prototype.string=function(e){var r=t.Buffer.byteLength(e);return this.uint32(r),r&&this._push(i,r,e),this},r._configure(),writer_buffer}function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=o;var e,t=requireMinimal$1(),r=t.LongBits,i=t.utf8;function n(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function o(e){this.buf=e,this.pos=0,this.len=e.length}var s=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new o(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new o(e);throw Error("illegal buffer")},a=function(){return t.Buffer?function(r){return(o.create=function(r){return t.Buffer.isBuffer(r)?new e(r):s(r)})(r)}:s};function u(){var e=new r(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw n(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw n(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function l(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw n(this,8);return new r(l(this.buf,this.pos+=4),l(this.buf,this.pos+=4))}return o.create=a(),o.prototype._slice=t.Array.prototype.subarray||t.Array.prototype.slice,o.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,n(this,10);return e}}(),o.prototype.int32=function(){return 0|this.uint32()},o.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},o.prototype.bool=function(){return 0!==this.uint32()},o.prototype.fixed32=function(){if(this.pos+4>this.len)throw n(this,4);return l(this.buf,this.pos+=4)},o.prototype.sfixed32=function(){if(this.pos+4>this.len)throw n(this,4);return 0|l(this.buf,this.pos+=4)},o.prototype.float=function(){if(this.pos+4>this.len)throw n(this,4);var e=t.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},o.prototype.double=function(){if(this.pos+8>this.len)throw n(this,4);var e=t.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},o.prototype.bytes=function(){var e=this.uint32(),r=this.pos,i=this.pos+e;if(i>this.len)throw n(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(r,i);if(r===i){var o=t.Buffer;return o?o.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,i)},o.prototype.string=function(){var e=this.bytes();return i.read(e,0,e.length)},o.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw n(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw n(this)}while(128&this.buf[this.pos++]);return this},o.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},o._configure=function(r){e=r,o.create=a(),e._configure();var i=t.Long?"toLong":"toNumber";t.merge(o.prototype,{int64:function(){return u.call(this)[i](!1)},uint64:function(){return u.call(this)[i](!0)},sint64:function(){return u.call(this).zzDecode()[i](!1)},fixed64:function(){return f.call(this)[i](!0)},sfixed64:function(){return f.call(this)[i](!1)}})},reader}function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=r;var e=requireReader();(r.prototype=Object.create(e.prototype)).constructor=r;var t=requireMinimal$1();function r(t){e.call(this,t)}return r._configure=function(){t.Buffer&&(r.prototype._slice=t.Buffer.prototype.slice)},r.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},r._configure(),reader_buffer}var rpc={},service,hasRequiredService,hasRequiredRpc,roots,hasRequiredRoots,hasRequiredIndexMinimal,minimal,hasRequiredMinimal;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=t;var e=requireMinimal$1();function t(t,r,i){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");e.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!r,this.responseDelimited=!!i}return(t.prototype=Object.create(e.EventEmitter.prototype)).constructor=t,t.prototype.rpcCall=function t(r,i,n,o,s){if(!o)throw TypeError("request must be specified");var a=this;if(!s)return e.asPromise(t,a,r,i,n,o);if(a.rpcImpl)try{return a.rpcImpl(r,i[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,t){if(e)return a.emit("error",e,r),s(e);if(null!==t){if(!(t instanceof n))try{t=n[a.responseDelimited?"decodeDelimited":"decode"](t)}catch(e){return a.emit("error",e,r),s(e)}return a.emit("data",t,r),s(null,t)}a.end(!0)}))}catch(e){return a.emit("error",e,r),void setTimeout((function(){s(e)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},t.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,rpc.Service=requireService()),rpc}function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(){var e=indexMinimal;function t(){e.util._configure(),e.Writer._configure(e.BufferWriter),e.Reader._configure(e.BufferReader)}e.build="minimal",e.Writer=requireWriter(),e.BufferWriter=requireWriter_buffer(),e.Reader=requireReader(),e.BufferReader=requireReader_buffer(),e.util=requireMinimal$1(),e.rpc=requireRpc(),e.roots=requireRoots(),e.configure=t,t()}()),indexMinimal}function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,minimal=requireIndexMinimal()),minimal}var minimalExports=requireMinimal();const $Reader=minimalExports.Reader,$util=minimalExports.util,$root=minimalExports.roots.default||(minimalExports.roots.default={}),com=$root.com=(()=>{const e={};return e.opensource=function(){const e={};return e.svga=function(){const e={};return e.MovieParams=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.viewBoxWidth=0,e.prototype.viewBoxHeight=0,e.prototype.fps=0,e.prototype.frames=0,e.decode=function(e,t,r){e instanceof $Reader||(e=$Reader.create(e));for(var i=void 0===t?e.len:e.pos+t,n=new $root.com.opensource.svga.MovieParams;e.pos<i;){var o=e.uint32();if(o===r)break;switch(o>>>3){case 1:n.viewBoxWidth=e.float();break;case 2:n.viewBoxHeight=e.float();break;case 3:n.fps=e.int32();break;case 4:n.frames=e.int32();break;default:e.skipType(7&o)}}return n},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.opensource.svga.MovieParams"},e}(),e.SpriteEntity=function(){function e(e){if(this.frames=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.imageKey="",e.prototype.frames=$util.emptyArray,e.prototype.matteKey="",e.decode=function(e,t,r){e instanceof $Reader||(e=$Reader.create(e));for(var i=void 0===t?e.len:e.pos+t,n=new $root.com.opensource.svga.SpriteEntity;e.pos<i;){var o=e.uint32();if(o===r)break;switch(o>>>3){case 1:n.imageKey=e.string();break;case 2:n.frames&&n.frames.length||(n.frames=[]),n.frames.push($root.com.opensource.svga.FrameEntity.decode(e,e.uint32()));break;case 3:n.matteKey=e.string();break;default:e.skipType(7&o)}}return n},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.opensource.svga.SpriteEntity"},e}(),e.AudioEntity=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.audioKey="",e.prototype.startFrame=0,e.prototype.endFrame=0,e.prototype.startTime=0,e.prototype.totalTime=0,e.decode=function(e,t,r){e instanceof $Reader||(e=$Reader.create(e));for(var i=void 0===t?e.len:e.pos+t,n=new $root.com.opensource.svga.AudioEntity;e.pos<i;){var o=e.uint32();if(o===r)break;switch(o>>>3){case 1:n.audioKey=e.string();break;case 2:n.startFrame=e.int32();break;case 3:n.endFrame=e.int32();break;case 4:n.startTime=e.int32();break;case 5:n.totalTime=e.int32();break;default:e.skipType(7&o)}}return n},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.opensource.svga.AudioEntity"},e}(),e.Layout=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.x=0,e.prototype.y=0,e.prototype.width=0,e.prototype.height=0,e.decode=function(e,t,r){e instanceof $Reader||(e=$Reader.create(e));for(var i=void 0===t?e.len:e.pos+t,n=new $root.com.opensource.svga.Layout;e.pos<i;){var o=e.uint32();if(o===r)break;switch(o>>>3){case 1:n.x=e.float();break;case 2:n.y=e.float();break;case 3:n.width=e.float();break;case 4:n.height=e.float();break;default:e.skipType(7&o)}}return n},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.opensource.svga.Layout"},e}(),e.Transform=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.a=0,e.prototype.b=0,e.prototype.c=0,e.prototype.d=0,e.prototype.tx=0,e.prototype.ty=0,e.decode=function(e,t,r){e instanceof $Reader||(e=$Reader.create(e));for(var i=void 0===t?e.len:e.pos+t,n=new $root.com.opensource.svga.Transform;e.pos<i;){var o=e.uint32();if(o===r)break;switch(o>>>3){case 1:n.a=e.float();break;case 2:n.b=e.float();break;case 3:n.c=e.float();break;case 4:n.d=e.float();break;case 5:n.tx=e.float();break;case 6:n.ty=e.float();break;default:e.skipType(7&o)}}return n},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.opensource.svga.Transform"},e}(),e.ShapeEntity=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}let t;return e.prototype.type=0,e.prototype.shape=null,e.prototype.rect=null,e.prototype.ellipse=null,e.prototype.styles=null,e.prototype.transform=null,Object.defineProperty(e.prototype,"args",{get:$util.oneOfGetter(t=["shape","rect","ellipse"]),set:$util.oneOfSetter(t)}),e.decode=function(e,t,r){e instanceof $Reader||(e=$Reader.create(e));for(var i=void 0===t?e.len:e.pos+t,n=new $root.com.opensource.svga.ShapeEntity;e.pos<i;){var o=e.uint32();if(o===r)break;switch(o>>>3){case 1:n.type=e.int32();break;case 2:n.shape=$root.com.opensource.svga.ShapeEntity.ShapeArgs.decode(e,e.uint32());break;case 3:n.rect=$root.com.opensource.svga.ShapeEntity.RectArgs.decode(e,e.uint32());break;case 4:n.ellipse=$root.com.opensource.svga.ShapeEntity.EllipseArgs.decode(e,e.uint32());break;case 10:n.styles=$root.com.opensource.svga.ShapeEntity.ShapeStyle.decode(e,e.uint32());break;case 11:n.transform=$root.com.opensource.svga.Transform.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.opensource.svga.ShapeEntity"},e.ShapeType=function(){const e={},t=Object.create(e);return t[e[0]="SHAPE"]=0,t[e[1]="RECT"]=1,t[e[2]="ELLIPSE"]=2,t[e[3]="KEEP"]=3,t}(),e.ShapeArgs=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.d="",e.decode=function(e,t,r){e instanceof $Reader||(e=$Reader.create(e));for(var i=void 0===t?e.len:e.pos+t,n=new $root.com.opensource.svga.ShapeEntity.ShapeArgs;e.pos<i;){var o=e.uint32();if(o===r)break;o>>>3==1?n.d=e.string():e.skipType(7&o)}return n},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.opensource.svga.ShapeEntity.ShapeArgs"},e}(),e.RectArgs=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.x=0,e.prototype.y=0,e.prototype.width=0,e.prototype.height=0,e.prototype.cornerRadius=0,e.decode=function(e,t,r){e instanceof $Reader||(e=$Reader.create(e));for(var i=void 0===t?e.len:e.pos+t,n=new $root.com.opensource.svga.ShapeEntity.RectArgs;e.pos<i;){var o=e.uint32();if(o===r)break;switch(o>>>3){case 1:n.x=e.float();break;case 2:n.y=e.float();break;case 3:n.width=e.float();break;case 4:n.height=e.float();break;case 5:n.cornerRadius=e.float();break;default:e.skipType(7&o)}}return n},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.opensource.svga.ShapeEntity.RectArgs"},e}(),e.EllipseArgs=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.x=0,e.prototype.y=0,e.prototype.radiusX=0,e.prototype.radiusY=0,e.decode=function(e,t,r){e instanceof $Reader||(e=$Reader.create(e));for(var i=void 0===t?e.len:e.pos+t,n=new $root.com.opensource.svga.ShapeEntity.EllipseArgs;e.pos<i;){var o=e.uint32();if(o===r)break;switch(o>>>3){case 1:n.x=e.float();break;case 2:n.y=e.float();break;case 3:n.radiusX=e.float();break;case 4:n.radiusY=e.float();break;default:e.skipType(7&o)}}return n},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.opensource.svga.ShapeEntity.EllipseArgs"},e}(),e.ShapeStyle=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.fill=null,e.prototype.stroke=null,e.prototype.strokeWidth=0,e.prototype.lineCap=0,e.prototype.lineJoin=0,e.prototype.miterLimit=0,e.prototype.lineDashI=0,e.prototype.lineDashII=0,e.prototype.lineDashIII=0,e.decode=function(e,t,r){e instanceof $Reader||(e=$Reader.create(e));for(var i=void 0===t?e.len:e.pos+t,n=new $root.com.opensource.svga.ShapeEntity.ShapeStyle;e.pos<i;){var o=e.uint32();if(o===r)break;switch(o>>>3){case 1:n.fill=$root.com.opensource.svga.ShapeEntity.ShapeStyle.RGBAColor.decode(e,e.uint32());break;case 2:n.stroke=$root.com.opensource.svga.ShapeEntity.ShapeStyle.RGBAColor.decode(e,e.uint32());break;case 3:n.strokeWidth=e.float();break;case 4:n.lineCap=e.int32();break;case 5:n.lineJoin=e.int32();break;case 6:n.miterLimit=e.float();break;case 7:n.lineDashI=e.float();break;case 8:n.lineDashII=e.float();break;case 9:n.lineDashIII=e.float();break;default:e.skipType(7&o)}}return n},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.opensource.svga.ShapeEntity.ShapeStyle"},e.RGBAColor=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.r=0,e.prototype.g=0,e.prototype.b=0,e.prototype.a=0,e.decode=function(e,t,r){e instanceof $Reader||(e=$Reader.create(e));for(var i=void 0===t?e.len:e.pos+t,n=new $root.com.opensource.svga.ShapeEntity.ShapeStyle.RGBAColor;e.pos<i;){var o=e.uint32();if(o===r)break;switch(o>>>3){case 1:n.r=e.float();break;case 2:n.g=e.float();break;case 3:n.b=e.float();break;case 4:n.a=e.float();break;default:e.skipType(7&o)}}return n},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.opensource.svga.ShapeEntity.ShapeStyle.RGBAColor"},e}(),e.LineCap=function(){const e={},t=Object.create(e);return t[e[0]="LineCap_BUTT"]=0,t[e[1]="LineCap_ROUND"]=1,t[e[2]="LineCap_SQUARE"]=2,t}(),e.LineJoin=function(){const e={},t=Object.create(e);return t[e[0]="LineJoin_MITER"]=0,t[e[1]="LineJoin_ROUND"]=1,t[e[2]="LineJoin_BEVEL"]=2,t}(),e}(),e}(),e.FrameEntity=function(){function e(e){if(this.shapes=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.alpha=0,e.prototype.layout=null,e.prototype.transform=null,e.prototype.clipPath="",e.prototype.shapes=$util.emptyArray,e.decode=function(e,t,r){e instanceof $Reader||(e=$Reader.create(e));for(var i=void 0===t?e.len:e.pos+t,n=new $root.com.opensource.svga.FrameEntity;e.pos<i;){var o=e.uint32();if(o===r)break;switch(o>>>3){case 1:n.alpha=e.float();break;case 2:n.layout=$root.com.opensource.svga.Layout.decode(e,e.uint32());break;case 3:n.transform=$root.com.opensource.svga.Transform.decode(e,e.uint32());break;case 4:n.clipPath=e.string();break;case 5:n.shapes&&n.shapes.length||(n.shapes=[]),n.shapes.push($root.com.opensource.svga.ShapeEntity.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.opensource.svga.FrameEntity"},e}(),e.MovieEntity=function(){function e(e){if(this.images={},this.sprites=[],this.audios=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.version="",e.prototype.params=null,e.prototype.images=$util.emptyObject,e.prototype.sprites=$util.emptyArray,e.prototype.audios=$util.emptyArray,e.decode=function(e,t,r){e instanceof $Reader||(e=$Reader.create(e));for(var i,n,o=void 0===t?e.len:e.pos+t,s=new $root.com.opensource.svga.MovieEntity;e.pos<o;){var a=e.uint32();if(a===r)break;switch(a>>>3){case 1:s.version=e.string();break;case 2:s.params=$root.com.opensource.svga.MovieParams.decode(e,e.uint32());break;case 3:s.images===$util.emptyObject&&(s.images={});var u=e.uint32()+e.pos;for(i="",n=[];e.pos<u;){var l=e.uint32();switch(l>>>3){case 1:i=e.string();break;case 2:n=e.bytes();break;default:e.skipType(7&l)}}s.images[i]=n;break;case 4:s.sprites&&s.sprites.length||(s.sprites=[]),s.sprites.push($root.com.opensource.svga.SpriteEntity.decode(e,e.uint32()));break;case 5:s.audios&&s.audios.length||(s.audios=[]),s.audios.push($root.com.opensource.svga.AudioEntity.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return s},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/com.opensource.svga.MovieEntity"},e}(),e}(),e}(),e})(),svga$1=com.opensource.svga,_=class e{constructor(t){if(this.shapes=[],this.alpha=t.alpha||0,this.layout={x:t.layout?.x||0,y:t.layout?.y||0,width:t.layout?.width||0,height:t.layout?.height||0},this.transform={a:t.transform?.a||1,b:t.transform?.b||0,c:t.transform?.c||0,d:t.transform?.d||1,tx:t.transform?.tx||0,ty:t.transform?.ty||0},this.clipPath=t.clipPath||null,t.shapes)if(t.shapes[0]&&t.shapes[0].type===svga$1.ShapeEntity.ShapeType.KEEP)this.shapes=e.lastShapes;else{const r=t.shapes.map((e=>{if(Object.prototype.hasOwnProperty.call(e,"type")||Object.defineProperty(e,"type",{value:e.type,enumerable:!0}),e.styles){if(e.styles.fill){const{r:t,g:r,b:i,a:n}=e.styles.fill;e.styles.fillStr=`rgba(${parseInt((255*t).toString())}, ${parseInt((255*r).toString())}, ${parseInt((255*i).toString())}, ${n})`}if(e.styles.stroke){const{r:t,g:r,b:i,a:n}=e.styles.stroke;e.styles.strokeStr=`rgba(${parseInt((255*t).toString())}, ${parseInt((255*r).toString())}, ${parseInt((255*i).toString())}, ${n})`}switch(e.styles.lineJoin){case svga$1.ShapeEntity.ShapeStyle.LineJoin.LineJoin_MITER:e.styles.lineJoinStr="miter";break;case svga$1.ShapeEntity.ShapeStyle.LineJoin.LineJoin_ROUND:e.styles.lineJoinStr="round";break;case svga$1.ShapeEntity.ShapeStyle.LineJoin.LineJoin_BEVEL:e.styles.lineJoinStr="bevel"}switch(e.styles.lineCap){case svga$1.ShapeEntity.ShapeStyle.LineCap.LineCap_BUTT:e.styles.lineCapStr="butt";break;case svga$1.ShapeEntity.ShapeStyle.LineCap.LineCap_ROUND:e.styles.lineCapStr="round";break;case svga$1.ShapeEntity.ShapeStyle.LineCap.LineCap_SQUARE:e.styles.lineCapStr="square"}}return e}));e.lastShapes=r,this.shapes=r}}};_.lastShapes=[];let FrameEntity=_;class VideoEntity{constructor(e,t,r){this.videoSize={width:0,height:0},this.images={},this.audios={},this.dynamicElements={},this.sprites=[],this.version=e.version,this.videoSize.width=e.params?.viewBoxWidth||0,this.videoSize.height=e.params?.viewBoxHeight||0,this.FPS=e.params?.fps||20,this.frames=e.params?.frames||0,this.sprites=e.sprites.map((({imageKey:e=null,frames:t})=>({imageKey:e,frames:(t||[]).map((e=>new FrameEntity(e)))}))),this.images=t,this.audios=r}}const v=class e{constructor(){e.ensureWorker()}static ensureWorker(){return this.worker=this.worker||new WorkerWrapper,this.destroying=!1,this.worker}static destroyWorker(){this.worker?.terminate(),this.worker=null,this.destroying=!1}do(t){if(getVersion(new Uint8Array(t,0,4))===Version.VERSION_1)throw new Error("this parser does not support version@1.x of svga.");if(!t)throw new Error("Parser Data not found");return new Promise((r=>{const i=e.ensureWorker(),n=e.usageNO++,o=({data:{result:t,id:s}})=>{s===n&&(r(t),i.removeEventListener("message",o),e.workingCount--,e.destroying&&this.destroy())};e.workingCount++,i.addEventListener("message",o),i.postMessage({data:t,id:n},[t])}))}destroy(){if(null!==e.worker){if(e.workingCount>0)return void(e.destroying=!0);e.destroyWorker()}}};v.destroying=!1,v.usageNO=1,v.workingCount=0;let Parser=v;function resetShapeStyles(e,t){t&&(e.strokeStyle=t?.strokeStr||"transparent",t&&(e.lineWidth=t.strokeWidth,e.lineCap=t.lineCapStr,e.lineJoin=t.lineJoinStr,e.miterLimit=t.miterLimit),e.fillStyle=t?.fillStr||"transparent",(t.lineDashI||t.lineDashII||t.lineDashIII)&&e.setLineDash([t.lineDashI?t.lineDashI:0,t.lineDashII?t.lineDashII:0,t.lineDashIII?t.lineDashIII:0]))}function applyTransform(e,t){t&&e.transform(t.a||1,t.b||0,t.c||0,t.d||1,t.tx||0,t.ty||0)}function drawEllipse(e,t){e.save(),resetShapeStyles(e,t.styles),applyTransform(e,t.transform);const r=t.x-t.radiusX,i=t.y-t.radiusY,n=2*t.radiusX,o=2*t.radiusY,s=.5522848,a=n/2*s,u=o/2*s,l=r+n,f=i+o,c=r+n/2,h=i+o/2;e.beginPath(),e.moveTo(r,h),e.bezierCurveTo(r,h-u,c-a,i,c,i),e.bezierCurveTo(c+a,i,l,h-u,l,h),e.bezierCurveTo(l,h+u,c+a,f,c,f),e.bezierCurveTo(c-a,f,r,h+u,r,h),t.styles?.fill&&e.fill(),t.styles?.stroke&&e.stroke(),e.restore()}function drawRect(e,t){e.save(),resetShapeStyles(e,t.styles),applyTransform(e,t.transform);const r=t.x,i=t.y,n=t.width,o=t.height;let s=t.cornerRadius;n<2*s&&(s=n/2),o<2*s&&(s=o/2),e.beginPath(),e.moveTo(r+s,i),e.arcTo(r+n,i,r+n,i+o,s),e.arcTo(r+n,i+o,r,i+o,s),e.arcTo(r,i+o,r,i,s),e.arcTo(r,i,r+n,i,s),e.closePath(),t.styles?.fill&&e.fill(),t.styles?.stroke&&e.stroke(),e.restore()}function drawBezier(e,t){e.save(),resetShapeStyles(e,t.styles),applyTransform(e,t.transform);const r={x:0,y:0,x1:0,y1:0,x2:0,y2:0};e.beginPath(),t.d.replace(/([a-zA-Z])/g,"|||$1 ").replace(/,/g," ").split("|||").forEach((t=>{if(0==t.length)return;const i=t.substr(0,1),n=t.substr(1).trim().split(" ");drawBezierElement(e,r,i,n)})),t.styles?.fill&&e.fill(),t.styles?.stroke&&e.stroke(),e.restore()}function drawBezierElement(e,t,r,i){switch(r){case"M":t.x=Number(i[0]),t.y=Number(i[1]),e.moveTo(t.x,t.y);break;case"m":t.x+=Number(i[0]),t.y+=Number(i[1]),e.moveTo(t.x,t.y);break;case"L":t.x=Number(i[0]),t.y=Number(i[1]),e.lineTo(t.x,t.y);break;case"l":t.x+=Number(i[0]),t.y+=Number(i[1]),e.lineTo(t.x,t.y);break;case"H":t.x=Number(i[0]),e.lineTo(t.x,t.y);break;case"h":t.x+=Number(i[0]),e.lineTo(t.x,t.y);break;case"V":t.y=Number(i[0]),e.lineTo(t.x,t.y);break;case"v":t.y+=Number(i[0]),e.lineTo(t.x,t.y);break;case"C":t.x1=Number(i[0]),t.y1=Number(i[1]),t.x2=Number(i[2]),t.y2=Number(i[3]),t.x=Number(i[4]),t.y=Number(i[5]),e.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"c":t.x1=t.x+Number(i[0]),t.y1=t.y+Number(i[1]),t.x2=t.x+Number(i[2]),t.y2=t.y+Number(i[3]),t.x+=Number(i[4]),t.y+=Number(i[5]),e.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"S":t.x1&&t.y1&&t.x2&&t.y2?(t.x1=t.x-t.x2+t.x,t.y1=t.y-t.y2+t.y,t.x2=Number(i[0]),t.y2=Number(i[1]),t.x=Number(i[2]),t.y=Number(i[3]),e.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y)):(t.x1=Number(i[0]),t.y1=Number(i[1]),t.x=Number(i[2]),t.y=Number(i[3]),e.quadraticCurveTo(t.x1,t.y1,t.x,t.y));break;case"s":t.x1&&t.y1&&t.x2&&t.y2?(t.x1=t.x-t.x2+t.x,t.y1=t.y-t.y2+t.y,t.x2=t.x+Number(i[0]),t.y2=t.y+Number(i[1]),t.x+=Number(i[2]),t.y+=Number(i[3]),e.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y)):(t.x1=t.x+Number(i[0]),t.y1=t.y+Number(i[1]),t.x+=Number(i[2]),t.y+=Number(i[3]),e.quadraticCurveTo(t.x1,t.y1,t.x,t.y));break;case"Q":t.x1=Number(i[0]),t.y1=Number(i[1]),t.x=Number(i[2]),t.y=Number(i[3]),e.quadraticCurveTo(t.x1,t.y1,t.x,t.y);break;case"q":t.x1=t.x+Number(i[0]),t.y1=t.y+Number(i[1]),t.x+=Number(i[2]),t.y+=Number(i[3]),e.quadraticCurveTo(t.x1,t.y1,t.x,t.y);break;case"A":case"a":break;case"Z":case"z":e.closePath()}}const svga=com.opensource.svga;function render(e,t,r,i,n){const o=e.getContext("2d");return null===o?(console.error("svga render fail, 2d context null"),e):(i.forEach((e=>{const i=e.frames[n];if(i.alpha<.05)return;o.save(),o.globalAlpha=i.alpha,o.transform(i.transform.a||1,i.transform.b||0,i.transform.c||0,i.transform.d||1,i.transform.tx||0,i.transform.ty||0);const s=e.imageKey&&t[e.imageKey];s&&(i.clipPath&&(drawBezier(o,{d:i.clipPath}),o.clip()),s instanceof Image?o.drawImage(s,0,0,s.width,s.height):o.drawImage(s,0,0));const a=e.imageKey&&r[e.imageKey];if(a){const{source:e,fit:t}="fit"in a?a:{source:a,fit:"none"};let r,n;switch(e instanceof HTMLImageElement?(r=e.naturalWidth,n=e.naturalHeight):e instanceof HTMLVideoElement?(r=e.videoWidth,n=e.videoHeight):e instanceof SVGImageElement?(r=e.width.baseVal.value,n=e.height.baseVal.value):e instanceof VideoFrame?(r=e.codedWidth,n=e.codedHeight):(r=e.width,n=e.height),t){case"contain":{const t=i.layout.width/r,s=i.layout.height/n,a=Math.min(t,s),u=a*r,l=a*n;o.drawImage(e,(i.layout.width-u)/2,(i.layout.height-l)/2,u,l);break}case"cover":{const t=i.layout.width/r,s=i.layout.height/n,a=Math.max(t,s),u=a*r,l=a*n;o.drawImage(e,(i.layout.width-u)/2,(i.layout.height-l)/2,u,l);break}case"fill":o.drawImage(e,0,0,i.layout.width,i.layout.height);break;default:o.drawImage(e,(i.layout.width-r)/2,(i.layout.height-n)/2)}}i.shapes?.forEach((e=>{e.type===svga.ShapeEntity.ShapeType.SHAPE&&e.shape&&e.shape.d?drawBezier(o,{d:e.shape.d,transform:e.transform,styles:e.styles}):e.type===svga.ShapeEntity.ShapeType.ELLIPSE&&e.ellipse?drawEllipse(o,{x:e.ellipse.x||0,y:e.ellipse.y||0,radiusX:e.ellipse.radiusX||0,radiusY:e.ellipse.radiusY||0,transform:e.transform,styles:e.styles}):e.type===svga.ShapeEntity.ShapeType.RECT&&e.rect&&drawRect(o,{x:e.rect.x||0,y:e.rect.y||0,width:e.rect.width||0,height:e.rect.height||0,cornerRadius:e.rect.cornerRadius||0,transform:e.transform,styles:e.styles})})),o.restore()})),e)}function polyfillCreateImageBitmap(){"createImageBitmap"in window||Object.assign(window,{createImageBitmap:async function(e){return new Promise(((t,r)=>{const i=document.createElement("img");i.addEventListener("load",(function(){t(this)})),i.addEventListener("error",(function(e){r(e)})),i.src=URL.createObjectURL(e)}))}})}class Renderer{constructor(e){this.audios=[],this.audioConfigs={},this.isCacheFrame=!1,this.frameCache={},polyfillCreateImageBitmap(),this.target=e,this.offscreenCanvas=window.OffscreenCanvas?new window.OffscreenCanvas(e.width,e.height):document.createElement("canvas")}async prepare(e){this.audios=[],this.audioConfigs={},this.target.width!==e.videoSize.width&&(this.target.width=e.videoSize.width),this.target.height!==e.videoSize.height&&(this.target.height=e.videoSize.height);const t=(e,t)=>{const r=this.audioConfigs[e]||[];r.push(t),this.audioConfigs[e]=r},r=Object.entries(e.images).map((async([t,r])=>{if(r instanceof ArrayBuffer){const i=new Blob([r],{type:"image/png"}),n=await createImageBitmap(i);e.images[t]=n}return r})),i=Object.values(e.audios).map((({source:e,startFrame:r,endFrame:i,audioKey:n,startTime:o,totalTime:s})=>new Promise((a=>{const u=new Audio(URL.createObjectURL(new Blob([new Uint8Array(e)],{type:"audio/x-mpeg"}))),l={audioKey:n,audio:u,startFrame:r,endFrame:i,startTime:o,totalTime:s};t(r,l),t(i,l),this.audios.push(u),u.onloadeddata=a,u.load()}))));await Promise.all([...i,...r])}processAudio(e){const t=this.audioConfigs[e];!t||0===t.length||t.forEach((function(t){return t.startFrame===e?(t.audio.currentTime=t.startTime,void t.audio.play()):t.endFrame===e?(t.audio.pause(),void(t.audio.currentTime=0)):void 0}))}clear(){this.target.getContext("2d")?.clearRect(0,0,this.target.width,this.target.height)}drawFrame(e,t,r,i){const n=this.target.getContext("2d");if(!n)return;if(n.clearRect(0,0,this.target.width,this.target.height),this.isCacheFrame&&this.frameCache[i]){const e=this.frameCache[i];return void n.drawImage(e,0,0)}const o=this.offscreenCanvas;o.width=this.target.width,o.height=this.target.height,render(o,e,r,t,i),n.drawImage(o,0,0),this.isCacheFrame&&createImageBitmap(o).then((e=>{this.frameCache[i]=e}))}pauseAllAudio(){this.audios.forEach((function(e){e.pause()}))}resumeAllAudio(){this.audios.forEach((function(e){e.play()}))}stopAllAudio(){this.audios.forEach((function(e){e.pause(),e.currentTime=0}))}}function noop(){}const WORKER="onmessage = function () {\n  setTimeout(function() {postMessage(null)}, 1 / 60)\n}";var FILL_MODE=(e=>(e.FORWARDS="forwards",e.BACKWARDS="backwards",e))(FILL_MODE||{});class Animator{constructor(){this.noExecutionDelay=!1,this.startValue=0,this.endValue=0,this.duration=0,this.repeatNumber=1,this.loop=!1,this.fillRule="forwards",this.onUpdate=noop,this.onEnd=noop,this.isRunning=!1,this.startTimestamp=0,this.timeoutWorker=null,this.doFrame=()=>{const e=Animator.currentTimeMillisecond()-this.startTimestamp;let t;!this.loop&&e>=this.duration*this.repeatNumber?(t="backwards"===this.fillRule?0:1,this.isRunning=!1):t=e%this.duration/this.duration;const r=(this.endValue-this.startValue)*t+this.startValue;this.onUpdate(r),this.isRunning?this.timeoutWorker?(this.timeoutWorker.onmessage=this.doFrame,this.timeoutWorker.postMessage(null)):window.requestAnimationFrame(this.doFrame):(null!==this.timeoutWorker&&(this.timeoutWorker.terminate(),this.timeoutWorker=null),this.onEnd())}}static currentTimeMillisecond(){return performance?performance.now():(new Date).getTime()}start(e){this.isRunning=!0,this.startTimestamp=Animator.currentTimeMillisecond(),e&&(this.startTimestamp-=e/(this.endValue-this.startValue)*this.duration),this.noExecutionDelay&&null===this.timeoutWorker&&(this.timeoutWorker=new Worker(window.URL.createObjectURL(new Blob([WORKER])))),this.doFrame()}stop(){this.isRunning=!1,null!==this.timeoutWorker&&(this.timeoutWorker.terminate(),this.timeoutWorker=null)}}var EVENT_TYPES=(e=>(e.START="start",e.PROCESS="process",e.PAUSE="pause",e.RESUME="resume",e.STOP="stop",e.END="end",e.CLEAR="clear",e))(EVENT_TYPES||{}),PLAY_MODE=(e=>(e.FORWARDS="forwards",e.FALLBACKS="fallbacks",e))(PLAY_MODE||{});class Player{constructor(e,t,r){if(this.currentFrame=0,this.videoItem=null,this.playMode="forwards",this.startFrame=0,this.endFrame=0,this.intersectionObserverRenderShow=!0,this.intersectionObserver=null,this.$onEvent={start:noop,process:noop,pause:noop,resume:noop,stop:noop,end:noop,clear:noop},this.container="string"==typeof e?document.body.querySelector(e):e,!this.container)throw new Error("container undefined.");if(!this.container.getContext)throw new Error("container should be HTMLCanvasElement.");this.renderer=new Renderer(this.container),this.animator=new Animator,t&&this.mount(t),r&&this.set(r)}get progress(){return this.videoItem?(this.currentFrame+1)/this.videoItem.frames*100:0}set({loop:e=!0,fillMode:t=FILL_MODE.FORWARDS,playMode:r="forwards",startFrame:i=0,endFrame:n=0,cacheFrames:o=!1,intersectionObserverRender:s=!1,noExecutionDelay:a=!1}){this.playMode=r,this.startFrame=i,this.endFrame=n,this.handleIntersectionObserver(s),this.setAnimatorLoop(e),this.animator.fillRule=t,this.animator.noExecutionDelay=a,this.renderer.isCacheFrame=o}mount(e){return this.currentFrame=0,this.videoItem=e,this.renderer.prepare(e)}start(){if(!this.videoItem)throw new Error("video item undefined.");this.startAnimation(this.videoItem),this.$onEvent.start()}resume(){this.animator.start(this.currentFrame),this.renderer.resumeAllAudio(),this.$onEvent.resume()}pause(){this.animator.stop(),this.renderer.pauseAllAudio(),this.$onEvent.pause()}stop(){this.animator.stop(),this.renderer.clear(),this.currentFrame=0,this.renderer.stopAllAudio(),this.$onEvent.stop()}clear(){this.animator.stop(),this.renderer.clear(),this.renderer.stopAllAudio(),this.$onEvent.clear()}destroy(){this.animator.stop(),this.renderer.clear(),this.renderer.stopAllAudio(),this.currentFrame=0,this.videoItem=null}$on(e,t){return this.$onEvent[e]=t,"end"===e&&(this.animator.onEnd=()=>this.$onEvent.end()),this}handleIntersectionObserver(e){typeof window<"u"&&"IntersectionObserver"in window&&e?(this.intersectionObserver=new IntersectionObserver((e=>{this.intersectionObserverRenderShow=e[0]?.intersectionRatio>0}),{rootMargin:"0px",threshold:[0,.5,1]}),this.intersectionObserver.observe(this.container)):(this.intersectionObserver&&this.intersectionObserver.disconnect(),this.intersectionObserverRenderShow=!0)}setAnimatorLoop(e){switch(typeof e){case"boolean":this.animator.loop=e;break;case"number":e<=0?(console.warn('[svga-web] set loop to 0 is deprecated, use "loop: true" instead'),this.animator.loop=!0):(this.animator.loop=!1,this.animator.repeatNumber=e)}}startAnimation({images:e,sprites:t,frames:r,FPS:i,dynamicElements:n}){const{playMode:o,startFrame:s,endFrame:a}=this,u=r-1;this.currentFrame===u&&(this.currentFrame=s||0),this.animator.startValue="fallbacks"===o?a||u:s||0,this.animator.endValue="fallbacks"===o?s||0:a||u,a>0&&a>s?r=a-s:a<=0&&s>0&&(r-=s),this.animator.duration=r*(1/i)*1e3,this.animator.onUpdate=r=>{r=Math.floor(r),this.currentFrame!==r&&("forwards"===this.playMode&&this.renderer.processAudio(r),this.currentFrame=r,this.intersectionObserverRenderShow&&this.renderer.drawFrame(e,t,n,this.currentFrame),this.$onEvent.process())},"forwards"===this.playMode&&this.renderer.processAudio(0),this.animator.start(this.currentFrame)}}const version="2.4.3";class DB{constructor({name:e,storeName:t}={name:"svga-web."+version,storeName:"svga_file"}){this.storeName=t,this.dbPromise=new Promise((function(r,i){if(!window.indexedDB)throw new Error("[svgaWeb.DB] indexedDB not supported");{const n=window.indexedDB.open(e);n.onerror=function(e){i(new Error("[svgaWeb.DB] indexedDB open fail"+e))},n.onsuccess=function(){r(n.result)},n.onupgradeneeded=function(){const e=n.result;e.objectStoreNames.contains(t)||e.createObjectStore(t)}}}))}async find(e){return this.dbPromise.then((t=>new Promise((r=>{const i=t.transaction([this.storeName],"readonly").objectStore(this.storeName).get(e);i.onsuccess=()=>r(i.result)}))))}async insert(e,t){return this.dbPromise.then((r=>new Promise((i=>{const n=r.transaction([this.storeName],"readwrite");n.objectStore(this.storeName).put(t,e),n.oncomplete=i}))))}async delete(e){return this.dbPromise.then((t=>new Promise((r=>{t.transaction([this.storeName],"readwrite").objectStore(this.storeName).delete(e).onsuccess=r}))))}}export{DB,Downloader,EVENT_TYPES,FILL_MODE,PLAY_MODE,Parser,Player,Version,VideoEntity,getVersion};
//# sourceMappingURL=/sm/826a368f476ec4caa63e1b507b6d4eaebbb34bc752f5aca549bdffbe12c0b9f8.map