@poor-knight/cesium-utils 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
- "use strict";var ue=Object.defineProperty;var le=(s,i,r)=>i in s?ue(s,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[i]=r;var j=(s,i,r)=>le(s,typeof i!="symbol"?i+"":i,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Cesium=require("cesium");function _interopNamespaceDefault(s){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(i,r,o.get?o:{enumerable:!0,get:()=>s[r]})}}return i.default=s,Object.freeze(i)}const Cesium__namespace=_interopNamespaceDefault(Cesium);var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},inflate$2={};const adler32$1=(s,i,r,o)=>{let d=s&65535|0,u=s>>>16&65535|0,l=0;for(;r!==0;){l=r>2e3?2e3:r,r-=l;do d=d+i[o++]|0,u=u+d|0;while(--l);d%=65521,u%=65521}return d|u<<16|0};var adler32_1=adler32$1;const makeTable=()=>{let s,i=[];for(var r=0;r<256;r++){s=r;for(var o=0;o<8;o++)s=s&1?3988292384^s>>>1:s>>>1;i[r]=s}return i},crcTable=new Uint32Array(makeTable()),crc32$1=(s,i,r,o)=>{const d=crcTable,u=o+r;s^=-1;for(let l=o;l<u;l++)s=s>>>8^d[(s^i[l])&255];return s^-1};var crc32_1=crc32$1;const BAD$1=16209,TYPE$1=16191;var inffast=function(i,r){let o,d,u,l,c,h,a,m,y,g,p,v,b,w,x,_,T,O,E,C,R,P,k,A;const I=i.state;o=i.next_in,k=i.input,d=o+(i.avail_in-5),u=i.next_out,A=i.output,l=u-(r-i.avail_out),c=u+(i.avail_out-257),h=I.dmax,a=I.wsize,m=I.whave,y=I.wnext,g=I.window,p=I.hold,v=I.bits,b=I.lencode,w=I.distcode,x=(1<<I.lenbits)-1,_=(1<<I.distbits)-1;e:do{v<15&&(p+=k[o++]<<v,v+=8,p+=k[o++]<<v,v+=8),T=b[p&x];t:for(;;){if(O=T>>>24,p>>>=O,v-=O,O=T>>>16&255,O===0)A[u++]=T&65535;else if(O&16){E=T&65535,O&=15,O&&(v<O&&(p+=k[o++]<<v,v+=8),E+=p&(1<<O)-1,p>>>=O,v-=O),v<15&&(p+=k[o++]<<v,v+=8,p+=k[o++]<<v,v+=8),T=w[p&_];r:for(;;){if(O=T>>>24,p>>>=O,v-=O,O=T>>>16&255,O&16){if(C=T&65535,O&=15,v<O&&(p+=k[o++]<<v,v+=8,v<O&&(p+=k[o++]<<v,v+=8)),C+=p&(1<<O)-1,C>h){i.msg="invalid distance too far back",I.mode=BAD$1;break e}if(p>>>=O,v-=O,O=u-l,C>O){if(O=C-O,O>m&&I.sane){i.msg="invalid distance too far back",I.mode=BAD$1;break e}if(R=0,P=g,y===0){if(R+=a-O,O<E){E-=O;do A[u++]=g[R++];while(--O);R=u-C,P=A}}else if(y<O){if(R+=a+y-O,O-=y,O<E){E-=O;do A[u++]=g[R++];while(--O);if(R=0,y<E){O=y,E-=O;do A[u++]=g[R++];while(--O);R=u-C,P=A}}}else if(R+=y-O,O<E){E-=O;do A[u++]=g[R++];while(--O);R=u-C,P=A}for(;E>2;)A[u++]=P[R++],A[u++]=P[R++],A[u++]=P[R++],E-=3;E&&(A[u++]=P[R++],E>1&&(A[u++]=P[R++]))}else{R=u-C;do A[u++]=A[R++],A[u++]=A[R++],A[u++]=A[R++],E-=3;while(E>2);E&&(A[u++]=A[R++],E>1&&(A[u++]=A[R++]))}}else if((O&64)===0){T=w[(T&65535)+(p&(1<<O)-1)];continue r}else{i.msg="invalid distance code",I.mode=BAD$1;break e}break}}else if((O&64)===0){T=b[(T&65535)+(p&(1<<O)-1)];continue t}else if(O&32){I.mode=TYPE$1;break e}else{i.msg="invalid literal/length code",I.mode=BAD$1;break e}break}}while(o<d&&u<c);E=v>>3,o-=E,v-=E<<3,p&=(1<<v)-1,i.next_in=o,i.next_out=u,i.avail_in=o<d?5+(d-o):5-(o-d),i.avail_out=u<c?257+(c-u):257-(u-c),I.hold=p,I.bits=v};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$1=(s,i,r,o,d,u,l,c)=>{const h=c.bits;let a=0,m=0,y=0,g=0,p=0,v=0,b=0,w=0,x=0,_=0,T,O,E,C,R,P=null,k;const A=new Uint16Array(MAXBITS+1),I=new Uint16Array(MAXBITS+1);let $=null,F,q,V;for(a=0;a<=MAXBITS;a++)A[a]=0;for(m=0;m<o;m++)A[i[r+m]]++;for(p=h,g=MAXBITS;g>=1&&A[g]===0;g--);if(p>g&&(p=g),g===0)return d[u++]=1<<24|64<<16|0,d[u++]=1<<24|64<<16|0,c.bits=1,0;for(y=1;y<g&&A[y]===0;y++);for(p<y&&(p=y),w=1,a=1;a<=MAXBITS;a++)if(w<<=1,w-=A[a],w<0)return-1;if(w>0&&(s===CODES$1||g!==1))return-1;for(I[1]=0,a=1;a<MAXBITS;a++)I[a+1]=I[a]+A[a];for(m=0;m<o;m++)i[r+m]!==0&&(l[I[i[r+m]]++]=m);if(s===CODES$1?(P=$=l,k=20):s===LENS$1?(P=lbase,$=lext,k=257):(P=dbase,$=dext,k=0),_=0,m=0,a=y,R=u,v=p,b=0,E=-1,x=1<<p,C=x-1,s===LENS$1&&x>ENOUGH_LENS$1||s===DISTS$1&&x>ENOUGH_DISTS$1)return 1;for(;;){F=a-b,l[m]+1<k?(q=0,V=l[m]):l[m]>=k?(q=$[l[m]-k],V=P[l[m]-k]):(q=96,V=0),T=1<<a-b,O=1<<v,y=O;do O-=T,d[R+(_>>b)+O]=F<<24|q<<16|V|0;while(O!==0);for(T=1<<a-1;_&T;)T>>=1;if(T!==0?(_&=T-1,_+=T):_=0,m++,--A[a]===0){if(a===g)break;a=i[r+l[m]]}if(a>p&&(_&C)!==E){for(b===0&&(b=p),R+=y,v=a-b,w=1<<v;v+b<g&&(w-=A[v+b],!(w<=0));)v++,w<<=1;if(x+=1<<v,s===LENS$1&&x>ENOUGH_LENS$1||s===DISTS$1&&x>ENOUGH_DISTS$1)return 1;E=_&C,d[E]=p<<24|v<<16|R-u|0}}return _!==0&&(d[R+_]=a-b<<24|64<<16|0),c.bits=p,0};var inftrees=inflate_table$1,constants={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 adler32=adler32_1,crc32=crc32_1,inflate_fast=inffast,inflate_table=inftrees,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,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=s=>(s>>>24&255)+(s>>>8&65280)+((s&65280)<<8)+((s&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=s=>{if(!s)return 1;const i=s.state;return!i||i.strm!==s||i.mode<HEAD||i.mode>SYNC?1:0},inflateResetKeep=s=>{if(inflateStateCheck(s))return Z_STREAM_ERROR$1;const i=s.state;return s.total_in=s.total_out=i.total=0,s.msg="",i.wrap&&(s.adler=i.wrap&1),i.mode=HEAD,i.last=0,i.havedict=0,i.flags=-1,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new Int32Array(ENOUGH_LENS),i.distcode=i.distdyn=new Int32Array(ENOUGH_DISTS),i.sane=1,i.back=-1,Z_OK$1},inflateReset=s=>{if(inflateStateCheck(s))return Z_STREAM_ERROR$1;const i=s.state;return i.wsize=0,i.whave=0,i.wnext=0,inflateResetKeep(s)},inflateReset2=(s,i)=>{let r;if(inflateStateCheck(s))return Z_STREAM_ERROR$1;const o=s.state;return i<0?(r=0,i=-i):(r=(i>>4)+5,i<48&&(i&=15)),i&&(i<8||i>15)?Z_STREAM_ERROR$1:(o.window!==null&&o.wbits!==i&&(o.window=null),o.wrap=r,o.wbits=i,inflateReset(s))},inflateInit2=(s,i)=>{if(!s)return Z_STREAM_ERROR$1;const r=new InflateState;s.state=r,r.strm=s,r.window=null,r.mode=HEAD;const o=inflateReset2(s,i);return o!==Z_OK$1&&(s.state=null),o},inflateInit=s=>inflateInit2(s,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=s=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let i=0;for(;i<144;)s.lens[i++]=8;for(;i<256;)s.lens[i++]=9;for(;i<280;)s.lens[i++]=7;for(;i<288;)s.lens[i++]=8;for(inflate_table(LENS,s.lens,0,288,lenfix,0,s.work,{bits:9}),i=0;i<32;)s.lens[i++]=5;inflate_table(DISTS,s.lens,0,32,distfix,0,s.work,{bits:5}),virgin=!1}s.lencode=lenfix,s.lenbits=9,s.distcode=distfix,s.distbits=5},updatewindow=(s,i,r,o)=>{let d;const u=s.state;return u.window===null&&(u.wsize=1<<u.wbits,u.wnext=0,u.whave=0,u.window=new Uint8Array(u.wsize)),o>=u.wsize?(u.window.set(i.subarray(r-u.wsize,r),0),u.wnext=0,u.whave=u.wsize):(d=u.wsize-u.wnext,d>o&&(d=o),u.window.set(i.subarray(r-o,r-o+d),u.wnext),o-=d,o?(u.window.set(i.subarray(r-o,r),0),u.wnext=o,u.whave=u.wsize):(u.wnext+=d,u.wnext===u.wsize&&(u.wnext=0),u.whave<u.wsize&&(u.whave+=d))),0},inflate$1=(s,i)=>{let r,o,d,u,l,c,h,a,m,y,g,p,v,b,w=0,x,_,T,O,E,C,R,P;const k=new Uint8Array(4);let A,I;const $=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(s)||!s.output||!s.input&&s.avail_in!==0)return Z_STREAM_ERROR$1;r=s.state,r.mode===TYPE&&(r.mode=TYPEDO),l=s.next_out,d=s.output,h=s.avail_out,u=s.next_in,o=s.input,c=s.avail_in,a=r.hold,m=r.bits,y=c,g=h,P=Z_OK$1;e:for(;;)switch(r.mode){case HEAD:if(r.wrap===0){r.mode=TYPEDO;break}for(;m<16;){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}if(r.wrap&2&&a===35615){r.wbits===0&&(r.wbits=15),r.check=0,k[0]=a&255,k[1]=a>>>8&255,r.check=crc32(r.check,k,2,0),a=0,m=0,r.mode=FLAGS;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((a&255)<<8)+(a>>8))%31){s.msg="incorrect header check",r.mode=BAD;break}if((a&15)!==Z_DEFLATED){s.msg="unknown compression method",r.mode=BAD;break}if(a>>>=4,m-=4,R=(a&15)+8,r.wbits===0&&(r.wbits=R),R>15||R>r.wbits){s.msg="invalid window size",r.mode=BAD;break}r.dmax=1<<r.wbits,r.flags=0,s.adler=r.check=1,r.mode=a&512?DICTID:TYPE,a=0,m=0;break;case FLAGS:for(;m<16;){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}if(r.flags=a,(r.flags&255)!==Z_DEFLATED){s.msg="unknown compression method",r.mode=BAD;break}if(r.flags&57344){s.msg="unknown header flags set",r.mode=BAD;break}r.head&&(r.head.text=a>>8&1),r.flags&512&&r.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,r.check=crc32(r.check,k,2,0)),a=0,m=0,r.mode=TIME;case TIME:for(;m<32;){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}r.head&&(r.head.time=a),r.flags&512&&r.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,k[2]=a>>>16&255,k[3]=a>>>24&255,r.check=crc32(r.check,k,4,0)),a=0,m=0,r.mode=OS;case OS:for(;m<16;){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}r.head&&(r.head.xflags=a&255,r.head.os=a>>8),r.flags&512&&r.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,r.check=crc32(r.check,k,2,0)),a=0,m=0,r.mode=EXLEN;case EXLEN:if(r.flags&1024){for(;m<16;){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}r.length=a,r.head&&(r.head.extra_len=a),r.flags&512&&r.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,r.check=crc32(r.check,k,2,0)),a=0,m=0}else r.head&&(r.head.extra=null);r.mode=EXTRA;case EXTRA:if(r.flags&1024&&(p=r.length,p>c&&(p=c),p&&(r.head&&(R=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(o.subarray(u,u+p),R)),r.flags&512&&r.wrap&4&&(r.check=crc32(r.check,o,p,u)),c-=p,u+=p,r.length-=p),r.length))break e;r.length=0,r.mode=NAME;case NAME:if(r.flags&2048){if(c===0)break e;p=0;do R=o[u+p++],r.head&&R&&r.length<65536&&(r.head.name+=String.fromCharCode(R));while(R&&p<c);if(r.flags&512&&r.wrap&4&&(r.check=crc32(r.check,o,p,u)),c-=p,u+=p,R)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=COMMENT;case COMMENT:if(r.flags&4096){if(c===0)break e;p=0;do R=o[u+p++],r.head&&R&&r.length<65536&&(r.head.comment+=String.fromCharCode(R));while(R&&p<c);if(r.flags&512&&r.wrap&4&&(r.check=crc32(r.check,o,p,u)),c-=p,u+=p,R)break e}else r.head&&(r.head.comment=null);r.mode=HCRC;case HCRC:if(r.flags&512){for(;m<16;){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}if(r.wrap&4&&a!==(r.check&65535)){s.msg="header crc mismatch",r.mode=BAD;break}a=0,m=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),s.adler=r.check=0,r.mode=TYPE;break;case DICTID:for(;m<32;){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}s.adler=r.check=zswap32(a),a=0,m=0,r.mode=DICT;case DICT:if(r.havedict===0)return s.next_out=l,s.avail_out=h,s.next_in=u,s.avail_in=c,r.hold=a,r.bits=m,Z_NEED_DICT$1;s.adler=r.check=1,r.mode=TYPE;case TYPE:if(i===Z_BLOCK||i===Z_TREES)break e;case TYPEDO:if(r.last){a>>>=m&7,m-=m&7,r.mode=CHECK;break}for(;m<3;){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}switch(r.last=a&1,a>>>=1,m-=1,a&3){case 0:r.mode=STORED;break;case 1:if(fixedtables(r),r.mode=LEN_,i===Z_TREES){a>>>=2,m-=2;break e}break;case 2:r.mode=TABLE;break;case 3:s.msg="invalid block type",r.mode=BAD}a>>>=2,m-=2;break;case STORED:for(a>>>=m&7,m-=m&7;m<32;){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}if((a&65535)!==(a>>>16^65535)){s.msg="invalid stored block lengths",r.mode=BAD;break}if(r.length=a&65535,a=0,m=0,r.mode=COPY_,i===Z_TREES)break e;case COPY_:r.mode=COPY;case COPY:if(p=r.length,p){if(p>c&&(p=c),p>h&&(p=h),p===0)break e;d.set(o.subarray(u,u+p),l),c-=p,u+=p,h-=p,l+=p,r.length-=p;break}r.mode=TYPE;break;case TABLE:for(;m<14;){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}if(r.nlen=(a&31)+257,a>>>=5,m-=5,r.ndist=(a&31)+1,a>>>=5,m-=5,r.ncode=(a&15)+4,a>>>=4,m-=4,r.nlen>286||r.ndist>30){s.msg="too many length or distance symbols",r.mode=BAD;break}r.have=0,r.mode=LENLENS;case LENLENS:for(;r.have<r.ncode;){for(;m<3;){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}r.lens[$[r.have++]]=a&7,a>>>=3,m-=3}for(;r.have<19;)r.lens[$[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,A={bits:r.lenbits},P=inflate_table(CODES,r.lens,0,19,r.lencode,0,r.work,A),r.lenbits=A.bits,P){s.msg="invalid code lengths set",r.mode=BAD;break}r.have=0,r.mode=CODELENS;case CODELENS:for(;r.have<r.nlen+r.ndist;){for(;w=r.lencode[a&(1<<r.lenbits)-1],x=w>>>24,_=w>>>16&255,T=w&65535,!(x<=m);){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}if(T<16)a>>>=x,m-=x,r.lens[r.have++]=T;else{if(T===16){for(I=x+2;m<I;){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}if(a>>>=x,m-=x,r.have===0){s.msg="invalid bit length repeat",r.mode=BAD;break}R=r.lens[r.have-1],p=3+(a&3),a>>>=2,m-=2}else if(T===17){for(I=x+3;m<I;){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}a>>>=x,m-=x,R=0,p=3+(a&7),a>>>=3,m-=3}else{for(I=x+7;m<I;){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}a>>>=x,m-=x,R=0,p=11+(a&127),a>>>=7,m-=7}if(r.have+p>r.nlen+r.ndist){s.msg="invalid bit length repeat",r.mode=BAD;break}for(;p--;)r.lens[r.have++]=R}}if(r.mode===BAD)break;if(r.lens[256]===0){s.msg="invalid code -- missing end-of-block",r.mode=BAD;break}if(r.lenbits=9,A={bits:r.lenbits},P=inflate_table(LENS,r.lens,0,r.nlen,r.lencode,0,r.work,A),r.lenbits=A.bits,P){s.msg="invalid literal/lengths set",r.mode=BAD;break}if(r.distbits=6,r.distcode=r.distdyn,A={bits:r.distbits},P=inflate_table(DISTS,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,A),r.distbits=A.bits,P){s.msg="invalid distances set",r.mode=BAD;break}if(r.mode=LEN_,i===Z_TREES)break e;case LEN_:r.mode=LEN;case LEN:if(c>=6&&h>=258){s.next_out=l,s.avail_out=h,s.next_in=u,s.avail_in=c,r.hold=a,r.bits=m,inflate_fast(s,g),l=s.next_out,d=s.output,h=s.avail_out,u=s.next_in,o=s.input,c=s.avail_in,a=r.hold,m=r.bits,r.mode===TYPE&&(r.back=-1);break}for(r.back=0;w=r.lencode[a&(1<<r.lenbits)-1],x=w>>>24,_=w>>>16&255,T=w&65535,!(x<=m);){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}if(_&&(_&240)===0){for(O=x,E=_,C=T;w=r.lencode[C+((a&(1<<O+E)-1)>>O)],x=w>>>24,_=w>>>16&255,T=w&65535,!(O+x<=m);){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}a>>>=O,m-=O,r.back+=O}if(a>>>=x,m-=x,r.back+=x,r.length=T,_===0){r.mode=LIT;break}if(_&32){r.back=-1,r.mode=TYPE;break}if(_&64){s.msg="invalid literal/length code",r.mode=BAD;break}r.extra=_&15,r.mode=LENEXT;case LENEXT:if(r.extra){for(I=r.extra;m<I;){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}r.length+=a&(1<<r.extra)-1,a>>>=r.extra,m-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=DIST;case DIST:for(;w=r.distcode[a&(1<<r.distbits)-1],x=w>>>24,_=w>>>16&255,T=w&65535,!(x<=m);){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}if((_&240)===0){for(O=x,E=_,C=T;w=r.distcode[C+((a&(1<<O+E)-1)>>O)],x=w>>>24,_=w>>>16&255,T=w&65535,!(O+x<=m);){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}a>>>=O,m-=O,r.back+=O}if(a>>>=x,m-=x,r.back+=x,_&64){s.msg="invalid distance code",r.mode=BAD;break}r.offset=T,r.extra=_&15,r.mode=DISTEXT;case DISTEXT:if(r.extra){for(I=r.extra;m<I;){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}r.offset+=a&(1<<r.extra)-1,a>>>=r.extra,m-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){s.msg="invalid distance too far back",r.mode=BAD;break}r.mode=MATCH;case MATCH:if(h===0)break e;if(p=g-h,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){s.msg="invalid distance too far back",r.mode=BAD;break}p>r.wnext?(p-=r.wnext,v=r.wsize-p):v=r.wnext-p,p>r.length&&(p=r.length),b=r.window}else b=d,v=l-r.offset,p=r.length;p>h&&(p=h),h-=p,r.length-=p;do d[l++]=b[v++];while(--p);r.length===0&&(r.mode=LEN);break;case LIT:if(h===0)break e;d[l++]=r.length,h--,r.mode=LEN;break;case CHECK:if(r.wrap){for(;m<32;){if(c===0)break e;c--,a|=o[u++]<<m,m+=8}if(g-=h,s.total_out+=g,r.total+=g,r.wrap&4&&g&&(s.adler=r.check=r.flags?crc32(r.check,d,g,l-g):adler32(r.check,d,g,l-g)),g=h,r.wrap&4&&(r.flags?a:zswap32(a))!==r.check){s.msg="incorrect data check",r.mode=BAD;break}a=0,m=0}r.mode=LENGTH;case LENGTH:if(r.wrap&&r.flags){for(;m<32;){if(c===0)break e;c--,a+=o[u++]<<m,m+=8}if(r.wrap&4&&a!==(r.total&4294967295)){s.msg="incorrect length check",r.mode=BAD;break}a=0,m=0}r.mode=DONE;case DONE:P=Z_STREAM_END$1;break e;case BAD:P=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return s.next_out=l,s.avail_out=h,s.next_in=u,s.avail_in=c,r.hold=a,r.bits=m,(r.wsize||g!==s.avail_out&&r.mode<BAD&&(r.mode<CHECK||i!==Z_FINISH$1))&&updatewindow(s,s.output,s.next_out,g-s.avail_out),y-=s.avail_in,g-=s.avail_out,s.total_in+=y,s.total_out+=g,r.total+=g,r.wrap&4&&g&&(s.adler=r.check=r.flags?crc32(r.check,d,g,s.next_out-g):adler32(r.check,d,g,s.next_out-g)),s.data_type=r.bits+(r.last?64:0)+(r.mode===TYPE?128:0)+(r.mode===LEN_||r.mode===COPY_?256:0),(y===0&&g===0||i===Z_FINISH$1)&&P===Z_OK$1&&(P=Z_BUF_ERROR),P},inflateEnd=s=>{if(inflateStateCheck(s))return Z_STREAM_ERROR$1;let i=s.state;return i.window&&(i.window=null),s.state=null,Z_OK$1},inflateGetHeader=(s,i)=>{if(inflateStateCheck(s))return Z_STREAM_ERROR$1;const r=s.state;return(r.wrap&2)===0?Z_STREAM_ERROR$1:(r.head=i,i.done=!1,Z_OK$1)},inflateSetDictionary=(s,i)=>{const r=i.length;let o,d,u;return inflateStateCheck(s)||(o=s.state,o.wrap!==0&&o.mode!==DICT)?Z_STREAM_ERROR$1:o.mode===DICT&&(d=1,d=adler32(d,i,r,0),d!==o.check)?Z_DATA_ERROR$1:(u=updatewindow(s,i,r,r),u?(o.mode=MEM,Z_MEM_ERROR$1):(o.havedict=1,Z_OK$1))};inflate$2.inflateReset=inflateReset;inflate$2.inflateReset2=inflateReset2;inflate$2.inflateResetKeep=inflateResetKeep;inflate$2.inflateInit=inflateInit;inflate$2.inflateInit2=inflateInit2;inflate$2.inflate=inflate$1;inflate$2.inflateEnd=inflateEnd;inflate$2.inflateGetHeader=inflateGetHeader;inflate$2.inflateSetDictionary=inflateSetDictionary;inflate$2.inflateInfo="pako inflate (from Nodeca project)";var common$1={};const _has=(s,i)=>Object.prototype.hasOwnProperty.call(s,i);common$1.assign=function(s){const i=Array.prototype.slice.call(arguments,1);for(;i.length;){const r=i.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(const o in r)_has(r,o)&&(s[o]=r[o])}}return s};common$1.flattenChunks=s=>{let i=0;for(let o=0,d=s.length;o<d;o++)i+=s[o].length;const r=new Uint8Array(i);for(let o=0,d=0,u=s.length;o<u;o++){let l=s[o];r.set(l,d),d+=l.length}return r};var strings$1={};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let s=0;s<256;s++)_utf8len[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;_utf8len[254]=_utf8len[254]=1;strings$1.string2buf=s=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(s);let i,r,o,d,u,l=s.length,c=0;for(d=0;d<l;d++)r=s.charCodeAt(d),(r&64512)===55296&&d+1<l&&(o=s.charCodeAt(d+1),(o&64512)===56320&&(r=65536+(r-55296<<10)+(o-56320),d++)),c+=r<128?1:r<2048?2:r<65536?3:4;for(i=new Uint8Array(c),u=0,d=0;u<c;d++)r=s.charCodeAt(d),(r&64512)===55296&&d+1<l&&(o=s.charCodeAt(d+1),(o&64512)===56320&&(r=65536+(r-55296<<10)+(o-56320),d++)),r<128?i[u++]=r:r<2048?(i[u++]=192|r>>>6,i[u++]=128|r&63):r<65536?(i[u++]=224|r>>>12,i[u++]=128|r>>>6&63,i[u++]=128|r&63):(i[u++]=240|r>>>18,i[u++]=128|r>>>12&63,i[u++]=128|r>>>6&63,i[u++]=128|r&63);return i};const buf2binstring=(s,i)=>{if(i<65534&&s.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,s.length===i?s:s.subarray(0,i));let r="";for(let o=0;o<i;o++)r+=String.fromCharCode(s[o]);return r};strings$1.buf2string=(s,i)=>{const r=i||s.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(s.subarray(0,i));let o,d;const u=new Array(r*2);for(d=0,o=0;o<r;){let l=s[o++];if(l<128){u[d++]=l;continue}let c=_utf8len[l];if(c>4){u[d++]=65533,o+=c-1;continue}for(l&=c===2?31:c===3?15:7;c>1&&o<r;)l=l<<6|s[o++]&63,c--;if(c>1){u[d++]=65533;continue}l<65536?u[d++]=l:(l-=65536,u[d++]=55296|l>>10&1023,u[d++]=56320|l&1023)}return buf2binstring(u,d)};strings$1.utf8border=(s,i)=>{i=i||s.length,i>s.length&&(i=s.length);let r=i-1;for(;r>=0&&(s[r]&192)===128;)r--;return r<0||r===0?i:r+_utf8len[s[r]]>i?r:i};var 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"};function ZStream$1(){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$1;function GZheader$1(){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$1;const zlib_inflate=inflate$2,utils=common$1,strings=strings$1,msg=messages,ZStream=zstream,GZheader=gzheader,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;function Inflate(s){this.options=utils.assign({chunkSize:1024*64,windowBits:15,to:""},s||{});const i=this.options;i.raw&&i.windowBits>=0&&i.windowBits<16&&(i.windowBits=-i.windowBits,i.windowBits===0&&(i.windowBits=-15)),i.windowBits>=0&&i.windowBits<16&&!(s&&s.windowBits)&&(i.windowBits+=32),i.windowBits>15&&i.windowBits<48&&(i.windowBits&15)===0&&(i.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ZStream,this.strm.avail_out=0;let r=zlib_inflate.inflateInit2(this.strm,i.windowBits);if(r!==Z_OK)throw new Error(msg[r]);if(this.header=new GZheader,zlib_inflate.inflateGetHeader(this.strm,this.header),i.dictionary&&(typeof i.dictionary=="string"?i.dictionary=strings.string2buf(i.dictionary):toString.call(i.dictionary)==="[object ArrayBuffer]"&&(i.dictionary=new Uint8Array(i.dictionary)),i.raw&&(r=zlib_inflate.inflateSetDictionary(this.strm,i.dictionary),r!==Z_OK)))throw new Error(msg[r])}Inflate.prototype.push=function(s,i){const r=this.strm,o=this.options.chunkSize,d=this.options.dictionary;let u,l,c;if(this.ended)return!1;for(i===~~i?l=i:l=i===!0?Z_FINISH:Z_NO_FLUSH,toString.call(s)==="[object ArrayBuffer]"?r.input=new Uint8Array(s):r.input=s,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(o),r.next_out=0,r.avail_out=o),u=zlib_inflate.inflate(r,l),u===Z_NEED_DICT&&d&&(u=zlib_inflate.inflateSetDictionary(r,d),u===Z_OK?u=zlib_inflate.inflate(r,l):u===Z_DATA_ERROR&&(u=Z_NEED_DICT));r.avail_in>0&&u===Z_STREAM_END&&r.state.wrap>0&&s[r.next_in]!==0;)zlib_inflate.inflateReset(r),u=zlib_inflate.inflate(r,l);switch(u){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(u),this.ended=!0,!1}if(c=r.avail_out,r.next_out&&(r.avail_out===0||u===Z_STREAM_END))if(this.options.to==="string"){let h=strings.utf8border(r.output,r.next_out),a=r.next_out-h,m=strings.buf2string(r.output,h);r.next_out=a,r.avail_out=o-a,a&&r.output.set(r.output.subarray(h,h+a),0),this.onData(m)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(u===Z_OK&&c===0)){if(u===Z_STREAM_END)return u=zlib_inflate.inflateEnd(this.strm),this.onEnd(u),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};Inflate.prototype.onData=function(s){this.chunks.push(s)};Inflate.prototype.onEnd=function(s){s===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=utils.flattenChunks(this.chunks)),this.chunks=[],this.err=s,this.msg=this.strm.msg};function inflate(s,i){const r=new Inflate(i);if(r.push(s),r.err)throw r.msg||msg[r.err];return r.result}var inflate_2=inflate;function f(s,i,r,o,d,u){let l=s.tileXYToRectangle(r,o,d);return Cesium.defined(Cesium.Rectangle.intersection(l,i,u))}class GeoTerrainProvider{constructor(i){if(i=i??{},!Cesium.defined(i.url))throw new Cesium.DeveloperError("options.url is required.");this._dataType=i.dataType??"int",this._tileType=i.tileType??"heightmap",this._url=i.url,this._maxTerrainLevel=i.dataType??"int",this._subdomains=i.subdomains,this._token=i.token,this.init(i)}get credit(){return this._credit}get errorEvent(){return this._errorEvent}get hasVertexNormals(){return!1}get hasWaterMask(){return!1}get tilingScheme(){if(!this.ready)throw new Cesium.DeveloperError("requestTileGeometry must not be called before ready returns true.");return this._tilingScheme}get ready(){return this._ready}init(i){this._ready=!1,this._errorEvent=new Cesium.Event,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0};const r=i.credit;typeof r=="string"&&(this._credit=new Cesium.Credit(r)),this._rectangles=[];const o=i.ellipsoid??Cesium.Ellipsoid.WGS84;this._tilingScheme=new Cesium.GeographicTilingScheme({ellipsoid:o}),this._heightmapWidth=64,this._heightmapHeight=64,this._levelZeroMaximumGeometricError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(o,Math.min(this._heightmapWidth,this._heightmapHeight),this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._ready=!0,this._topLevel=i.topLevel??5,this._bottomLevel=i.bottomLevel??25}requestTileGeometry(i,r,o,d){if(!this.ready)throw new Cesium.DeveloperError("requestTileGeometry must not be called before ready returns true.");if(o>=this._bottomLevel)return Promise.reject(`${o}该级别不发送请求!`);if(o<this._topLevel)return Promise.resolve(new Cesium.HeightmapTerrainData({buffer:this.getVHeightBuffer(),width:this._heightmapWidth,height:this._heightmapHeight,childTileMask:this.getChildTileMask(i,r,o),structure:this._terrainDataStructure}));let u="",l=this._url;Array.isArray(this._subdomains)&&this._subdomains.length&&(u=this._subdomains[(i+r)%this._subdomains.length],l=l.replace("{s}",u)),l=l.replace("{token}",this._token).replace("{x}",i).replace("{y}",r).replace("{z}",o+1);const c=Cesium.Resource.fetchArrayBuffer({url:l,request:d});if(c)return c.then(h=>h.byteLength<1e3?Promise.reject("无效数据"):inflate_2(h)).then(h=>{const a=new Cesium.HeightmapTerrainData({buffer:this.transformBuffer(h),width:this._heightmapWidth,height:this._heightmapHeight,childTileMask:this.getChildTileMask(i,r,o),structure:this._terrainDataStructure});return a._skirtHeight=6e3,a})}getLevelMaximumGeometricError(i){if(!this.ready)throw new Cesium.DeveloperError("requestTileGeometry must not be called before ready returns true.");return this._levelZeroMaximumGeometricError/(1<<i)}getTileDataAvailable(i,r,o){if(o<25)return!0}transformBuffer(i){let r=2;this._dataType==="int"?r=2:this._dataType==="float"&&(r=4);let o=i;if(o.length!==22500*r)return null;let d,u,l,c,h=new ArrayBuffer(r),a=new DataView(h),m=this._heightmapWidth,y=this._heightmapHeight,g=new Uint8Array(m*y*4);for(let p=0;p<y;p++)for(let v=0;v<m;v++){l=parseInt(149*p/(y-1)),c=parseInt(149*v/(m-1)),u=r*(150*l+c),r===4?(a.setInt8(0,o[u]),a.setInt8(1,o[u+1]),a.setInt8(2,o[u+2]),a.setInt8(3,o[u+3]),d=a.getFloat32(0,!0)):d=o[u]+256*o[u+1],(1e4<d||d<-2e3)&&(d=0);let b=(d+1e3)/.001,w=4*(p*m+v);g[w]=b/65536,g[1+w]=(b-256*g[w]*256)/256,g[2+w]=b-256*g[w]*256-256*g[1+w],g[3+w]=255}return g}getVHeightBuffer(){let i=this._vHeightBuffer;if(!Cesium.defined(i)){i=new Uint8ClampedArray(this._heightmapWidth*this._heightmapHeight*4);for(let r=0;r<this._heightmapWidth*this._heightmapHeight*4;)i[r++]=15,i[r++]=66,i[r++]=64,i[r++]=255;this._vHeightBuffer=i}return i}getChildTileMask(i,r,o){let d=new Cesium.Rectangle,u=this._tilingScheme,l=this._rectangles,c=u.tileXYToRectangle(i,r,o),h=0;for(let a=0;a<l.length&&h!==15;++a){let m=l[a];if(!(m.maxLevel<=o)){let y=m.rectangle,g=Cesium.Rectangle.intersection(y,c,d);Cesium.defined(g)&&(f(u,y,2*i,2*r,o+1,d)&&(h|=4),f(u,y,2*i+1,2*r,o+1,d)&&(h|=8),f(u,y,2*i,2*r+1,o+1,d)&&(h|=1),f(u,y,2*i+1,2*r+1,o+1,d)&&(h|=2))}}return h}}var src={exports:{}},indexLight={exports:{}},indexMinimal={},minimal={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=s;function s(i,r){for(var o=new Array(arguments.length-1),d=0,u=2,l=!0;u<arguments.length;)o[d++]=arguments[u++];return new Promise(function(h,a){o[d]=function(y){if(l)if(l=!1,y)a(y);else{for(var g=new Array(arguments.length-1),p=0;p<g.length;)g[p++]=arguments[p];h.apply(null,g)}};try{i.apply(r||null,o)}catch(m){l&&(l=!1,a(m))}})}return aspromise}var base64$1={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(s){var i=s;i.length=function(c){var h=c.length;if(!h)return 0;for(var a=0;--h%4>1&&c.charAt(h)==="=";)++a;return Math.ceil(c.length*3)/4-a};for(var r=new Array(64),o=new Array(123),d=0;d<64;)o[r[d]=d<26?d+65:d<52?d+71:d<62?d-4:d-59|43]=d++;i.encode=function(c,h,a){for(var m=null,y=[],g=0,p=0,v;h<a;){var b=c[h++];switch(p){case 0:y[g++]=r[b>>2],v=(b&3)<<4,p=1;break;case 1:y[g++]=r[v|b>>4],v=(b&15)<<2,p=2;break;case 2:y[g++]=r[v|b>>6],y[g++]=r[b&63],p=0;break}g>8191&&((m||(m=[])).push(String.fromCharCode.apply(String,y)),g=0)}return p&&(y[g++]=r[v],y[g++]=61,p===1&&(y[g++]=61)),m?(g&&m.push(String.fromCharCode.apply(String,y.slice(0,g))),m.join("")):String.fromCharCode.apply(String,y.slice(0,g))};var u="invalid encoding";i.decode=function(c,h,a){for(var m=a,y=0,g,p=0;p<c.length;){var v=c.charCodeAt(p++);if(v===61&&y>1)break;if((v=o[v])===void 0)throw Error(u);switch(y){case 0:g=v,y=1;break;case 1:h[a++]=g<<2|(v&48)>>4,g=v,y=2;break;case 2:h[a++]=(g&15)<<4|(v&60)>>2,g=v,y=3;break;case 3:h[a++]=(g&3)<<6|v,y=0;break}}if(y===1)throw Error(u);return a-m},i.test=function(c){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(c)}}(base64$1)),base64$1}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=s;function s(){this._listeners={}}return s.prototype.on=function(r,o,d){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:o,ctx:d||this}),this},s.prototype.off=function(r,o){if(r===void 0)this._listeners={};else if(o===void 0)this._listeners[r]=[];else for(var d=this._listeners[r],u=0;u<d.length;)d[u].fn===o?d.splice(u,1):++u;return this},s.prototype.emit=function(r){var o=this._listeners[r];if(o){for(var d=[],u=1;u<arguments.length;)d.push(arguments[u++]);for(u=0;u<o.length;)o[u].fn.apply(o[u++].ctx,d)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=s(s);function s(u){return typeof Float32Array<"u"?function(){var l=new Float32Array([-0]),c=new Uint8Array(l.buffer),h=c[3]===128;function a(p,v,b){l[0]=p,v[b]=c[0],v[b+1]=c[1],v[b+2]=c[2],v[b+3]=c[3]}function m(p,v,b){l[0]=p,v[b]=c[3],v[b+1]=c[2],v[b+2]=c[1],v[b+3]=c[0]}u.writeFloatLE=h?a:m,u.writeFloatBE=h?m:a;function y(p,v){return c[0]=p[v],c[1]=p[v+1],c[2]=p[v+2],c[3]=p[v+3],l[0]}function g(p,v){return c[3]=p[v],c[2]=p[v+1],c[1]=p[v+2],c[0]=p[v+3],l[0]}u.readFloatLE=h?y:g,u.readFloatBE=h?g:y}():function(){function l(h,a,m,y){var g=a<0?1:0;if(g&&(a=-a),a===0)h(1/a>0?0:2147483648,m,y);else if(isNaN(a))h(2143289344,m,y);else if(a>34028234663852886e22)h((g<<31|2139095040)>>>0,m,y);else if(a<11754943508222875e-54)h((g<<31|Math.round(a/1401298464324817e-60))>>>0,m,y);else{var p=Math.floor(Math.log(a)/Math.LN2),v=Math.round(a*Math.pow(2,-p)*8388608)&8388607;h((g<<31|p+127<<23|v)>>>0,m,y)}}u.writeFloatLE=l.bind(null,i),u.writeFloatBE=l.bind(null,r);function c(h,a,m){var y=h(a,m),g=(y>>31)*2+1,p=y>>>23&255,v=y&8388607;return p===255?v?NaN:g*(1/0):p===0?g*1401298464324817e-60*v:g*Math.pow(2,p-150)*(v+8388608)}u.readFloatLE=c.bind(null,o),u.readFloatBE=c.bind(null,d)}(),typeof Float64Array<"u"?function(){var l=new Float64Array([-0]),c=new Uint8Array(l.buffer),h=c[7]===128;function a(p,v,b){l[0]=p,v[b]=c[0],v[b+1]=c[1],v[b+2]=c[2],v[b+3]=c[3],v[b+4]=c[4],v[b+5]=c[5],v[b+6]=c[6],v[b+7]=c[7]}function m(p,v,b){l[0]=p,v[b]=c[7],v[b+1]=c[6],v[b+2]=c[5],v[b+3]=c[4],v[b+4]=c[3],v[b+5]=c[2],v[b+6]=c[1],v[b+7]=c[0]}u.writeDoubleLE=h?a:m,u.writeDoubleBE=h?m:a;function y(p,v){return c[0]=p[v],c[1]=p[v+1],c[2]=p[v+2],c[3]=p[v+3],c[4]=p[v+4],c[5]=p[v+5],c[6]=p[v+6],c[7]=p[v+7],l[0]}function g(p,v){return c[7]=p[v],c[6]=p[v+1],c[5]=p[v+2],c[4]=p[v+3],c[3]=p[v+4],c[2]=p[v+5],c[1]=p[v+6],c[0]=p[v+7],l[0]}u.readDoubleLE=h?y:g,u.readDoubleBE=h?g:y}():function(){function l(h,a,m,y,g,p){var v=y<0?1:0;if(v&&(y=-y),y===0)h(0,g,p+a),h(1/y>0?0:2147483648,g,p+m);else if(isNaN(y))h(0,g,p+a),h(2146959360,g,p+m);else if(y>17976931348623157e292)h(0,g,p+a),h((v<<31|2146435072)>>>0,g,p+m);else{var b;if(y<22250738585072014e-324)b=y/5e-324,h(b>>>0,g,p+a),h((v<<31|b/4294967296)>>>0,g,p+m);else{var w=Math.floor(Math.log(y)/Math.LN2);w===1024&&(w=1023),b=y*Math.pow(2,-w),h(b*4503599627370496>>>0,g,p+a),h((v<<31|w+1023<<20|b*1048576&1048575)>>>0,g,p+m)}}}u.writeDoubleLE=l.bind(null,i,0,4),u.writeDoubleBE=l.bind(null,r,4,0);function c(h,a,m,y,g){var p=h(y,g+a),v=h(y,g+m),b=(v>>31)*2+1,w=v>>>20&2047,x=4294967296*(v&1048575)+p;return w===2047?x?NaN:b*(1/0):w===0?b*5e-324*x:b*Math.pow(2,w-1075)*(x+4503599627370496)}u.readDoubleLE=c.bind(null,o,0,4),u.readDoubleBE=c.bind(null,d,4,0)}(),u}function i(u,l,c){l[c]=u&255,l[c+1]=u>>>8&255,l[c+2]=u>>>16&255,l[c+3]=u>>>24}function r(u,l,c){l[c]=u>>>24,l[c+1]=u>>>16&255,l[c+2]=u>>>8&255,l[c+3]=u&255}function o(u,l){return(u[l]|u[l+1]<<8|u[l+2]<<16|u[l+3]<<24)>>>0}function d(u,l){return(u[l]<<24|u[l+1]<<16|u[l+2]<<8|u[l+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(s){}return null}return inquire_1}var utf8$2={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(s){var i=s;i.length=function(o){for(var d=0,u=0,l=0;l<o.length;++l)u=o.charCodeAt(l),u<128?d+=1:u<2048?d+=2:(u&64512)===55296&&(o.charCodeAt(l+1)&64512)===56320?(++l,d+=4):d+=3;return d},i.read=function(o,d,u){var l=u-d;if(l<1)return"";for(var c=null,h=[],a=0,m;d<u;)m=o[d++],m<128?h[a++]=m:m>191&&m<224?h[a++]=(m&31)<<6|o[d++]&63:m>239&&m<365?(m=((m&7)<<18|(o[d++]&63)<<12|(o[d++]&63)<<6|o[d++]&63)-65536,h[a++]=55296+(m>>10),h[a++]=56320+(m&1023)):h[a++]=(m&15)<<12|(o[d++]&63)<<6|o[d++]&63,a>8191&&((c||(c=[])).push(String.fromCharCode.apply(String,h)),a=0);return c?(a&&c.push(String.fromCharCode.apply(String,h.slice(0,a))),c.join("")):String.fromCharCode.apply(String,h.slice(0,a))},i.write=function(o,d,u){for(var l=u,c,h,a=0;a<o.length;++a)c=o.charCodeAt(a),c<128?d[u++]=c:c<2048?(d[u++]=c>>6|192,d[u++]=c&63|128):(c&64512)===55296&&((h=o.charCodeAt(a+1))&64512)===56320?(c=65536+((c&1023)<<10)+(h&1023),++a,d[u++]=c>>18|240,d[u++]=c>>12&63|128,d[u++]=c>>6&63|128,d[u++]=c&63|128):(d[u++]=c>>12|224,d[u++]=c>>6&63|128,d[u++]=c&63|128);return u-l}}(utf8$2)),utf8$2}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=s;function s(i,r,o){var d=o||8192,u=d>>>1,l=null,c=d;return function(a){if(a<1||a>u)return i(a);c+a>d&&(l=i(d),c=0);var m=r.call(l,c,c+=a);return c&7&&(c=(c|7)+1),m}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=i;var s=requireMinimal();function i(u,l){this.lo=u>>>0,this.hi=l>>>0}var r=i.zero=new i(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var o=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(l){if(l===0)return r;var c=l<0;c&&(l=-l);var h=l>>>0,a=(l-h)/4294967296>>>0;return c&&(a=~a>>>0,h=~h>>>0,++h>4294967295&&(h=0,++a>4294967295&&(a=0))),new i(h,a)},i.from=function(l){if(typeof l=="number")return i.fromNumber(l);if(s.isString(l))if(s.Long)l=s.Long.fromString(l);else return i.fromNumber(parseInt(l,10));return l.low||l.high?new i(l.low>>>0,l.high>>>0):r},i.prototype.toNumber=function(l){if(!l&&this.hi>>>31){var c=~this.lo+1>>>0,h=~this.hi>>>0;return c||(h=h+1>>>0),-(c+h*4294967296)}return this.lo+this.hi*4294967296},i.prototype.toLong=function(l){return s.Long?new s.Long(this.lo|0,this.hi|0,!!l):{low:this.lo|0,high:this.hi|0,unsigned:!!l}};var d=String.prototype.charCodeAt;return i.fromHash=function(l){return l===o?r:new i((d.call(l,0)|d.call(l,1)<<8|d.call(l,2)<<16|d.call(l,3)<<24)>>>0,(d.call(l,4)|d.call(l,5)<<8|d.call(l,6)<<16|d.call(l,7)<<24)>>>0)},i.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)},i.prototype.zzEncode=function(){var l=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^l)>>>0,this.lo=(this.lo<<1^l)>>>0,this},i.prototype.zzDecode=function(){var l=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^l)>>>0,this.hi=(this.hi>>>1^l)>>>0,this},i.prototype.length=function(){var l=this.lo,c=(this.lo>>>28|this.hi<<4)>>>0,h=this.hi>>>24;return h===0?c===0?l<16384?l<128?1:2:l<2097152?3:4:c<16384?c<128?5:6:c<2097152?7:8:h<128?9:10},longbits}var hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,function(s){var i=s;i.asPromise=requireAspromise(),i.base64=requireBase64(),i.EventEmitter=requireEventemitter(),i.float=requireFloat(),i.inquire=requireInquire(),i.utf8=requireUtf8(),i.pool=requirePool(),i.LongBits=requireLongbits(),i.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),i.global=i.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||commonjsGlobal,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u},i.isString=function(u){return typeof u=="string"||u instanceof String},i.isObject=function(u){return u&&typeof u=="object"},i.isset=i.isSet=function(u,l){var c=u[l];return c!=null&&u.hasOwnProperty(l)?typeof c!="object"||(Array.isArray(c)?c.length:Object.keys(c).length)>0:!1},i.Buffer=function(){try{var d=i.inquire("buffer").Buffer;return d.prototype.utf8Write?d:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(u){return typeof u=="number"?i.Buffer?i._Buffer_allocUnsafe(u):new i.Array(u):i.Buffer?i._Buffer_from(u):typeof Uint8Array>"u"?u:new Uint8Array(u)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(u){return u?i.LongBits.from(u).toHash():i.LongBits.zeroHash},i.longFromHash=function(u,l){var c=i.LongBits.fromHash(u);return i.Long?i.Long.fromBits(c.lo,c.hi,l):c.toNumber(!!l)};function r(d,u,l){for(var c=Object.keys(u),h=0;h<c.length;++h)(d[c[h]]===void 0||!l)&&(d[c[h]]=u[c[h]]);return d}i.merge=r,i.lcFirst=function(u){return u.charAt(0).toLowerCase()+u.substring(1)};function o(d){function u(l,c){if(!(this instanceof u))return new u(l,c);Object.defineProperty(this,"message",{get:function(){return l}}),Error.captureStackTrace?Error.captureStackTrace(this,u):Object.defineProperty(this,"stack",{value:new Error().stack||""}),c&&r(this,c)}return u.prototype=Object.create(Error.prototype,{constructor:{value:u,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return d},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),u}i.newError=o,i.ProtocolError=o("ProtocolError"),i.oneOfGetter=function(u){for(var l={},c=0;c<u.length;++c)l[u[c]]=1;return function(){for(var h=Object.keys(this),a=h.length-1;a>-1;--a)if(l[h[a]]===1&&this[h[a]]!==void 0&&this[h[a]]!==null)return h[a]}},i.oneOfSetter=function(u){return function(l){for(var c=0;c<u.length;++c)u[c]!==l&&delete this[u[c]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var d=i.Buffer;if(!d){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=d.from!==Uint8Array.from&&d.from||function(l,c){return new d(l,c)},i._Buffer_allocUnsafe=d.allocUnsafe||function(l){return new d(l)}}}(minimal)),minimal}var writer=Writer$1,util$7=requireMinimal(),BufferWriter$1,LongBits$1=util$7.LongBits,base64=util$7.base64,utf8$1=util$7.utf8;function Op(s,i,r){this.fn=s,this.len=i,this.next=void 0,this.val=r}function noop(){}function State(s){this.head=s.head,this.tail=s.tail,this.len=s.len,this.next=s.states}function Writer$1(){this.len=0,this.head=new Op(noop,0,0),this.tail=this.head,this.states=null}var create$1=function s(){return util$7.Buffer?function(){return(Writer$1.create=function(){return new BufferWriter$1})()}:function(){return new Writer$1}};Writer$1.create=create$1();Writer$1.alloc=function s(i){return new util$7.Array(i)};util$7.Array!==Array&&(Writer$1.alloc=util$7.pool(Writer$1.alloc,util$7.Array.prototype.subarray));Writer$1.prototype._push=function s(i,r,o){return this.tail=this.tail.next=new Op(i,r,o),this.len+=r,this};function writeByte(s,i,r){i[r]=s&255}function writeVarint32(s,i,r){for(;s>127;)i[r++]=s&127|128,s>>>=7;i[r]=s}function VarintOp(s,i){this.len=s,this.next=void 0,this.val=i}VarintOp.prototype=Object.create(Op.prototype);VarintOp.prototype.fn=writeVarint32;Writer$1.prototype.uint32=function s(i){return this.len+=(this.tail=this.tail.next=new VarintOp((i=i>>>0)<128?1:i<16384?2:i<2097152?3:i<268435456?4:5,i)).len,this};Writer$1.prototype.int32=function s(i){return i<0?this._push(writeVarint64,10,LongBits$1.fromNumber(i)):this.uint32(i)};Writer$1.prototype.sint32=function s(i){return this.uint32((i<<1^i>>31)>>>0)};function writeVarint64(s,i,r){for(;s.hi;)i[r++]=s.lo&127|128,s.lo=(s.lo>>>7|s.hi<<25)>>>0,s.hi>>>=7;for(;s.lo>127;)i[r++]=s.lo&127|128,s.lo=s.lo>>>7;i[r++]=s.lo}Writer$1.prototype.uint64=function s(i){var r=LongBits$1.from(i);return this._push(writeVarint64,r.length(),r)};Writer$1.prototype.int64=Writer$1.prototype.uint64;Writer$1.prototype.sint64=function s(i){var r=LongBits$1.from(i).zzEncode();return this._push(writeVarint64,r.length(),r)};Writer$1.prototype.bool=function s(i){return this._push(writeByte,1,i?1:0)};function writeFixed32(s,i,r){i[r]=s&255,i[r+1]=s>>>8&255,i[r+2]=s>>>16&255,i[r+3]=s>>>24}Writer$1.prototype.fixed32=function s(i){return this._push(writeFixed32,4,i>>>0)};Writer$1.prototype.sfixed32=Writer$1.prototype.fixed32;Writer$1.prototype.fixed64=function s(i){var r=LongBits$1.from(i);return this._push(writeFixed32,4,r.lo)._push(writeFixed32,4,r.hi)};Writer$1.prototype.sfixed64=Writer$1.prototype.fixed64;Writer$1.prototype.float=function s(i){return this._push(util$7.float.writeFloatLE,4,i)};Writer$1.prototype.double=function s(i){return this._push(util$7.float.writeDoubleLE,8,i)};var writeBytes=util$7.Array.prototype.set?function s(i,r,o){r.set(i,o)}:function s(i,r,o){for(var d=0;d<i.length;++d)r[o+d]=i[d]};Writer$1.prototype.bytes=function s(i){var r=i.length>>>0;if(!r)return this._push(writeByte,1,0);if(util$7.isString(i)){var o=Writer$1.alloc(r=base64.length(i));base64.decode(i,o,0),i=o}return this.uint32(r)._push(writeBytes,r,i)};Writer$1.prototype.string=function s(i){var r=utf8$1.length(i);return r?this.uint32(r)._push(utf8$1.write,r,i):this._push(writeByte,1,0)};Writer$1.prototype.fork=function s(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this};Writer$1.prototype.reset=function s(){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 Op(noop,0,0),this.len=0),this};Writer$1.prototype.ldelim=function s(){var i=this.head,r=this.tail,o=this.len;return this.reset().uint32(o),o&&(this.tail.next=i.next,this.tail=r,this.len+=o),this};Writer$1.prototype.finish=function s(){for(var i=this.head.next,r=this.constructor.alloc(this.len),o=0;i;)i.fn(i.val,r,o),o+=i.len,i=i.next;return r};Writer$1._configure=function(s){BufferWriter$1=s,Writer$1.create=create$1(),BufferWriter$1._configure()};var writer_buffer=BufferWriter,Writer=writer;(BufferWriter.prototype=Object.create(Writer.prototype)).constructor=BufferWriter;var util$6=requireMinimal();function BufferWriter(){Writer.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=util$6._Buffer_allocUnsafe,BufferWriter.writeBytesBuffer=util$6.Buffer&&util$6.Buffer.prototype instanceof Uint8Array&&util$6.Buffer.prototype.set.name==="set"?function(i,r,o){r.set(i,o)}:function(i,r,o){if(i.copy)i.copy(r,o,0,i.length);else for(var d=0;d<i.length;)r[o++]=i[d++]}};BufferWriter.prototype.bytes=function s(i){util$6.isString(i)&&(i=util$6._Buffer_from(i,"base64"));var r=i.length>>>0;return this.uint32(r),r&&this._push(BufferWriter.writeBytesBuffer,r,i),this};function writeStringBuffer(s,i,r){s.length<40?util$6.utf8.write(s,i,r):i.utf8Write?i.utf8Write(s,r):i.write(s,r)}BufferWriter.prototype.string=function s(i){var r=util$6.Buffer.byteLength(i);return this.uint32(r),r&&this._push(writeStringBuffer,r,i),this};BufferWriter._configure();var reader=Reader$1,util$5=requireMinimal(),BufferReader$1,LongBits=util$5.LongBits,utf8=util$5.utf8;function indexOutOfRange(s,i){return RangeError("index out of range: "+s.pos+" + "+(i||1)+" > "+s.len)}function Reader$1(s){this.buf=s,this.pos=0,this.len=s.length}var create_array=typeof Uint8Array<"u"?function s(i){if(i instanceof Uint8Array||Array.isArray(i))return new Reader$1(i);throw Error("illegal buffer")}:function s(i){if(Array.isArray(i))return new Reader$1(i);throw Error("illegal buffer")},create=function s(){return util$5.Buffer?function(r){return(Reader$1.create=function(d){return util$5.Buffer.isBuffer(d)?new BufferReader$1(d):create_array(d)})(r)}:create_array};Reader$1.create=create();Reader$1.prototype._slice=util$5.Array.prototype.subarray||util$5.Array.prototype.slice;Reader$1.prototype.uint32=function s(){var i=4294967295;return function(){if(i=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(i=(i|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(i=(i|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(i=(i|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(i=(i|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return i;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return i}}();Reader$1.prototype.int32=function s(){return this.uint32()|0};Reader$1.prototype.sint32=function s(){var i=this.uint32();return i>>>1^-(i&1)|0};function readLongVarint(){var s=new LongBits(0,0),i=0;if(this.len-this.pos>4){for(;i<4;++i)if(s.lo=(s.lo|(this.buf[this.pos]&127)<<i*7)>>>0,this.buf[this.pos++]<128)return s;if(s.lo=(s.lo|(this.buf[this.pos]&127)<<28)>>>0,s.hi=(s.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return s;i=0}else{for(;i<3;++i){if(this.pos>=this.len)throw indexOutOfRange(this);if(s.lo=(s.lo|(this.buf[this.pos]&127)<<i*7)>>>0,this.buf[this.pos++]<128)return s}return s.lo=(s.lo|(this.buf[this.pos++]&127)<<i*7)>>>0,s}if(this.len-this.pos>4){for(;i<5;++i)if(s.hi=(s.hi|(this.buf[this.pos]&127)<<i*7+3)>>>0,this.buf[this.pos++]<128)return s}else for(;i<5;++i){if(this.pos>=this.len)throw indexOutOfRange(this);if(s.hi=(s.hi|(this.buf[this.pos]&127)<<i*7+3)>>>0,this.buf[this.pos++]<128)return s}throw Error("invalid varint encoding")}Reader$1.prototype.bool=function s(){return this.uint32()!==0};function readFixed32_end(s,i){return(s[i-4]|s[i-3]<<8|s[i-2]<<16|s[i-1]<<24)>>>0}Reader$1.prototype.fixed32=function s(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)};Reader$1.prototype.sfixed32=function s(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)|0};function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader$1.prototype.float=function s(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var i=util$5.float.readFloatLE(this.buf,this.pos);return this.pos+=4,i};Reader$1.prototype.double=function s(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var i=util$5.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,i};Reader$1.prototype.bytes=function s(){var i=this.uint32(),r=this.pos,o=this.pos+i;if(o>this.len)throw indexOutOfRange(this,i);if(this.pos+=i,Array.isArray(this.buf))return this.buf.slice(r,o);if(r===o){var d=util$5.Buffer;return d?d.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,o)};Reader$1.prototype.string=function s(){var i=this.bytes();return utf8.read(i,0,i.length)};Reader$1.prototype.skip=function s(i){if(typeof i=="number"){if(this.pos+i>this.len)throw indexOutOfRange(this,i);this.pos+=i}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(this.buf[this.pos++]&128);return this};Reader$1.prototype.skipType=function(s){switch(s){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(s=this.uint32()&7)!==4;)this.skipType(s);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+s+" at offset "+this.pos)}return this};Reader$1._configure=function(s){BufferReader$1=s,Reader$1.create=create(),BufferReader$1._configure();var i=util$5.Long?"toLong":"toNumber";util$5.merge(Reader$1.prototype,{int64:function(){return readLongVarint.call(this)[i](!1)},uint64:function(){return readLongVarint.call(this)[i](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[i](!1)},fixed64:function(){return readFixed64.call(this)[i](!0)},sfixed64:function(){return readFixed64.call(this)[i](!1)}})};var reader_buffer=BufferReader,Reader=reader;(BufferReader.prototype=Object.create(Reader.prototype)).constructor=BufferReader;var util$4=requireMinimal();function BufferReader(s){Reader.call(this,s)}BufferReader._configure=function(){util$4.Buffer&&(BufferReader.prototype._slice=util$4.Buffer.prototype.slice)};BufferReader.prototype.string=function s(){var i=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+i,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+i,this.len))};BufferReader._configure();var rpc={},service$1=Service$1,util$3=requireMinimal();(Service$1.prototype=Object.create(util$3.EventEmitter.prototype)).constructor=Service$1;function Service$1(s,i,r){if(typeof s!="function")throw TypeError("rpcImpl must be a function");util$3.EventEmitter.call(this),this.rpcImpl=s,this.requestDelimited=!!i,this.responseDelimited=!!r}Service$1.prototype.rpcCall=function s(i,r,o,d,u){if(!d)throw TypeError("request must be specified");var l=this;if(!u)return util$3.asPromise(s,l,i,r,o,d);if(!l.rpcImpl){setTimeout(function(){u(Error("already ended"))},0);return}try{return l.rpcImpl(i,r[l.requestDelimited?"encodeDelimited":"encode"](d).finish(),function(h,a){if(h)return l.emit("error",h,i),u(h);if(a===null){l.end(!0);return}if(!(a instanceof o))try{a=o[l.responseDelimited?"decodeDelimited":"decode"](a)}catch(m){return l.emit("error",m,i),u(m)}return l.emit("data",a,i),u(null,a)})}catch(c){l.emit("error",c,i),setTimeout(function(){u(c)},0);return}};Service$1.prototype.end=function s(i){return this.rpcImpl&&(i||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};(function(s){var i=s;i.Service=service$1})(rpc);var roots={};(function(s){var i=s;i.build="minimal",i.Writer=writer,i.BufferWriter=writer_buffer,i.Reader=reader,i.BufferReader=reader_buffer,i.util=requireMinimal(),i.rpc=rpc,i.roots=roots,i.configure=r;function r(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}r()})(indexMinimal);var util$2={exports:{}},codegen_1=codegen;function codegen(s,i){typeof s=="string"&&(i=s,s=void 0);var r=[];function o(u){if(typeof u!="string"){var l=d();if(codegen.verbose&&console.warn("codegen: "+l),l="return "+l,u){for(var c=Object.keys(u),h=new Array(c.length+1),a=new Array(c.length),m=0;m<c.length;)h[m]=c[m],a[m]=u[c[m++]];return h[m]=l,Function.apply(null,h).apply(null,a)}return Function(l)()}for(var y=new Array(arguments.length-1),g=0;g<y.length;)y[g]=arguments[++g];if(g=0,u=u.replace(/%([%dfijs])/g,function(v,b){var w=y[g++];switch(b){case"d":case"f":return String(Number(w));case"i":return String(Math.floor(w));case"j":return JSON.stringify(w);case"s":return String(w)}return"%"}),g!==y.length)throw Error("parameter count mismatch");return r.push(u),o}function d(u){return"function "+(u||i||"")+"("+(s&&s.join(",")||"")+`){
1
+ "use strict";var ue=Object.defineProperty;var le=(s,i,r)=>i in s?ue(s,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[i]=r;var j=(s,i,r)=>le(s,typeof i!="symbol"?i+"":i,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Cesium=require("cesium");function _interopNamespaceDefault(s){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(i,r,a.get?a:{enumerable:!0,get:()=>s[r]})}}return i.default=s,Object.freeze(i)}const Cesium__namespace=_interopNamespaceDefault(Cesium);var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},inflate$2={};const adler32$1=(s,i,r,a)=>{let d=s&65535|0,u=s>>>16&65535|0,l=0;for(;r!==0;){l=r>2e3?2e3:r,r-=l;do d=d+i[a++]|0,u=u+d|0;while(--l);d%=65521,u%=65521}return d|u<<16|0};var adler32_1=adler32$1;const makeTable=()=>{let s,i=[];for(var r=0;r<256;r++){s=r;for(var a=0;a<8;a++)s=s&1?3988292384^s>>>1:s>>>1;i[r]=s}return i},crcTable=new Uint32Array(makeTable()),crc32$1=(s,i,r,a)=>{const d=crcTable,u=a+r;s^=-1;for(let l=a;l<u;l++)s=s>>>8^d[(s^i[l])&255];return s^-1};var crc32_1=crc32$1;const BAD$1=16209,TYPE$1=16191;var inffast=function(i,r){let a,d,u,l,c,h,o,m,y,g,p,v,b,w,x,_,T,O,E,C,R,P,k,A;const I=i.state;a=i.next_in,k=i.input,d=a+(i.avail_in-5),u=i.next_out,A=i.output,l=u-(r-i.avail_out),c=u+(i.avail_out-257),h=I.dmax,o=I.wsize,m=I.whave,y=I.wnext,g=I.window,p=I.hold,v=I.bits,b=I.lencode,w=I.distcode,x=(1<<I.lenbits)-1,_=(1<<I.distbits)-1;e:do{v<15&&(p+=k[a++]<<v,v+=8,p+=k[a++]<<v,v+=8),T=b[p&x];t:for(;;){if(O=T>>>24,p>>>=O,v-=O,O=T>>>16&255,O===0)A[u++]=T&65535;else if(O&16){E=T&65535,O&=15,O&&(v<O&&(p+=k[a++]<<v,v+=8),E+=p&(1<<O)-1,p>>>=O,v-=O),v<15&&(p+=k[a++]<<v,v+=8,p+=k[a++]<<v,v+=8),T=w[p&_];r:for(;;){if(O=T>>>24,p>>>=O,v-=O,O=T>>>16&255,O&16){if(C=T&65535,O&=15,v<O&&(p+=k[a++]<<v,v+=8,v<O&&(p+=k[a++]<<v,v+=8)),C+=p&(1<<O)-1,C>h){i.msg="invalid distance too far back",I.mode=BAD$1;break e}if(p>>>=O,v-=O,O=u-l,C>O){if(O=C-O,O>m&&I.sane){i.msg="invalid distance too far back",I.mode=BAD$1;break e}if(R=0,P=g,y===0){if(R+=o-O,O<E){E-=O;do A[u++]=g[R++];while(--O);R=u-C,P=A}}else if(y<O){if(R+=o+y-O,O-=y,O<E){E-=O;do A[u++]=g[R++];while(--O);if(R=0,y<E){O=y,E-=O;do A[u++]=g[R++];while(--O);R=u-C,P=A}}}else if(R+=y-O,O<E){E-=O;do A[u++]=g[R++];while(--O);R=u-C,P=A}for(;E>2;)A[u++]=P[R++],A[u++]=P[R++],A[u++]=P[R++],E-=3;E&&(A[u++]=P[R++],E>1&&(A[u++]=P[R++]))}else{R=u-C;do A[u++]=A[R++],A[u++]=A[R++],A[u++]=A[R++],E-=3;while(E>2);E&&(A[u++]=A[R++],E>1&&(A[u++]=A[R++]))}}else if((O&64)===0){T=w[(T&65535)+(p&(1<<O)-1)];continue r}else{i.msg="invalid distance code",I.mode=BAD$1;break e}break}}else if((O&64)===0){T=b[(T&65535)+(p&(1<<O)-1)];continue t}else if(O&32){I.mode=TYPE$1;break e}else{i.msg="invalid literal/length code",I.mode=BAD$1;break e}break}}while(a<d&&u<c);E=v>>3,a-=E,v-=E<<3,p&=(1<<v)-1,i.next_in=a,i.next_out=u,i.avail_in=a<d?5+(d-a):5-(a-d),i.avail_out=u<c?257+(c-u):257-(u-c),I.hold=p,I.bits=v};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$1=(s,i,r,a,d,u,l,c)=>{const h=c.bits;let o=0,m=0,y=0,g=0,p=0,v=0,b=0,w=0,x=0,_=0,T,O,E,C,R,P=null,k;const A=new Uint16Array(MAXBITS+1),I=new Uint16Array(MAXBITS+1);let $=null,F,q,V;for(o=0;o<=MAXBITS;o++)A[o]=0;for(m=0;m<a;m++)A[i[r+m]]++;for(p=h,g=MAXBITS;g>=1&&A[g]===0;g--);if(p>g&&(p=g),g===0)return d[u++]=1<<24|64<<16|0,d[u++]=1<<24|64<<16|0,c.bits=1,0;for(y=1;y<g&&A[y]===0;y++);for(p<y&&(p=y),w=1,o=1;o<=MAXBITS;o++)if(w<<=1,w-=A[o],w<0)return-1;if(w>0&&(s===CODES$1||g!==1))return-1;for(I[1]=0,o=1;o<MAXBITS;o++)I[o+1]=I[o]+A[o];for(m=0;m<a;m++)i[r+m]!==0&&(l[I[i[r+m]]++]=m);if(s===CODES$1?(P=$=l,k=20):s===LENS$1?(P=lbase,$=lext,k=257):(P=dbase,$=dext,k=0),_=0,m=0,o=y,R=u,v=p,b=0,E=-1,x=1<<p,C=x-1,s===LENS$1&&x>ENOUGH_LENS$1||s===DISTS$1&&x>ENOUGH_DISTS$1)return 1;for(;;){F=o-b,l[m]+1<k?(q=0,V=l[m]):l[m]>=k?(q=$[l[m]-k],V=P[l[m]-k]):(q=96,V=0),T=1<<o-b,O=1<<v,y=O;do O-=T,d[R+(_>>b)+O]=F<<24|q<<16|V|0;while(O!==0);for(T=1<<o-1;_&T;)T>>=1;if(T!==0?(_&=T-1,_+=T):_=0,m++,--A[o]===0){if(o===g)break;o=i[r+l[m]]}if(o>p&&(_&C)!==E){for(b===0&&(b=p),R+=y,v=o-b,w=1<<v;v+b<g&&(w-=A[v+b],!(w<=0));)v++,w<<=1;if(x+=1<<v,s===LENS$1&&x>ENOUGH_LENS$1||s===DISTS$1&&x>ENOUGH_DISTS$1)return 1;E=_&C,d[E]=p<<24|v<<16|R-u|0}}return _!==0&&(d[R+_]=o-b<<24|64<<16|0),c.bits=p,0};var inftrees=inflate_table$1,constants={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 adler32=adler32_1,crc32=crc32_1,inflate_fast=inffast,inflate_table=inftrees,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,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=s=>(s>>>24&255)+(s>>>8&65280)+((s&65280)<<8)+((s&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=s=>{if(!s)return 1;const i=s.state;return!i||i.strm!==s||i.mode<HEAD||i.mode>SYNC?1:0},inflateResetKeep=s=>{if(inflateStateCheck(s))return Z_STREAM_ERROR$1;const i=s.state;return s.total_in=s.total_out=i.total=0,s.msg="",i.wrap&&(s.adler=i.wrap&1),i.mode=HEAD,i.last=0,i.havedict=0,i.flags=-1,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new Int32Array(ENOUGH_LENS),i.distcode=i.distdyn=new Int32Array(ENOUGH_DISTS),i.sane=1,i.back=-1,Z_OK$1},inflateReset=s=>{if(inflateStateCheck(s))return Z_STREAM_ERROR$1;const i=s.state;return i.wsize=0,i.whave=0,i.wnext=0,inflateResetKeep(s)},inflateReset2=(s,i)=>{let r;if(inflateStateCheck(s))return Z_STREAM_ERROR$1;const a=s.state;return i<0?(r=0,i=-i):(r=(i>>4)+5,i<48&&(i&=15)),i&&(i<8||i>15)?Z_STREAM_ERROR$1:(a.window!==null&&a.wbits!==i&&(a.window=null),a.wrap=r,a.wbits=i,inflateReset(s))},inflateInit2=(s,i)=>{if(!s)return Z_STREAM_ERROR$1;const r=new InflateState;s.state=r,r.strm=s,r.window=null,r.mode=HEAD;const a=inflateReset2(s,i);return a!==Z_OK$1&&(s.state=null),a},inflateInit=s=>inflateInit2(s,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=s=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let i=0;for(;i<144;)s.lens[i++]=8;for(;i<256;)s.lens[i++]=9;for(;i<280;)s.lens[i++]=7;for(;i<288;)s.lens[i++]=8;for(inflate_table(LENS,s.lens,0,288,lenfix,0,s.work,{bits:9}),i=0;i<32;)s.lens[i++]=5;inflate_table(DISTS,s.lens,0,32,distfix,0,s.work,{bits:5}),virgin=!1}s.lencode=lenfix,s.lenbits=9,s.distcode=distfix,s.distbits=5},updatewindow=(s,i,r,a)=>{let d;const u=s.state;return u.window===null&&(u.wsize=1<<u.wbits,u.wnext=0,u.whave=0,u.window=new Uint8Array(u.wsize)),a>=u.wsize?(u.window.set(i.subarray(r-u.wsize,r),0),u.wnext=0,u.whave=u.wsize):(d=u.wsize-u.wnext,d>a&&(d=a),u.window.set(i.subarray(r-a,r-a+d),u.wnext),a-=d,a?(u.window.set(i.subarray(r-a,r),0),u.wnext=a,u.whave=u.wsize):(u.wnext+=d,u.wnext===u.wsize&&(u.wnext=0),u.whave<u.wsize&&(u.whave+=d))),0},inflate$1=(s,i)=>{let r,a,d,u,l,c,h,o,m,y,g,p,v,b,w=0,x,_,T,O,E,C,R,P;const k=new Uint8Array(4);let A,I;const $=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(s)||!s.output||!s.input&&s.avail_in!==0)return Z_STREAM_ERROR$1;r=s.state,r.mode===TYPE&&(r.mode=TYPEDO),l=s.next_out,d=s.output,h=s.avail_out,u=s.next_in,a=s.input,c=s.avail_in,o=r.hold,m=r.bits,y=c,g=h,P=Z_OK$1;e:for(;;)switch(r.mode){case HEAD:if(r.wrap===0){r.mode=TYPEDO;break}for(;m<16;){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}if(r.wrap&2&&o===35615){r.wbits===0&&(r.wbits=15),r.check=0,k[0]=o&255,k[1]=o>>>8&255,r.check=crc32(r.check,k,2,0),o=0,m=0,r.mode=FLAGS;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((o&255)<<8)+(o>>8))%31){s.msg="incorrect header check",r.mode=BAD;break}if((o&15)!==Z_DEFLATED){s.msg="unknown compression method",r.mode=BAD;break}if(o>>>=4,m-=4,R=(o&15)+8,r.wbits===0&&(r.wbits=R),R>15||R>r.wbits){s.msg="invalid window size",r.mode=BAD;break}r.dmax=1<<r.wbits,r.flags=0,s.adler=r.check=1,r.mode=o&512?DICTID:TYPE,o=0,m=0;break;case FLAGS:for(;m<16;){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}if(r.flags=o,(r.flags&255)!==Z_DEFLATED){s.msg="unknown compression method",r.mode=BAD;break}if(r.flags&57344){s.msg="unknown header flags set",r.mode=BAD;break}r.head&&(r.head.text=o>>8&1),r.flags&512&&r.wrap&4&&(k[0]=o&255,k[1]=o>>>8&255,r.check=crc32(r.check,k,2,0)),o=0,m=0,r.mode=TIME;case TIME:for(;m<32;){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}r.head&&(r.head.time=o),r.flags&512&&r.wrap&4&&(k[0]=o&255,k[1]=o>>>8&255,k[2]=o>>>16&255,k[3]=o>>>24&255,r.check=crc32(r.check,k,4,0)),o=0,m=0,r.mode=OS;case OS:for(;m<16;){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}r.head&&(r.head.xflags=o&255,r.head.os=o>>8),r.flags&512&&r.wrap&4&&(k[0]=o&255,k[1]=o>>>8&255,r.check=crc32(r.check,k,2,0)),o=0,m=0,r.mode=EXLEN;case EXLEN:if(r.flags&1024){for(;m<16;){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}r.length=o,r.head&&(r.head.extra_len=o),r.flags&512&&r.wrap&4&&(k[0]=o&255,k[1]=o>>>8&255,r.check=crc32(r.check,k,2,0)),o=0,m=0}else r.head&&(r.head.extra=null);r.mode=EXTRA;case EXTRA:if(r.flags&1024&&(p=r.length,p>c&&(p=c),p&&(r.head&&(R=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(a.subarray(u,u+p),R)),r.flags&512&&r.wrap&4&&(r.check=crc32(r.check,a,p,u)),c-=p,u+=p,r.length-=p),r.length))break e;r.length=0,r.mode=NAME;case NAME:if(r.flags&2048){if(c===0)break e;p=0;do R=a[u+p++],r.head&&R&&r.length<65536&&(r.head.name+=String.fromCharCode(R));while(R&&p<c);if(r.flags&512&&r.wrap&4&&(r.check=crc32(r.check,a,p,u)),c-=p,u+=p,R)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=COMMENT;case COMMENT:if(r.flags&4096){if(c===0)break e;p=0;do R=a[u+p++],r.head&&R&&r.length<65536&&(r.head.comment+=String.fromCharCode(R));while(R&&p<c);if(r.flags&512&&r.wrap&4&&(r.check=crc32(r.check,a,p,u)),c-=p,u+=p,R)break e}else r.head&&(r.head.comment=null);r.mode=HCRC;case HCRC:if(r.flags&512){for(;m<16;){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}if(r.wrap&4&&o!==(r.check&65535)){s.msg="header crc mismatch",r.mode=BAD;break}o=0,m=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),s.adler=r.check=0,r.mode=TYPE;break;case DICTID:for(;m<32;){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}s.adler=r.check=zswap32(o),o=0,m=0,r.mode=DICT;case DICT:if(r.havedict===0)return s.next_out=l,s.avail_out=h,s.next_in=u,s.avail_in=c,r.hold=o,r.bits=m,Z_NEED_DICT$1;s.adler=r.check=1,r.mode=TYPE;case TYPE:if(i===Z_BLOCK||i===Z_TREES)break e;case TYPEDO:if(r.last){o>>>=m&7,m-=m&7,r.mode=CHECK;break}for(;m<3;){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}switch(r.last=o&1,o>>>=1,m-=1,o&3){case 0:r.mode=STORED;break;case 1:if(fixedtables(r),r.mode=LEN_,i===Z_TREES){o>>>=2,m-=2;break e}break;case 2:r.mode=TABLE;break;case 3:s.msg="invalid block type",r.mode=BAD}o>>>=2,m-=2;break;case STORED:for(o>>>=m&7,m-=m&7;m<32;){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}if((o&65535)!==(o>>>16^65535)){s.msg="invalid stored block lengths",r.mode=BAD;break}if(r.length=o&65535,o=0,m=0,r.mode=COPY_,i===Z_TREES)break e;case COPY_:r.mode=COPY;case COPY:if(p=r.length,p){if(p>c&&(p=c),p>h&&(p=h),p===0)break e;d.set(a.subarray(u,u+p),l),c-=p,u+=p,h-=p,l+=p,r.length-=p;break}r.mode=TYPE;break;case TABLE:for(;m<14;){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}if(r.nlen=(o&31)+257,o>>>=5,m-=5,r.ndist=(o&31)+1,o>>>=5,m-=5,r.ncode=(o&15)+4,o>>>=4,m-=4,r.nlen>286||r.ndist>30){s.msg="too many length or distance symbols",r.mode=BAD;break}r.have=0,r.mode=LENLENS;case LENLENS:for(;r.have<r.ncode;){for(;m<3;){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}r.lens[$[r.have++]]=o&7,o>>>=3,m-=3}for(;r.have<19;)r.lens[$[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,A={bits:r.lenbits},P=inflate_table(CODES,r.lens,0,19,r.lencode,0,r.work,A),r.lenbits=A.bits,P){s.msg="invalid code lengths set",r.mode=BAD;break}r.have=0,r.mode=CODELENS;case CODELENS:for(;r.have<r.nlen+r.ndist;){for(;w=r.lencode[o&(1<<r.lenbits)-1],x=w>>>24,_=w>>>16&255,T=w&65535,!(x<=m);){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}if(T<16)o>>>=x,m-=x,r.lens[r.have++]=T;else{if(T===16){for(I=x+2;m<I;){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}if(o>>>=x,m-=x,r.have===0){s.msg="invalid bit length repeat",r.mode=BAD;break}R=r.lens[r.have-1],p=3+(o&3),o>>>=2,m-=2}else if(T===17){for(I=x+3;m<I;){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}o>>>=x,m-=x,R=0,p=3+(o&7),o>>>=3,m-=3}else{for(I=x+7;m<I;){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}o>>>=x,m-=x,R=0,p=11+(o&127),o>>>=7,m-=7}if(r.have+p>r.nlen+r.ndist){s.msg="invalid bit length repeat",r.mode=BAD;break}for(;p--;)r.lens[r.have++]=R}}if(r.mode===BAD)break;if(r.lens[256]===0){s.msg="invalid code -- missing end-of-block",r.mode=BAD;break}if(r.lenbits=9,A={bits:r.lenbits},P=inflate_table(LENS,r.lens,0,r.nlen,r.lencode,0,r.work,A),r.lenbits=A.bits,P){s.msg="invalid literal/lengths set",r.mode=BAD;break}if(r.distbits=6,r.distcode=r.distdyn,A={bits:r.distbits},P=inflate_table(DISTS,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,A),r.distbits=A.bits,P){s.msg="invalid distances set",r.mode=BAD;break}if(r.mode=LEN_,i===Z_TREES)break e;case LEN_:r.mode=LEN;case LEN:if(c>=6&&h>=258){s.next_out=l,s.avail_out=h,s.next_in=u,s.avail_in=c,r.hold=o,r.bits=m,inflate_fast(s,g),l=s.next_out,d=s.output,h=s.avail_out,u=s.next_in,a=s.input,c=s.avail_in,o=r.hold,m=r.bits,r.mode===TYPE&&(r.back=-1);break}for(r.back=0;w=r.lencode[o&(1<<r.lenbits)-1],x=w>>>24,_=w>>>16&255,T=w&65535,!(x<=m);){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}if(_&&(_&240)===0){for(O=x,E=_,C=T;w=r.lencode[C+((o&(1<<O+E)-1)>>O)],x=w>>>24,_=w>>>16&255,T=w&65535,!(O+x<=m);){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}o>>>=O,m-=O,r.back+=O}if(o>>>=x,m-=x,r.back+=x,r.length=T,_===0){r.mode=LIT;break}if(_&32){r.back=-1,r.mode=TYPE;break}if(_&64){s.msg="invalid literal/length code",r.mode=BAD;break}r.extra=_&15,r.mode=LENEXT;case LENEXT:if(r.extra){for(I=r.extra;m<I;){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}r.length+=o&(1<<r.extra)-1,o>>>=r.extra,m-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=DIST;case DIST:for(;w=r.distcode[o&(1<<r.distbits)-1],x=w>>>24,_=w>>>16&255,T=w&65535,!(x<=m);){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}if((_&240)===0){for(O=x,E=_,C=T;w=r.distcode[C+((o&(1<<O+E)-1)>>O)],x=w>>>24,_=w>>>16&255,T=w&65535,!(O+x<=m);){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}o>>>=O,m-=O,r.back+=O}if(o>>>=x,m-=x,r.back+=x,_&64){s.msg="invalid distance code",r.mode=BAD;break}r.offset=T,r.extra=_&15,r.mode=DISTEXT;case DISTEXT:if(r.extra){for(I=r.extra;m<I;){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}r.offset+=o&(1<<r.extra)-1,o>>>=r.extra,m-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){s.msg="invalid distance too far back",r.mode=BAD;break}r.mode=MATCH;case MATCH:if(h===0)break e;if(p=g-h,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){s.msg="invalid distance too far back",r.mode=BAD;break}p>r.wnext?(p-=r.wnext,v=r.wsize-p):v=r.wnext-p,p>r.length&&(p=r.length),b=r.window}else b=d,v=l-r.offset,p=r.length;p>h&&(p=h),h-=p,r.length-=p;do d[l++]=b[v++];while(--p);r.length===0&&(r.mode=LEN);break;case LIT:if(h===0)break e;d[l++]=r.length,h--,r.mode=LEN;break;case CHECK:if(r.wrap){for(;m<32;){if(c===0)break e;c--,o|=a[u++]<<m,m+=8}if(g-=h,s.total_out+=g,r.total+=g,r.wrap&4&&g&&(s.adler=r.check=r.flags?crc32(r.check,d,g,l-g):adler32(r.check,d,g,l-g)),g=h,r.wrap&4&&(r.flags?o:zswap32(o))!==r.check){s.msg="incorrect data check",r.mode=BAD;break}o=0,m=0}r.mode=LENGTH;case LENGTH:if(r.wrap&&r.flags){for(;m<32;){if(c===0)break e;c--,o+=a[u++]<<m,m+=8}if(r.wrap&4&&o!==(r.total&4294967295)){s.msg="incorrect length check",r.mode=BAD;break}o=0,m=0}r.mode=DONE;case DONE:P=Z_STREAM_END$1;break e;case BAD:P=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return s.next_out=l,s.avail_out=h,s.next_in=u,s.avail_in=c,r.hold=o,r.bits=m,(r.wsize||g!==s.avail_out&&r.mode<BAD&&(r.mode<CHECK||i!==Z_FINISH$1))&&updatewindow(s,s.output,s.next_out,g-s.avail_out),y-=s.avail_in,g-=s.avail_out,s.total_in+=y,s.total_out+=g,r.total+=g,r.wrap&4&&g&&(s.adler=r.check=r.flags?crc32(r.check,d,g,s.next_out-g):adler32(r.check,d,g,s.next_out-g)),s.data_type=r.bits+(r.last?64:0)+(r.mode===TYPE?128:0)+(r.mode===LEN_||r.mode===COPY_?256:0),(y===0&&g===0||i===Z_FINISH$1)&&P===Z_OK$1&&(P=Z_BUF_ERROR),P},inflateEnd=s=>{if(inflateStateCheck(s))return Z_STREAM_ERROR$1;let i=s.state;return i.window&&(i.window=null),s.state=null,Z_OK$1},inflateGetHeader=(s,i)=>{if(inflateStateCheck(s))return Z_STREAM_ERROR$1;const r=s.state;return(r.wrap&2)===0?Z_STREAM_ERROR$1:(r.head=i,i.done=!1,Z_OK$1)},inflateSetDictionary=(s,i)=>{const r=i.length;let a,d,u;return inflateStateCheck(s)||(a=s.state,a.wrap!==0&&a.mode!==DICT)?Z_STREAM_ERROR$1:a.mode===DICT&&(d=1,d=adler32(d,i,r,0),d!==a.check)?Z_DATA_ERROR$1:(u=updatewindow(s,i,r,r),u?(a.mode=MEM,Z_MEM_ERROR$1):(a.havedict=1,Z_OK$1))};inflate$2.inflateReset=inflateReset;inflate$2.inflateReset2=inflateReset2;inflate$2.inflateResetKeep=inflateResetKeep;inflate$2.inflateInit=inflateInit;inflate$2.inflateInit2=inflateInit2;inflate$2.inflate=inflate$1;inflate$2.inflateEnd=inflateEnd;inflate$2.inflateGetHeader=inflateGetHeader;inflate$2.inflateSetDictionary=inflateSetDictionary;inflate$2.inflateInfo="pako inflate (from Nodeca project)";var common$1={};const _has=(s,i)=>Object.prototype.hasOwnProperty.call(s,i);common$1.assign=function(s){const i=Array.prototype.slice.call(arguments,1);for(;i.length;){const r=i.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(const a in r)_has(r,a)&&(s[a]=r[a])}}return s};common$1.flattenChunks=s=>{let i=0;for(let a=0,d=s.length;a<d;a++)i+=s[a].length;const r=new Uint8Array(i);for(let a=0,d=0,u=s.length;a<u;a++){let l=s[a];r.set(l,d),d+=l.length}return r};var strings$1={};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let s=0;s<256;s++)_utf8len[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;_utf8len[254]=_utf8len[254]=1;strings$1.string2buf=s=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(s);let i,r,a,d,u,l=s.length,c=0;for(d=0;d<l;d++)r=s.charCodeAt(d),(r&64512)===55296&&d+1<l&&(a=s.charCodeAt(d+1),(a&64512)===56320&&(r=65536+(r-55296<<10)+(a-56320),d++)),c+=r<128?1:r<2048?2:r<65536?3:4;for(i=new Uint8Array(c),u=0,d=0;u<c;d++)r=s.charCodeAt(d),(r&64512)===55296&&d+1<l&&(a=s.charCodeAt(d+1),(a&64512)===56320&&(r=65536+(r-55296<<10)+(a-56320),d++)),r<128?i[u++]=r:r<2048?(i[u++]=192|r>>>6,i[u++]=128|r&63):r<65536?(i[u++]=224|r>>>12,i[u++]=128|r>>>6&63,i[u++]=128|r&63):(i[u++]=240|r>>>18,i[u++]=128|r>>>12&63,i[u++]=128|r>>>6&63,i[u++]=128|r&63);return i};const buf2binstring=(s,i)=>{if(i<65534&&s.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,s.length===i?s:s.subarray(0,i));let r="";for(let a=0;a<i;a++)r+=String.fromCharCode(s[a]);return r};strings$1.buf2string=(s,i)=>{const r=i||s.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(s.subarray(0,i));let a,d;const u=new Array(r*2);for(d=0,a=0;a<r;){let l=s[a++];if(l<128){u[d++]=l;continue}let c=_utf8len[l];if(c>4){u[d++]=65533,a+=c-1;continue}for(l&=c===2?31:c===3?15:7;c>1&&a<r;)l=l<<6|s[a++]&63,c--;if(c>1){u[d++]=65533;continue}l<65536?u[d++]=l:(l-=65536,u[d++]=55296|l>>10&1023,u[d++]=56320|l&1023)}return buf2binstring(u,d)};strings$1.utf8border=(s,i)=>{i=i||s.length,i>s.length&&(i=s.length);let r=i-1;for(;r>=0&&(s[r]&192)===128;)r--;return r<0||r===0?i:r+_utf8len[s[r]]>i?r:i};var 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"};function ZStream$1(){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$1;function GZheader$1(){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$1;const zlib_inflate=inflate$2,utils=common$1,strings=strings$1,msg=messages,ZStream=zstream,GZheader=gzheader,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;function Inflate(s){this.options=utils.assign({chunkSize:1024*64,windowBits:15,to:""},s||{});const i=this.options;i.raw&&i.windowBits>=0&&i.windowBits<16&&(i.windowBits=-i.windowBits,i.windowBits===0&&(i.windowBits=-15)),i.windowBits>=0&&i.windowBits<16&&!(s&&s.windowBits)&&(i.windowBits+=32),i.windowBits>15&&i.windowBits<48&&(i.windowBits&15)===0&&(i.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ZStream,this.strm.avail_out=0;let r=zlib_inflate.inflateInit2(this.strm,i.windowBits);if(r!==Z_OK)throw new Error(msg[r]);if(this.header=new GZheader,zlib_inflate.inflateGetHeader(this.strm,this.header),i.dictionary&&(typeof i.dictionary=="string"?i.dictionary=strings.string2buf(i.dictionary):toString.call(i.dictionary)==="[object ArrayBuffer]"&&(i.dictionary=new Uint8Array(i.dictionary)),i.raw&&(r=zlib_inflate.inflateSetDictionary(this.strm,i.dictionary),r!==Z_OK)))throw new Error(msg[r])}Inflate.prototype.push=function(s,i){const r=this.strm,a=this.options.chunkSize,d=this.options.dictionary;let u,l,c;if(this.ended)return!1;for(i===~~i?l=i:l=i===!0?Z_FINISH:Z_NO_FLUSH,toString.call(s)==="[object ArrayBuffer]"?r.input=new Uint8Array(s):r.input=s,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(a),r.next_out=0,r.avail_out=a),u=zlib_inflate.inflate(r,l),u===Z_NEED_DICT&&d&&(u=zlib_inflate.inflateSetDictionary(r,d),u===Z_OK?u=zlib_inflate.inflate(r,l):u===Z_DATA_ERROR&&(u=Z_NEED_DICT));r.avail_in>0&&u===Z_STREAM_END&&r.state.wrap>0&&s[r.next_in]!==0;)zlib_inflate.inflateReset(r),u=zlib_inflate.inflate(r,l);switch(u){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(u),this.ended=!0,!1}if(c=r.avail_out,r.next_out&&(r.avail_out===0||u===Z_STREAM_END))if(this.options.to==="string"){let h=strings.utf8border(r.output,r.next_out),o=r.next_out-h,m=strings.buf2string(r.output,h);r.next_out=o,r.avail_out=a-o,o&&r.output.set(r.output.subarray(h,h+o),0),this.onData(m)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(u===Z_OK&&c===0)){if(u===Z_STREAM_END)return u=zlib_inflate.inflateEnd(this.strm),this.onEnd(u),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};Inflate.prototype.onData=function(s){this.chunks.push(s)};Inflate.prototype.onEnd=function(s){s===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=utils.flattenChunks(this.chunks)),this.chunks=[],this.err=s,this.msg=this.strm.msg};function inflate(s,i){const r=new Inflate(i);if(r.push(s),r.err)throw r.msg||msg[r.err];return r.result}var inflate_2=inflate;function f(s,i,r,a,d,u){let l=s.tileXYToRectangle(r,a,d);return Cesium.defined(Cesium.Rectangle.intersection(l,i,u))}class GeoTerrainProvider{constructor(i){if(i=i??{},!Cesium.defined(i.url))throw new Cesium.DeveloperError("options.url is required.");this._dataType=i.dataType??"int",this._tileType=i.tileType??"heightmap",this._url=i.url,this._maxTerrainLevel=i.dataType??"int",this._subdomains=i.subdomains,this._token=i.token,this.init(i)}get credit(){return this._credit}get errorEvent(){return this._errorEvent}get hasVertexNormals(){return!1}get hasWaterMask(){return!1}get tilingScheme(){if(!this.ready)throw new Cesium.DeveloperError("requestTileGeometry must not be called before ready returns true.");return this._tilingScheme}get ready(){return this._ready}init(i){this._ready=!1,this._errorEvent=new Cesium.Event,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0};const r=i.credit;typeof r=="string"&&(this._credit=new Cesium.Credit(r)),this._rectangles=[];const a=i.ellipsoid??Cesium.Ellipsoid.WGS84;this._tilingScheme=new Cesium.GeographicTilingScheme({ellipsoid:a}),this._heightmapWidth=64,this._heightmapHeight=64,this._levelZeroMaximumGeometricError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,Math.min(this._heightmapWidth,this._heightmapHeight),this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._ready=!0,this._topLevel=i.topLevel??5,this._bottomLevel=i.bottomLevel??25}requestTileGeometry(i,r,a,d){if(!this.ready)throw new Cesium.DeveloperError("requestTileGeometry must not be called before ready returns true.");if(a>=this._bottomLevel)return Promise.reject(`${a}该级别不发送请求!`);if(a<this._topLevel)return Promise.resolve(new Cesium.HeightmapTerrainData({buffer:this.getVHeightBuffer(),width:this._heightmapWidth,height:this._heightmapHeight,childTileMask:this.getChildTileMask(i,r,a),structure:this._terrainDataStructure}));let u="",l=this._url;Array.isArray(this._subdomains)&&this._subdomains.length&&(u=this._subdomains[(i+r)%this._subdomains.length],l=l.replace("{s}",u)),l=l.replace("{token}",this._token).replace("{x}",i).replace("{y}",r).replace("{z}",a+1);const c=Cesium.Resource.fetchArrayBuffer({url:l,request:d});if(c)return c.then(h=>h.byteLength<1e3?Promise.reject("无效数据"):inflate_2(h)).then(h=>{const o=new Cesium.HeightmapTerrainData({buffer:this.transformBuffer(h),width:this._heightmapWidth,height:this._heightmapHeight,childTileMask:this.getChildTileMask(i,r,a),structure:this._terrainDataStructure});return o._skirtHeight=6e3,o})}getLevelMaximumGeometricError(i){if(!this.ready)throw new Cesium.DeveloperError("requestTileGeometry must not be called before ready returns true.");return this._levelZeroMaximumGeometricError/(1<<i)}getTileDataAvailable(i,r,a){if(a<25)return!0}transformBuffer(i){let r=2;this._dataType==="int"?r=2:this._dataType==="float"&&(r=4);let a=i;if(a.length!==22500*r)return null;let d,u,l,c,h=new ArrayBuffer(r),o=new DataView(h),m=this._heightmapWidth,y=this._heightmapHeight,g=new Uint8Array(m*y*4);for(let p=0;p<y;p++)for(let v=0;v<m;v++){l=parseInt(149*p/(y-1)),c=parseInt(149*v/(m-1)),u=r*(150*l+c),r===4?(o.setInt8(0,a[u]),o.setInt8(1,a[u+1]),o.setInt8(2,a[u+2]),o.setInt8(3,a[u+3]),d=o.getFloat32(0,!0)):d=a[u]+256*a[u+1],(1e4<d||d<-2e3)&&(d=0);let b=(d+1e3)/.001,w=4*(p*m+v);g[w]=b/65536,g[1+w]=(b-256*g[w]*256)/256,g[2+w]=b-256*g[w]*256-256*g[1+w],g[3+w]=255}return g}getVHeightBuffer(){let i=this._vHeightBuffer;if(!Cesium.defined(i)){i=new Uint8ClampedArray(this._heightmapWidth*this._heightmapHeight*4);for(let r=0;r<this._heightmapWidth*this._heightmapHeight*4;)i[r++]=15,i[r++]=66,i[r++]=64,i[r++]=255;this._vHeightBuffer=i}return i}getChildTileMask(i,r,a){let d=new Cesium.Rectangle,u=this._tilingScheme,l=this._rectangles,c=u.tileXYToRectangle(i,r,a),h=0;for(let o=0;o<l.length&&h!==15;++o){let m=l[o];if(!(m.maxLevel<=a)){let y=m.rectangle,g=Cesium.Rectangle.intersection(y,c,d);Cesium.defined(g)&&(f(u,y,2*i,2*r,a+1,d)&&(h|=4),f(u,y,2*i+1,2*r,a+1,d)&&(h|=8),f(u,y,2*i,2*r+1,a+1,d)&&(h|=1),f(u,y,2*i+1,2*r+1,a+1,d)&&(h|=2))}}return h}}var src={exports:{}},indexLight={exports:{}},indexMinimal={},minimal={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=s;function s(i,r){for(var a=new Array(arguments.length-1),d=0,u=2,l=!0;u<arguments.length;)a[d++]=arguments[u++];return new Promise(function(h,o){a[d]=function(y){if(l)if(l=!1,y)o(y);else{for(var g=new Array(arguments.length-1),p=0;p<g.length;)g[p++]=arguments[p];h.apply(null,g)}};try{i.apply(r||null,a)}catch(m){l&&(l=!1,o(m))}})}return aspromise}var base64$1={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(s){var i=s;i.length=function(c){var h=c.length;if(!h)return 0;for(var o=0;--h%4>1&&c.charAt(h)==="=";)++o;return Math.ceil(c.length*3)/4-o};for(var r=new Array(64),a=new Array(123),d=0;d<64;)a[r[d]=d<26?d+65:d<52?d+71:d<62?d-4:d-59|43]=d++;i.encode=function(c,h,o){for(var m=null,y=[],g=0,p=0,v;h<o;){var b=c[h++];switch(p){case 0:y[g++]=r[b>>2],v=(b&3)<<4,p=1;break;case 1:y[g++]=r[v|b>>4],v=(b&15)<<2,p=2;break;case 2:y[g++]=r[v|b>>6],y[g++]=r[b&63],p=0;break}g>8191&&((m||(m=[])).push(String.fromCharCode.apply(String,y)),g=0)}return p&&(y[g++]=r[v],y[g++]=61,p===1&&(y[g++]=61)),m?(g&&m.push(String.fromCharCode.apply(String,y.slice(0,g))),m.join("")):String.fromCharCode.apply(String,y.slice(0,g))};var u="invalid encoding";i.decode=function(c,h,o){for(var m=o,y=0,g,p=0;p<c.length;){var v=c.charCodeAt(p++);if(v===61&&y>1)break;if((v=a[v])===void 0)throw Error(u);switch(y){case 0:g=v,y=1;break;case 1:h[o++]=g<<2|(v&48)>>4,g=v,y=2;break;case 2:h[o++]=(g&15)<<4|(v&60)>>2,g=v,y=3;break;case 3:h[o++]=(g&3)<<6|v,y=0;break}}if(y===1)throw Error(u);return o-m},i.test=function(c){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(c)}}(base64$1)),base64$1}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=s;function s(){this._listeners={}}return s.prototype.on=function(r,a,d){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:a,ctx:d||this}),this},s.prototype.off=function(r,a){if(r===void 0)this._listeners={};else if(a===void 0)this._listeners[r]=[];else for(var d=this._listeners[r],u=0;u<d.length;)d[u].fn===a?d.splice(u,1):++u;return this},s.prototype.emit=function(r){var a=this._listeners[r];if(a){for(var d=[],u=1;u<arguments.length;)d.push(arguments[u++]);for(u=0;u<a.length;)a[u].fn.apply(a[u++].ctx,d)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=s(s);function s(u){return typeof Float32Array<"u"?function(){var l=new Float32Array([-0]),c=new Uint8Array(l.buffer),h=c[3]===128;function o(p,v,b){l[0]=p,v[b]=c[0],v[b+1]=c[1],v[b+2]=c[2],v[b+3]=c[3]}function m(p,v,b){l[0]=p,v[b]=c[3],v[b+1]=c[2],v[b+2]=c[1],v[b+3]=c[0]}u.writeFloatLE=h?o:m,u.writeFloatBE=h?m:o;function y(p,v){return c[0]=p[v],c[1]=p[v+1],c[2]=p[v+2],c[3]=p[v+3],l[0]}function g(p,v){return c[3]=p[v],c[2]=p[v+1],c[1]=p[v+2],c[0]=p[v+3],l[0]}u.readFloatLE=h?y:g,u.readFloatBE=h?g:y}():function(){function l(h,o,m,y){var g=o<0?1:0;if(g&&(o=-o),o===0)h(1/o>0?0:2147483648,m,y);else if(isNaN(o))h(2143289344,m,y);else if(o>34028234663852886e22)h((g<<31|2139095040)>>>0,m,y);else if(o<11754943508222875e-54)h((g<<31|Math.round(o/1401298464324817e-60))>>>0,m,y);else{var p=Math.floor(Math.log(o)/Math.LN2),v=Math.round(o*Math.pow(2,-p)*8388608)&8388607;h((g<<31|p+127<<23|v)>>>0,m,y)}}u.writeFloatLE=l.bind(null,i),u.writeFloatBE=l.bind(null,r);function c(h,o,m){var y=h(o,m),g=(y>>31)*2+1,p=y>>>23&255,v=y&8388607;return p===255?v?NaN:g*(1/0):p===0?g*1401298464324817e-60*v:g*Math.pow(2,p-150)*(v+8388608)}u.readFloatLE=c.bind(null,a),u.readFloatBE=c.bind(null,d)}(),typeof Float64Array<"u"?function(){var l=new Float64Array([-0]),c=new Uint8Array(l.buffer),h=c[7]===128;function o(p,v,b){l[0]=p,v[b]=c[0],v[b+1]=c[1],v[b+2]=c[2],v[b+3]=c[3],v[b+4]=c[4],v[b+5]=c[5],v[b+6]=c[6],v[b+7]=c[7]}function m(p,v,b){l[0]=p,v[b]=c[7],v[b+1]=c[6],v[b+2]=c[5],v[b+3]=c[4],v[b+4]=c[3],v[b+5]=c[2],v[b+6]=c[1],v[b+7]=c[0]}u.writeDoubleLE=h?o:m,u.writeDoubleBE=h?m:o;function y(p,v){return c[0]=p[v],c[1]=p[v+1],c[2]=p[v+2],c[3]=p[v+3],c[4]=p[v+4],c[5]=p[v+5],c[6]=p[v+6],c[7]=p[v+7],l[0]}function g(p,v){return c[7]=p[v],c[6]=p[v+1],c[5]=p[v+2],c[4]=p[v+3],c[3]=p[v+4],c[2]=p[v+5],c[1]=p[v+6],c[0]=p[v+7],l[0]}u.readDoubleLE=h?y:g,u.readDoubleBE=h?g:y}():function(){function l(h,o,m,y,g,p){var v=y<0?1:0;if(v&&(y=-y),y===0)h(0,g,p+o),h(1/y>0?0:2147483648,g,p+m);else if(isNaN(y))h(0,g,p+o),h(2146959360,g,p+m);else if(y>17976931348623157e292)h(0,g,p+o),h((v<<31|2146435072)>>>0,g,p+m);else{var b;if(y<22250738585072014e-324)b=y/5e-324,h(b>>>0,g,p+o),h((v<<31|b/4294967296)>>>0,g,p+m);else{var w=Math.floor(Math.log(y)/Math.LN2);w===1024&&(w=1023),b=y*Math.pow(2,-w),h(b*4503599627370496>>>0,g,p+o),h((v<<31|w+1023<<20|b*1048576&1048575)>>>0,g,p+m)}}}u.writeDoubleLE=l.bind(null,i,0,4),u.writeDoubleBE=l.bind(null,r,4,0);function c(h,o,m,y,g){var p=h(y,g+o),v=h(y,g+m),b=(v>>31)*2+1,w=v>>>20&2047,x=4294967296*(v&1048575)+p;return w===2047?x?NaN:b*(1/0):w===0?b*5e-324*x:b*Math.pow(2,w-1075)*(x+4503599627370496)}u.readDoubleLE=c.bind(null,a,0,4),u.readDoubleBE=c.bind(null,d,4,0)}(),u}function i(u,l,c){l[c]=u&255,l[c+1]=u>>>8&255,l[c+2]=u>>>16&255,l[c+3]=u>>>24}function r(u,l,c){l[c]=u>>>24,l[c+1]=u>>>16&255,l[c+2]=u>>>8&255,l[c+3]=u&255}function a(u,l){return(u[l]|u[l+1]<<8|u[l+2]<<16|u[l+3]<<24)>>>0}function d(u,l){return(u[l]<<24|u[l+1]<<16|u[l+2]<<8|u[l+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(s){}return null}return inquire_1}var utf8$2={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(s){var i=s;i.length=function(a){for(var d=0,u=0,l=0;l<a.length;++l)u=a.charCodeAt(l),u<128?d+=1:u<2048?d+=2:(u&64512)===55296&&(a.charCodeAt(l+1)&64512)===56320?(++l,d+=4):d+=3;return d},i.read=function(a,d,u){var l=u-d;if(l<1)return"";for(var c=null,h=[],o=0,m;d<u;)m=a[d++],m<128?h[o++]=m:m>191&&m<224?h[o++]=(m&31)<<6|a[d++]&63:m>239&&m<365?(m=((m&7)<<18|(a[d++]&63)<<12|(a[d++]&63)<<6|a[d++]&63)-65536,h[o++]=55296+(m>>10),h[o++]=56320+(m&1023)):h[o++]=(m&15)<<12|(a[d++]&63)<<6|a[d++]&63,o>8191&&((c||(c=[])).push(String.fromCharCode.apply(String,h)),o=0);return c?(o&&c.push(String.fromCharCode.apply(String,h.slice(0,o))),c.join("")):String.fromCharCode.apply(String,h.slice(0,o))},i.write=function(a,d,u){for(var l=u,c,h,o=0;o<a.length;++o)c=a.charCodeAt(o),c<128?d[u++]=c:c<2048?(d[u++]=c>>6|192,d[u++]=c&63|128):(c&64512)===55296&&((h=a.charCodeAt(o+1))&64512)===56320?(c=65536+((c&1023)<<10)+(h&1023),++o,d[u++]=c>>18|240,d[u++]=c>>12&63|128,d[u++]=c>>6&63|128,d[u++]=c&63|128):(d[u++]=c>>12|224,d[u++]=c>>6&63|128,d[u++]=c&63|128);return u-l}}(utf8$2)),utf8$2}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=s;function s(i,r,a){var d=a||8192,u=d>>>1,l=null,c=d;return function(o){if(o<1||o>u)return i(o);c+o>d&&(l=i(d),c=0);var m=r.call(l,c,c+=o);return c&7&&(c=(c|7)+1),m}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=i;var s=requireMinimal();function i(u,l){this.lo=u>>>0,this.hi=l>>>0}var r=i.zero=new i(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var a=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(l){if(l===0)return r;var c=l<0;c&&(l=-l);var h=l>>>0,o=(l-h)/4294967296>>>0;return c&&(o=~o>>>0,h=~h>>>0,++h>4294967295&&(h=0,++o>4294967295&&(o=0))),new i(h,o)},i.from=function(l){if(typeof l=="number")return i.fromNumber(l);if(s.isString(l))if(s.Long)l=s.Long.fromString(l);else return i.fromNumber(parseInt(l,10));return l.low||l.high?new i(l.low>>>0,l.high>>>0):r},i.prototype.toNumber=function(l){if(!l&&this.hi>>>31){var c=~this.lo+1>>>0,h=~this.hi>>>0;return c||(h=h+1>>>0),-(c+h*4294967296)}return this.lo+this.hi*4294967296},i.prototype.toLong=function(l){return s.Long?new s.Long(this.lo|0,this.hi|0,!!l):{low:this.lo|0,high:this.hi|0,unsigned:!!l}};var d=String.prototype.charCodeAt;return i.fromHash=function(l){return l===a?r:new i((d.call(l,0)|d.call(l,1)<<8|d.call(l,2)<<16|d.call(l,3)<<24)>>>0,(d.call(l,4)|d.call(l,5)<<8|d.call(l,6)<<16|d.call(l,7)<<24)>>>0)},i.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)},i.prototype.zzEncode=function(){var l=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^l)>>>0,this.lo=(this.lo<<1^l)>>>0,this},i.prototype.zzDecode=function(){var l=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^l)>>>0,this.hi=(this.hi>>>1^l)>>>0,this},i.prototype.length=function(){var l=this.lo,c=(this.lo>>>28|this.hi<<4)>>>0,h=this.hi>>>24;return h===0?c===0?l<16384?l<128?1:2:l<2097152?3:4:c<16384?c<128?5:6:c<2097152?7:8:h<128?9:10},longbits}var hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,function(s){var i=s;i.asPromise=requireAspromise(),i.base64=requireBase64(),i.EventEmitter=requireEventemitter(),i.float=requireFloat(),i.inquire=requireInquire(),i.utf8=requireUtf8(),i.pool=requirePool(),i.LongBits=requireLongbits(),i.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),i.global=i.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||commonjsGlobal,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u},i.isString=function(u){return typeof u=="string"||u instanceof String},i.isObject=function(u){return u&&typeof u=="object"},i.isset=i.isSet=function(u,l){var c=u[l];return c!=null&&u.hasOwnProperty(l)?typeof c!="object"||(Array.isArray(c)?c.length:Object.keys(c).length)>0:!1},i.Buffer=function(){try{var d=i.inquire("buffer").Buffer;return d.prototype.utf8Write?d:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(u){return typeof u=="number"?i.Buffer?i._Buffer_allocUnsafe(u):new i.Array(u):i.Buffer?i._Buffer_from(u):typeof Uint8Array>"u"?u:new Uint8Array(u)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(u){return u?i.LongBits.from(u).toHash():i.LongBits.zeroHash},i.longFromHash=function(u,l){var c=i.LongBits.fromHash(u);return i.Long?i.Long.fromBits(c.lo,c.hi,l):c.toNumber(!!l)};function r(d,u,l){for(var c=Object.keys(u),h=0;h<c.length;++h)(d[c[h]]===void 0||!l)&&(d[c[h]]=u[c[h]]);return d}i.merge=r,i.lcFirst=function(u){return u.charAt(0).toLowerCase()+u.substring(1)};function a(d){function u(l,c){if(!(this instanceof u))return new u(l,c);Object.defineProperty(this,"message",{get:function(){return l}}),Error.captureStackTrace?Error.captureStackTrace(this,u):Object.defineProperty(this,"stack",{value:new Error().stack||""}),c&&r(this,c)}return u.prototype=Object.create(Error.prototype,{constructor:{value:u,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return d},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),u}i.newError=a,i.ProtocolError=a("ProtocolError"),i.oneOfGetter=function(u){for(var l={},c=0;c<u.length;++c)l[u[c]]=1;return function(){for(var h=Object.keys(this),o=h.length-1;o>-1;--o)if(l[h[o]]===1&&this[h[o]]!==void 0&&this[h[o]]!==null)return h[o]}},i.oneOfSetter=function(u){return function(l){for(var c=0;c<u.length;++c)u[c]!==l&&delete this[u[c]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var d=i.Buffer;if(!d){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=d.from!==Uint8Array.from&&d.from||function(l,c){return new d(l,c)},i._Buffer_allocUnsafe=d.allocUnsafe||function(l){return new d(l)}}}(minimal)),minimal}var writer=Writer$1,util$7=requireMinimal(),BufferWriter$1,LongBits$1=util$7.LongBits,base64=util$7.base64,utf8$1=util$7.utf8;function Op(s,i,r){this.fn=s,this.len=i,this.next=void 0,this.val=r}function noop(){}function State(s){this.head=s.head,this.tail=s.tail,this.len=s.len,this.next=s.states}function Writer$1(){this.len=0,this.head=new Op(noop,0,0),this.tail=this.head,this.states=null}var create$1=function s(){return util$7.Buffer?function(){return(Writer$1.create=function(){return new BufferWriter$1})()}:function(){return new Writer$1}};Writer$1.create=create$1();Writer$1.alloc=function s(i){return new util$7.Array(i)};util$7.Array!==Array&&(Writer$1.alloc=util$7.pool(Writer$1.alloc,util$7.Array.prototype.subarray));Writer$1.prototype._push=function s(i,r,a){return this.tail=this.tail.next=new Op(i,r,a),this.len+=r,this};function writeByte(s,i,r){i[r]=s&255}function writeVarint32(s,i,r){for(;s>127;)i[r++]=s&127|128,s>>>=7;i[r]=s}function VarintOp(s,i){this.len=s,this.next=void 0,this.val=i}VarintOp.prototype=Object.create(Op.prototype);VarintOp.prototype.fn=writeVarint32;Writer$1.prototype.uint32=function s(i){return this.len+=(this.tail=this.tail.next=new VarintOp((i=i>>>0)<128?1:i<16384?2:i<2097152?3:i<268435456?4:5,i)).len,this};Writer$1.prototype.int32=function s(i){return i<0?this._push(writeVarint64,10,LongBits$1.fromNumber(i)):this.uint32(i)};Writer$1.prototype.sint32=function s(i){return this.uint32((i<<1^i>>31)>>>0)};function writeVarint64(s,i,r){for(;s.hi;)i[r++]=s.lo&127|128,s.lo=(s.lo>>>7|s.hi<<25)>>>0,s.hi>>>=7;for(;s.lo>127;)i[r++]=s.lo&127|128,s.lo=s.lo>>>7;i[r++]=s.lo}Writer$1.prototype.uint64=function s(i){var r=LongBits$1.from(i);return this._push(writeVarint64,r.length(),r)};Writer$1.prototype.int64=Writer$1.prototype.uint64;Writer$1.prototype.sint64=function s(i){var r=LongBits$1.from(i).zzEncode();return this._push(writeVarint64,r.length(),r)};Writer$1.prototype.bool=function s(i){return this._push(writeByte,1,i?1:0)};function writeFixed32(s,i,r){i[r]=s&255,i[r+1]=s>>>8&255,i[r+2]=s>>>16&255,i[r+3]=s>>>24}Writer$1.prototype.fixed32=function s(i){return this._push(writeFixed32,4,i>>>0)};Writer$1.prototype.sfixed32=Writer$1.prototype.fixed32;Writer$1.prototype.fixed64=function s(i){var r=LongBits$1.from(i);return this._push(writeFixed32,4,r.lo)._push(writeFixed32,4,r.hi)};Writer$1.prototype.sfixed64=Writer$1.prototype.fixed64;Writer$1.prototype.float=function s(i){return this._push(util$7.float.writeFloatLE,4,i)};Writer$1.prototype.double=function s(i){return this._push(util$7.float.writeDoubleLE,8,i)};var writeBytes=util$7.Array.prototype.set?function s(i,r,a){r.set(i,a)}:function s(i,r,a){for(var d=0;d<i.length;++d)r[a+d]=i[d]};Writer$1.prototype.bytes=function s(i){var r=i.length>>>0;if(!r)return this._push(writeByte,1,0);if(util$7.isString(i)){var a=Writer$1.alloc(r=base64.length(i));base64.decode(i,a,0),i=a}return this.uint32(r)._push(writeBytes,r,i)};Writer$1.prototype.string=function s(i){var r=utf8$1.length(i);return r?this.uint32(r)._push(utf8$1.write,r,i):this._push(writeByte,1,0)};Writer$1.prototype.fork=function s(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this};Writer$1.prototype.reset=function s(){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 Op(noop,0,0),this.len=0),this};Writer$1.prototype.ldelim=function s(){var i=this.head,r=this.tail,a=this.len;return this.reset().uint32(a),a&&(this.tail.next=i.next,this.tail=r,this.len+=a),this};Writer$1.prototype.finish=function s(){for(var i=this.head.next,r=this.constructor.alloc(this.len),a=0;i;)i.fn(i.val,r,a),a+=i.len,i=i.next;return r};Writer$1._configure=function(s){BufferWriter$1=s,Writer$1.create=create$1(),BufferWriter$1._configure()};var writer_buffer=BufferWriter,Writer=writer;(BufferWriter.prototype=Object.create(Writer.prototype)).constructor=BufferWriter;var util$6=requireMinimal();function BufferWriter(){Writer.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=util$6._Buffer_allocUnsafe,BufferWriter.writeBytesBuffer=util$6.Buffer&&util$6.Buffer.prototype instanceof Uint8Array&&util$6.Buffer.prototype.set.name==="set"?function(i,r,a){r.set(i,a)}:function(i,r,a){if(i.copy)i.copy(r,a,0,i.length);else for(var d=0;d<i.length;)r[a++]=i[d++]}};BufferWriter.prototype.bytes=function s(i){util$6.isString(i)&&(i=util$6._Buffer_from(i,"base64"));var r=i.length>>>0;return this.uint32(r),r&&this._push(BufferWriter.writeBytesBuffer,r,i),this};function writeStringBuffer(s,i,r){s.length<40?util$6.utf8.write(s,i,r):i.utf8Write?i.utf8Write(s,r):i.write(s,r)}BufferWriter.prototype.string=function s(i){var r=util$6.Buffer.byteLength(i);return this.uint32(r),r&&this._push(writeStringBuffer,r,i),this};BufferWriter._configure();var reader=Reader$1,util$5=requireMinimal(),BufferReader$1,LongBits=util$5.LongBits,utf8=util$5.utf8;function indexOutOfRange(s,i){return RangeError("index out of range: "+s.pos+" + "+(i||1)+" > "+s.len)}function Reader$1(s){this.buf=s,this.pos=0,this.len=s.length}var create_array=typeof Uint8Array<"u"?function s(i){if(i instanceof Uint8Array||Array.isArray(i))return new Reader$1(i);throw Error("illegal buffer")}:function s(i){if(Array.isArray(i))return new Reader$1(i);throw Error("illegal buffer")},create=function s(){return util$5.Buffer?function(r){return(Reader$1.create=function(d){return util$5.Buffer.isBuffer(d)?new BufferReader$1(d):create_array(d)})(r)}:create_array};Reader$1.create=create();Reader$1.prototype._slice=util$5.Array.prototype.subarray||util$5.Array.prototype.slice;Reader$1.prototype.uint32=function s(){var i=4294967295;return function(){if(i=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(i=(i|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(i=(i|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(i=(i|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(i=(i|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return i;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return i}}();Reader$1.prototype.int32=function s(){return this.uint32()|0};Reader$1.prototype.sint32=function s(){var i=this.uint32();return i>>>1^-(i&1)|0};function readLongVarint(){var s=new LongBits(0,0),i=0;if(this.len-this.pos>4){for(;i<4;++i)if(s.lo=(s.lo|(this.buf[this.pos]&127)<<i*7)>>>0,this.buf[this.pos++]<128)return s;if(s.lo=(s.lo|(this.buf[this.pos]&127)<<28)>>>0,s.hi=(s.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return s;i=0}else{for(;i<3;++i){if(this.pos>=this.len)throw indexOutOfRange(this);if(s.lo=(s.lo|(this.buf[this.pos]&127)<<i*7)>>>0,this.buf[this.pos++]<128)return s}return s.lo=(s.lo|(this.buf[this.pos++]&127)<<i*7)>>>0,s}if(this.len-this.pos>4){for(;i<5;++i)if(s.hi=(s.hi|(this.buf[this.pos]&127)<<i*7+3)>>>0,this.buf[this.pos++]<128)return s}else for(;i<5;++i){if(this.pos>=this.len)throw indexOutOfRange(this);if(s.hi=(s.hi|(this.buf[this.pos]&127)<<i*7+3)>>>0,this.buf[this.pos++]<128)return s}throw Error("invalid varint encoding")}Reader$1.prototype.bool=function s(){return this.uint32()!==0};function readFixed32_end(s,i){return(s[i-4]|s[i-3]<<8|s[i-2]<<16|s[i-1]<<24)>>>0}Reader$1.prototype.fixed32=function s(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)};Reader$1.prototype.sfixed32=function s(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)|0};function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader$1.prototype.float=function s(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var i=util$5.float.readFloatLE(this.buf,this.pos);return this.pos+=4,i};Reader$1.prototype.double=function s(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var i=util$5.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,i};Reader$1.prototype.bytes=function s(){var i=this.uint32(),r=this.pos,a=this.pos+i;if(a>this.len)throw indexOutOfRange(this,i);if(this.pos+=i,Array.isArray(this.buf))return this.buf.slice(r,a);if(r===a){var d=util$5.Buffer;return d?d.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,a)};Reader$1.prototype.string=function s(){var i=this.bytes();return utf8.read(i,0,i.length)};Reader$1.prototype.skip=function s(i){if(typeof i=="number"){if(this.pos+i>this.len)throw indexOutOfRange(this,i);this.pos+=i}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(this.buf[this.pos++]&128);return this};Reader$1.prototype.skipType=function(s){switch(s){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(s=this.uint32()&7)!==4;)this.skipType(s);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+s+" at offset "+this.pos)}return this};Reader$1._configure=function(s){BufferReader$1=s,Reader$1.create=create(),BufferReader$1._configure();var i=util$5.Long?"toLong":"toNumber";util$5.merge(Reader$1.prototype,{int64:function(){return readLongVarint.call(this)[i](!1)},uint64:function(){return readLongVarint.call(this)[i](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[i](!1)},fixed64:function(){return readFixed64.call(this)[i](!0)},sfixed64:function(){return readFixed64.call(this)[i](!1)}})};var reader_buffer=BufferReader,Reader=reader;(BufferReader.prototype=Object.create(Reader.prototype)).constructor=BufferReader;var util$4=requireMinimal();function BufferReader(s){Reader.call(this,s)}BufferReader._configure=function(){util$4.Buffer&&(BufferReader.prototype._slice=util$4.Buffer.prototype.slice)};BufferReader.prototype.string=function s(){var i=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+i,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+i,this.len))};BufferReader._configure();var rpc={},service$1=Service$1,util$3=requireMinimal();(Service$1.prototype=Object.create(util$3.EventEmitter.prototype)).constructor=Service$1;function Service$1(s,i,r){if(typeof s!="function")throw TypeError("rpcImpl must be a function");util$3.EventEmitter.call(this),this.rpcImpl=s,this.requestDelimited=!!i,this.responseDelimited=!!r}Service$1.prototype.rpcCall=function s(i,r,a,d,u){if(!d)throw TypeError("request must be specified");var l=this;if(!u)return util$3.asPromise(s,l,i,r,a,d);if(!l.rpcImpl){setTimeout(function(){u(Error("already ended"))},0);return}try{return l.rpcImpl(i,r[l.requestDelimited?"encodeDelimited":"encode"](d).finish(),function(h,o){if(h)return l.emit("error",h,i),u(h);if(o===null){l.end(!0);return}if(!(o instanceof a))try{o=a[l.responseDelimited?"decodeDelimited":"decode"](o)}catch(m){return l.emit("error",m,i),u(m)}return l.emit("data",o,i),u(null,o)})}catch(c){l.emit("error",c,i),setTimeout(function(){u(c)},0);return}};Service$1.prototype.end=function s(i){return this.rpcImpl&&(i||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};(function(s){var i=s;i.Service=service$1})(rpc);var roots={};(function(s){var i=s;i.build="minimal",i.Writer=writer,i.BufferWriter=writer_buffer,i.Reader=reader,i.BufferReader=reader_buffer,i.util=requireMinimal(),i.rpc=rpc,i.roots=roots,i.configure=r;function r(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}r()})(indexMinimal);var util$2={exports:{}},codegen_1=codegen;function codegen(s,i){typeof s=="string"&&(i=s,s=void 0);var r=[];function a(u){if(typeof u!="string"){var l=d();if(codegen.verbose&&console.warn("codegen: "+l),l="return "+l,u){for(var c=Object.keys(u),h=new Array(c.length+1),o=new Array(c.length),m=0;m<c.length;)h[m]=c[m],o[m]=u[c[m++]];return h[m]=l,Function.apply(null,h).apply(null,o)}return Function(l)()}for(var y=new Array(arguments.length-1),g=0;g<y.length;)y[g]=arguments[++g];if(g=0,u=u.replace(/%([%dfijs])/g,function(v,b){var w=y[g++];switch(b){case"d":case"f":return String(Number(w));case"i":return String(Math.floor(w));case"j":return JSON.stringify(w);case"s":return String(w)}return"%"}),g!==y.length)throw Error("parameter count mismatch");return r.push(u),a}function d(u){return"function "+(u||i||"")+"("+(s&&s.join(",")||"")+`){
2
2
  `+r.join(`
3
3
  `)+`
4
- }`}return o.toString=d,o}codegen.verbose=!1;var fetch_1=fetch,asPromise=requireAspromise(),inquire=requireInquire(),fs=inquire("fs");function fetch(s,i,r){return typeof i=="function"?(r=i,i={}):i||(i={}),r?!i.xhr&&fs&&fs.readFile?fs.readFile(s,function(d,u){return d&&typeof XMLHttpRequest<"u"?fetch.xhr(s,i,r):d?r(d):r(null,i.binary?u:u.toString("utf8"))}):fetch.xhr(s,i,r):asPromise(fetch,this,s,i)}fetch.xhr=function s(i,r,o){var d=new XMLHttpRequest;d.onreadystatechange=function(){if(d.readyState===4){if(d.status!==0&&d.status!==200)return o(Error("status "+d.status));if(r.binary){var l=d.response;if(!l){l=[];for(var c=0;c<d.responseText.length;++c)l.push(d.responseText.charCodeAt(c)&255)}return o(null,typeof Uint8Array<"u"?new Uint8Array(l):l)}return o(null,d.responseText)}},r.binary&&("overrideMimeType"in d&&d.overrideMimeType("text/plain; charset=x-user-defined"),d.responseType="arraybuffer"),d.open("GET",i),d.send()};var path={};(function(s){var i=s,r=i.isAbsolute=function(u){return/^(?:\/|\w+:)/.test(u)},o=i.normalize=function(u){u=u.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var l=u.split("/"),c=r(u),h="";c&&(h=l.shift()+"/");for(var a=0;a<l.length;)l[a]===".."?a>0&&l[a-1]!==".."?l.splice(--a,2):c?l.splice(a,1):++a:l[a]==="."?l.splice(a,1):++a;return h+l.join("/")};i.resolve=function(u,l,c){return c||(l=o(l)),r(l)?l:(c||(u=o(u)),(u=u.replace(/(?:\/|^)[^/]+$/,"")).length?o(u+"/"+l):l)}})(path);var types$1={},hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(s){var i=s,r=requireUtil(),o=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function d(u,l){var c=0,h={};for(l|=0;c<u.length;)h[o[c+l]]=u[c++];return h}i.basic=d([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),i.defaults=d([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",r.emptyArray,null]),i.long=d([0,0,0,1,1],7),i.mapKey=d([0,0,0,5,5,0,0,0,1,1,0,2],2),i.packed=d([1,5,0,0,0,5,5,0,0,0,1,1,0])}(types$1)),types$1}var field,hasRequiredField;function requireField(){if(hasRequiredField)return field;hasRequiredField=1,field=l;var s=requireObject();((l.prototype=Object.create(s.prototype)).constructor=l).className="Field";var i=require_enum(),r=requireTypes(),o=requireUtil(),d,u=/^required|optional|repeated$/;l.fromJSON=function(h,a){return new l(h,a.id,a.type,a.rule,a.extend,a.options,a.comment)};function l(c,h,a,m,y,g,p){if(o.isObject(m)?(p=y,g=m,m=y=void 0):o.isObject(y)&&(p=g,g=y,y=void 0),s.call(this,c,g),!o.isInteger(h)||h<0)throw TypeError("id must be a non-negative integer");if(!o.isString(a))throw TypeError("type must be a string");if(m!==void 0&&!u.test(m=m.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(y!==void 0&&!o.isString(y))throw TypeError("extend must be a string");m==="proto3_optional"&&(m="optional"),this.rule=m&&m!=="optional"?m:void 0,this.type=a,this.id=h,this.extend=y||void 0,this.required=m==="required",this.optional=!this.required,this.repeated=m==="repeated",this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=o.Long?r.long[a]!==void 0:!1,this.bytes=a==="bytes",this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=p}return Object.defineProperty(l.prototype,"packed",{get:function(){return this._packed===null&&(this._packed=this.getOption("packed")!==!1),this._packed}}),l.prototype.setOption=function(h,a,m){return h==="packed"&&(this._packed=null),s.prototype.setOption.call(this,h,a,m)},l.prototype.toJSON=function(h){var a=h?!!h.keepComments:!1;return o.toObject(["rule",this.rule!=="optional"&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",a?this.comment:void 0])},l.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=r.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof d?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof i&&typeof this.typeDefault=="string"&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&((this.options.packed===!0||this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof i))&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=o.Long.fromNumber(this.typeDefault,this.type.charAt(0)==="u"),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault=="string"){var h;o.base64.test(this.typeDefault)?o.base64.decode(this.typeDefault,h=o.newBuffer(o.base64.length(this.typeDefault)),0):o.utf8.write(this.typeDefault,h=o.newBuffer(o.utf8.length(this.typeDefault)),0),this.typeDefault=h}return this.map?this.defaultValue=o.emptyObject:this.repeated?this.defaultValue=o.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof d&&(this.parent.ctor.prototype[this.name]=this.defaultValue),s.prototype.resolve.call(this)},l.d=function(h,a,m,y){return typeof a=="function"?a=o.decorateType(a).name:a&&typeof a=="object"&&(a=o.decorateEnum(a).name),function(p,v){o.decorateType(p.constructor).add(new l(v,h,a,m,{default:y}))}},l._configure=function(h){d=h},field}var oneof,hasRequiredOneof;function requireOneof(){if(hasRequiredOneof)return oneof;hasRequiredOneof=1,oneof=o;var s=requireObject();((o.prototype=Object.create(s.prototype)).constructor=o).className="OneOf";var i=requireField(),r=requireUtil();function o(u,l,c,h){if(Array.isArray(l)||(c=l,l=void 0),s.call(this,u,c),!(l===void 0||Array.isArray(l)))throw TypeError("fieldNames must be an Array");this.oneof=l||[],this.fieldsArray=[],this.comment=h}o.fromJSON=function(l,c){return new o(l,c.oneof,c.options,c.comment)},o.prototype.toJSON=function(l){var c=l?!!l.keepComments:!1;return r.toObject(["options",this.options,"oneof",this.oneof,"comment",c?this.comment:void 0])};function d(u){if(u.parent)for(var l=0;l<u.fieldsArray.length;++l)u.fieldsArray[l].parent||u.parent.add(u.fieldsArray[l])}return o.prototype.add=function(l){if(!(l instanceof i))throw TypeError("field must be a Field");return l.parent&&l.parent!==this.parent&&l.parent.remove(l),this.oneof.push(l.name),this.fieldsArray.push(l),l.partOf=this,d(this),this},o.prototype.remove=function(l){if(!(l instanceof i))throw TypeError("field must be a Field");var c=this.fieldsArray.indexOf(l);if(c<0)throw Error(l+" is not a member of "+this);return this.fieldsArray.splice(c,1),c=this.oneof.indexOf(l.name),c>-1&&this.oneof.splice(c,1),l.partOf=null,this},o.prototype.onAdd=function(l){s.prototype.onAdd.call(this,l);for(var c=this,h=0;h<this.oneof.length;++h){var a=l.get(this.oneof[h]);a&&!a.partOf&&(a.partOf=c,c.fieldsArray.push(a))}d(this)},o.prototype.onRemove=function(l){for(var c=0,h;c<this.fieldsArray.length;++c)(h=this.fieldsArray[c]).parent&&h.parent.remove(h);s.prototype.onRemove.call(this,l)},o.d=function(){for(var l=new Array(arguments.length),c=0;c<arguments.length;)l[c]=arguments[c++];return function(a,m){r.decorateType(a.constructor).add(new o(m,l)),Object.defineProperty(a,m,{get:r.oneOfGetter(l),set:r.oneOfSetter(l)})}},oneof}var namespace,hasRequiredNamespace;function requireNamespace(){if(hasRequiredNamespace)return namespace;hasRequiredNamespace=1,namespace=h;var s=requireObject();((h.prototype=Object.create(s.prototype)).constructor=h).className="Namespace";var i=requireField(),r=requireUtil(),o=requireOneof(),d,u,l;h.fromJSON=function(y,g){return new h(y,g.options).addJSON(g.nested)};function c(m,y){if(m&&m.length){for(var g={},p=0;p<m.length;++p)g[m[p].name]=m[p].toJSON(y);return g}}h.arrayToJSON=c,h.isReservedId=function(y,g){if(y){for(var p=0;p<y.length;++p)if(typeof y[p]!="string"&&y[p][0]<=g&&y[p][1]>g)return!0}return!1},h.isReservedName=function(y,g){if(y){for(var p=0;p<y.length;++p)if(y[p]===g)return!0}return!1};function h(m,y){s.call(this,m,y),this.nested=void 0,this._nestedArray=null}function a(m){return m._nestedArray=null,m}return Object.defineProperty(h.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=r.toArray(this.nested))}}),h.prototype.toJSON=function(y){return r.toObject(["options",this.options,"nested",c(this.nestedArray,y)])},h.prototype.addJSON=function(y){var g=this;if(y)for(var p=Object.keys(y),v=0,b;v<p.length;++v)b=y[p[v]],g.add((b.fields!==void 0?d.fromJSON:b.values!==void 0?l.fromJSON:b.methods!==void 0?u.fromJSON:b.id!==void 0?i.fromJSON:h.fromJSON)(p[v],b));return this},h.prototype.get=function(y){return this.nested&&this.nested[y]||null},h.prototype.getEnum=function(y){if(this.nested&&this.nested[y]instanceof l)return this.nested[y].values;throw Error("no such enum: "+y)},h.prototype.add=function(y){if(!(y instanceof i&&y.extend!==void 0||y instanceof d||y instanceof o||y instanceof l||y instanceof u||y instanceof h))throw TypeError("object must be a valid nested object");if(!this.nested)this.nested={};else{var g=this.get(y.name);if(g)if(g instanceof h&&y instanceof h&&!(g instanceof d||g instanceof u)){for(var p=g.nestedArray,v=0;v<p.length;++v)y.add(p[v]);this.remove(g),this.nested||(this.nested={}),y.setOptions(g.options,!0)}else throw Error("duplicate name '"+y.name+"' in "+this)}return this.nested[y.name]=y,y.onAdd(this),a(this)},h.prototype.remove=function(y){if(!(y instanceof s))throw TypeError("object must be a ReflectionObject");if(y.parent!==this)throw Error(y+" is not a member of "+this);return delete this.nested[y.name],Object.keys(this.nested).length||(this.nested=void 0),y.onRemove(this),a(this)},h.prototype.define=function(y,g){if(r.isString(y))y=y.split(".");else if(!Array.isArray(y))throw TypeError("illegal path");if(y&&y.length&&y[0]==="")throw Error("path must be relative");for(var p=this;y.length>0;){var v=y.shift();if(p.nested&&p.nested[v]){if(p=p.nested[v],!(p instanceof h))throw Error("path conflicts with non-namespace objects")}else p.add(p=new h(v))}return g&&p.addJSON(g),p},h.prototype.resolveAll=function(){for(var y=this.nestedArray,g=0;g<y.length;)y[g]instanceof h?y[g++].resolveAll():y[g++].resolve();return this.resolve()},h.prototype.lookup=function(y,g,p){if(typeof g=="boolean"?(p=g,g=void 0):g&&!Array.isArray(g)&&(g=[g]),r.isString(y)&&y.length){if(y===".")return this.root;y=y.split(".")}else if(!y.length)return this;if(y[0]==="")return this.root.lookup(y.slice(1),g);var v=this.get(y[0]);if(v){if(y.length===1){if(!g||g.indexOf(v.constructor)>-1)return v}else if(v instanceof h&&(v=v.lookup(y.slice(1),g,!0)))return v}else for(var b=0;b<this.nestedArray.length;++b)if(this._nestedArray[b]instanceof h&&(v=this._nestedArray[b].lookup(y,g,!0)))return v;return this.parent===null||p?null:this.parent.lookup(y,g)},h.prototype.lookupType=function(y){var g=this.lookup(y,[d]);if(!g)throw Error("no such type: "+y);return g},h.prototype.lookupEnum=function(y){var g=this.lookup(y,[l]);if(!g)throw Error("no such Enum '"+y+"' in "+this);return g},h.prototype.lookupTypeOrEnum=function(y){var g=this.lookup(y,[d,l]);if(!g)throw Error("no such Type or Enum '"+y+"' in "+this);return g},h.prototype.lookupService=function(y){var g=this.lookup(y,[u]);if(!g)throw Error("no such Service '"+y+"' in "+this);return g},h._configure=function(m,y,g){d=m,u=y,l=g},namespace}var mapfield,hasRequiredMapfield;function requireMapfield(){if(hasRequiredMapfield)return mapfield;hasRequiredMapfield=1,mapfield=o;var s=requireField();((o.prototype=Object.create(s.prototype)).constructor=o).className="MapField";var i=requireTypes(),r=requireUtil();function o(d,u,l,c,h,a){if(s.call(this,d,u,c,void 0,void 0,h,a),!r.isString(l))throw TypeError("keyType must be a string");this.keyType=l,this.resolvedKeyType=null,this.map=!0}return o.fromJSON=function(u,l){return new o(u,l.id,l.keyType,l.type,l.options,l.comment)},o.prototype.toJSON=function(u){var l=u?!!u.keepComments:!1;return r.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",l?this.comment:void 0])},o.prototype.resolve=function(){if(this.resolved)return this;if(i.mapKey[this.keyType]===void 0)throw Error("invalid key type: "+this.keyType);return s.prototype.resolve.call(this)},o.d=function(u,l,c){return typeof c=="function"?c=r.decorateType(c).name:c&&typeof c=="object"&&(c=r.decorateEnum(c).name),function(a,m){r.decorateType(a.constructor).add(new o(m,u,l,c))}},mapfield}var method,hasRequiredMethod;function requireMethod(){if(hasRequiredMethod)return method;hasRequiredMethod=1,method=r;var s=requireObject();((r.prototype=Object.create(s.prototype)).constructor=r).className="Method";var i=requireUtil();function r(o,d,u,l,c,h,a,m,y){if(i.isObject(c)?(a=c,c=h=void 0):i.isObject(h)&&(a=h,h=void 0),!(d===void 0||i.isString(d)))throw TypeError("type must be a string");if(!i.isString(u))throw TypeError("requestType must be a string");if(!i.isString(l))throw TypeError("responseType must be a string");s.call(this,o,a),this.type=d||"rpc",this.requestType=u,this.requestStream=c?!0:void 0,this.responseType=l,this.responseStream=h?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=m,this.parsedOptions=y}return r.fromJSON=function(d,u){return new r(d,u.type,u.requestType,u.responseType,u.requestStream,u.responseStream,u.options,u.comment,u.parsedOptions)},r.prototype.toJSON=function(d){var u=d?!!d.keepComments:!1;return i.toObject(["type",this.type!=="rpc"&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",u?this.comment:void 0,"parsedOptions",this.parsedOptions])},r.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),s.prototype.resolve.call(this))},method}var service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=d;var s=requireNamespace();((d.prototype=Object.create(s.prototype)).constructor=d).className="Service";var i=requireMethod(),r=requireUtil(),o=rpc;function d(l,c){s.call(this,l,c),this.methods={},this._methodsArray=null}d.fromJSON=function(c,h){var a=new d(c,h.options);if(h.methods)for(var m=Object.keys(h.methods),y=0;y<m.length;++y)a.add(i.fromJSON(m[y],h.methods[m[y]]));return h.nested&&a.addJSON(h.nested),a.comment=h.comment,a},d.prototype.toJSON=function(c){var h=s.prototype.toJSON.call(this,c),a=c?!!c.keepComments:!1;return r.toObject(["options",h&&h.options||void 0,"methods",s.arrayToJSON(this.methodsArray,c)||{},"nested",h&&h.nested||void 0,"comment",a?this.comment:void 0])},Object.defineProperty(d.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=r.toArray(this.methods))}});function u(l){return l._methodsArray=null,l}return d.prototype.get=function(c){return this.methods[c]||s.prototype.get.call(this,c)},d.prototype.resolveAll=function(){for(var c=this.methodsArray,h=0;h<c.length;++h)c[h].resolve();return s.prototype.resolve.call(this)},d.prototype.add=function(c){if(this.get(c.name))throw Error("duplicate name '"+c.name+"' in "+this);return c instanceof i?(this.methods[c.name]=c,c.parent=this,u(this)):s.prototype.add.call(this,c)},d.prototype.remove=function(c){if(c instanceof i){if(this.methods[c.name]!==c)throw Error(c+" is not a member of "+this);return delete this.methods[c.name],c.parent=null,u(this)}return s.prototype.remove.call(this,c)},d.prototype.create=function(c,h,a){for(var m=new o.Service(c,h,a),y=0,g;y<this.methodsArray.length;++y){var p=r.lcFirst((g=this._methodsArray[y]).resolve().name).replace(/[^$\w_]/g,"");m[p]=r.codegen(["r","c"],r.isReserved(p)?p+"_":p)("return this.rpcCall(m,q,s,r,c)")({m:g,q:g.resolvedRequestType.ctor,s:g.resolvedResponseType.ctor})}return m},service}var message=Message,util$1=requireMinimal();function Message(s){if(s)for(var i=Object.keys(s),r=0;r<i.length;++r)this[i[r]]=s[i[r]]}Message.create=function s(i){return this.$type.create(i)};Message.encode=function s(i,r){return this.$type.encode(i,r)};Message.encodeDelimited=function s(i,r){return this.$type.encodeDelimited(i,r)};Message.decode=function s(i){return this.$type.decode(i)};Message.decodeDelimited=function s(i){return this.$type.decodeDelimited(i)};Message.verify=function s(i){return this.$type.verify(i)};Message.fromObject=function s(i){return this.$type.fromObject(i)};Message.toObject=function s(i,r){return this.$type.toObject(i,r)};Message.prototype.toJSON=function s(){return this.$type.toObject(this,util$1.toJSONOptions)};var decoder_1,hasRequiredDecoder;function requireDecoder(){if(hasRequiredDecoder)return decoder_1;hasRequiredDecoder=1,decoder_1=d;var s=require_enum(),i=requireTypes(),r=requireUtil();function o(u){return"missing required '"+u.name+"'"}function d(u){var l=r.codegen(["r","l"],u.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(u.fieldsArray.filter(function(g){return g.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");u.group&&l("if((t&7)===4)")("break"),l("switch(t>>>3){");for(var c=0;c<u.fieldsArray.length;++c){var h=u._fieldsArray[c].resolve(),a=h.resolvedType instanceof s?"int32":h.type,m="m"+r.safeProp(h.name);l("case %i: {",h.id),h.map?(l("if(%s===util.emptyObject)",m)("%s={}",m)("var c2 = r.uint32()+r.pos"),i.defaults[h.keyType]!==void 0?l("k=%j",i.defaults[h.keyType]):l("k=null"),i.defaults[a]!==void 0?l("value=%j",i.defaults[a]):l("value=null"),l("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",h.keyType)("case 2:"),i.basic[a]===void 0?l("value=types[%i].decode(r,r.uint32())",c):l("value=r.%s()",a),l("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),i.long[h.keyType]!==void 0?l('%s[typeof k==="object"?util.longToHash(k):k]=value',m):l("%s[k]=value",m)):h.repeated?(l("if(!(%s&&%s.length))",m,m)("%s=[]",m),i.packed[a]!==void 0&&l("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",m,a)("}else"),i.basic[a]===void 0?l(h.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",m,c):l("%s.push(r.%s())",m,a)):i.basic[a]===void 0?l(h.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",m,c):l("%s=r.%s()",m,a),l("break")("}")}for(l("default:")("r.skipType(t&7)")("break")("}")("}"),c=0;c<u._fieldsArray.length;++c){var y=u._fieldsArray[c];y.required&&l("if(!m.hasOwnProperty(%j))",y.name)("throw util.ProtocolError(%j,{instance:m})",o(y))}return l("return m")}return decoder_1}var verifier_1,hasRequiredVerifier;function requireVerifier(){if(hasRequiredVerifier)return verifier_1;hasRequiredVerifier=1,verifier_1=u;var s=require_enum(),i=requireUtil();function r(l,c){return l.name+": "+c+(l.repeated&&c!=="array"?"[]":l.map&&c!=="object"?"{k:"+l.keyType+"}":"")+" expected"}function o(l,c,h,a){if(c.resolvedType)if(c.resolvedType instanceof s){l("switch(%s){",a)("default:")("return%j",r(c,"enum value"));for(var m=Object.keys(c.resolvedType.values),y=0;y<m.length;++y)l("case %i:",c.resolvedType.values[m[y]]);l("break")("}")}else l("{")("var e=types[%i].verify(%s);",h,a)("if(e)")("return%j+e",c.name+".")("}");else switch(c.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":l("if(!util.isInteger(%s))",a)("return%j",r(c,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":l("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",a,a,a,a)("return%j",r(c,"integer|Long"));break;case"float":case"double":l('if(typeof %s!=="number")',a)("return%j",r(c,"number"));break;case"bool":l('if(typeof %s!=="boolean")',a)("return%j",r(c,"boolean"));break;case"string":l("if(!util.isString(%s))",a)("return%j",r(c,"string"));break;case"bytes":l('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',a,a,a)("return%j",r(c,"buffer"));break}return l}function d(l,c,h){switch(c.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":l("if(!util.key32Re.test(%s))",h)("return%j",r(c,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":l("if(!util.key64Re.test(%s))",h)("return%j",r(c,"integer|Long key"));break;case"bool":l("if(!util.key2Re.test(%s))",h)("return%j",r(c,"boolean key"));break}return l}function u(l){var c=i.codegen(["m"],l.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),h=l.oneofsArray,a={};h.length&&c("var p={}");for(var m=0;m<l.fieldsArray.length;++m){var y=l._fieldsArray[m].resolve(),g="m"+i.safeProp(y.name);if(y.optional&&c("if(%s!=null&&m.hasOwnProperty(%j)){",g,y.name),y.map)c("if(!util.isObject(%s))",g)("return%j",r(y,"object"))("var k=Object.keys(%s)",g)("for(var i=0;i<k.length;++i){"),d(c,y,"k[i]"),o(c,y,m,g+"[k[i]]")("}");else if(y.repeated)c("if(!Array.isArray(%s))",g)("return%j",r(y,"array"))("for(var i=0;i<%s.length;++i){",g),o(c,y,m,g+"[i]")("}");else{if(y.partOf){var p=i.safeProp(y.partOf.name);a[y.partOf.name]===1&&c("if(p%s===1)",p)("return%j",y.partOf.name+": multiple values"),a[y.partOf.name]=1,c("p%s=1",p)}o(c,y,m,g)}y.optional&&c("}")}return c("return null")}return verifier_1}var converter={},hasRequiredConverter;function requireConverter(){return hasRequiredConverter||(hasRequiredConverter=1,function(s){var i=s,r=require_enum(),o=requireUtil();function d(l,c,h,a){var m=!1;if(c.resolvedType)if(c.resolvedType instanceof r){l("switch(d%s){",a);for(var y=c.resolvedType.values,g=Object.keys(y),p=0;p<g.length;++p)y[g[p]]===c.typeDefault&&!m&&(l("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',a,a,a),c.repeated||l("break"),m=!0),l("case%j:",g[p])("case %i:",y[g[p]])("m%s=%j",a,y[g[p]])("break");l("}")}else l('if(typeof d%s!=="object")',a)("throw TypeError(%j)",c.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",a,h,a);else{var v=!1;switch(c.type){case"double":case"float":l("m%s=Number(d%s)",a,a);break;case"uint32":case"fixed32":l("m%s=d%s>>>0",a,a);break;case"int32":case"sint32":case"sfixed32":l("m%s=d%s|0",a,a);break;case"uint64":v=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":l("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",a,a,v)('else if(typeof d%s==="string")',a)("m%s=parseInt(d%s,10)",a,a)('else if(typeof d%s==="number")',a)("m%s=d%s",a,a)('else if(typeof d%s==="object")',a)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",a,a,a,v?"true":"");break;case"bytes":l('if(typeof d%s==="string")',a)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",a,a,a)("else if(d%s.length >= 0)",a)("m%s=d%s",a,a);break;case"string":l("m%s=String(d%s)",a,a);break;case"bool":l("m%s=Boolean(d%s)",a,a);break}}return l}i.fromObject=function(c){var h=c.fieldsArray,a=o.codegen(["d"],c.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!h.length)return a("return new this.ctor");a("var m=new this.ctor");for(var m=0;m<h.length;++m){var y=h[m].resolve(),g=o.safeProp(y.name);y.map?(a("if(d%s){",g)('if(typeof d%s!=="object")',g)("throw TypeError(%j)",y.fullName+": object expected")("m%s={}",g)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",g),d(a,y,m,g+"[ks[i]]")("}")("}")):y.repeated?(a("if(d%s){",g)("if(!Array.isArray(d%s))",g)("throw TypeError(%j)",y.fullName+": array expected")("m%s=[]",g)("for(var i=0;i<d%s.length;++i){",g),d(a,y,m,g+"[i]")("}")("}")):(y.resolvedType instanceof r||a("if(d%s!=null){",g),d(a,y,m,g),y.resolvedType instanceof r||a("}"))}return a("return m")};function u(l,c,h,a){if(c.resolvedType)c.resolvedType instanceof r?l("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",a,h,a,a,h,a,a):l("d%s=types[%i].toObject(m%s,o)",a,h,a);else{var m=!1;switch(c.type){case"double":case"float":l("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",a,a,a,a);break;case"uint64":m=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":l('if(typeof m%s==="number")',a)("d%s=o.longs===String?String(m%s):m%s",a,a,a)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",a,a,a,a,m?"true":"",a);break;case"bytes":l("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",a,a,a,a,a);break;default:l("d%s=m%s",a,a);break}}return l}i.toObject=function(c){var h=c.fieldsArray.slice().sort(o.compareFieldsById);if(!h.length)return o.codegen()("return {}");for(var a=o.codegen(["m","o"],c.name+"$toObject")("if(!o)")("o={}")("var d={}"),m=[],y=[],g=[],p=0;p<h.length;++p)h[p].partOf||(h[p].resolve().repeated?m:h[p].map?y:g).push(h[p]);if(m.length){for(a("if(o.arrays||o.defaults){"),p=0;p<m.length;++p)a("d%s=[]",o.safeProp(m[p].name));a("}")}if(y.length){for(a("if(o.objects||o.defaults){"),p=0;p<y.length;++p)a("d%s={}",o.safeProp(y[p].name));a("}")}if(g.length){for(a("if(o.defaults){"),p=0;p<g.length;++p){var v=g[p],b=o.safeProp(v.name);if(v.resolvedType instanceof r)a("d%s=o.enums===String?%j:%j",b,v.resolvedType.valuesById[v.typeDefault],v.typeDefault);else if(v.long)a("if(util.Long){")("var n=new util.Long(%i,%i,%j)",v.typeDefault.low,v.typeDefault.high,v.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",b)("}else")("d%s=o.longs===String?%j:%i",b,v.typeDefault.toString(),v.typeDefault.toNumber());else if(v.bytes){var w="["+Array.prototype.slice.call(v.typeDefault).join(",")+"]";a("if(o.bytes===String)d%s=%j",b,String.fromCharCode.apply(String,v.typeDefault))("else{")("d%s=%s",b,w)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",b,b)("}")}else a("d%s=%j",b,v.typeDefault)}a("}")}var x=!1;for(p=0;p<h.length;++p){var v=h[p],_=c._fieldsArray.indexOf(v),b=o.safeProp(v.name);v.map?(x||(x=!0,a("var ks2")),a("if(m%s&&(ks2=Object.keys(m%s)).length){",b,b)("d%s={}",b)("for(var j=0;j<ks2.length;++j){"),u(a,v,_,b+"[ks2[j]]")("}")):v.repeated?(a("if(m%s&&m%s.length){",b,b)("d%s=[]",b)("for(var j=0;j<m%s.length;++j){",b),u(a,v,_,b+"[j]")("}")):(a("if(m%s!=null&&m.hasOwnProperty(%j)){",b,v.name),u(a,v,_,b),v.partOf&&a("if(o.oneofs)")("d%s=%j",o.safeProp(v.partOf.name),v.name)),a("}")}return a("return d")}}(converter)),converter}var wrappers={};(function(s){var i=s,r=message;i[".google.protobuf.Any"]={fromObject:function(o){if(o&&o["@type"]){var d=o["@type"].substring(o["@type"].lastIndexOf("/")+1),u=this.lookup(d);if(u){var l=o["@type"].charAt(0)==="."?o["@type"].slice(1):o["@type"];return l.indexOf("/")===-1&&(l="/"+l),this.create({type_url:l,value:u.encode(u.fromObject(o)).finish()})}}return this.fromObject(o)},toObject:function(o,d){var u="type.googleapis.com/",l="",c="";if(d&&d.json&&o.type_url&&o.value){c=o.type_url.substring(o.type_url.lastIndexOf("/")+1),l=o.type_url.substring(0,o.type_url.lastIndexOf("/")+1);var h=this.lookup(c);h&&(o=h.decode(o.value))}if(!(o instanceof this.ctor)&&o instanceof r){var a=o.$type.toObject(o,d),m=o.$type.fullName[0]==="."?o.$type.fullName.slice(1):o.$type.fullName;return l===""&&(l=u),c=l+m,a["@type"]=c,a}return this.toObject(o,d)}}})(wrappers);var type,hasRequiredType;function requireType(){if(hasRequiredType)return type;hasRequiredType=1,type=b;var s=requireNamespace();((b.prototype=Object.create(s.prototype)).constructor=b).className="Type";var i=require_enum(),r=requireOneof(),o=requireField(),d=requireMapfield(),u=requireService(),l=message,c=reader,h=writer,a=requireUtil(),m=requireEncoder(),y=requireDecoder(),g=requireVerifier(),p=requireConverter(),v=wrappers;function b(x,_){s.call(this,x,_),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(b.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var x=Object.keys(this.fields),_=0;_<x.length;++_){var T=this.fields[x[_]],O=T.id;if(this._fieldsById[O])throw Error("duplicate id "+O+" in "+this);this._fieldsById[O]=T}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=a.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=a.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=b.generateConstructor(this)())},set:function(x){var _=x.prototype;_ instanceof l||((x.prototype=new l).constructor=x,a.merge(x.prototype,_)),x.$type=x.prototype.$type=this,a.merge(x,l,!0),this._ctor=x;for(var T=0;T<this.fieldsArray.length;++T)this._fieldsArray[T].resolve();var O={};for(T=0;T<this.oneofsArray.length;++T)O[this._oneofsArray[T].resolve().name]={get:a.oneOfGetter(this._oneofsArray[T].oneof),set:a.oneOfSetter(this._oneofsArray[T].oneof)};T&&Object.defineProperties(x.prototype,O)}}}),b.generateConstructor=function(_){for(var T=a.codegen(["p"],_.name),O=0,E;O<_.fieldsArray.length;++O)(E=_._fieldsArray[O]).map?T("this%s={}",a.safeProp(E.name)):E.repeated&&T("this%s=[]",a.safeProp(E.name));return T("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")};function w(x){return x._fieldsById=x._fieldsArray=x._oneofsArray=null,delete x.encode,delete x.decode,delete x.verify,x}return b.fromJSON=function(_,T){var O=new b(_,T.options);O.extensions=T.extensions,O.reserved=T.reserved;for(var E=Object.keys(T.fields),C=0;C<E.length;++C)O.add((typeof T.fields[E[C]].keyType<"u"?d.fromJSON:o.fromJSON)(E[C],T.fields[E[C]]));if(T.oneofs)for(E=Object.keys(T.oneofs),C=0;C<E.length;++C)O.add(r.fromJSON(E[C],T.oneofs[E[C]]));if(T.nested)for(E=Object.keys(T.nested),C=0;C<E.length;++C){var R=T.nested[E[C]];O.add((R.id!==void 0?o.fromJSON:R.fields!==void 0?b.fromJSON:R.values!==void 0?i.fromJSON:R.methods!==void 0?u.fromJSON:s.fromJSON)(E[C],R))}return T.extensions&&T.extensions.length&&(O.extensions=T.extensions),T.reserved&&T.reserved.length&&(O.reserved=T.reserved),T.group&&(O.group=!0),T.comment&&(O.comment=T.comment),O},b.prototype.toJSON=function(_){var T=s.prototype.toJSON.call(this,_),O=_?!!_.keepComments:!1;return a.toObject(["options",T&&T.options||void 0,"oneofs",s.arrayToJSON(this.oneofsArray,_),"fields",s.arrayToJSON(this.fieldsArray.filter(function(E){return!E.declaringField}),_)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",T&&T.nested||void 0,"comment",O?this.comment:void 0])},b.prototype.resolveAll=function(){for(var _=this.fieldsArray,T=0;T<_.length;)_[T++].resolve();var O=this.oneofsArray;for(T=0;T<O.length;)O[T++].resolve();return s.prototype.resolveAll.call(this)},b.prototype.get=function(_){return this.fields[_]||this.oneofs&&this.oneofs[_]||this.nested&&this.nested[_]||null},b.prototype.add=function(_){if(this.get(_.name))throw Error("duplicate name '"+_.name+"' in "+this);if(_ instanceof o&&_.extend===void 0){if(this._fieldsById?this._fieldsById[_.id]:this.fieldsById[_.id])throw Error("duplicate id "+_.id+" in "+this);if(this.isReservedId(_.id))throw Error("id "+_.id+" is reserved in "+this);if(this.isReservedName(_.name))throw Error("name '"+_.name+"' is reserved in "+this);return _.parent&&_.parent.remove(_),this.fields[_.name]=_,_.message=this,_.onAdd(this),w(this)}return _ instanceof r?(this.oneofs||(this.oneofs={}),this.oneofs[_.name]=_,_.onAdd(this),w(this)):s.prototype.add.call(this,_)},b.prototype.remove=function(_){if(_ instanceof o&&_.extend===void 0){if(!this.fields||this.fields[_.name]!==_)throw Error(_+" is not a member of "+this);return delete this.fields[_.name],_.parent=null,_.onRemove(this),w(this)}if(_ instanceof r){if(!this.oneofs||this.oneofs[_.name]!==_)throw Error(_+" is not a member of "+this);return delete this.oneofs[_.name],_.parent=null,_.onRemove(this),w(this)}return s.prototype.remove.call(this,_)},b.prototype.isReservedId=function(_){return s.isReservedId(this.reserved,_)},b.prototype.isReservedName=function(_){return s.isReservedName(this.reserved,_)},b.prototype.create=function(_){return new this.ctor(_)},b.prototype.setup=function(){for(var _=this.fullName,T=[],O=0;O<this.fieldsArray.length;++O)T.push(this._fieldsArray[O].resolve().resolvedType);this.encode=m(this)({Writer:h,types:T,util:a}),this.decode=y(this)({Reader:c,types:T,util:a}),this.verify=g(this)({types:T,util:a}),this.fromObject=p.fromObject(this)({types:T,util:a}),this.toObject=p.toObject(this)({types:T,util:a});var E=v[_];if(E){var C=Object.create(this);C.fromObject=this.fromObject,this.fromObject=E.fromObject.bind(C),C.toObject=this.toObject,this.toObject=E.toObject.bind(C)}return this},b.prototype.encode=function(_,T){return this.setup().encode(_,T)},b.prototype.encodeDelimited=function(_,T){return this.encode(_,T&&T.len?T.fork():T).ldelim()},b.prototype.decode=function(_,T){return this.setup().decode(_,T)},b.prototype.decodeDelimited=function(_){return _ instanceof c||(_=c.create(_)),this.decode(_,_.uint32())},b.prototype.verify=function(_){return this.setup().verify(_)},b.prototype.fromObject=function(_){return this.setup().fromObject(_)},b.prototype.toObject=function(_,T){return this.setup().toObject(_,T)},b.d=function(_){return function(O){a.decorateType(O,_)}},type}var root$1,hasRequiredRoot;function requireRoot(){if(hasRequiredRoot)return root$1;hasRequiredRoot=1,root$1=h;var s=requireNamespace();((h.prototype=Object.create(s.prototype)).constructor=h).className="Root";var i=requireField(),r=require_enum(),o=requireOneof(),d=requireUtil(),u,l,c;function h(g){s.call(this,"",g),this.deferred=[],this.files=[]}h.fromJSON=function(p,v){return v||(v=new h),p.options&&v.setOptions(p.options),v.addJSON(p.nested)},h.prototype.resolvePath=d.path.resolve,h.prototype.fetch=d.fetch;function a(){}h.prototype.load=function g(p,v,b){typeof v=="function"&&(b=v,v=void 0);var w=this;if(!b)return d.asPromise(g,w,p,v);var x=b===a;function _(k,A){if(b){if(x)throw k;var I=b;b=null,I(k,A)}}function T(k){var A=k.lastIndexOf("google/protobuf/");if(A>-1){var I=k.substring(A);if(I in c)return I}return null}function O(k,A){try{if(d.isString(A)&&A.charAt(0)==="{"&&(A=JSON.parse(A)),!d.isString(A))w.setOptions(A.options).addJSON(A.nested);else{l.filename=k;var I=l(A,w,v),$,F=0;if(I.imports)for(;F<I.imports.length;++F)($=T(I.imports[F])||w.resolvePath(k,I.imports[F]))&&E($);if(I.weakImports)for(F=0;F<I.weakImports.length;++F)($=T(I.weakImports[F])||w.resolvePath(k,I.weakImports[F]))&&E($,!0)}}catch(q){_(q)}!x&&!C&&_(null,w)}function E(k,A){if(k=T(k)||k,!(w.files.indexOf(k)>-1)){if(w.files.push(k),k in c){x?O(k,c[k]):(++C,setTimeout(function(){--C,O(k,c[k])}));return}if(x){var I;try{I=d.fs.readFileSync(k).toString("utf8")}catch($){A||_($);return}O(k,I)}else++C,w.fetch(k,function($,F){if(--C,!!b){if($){A?C||_(null,w):_($);return}O(k,F)}})}}var C=0;d.isString(p)&&(p=[p]);for(var R=0,P;R<p.length;++R)(P=w.resolvePath("",p[R]))&&E(P);if(x)return w;C||_(null,w)},h.prototype.loadSync=function(p,v){if(!d.isNode)throw Error("not supported");return this.load(p,v,a)},h.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(p){return"'extend "+p.extend+"' in "+p.parent.fullName}).join(", "));return s.prototype.resolveAll.call(this)};var m=/^[A-Z]/;function y(g,p){var v=p.parent.lookup(p.extend);if(v){var b=new i(p.fullName,p.id,p.type,p.rule,void 0,p.options);return v.get(b.name)||(b.declaringField=p,p.extensionField=b,v.add(b)),!0}return!1}return h.prototype._handleAdd=function(p){if(p instanceof i)p.extend!==void 0&&!p.extensionField&&(y(this,p)||this.deferred.push(p));else if(p instanceof r)m.test(p.name)&&(p.parent[p.name]=p.values);else if(!(p instanceof o)){if(p instanceof u)for(var v=0;v<this.deferred.length;)y(this,this.deferred[v])?this.deferred.splice(v,1):++v;for(var b=0;b<p.nestedArray.length;++b)this._handleAdd(p._nestedArray[b]);m.test(p.name)&&(p.parent[p.name]=p)}},h.prototype._handleRemove=function(p){if(p instanceof i){if(p.extend!==void 0)if(p.extensionField)p.extensionField.parent.remove(p.extensionField),p.extensionField=null;else{var v=this.deferred.indexOf(p);v>-1&&this.deferred.splice(v,1)}}else if(p instanceof r)m.test(p.name)&&delete p.parent[p.name];else if(p instanceof s){for(var b=0;b<p.nestedArray.length;++b)this._handleRemove(p._nestedArray[b]);m.test(p.name)&&delete p.parent[p.name]}},h._configure=function(g,p,v){u=g,l=p,c=v},root$1}var hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util$2.exports;hasRequiredUtil=1;var s=util$2.exports=requireMinimal(),i=roots,r,o;s.codegen=codegen_1,s.fetch=fetch_1,s.path=path,s.fs=s.inquire("fs"),s.toArray=function(a){if(a){for(var m=Object.keys(a),y=new Array(m.length),g=0;g<m.length;)y[g]=a[m[g++]];return y}return[]},s.toObject=function(a){for(var m={},y=0;y<a.length;){var g=a[y++],p=a[y++];p!==void 0&&(m[g]=p)}return m};var d=/\\/g,u=/"/g;s.isReserved=function(a){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(a)},s.safeProp=function(a){return!/^[$\w_]+$/.test(a)||s.isReserved(a)?'["'+a.replace(d,"\\\\").replace(u,'\\"')+'"]':"."+a},s.ucFirst=function(a){return a.charAt(0).toUpperCase()+a.substring(1)};var l=/_([a-z])/g;s.camelCase=function(a){return a.substring(0,1)+a.substring(1).replace(l,function(m,y){return y.toUpperCase()})},s.compareFieldsById=function(a,m){return a.id-m.id},s.decorateType=function(a,m){if(a.$type)return m&&a.$type.name!==m&&(s.decorateRoot.remove(a.$type),a.$type.name=m,s.decorateRoot.add(a.$type)),a.$type;r||(r=requireType());var y=new r(m||a.name);return s.decorateRoot.add(y),y.ctor=a,Object.defineProperty(a,"$type",{value:y,enumerable:!1}),Object.defineProperty(a.prototype,"$type",{value:y,enumerable:!1}),y};var c=0;return s.decorateEnum=function(a){if(a.$type)return a.$type;o||(o=require_enum());var m=new o("Enum"+c++,a);return s.decorateRoot.add(m),Object.defineProperty(a,"$type",{value:m,enumerable:!1}),m},s.setProperty=function(a,m,y){function g(p,v,b){var w=v.shift();if(w==="__proto__"||w==="prototype")return p;if(v.length>0)p[w]=g(p[w]||{},v,b);else{var x=p[w];x&&(b=[].concat(x).concat(b)),p[w]=b}return p}if(typeof a!="object")throw TypeError("dst must be an object");if(!m)throw TypeError("path must be specified");return m=m.split("."),g(a,m,y)},Object.defineProperty(s,"decorateRoot",{get:function(){return i.decorated||(i.decorated=new(requireRoot()))}}),util$2.exports}var object,hasRequiredObject;function requireObject(){if(hasRequiredObject)return object;hasRequiredObject=1,object=r,r.className="ReflectionObject";var s=requireUtil(),i;function r(o,d){if(!s.isString(o))throw TypeError("name must be a string");if(d&&!s.isObject(d))throw TypeError("options must be an object");this.options=d,this.parsedOptions=null,this.name=o,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}return Object.defineProperties(r.prototype,{root:{get:function(){for(var o=this;o.parent!==null;)o=o.parent;return o}},fullName:{get:function(){for(var o=[this.name],d=this.parent;d;)o.unshift(d.name),d=d.parent;return o.join(".")}}}),r.prototype.toJSON=function(){throw Error()},r.prototype.onAdd=function(d){this.parent&&this.parent!==d&&this.parent.remove(this),this.parent=d,this.resolved=!1;var u=d.root;u instanceof i&&u._handleAdd(this)},r.prototype.onRemove=function(d){var u=d.root;u instanceof i&&u._handleRemove(this),this.parent=null,this.resolved=!1},r.prototype.resolve=function(){return this.resolved?this:(this.root instanceof i&&(this.resolved=!0),this)},r.prototype.getOption=function(d){if(this.options)return this.options[d]},r.prototype.setOption=function(d,u,l){return(!l||!this.options||this.options[d]===void 0)&&((this.options||(this.options={}))[d]=u),this},r.prototype.setParsedOption=function(d,u,l){this.parsedOptions||(this.parsedOptions=[]);var c=this.parsedOptions;if(l){var h=c.find(function(y){return Object.prototype.hasOwnProperty.call(y,d)});if(h){var a=h[d];s.setProperty(a,l,u)}else h={},h[d]=s.setProperty({},l,u),c.push(h)}else{var m={};m[d]=u,c.push(m)}return this},r.prototype.setOptions=function(d,u){if(d)for(var l=Object.keys(d),c=0;c<l.length;++c)this.setOption(l[c],d[l[c]],u);return this},r.prototype.toString=function(){var d=this.constructor.className,u=this.fullName;return u.length?d+" "+u:d},r._configure=function(o){i=o},object}var _enum,hasRequired_enum;function require_enum(){if(hasRequired_enum)return _enum;hasRequired_enum=1,_enum=o;var s=requireObject();((o.prototype=Object.create(s.prototype)).constructor=o).className="Enum";var i=requireNamespace(),r=requireUtil();function o(d,u,l,c,h,a){if(s.call(this,d,l),u&&typeof u!="object")throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=c,this.comments=h||{},this.valuesOptions=a,this.reserved=void 0,u)for(var m=Object.keys(u),y=0;y<m.length;++y)typeof u[m[y]]=="number"&&(this.valuesById[this.values[m[y]]=u[m[y]]]=m[y])}return o.fromJSON=function(u,l){var c=new o(u,l.values,l.options,l.comment,l.comments);return c.reserved=l.reserved,c},o.prototype.toJSON=function(u){var l=u?!!u.keepComments:!1;return r.toObject(["options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",l?this.comment:void 0,"comments",l?this.comments:void 0])},o.prototype.add=function(u,l,c,h){if(!r.isString(u))throw TypeError("name must be a string");if(!r.isInteger(l))throw TypeError("id must be an integer");if(this.values[u]!==void 0)throw Error("duplicate name '"+u+"' in "+this);if(this.isReservedId(l))throw Error("id "+l+" is reserved in "+this);if(this.isReservedName(u))throw Error("name '"+u+"' is reserved in "+this);if(this.valuesById[l]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error("duplicate id "+l+" in "+this);this.values[u]=l}else this.valuesById[this.values[u]=l]=u;return h&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[u]=h||null),this.comments[u]=c||null,this},o.prototype.remove=function(u){if(!r.isString(u))throw TypeError("name must be a string");var l=this.values[u];if(l==null)throw Error("name '"+u+"' does not exist in "+this);return delete this.valuesById[l],delete this.values[u],delete this.comments[u],this.valuesOptions&&delete this.valuesOptions[u],this},o.prototype.isReservedId=function(u){return i.isReservedId(this.reserved,u)},o.prototype.isReservedName=function(u){return i.isReservedName(this.reserved,u)},_enum}var encoder_1,hasRequiredEncoder;function requireEncoder(){if(hasRequiredEncoder)return encoder_1;hasRequiredEncoder=1,encoder_1=d;var s=require_enum(),i=requireTypes(),r=requireUtil();function o(u,l,c,h){return l.resolvedType.group?u("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",c,h,(l.id<<3|3)>>>0,(l.id<<3|4)>>>0):u("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",c,h,(l.id<<3|2)>>>0)}function d(u){for(var l=r.codegen(["m","w"],u.name+"$encode")("if(!w)")("w=Writer.create()"),c,h,a=u.fieldsArray.slice().sort(r.compareFieldsById),c=0;c<a.length;++c){var m=a[c].resolve(),y=u._fieldsArray.indexOf(m),g=m.resolvedType instanceof s?"int32":m.type,p=i.basic[g];h="m"+r.safeProp(m.name),m.map?(l("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",h,m.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",h)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(m.id<<3|2)>>>0,8|i.mapKey[m.keyType],m.keyType),p===void 0?l("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",y,h):l(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|p,g,h),l("}")("}")):m.repeated?(l("if(%s!=null&&%s.length){",h,h),m.packed&&i.packed[g]!==void 0?l("w.uint32(%i).fork()",(m.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",h)("w.%s(%s[i])",g,h)("w.ldelim()"):(l("for(var i=0;i<%s.length;++i)",h),p===void 0?o(l,m,y,h+"[i]"):l("w.uint32(%i).%s(%s[i])",(m.id<<3|p)>>>0,g,h)),l("}")):(m.optional&&l("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",h,m.name),p===void 0?o(l,m,y,h):l("w.uint32(%i).%s(%s)",(m.id<<3|p)>>>0,g,h))}return l("return w")}return encoder_1}var protobuf$1=indexLight.exports=indexMinimal;protobuf$1.build="light";function load(s,i,r){return typeof i=="function"?(r=i,i=new protobuf$1.Root):i||(i=new protobuf$1.Root),i.load(s,r)}protobuf$1.load=load;function loadSync(s,i){return i||(i=new protobuf$1.Root),i.loadSync(s)}protobuf$1.loadSync=loadSync;protobuf$1.encoder=requireEncoder();protobuf$1.decoder=requireDecoder();protobuf$1.verifier=requireVerifier();protobuf$1.converter=requireConverter();protobuf$1.ReflectionObject=requireObject();protobuf$1.Namespace=requireNamespace();protobuf$1.Root=requireRoot();protobuf$1.Enum=require_enum();protobuf$1.Type=requireType();protobuf$1.Field=requireField();protobuf$1.OneOf=requireOneof();protobuf$1.MapField=requireMapfield();protobuf$1.Service=requireService();protobuf$1.Method=requireMethod();protobuf$1.Message=message;protobuf$1.wrappers=wrappers;protobuf$1.types=requireTypes();protobuf$1.util=requireUtil();protobuf$1.ReflectionObject._configure(protobuf$1.Root);protobuf$1.Namespace._configure(protobuf$1.Type,protobuf$1.Service,protobuf$1.Enum);protobuf$1.Root._configure(protobuf$1.Type);protobuf$1.Field._configure(protobuf$1.Type);var indexLightExports=indexLight.exports,tokenize_1=tokenize$1,delimRe=/[\s{}=;:[\],'"()<>]/g,stringDoubleRe=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,stringSingleRe=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,setCommentRe=/^ *[*/]+ */,setCommentAltRe=/^\s*\*?\/*/,setCommentSplitRe=/\n/g,whitespaceRe=/\s/,unescapeRe=/\\(.?)/g,unescapeMap={0:"\0",r:"\r",n:`
5
- `,t:" "};function unescape(s){return s.replace(unescapeRe,function(i,r){switch(r){case"\\":case"":return r;default:return unescapeMap[r]||""}})}tokenize$1.unescape=unescape;function tokenize$1(s,i){s=s.toString();var r=0,o=s.length,d=1,u=0,l={},c=[],h=null;function a(O){return Error("illegal "+O+" (line "+d+")")}function m(){var O=h==="'"?stringSingleRe:stringDoubleRe;O.lastIndex=r-1;var E=O.exec(s);if(!E)throw a("string");return r=O.lastIndex,w(h),h=null,unescape(E[1])}function y(O){return s.charAt(O)}function g(O,E,C){var R={type:s.charAt(O++),lineEmpty:!1,leading:C},P;i?P=2:P=3;var k=O-P,A;do if(--k<0||(A=s.charAt(k))===`
4
+ }`}return a.toString=d,a}codegen.verbose=!1;var fetch_1=fetch,asPromise=requireAspromise(),inquire=requireInquire(),fs=inquire("fs");function fetch(s,i,r){return typeof i=="function"?(r=i,i={}):i||(i={}),r?!i.xhr&&fs&&fs.readFile?fs.readFile(s,function(d,u){return d&&typeof XMLHttpRequest<"u"?fetch.xhr(s,i,r):d?r(d):r(null,i.binary?u:u.toString("utf8"))}):fetch.xhr(s,i,r):asPromise(fetch,this,s,i)}fetch.xhr=function s(i,r,a){var d=new XMLHttpRequest;d.onreadystatechange=function(){if(d.readyState===4){if(d.status!==0&&d.status!==200)return a(Error("status "+d.status));if(r.binary){var l=d.response;if(!l){l=[];for(var c=0;c<d.responseText.length;++c)l.push(d.responseText.charCodeAt(c)&255)}return a(null,typeof Uint8Array<"u"?new Uint8Array(l):l)}return a(null,d.responseText)}},r.binary&&("overrideMimeType"in d&&d.overrideMimeType("text/plain; charset=x-user-defined"),d.responseType="arraybuffer"),d.open("GET",i),d.send()};var path={};(function(s){var i=s,r=i.isAbsolute=function(u){return/^(?:\/|\w+:)/.test(u)},a=i.normalize=function(u){u=u.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var l=u.split("/"),c=r(u),h="";c&&(h=l.shift()+"/");for(var o=0;o<l.length;)l[o]===".."?o>0&&l[o-1]!==".."?l.splice(--o,2):c?l.splice(o,1):++o:l[o]==="."?l.splice(o,1):++o;return h+l.join("/")};i.resolve=function(u,l,c){return c||(l=a(l)),r(l)?l:(c||(u=a(u)),(u=u.replace(/(?:\/|^)[^/]+$/,"")).length?a(u+"/"+l):l)}})(path);var types$1={},hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(s){var i=s,r=requireUtil(),a=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function d(u,l){var c=0,h={};for(l|=0;c<u.length;)h[a[c+l]]=u[c++];return h}i.basic=d([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),i.defaults=d([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",r.emptyArray,null]),i.long=d([0,0,0,1,1],7),i.mapKey=d([0,0,0,5,5,0,0,0,1,1,0,2],2),i.packed=d([1,5,0,0,0,5,5,0,0,0,1,1,0])}(types$1)),types$1}var field,hasRequiredField;function requireField(){if(hasRequiredField)return field;hasRequiredField=1,field=l;var s=requireObject();((l.prototype=Object.create(s.prototype)).constructor=l).className="Field";var i=require_enum(),r=requireTypes(),a=requireUtil(),d,u=/^required|optional|repeated$/;l.fromJSON=function(h,o){return new l(h,o.id,o.type,o.rule,o.extend,o.options,o.comment)};function l(c,h,o,m,y,g,p){if(a.isObject(m)?(p=y,g=m,m=y=void 0):a.isObject(y)&&(p=g,g=y,y=void 0),s.call(this,c,g),!a.isInteger(h)||h<0)throw TypeError("id must be a non-negative integer");if(!a.isString(o))throw TypeError("type must be a string");if(m!==void 0&&!u.test(m=m.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(y!==void 0&&!a.isString(y))throw TypeError("extend must be a string");m==="proto3_optional"&&(m="optional"),this.rule=m&&m!=="optional"?m:void 0,this.type=o,this.id=h,this.extend=y||void 0,this.required=m==="required",this.optional=!this.required,this.repeated=m==="repeated",this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=a.Long?r.long[o]!==void 0:!1,this.bytes=o==="bytes",this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=p}return Object.defineProperty(l.prototype,"packed",{get:function(){return this._packed===null&&(this._packed=this.getOption("packed")!==!1),this._packed}}),l.prototype.setOption=function(h,o,m){return h==="packed"&&(this._packed=null),s.prototype.setOption.call(this,h,o,m)},l.prototype.toJSON=function(h){var o=h?!!h.keepComments:!1;return a.toObject(["rule",this.rule!=="optional"&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",o?this.comment:void 0])},l.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=r.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof d?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof i&&typeof this.typeDefault=="string"&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&((this.options.packed===!0||this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof i))&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=a.Long.fromNumber(this.typeDefault,this.type.charAt(0)==="u"),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault=="string"){var h;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,h=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,h=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=h}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof d&&(this.parent.ctor.prototype[this.name]=this.defaultValue),s.prototype.resolve.call(this)},l.d=function(h,o,m,y){return typeof o=="function"?o=a.decorateType(o).name:o&&typeof o=="object"&&(o=a.decorateEnum(o).name),function(p,v){a.decorateType(p.constructor).add(new l(v,h,o,m,{default:y}))}},l._configure=function(h){d=h},field}var oneof,hasRequiredOneof;function requireOneof(){if(hasRequiredOneof)return oneof;hasRequiredOneof=1,oneof=a;var s=requireObject();((a.prototype=Object.create(s.prototype)).constructor=a).className="OneOf";var i=requireField(),r=requireUtil();function a(u,l,c,h){if(Array.isArray(l)||(c=l,l=void 0),s.call(this,u,c),!(l===void 0||Array.isArray(l)))throw TypeError("fieldNames must be an Array");this.oneof=l||[],this.fieldsArray=[],this.comment=h}a.fromJSON=function(l,c){return new a(l,c.oneof,c.options,c.comment)},a.prototype.toJSON=function(l){var c=l?!!l.keepComments:!1;return r.toObject(["options",this.options,"oneof",this.oneof,"comment",c?this.comment:void 0])};function d(u){if(u.parent)for(var l=0;l<u.fieldsArray.length;++l)u.fieldsArray[l].parent||u.parent.add(u.fieldsArray[l])}return a.prototype.add=function(l){if(!(l instanceof i))throw TypeError("field must be a Field");return l.parent&&l.parent!==this.parent&&l.parent.remove(l),this.oneof.push(l.name),this.fieldsArray.push(l),l.partOf=this,d(this),this},a.prototype.remove=function(l){if(!(l instanceof i))throw TypeError("field must be a Field");var c=this.fieldsArray.indexOf(l);if(c<0)throw Error(l+" is not a member of "+this);return this.fieldsArray.splice(c,1),c=this.oneof.indexOf(l.name),c>-1&&this.oneof.splice(c,1),l.partOf=null,this},a.prototype.onAdd=function(l){s.prototype.onAdd.call(this,l);for(var c=this,h=0;h<this.oneof.length;++h){var o=l.get(this.oneof[h]);o&&!o.partOf&&(o.partOf=c,c.fieldsArray.push(o))}d(this)},a.prototype.onRemove=function(l){for(var c=0,h;c<this.fieldsArray.length;++c)(h=this.fieldsArray[c]).parent&&h.parent.remove(h);s.prototype.onRemove.call(this,l)},a.d=function(){for(var l=new Array(arguments.length),c=0;c<arguments.length;)l[c]=arguments[c++];return function(o,m){r.decorateType(o.constructor).add(new a(m,l)),Object.defineProperty(o,m,{get:r.oneOfGetter(l),set:r.oneOfSetter(l)})}},oneof}var namespace,hasRequiredNamespace;function requireNamespace(){if(hasRequiredNamespace)return namespace;hasRequiredNamespace=1,namespace=h;var s=requireObject();((h.prototype=Object.create(s.prototype)).constructor=h).className="Namespace";var i=requireField(),r=requireUtil(),a=requireOneof(),d,u,l;h.fromJSON=function(y,g){return new h(y,g.options).addJSON(g.nested)};function c(m,y){if(m&&m.length){for(var g={},p=0;p<m.length;++p)g[m[p].name]=m[p].toJSON(y);return g}}h.arrayToJSON=c,h.isReservedId=function(y,g){if(y){for(var p=0;p<y.length;++p)if(typeof y[p]!="string"&&y[p][0]<=g&&y[p][1]>g)return!0}return!1},h.isReservedName=function(y,g){if(y){for(var p=0;p<y.length;++p)if(y[p]===g)return!0}return!1};function h(m,y){s.call(this,m,y),this.nested=void 0,this._nestedArray=null}function o(m){return m._nestedArray=null,m}return Object.defineProperty(h.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=r.toArray(this.nested))}}),h.prototype.toJSON=function(y){return r.toObject(["options",this.options,"nested",c(this.nestedArray,y)])},h.prototype.addJSON=function(y){var g=this;if(y)for(var p=Object.keys(y),v=0,b;v<p.length;++v)b=y[p[v]],g.add((b.fields!==void 0?d.fromJSON:b.values!==void 0?l.fromJSON:b.methods!==void 0?u.fromJSON:b.id!==void 0?i.fromJSON:h.fromJSON)(p[v],b));return this},h.prototype.get=function(y){return this.nested&&this.nested[y]||null},h.prototype.getEnum=function(y){if(this.nested&&this.nested[y]instanceof l)return this.nested[y].values;throw Error("no such enum: "+y)},h.prototype.add=function(y){if(!(y instanceof i&&y.extend!==void 0||y instanceof d||y instanceof a||y instanceof l||y instanceof u||y instanceof h))throw TypeError("object must be a valid nested object");if(!this.nested)this.nested={};else{var g=this.get(y.name);if(g)if(g instanceof h&&y instanceof h&&!(g instanceof d||g instanceof u)){for(var p=g.nestedArray,v=0;v<p.length;++v)y.add(p[v]);this.remove(g),this.nested||(this.nested={}),y.setOptions(g.options,!0)}else throw Error("duplicate name '"+y.name+"' in "+this)}return this.nested[y.name]=y,y.onAdd(this),o(this)},h.prototype.remove=function(y){if(!(y instanceof s))throw TypeError("object must be a ReflectionObject");if(y.parent!==this)throw Error(y+" is not a member of "+this);return delete this.nested[y.name],Object.keys(this.nested).length||(this.nested=void 0),y.onRemove(this),o(this)},h.prototype.define=function(y,g){if(r.isString(y))y=y.split(".");else if(!Array.isArray(y))throw TypeError("illegal path");if(y&&y.length&&y[0]==="")throw Error("path must be relative");for(var p=this;y.length>0;){var v=y.shift();if(p.nested&&p.nested[v]){if(p=p.nested[v],!(p instanceof h))throw Error("path conflicts with non-namespace objects")}else p.add(p=new h(v))}return g&&p.addJSON(g),p},h.prototype.resolveAll=function(){for(var y=this.nestedArray,g=0;g<y.length;)y[g]instanceof h?y[g++].resolveAll():y[g++].resolve();return this.resolve()},h.prototype.lookup=function(y,g,p){if(typeof g=="boolean"?(p=g,g=void 0):g&&!Array.isArray(g)&&(g=[g]),r.isString(y)&&y.length){if(y===".")return this.root;y=y.split(".")}else if(!y.length)return this;if(y[0]==="")return this.root.lookup(y.slice(1),g);var v=this.get(y[0]);if(v){if(y.length===1){if(!g||g.indexOf(v.constructor)>-1)return v}else if(v instanceof h&&(v=v.lookup(y.slice(1),g,!0)))return v}else for(var b=0;b<this.nestedArray.length;++b)if(this._nestedArray[b]instanceof h&&(v=this._nestedArray[b].lookup(y,g,!0)))return v;return this.parent===null||p?null:this.parent.lookup(y,g)},h.prototype.lookupType=function(y){var g=this.lookup(y,[d]);if(!g)throw Error("no such type: "+y);return g},h.prototype.lookupEnum=function(y){var g=this.lookup(y,[l]);if(!g)throw Error("no such Enum '"+y+"' in "+this);return g},h.prototype.lookupTypeOrEnum=function(y){var g=this.lookup(y,[d,l]);if(!g)throw Error("no such Type or Enum '"+y+"' in "+this);return g},h.prototype.lookupService=function(y){var g=this.lookup(y,[u]);if(!g)throw Error("no such Service '"+y+"' in "+this);return g},h._configure=function(m,y,g){d=m,u=y,l=g},namespace}var mapfield,hasRequiredMapfield;function requireMapfield(){if(hasRequiredMapfield)return mapfield;hasRequiredMapfield=1,mapfield=a;var s=requireField();((a.prototype=Object.create(s.prototype)).constructor=a).className="MapField";var i=requireTypes(),r=requireUtil();function a(d,u,l,c,h,o){if(s.call(this,d,u,c,void 0,void 0,h,o),!r.isString(l))throw TypeError("keyType must be a string");this.keyType=l,this.resolvedKeyType=null,this.map=!0}return a.fromJSON=function(u,l){return new a(u,l.id,l.keyType,l.type,l.options,l.comment)},a.prototype.toJSON=function(u){var l=u?!!u.keepComments:!1;return r.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",l?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(i.mapKey[this.keyType]===void 0)throw Error("invalid key type: "+this.keyType);return s.prototype.resolve.call(this)},a.d=function(u,l,c){return typeof c=="function"?c=r.decorateType(c).name:c&&typeof c=="object"&&(c=r.decorateEnum(c).name),function(o,m){r.decorateType(o.constructor).add(new a(m,u,l,c))}},mapfield}var method,hasRequiredMethod;function requireMethod(){if(hasRequiredMethod)return method;hasRequiredMethod=1,method=r;var s=requireObject();((r.prototype=Object.create(s.prototype)).constructor=r).className="Method";var i=requireUtil();function r(a,d,u,l,c,h,o,m,y){if(i.isObject(c)?(o=c,c=h=void 0):i.isObject(h)&&(o=h,h=void 0),!(d===void 0||i.isString(d)))throw TypeError("type must be a string");if(!i.isString(u))throw TypeError("requestType must be a string");if(!i.isString(l))throw TypeError("responseType must be a string");s.call(this,a,o),this.type=d||"rpc",this.requestType=u,this.requestStream=c?!0:void 0,this.responseType=l,this.responseStream=h?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=m,this.parsedOptions=y}return r.fromJSON=function(d,u){return new r(d,u.type,u.requestType,u.responseType,u.requestStream,u.responseStream,u.options,u.comment,u.parsedOptions)},r.prototype.toJSON=function(d){var u=d?!!d.keepComments:!1;return i.toObject(["type",this.type!=="rpc"&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",u?this.comment:void 0,"parsedOptions",this.parsedOptions])},r.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),s.prototype.resolve.call(this))},method}var service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=d;var s=requireNamespace();((d.prototype=Object.create(s.prototype)).constructor=d).className="Service";var i=requireMethod(),r=requireUtil(),a=rpc;function d(l,c){s.call(this,l,c),this.methods={},this._methodsArray=null}d.fromJSON=function(c,h){var o=new d(c,h.options);if(h.methods)for(var m=Object.keys(h.methods),y=0;y<m.length;++y)o.add(i.fromJSON(m[y],h.methods[m[y]]));return h.nested&&o.addJSON(h.nested),o.comment=h.comment,o},d.prototype.toJSON=function(c){var h=s.prototype.toJSON.call(this,c),o=c?!!c.keepComments:!1;return r.toObject(["options",h&&h.options||void 0,"methods",s.arrayToJSON(this.methodsArray,c)||{},"nested",h&&h.nested||void 0,"comment",o?this.comment:void 0])},Object.defineProperty(d.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=r.toArray(this.methods))}});function u(l){return l._methodsArray=null,l}return d.prototype.get=function(c){return this.methods[c]||s.prototype.get.call(this,c)},d.prototype.resolveAll=function(){for(var c=this.methodsArray,h=0;h<c.length;++h)c[h].resolve();return s.prototype.resolve.call(this)},d.prototype.add=function(c){if(this.get(c.name))throw Error("duplicate name '"+c.name+"' in "+this);return c instanceof i?(this.methods[c.name]=c,c.parent=this,u(this)):s.prototype.add.call(this,c)},d.prototype.remove=function(c){if(c instanceof i){if(this.methods[c.name]!==c)throw Error(c+" is not a member of "+this);return delete this.methods[c.name],c.parent=null,u(this)}return s.prototype.remove.call(this,c)},d.prototype.create=function(c,h,o){for(var m=new a.Service(c,h,o),y=0,g;y<this.methodsArray.length;++y){var p=r.lcFirst((g=this._methodsArray[y]).resolve().name).replace(/[^$\w_]/g,"");m[p]=r.codegen(["r","c"],r.isReserved(p)?p+"_":p)("return this.rpcCall(m,q,s,r,c)")({m:g,q:g.resolvedRequestType.ctor,s:g.resolvedResponseType.ctor})}return m},service}var message=Message,util$1=requireMinimal();function Message(s){if(s)for(var i=Object.keys(s),r=0;r<i.length;++r)this[i[r]]=s[i[r]]}Message.create=function s(i){return this.$type.create(i)};Message.encode=function s(i,r){return this.$type.encode(i,r)};Message.encodeDelimited=function s(i,r){return this.$type.encodeDelimited(i,r)};Message.decode=function s(i){return this.$type.decode(i)};Message.decodeDelimited=function s(i){return this.$type.decodeDelimited(i)};Message.verify=function s(i){return this.$type.verify(i)};Message.fromObject=function s(i){return this.$type.fromObject(i)};Message.toObject=function s(i,r){return this.$type.toObject(i,r)};Message.prototype.toJSON=function s(){return this.$type.toObject(this,util$1.toJSONOptions)};var decoder_1,hasRequiredDecoder;function requireDecoder(){if(hasRequiredDecoder)return decoder_1;hasRequiredDecoder=1,decoder_1=d;var s=require_enum(),i=requireTypes(),r=requireUtil();function a(u){return"missing required '"+u.name+"'"}function d(u){var l=r.codegen(["r","l"],u.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(u.fieldsArray.filter(function(g){return g.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");u.group&&l("if((t&7)===4)")("break"),l("switch(t>>>3){");for(var c=0;c<u.fieldsArray.length;++c){var h=u._fieldsArray[c].resolve(),o=h.resolvedType instanceof s?"int32":h.type,m="m"+r.safeProp(h.name);l("case %i: {",h.id),h.map?(l("if(%s===util.emptyObject)",m)("%s={}",m)("var c2 = r.uint32()+r.pos"),i.defaults[h.keyType]!==void 0?l("k=%j",i.defaults[h.keyType]):l("k=null"),i.defaults[o]!==void 0?l("value=%j",i.defaults[o]):l("value=null"),l("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",h.keyType)("case 2:"),i.basic[o]===void 0?l("value=types[%i].decode(r,r.uint32())",c):l("value=r.%s()",o),l("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),i.long[h.keyType]!==void 0?l('%s[typeof k==="object"?util.longToHash(k):k]=value',m):l("%s[k]=value",m)):h.repeated?(l("if(!(%s&&%s.length))",m,m)("%s=[]",m),i.packed[o]!==void 0&&l("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",m,o)("}else"),i.basic[o]===void 0?l(h.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",m,c):l("%s.push(r.%s())",m,o)):i.basic[o]===void 0?l(h.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",m,c):l("%s=r.%s()",m,o),l("break")("}")}for(l("default:")("r.skipType(t&7)")("break")("}")("}"),c=0;c<u._fieldsArray.length;++c){var y=u._fieldsArray[c];y.required&&l("if(!m.hasOwnProperty(%j))",y.name)("throw util.ProtocolError(%j,{instance:m})",a(y))}return l("return m")}return decoder_1}var verifier_1,hasRequiredVerifier;function requireVerifier(){if(hasRequiredVerifier)return verifier_1;hasRequiredVerifier=1,verifier_1=u;var s=require_enum(),i=requireUtil();function r(l,c){return l.name+": "+c+(l.repeated&&c!=="array"?"[]":l.map&&c!=="object"?"{k:"+l.keyType+"}":"")+" expected"}function a(l,c,h,o){if(c.resolvedType)if(c.resolvedType instanceof s){l("switch(%s){",o)("default:")("return%j",r(c,"enum value"));for(var m=Object.keys(c.resolvedType.values),y=0;y<m.length;++y)l("case %i:",c.resolvedType.values[m[y]]);l("break")("}")}else l("{")("var e=types[%i].verify(%s);",h,o)("if(e)")("return%j+e",c.name+".")("}");else switch(c.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":l("if(!util.isInteger(%s))",o)("return%j",r(c,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":l("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",o,o,o,o)("return%j",r(c,"integer|Long"));break;case"float":case"double":l('if(typeof %s!=="number")',o)("return%j",r(c,"number"));break;case"bool":l('if(typeof %s!=="boolean")',o)("return%j",r(c,"boolean"));break;case"string":l("if(!util.isString(%s))",o)("return%j",r(c,"string"));break;case"bytes":l('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',o,o,o)("return%j",r(c,"buffer"));break}return l}function d(l,c,h){switch(c.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":l("if(!util.key32Re.test(%s))",h)("return%j",r(c,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":l("if(!util.key64Re.test(%s))",h)("return%j",r(c,"integer|Long key"));break;case"bool":l("if(!util.key2Re.test(%s))",h)("return%j",r(c,"boolean key"));break}return l}function u(l){var c=i.codegen(["m"],l.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),h=l.oneofsArray,o={};h.length&&c("var p={}");for(var m=0;m<l.fieldsArray.length;++m){var y=l._fieldsArray[m].resolve(),g="m"+i.safeProp(y.name);if(y.optional&&c("if(%s!=null&&m.hasOwnProperty(%j)){",g,y.name),y.map)c("if(!util.isObject(%s))",g)("return%j",r(y,"object"))("var k=Object.keys(%s)",g)("for(var i=0;i<k.length;++i){"),d(c,y,"k[i]"),a(c,y,m,g+"[k[i]]")("}");else if(y.repeated)c("if(!Array.isArray(%s))",g)("return%j",r(y,"array"))("for(var i=0;i<%s.length;++i){",g),a(c,y,m,g+"[i]")("}");else{if(y.partOf){var p=i.safeProp(y.partOf.name);o[y.partOf.name]===1&&c("if(p%s===1)",p)("return%j",y.partOf.name+": multiple values"),o[y.partOf.name]=1,c("p%s=1",p)}a(c,y,m,g)}y.optional&&c("}")}return c("return null")}return verifier_1}var converter={},hasRequiredConverter;function requireConverter(){return hasRequiredConverter||(hasRequiredConverter=1,function(s){var i=s,r=require_enum(),a=requireUtil();function d(l,c,h,o){var m=!1;if(c.resolvedType)if(c.resolvedType instanceof r){l("switch(d%s){",o);for(var y=c.resolvedType.values,g=Object.keys(y),p=0;p<g.length;++p)y[g[p]]===c.typeDefault&&!m&&(l("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',o,o,o),c.repeated||l("break"),m=!0),l("case%j:",g[p])("case %i:",y[g[p]])("m%s=%j",o,y[g[p]])("break");l("}")}else l('if(typeof d%s!=="object")',o)("throw TypeError(%j)",c.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",o,h,o);else{var v=!1;switch(c.type){case"double":case"float":l("m%s=Number(d%s)",o,o);break;case"uint32":case"fixed32":l("m%s=d%s>>>0",o,o);break;case"int32":case"sint32":case"sfixed32":l("m%s=d%s|0",o,o);break;case"uint64":v=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":l("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",o,o,v)('else if(typeof d%s==="string")',o)("m%s=parseInt(d%s,10)",o,o)('else if(typeof d%s==="number")',o)("m%s=d%s",o,o)('else if(typeof d%s==="object")',o)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",o,o,o,v?"true":"");break;case"bytes":l('if(typeof d%s==="string")',o)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",o,o,o)("else if(d%s.length >= 0)",o)("m%s=d%s",o,o);break;case"string":l("m%s=String(d%s)",o,o);break;case"bool":l("m%s=Boolean(d%s)",o,o);break}}return l}i.fromObject=function(c){var h=c.fieldsArray,o=a.codegen(["d"],c.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!h.length)return o("return new this.ctor");o("var m=new this.ctor");for(var m=0;m<h.length;++m){var y=h[m].resolve(),g=a.safeProp(y.name);y.map?(o("if(d%s){",g)('if(typeof d%s!=="object")',g)("throw TypeError(%j)",y.fullName+": object expected")("m%s={}",g)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",g),d(o,y,m,g+"[ks[i]]")("}")("}")):y.repeated?(o("if(d%s){",g)("if(!Array.isArray(d%s))",g)("throw TypeError(%j)",y.fullName+": array expected")("m%s=[]",g)("for(var i=0;i<d%s.length;++i){",g),d(o,y,m,g+"[i]")("}")("}")):(y.resolvedType instanceof r||o("if(d%s!=null){",g),d(o,y,m,g),y.resolvedType instanceof r||o("}"))}return o("return m")};function u(l,c,h,o){if(c.resolvedType)c.resolvedType instanceof r?l("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",o,h,o,o,h,o,o):l("d%s=types[%i].toObject(m%s,o)",o,h,o);else{var m=!1;switch(c.type){case"double":case"float":l("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",o,o,o,o);break;case"uint64":m=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":l('if(typeof m%s==="number")',o)("d%s=o.longs===String?String(m%s):m%s",o,o,o)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",o,o,o,o,m?"true":"",o);break;case"bytes":l("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",o,o,o,o,o);break;default:l("d%s=m%s",o,o);break}}return l}i.toObject=function(c){var h=c.fieldsArray.slice().sort(a.compareFieldsById);if(!h.length)return a.codegen()("return {}");for(var o=a.codegen(["m","o"],c.name+"$toObject")("if(!o)")("o={}")("var d={}"),m=[],y=[],g=[],p=0;p<h.length;++p)h[p].partOf||(h[p].resolve().repeated?m:h[p].map?y:g).push(h[p]);if(m.length){for(o("if(o.arrays||o.defaults){"),p=0;p<m.length;++p)o("d%s=[]",a.safeProp(m[p].name));o("}")}if(y.length){for(o("if(o.objects||o.defaults){"),p=0;p<y.length;++p)o("d%s={}",a.safeProp(y[p].name));o("}")}if(g.length){for(o("if(o.defaults){"),p=0;p<g.length;++p){var v=g[p],b=a.safeProp(v.name);if(v.resolvedType instanceof r)o("d%s=o.enums===String?%j:%j",b,v.resolvedType.valuesById[v.typeDefault],v.typeDefault);else if(v.long)o("if(util.Long){")("var n=new util.Long(%i,%i,%j)",v.typeDefault.low,v.typeDefault.high,v.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",b)("}else")("d%s=o.longs===String?%j:%i",b,v.typeDefault.toString(),v.typeDefault.toNumber());else if(v.bytes){var w="["+Array.prototype.slice.call(v.typeDefault).join(",")+"]";o("if(o.bytes===String)d%s=%j",b,String.fromCharCode.apply(String,v.typeDefault))("else{")("d%s=%s",b,w)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",b,b)("}")}else o("d%s=%j",b,v.typeDefault)}o("}")}var x=!1;for(p=0;p<h.length;++p){var v=h[p],_=c._fieldsArray.indexOf(v),b=a.safeProp(v.name);v.map?(x||(x=!0,o("var ks2")),o("if(m%s&&(ks2=Object.keys(m%s)).length){",b,b)("d%s={}",b)("for(var j=0;j<ks2.length;++j){"),u(o,v,_,b+"[ks2[j]]")("}")):v.repeated?(o("if(m%s&&m%s.length){",b,b)("d%s=[]",b)("for(var j=0;j<m%s.length;++j){",b),u(o,v,_,b+"[j]")("}")):(o("if(m%s!=null&&m.hasOwnProperty(%j)){",b,v.name),u(o,v,_,b),v.partOf&&o("if(o.oneofs)")("d%s=%j",a.safeProp(v.partOf.name),v.name)),o("}")}return o("return d")}}(converter)),converter}var wrappers={};(function(s){var i=s,r=message;i[".google.protobuf.Any"]={fromObject:function(a){if(a&&a["@type"]){var d=a["@type"].substring(a["@type"].lastIndexOf("/")+1),u=this.lookup(d);if(u){var l=a["@type"].charAt(0)==="."?a["@type"].slice(1):a["@type"];return l.indexOf("/")===-1&&(l="/"+l),this.create({type_url:l,value:u.encode(u.fromObject(a)).finish()})}}return this.fromObject(a)},toObject:function(a,d){var u="type.googleapis.com/",l="",c="";if(d&&d.json&&a.type_url&&a.value){c=a.type_url.substring(a.type_url.lastIndexOf("/")+1),l=a.type_url.substring(0,a.type_url.lastIndexOf("/")+1);var h=this.lookup(c);h&&(a=h.decode(a.value))}if(!(a instanceof this.ctor)&&a instanceof r){var o=a.$type.toObject(a,d),m=a.$type.fullName[0]==="."?a.$type.fullName.slice(1):a.$type.fullName;return l===""&&(l=u),c=l+m,o["@type"]=c,o}return this.toObject(a,d)}}})(wrappers);var type,hasRequiredType;function requireType(){if(hasRequiredType)return type;hasRequiredType=1,type=b;var s=requireNamespace();((b.prototype=Object.create(s.prototype)).constructor=b).className="Type";var i=require_enum(),r=requireOneof(),a=requireField(),d=requireMapfield(),u=requireService(),l=message,c=reader,h=writer,o=requireUtil(),m=requireEncoder(),y=requireDecoder(),g=requireVerifier(),p=requireConverter(),v=wrappers;function b(x,_){s.call(this,x,_),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(b.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var x=Object.keys(this.fields),_=0;_<x.length;++_){var T=this.fields[x[_]],O=T.id;if(this._fieldsById[O])throw Error("duplicate id "+O+" in "+this);this._fieldsById[O]=T}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=o.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=o.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=b.generateConstructor(this)())},set:function(x){var _=x.prototype;_ instanceof l||((x.prototype=new l).constructor=x,o.merge(x.prototype,_)),x.$type=x.prototype.$type=this,o.merge(x,l,!0),this._ctor=x;for(var T=0;T<this.fieldsArray.length;++T)this._fieldsArray[T].resolve();var O={};for(T=0;T<this.oneofsArray.length;++T)O[this._oneofsArray[T].resolve().name]={get:o.oneOfGetter(this._oneofsArray[T].oneof),set:o.oneOfSetter(this._oneofsArray[T].oneof)};T&&Object.defineProperties(x.prototype,O)}}}),b.generateConstructor=function(_){for(var T=o.codegen(["p"],_.name),O=0,E;O<_.fieldsArray.length;++O)(E=_._fieldsArray[O]).map?T("this%s={}",o.safeProp(E.name)):E.repeated&&T("this%s=[]",o.safeProp(E.name));return T("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")};function w(x){return x._fieldsById=x._fieldsArray=x._oneofsArray=null,delete x.encode,delete x.decode,delete x.verify,x}return b.fromJSON=function(_,T){var O=new b(_,T.options);O.extensions=T.extensions,O.reserved=T.reserved;for(var E=Object.keys(T.fields),C=0;C<E.length;++C)O.add((typeof T.fields[E[C]].keyType<"u"?d.fromJSON:a.fromJSON)(E[C],T.fields[E[C]]));if(T.oneofs)for(E=Object.keys(T.oneofs),C=0;C<E.length;++C)O.add(r.fromJSON(E[C],T.oneofs[E[C]]));if(T.nested)for(E=Object.keys(T.nested),C=0;C<E.length;++C){var R=T.nested[E[C]];O.add((R.id!==void 0?a.fromJSON:R.fields!==void 0?b.fromJSON:R.values!==void 0?i.fromJSON:R.methods!==void 0?u.fromJSON:s.fromJSON)(E[C],R))}return T.extensions&&T.extensions.length&&(O.extensions=T.extensions),T.reserved&&T.reserved.length&&(O.reserved=T.reserved),T.group&&(O.group=!0),T.comment&&(O.comment=T.comment),O},b.prototype.toJSON=function(_){var T=s.prototype.toJSON.call(this,_),O=_?!!_.keepComments:!1;return o.toObject(["options",T&&T.options||void 0,"oneofs",s.arrayToJSON(this.oneofsArray,_),"fields",s.arrayToJSON(this.fieldsArray.filter(function(E){return!E.declaringField}),_)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",T&&T.nested||void 0,"comment",O?this.comment:void 0])},b.prototype.resolveAll=function(){for(var _=this.fieldsArray,T=0;T<_.length;)_[T++].resolve();var O=this.oneofsArray;for(T=0;T<O.length;)O[T++].resolve();return s.prototype.resolveAll.call(this)},b.prototype.get=function(_){return this.fields[_]||this.oneofs&&this.oneofs[_]||this.nested&&this.nested[_]||null},b.prototype.add=function(_){if(this.get(_.name))throw Error("duplicate name '"+_.name+"' in "+this);if(_ instanceof a&&_.extend===void 0){if(this._fieldsById?this._fieldsById[_.id]:this.fieldsById[_.id])throw Error("duplicate id "+_.id+" in "+this);if(this.isReservedId(_.id))throw Error("id "+_.id+" is reserved in "+this);if(this.isReservedName(_.name))throw Error("name '"+_.name+"' is reserved in "+this);return _.parent&&_.parent.remove(_),this.fields[_.name]=_,_.message=this,_.onAdd(this),w(this)}return _ instanceof r?(this.oneofs||(this.oneofs={}),this.oneofs[_.name]=_,_.onAdd(this),w(this)):s.prototype.add.call(this,_)},b.prototype.remove=function(_){if(_ instanceof a&&_.extend===void 0){if(!this.fields||this.fields[_.name]!==_)throw Error(_+" is not a member of "+this);return delete this.fields[_.name],_.parent=null,_.onRemove(this),w(this)}if(_ instanceof r){if(!this.oneofs||this.oneofs[_.name]!==_)throw Error(_+" is not a member of "+this);return delete this.oneofs[_.name],_.parent=null,_.onRemove(this),w(this)}return s.prototype.remove.call(this,_)},b.prototype.isReservedId=function(_){return s.isReservedId(this.reserved,_)},b.prototype.isReservedName=function(_){return s.isReservedName(this.reserved,_)},b.prototype.create=function(_){return new this.ctor(_)},b.prototype.setup=function(){for(var _=this.fullName,T=[],O=0;O<this.fieldsArray.length;++O)T.push(this._fieldsArray[O].resolve().resolvedType);this.encode=m(this)({Writer:h,types:T,util:o}),this.decode=y(this)({Reader:c,types:T,util:o}),this.verify=g(this)({types:T,util:o}),this.fromObject=p.fromObject(this)({types:T,util:o}),this.toObject=p.toObject(this)({types:T,util:o});var E=v[_];if(E){var C=Object.create(this);C.fromObject=this.fromObject,this.fromObject=E.fromObject.bind(C),C.toObject=this.toObject,this.toObject=E.toObject.bind(C)}return this},b.prototype.encode=function(_,T){return this.setup().encode(_,T)},b.prototype.encodeDelimited=function(_,T){return this.encode(_,T&&T.len?T.fork():T).ldelim()},b.prototype.decode=function(_,T){return this.setup().decode(_,T)},b.prototype.decodeDelimited=function(_){return _ instanceof c||(_=c.create(_)),this.decode(_,_.uint32())},b.prototype.verify=function(_){return this.setup().verify(_)},b.prototype.fromObject=function(_){return this.setup().fromObject(_)},b.prototype.toObject=function(_,T){return this.setup().toObject(_,T)},b.d=function(_){return function(O){o.decorateType(O,_)}},type}var root$1,hasRequiredRoot;function requireRoot(){if(hasRequiredRoot)return root$1;hasRequiredRoot=1,root$1=h;var s=requireNamespace();((h.prototype=Object.create(s.prototype)).constructor=h).className="Root";var i=requireField(),r=require_enum(),a=requireOneof(),d=requireUtil(),u,l,c;function h(g){s.call(this,"",g),this.deferred=[],this.files=[]}h.fromJSON=function(p,v){return v||(v=new h),p.options&&v.setOptions(p.options),v.addJSON(p.nested)},h.prototype.resolvePath=d.path.resolve,h.prototype.fetch=d.fetch;function o(){}h.prototype.load=function g(p,v,b){typeof v=="function"&&(b=v,v=void 0);var w=this;if(!b)return d.asPromise(g,w,p,v);var x=b===o;function _(k,A){if(b){if(x)throw k;var I=b;b=null,I(k,A)}}function T(k){var A=k.lastIndexOf("google/protobuf/");if(A>-1){var I=k.substring(A);if(I in c)return I}return null}function O(k,A){try{if(d.isString(A)&&A.charAt(0)==="{"&&(A=JSON.parse(A)),!d.isString(A))w.setOptions(A.options).addJSON(A.nested);else{l.filename=k;var I=l(A,w,v),$,F=0;if(I.imports)for(;F<I.imports.length;++F)($=T(I.imports[F])||w.resolvePath(k,I.imports[F]))&&E($);if(I.weakImports)for(F=0;F<I.weakImports.length;++F)($=T(I.weakImports[F])||w.resolvePath(k,I.weakImports[F]))&&E($,!0)}}catch(q){_(q)}!x&&!C&&_(null,w)}function E(k,A){if(k=T(k)||k,!(w.files.indexOf(k)>-1)){if(w.files.push(k),k in c){x?O(k,c[k]):(++C,setTimeout(function(){--C,O(k,c[k])}));return}if(x){var I;try{I=d.fs.readFileSync(k).toString("utf8")}catch($){A||_($);return}O(k,I)}else++C,w.fetch(k,function($,F){if(--C,!!b){if($){A?C||_(null,w):_($);return}O(k,F)}})}}var C=0;d.isString(p)&&(p=[p]);for(var R=0,P;R<p.length;++R)(P=w.resolvePath("",p[R]))&&E(P);if(x)return w;C||_(null,w)},h.prototype.loadSync=function(p,v){if(!d.isNode)throw Error("not supported");return this.load(p,v,o)},h.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(p){return"'extend "+p.extend+"' in "+p.parent.fullName}).join(", "));return s.prototype.resolveAll.call(this)};var m=/^[A-Z]/;function y(g,p){var v=p.parent.lookup(p.extend);if(v){var b=new i(p.fullName,p.id,p.type,p.rule,void 0,p.options);return v.get(b.name)||(b.declaringField=p,p.extensionField=b,v.add(b)),!0}return!1}return h.prototype._handleAdd=function(p){if(p instanceof i)p.extend!==void 0&&!p.extensionField&&(y(this,p)||this.deferred.push(p));else if(p instanceof r)m.test(p.name)&&(p.parent[p.name]=p.values);else if(!(p instanceof a)){if(p instanceof u)for(var v=0;v<this.deferred.length;)y(this,this.deferred[v])?this.deferred.splice(v,1):++v;for(var b=0;b<p.nestedArray.length;++b)this._handleAdd(p._nestedArray[b]);m.test(p.name)&&(p.parent[p.name]=p)}},h.prototype._handleRemove=function(p){if(p instanceof i){if(p.extend!==void 0)if(p.extensionField)p.extensionField.parent.remove(p.extensionField),p.extensionField=null;else{var v=this.deferred.indexOf(p);v>-1&&this.deferred.splice(v,1)}}else if(p instanceof r)m.test(p.name)&&delete p.parent[p.name];else if(p instanceof s){for(var b=0;b<p.nestedArray.length;++b)this._handleRemove(p._nestedArray[b]);m.test(p.name)&&delete p.parent[p.name]}},h._configure=function(g,p,v){u=g,l=p,c=v},root$1}var hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util$2.exports;hasRequiredUtil=1;var s=util$2.exports=requireMinimal(),i=roots,r,a;s.codegen=codegen_1,s.fetch=fetch_1,s.path=path,s.fs=s.inquire("fs"),s.toArray=function(o){if(o){for(var m=Object.keys(o),y=new Array(m.length),g=0;g<m.length;)y[g]=o[m[g++]];return y}return[]},s.toObject=function(o){for(var m={},y=0;y<o.length;){var g=o[y++],p=o[y++];p!==void 0&&(m[g]=p)}return m};var d=/\\/g,u=/"/g;s.isReserved=function(o){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(o)},s.safeProp=function(o){return!/^[$\w_]+$/.test(o)||s.isReserved(o)?'["'+o.replace(d,"\\\\").replace(u,'\\"')+'"]':"."+o},s.ucFirst=function(o){return o.charAt(0).toUpperCase()+o.substring(1)};var l=/_([a-z])/g;s.camelCase=function(o){return o.substring(0,1)+o.substring(1).replace(l,function(m,y){return y.toUpperCase()})},s.compareFieldsById=function(o,m){return o.id-m.id},s.decorateType=function(o,m){if(o.$type)return m&&o.$type.name!==m&&(s.decorateRoot.remove(o.$type),o.$type.name=m,s.decorateRoot.add(o.$type)),o.$type;r||(r=requireType());var y=new r(m||o.name);return s.decorateRoot.add(y),y.ctor=o,Object.defineProperty(o,"$type",{value:y,enumerable:!1}),Object.defineProperty(o.prototype,"$type",{value:y,enumerable:!1}),y};var c=0;return s.decorateEnum=function(o){if(o.$type)return o.$type;a||(a=require_enum());var m=new a("Enum"+c++,o);return s.decorateRoot.add(m),Object.defineProperty(o,"$type",{value:m,enumerable:!1}),m},s.setProperty=function(o,m,y){function g(p,v,b){var w=v.shift();if(w==="__proto__"||w==="prototype")return p;if(v.length>0)p[w]=g(p[w]||{},v,b);else{var x=p[w];x&&(b=[].concat(x).concat(b)),p[w]=b}return p}if(typeof o!="object")throw TypeError("dst must be an object");if(!m)throw TypeError("path must be specified");return m=m.split("."),g(o,m,y)},Object.defineProperty(s,"decorateRoot",{get:function(){return i.decorated||(i.decorated=new(requireRoot()))}}),util$2.exports}var object,hasRequiredObject;function requireObject(){if(hasRequiredObject)return object;hasRequiredObject=1,object=r,r.className="ReflectionObject";var s=requireUtil(),i;function r(a,d){if(!s.isString(a))throw TypeError("name must be a string");if(d&&!s.isObject(d))throw TypeError("options must be an object");this.options=d,this.parsedOptions=null,this.name=a,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}return Object.defineProperties(r.prototype,{root:{get:function(){for(var a=this;a.parent!==null;)a=a.parent;return a}},fullName:{get:function(){for(var a=[this.name],d=this.parent;d;)a.unshift(d.name),d=d.parent;return a.join(".")}}}),r.prototype.toJSON=function(){throw Error()},r.prototype.onAdd=function(d){this.parent&&this.parent!==d&&this.parent.remove(this),this.parent=d,this.resolved=!1;var u=d.root;u instanceof i&&u._handleAdd(this)},r.prototype.onRemove=function(d){var u=d.root;u instanceof i&&u._handleRemove(this),this.parent=null,this.resolved=!1},r.prototype.resolve=function(){return this.resolved?this:(this.root instanceof i&&(this.resolved=!0),this)},r.prototype.getOption=function(d){if(this.options)return this.options[d]},r.prototype.setOption=function(d,u,l){return(!l||!this.options||this.options[d]===void 0)&&((this.options||(this.options={}))[d]=u),this},r.prototype.setParsedOption=function(d,u,l){this.parsedOptions||(this.parsedOptions=[]);var c=this.parsedOptions;if(l){var h=c.find(function(y){return Object.prototype.hasOwnProperty.call(y,d)});if(h){var o=h[d];s.setProperty(o,l,u)}else h={},h[d]=s.setProperty({},l,u),c.push(h)}else{var m={};m[d]=u,c.push(m)}return this},r.prototype.setOptions=function(d,u){if(d)for(var l=Object.keys(d),c=0;c<l.length;++c)this.setOption(l[c],d[l[c]],u);return this},r.prototype.toString=function(){var d=this.constructor.className,u=this.fullName;return u.length?d+" "+u:d},r._configure=function(a){i=a},object}var _enum,hasRequired_enum;function require_enum(){if(hasRequired_enum)return _enum;hasRequired_enum=1,_enum=a;var s=requireObject();((a.prototype=Object.create(s.prototype)).constructor=a).className="Enum";var i=requireNamespace(),r=requireUtil();function a(d,u,l,c,h,o){if(s.call(this,d,l),u&&typeof u!="object")throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=c,this.comments=h||{},this.valuesOptions=o,this.reserved=void 0,u)for(var m=Object.keys(u),y=0;y<m.length;++y)typeof u[m[y]]=="number"&&(this.valuesById[this.values[m[y]]=u[m[y]]]=m[y])}return a.fromJSON=function(u,l){var c=new a(u,l.values,l.options,l.comment,l.comments);return c.reserved=l.reserved,c},a.prototype.toJSON=function(u){var l=u?!!u.keepComments:!1;return r.toObject(["options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",l?this.comment:void 0,"comments",l?this.comments:void 0])},a.prototype.add=function(u,l,c,h){if(!r.isString(u))throw TypeError("name must be a string");if(!r.isInteger(l))throw TypeError("id must be an integer");if(this.values[u]!==void 0)throw Error("duplicate name '"+u+"' in "+this);if(this.isReservedId(l))throw Error("id "+l+" is reserved in "+this);if(this.isReservedName(u))throw Error("name '"+u+"' is reserved in "+this);if(this.valuesById[l]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error("duplicate id "+l+" in "+this);this.values[u]=l}else this.valuesById[this.values[u]=l]=u;return h&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[u]=h||null),this.comments[u]=c||null,this},a.prototype.remove=function(u){if(!r.isString(u))throw TypeError("name must be a string");var l=this.values[u];if(l==null)throw Error("name '"+u+"' does not exist in "+this);return delete this.valuesById[l],delete this.values[u],delete this.comments[u],this.valuesOptions&&delete this.valuesOptions[u],this},a.prototype.isReservedId=function(u){return i.isReservedId(this.reserved,u)},a.prototype.isReservedName=function(u){return i.isReservedName(this.reserved,u)},_enum}var encoder_1,hasRequiredEncoder;function requireEncoder(){if(hasRequiredEncoder)return encoder_1;hasRequiredEncoder=1,encoder_1=d;var s=require_enum(),i=requireTypes(),r=requireUtil();function a(u,l,c,h){return l.resolvedType.group?u("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",c,h,(l.id<<3|3)>>>0,(l.id<<3|4)>>>0):u("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",c,h,(l.id<<3|2)>>>0)}function d(u){for(var l=r.codegen(["m","w"],u.name+"$encode")("if(!w)")("w=Writer.create()"),c,h,o=u.fieldsArray.slice().sort(r.compareFieldsById),c=0;c<o.length;++c){var m=o[c].resolve(),y=u._fieldsArray.indexOf(m),g=m.resolvedType instanceof s?"int32":m.type,p=i.basic[g];h="m"+r.safeProp(m.name),m.map?(l("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",h,m.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",h)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(m.id<<3|2)>>>0,8|i.mapKey[m.keyType],m.keyType),p===void 0?l("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",y,h):l(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|p,g,h),l("}")("}")):m.repeated?(l("if(%s!=null&&%s.length){",h,h),m.packed&&i.packed[g]!==void 0?l("w.uint32(%i).fork()",(m.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",h)("w.%s(%s[i])",g,h)("w.ldelim()"):(l("for(var i=0;i<%s.length;++i)",h),p===void 0?a(l,m,y,h+"[i]"):l("w.uint32(%i).%s(%s[i])",(m.id<<3|p)>>>0,g,h)),l("}")):(m.optional&&l("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",h,m.name),p===void 0?a(l,m,y,h):l("w.uint32(%i).%s(%s)",(m.id<<3|p)>>>0,g,h))}return l("return w")}return encoder_1}var protobuf$1=indexLight.exports=indexMinimal;protobuf$1.build="light";function load(s,i,r){return typeof i=="function"?(r=i,i=new protobuf$1.Root):i||(i=new protobuf$1.Root),i.load(s,r)}protobuf$1.load=load;function loadSync(s,i){return i||(i=new protobuf$1.Root),i.loadSync(s)}protobuf$1.loadSync=loadSync;protobuf$1.encoder=requireEncoder();protobuf$1.decoder=requireDecoder();protobuf$1.verifier=requireVerifier();protobuf$1.converter=requireConverter();protobuf$1.ReflectionObject=requireObject();protobuf$1.Namespace=requireNamespace();protobuf$1.Root=requireRoot();protobuf$1.Enum=require_enum();protobuf$1.Type=requireType();protobuf$1.Field=requireField();protobuf$1.OneOf=requireOneof();protobuf$1.MapField=requireMapfield();protobuf$1.Service=requireService();protobuf$1.Method=requireMethod();protobuf$1.Message=message;protobuf$1.wrappers=wrappers;protobuf$1.types=requireTypes();protobuf$1.util=requireUtil();protobuf$1.ReflectionObject._configure(protobuf$1.Root);protobuf$1.Namespace._configure(protobuf$1.Type,protobuf$1.Service,protobuf$1.Enum);protobuf$1.Root._configure(protobuf$1.Type);protobuf$1.Field._configure(protobuf$1.Type);var indexLightExports=indexLight.exports,tokenize_1=tokenize$1,delimRe=/[\s{}=;:[\],'"()<>]/g,stringDoubleRe=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,stringSingleRe=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,setCommentRe=/^ *[*/]+ */,setCommentAltRe=/^\s*\*?\/*/,setCommentSplitRe=/\n/g,whitespaceRe=/\s/,unescapeRe=/\\(.?)/g,unescapeMap={0:"\0",r:"\r",n:`
5
+ `,t:" "};function unescape(s){return s.replace(unescapeRe,function(i,r){switch(r){case"\\":case"":return r;default:return unescapeMap[r]||""}})}tokenize$1.unescape=unescape;function tokenize$1(s,i){s=s.toString();var r=0,a=s.length,d=1,u=0,l={},c=[],h=null;function o(O){return Error("illegal "+O+" (line "+d+")")}function m(){var O=h==="'"?stringSingleRe:stringDoubleRe;O.lastIndex=r-1;var E=O.exec(s);if(!E)throw o("string");return r=O.lastIndex,w(h),h=null,unescape(E[1])}function y(O){return s.charAt(O)}function g(O,E,C){var R={type:s.charAt(O++),lineEmpty:!1,leading:C},P;i?P=2:P=3;var k=O-P,A;do if(--k<0||(A=s.charAt(k))===`
6
6
  `){R.lineEmpty=!0;break}while(A===" "||A===" ");for(var I=s.substring(O,E).split(setCommentSplitRe),$=0;$<I.length;++$)I[$]=I[$].replace(i?setCommentAltRe:setCommentRe,"").trim();R.text=I.join(`
7
- `).trim(),l[d]=R,u=d}function p(O){var E=v(O),C=s.substring(O,E),R=/^\s*\/\//.test(C);return R}function v(O){for(var E=O;E<o&&y(E)!==`
8
- `;)E++;return E}function b(){if(c.length>0)return c.shift();if(h)return m();var O,E,C,R,P,k=r===0;do{if(r===o)return null;for(O=!1;whitespaceRe.test(C=y(r));)if(C===`
9
- `&&(k=!0,++d),++r===o)return null;if(y(r)==="/"){if(++r===o)throw a("comment");if(y(r)==="/")if(i){if(R=r,P=!1,p(r-1)){P=!0;do if(r=v(r),r===o||(r++,!k))break;while(p(r))}else r=Math.min(o,v(r)+1);P&&(g(R,r,k),k=!0),d++,O=!0}else{for(P=y(R=r+1)==="/";y(++r)!==`
10
- `;)if(r===o)return null;++r,P&&(g(R,r-1,k),k=!0),++d,O=!0}else if((C=y(r))==="*"){R=r+1,P=i||y(R)==="*";do{if(C===`
11
- `&&++d,++r===o)throw a("comment");E=C,C=y(r)}while(E!=="*"||C!=="/");++r,P&&(g(R,r-2,k),k=!0),O=!0}else return"/"}}while(O);var A=r;delimRe.lastIndex=0;var I=delimRe.test(y(A++));if(!I)for(;A<o&&!delimRe.test(y(A));)++A;var $=s.substring(r,r=A);return($==='"'||$==="'")&&(h=$),$}function w(O){c.push(O)}function x(){if(!c.length){var O=b();if(O===null)return null;w(O)}return c[0]}function _(O,E){var C=x(),R=C===O;if(R)return b(),!0;if(!E)throw a("token '"+C+"', '"+O+"' expected");return!1}function T(O){var E=null,C;return O===void 0?(C=l[d-1],delete l[d-1],C&&(i||C.type==="*"||C.lineEmpty)&&(E=C.leading?C.text:null)):(u<O&&x(),C=l[O],delete l[O],C&&!C.lineEmpty&&(i||C.type==="/")&&(E=C.leading?null:C.text)),E}return Object.defineProperty({next:b,peek:x,push:w,skip:_,cmnt:T},"line",{get:function(){return d}})}var parse_1=parse;parse.filename=null;parse.defaults={keepCase:!1};var tokenize=tokenize_1,Root=requireRoot(),Type=requireType(),Field=requireField(),MapField=requireMapfield(),OneOf=requireOneof(),Enum=require_enum(),Service=requireService(),Method=requireMethod(),types=requireTypes(),util=requireUtil(),base10Re=/^[1-9][0-9]*$/,base10NegRe=/^-?[1-9][0-9]*$/,base16Re=/^0[x][0-9a-fA-F]+$/,base16NegRe=/^-?0[x][0-9a-fA-F]+$/,base8Re=/^0[0-7]+$/,base8NegRe=/^-?0[0-7]+$/,numberRe=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,nameRe=/^[a-zA-Z_][a-zA-Z_0-9]*$/,typeRefRe=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,fqTypeRefRe=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function parse(s,i,r){i instanceof Root||(r=i,i=new Root),r||(r=parse.defaults);var o=r.preferTrailingComment||!1,d=tokenize(s,r.alternateCommentMode||!1),u=d.next,l=d.push,c=d.peek,h=d.skip,a=d.cmnt,m=!0,y,g,p,v,b=!1,w=i,x=r.keepCase?function(S){return S}:util.camelCase;function _(S,D,N){var B=parse.filename;return N||(parse.filename=null),Error("illegal "+(D||"token")+" '"+S+"' ("+(B?B+", ":"")+"line "+d.line+")")}function T(){var S=[],D;do{if((D=u())!=='"'&&D!=="'")throw _(D);S.push(u()),h(D),D=c()}while(D==='"'||D==="'");return S.join("")}function O(){var S=u();switch(S){case"'":case'"':return l(S),T();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return C(S,!0)}catch{if(typeRefRe.test(S))return S;throw _(S,"value")}}function E(S,D){var N,B;do D&&((N=c())==='"'||N==="'")?S.push(T()):S.push([B=R(u()),h("to",!0)?R(u()):B]);while(h(",",!0));var M={options:void 0};M.setOption=function(L,z){this.options===void 0&&(this.options={}),this.options[L]=z},$(M,function(z){if(z==="option")Z(M,z),h(";");else throw _(z)},function(){Y(M)})}function C(S,D){var N=1;switch(S.charAt(0)==="-"&&(N=-1,S=S.substring(1)),S){case"inf":case"INF":case"Inf":return N*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(base10Re.test(S))return N*parseInt(S,10);if(base16Re.test(S))return N*parseInt(S,16);if(base8Re.test(S))return N*parseInt(S,8);if(numberRe.test(S))return N*parseFloat(S);throw _(S,"number",D)}function R(S,D){switch(S){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!D&&S.charAt(0)==="-")throw _(S,"id");if(base10NegRe.test(S))return parseInt(S,10);if(base16NegRe.test(S))return parseInt(S,16);if(base8NegRe.test(S))return parseInt(S,8);throw _(S,"id")}function P(){if(y!==void 0)throw _("package");if(y=u(),!typeRefRe.test(y))throw _(y,"name");w=w.define(y),h(";")}function k(){var S=c(),D;switch(S){case"weak":D=p||(p=[]),u();break;case"public":u();default:D=g||(g=[]);break}S=T(),h(";"),D.push(S)}function A(){if(h("="),v=T(),b=v==="proto3",!b&&v!=="proto2")throw _(v,"syntax");i.setOption("syntax",v),h(";")}function I(S,D){switch(D){case"option":return Z(S,D),h(";"),!0;case"message":return F(S,D),!0;case"enum":return K(S,D),!0;case"service":return se(S,D),!0;case"extend":return oe(S,D),!0}return!1}function $(S,D,N){var B=d.line;if(S&&(typeof S.comment!="string"&&(S.comment=a()),S.filename=parse.filename),h("{",!0)){for(var M;(M=u())!=="}";)D(M);h(";",!0)}else N&&N(),h(";"),S&&(typeof S.comment!="string"||o)&&(S.comment=a(B)||S.comment)}function F(S,D){if(!nameRe.test(D=u()))throw _(D,"type name");var N=new Type(D);$(N,function(M){if(!I(N,M))switch(M){case"map":J(N);break;case"required":case"repeated":q(N,M);break;case"optional":b?q(N,"proto3_optional"):q(N,"optional");break;case"oneof":U(N,M);break;case"extensions":E(N.extensions||(N.extensions=[]));break;case"reserved":E(N.reserved||(N.reserved=[]),!0);break;default:if(!b||!typeRefRe.test(M))throw _(M);l(M),q(N,"optional");break}}),S.add(N)}function q(S,D,N){var B=u();if(B==="group"){V(S,D);return}for(;B.endsWith(".")||c().startsWith(".");)B+=u();if(!typeRefRe.test(B))throw _(B,"type");var M=u();if(!nameRe.test(M))throw _(M,"name");M=x(M),h("=");var L=new Field(M,R(u()),B,D,N);if($(L,function(W){if(W==="option")Z(L,W),h(";");else throw _(W)},function(){Y(L)}),D==="proto3_optional"){var z=new OneOf("_"+M);L.setOption("proto3_optional",!0),z.add(L),S.add(z)}else S.add(L);!b&&L.repeated&&(types.packed[B]!==void 0||types.basic[B]===void 0)&&L.setOption("packed",!1,!0)}function V(S,D){var N=u();if(!nameRe.test(N))throw _(N,"name");var B=util.lcFirst(N);N===B&&(N=util.ucFirst(N)),h("=");var M=R(u()),L=new Type(N);L.group=!0;var z=new Field(B,M,N,D);z.filename=parse.filename,$(L,function(W){switch(W){case"option":Z(L,W),h(";");break;case"required":case"repeated":q(L,W);break;case"optional":b?q(L,"proto3_optional"):q(L,"optional");break;case"message":F(L,W);break;case"enum":K(L,W);break;default:throw _(W)}}),S.add(L).add(z)}function J(S){h("<");var D=u();if(types.mapKey[D]===void 0)throw _(D,"type");h(",");var N=u();if(!typeRefRe.test(N))throw _(N,"type");h(">");var B=u();if(!nameRe.test(B))throw _(B,"name");h("=");var M=new MapField(x(B),R(u()),D,N);$(M,function(z){if(z==="option")Z(M,z),h(";");else throw _(z)},function(){Y(M)}),S.add(M)}function U(S,D){if(!nameRe.test(D=u()))throw _(D,"name");var N=new OneOf(x(D));$(N,function(M){M==="option"?(Z(N,M),h(";")):(l(M),q(N,"optional"))}),S.add(N)}function K(S,D){if(!nameRe.test(D=u()))throw _(D,"name");var N=new Enum(D);$(N,function(M){switch(M){case"option":Z(N,M),h(";");break;case"reserved":E(N.reserved||(N.reserved=[]),!0);break;default:ie(N,M)}}),S.add(N)}function ie(S,D){if(!nameRe.test(D))throw _(D,"name");h("=");var N=R(u(),!0),B={options:void 0};B.setOption=function(M,L){this.options===void 0&&(this.options={}),this.options[M]=L},$(B,function(L){if(L==="option")Z(B,L),h(";");else throw _(L)},function(){Y(B)}),S.add(D,N,B.comment,B.options)}function Z(S,D){var N=h("(",!0);if(!typeRefRe.test(D=u()))throw _(D,"name");var B=D,M=B,L;N&&(h(")"),B="("+B+")",M=B,D=c(),fqTypeRefRe.test(D)&&(L=D.slice(1),B+=D,u())),h("=");var z=re(S,B);ne(S,M,z,L)}function re(S,D){if(h("{",!0)){for(var N={};!h("}",!0);){if(!nameRe.test(H=u()))throw _(H,"name");if(H===null)throw _(H,"end of input");var B,M=H;if(h(":",!0),c()==="{")B=re(S,D+"."+H);else if(c()==="["){B=[];var L;if(h("[",!0)){do L=O(),B.push(L);while(h(",",!0));h("]"),typeof L<"u"&&ee(S,D+"."+H,L)}}else B=O(),ee(S,D+"."+H,B);var z=N[M];z&&(B=[].concat(z).concat(B)),N[M]=B,h(",",!0),h(";",!0)}return N}var G=O();return ee(S,D,G),G}function ee(S,D,N){S.setOption&&S.setOption(D,N)}function ne(S,D,N,B){S.setParsedOption&&S.setParsedOption(D,N,B)}function Y(S){if(h("[",!0)){do Z(S,"option");while(h(",",!0));h("]")}return S}function se(S,D){if(!nameRe.test(D=u()))throw _(D,"service name");var N=new Service(D);$(N,function(M){if(!I(N,M))if(M==="rpc")ae(N,M);else throw _(M)}),S.add(N)}function ae(S,D){var N=a(),B=D;if(!nameRe.test(D=u()))throw _(D,"name");var M=D,L,z,G,W;if(h("("),h("stream",!0)&&(z=!0),!typeRefRe.test(D=u())||(L=D,h(")"),h("returns"),h("("),h("stream",!0)&&(W=!0),!typeRefRe.test(D=u())))throw _(D);G=D,h(")");var Q=new Method(M,B,L,G,z,W);Q.comment=N,$(Q,function(te){if(te==="option")Z(Q,te),h(";");else throw _(te)}),S.add(Q)}function oe(S,D){if(!typeRefRe.test(D=u()))throw _(D,"reference");var N=D;$(null,function(M){switch(M){case"required":case"repeated":q(S,M,N);break;case"optional":b?q(S,"proto3_optional",N):q(S,"optional",N);break;default:if(!b||!typeRefRe.test(M))throw _(M);l(M),q(S,"optional",N);break}})}for(var H;(H=u())!==null;)switch(H){case"package":if(!m)throw _(H);P();break;case"import":if(!m)throw _(H);k();break;case"syntax":if(!m)throw _(H);A();break;case"option":Z(w,H),h(";");break;default:if(I(w,H)){m=!1;continue}throw _(H)}return parse.filename=null,{package:y,imports:g,weakImports:p,syntax:v,root:i}}var common_1=common,commonRe=/\/|\./;function common(s,i){commonRe.test(s)||(s="google/protobuf/"+s+".proto",i={nested:{google:{nested:{protobuf:{nested:i}}}}}),common[s]=i}common("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var timeType;common("duration",{Duration:timeType={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});common("timestamp",{Timestamp:timeType});common("empty",{Empty:{fields:{}}});common("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});common("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});common("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});common.get=function s(i){return common[i]||null};var protobuf=src.exports=indexLightExports;protobuf.build="full";protobuf.tokenize=tokenize_1;protobuf.parse=parse_1;protobuf.common=common_1;protobuf.Root._configure(protobuf.Type,protobuf.parse,protobuf.common);var srcExports=src.exports,protobufjs=srcExports;function loadProto(s){return protobufjs.parse(s)}loadProto("option optimize_for = LITE_RUNTIME;package GEOPOI;enum enumGeometryType {ePoint = 0;eMultiLineString = 1;ePolygon = 2;} ;message PBPOI{required uint64 OID = 1;required string Name =2;repeated double Coordinates =3 [packed=true];required enumGeometryType GeometryType = 4;optional int32 Interate = 5;optional int32 SymbolID = 10 [default = 0];optional double DisplayHeight = 11 [default = 32];optional uint32 ShiningColor=12 [default =0];optional uint32 FontNameIndex=13 [default =0];optional int32 FontSize=14 [default =18];optional uint32 FontColor=15 [default =0];};message StringTable {repeated string s = 1;}message PBPOITile{required int64 Version = 1;required int64 TileKey = 2;required StringTable StringTable = 3;repeated PBPOI POIS = 4;};").root.lookup("GEOPOI.PBPOITile");loadProto("option optimize_for = LITE_RUNTIME;package GEOPOI;enum enumGeometryType {ePoint = 0;eMultiLineString = 1;ePolygon = 2;};enum enumZCoordType {eCloseGround = 0;eCloseSeaSurface = 1;eRelativelyGround = 2;eAbsolute = 3;};message PBPOI{required uint64 OID = 1;required string Name =2;repeated double Coordinates =3 [packed=true];required enumGeometryType GeometryType = 4;optional int32 Interate = 5;optional int32 SymbolID = 10 [default = 0];optional double DisplayHeight = 11 [default = 32];optional uint32 ShiningColor=12 [default =0];optional uint32 FontNameIndex=13 [default =0];optional int32 FontSize=14 [default =18];optional uint32 FontColor=15 [default =0];optional enumZCoordType ZCoordType = 16 [default = eAbsolute];};message StringTable {repeated string s = 1;}message PBPOITile{required int64 Version = 1;required int64 TileKey = 2;required StringTable StringTable = 3;repeated PBPOI POIS = 4;};").root.lookup("GEOPOI.PBPOITile");loadProto("option optimize_for = LITE_RUNTIME;package GEOPOI;enum enumGeometryType {ePoint = 0;eMultiLineString = 1;ePolygon = 2;};enum enumZCoordType {eCloseGround = 0;eCloseSeaSurface = 1;eRelativelyGround = 2;eAbsolute = 3;};message PBPOI{required uint64 OID = 1;required string Name =2;repeated double Coordinates =3 [packed=true];required enumGeometryType GeometryType = 4;optional int32 Priority = 5;repeated int32 Interates =6 [packed=true];optional int32 SymbolID = 10 [default = 0];optional double DisplayHeight = 11 [default = 32];optional uint32 ShiningColor=12 [default =0];optional uint32 FontNameIndex=13 [default =0];optional int32 FontSize=14 [default =18];optional uint32 FontColor=15 [default =0];optional enumZCoordType ZCoordType = 16 [default = eAbsolute];optional int32 FontStyle=17;optional int32 ShiningSize=18;};message StringTable {repeated string s = 1;}message PBPOITile{required int64 Version = 1;required int64 TileKey = 2;required StringTable StringTable = 3;repeated PBPOI POIS = 4;};").root.lookup("GEOPOI.PBPOITile");Cesium.Color.WHITE,Cesium.Color.BLACK,Cesium.LabelStyle.FILL_AND_OUTLINE,Cesium.Color.RED,new Cesium.Cartesian2(10,10),Cesium.HorizontalOrigin.CENTER,Cesium.VerticalOrigin.TOP,Cesium.Cartesian3.ZERO,new Cesium.Cartesian2(0,8);Cesium.HorizontalOrigin.CENTER,Cesium.VerticalOrigin.CENTER,Cesium.Cartesian3.ZERO,Cesium.Cartesian2.ZERO,Cesium.Cartesian3.ZERO,Cesium.Color.WHITE;var index={GeoTerrainProvider};function invertToCanvas(s){var c;const i=s.width,r=s.height,o=document.createElement("canvas");o.width=i,o.height=r;const d=o.getContext("2d");d.translate(0,r),d.scale(1,-1),d.drawImage(s,0,0);const u=d.getImageData(0,0,i,r),l=u.data;for(let h=0;h<l.length;h+=4)l[h]=255-l[h],l[h+1]=255-l[h+1],l[h+2]=255-l[h+2];return d.putImageData(u,0,0),"close"in s&&((c=s.close)==null||c.call(s)),o}class CustomWebMapTileServiceImageryProvider extends Cesium__namespace.WebMapTileServiceImageryProvider{constructor(i){super(i),this.options=i}requestImage(i,r,o,d){this.options.subdomains&&d&&d.url&&(d.url=d.url.replace("{s}",this.pickSubdomain(i,r,o,this.options.subdomains)));const u=super.requestImage(i,r,o,d);return u&&u.then(l=>{var c,h;return((h=(c=this.options).requestInterceptor)==null?void 0:h.call(c,l))??l})}pickSubdomain(i,r,o,d){const u=Math.abs(i*73856093^r*19349663^o*83492791)%d.length;return d[u]}}function createTdtProvider(s,i){const{token:r,...o}=i;return new CustomWebMapTileServiceImageryProvider({url:`https://t{s}.tianditu.gov.cn/${s}_w/wmts?tk=${r}`,subdomains:["0","1","2","3","4","5","6","7"],layer:s,style:"default",format:"tiles",tileMatrixSetID:"w",maximumLevel:18,credit:new Cesium__namespace.Credit("TianDiTu"),...o})}function createTdtTerrain(s){const i=["0","1","2","3","4","5","6","7"];return new index.GeoTerrainProvider({url:"https://t{s}.tianditu.gov.cn/mapservice/swdx?T=elv_c&x={x}&y={y}&l={z}&tk={token}",subdomains:i,token:s.token})}var freeGlobal=typeof global=="object"&&global&&global.Object===Object&&global,freeSelf=typeof self=="object"&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),Symbol$1=root.Symbol,objectProto$8=Object.prototype,hasOwnProperty$6=objectProto$8.hasOwnProperty,nativeObjectToString$1=objectProto$8.toString,symToStringTag$1=Symbol$1?Symbol$1.toStringTag:void 0;function getRawTag(s){var i=hasOwnProperty$6.call(s,symToStringTag$1),r=s[symToStringTag$1];try{s[symToStringTag$1]=void 0;var o=!0}catch{}var d=nativeObjectToString$1.call(s);return o&&(i?s[symToStringTag$1]=r:delete s[symToStringTag$1]),d}var objectProto$7=Object.prototype,nativeObjectToString=objectProto$7.toString;function objectToString(s){return nativeObjectToString.call(s)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$1?Symbol$1.toStringTag:void 0;function baseGetTag(s){return s==null?s===void 0?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(s)?getRawTag(s):objectToString(s)}function isObjectLike(s){return s!=null&&typeof s=="object"}var symbolTag="[object Symbol]";function isSymbol(s){return typeof s=="symbol"||isObjectLike(s)&&baseGetTag(s)==symbolTag}var isArray=Array.isArray,reWhitespace=/\s/;function trimmedEndIndex(s){for(var i=s.length;i--&&reWhitespace.test(s.charAt(i)););return i}var reTrimStart=/^\s+/;function baseTrim(s){return s&&s.slice(0,trimmedEndIndex(s)+1).replace(reTrimStart,"")}function isObject(s){var i=typeof s;return s!=null&&(i=="object"||i=="function")}var NAN=NaN,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;function toNumber(s){if(typeof s=="number")return s;if(isSymbol(s))return NAN;if(isObject(s)){var i=typeof s.valueOf=="function"?s.valueOf():s;s=isObject(i)?i+"":i}if(typeof s!="string")return s===0?s:+s;s=baseTrim(s);var r=reIsBinary.test(s);return r||reIsOctal.test(s)?freeParseInt(s.slice(2),r?2:8):reIsBadHex.test(s)?NAN:+s}function identity(s){return s}var asyncTag="[object AsyncFunction]",funcTag$1="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(s){if(!isObject(s))return!1;var i=baseGetTag(s);return i==funcTag$1||i==genTag||i==asyncTag||i==proxyTag}var coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var s=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}();function isMasked(s){return!!maskSrcKey&&maskSrcKey in s}var funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource(s){if(s!=null){try{return funcToString$1.call(s)}catch{}try{return s+""}catch{}}return""}var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$6=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$5=objectProto$6.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$5).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(s){if(!isObject(s)||isMasked(s))return!1;var i=isFunction(s)?reIsNative:reIsHostCtor;return i.test(toSource(s))}function getValue(s,i){return s==null?void 0:s[i]}function getNative(s,i){var r=getValue(s,i);return baseIsNative(r)?r:void 0}function apply(s,i,r){switch(r.length){case 0:return s.call(i);case 1:return s.call(i,r[0]);case 2:return s.call(i,r[0],r[1]);case 3:return s.call(i,r[0],r[1],r[2])}return s.apply(i,r)}var HOT_COUNT=800,HOT_SPAN=16,nativeNow=Date.now;function shortOut(s){var i=0,r=0;return function(){var o=nativeNow(),d=HOT_SPAN-(o-r);if(r=o,d>0){if(++i>=HOT_COUNT)return arguments[0]}else i=0;return s.apply(void 0,arguments)}}function constant(s){return function(){return s}}var defineProperty=function(){try{var s=getNative(Object,"defineProperty");return s({},"",{}),s}catch{}}(),baseSetToString=defineProperty?function(s,i){return defineProperty(s,"toString",{configurable:!0,enumerable:!1,value:constant(i),writable:!0})}:identity,setToString=shortOut(baseSetToString),MAX_SAFE_INTEGER$1=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(s,i){var r=typeof s;return i=i??MAX_SAFE_INTEGER$1,!!i&&(r=="number"||r!="symbol"&&reIsUint.test(s))&&s>-1&&s%1==0&&s<i}function eq(s,i){return s===i||s!==s&&i!==i}var nativeMax$1=Math.max;function overRest(s,i,r){return i=nativeMax$1(i===void 0?s.length-1:i,0),function(){for(var o=arguments,d=-1,u=nativeMax$1(o.length-i,0),l=Array(u);++d<u;)l[d]=o[i+d];d=-1;for(var c=Array(i+1);++d<i;)c[d]=o[d];return c[i]=r(l),apply(s,this,c)}}function baseRest(s,i){return setToString(overRest(s,i,identity),s+"")}var MAX_SAFE_INTEGER=9007199254740991;function isLength(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=MAX_SAFE_INTEGER}function isArrayLike(s){return s!=null&&isLength(s.length)&&!isFunction(s)}function isIterateeCall(s,i,r){if(!isObject(r))return!1;var o=typeof i;return(o=="number"?isArrayLike(r)&&isIndex(i,r.length):o=="string"&&i in r)?eq(r[i],s):!1}var objectProto$5=Object.prototype;function isPrototype(s){var i=s&&s.constructor,r=typeof i=="function"&&i.prototype||objectProto$5;return s===r}function baseTimes(s,i){for(var r=-1,o=Array(s);++r<s;)o[r]=i(r);return o}var argsTag$1="[object Arguments]";function baseIsArguments(s){return isObjectLike(s)&&baseGetTag(s)==argsTag$1}var objectProto$4=Object.prototype,hasOwnProperty$4=objectProto$4.hasOwnProperty,propertyIsEnumerable=objectProto$4.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(s){return isObjectLike(s)&&hasOwnProperty$4.call(s,"callee")&&!propertyIsEnumerable.call(s,"callee")};function stubFalse(){return!1}var freeExports$1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports$1=freeModule$1&&freeModule$1.exports===freeExports$1,Buffer=moduleExports$1?root.Buffer:void 0,nativeIsBuffer=Buffer?Buffer.isBuffer:void 0,isBuffer=nativeIsBuffer||stubFalse,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0;typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;function baseIsTypedArray(s){return isObjectLike(s)&&isLength(s.length)&&!!typedArrayTags[baseGetTag(s)]}function baseUnary(s){return function(i){return s(i)}}var freeExports=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{var s=freeModule&&freeModule.require&&freeModule.require("util").types;return s||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch{}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;function arrayLikeKeys(s,i){var r=isArray(s),o=!r&&isArguments(s),d=!r&&!o&&isBuffer(s),u=!r&&!o&&!d&&isTypedArray(s),l=r||o||d||u,c=l?baseTimes(s.length,String):[],h=c.length;for(var a in s)l&&(a=="length"||d&&(a=="offset"||a=="parent")||u&&(a=="buffer"||a=="byteLength"||a=="byteOffset")||isIndex(a,h))||c.push(a);return c}function nativeKeysIn(s){var i=[];if(s!=null)for(var r in Object(s))i.push(r);return i}var objectProto$3=Object.prototype,hasOwnProperty$3=objectProto$3.hasOwnProperty;function baseKeysIn(s){if(!isObject(s))return nativeKeysIn(s);var i=isPrototype(s),r=[];for(var o in s)o=="constructor"&&(i||!hasOwnProperty$3.call(s,o))||r.push(o);return r}function keysIn(s){return isArrayLike(s)?arrayLikeKeys(s):baseKeysIn(s)}var nativeCreate=getNative(Object,"create");function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(s){var i=this.has(s)&&delete this.__data__[s];return this.size-=i?1:0,i}var HASH_UNDEFINED$1="__lodash_hash_undefined__",objectProto$2=Object.prototype,hasOwnProperty$2=objectProto$2.hasOwnProperty;function hashGet(s){var i=this.__data__;if(nativeCreate){var r=i[s];return r===HASH_UNDEFINED$1?void 0:r}return hasOwnProperty$2.call(i,s)?i[s]:void 0}var objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function hashHas(s){var i=this.__data__;return nativeCreate?i[s]!==void 0:hasOwnProperty$1.call(i,s)}var HASH_UNDEFINED="__lodash_hash_undefined__";function hashSet(s,i){var r=this.__data__;return this.size+=this.has(s)?0:1,r[s]=nativeCreate&&i===void 0?HASH_UNDEFINED:i,this}function Hash(s){var i=-1,r=s==null?0:s.length;for(this.clear();++i<r;){var o=s[i];this.set(o[0],o[1])}}Hash.prototype.clear=hashClear;Hash.prototype.delete=hashDelete;Hash.prototype.get=hashGet;Hash.prototype.has=hashHas;Hash.prototype.set=hashSet;function listCacheClear(){this.__data__=[],this.size=0}function assocIndexOf(s,i){for(var r=s.length;r--;)if(eq(s[r][0],i))return r;return-1}var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(s){var i=this.__data__,r=assocIndexOf(i,s);if(r<0)return!1;var o=i.length-1;return r==o?i.pop():splice.call(i,r,1),--this.size,!0}function listCacheGet(s){var i=this.__data__,r=assocIndexOf(i,s);return r<0?void 0:i[r][1]}function listCacheHas(s){return assocIndexOf(this.__data__,s)>-1}function listCacheSet(s,i){var r=this.__data__,o=assocIndexOf(r,s);return o<0?(++this.size,r.push([s,i])):r[o][1]=i,this}function ListCache(s){var i=-1,r=s==null?0:s.length;for(this.clear();++i<r;){var o=s[i];this.set(o[0],o[1])}}ListCache.prototype.clear=listCacheClear;ListCache.prototype.delete=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;var Map$1=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||ListCache),string:new Hash}}function isKeyable(s){var i=typeof s;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?s!=="__proto__":s===null}function getMapData(s,i){var r=s.__data__;return isKeyable(i)?r[typeof i=="string"?"string":"hash"]:r.map}function mapCacheDelete(s){var i=getMapData(this,s).delete(s);return this.size-=i?1:0,i}function mapCacheGet(s){return getMapData(this,s).get(s)}function mapCacheHas(s){return getMapData(this,s).has(s)}function mapCacheSet(s,i){var r=getMapData(this,s),o=r.size;return r.set(s,i),this.size+=r.size==o?0:1,this}function MapCache(s){var i=-1,r=s==null?0:s.length;for(this.clear();++i<r;){var o=s[i];this.set(o[0],o[1])}}MapCache.prototype.clear=mapCacheClear;MapCache.prototype.delete=mapCacheDelete;MapCache.prototype.get=mapCacheGet;MapCache.prototype.has=mapCacheHas;MapCache.prototype.set=mapCacheSet;var FUNC_ERROR_TEXT$1="Expected a function";function memoize(s,i){if(typeof s!="function"||i!=null&&typeof i!="function")throw new TypeError(FUNC_ERROR_TEXT$1);var r=function(){var o=arguments,d=i?i.apply(this,o):o[0],u=r.cache;if(u.has(d))return u.get(d);var l=s.apply(this,o);return r.cache=u.set(d,l)||u,l};return r.cache=new(memoize.Cache||MapCache),r}memoize.Cache=MapCache;var now=function(){return root.Date.now()},FUNC_ERROR_TEXT="Expected a function",nativeMax=Math.max,nativeMin=Math.min;function debounce(s,i,r){var o,d,u,l,c,h,a=0,m=!1,y=!1,g=!0;if(typeof s!="function")throw new TypeError(FUNC_ERROR_TEXT);i=toNumber(i)||0,isObject(r)&&(m=!!r.leading,y="maxWait"in r,u=y?nativeMax(toNumber(r.maxWait)||0,i):u,g="trailing"in r?!!r.trailing:g);function p(C){var R=o,P=d;return o=d=void 0,a=C,l=s.apply(P,R),l}function v(C){return a=C,c=setTimeout(x,i),m?p(C):l}function b(C){var R=C-h,P=C-a,k=i-R;return y?nativeMin(k,u-P):k}function w(C){var R=C-h,P=C-a;return h===void 0||R>=i||R<0||y&&P>=u}function x(){var C=now();if(w(C))return _(C);c=setTimeout(x,b(C))}function _(C){return c=void 0,g&&o?p(C):(o=d=void 0,l)}function T(){c!==void 0&&clearTimeout(c),a=0,o=h=d=c=void 0}function O(){return c===void 0?l:_(now())}function E(){var C=now(),R=w(C);if(o=arguments,d=this,h=C,R){if(c===void 0)return v(h);if(y)return clearTimeout(c),c=setTimeout(x,i),p(h)}return c===void 0&&(c=setTimeout(x,i)),l}return E.cancel=T,E.flush=O,E}var objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,defaults=baseRest(function(s,i){s=Object(s);var r=-1,o=i.length,d=o>2?i[2]:void 0;for(d&&isIterateeCall(i[0],i[1],d)&&(o=1);++r<o;)for(var u=i[r],l=keysIn(u),c=-1,h=l.length;++c<h;){var a=l[c],m=s[a];(m===void 0||eq(m,objectProto[a])&&!hasOwnProperty.call(s,a))&&(s[a]=u[a])}return s});function getDefaultExportFromCjs(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var eventemitter3={exports:{}},hasRequiredEventemitter3;function requireEventemitter3(){return hasRequiredEventemitter3||(hasRequiredEventemitter3=1,function(s){var i=Object.prototype.hasOwnProperty,r="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(r=!1));function d(h,a,m){this.fn=h,this.context=a,this.once=m||!1}function u(h,a,m,y,g){if(typeof m!="function")throw new TypeError("The listener must be a function");var p=new d(m,y||h,g),v=r?r+a:a;return h._events[v]?h._events[v].fn?h._events[v]=[h._events[v],p]:h._events[v].push(p):(h._events[v]=p,h._eventsCount++),h}function l(h,a){--h._eventsCount===0?h._events=new o:delete h._events[a]}function c(){this._events=new o,this._eventsCount=0}c.prototype.eventNames=function(){var a=[],m,y;if(this._eventsCount===0)return a;for(y in m=this._events)i.call(m,y)&&a.push(r?y.slice(1):y);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(m)):a},c.prototype.listeners=function(a){var m=r?r+a:a,y=this._events[m];if(!y)return[];if(y.fn)return[y.fn];for(var g=0,p=y.length,v=new Array(p);g<p;g++)v[g]=y[g].fn;return v},c.prototype.listenerCount=function(a){var m=r?r+a:a,y=this._events[m];return y?y.fn?1:y.length:0},c.prototype.emit=function(a,m,y,g,p,v){var b=r?r+a:a;if(!this._events[b])return!1;var w=this._events[b],x=arguments.length,_,T;if(w.fn){switch(w.once&&this.removeListener(a,w.fn,void 0,!0),x){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,m),!0;case 3:return w.fn.call(w.context,m,y),!0;case 4:return w.fn.call(w.context,m,y,g),!0;case 5:return w.fn.call(w.context,m,y,g,p),!0;case 6:return w.fn.call(w.context,m,y,g,p,v),!0}for(T=1,_=new Array(x-1);T<x;T++)_[T-1]=arguments[T];w.fn.apply(w.context,_)}else{var O=w.length,E;for(T=0;T<O;T++)switch(w[T].once&&this.removeListener(a,w[T].fn,void 0,!0),x){case 1:w[T].fn.call(w[T].context);break;case 2:w[T].fn.call(w[T].context,m);break;case 3:w[T].fn.call(w[T].context,m,y);break;case 4:w[T].fn.call(w[T].context,m,y,g);break;default:if(!_)for(E=1,_=new Array(x-1);E<x;E++)_[E-1]=arguments[E];w[T].fn.apply(w[T].context,_)}}return!0},c.prototype.on=function(a,m,y){return u(this,a,m,y,!1)},c.prototype.once=function(a,m,y){return u(this,a,m,y,!0)},c.prototype.removeListener=function(a,m,y,g){var p=r?r+a:a;if(!this._events[p])return this;if(!m)return l(this,p),this;var v=this._events[p];if(v.fn)v.fn===m&&(!g||v.once)&&(!y||v.context===y)&&l(this,p);else{for(var b=0,w=[],x=v.length;b<x;b++)(v[b].fn!==m||g&&!v[b].once||y&&v[b].context!==y)&&w.push(v[b]);w.length?this._events[p]=w.length===1?w[0]:w:l(this,p)}return this},c.prototype.removeAllListeners=function(a){var m;return a?(m=r?r+a:a,this._events[m]&&l(this,m)):(this._events=new o,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,s.exports=c}(eventemitter3)),eventemitter3.exports}var eventemitter3Exports=requireEventemitter3();const EventEmitter=getDefaultExportFromCjs(eventemitter3Exports);class WmsLayer{constructor(i,r,o,d=1/0){this.ctrl=i,this.key=r,this.layer=o,this.zIndex=d,this.ctrl.registerLayer(this)}show(i){this.ctrl.showLayer(i,this.key)}hide(i){this.ctrl.hideLayer(i,this.key)}}class WmsLayerController extends EventEmitter{constructor(r){super();j(this,"layerMap",new Map);j(this,"showLayers",Array());j(this,"imgLayer");j(this,"update",debounce(r=>{if(this.imgLayer&&r.imageryLayers.remove(this.imgLayer,!0),this.showLayers.length===0){this.imgLayer=void 0,this.destroyHandler();return}this.handler||this.hookClickEvent(r),this.imgLayer=new Cesium.ImageryLayer(new Cesium.WebMapServiceImageryProvider({...this.args,layers:this.showLayers.map(o=>this.layerMap.get(o).layer).join(",")})),this.imgLayer.show=!0,r.imageryLayers.add(this.imgLayer)},200));j(this,"handler");this.args=r,this.args.parameters=defaults(this.args.parameters,{service:"WMS",version:"1.1.1",request:"GetMap",format:"image/png",transparent:!0,maximumLevel:18,minimumLevel:3,width:256,height:256})}registerLayer(r){if(this.layerMap.has(r.key))throw new Error(`Layer with key 【${r.key}】 is already registered`);this.layerMap.set(r.key,r)}showLayer(r,o){if(!this.layerMap.has(o))throw new Error(`Layer with key 【${o}】 is not registered`);this.showLayers.push(o),this.showLayers.sort((d,u)=>{const l=this.layerMap.get(d).zIndex,c=this.layerMap.get(u).zIndex;return l-c}),this.update(r)}hideLayer(r,o){const d=this.showLayers.indexOf(o);d!==-1&&(this.showLayers.splice(d,1),this.update(r))}hookClickEvent(r){this.handler=new Cesium.ScreenSpaceEventHandler(r.scene.canvas),this.handler.setInputAction(async o=>{const d=r.scene,u=d.camera.getPickRay(o.position),l=await d.imageryLayers.pickImageryLayerFeatures(u,r.scene);this.emit("click",l)},Cesium.ScreenSpaceEventType.LEFT_CLICK)}destroyHandler(){this.handler&&(this.handler.destroy(),this.handler=void 0)}}const createShipIconUrl=memoize((s,i)=>{const r=`<?xml version="1.0" encoding="UTF-8"?>
7
+ `).trim(),l[d]=R,u=d}function p(O){var E=v(O),C=s.substring(O,E),R=/^\s*\/\//.test(C);return R}function v(O){for(var E=O;E<a&&y(E)!==`
8
+ `;)E++;return E}function b(){if(c.length>0)return c.shift();if(h)return m();var O,E,C,R,P,k=r===0;do{if(r===a)return null;for(O=!1;whitespaceRe.test(C=y(r));)if(C===`
9
+ `&&(k=!0,++d),++r===a)return null;if(y(r)==="/"){if(++r===a)throw o("comment");if(y(r)==="/")if(i){if(R=r,P=!1,p(r-1)){P=!0;do if(r=v(r),r===a||(r++,!k))break;while(p(r))}else r=Math.min(a,v(r)+1);P&&(g(R,r,k),k=!0),d++,O=!0}else{for(P=y(R=r+1)==="/";y(++r)!==`
10
+ `;)if(r===a)return null;++r,P&&(g(R,r-1,k),k=!0),++d,O=!0}else if((C=y(r))==="*"){R=r+1,P=i||y(R)==="*";do{if(C===`
11
+ `&&++d,++r===a)throw o("comment");E=C,C=y(r)}while(E!=="*"||C!=="/");++r,P&&(g(R,r-2,k),k=!0),O=!0}else return"/"}}while(O);var A=r;delimRe.lastIndex=0;var I=delimRe.test(y(A++));if(!I)for(;A<a&&!delimRe.test(y(A));)++A;var $=s.substring(r,r=A);return($==='"'||$==="'")&&(h=$),$}function w(O){c.push(O)}function x(){if(!c.length){var O=b();if(O===null)return null;w(O)}return c[0]}function _(O,E){var C=x(),R=C===O;if(R)return b(),!0;if(!E)throw o("token '"+C+"', '"+O+"' expected");return!1}function T(O){var E=null,C;return O===void 0?(C=l[d-1],delete l[d-1],C&&(i||C.type==="*"||C.lineEmpty)&&(E=C.leading?C.text:null)):(u<O&&x(),C=l[O],delete l[O],C&&!C.lineEmpty&&(i||C.type==="/")&&(E=C.leading?null:C.text)),E}return Object.defineProperty({next:b,peek:x,push:w,skip:_,cmnt:T},"line",{get:function(){return d}})}var parse_1=parse;parse.filename=null;parse.defaults={keepCase:!1};var tokenize=tokenize_1,Root=requireRoot(),Type=requireType(),Field=requireField(),MapField=requireMapfield(),OneOf=requireOneof(),Enum=require_enum(),Service=requireService(),Method=requireMethod(),types=requireTypes(),util=requireUtil(),base10Re=/^[1-9][0-9]*$/,base10NegRe=/^-?[1-9][0-9]*$/,base16Re=/^0[x][0-9a-fA-F]+$/,base16NegRe=/^-?0[x][0-9a-fA-F]+$/,base8Re=/^0[0-7]+$/,base8NegRe=/^-?0[0-7]+$/,numberRe=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,nameRe=/^[a-zA-Z_][a-zA-Z_0-9]*$/,typeRefRe=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,fqTypeRefRe=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function parse(s,i,r){i instanceof Root||(r=i,i=new Root),r||(r=parse.defaults);var a=r.preferTrailingComment||!1,d=tokenize(s,r.alternateCommentMode||!1),u=d.next,l=d.push,c=d.peek,h=d.skip,o=d.cmnt,m=!0,y,g,p,v,b=!1,w=i,x=r.keepCase?function(S){return S}:util.camelCase;function _(S,D,N){var B=parse.filename;return N||(parse.filename=null),Error("illegal "+(D||"token")+" '"+S+"' ("+(B?B+", ":"")+"line "+d.line+")")}function T(){var S=[],D;do{if((D=u())!=='"'&&D!=="'")throw _(D);S.push(u()),h(D),D=c()}while(D==='"'||D==="'");return S.join("")}function O(){var S=u();switch(S){case"'":case'"':return l(S),T();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return C(S,!0)}catch{if(typeRefRe.test(S))return S;throw _(S,"value")}}function E(S,D){var N,B;do D&&((N=c())==='"'||N==="'")?S.push(T()):S.push([B=R(u()),h("to",!0)?R(u()):B]);while(h(",",!0));var M={options:void 0};M.setOption=function(L,z){this.options===void 0&&(this.options={}),this.options[L]=z},$(M,function(z){if(z==="option")Z(M,z),h(";");else throw _(z)},function(){Y(M)})}function C(S,D){var N=1;switch(S.charAt(0)==="-"&&(N=-1,S=S.substring(1)),S){case"inf":case"INF":case"Inf":return N*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(base10Re.test(S))return N*parseInt(S,10);if(base16Re.test(S))return N*parseInt(S,16);if(base8Re.test(S))return N*parseInt(S,8);if(numberRe.test(S))return N*parseFloat(S);throw _(S,"number",D)}function R(S,D){switch(S){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!D&&S.charAt(0)==="-")throw _(S,"id");if(base10NegRe.test(S))return parseInt(S,10);if(base16NegRe.test(S))return parseInt(S,16);if(base8NegRe.test(S))return parseInt(S,8);throw _(S,"id")}function P(){if(y!==void 0)throw _("package");if(y=u(),!typeRefRe.test(y))throw _(y,"name");w=w.define(y),h(";")}function k(){var S=c(),D;switch(S){case"weak":D=p||(p=[]),u();break;case"public":u();default:D=g||(g=[]);break}S=T(),h(";"),D.push(S)}function A(){if(h("="),v=T(),b=v==="proto3",!b&&v!=="proto2")throw _(v,"syntax");i.setOption("syntax",v),h(";")}function I(S,D){switch(D){case"option":return Z(S,D),h(";"),!0;case"message":return F(S,D),!0;case"enum":return K(S,D),!0;case"service":return se(S,D),!0;case"extend":return oe(S,D),!0}return!1}function $(S,D,N){var B=d.line;if(S&&(typeof S.comment!="string"&&(S.comment=o()),S.filename=parse.filename),h("{",!0)){for(var M;(M=u())!=="}";)D(M);h(";",!0)}else N&&N(),h(";"),S&&(typeof S.comment!="string"||a)&&(S.comment=o(B)||S.comment)}function F(S,D){if(!nameRe.test(D=u()))throw _(D,"type name");var N=new Type(D);$(N,function(M){if(!I(N,M))switch(M){case"map":J(N);break;case"required":case"repeated":q(N,M);break;case"optional":b?q(N,"proto3_optional"):q(N,"optional");break;case"oneof":U(N,M);break;case"extensions":E(N.extensions||(N.extensions=[]));break;case"reserved":E(N.reserved||(N.reserved=[]),!0);break;default:if(!b||!typeRefRe.test(M))throw _(M);l(M),q(N,"optional");break}}),S.add(N)}function q(S,D,N){var B=u();if(B==="group"){V(S,D);return}for(;B.endsWith(".")||c().startsWith(".");)B+=u();if(!typeRefRe.test(B))throw _(B,"type");var M=u();if(!nameRe.test(M))throw _(M,"name");M=x(M),h("=");var L=new Field(M,R(u()),B,D,N);if($(L,function(W){if(W==="option")Z(L,W),h(";");else throw _(W)},function(){Y(L)}),D==="proto3_optional"){var z=new OneOf("_"+M);L.setOption("proto3_optional",!0),z.add(L),S.add(z)}else S.add(L);!b&&L.repeated&&(types.packed[B]!==void 0||types.basic[B]===void 0)&&L.setOption("packed",!1,!0)}function V(S,D){var N=u();if(!nameRe.test(N))throw _(N,"name");var B=util.lcFirst(N);N===B&&(N=util.ucFirst(N)),h("=");var M=R(u()),L=new Type(N);L.group=!0;var z=new Field(B,M,N,D);z.filename=parse.filename,$(L,function(W){switch(W){case"option":Z(L,W),h(";");break;case"required":case"repeated":q(L,W);break;case"optional":b?q(L,"proto3_optional"):q(L,"optional");break;case"message":F(L,W);break;case"enum":K(L,W);break;default:throw _(W)}}),S.add(L).add(z)}function J(S){h("<");var D=u();if(types.mapKey[D]===void 0)throw _(D,"type");h(",");var N=u();if(!typeRefRe.test(N))throw _(N,"type");h(">");var B=u();if(!nameRe.test(B))throw _(B,"name");h("=");var M=new MapField(x(B),R(u()),D,N);$(M,function(z){if(z==="option")Z(M,z),h(";");else throw _(z)},function(){Y(M)}),S.add(M)}function U(S,D){if(!nameRe.test(D=u()))throw _(D,"name");var N=new OneOf(x(D));$(N,function(M){M==="option"?(Z(N,M),h(";")):(l(M),q(N,"optional"))}),S.add(N)}function K(S,D){if(!nameRe.test(D=u()))throw _(D,"name");var N=new Enum(D);$(N,function(M){switch(M){case"option":Z(N,M),h(";");break;case"reserved":E(N.reserved||(N.reserved=[]),!0);break;default:ie(N,M)}}),S.add(N)}function ie(S,D){if(!nameRe.test(D))throw _(D,"name");h("=");var N=R(u(),!0),B={options:void 0};B.setOption=function(M,L){this.options===void 0&&(this.options={}),this.options[M]=L},$(B,function(L){if(L==="option")Z(B,L),h(";");else throw _(L)},function(){Y(B)}),S.add(D,N,B.comment,B.options)}function Z(S,D){var N=h("(",!0);if(!typeRefRe.test(D=u()))throw _(D,"name");var B=D,M=B,L;N&&(h(")"),B="("+B+")",M=B,D=c(),fqTypeRefRe.test(D)&&(L=D.slice(1),B+=D,u())),h("=");var z=re(S,B);ne(S,M,z,L)}function re(S,D){if(h("{",!0)){for(var N={};!h("}",!0);){if(!nameRe.test(H=u()))throw _(H,"name");if(H===null)throw _(H,"end of input");var B,M=H;if(h(":",!0),c()==="{")B=re(S,D+"."+H);else if(c()==="["){B=[];var L;if(h("[",!0)){do L=O(),B.push(L);while(h(",",!0));h("]"),typeof L<"u"&&ee(S,D+"."+H,L)}}else B=O(),ee(S,D+"."+H,B);var z=N[M];z&&(B=[].concat(z).concat(B)),N[M]=B,h(",",!0),h(";",!0)}return N}var G=O();return ee(S,D,G),G}function ee(S,D,N){S.setOption&&S.setOption(D,N)}function ne(S,D,N,B){S.setParsedOption&&S.setParsedOption(D,N,B)}function Y(S){if(h("[",!0)){do Z(S,"option");while(h(",",!0));h("]")}return S}function se(S,D){if(!nameRe.test(D=u()))throw _(D,"service name");var N=new Service(D);$(N,function(M){if(!I(N,M))if(M==="rpc")ae(N,M);else throw _(M)}),S.add(N)}function ae(S,D){var N=o(),B=D;if(!nameRe.test(D=u()))throw _(D,"name");var M=D,L,z,G,W;if(h("("),h("stream",!0)&&(z=!0),!typeRefRe.test(D=u())||(L=D,h(")"),h("returns"),h("("),h("stream",!0)&&(W=!0),!typeRefRe.test(D=u())))throw _(D);G=D,h(")");var Q=new Method(M,B,L,G,z,W);Q.comment=N,$(Q,function(te){if(te==="option")Z(Q,te),h(";");else throw _(te)}),S.add(Q)}function oe(S,D){if(!typeRefRe.test(D=u()))throw _(D,"reference");var N=D;$(null,function(M){switch(M){case"required":case"repeated":q(S,M,N);break;case"optional":b?q(S,"proto3_optional",N):q(S,"optional",N);break;default:if(!b||!typeRefRe.test(M))throw _(M);l(M),q(S,"optional",N);break}})}for(var H;(H=u())!==null;)switch(H){case"package":if(!m)throw _(H);P();break;case"import":if(!m)throw _(H);k();break;case"syntax":if(!m)throw _(H);A();break;case"option":Z(w,H),h(";");break;default:if(I(w,H)){m=!1;continue}throw _(H)}return parse.filename=null,{package:y,imports:g,weakImports:p,syntax:v,root:i}}var common_1=common,commonRe=/\/|\./;function common(s,i){commonRe.test(s)||(s="google/protobuf/"+s+".proto",i={nested:{google:{nested:{protobuf:{nested:i}}}}}),common[s]=i}common("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var timeType;common("duration",{Duration:timeType={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});common("timestamp",{Timestamp:timeType});common("empty",{Empty:{fields:{}}});common("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});common("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});common("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});common.get=function s(i){return common[i]||null};var protobuf=src.exports=indexLightExports;protobuf.build="full";protobuf.tokenize=tokenize_1;protobuf.parse=parse_1;protobuf.common=common_1;protobuf.Root._configure(protobuf.Type,protobuf.parse,protobuf.common);var srcExports=src.exports,protobufjs=srcExports;function loadProto(s){return protobufjs.parse(s)}loadProto("option optimize_for = LITE_RUNTIME;package GEOPOI;enum enumGeometryType {ePoint = 0;eMultiLineString = 1;ePolygon = 2;} ;message PBPOI{required uint64 OID = 1;required string Name =2;repeated double Coordinates =3 [packed=true];required enumGeometryType GeometryType = 4;optional int32 Interate = 5;optional int32 SymbolID = 10 [default = 0];optional double DisplayHeight = 11 [default = 32];optional uint32 ShiningColor=12 [default =0];optional uint32 FontNameIndex=13 [default =0];optional int32 FontSize=14 [default =18];optional uint32 FontColor=15 [default =0];};message StringTable {repeated string s = 1;}message PBPOITile{required int64 Version = 1;required int64 TileKey = 2;required StringTable StringTable = 3;repeated PBPOI POIS = 4;};").root.lookup("GEOPOI.PBPOITile");loadProto("option optimize_for = LITE_RUNTIME;package GEOPOI;enum enumGeometryType {ePoint = 0;eMultiLineString = 1;ePolygon = 2;};enum enumZCoordType {eCloseGround = 0;eCloseSeaSurface = 1;eRelativelyGround = 2;eAbsolute = 3;};message PBPOI{required uint64 OID = 1;required string Name =2;repeated double Coordinates =3 [packed=true];required enumGeometryType GeometryType = 4;optional int32 Interate = 5;optional int32 SymbolID = 10 [default = 0];optional double DisplayHeight = 11 [default = 32];optional uint32 ShiningColor=12 [default =0];optional uint32 FontNameIndex=13 [default =0];optional int32 FontSize=14 [default =18];optional uint32 FontColor=15 [default =0];optional enumZCoordType ZCoordType = 16 [default = eAbsolute];};message StringTable {repeated string s = 1;}message PBPOITile{required int64 Version = 1;required int64 TileKey = 2;required StringTable StringTable = 3;repeated PBPOI POIS = 4;};").root.lookup("GEOPOI.PBPOITile");loadProto("option optimize_for = LITE_RUNTIME;package GEOPOI;enum enumGeometryType {ePoint = 0;eMultiLineString = 1;ePolygon = 2;};enum enumZCoordType {eCloseGround = 0;eCloseSeaSurface = 1;eRelativelyGround = 2;eAbsolute = 3;};message PBPOI{required uint64 OID = 1;required string Name =2;repeated double Coordinates =3 [packed=true];required enumGeometryType GeometryType = 4;optional int32 Priority = 5;repeated int32 Interates =6 [packed=true];optional int32 SymbolID = 10 [default = 0];optional double DisplayHeight = 11 [default = 32];optional uint32 ShiningColor=12 [default =0];optional uint32 FontNameIndex=13 [default =0];optional int32 FontSize=14 [default =18];optional uint32 FontColor=15 [default =0];optional enumZCoordType ZCoordType = 16 [default = eAbsolute];optional int32 FontStyle=17;optional int32 ShiningSize=18;};message StringTable {repeated string s = 1;}message PBPOITile{required int64 Version = 1;required int64 TileKey = 2;required StringTable StringTable = 3;repeated PBPOI POIS = 4;};").root.lookup("GEOPOI.PBPOITile");Cesium.Color.WHITE,Cesium.Color.BLACK,Cesium.LabelStyle.FILL_AND_OUTLINE,Cesium.Color.RED,new Cesium.Cartesian2(10,10),Cesium.HorizontalOrigin.CENTER,Cesium.VerticalOrigin.TOP,Cesium.Cartesian3.ZERO,new Cesium.Cartesian2(0,8);Cesium.HorizontalOrigin.CENTER,Cesium.VerticalOrigin.CENTER,Cesium.Cartesian3.ZERO,Cesium.Cartesian2.ZERO,Cesium.Cartesian3.ZERO,Cesium.Color.WHITE;var index={GeoTerrainProvider};function invertToCanvas(s){var c;const i=s.width,r=s.height,a=document.createElement("canvas");a.width=i,a.height=r;const d=a.getContext("2d");d.translate(0,r),d.scale(1,-1),d.drawImage(s,0,0);const u=d.getImageData(0,0,i,r),l=u.data;for(let h=0;h<l.length;h+=4)l[h]=255-l[h],l[h+1]=255-l[h+1],l[h+2]=255-l[h+2];return d.putImageData(u,0,0),"close"in s&&((c=s.close)==null||c.call(s)),a}class CustomWebMapTileServiceImageryProvider extends Cesium__namespace.WebMapTileServiceImageryProvider{constructor(i){super(i),this.options=i}requestImage(i,r,a,d){this.options.subdomains&&d&&d.url&&(d.url=d.url.replace("{s}",this.pickSubdomain(i,r,a,this.options.subdomains)));const u=super.requestImage(i,r,a,d);return u&&u.then(l=>{var c,h;return((h=(c=this.options).requestInterceptor)==null?void 0:h.call(c,l))??l})}pickSubdomain(i,r,a,d){const u=Math.abs(i*73856093^r*19349663^a*83492791)%d.length;return d[u]}}function createTdtProvider(s,i){const{token:r,...a}=i;return new CustomWebMapTileServiceImageryProvider({url:`https://t{s}.tianditu.gov.cn/${s}_w/wmts?tk=${r}`,subdomains:["0","1","2","3","4","5","6","7"],layer:s,style:"default",format:"tiles",tileMatrixSetID:"w",maximumLevel:18,credit:new Cesium__namespace.Credit("TianDiTu"),...a})}function createTdtTerrain(s){const i=["0","1","2","3","4","5","6","7"];return new index.GeoTerrainProvider({url:"https://t{s}.tianditu.gov.cn/mapservice/swdx?T=elv_c&x={x}&y={y}&l={z}&tk={token}",subdomains:i,token:s.token})}var freeGlobal=typeof global=="object"&&global&&global.Object===Object&&global,freeSelf=typeof self=="object"&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),Symbol$1=root.Symbol,objectProto$8=Object.prototype,hasOwnProperty$6=objectProto$8.hasOwnProperty,nativeObjectToString$1=objectProto$8.toString,symToStringTag$1=Symbol$1?Symbol$1.toStringTag:void 0;function getRawTag(s){var i=hasOwnProperty$6.call(s,symToStringTag$1),r=s[symToStringTag$1];try{s[symToStringTag$1]=void 0;var a=!0}catch{}var d=nativeObjectToString$1.call(s);return a&&(i?s[symToStringTag$1]=r:delete s[symToStringTag$1]),d}var objectProto$7=Object.prototype,nativeObjectToString=objectProto$7.toString;function objectToString(s){return nativeObjectToString.call(s)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$1?Symbol$1.toStringTag:void 0;function baseGetTag(s){return s==null?s===void 0?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(s)?getRawTag(s):objectToString(s)}function isObjectLike(s){return s!=null&&typeof s=="object"}var symbolTag="[object Symbol]";function isSymbol(s){return typeof s=="symbol"||isObjectLike(s)&&baseGetTag(s)==symbolTag}var isArray=Array.isArray,reWhitespace=/\s/;function trimmedEndIndex(s){for(var i=s.length;i--&&reWhitespace.test(s.charAt(i)););return i}var reTrimStart=/^\s+/;function baseTrim(s){return s&&s.slice(0,trimmedEndIndex(s)+1).replace(reTrimStart,"")}function isObject(s){var i=typeof s;return s!=null&&(i=="object"||i=="function")}var NAN=NaN,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;function toNumber(s){if(typeof s=="number")return s;if(isSymbol(s))return NAN;if(isObject(s)){var i=typeof s.valueOf=="function"?s.valueOf():s;s=isObject(i)?i+"":i}if(typeof s!="string")return s===0?s:+s;s=baseTrim(s);var r=reIsBinary.test(s);return r||reIsOctal.test(s)?freeParseInt(s.slice(2),r?2:8):reIsBadHex.test(s)?NAN:+s}function identity(s){return s}var asyncTag="[object AsyncFunction]",funcTag$1="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(s){if(!isObject(s))return!1;var i=baseGetTag(s);return i==funcTag$1||i==genTag||i==asyncTag||i==proxyTag}var coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var s=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}();function isMasked(s){return!!maskSrcKey&&maskSrcKey in s}var funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource(s){if(s!=null){try{return funcToString$1.call(s)}catch{}try{return s+""}catch{}}return""}var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$6=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$5=objectProto$6.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$5).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(s){if(!isObject(s)||isMasked(s))return!1;var i=isFunction(s)?reIsNative:reIsHostCtor;return i.test(toSource(s))}function getValue(s,i){return s==null?void 0:s[i]}function getNative(s,i){var r=getValue(s,i);return baseIsNative(r)?r:void 0}function apply(s,i,r){switch(r.length){case 0:return s.call(i);case 1:return s.call(i,r[0]);case 2:return s.call(i,r[0],r[1]);case 3:return s.call(i,r[0],r[1],r[2])}return s.apply(i,r)}var HOT_COUNT=800,HOT_SPAN=16,nativeNow=Date.now;function shortOut(s){var i=0,r=0;return function(){var a=nativeNow(),d=HOT_SPAN-(a-r);if(r=a,d>0){if(++i>=HOT_COUNT)return arguments[0]}else i=0;return s.apply(void 0,arguments)}}function constant(s){return function(){return s}}var defineProperty=function(){try{var s=getNative(Object,"defineProperty");return s({},"",{}),s}catch{}}(),baseSetToString=defineProperty?function(s,i){return defineProperty(s,"toString",{configurable:!0,enumerable:!1,value:constant(i),writable:!0})}:identity,setToString=shortOut(baseSetToString),MAX_SAFE_INTEGER$1=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(s,i){var r=typeof s;return i=i??MAX_SAFE_INTEGER$1,!!i&&(r=="number"||r!="symbol"&&reIsUint.test(s))&&s>-1&&s%1==0&&s<i}function eq(s,i){return s===i||s!==s&&i!==i}var nativeMax$1=Math.max;function overRest(s,i,r){return i=nativeMax$1(i===void 0?s.length-1:i,0),function(){for(var a=arguments,d=-1,u=nativeMax$1(a.length-i,0),l=Array(u);++d<u;)l[d]=a[i+d];d=-1;for(var c=Array(i+1);++d<i;)c[d]=a[d];return c[i]=r(l),apply(s,this,c)}}function baseRest(s,i){return setToString(overRest(s,i,identity),s+"")}var MAX_SAFE_INTEGER=9007199254740991;function isLength(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=MAX_SAFE_INTEGER}function isArrayLike(s){return s!=null&&isLength(s.length)&&!isFunction(s)}function isIterateeCall(s,i,r){if(!isObject(r))return!1;var a=typeof i;return(a=="number"?isArrayLike(r)&&isIndex(i,r.length):a=="string"&&i in r)?eq(r[i],s):!1}var objectProto$5=Object.prototype;function isPrototype(s){var i=s&&s.constructor,r=typeof i=="function"&&i.prototype||objectProto$5;return s===r}function baseTimes(s,i){for(var r=-1,a=Array(s);++r<s;)a[r]=i(r);return a}var argsTag$1="[object Arguments]";function baseIsArguments(s){return isObjectLike(s)&&baseGetTag(s)==argsTag$1}var objectProto$4=Object.prototype,hasOwnProperty$4=objectProto$4.hasOwnProperty,propertyIsEnumerable=objectProto$4.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(s){return isObjectLike(s)&&hasOwnProperty$4.call(s,"callee")&&!propertyIsEnumerable.call(s,"callee")};function stubFalse(){return!1}var freeExports$1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports$1=freeModule$1&&freeModule$1.exports===freeExports$1,Buffer=moduleExports$1?root.Buffer:void 0,nativeIsBuffer=Buffer?Buffer.isBuffer:void 0,isBuffer=nativeIsBuffer||stubFalse,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0;typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;function baseIsTypedArray(s){return isObjectLike(s)&&isLength(s.length)&&!!typedArrayTags[baseGetTag(s)]}function baseUnary(s){return function(i){return s(i)}}var freeExports=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{var s=freeModule&&freeModule.require&&freeModule.require("util").types;return s||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch{}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;function arrayLikeKeys(s,i){var r=isArray(s),a=!r&&isArguments(s),d=!r&&!a&&isBuffer(s),u=!r&&!a&&!d&&isTypedArray(s),l=r||a||d||u,c=l?baseTimes(s.length,String):[],h=c.length;for(var o in s)l&&(o=="length"||d&&(o=="offset"||o=="parent")||u&&(o=="buffer"||o=="byteLength"||o=="byteOffset")||isIndex(o,h))||c.push(o);return c}function nativeKeysIn(s){var i=[];if(s!=null)for(var r in Object(s))i.push(r);return i}var objectProto$3=Object.prototype,hasOwnProperty$3=objectProto$3.hasOwnProperty;function baseKeysIn(s){if(!isObject(s))return nativeKeysIn(s);var i=isPrototype(s),r=[];for(var a in s)a=="constructor"&&(i||!hasOwnProperty$3.call(s,a))||r.push(a);return r}function keysIn(s){return isArrayLike(s)?arrayLikeKeys(s):baseKeysIn(s)}var nativeCreate=getNative(Object,"create");function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(s){var i=this.has(s)&&delete this.__data__[s];return this.size-=i?1:0,i}var HASH_UNDEFINED$1="__lodash_hash_undefined__",objectProto$2=Object.prototype,hasOwnProperty$2=objectProto$2.hasOwnProperty;function hashGet(s){var i=this.__data__;if(nativeCreate){var r=i[s];return r===HASH_UNDEFINED$1?void 0:r}return hasOwnProperty$2.call(i,s)?i[s]:void 0}var objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function hashHas(s){var i=this.__data__;return nativeCreate?i[s]!==void 0:hasOwnProperty$1.call(i,s)}var HASH_UNDEFINED="__lodash_hash_undefined__";function hashSet(s,i){var r=this.__data__;return this.size+=this.has(s)?0:1,r[s]=nativeCreate&&i===void 0?HASH_UNDEFINED:i,this}function Hash(s){var i=-1,r=s==null?0:s.length;for(this.clear();++i<r;){var a=s[i];this.set(a[0],a[1])}}Hash.prototype.clear=hashClear;Hash.prototype.delete=hashDelete;Hash.prototype.get=hashGet;Hash.prototype.has=hashHas;Hash.prototype.set=hashSet;function listCacheClear(){this.__data__=[],this.size=0}function assocIndexOf(s,i){for(var r=s.length;r--;)if(eq(s[r][0],i))return r;return-1}var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(s){var i=this.__data__,r=assocIndexOf(i,s);if(r<0)return!1;var a=i.length-1;return r==a?i.pop():splice.call(i,r,1),--this.size,!0}function listCacheGet(s){var i=this.__data__,r=assocIndexOf(i,s);return r<0?void 0:i[r][1]}function listCacheHas(s){return assocIndexOf(this.__data__,s)>-1}function listCacheSet(s,i){var r=this.__data__,a=assocIndexOf(r,s);return a<0?(++this.size,r.push([s,i])):r[a][1]=i,this}function ListCache(s){var i=-1,r=s==null?0:s.length;for(this.clear();++i<r;){var a=s[i];this.set(a[0],a[1])}}ListCache.prototype.clear=listCacheClear;ListCache.prototype.delete=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;var Map$1=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||ListCache),string:new Hash}}function isKeyable(s){var i=typeof s;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?s!=="__proto__":s===null}function getMapData(s,i){var r=s.__data__;return isKeyable(i)?r[typeof i=="string"?"string":"hash"]:r.map}function mapCacheDelete(s){var i=getMapData(this,s).delete(s);return this.size-=i?1:0,i}function mapCacheGet(s){return getMapData(this,s).get(s)}function mapCacheHas(s){return getMapData(this,s).has(s)}function mapCacheSet(s,i){var r=getMapData(this,s),a=r.size;return r.set(s,i),this.size+=r.size==a?0:1,this}function MapCache(s){var i=-1,r=s==null?0:s.length;for(this.clear();++i<r;){var a=s[i];this.set(a[0],a[1])}}MapCache.prototype.clear=mapCacheClear;MapCache.prototype.delete=mapCacheDelete;MapCache.prototype.get=mapCacheGet;MapCache.prototype.has=mapCacheHas;MapCache.prototype.set=mapCacheSet;var FUNC_ERROR_TEXT$1="Expected a function";function memoize(s,i){if(typeof s!="function"||i!=null&&typeof i!="function")throw new TypeError(FUNC_ERROR_TEXT$1);var r=function(){var a=arguments,d=i?i.apply(this,a):a[0],u=r.cache;if(u.has(d))return u.get(d);var l=s.apply(this,a);return r.cache=u.set(d,l)||u,l};return r.cache=new(memoize.Cache||MapCache),r}memoize.Cache=MapCache;var now=function(){return root.Date.now()},FUNC_ERROR_TEXT="Expected a function",nativeMax=Math.max,nativeMin=Math.min;function debounce(s,i,r){var a,d,u,l,c,h,o=0,m=!1,y=!1,g=!0;if(typeof s!="function")throw new TypeError(FUNC_ERROR_TEXT);i=toNumber(i)||0,isObject(r)&&(m=!!r.leading,y="maxWait"in r,u=y?nativeMax(toNumber(r.maxWait)||0,i):u,g="trailing"in r?!!r.trailing:g);function p(C){var R=a,P=d;return a=d=void 0,o=C,l=s.apply(P,R),l}function v(C){return o=C,c=setTimeout(x,i),m?p(C):l}function b(C){var R=C-h,P=C-o,k=i-R;return y?nativeMin(k,u-P):k}function w(C){var R=C-h,P=C-o;return h===void 0||R>=i||R<0||y&&P>=u}function x(){var C=now();if(w(C))return _(C);c=setTimeout(x,b(C))}function _(C){return c=void 0,g&&a?p(C):(a=d=void 0,l)}function T(){c!==void 0&&clearTimeout(c),o=0,a=h=d=c=void 0}function O(){return c===void 0?l:_(now())}function E(){var C=now(),R=w(C);if(a=arguments,d=this,h=C,R){if(c===void 0)return v(h);if(y)return clearTimeout(c),c=setTimeout(x,i),p(h)}return c===void 0&&(c=setTimeout(x,i)),l}return E.cancel=T,E.flush=O,E}var objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,defaults=baseRest(function(s,i){s=Object(s);var r=-1,a=i.length,d=a>2?i[2]:void 0;for(d&&isIterateeCall(i[0],i[1],d)&&(a=1);++r<a;)for(var u=i[r],l=keysIn(u),c=-1,h=l.length;++c<h;){var o=l[c],m=s[o];(m===void 0||eq(m,objectProto[o])&&!hasOwnProperty.call(s,o))&&(s[o]=u[o])}return s});function getDefaultExportFromCjs(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var eventemitter3={exports:{}},hasRequiredEventemitter3;function requireEventemitter3(){return hasRequiredEventemitter3||(hasRequiredEventemitter3=1,function(s){var i=Object.prototype.hasOwnProperty,r="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(r=!1));function d(h,o,m){this.fn=h,this.context=o,this.once=m||!1}function u(h,o,m,y,g){if(typeof m!="function")throw new TypeError("The listener must be a function");var p=new d(m,y||h,g),v=r?r+o:o;return h._events[v]?h._events[v].fn?h._events[v]=[h._events[v],p]:h._events[v].push(p):(h._events[v]=p,h._eventsCount++),h}function l(h,o){--h._eventsCount===0?h._events=new a:delete h._events[o]}function c(){this._events=new a,this._eventsCount=0}c.prototype.eventNames=function(){var o=[],m,y;if(this._eventsCount===0)return o;for(y in m=this._events)i.call(m,y)&&o.push(r?y.slice(1):y);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(m)):o},c.prototype.listeners=function(o){var m=r?r+o:o,y=this._events[m];if(!y)return[];if(y.fn)return[y.fn];for(var g=0,p=y.length,v=new Array(p);g<p;g++)v[g]=y[g].fn;return v},c.prototype.listenerCount=function(o){var m=r?r+o:o,y=this._events[m];return y?y.fn?1:y.length:0},c.prototype.emit=function(o,m,y,g,p,v){var b=r?r+o:o;if(!this._events[b])return!1;var w=this._events[b],x=arguments.length,_,T;if(w.fn){switch(w.once&&this.removeListener(o,w.fn,void 0,!0),x){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,m),!0;case 3:return w.fn.call(w.context,m,y),!0;case 4:return w.fn.call(w.context,m,y,g),!0;case 5:return w.fn.call(w.context,m,y,g,p),!0;case 6:return w.fn.call(w.context,m,y,g,p,v),!0}for(T=1,_=new Array(x-1);T<x;T++)_[T-1]=arguments[T];w.fn.apply(w.context,_)}else{var O=w.length,E;for(T=0;T<O;T++)switch(w[T].once&&this.removeListener(o,w[T].fn,void 0,!0),x){case 1:w[T].fn.call(w[T].context);break;case 2:w[T].fn.call(w[T].context,m);break;case 3:w[T].fn.call(w[T].context,m,y);break;case 4:w[T].fn.call(w[T].context,m,y,g);break;default:if(!_)for(E=1,_=new Array(x-1);E<x;E++)_[E-1]=arguments[E];w[T].fn.apply(w[T].context,_)}}return!0},c.prototype.on=function(o,m,y){return u(this,o,m,y,!1)},c.prototype.once=function(o,m,y){return u(this,o,m,y,!0)},c.prototype.removeListener=function(o,m,y,g){var p=r?r+o:o;if(!this._events[p])return this;if(!m)return l(this,p),this;var v=this._events[p];if(v.fn)v.fn===m&&(!g||v.once)&&(!y||v.context===y)&&l(this,p);else{for(var b=0,w=[],x=v.length;b<x;b++)(v[b].fn!==m||g&&!v[b].once||y&&v[b].context!==y)&&w.push(v[b]);w.length?this._events[p]=w.length===1?w[0]:w:l(this,p)}return this},c.prototype.removeAllListeners=function(o){var m;return o?(m=r?r+o:o,this._events[m]&&l(this,m)):(this._events=new a,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,s.exports=c}(eventemitter3)),eventemitter3.exports}var eventemitter3Exports=requireEventemitter3();const EventEmitter=getDefaultExportFromCjs(eventemitter3Exports);class WmsLayer{constructor(i,r,a,d=1/0){this.ctrl=i,this.key=r,this.layer=a,this.zIndex=d,this.ctrl.registerLayer(this)}show(i){this.ctrl.showLayer(i,this.key)}hide(i){this.ctrl.hideLayer(i,this.key)}}class WmsLayerController extends EventEmitter{constructor(r){super();j(this,"layerMap",new Map);j(this,"showLayers",Array());j(this,"imgLayer");j(this,"update",debounce(r=>{if(this.imgLayer&&r.imageryLayers.remove(this.imgLayer,!0),this.showLayers.length===0){this.imgLayer=void 0,this.destroyHandler();return}this.handler||this.hookClickEvent(r),this.imgLayer=new Cesium.ImageryLayer(new Cesium.WebMapServiceImageryProvider({...this.args,layers:this.showLayers.map(a=>this.layerMap.get(a).layer).join(",")})),this.imgLayer.show=!0,r.imageryLayers.add(this.imgLayer)},200));j(this,"handler");this.args=r,this.args.parameters=defaults(this.args.parameters,{service:"WMS",version:"1.1.1",request:"GetMap",format:"image/png",transparent:!0,maximumLevel:18,minimumLevel:3,width:256,height:256})}registerLayer(r){if(this.layerMap.has(r.key))throw new Error(`Layer with key 【${r.key}】 is already registered`);this.layerMap.set(r.key,r)}showLayer(r,a){if(!this.layerMap.has(a))throw new Error(`Layer with key 【${a}】 is not registered`);this.showLayers.push(a),this.showLayers.sort((d,u)=>{const l=this.layerMap.get(d).zIndex,c=this.layerMap.get(u).zIndex;return l-c}),this.update(r)}hideLayer(r,a){const d=this.showLayers.indexOf(a);d!==-1&&(this.showLayers.splice(d,1),this.update(r))}hookClickEvent(r){this.handler=new Cesium.ScreenSpaceEventHandler(r.scene.canvas),this.handler.setInputAction(async a=>{const d=r.scene,u=d.camera.getPickRay(a.position),l=await d.imageryLayers.pickImageryLayerFeatures(u,r.scene);this.emit("click",l)},Cesium.ScreenSpaceEventType.LEFT_CLICK)}destroyHandler(){this.handler&&(this.handler.destroy(),this.handler=void 0)}}const createShipIconUrl=memoize((s,i)=>{const r=`<?xml version="1.0" encoding="UTF-8"?>
12
12
  <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 50 300">
13
13
  <defs>
14
14
  <style>
@@ -38,13 +38,13 @@
38
38
  <path id="svg_4" data-name="svg 4" class="cls-1" d="M 26 139 L 47 211 H 3 Z"/>
39
39
  </g>
40
40
  <image id="img_1" width="124" height="146" transform="translate(-.23 214.17) scale(.42 .77)" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHwAAACSCAMAAACwjl5+AAAAq1BMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Nr6iZAAAAOXRSTlMABRshFgkSZg5qJmFdWlEqOXBFPYVJQYB1VXtNLpc1mzKguZCKtJONxc69yaukwa/SqN/k1trs6fBhRQqRAAAVcElEQVR42rSX3ZKaQBCFgxoIICh/ggjiIMPPMAOy6yZ5/yfLaTBVSa5istu1Vepe+M3p7jkHPz1Vmqav99umYLxsh7bvO6oeb8ZR1XUS7TaftU8fVdqX9cWpGBt5WeJvKbwbOJvyujEPlv5RcLBXZyesc1lyMSk5qWmS0zQxNQrGVF2Fpv9hdOg+2HFzZZwPQjFWFAxV4FUNJd5VcWr4u4+hgx0YcVgVchRtOSmW50wpVoA+lS0vWB6mifkxdE2H7jSOazaVfYtJo91yHKVSUmLq/Yihp2Zi09a9N1rb7Hxi07oN/dAOgnMwB4F9E3jtW1Y1oWea2yhbve/Oa583WWR4SRLnGHAPVkd3bblpA70XvcjDKjVs24ku70rX9NU5OgIeV9ect0L03a3rbve3l5e3+6273Vp0opVVmnrG1jkFl9UX7R3HfY5c2zCTOLxKNHzobzdCv3779voK/ls3tOi+ihPPcI5uFGRrXdPeZ8t16+y7zpbgVcHFWLb9fUZ/RX0D/e2txew5zxPTcNzIP+xBR+vfgb2x9oeTe3Rs04sLXuKmDWg5sb+jFnqH9ZejrL3t1o0Oh+CcrWG1/4v//GW1OwfR6XRybC+5SrBLPnTd/YXYC/3l7XYfJB+VVA3aHgX7/fli/TddA3ud7Q++758cI6kUVwo3rOu7t9/ht46rETe/iA3Az5cs261X+hfQ/4Otb9a7bB/sA9+1zbCYGIOx4FID/voV9AWOje8GxSaY3jW1XYzcsnbWf9E1DfNeW1l2yc6B75hxDjNVk6Q4Rdtp3x4zv3dt23Oy+bquUvsUZNYa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"/>
41
- </svg>`;return URL.createObjectURL(new Blob([r],{type:"image/svg+xml"}))},(s,i)=>`${s},${i}`),createShipIconV2=memoize(s=>{const i=s.designBeam,r=s.designLength,o=s.aisFromBow!=null&&s.aisFromCenter!=null?{x:s.aisFromCenter,y:s.designLength-s.aisFromBow}:{x:0,y:r/2},d=`${i/2+o.x} ${o.y}`,u=`${-i/2+o.x} ${o.y}`,l=`${o.x} ${o.y}`,c=`${o.x} ${-r+o.y}`,h=Math.floor(r*4/5),a=Math.floor((r-h)*2/3),m=`M${l}
42
- C${d} ${d} ${i/2+o.x} ${o.y-3}
43
- V${-h+o.y}
44
- C${i/2+o.x} ${o.y-h-a} ${2+o.x} ${-r+o.y} ${c}
45
- C${-2+o.x} ${-r+o.y} ${-i/2+o.x} ${o.y-h-a} ${-i/2+o.x} ${-h+o.y}
46
- V${-3+o.y}
47
- C${u} ${u} ${l}`,y=Math.max(Math.abs(i/2+o.x),Math.abs(-i/2+o.x)),g=Math.max(Math.abs(-r+o.y+(s.isMoving?-5:0)),Math.abs(o.y+(s.isMoving?146/124*i:0))),p=[-y*1.2,-g,2*y*1.2,2*g],v={x:2*1.2*y/i,y:2*g/r},b=`<?xml version="1.0" encoding="UTF-8"?>
41
+ </svg>`;return URL.createObjectURL(new Blob([r],{type:"image/svg+xml"}))},(s,i)=>`${s},${i}`),createShipIconV2=memoize(s=>{const i=s.designBeam,r=s.designLength,a=s.aisFromBow!=null&&s.aisFromCenter!=null?{x:s.aisFromCenter,y:s.designLength-s.aisFromBow}:{x:0,y:r/2},d=`${i/2+a.x} ${a.y}`,u=`${-i/2+a.x} ${a.y}`,l=`${a.x} ${a.y}`,c=`${a.x} ${-r+a.y}`,h=Math.floor(r*4/5),o=Math.floor((r-h)*2/3),m=`M${l}
42
+ C${d} ${d} ${i/2+a.x} ${a.y-3}
43
+ V${-h+a.y}
44
+ C${i/2+a.x} ${a.y-h-o} ${2+a.x} ${-r+a.y} ${c}
45
+ C${-2+a.x} ${-r+a.y} ${-i/2+a.x} ${a.y-h-o} ${-i/2+a.x} ${-h+a.y}
46
+ V${-3+a.y}
47
+ C${u} ${u} ${l}`,y=Math.max(Math.abs(i/2+a.x),Math.abs(-i/2+a.x)),g=Math.max(Math.abs(-r+a.y+(s.isMoving?-5:0)),Math.abs(a.y+(s.isMoving?146/124*i:0))),p=[-y*1.2,-g,2*y*1.2,2*g],v={x:2*1.2*y/i,y:2*g/r},b=`<?xml version="1.0" encoding="UTF-8"?>
48
48
  <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="${p.join(" ")}">
49
49
  <defs>
50
50
  <style>
@@ -73,5 +73,5 @@
73
73
  <path id="svg_1" data-name="svg 1" class="cls-2" d="M${c}v-5"/>
74
74
  <path id="svg_4" data-name="svg 4" class="cls-1" d="${m}"/>
75
75
  </g>
76
- <image id="img_1" width="${i}" height="${146/124*i}" transform="translate(${-i/2+o.x} ${o.y})" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHwAAACSCAMAAACwjl5+AAAAq1BMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Nr6iZAAAAOXRSTlMABRshFgkSZg5qJmFdWlEqOXBFPYVJQYB1VXtNLpc1mzKguZCKtJONxc69yaukwa/SqN/k1trs6fBhRQqRAAAVcElEQVR42rSX3ZKaQBCFgxoIICh/ggjiIMPPMAOy6yZ5/yfLaTBVSa5istu1Vepe+M3p7jkHPz1Vmqav99umYLxsh7bvO6oeb8ZR1XUS7TaftU8fVdqX9cWpGBt5WeJvKbwbOJvyujEPlv5RcLBXZyesc1lyMSk5qWmS0zQxNQrGVF2Fpv9hdOg+2HFzZZwPQjFWFAxV4FUNJd5VcWr4u4+hgx0YcVgVchRtOSmW50wpVoA+lS0vWB6mifkxdE2H7jSOazaVfYtJo91yHKVSUmLq/Yihp2Zi09a9N1rb7Hxi07oN/dAOgnMwB4F9E3jtW1Y1oWea2yhbve/Oa583WWR4SRLnGHAPVkd3bblpA70XvcjDKjVs24ku70rX9NU5OgIeV9ect0L03a3rbve3l5e3+6273Vp0opVVmnrG1jkFl9UX7R3HfY5c2zCTOLxKNHzobzdCv3779voK/ls3tOi+ihPPcI5uFGRrXdPeZ8t16+y7zpbgVcHFWLb9fUZ/RX0D/e2txew5zxPTcNzIP+xBR+vfgb2x9oeTe3Rs04sLXuKmDWg5sb+jFnqH9ZejrL3t1o0Oh+CcrWG1/4v//GW1OwfR6XRybC+5SrBLPnTd/YXYC/3l7XYfJB+VVA3aHgX7/fli/TddA3ud7Q++758cI6kUVwo3rOu7t9/ht46rETe/iA3Az5cs261X+hfQ/4Otb9a7bB/sA9+1zbCYGIOx4FID/voV9AWOje8GxSaY3jW1XYzcsnbWf9E1DfNeW1l2yc6B75hxDjNVk6Q4Rdtp3x4zv3dt23Oy+bquUvsUZNYa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"/>
77
- </svg>`;return{url:URL.createObjectURL(new Blob([b],{type:"image/svg+xml"})),viewBox:p,scale:v}},s=>`${s.color},${s.isMoving},${s.designBeam??0},${s.designLength??0},${s.aisFromBow??0},${s.aisFromCenter??0}`),shipTypeColorMap=new Map([[-1,"#00FF00"],[70,"#95B3D7"],[37,"#00FF00"],[50,"#366092"],[51,"#366092"],[52,"#366092"],[53,"#366092"],[54,"#366092"],[55,"#366092"],[56,"#366092"],[57,"#366092"],[58,"#366092"],[59,"#366092"],[80,"red"],[81,"red"],[82,"red"],[83,"red"],[84,"red"],[85,"red"],[86,"red"],[87,"red"],[88,"red"],[89,"red"]]);function createAlphaSampled(s){const i=new Cesium__namespace.SampledProperty(Cesium__namespace.Color),r=(s==null?void 0:s.startTime)??Cesium__namespace.JulianDate.now(),o=Cesium__namespace.JulianDate.addMinutes(r,1,new Cesium__namespace.JulianDate),d=Cesium__namespace.JulianDate.addMinutes(r,5,new Cesium__namespace.JulianDate),u=Cesium__namespace.JulianDate.fromIso8601("2100-01-01T00:00:00Z"),l=(s==null?void 0:s.color)??Cesium__namespace.Color.WHITE;return i.addSample(r,l.withAlpha(1)),i.addSample(o,l.withAlpha(1)),i.addSample(d,l.withAlpha(.2)),i.addSample(u,l.withAlpha(.1)),i}function getHideAfterFiveMinutesProperty(s){const i=s??Cesium__namespace.JulianDate.now(),r=Cesium__namespace.JulianDate.addMinutes(i,5,new Cesium__namespace.JulianDate);return new Cesium__namespace.CallbackProperty(o=>o?Cesium__namespace.JulianDate.lessThan(o,r):!0,!1)}function createRoundedRectImage({text:s="未知",fill:i="#5582DF",stroke:r="#FFFFFF",strokeWidth:o=2,textColor:d="#FFFFFF",fontFamily:u="Segoe UI, Helvetica, Arial, sans-serif",fontWeight:l="normal",fontSize:c=12,padding:h=6,radius:a=5}={}){const m=Math.max(0,s.length*c*.6+h*2),y=c*1.6,g=1,p=Math.ceil(o/2)+1,v=m+p*2,b=y+p*2,w=document.createElement("canvas");w.width=Math.round(v*g),w.height=Math.round(b*g),w.style.width=`${v}px`,w.style.height=`${b}px`;const x=w.getContext("2d");if(!x)throw new Error("无法获取2D绘图上下文");x.scale(g,g),x.clearRect(0,0,v,b),x.lineJoin="round",x.lineCap="round";const _=p,T=p,O=v-p,E=b-p,C=O-_,R=E-T,P=Math.min(a,Math.min(C,R)/2);x.beginPath(),x.moveTo(_+P,T),x.lineTo(O-P,T),x.quadraticCurveTo(O,T,O,T+P),x.lineTo(O,E-P),x.quadraticCurveTo(O,E,O-P,E),x.lineTo(_+P,E),x.quadraticCurveTo(_,E,_,E-P),x.lineTo(_,T+P),x.quadraticCurveTo(_,T,_+P,T),x.closePath(),i&&i!=="transparent"&&(x.fillStyle=i,x.fill()),x.lineWidth=o,x.strokeStyle=r,x.stroke();const k=Math.max(0,m-h*2);let A=c;for(x.fillStyle=d,x.textAlign="center",x.textBaseline="middle",x.font=`${l} ${A}px ${u}`;x.measureText(s).width>k&&A>10;)A-=1,x.font=`${l} ${A}px ${u}`;return x.fillText(s,v/2,b/2),w}class ShipLayer extends EventEmitter{constructor(r,o,d){var u,l,c;super();j(this,"db");j(this,"labelDataSource",new Cesium__namespace.CustomDataSource("ship-labels"));j(this,"isMounted",!1);j(this,"_viewer",null);j(this,"entityMap",new Map);j(this,"IS_MOVING_THRESHOLD",1);j(this,"shadowEntityMap",new WeakMap);j(this,"hookFilterEntityFn");this.key=r,this.zIndex=o,this.db=new Cesium__namespace.CustomDataSource(r),this.labelDataSource.clustering.enabled=((u=d==null?void 0:d.clustering)==null?void 0:u.enabled)??!0,this.labelDataSource.clustering.pixelRange=((l=d==null?void 0:d.clustering)==null?void 0:l.pixelRange)??15,this.labelDataSource.clustering.minimumClusterSize=((c=d==null?void 0:d.clustering)==null?void 0:c.minimumClusterSize)??2}show(r){this.isMounted||(r.dataSources.add(this.db),r.dataSources.add(this.labelDataSource),this._viewer=r,this.isMounted=!0),this.db.show=!0}hide(){this.isMounted&&(this.db.show=!1,this.labelDataSource.show=!1)}contain(r){const o=r.id.replace(/_shadow\d*$/,"");return this.entityMap.has(o)}render(r){r.features.forEach(o=>{this.renderFeature(o)})}getIdByFeature(r){var d;const o=String(((d=r.properties)==null?void 0:d.mmsi)??r.id);if(!o)throw new Error("feature必须有mmsi或id");return"ship_mmsi_"+o}renderFeature(r){var a,m;const o=this.getIdByFeature(r),d=new Cesium__namespace.SampledPositionProperty;d.backwardExtrapolationType=Cesium__namespace.ExtrapolationType.HOLD,d.forwardExtrapolationType=Cesium__namespace.ExtrapolationType.HOLD;const u=Cesium__namespace.Cartesian3.fromDegrees(r.geometry.coordinates[0],r.geometry.coordinates[1]);d.addSample(((a=this._viewer)==null?void 0:a.clock.currentTime)??Cesium__namespace.JulianDate.now(),u);const l=((m=r.properties)==null?void 0:m.courseOverGroundTrue)??0,c=new Cesium__namespace.Entity({id:o,position:d,orientation:new Cesium__namespace.ConstantProperty(Cesium__namespace.Transforms.headingPitchRollQuaternion(u,new Cesium__namespace.HeadingPitchRoll(l,0,0))),properties:r.properties??{}});this.entityMap.set(o,c),this.db.entities.add(c),this.renderEntity(c);const h=new Cesium__namespace.Entity({id:o+"_shadow1",position:d,properties:r.properties??{}});this.labelDataSource.entities.add(h),this.renderLabelEntity(h),this.emit("createEntity",c)}update(r){var d,u,l,c,h,a,m,y,g,p;const o=this.db.entities.getById(this.getIdByFeature(r));if(o){const v=this.labelDataSource.entities.getById(o.id+"_shadow1"),b=this.shadowEntityMap.get(o),w=((d=r.properties)==null?void 0:d.shipTypeId)??-1,x=shipTypeColorMap.get(w)??shipTypeColorMap.get(-1),[_,T]=r.geometry.coordinates,O=((u=this._viewer)==null?void 0:u.clock.currentTime)??Cesium__namespace.JulianDate.now(),E=(l=o.position)==null?void 0:l.getValue(O),C=Cesium__namespace.Cartesian3.fromDegrees(_,T),R=new Cesium__namespace.SampledPositionProperty;R.backwardExtrapolationType=Cesium__namespace.ExtrapolationType.HOLD,R.forwardExtrapolationType=Cesium__namespace.ExtrapolationType.HOLD;const P=(c=o.properties)==null?void 0:c.getValue().updateTime,k=(h=r.properties)==null?void 0:h.updateTime;if(P&&k&&new Date(k).getTime()-new Date(P).getTime()>=3*1e3*60)R.addSample(O,C);else{const A=Cesium__namespace.JulianDate.addSeconds(O,3,new Cesium__namespace.JulianDate);R.addSample(Cesium__namespace.JulianDate.addSeconds(O,1,new Cesium__namespace.JulianDate),E??C),R.addSample(A,C)}if(o.position=R,b&&(b.position=R),v&&(v.position=R),o.properties)for(const[A,I]of Object.entries(r.properties??{})){if(A=="speedOverGround"){const $=o.properties.getValue().speedOverGround??0,F=Number($)>this.IS_MOVING_THRESHOLD,q=Number(I)>this.IS_MOVING_THRESHOLD;if(F!==q&&(o.billboard&&(o.billboard.image=new Cesium__namespace.ConstantProperty(createShipIconUrl(x,q))),b!=null&&b.plane)){const V=((a=r.properties)==null?void 0:a.designBeam)??8,J=((m=r.properties)==null?void 0:m.designLength)??20,U=createShipIconV2({color:x,isMoving:q,...r.properties,designBeam:V,designLength:J}),K=(y=b.plane)==null?void 0:y.material;K&&(K.image=new Cesium__namespace.ConstantProperty(U.url),b.plane.dimensions=new Cesium__namespace.ConstantProperty(new Cesium__namespace.Cartesian2(V*U.scale.x,J*U.scale.y))),b.plane.dimensions=new Cesium__namespace.CallbackProperty(()=>new Cesium__namespace.Cartesian2(V*U.scale.x,J*U.scale.y),!0)}}if(A=="courseOverGroundTrue"){const $=((g=r.properties)==null?void 0:g.courseOverGroundTrue)??0;o.billboard.rotation=new Cesium__namespace.ConstantProperty(typeof I=="number"?-1*I:0);const F=new Cesium__namespace.ConstantProperty(Cesium__namespace.Transforms.headingPitchRollQuaternion(C,new Cesium__namespace.HeadingPitchRoll($,0,0)));b&&(b.orientation=F)}if(A=="updateTime"){const $=Cesium__namespace.JulianDate.fromDate(new Date(I));o.billboard.color=createAlphaSampled({startTime:$});const F=(p=b==null?void 0:b.plane)==null?void 0:p.material;F&&(F.color=createAlphaSampled({startTime:$}));const q=getHideAfterFiveMinutesProperty($);v!=null&&v.billboard&&(v.billboard.show=q),o.point.show=q}o.properties[A]=I,b!=null&&b.properties&&(b.properties[A]=I)}}else this.renderFeature(r)}renderEntity(r){var m,y,g;const o=(m=r.properties)==null?void 0:m.getValue(),d=(o==null?void 0:o.shipTypeId)??-1,u=shipTypeColorMap.get(d)??shipTypeColorMap.get(-1),l=Number((o==null?void 0:o.speedOverGround)??0),c=o!=null&&o.updateTime?new Date(o.updateTime):new Date,h=Cesium__namespace.JulianDate.fromDate(c),a=createShipIconUrl(u,l>this.IS_MOVING_THRESHOLD);r.point=new Cesium__namespace.PointGraphics({pixelSize:4,color:Cesium__namespace.Color.fromCssColorString("#8AF22C"),disableDepthTestDistance:3e6,distanceDisplayCondition:new Cesium__namespace.DistanceDisplayCondition(15e3),show:getHideAfterFiveMinutesProperty(h)}),r.billboard=new Cesium__namespace.BillboardGraphics({image:a,width:14,height:70,disableDepthTestDistance:3e6,distanceDisplayCondition:new Cesium__namespace.DistanceDisplayCondition(4e3,15e3),pixelOffset:new Cesium__namespace.Cartesian2(0,0),alignedAxis:Cesium__namespace.Cartesian3.UNIT_Z,color:createAlphaSampled({startTime:h}),rotation:new Cesium__namespace.ConstantProperty((g=(y=r.properties)==null?void 0:y.getValue())!=null&&g.courseOverGroundTrue?-1*r.properties.getValue().courseOverGroundTrue:0)}),this.createShipPlane(r)}renderLabelEntity(r){var h,a,m,y,g;const o=(h=r.properties)==null?void 0:h.getValue(),d=o!=null&&o.updateTime?new Date(o.updateTime):new Date,u=Cesium__namespace.JulianDate.fromDate(d),l=((m=(a=r.properties)==null?void 0:a.getValue())==null?void 0:m.name)??((y=r.properties)!=null&&y.getValue().mmsi?"mmsi:"+((g=r.properties)==null?void 0:g.getValue().mmsi):"未知"),c=createRoundedRectImage({text:l});r.billboard=new Cesium__namespace.BillboardGraphics({image:new Cesium__namespace.ConstantProperty(c),scale:new Cesium__namespace.ConstantProperty(1),pixelOffset:new Cesium__namespace.ConstantProperty(new Cesium__namespace.Cartesian2(0,-20)),horizontalOrigin:new Cesium__namespace.ConstantProperty(Cesium__namespace.HorizontalOrigin.CENTER),verticalOrigin:new Cesium__namespace.ConstantProperty(Cesium__namespace.VerticalOrigin.CENTER),distanceDisplayCondition:new Cesium__namespace.DistanceDisplayCondition(0,15e3),disableDepthTestDistance:5e3,show:getHideAfterFiveMinutesProperty(u)})}createShipPlane(r){var p;const o=new Cesium__namespace.Entity({id:r.id+"_shadow",position:r.position,orientation:r.orientation,properties:r.properties});this.shadowEntityMap.set(r,o),this.db.entities.add(o);const d=(p=r.properties)==null?void 0:p.getValue(),u=d!=null&&d.updateTime?new Date(d.updateTime):new Date,l=Cesium__namespace.JulianDate.fromDate(u),c=Number((d==null?void 0:d.speedOverGround)??0),h=(d==null?void 0:d.designLength)??20,a=(d==null?void 0:d.designBeam)??8,m=(d==null?void 0:d.shipTypeId)??-1,y=shipTypeColorMap.get(m)??shipTypeColorMap.get(-1),g=createShipIconV2({color:y,isMoving:c>this.IS_MOVING_THRESHOLD,...d,designBeam:(d==null?void 0:d.designBeam)??8,designLength:(d==null?void 0:d.designLength)??20});o.plane=new Cesium__namespace.PlaneGraphics({plane:new Cesium__namespace.Plane(Cesium__namespace.Cartesian3.UNIT_Z,0),dimensions:new Cesium__namespace.Cartesian2(a*g.scale.x,h*g.scale.y),show:new Cesium__namespace.CallbackProperty(()=>{var x;if(!this._viewer)return!0;const v=this._viewer.clock.currentTime,b=(x=r.position)==null?void 0:x.getValue(v);return b?Cesium__namespace.Cartesian3.distance(this._viewer.camera.positionWC,b)<=4e3:!1},!1),material:new Cesium__namespace.ImageMaterialProperty({image:g.url,transparent:!0,repeat:new Cesium__namespace.Cartesian2(1,1),color:createAlphaSampled({startTime:l})})})}hideEntityByCondition(r){this.hookFilterEntityFn&&this.off("createEntity",this.hookFilterEntityFn),this.hookFilterEntityFn=o=>{const d=(r==null?void 0:r(o))??!0;o.show=d;const u=this.shadowEntityMap.get(o);u&&(u.show=d)},this.db.entities.values.forEach(o=>{var d;(d=this.hookFilterEntityFn)==null||d.call(this,o)}),r&&this.on("createEntity",this.hookFilterEntityFn)}}Cesium.Color.fromCssColorString("#FC4C02");Cesium.Color.WHITE;new Cesium.Color;new Array(4);var e$2=[],t$2=[];function n$2(s,i){if(s&&typeof document<"u"){var r,o=i.prepend===!0?"prepend":"append",d=i.singleTag===!0,u=typeof i.container=="string"?document.querySelector(i.container):document.getElementsByTagName("head")[0];if(d){var l=e$2.indexOf(u);l===-1&&(l=e$2.push(u)-1,t$2[l]={}),r=t$2[l]&&t$2[l][o]?t$2[l][o]:t$2[l][o]=c()}else r=c();s.charCodeAt(0)===65279&&(s=s.substring(1)),r.styleSheet?r.styleSheet.cssText+=s:r.appendChild(document.createTextNode(s))}function c(){var h=document.createElement("style");if(h.setAttribute("type","text/css"),i.attributes)for(var a=Object.keys(i.attributes),m=0;m<a.length;m++)h.setAttribute(a[m],i.attributes[a[m]]);var y=o==="prepend"?"afterbegin":"beforeend";return u.insertAdjacentElement(y,h),h}}var css$2='.cesium-tool-tip{background:rgba(0,0,0,.6);border-radius:4px;color:#fff;left:0;line-height:30px;min-height:30px;min-width:100px;padding:0 10px;pointer-events:none;position:absolute;top:0;visibility:hidden;z-index:-1}.cesium-tool-tip:before{border-bottom:10px solid transparent;border-right:10px solid rgba(0,0,0,.6);border-top:10px solid transparent;content:"";display:block;left:-10px;pointer-events:none;position:absolute;top:calc(50% - 10px)}';n$2(css$2,{});Cesium.Color.YELLOW,Cesium.Color.YELLOW,Cesium.Color.DARKTURQUOISE.withAlpha(.5),Cesium.Color.BLUE,Cesium.Color.WHITE,Cesium.Color.YELLOW.withAlpha(.5),Cesium.Color.YELLOW.withAlpha(.5);Cesium.Color.WHITE,new Cesium.Color(.165,.165,.165,.8),new Cesium.Cartesian2(4,4),Cesium.LabelStyle.FILL_AND_OUTLINE,new Cesium.Cartesian2(4,0),new Cesium.NearFarScalar(1,.85,8e6,.75),Cesium.HeightReference.CLAMP_TO_GROUND;class Popup{constructor(i,r){j(this,"_position");j(this,"_screenPosition",new Cesium.Cartesian2);j(this,"_element");j(this,"_viewer");j(this,"_options");j(this,"_destroyed",!1);j(this,"_offset");j(this,"setPosition",()=>{if(this._position&&this._viewer&&this._position){if(this._viewer.scene.mode===Cesium.SceneMode.SCENE3D){const o=this._viewer.scene.camera.position,d=new Cesium.BoundingSphere(new Cesium.Cartesian3(0,0,0),635e4);if(!new Cesium.Occluder(d,o).isPointVisible(this._position)){this.switchElementShow(!1);return}}const i=Cesium.SceneTransforms.worldToWindowCoordinates(this._viewer.scene,this._position),{_element:r}=this;if(r&&i){if(this._screenPosition&&this._screenPosition.x===i.x&&this._screenPosition.y===i.y)return;this.switchElementShow(!0);const o=i.x-r.clientWidth/2+this._offset[0],d=i.y-r.clientHeight+this._offset[1];r.style.left=`${o}px`,r.style.top=`${d}px`,this._screenPosition=i}}});this._viewer=i,this._options=r;const{position:o,element:d,offset:u}=r;if(!d)throw Error("no element!");this._position=o?Cesium.Cartesian3.fromDegrees(o[0],o[1],o[2]):null,this._element=d,this._offset=[(u==null?void 0:u[0])??0,(u==null?void 0:u[1])??0],this.addMapListener()}set position(i){if(!i){this.switchElementShow(!1),this._position=null,this._options.position=null;return}this._position=Cesium.Cartesian3.fromDegrees(i[0],i[1],i[2]),this._options.position=i,this.setPosition()}get position(){return this._options.position}get destroyed(){return this._destroyed}switchElementShow(i){this._element&&(this._element.style.display=i?"block":"none")}addMapListener(){var i;(i=this._viewer)==null||i.scene.postRender.addEventListener(this.setPosition)}destroy(){this._viewer.isDestroyed()||this._viewer.scene.postRender.removeEventListener(this.setPosition),this.setPosition=void 0,this._destroyed=!0}}var e$1=[],t$1=[];function n$1(s,i){if(s&&typeof document<"u"){var r,o=i.prepend===!0?"prepend":"append",d=i.singleTag===!0,u=typeof i.container=="string"?document.querySelector(i.container):document.getElementsByTagName("head")[0];if(d){var l=e$1.indexOf(u);l===-1&&(l=e$1.push(u)-1,t$1[l]={}),r=t$1[l]&&t$1[l][o]?t$1[l][o]:t$1[l][o]=c()}else r=c();s.charCodeAt(0)===65279&&(s=s.substring(1)),r.styleSheet?r.styleSheet.cssText+=s:r.appendChild(document.createTextNode(s))}function c(){var h=document.createElement("style");if(h.setAttribute("type","text/css"),i.attributes)for(var a=Object.keys(i.attributes),m=0;m<a.length;m++)h.setAttribute(a[m],i.attributes[a[m]]);var y=o==="prepend"?"afterbegin":"beforeend";return u.insertAdjacentElement(y,h),h}}var css$1=".cesium-compass{cursor:pointer;height:60px;pointer-events:auto;position:absolute;right:15px;top:100px;user-select:none;width:60px}.cesium-compass .out-ring{fill:rgba(23,49,71,.702);background-repeat:no-repeat;background-size:contain;border-radius:50%;height:60px;left:0;position:absolute;top:0;transition:all .3s ease;width:60px}.cesium-compass .out-ring svg{height:60px;width:60px}.cesium-compass:hover .rotation_marker svg{height:70.2px;width:70.2px}.cesium-compass .gyro{align-items:center;background:#fff;border-radius:50%;box-sizing:border-box;display:flex;height:30px;justify-content:center;margin:0 auto;padding:4px;position:relative;text-align:center;top:50%;transform:translateY(-50%);transition:all .3s ease;width:30px}.cesium-compass .gyro svg{height:20px;width:20px}.rotation_marker{background-repeat:no-repeat;background-size:contain;border-radius:50%;position:relative}.rotation_marker svg{height:60px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);transition:all .3s ease;width:60px}.cesium-compass .gyro-active,.cesium-compass .gyro:hover{fill:#68adfe}";n$1(css$1,{});var e=[],t=[];function n(s,i){if(s&&typeof document<"u"){var r,o=i.prepend===!0?"prepend":"append",d=i.singleTag===!0,u=typeof i.container=="string"?document.querySelector(i.container):document.getElementsByTagName("head")[0];if(d){var l=e.indexOf(u);l===-1&&(l=e.push(u)-1,t[l]={}),r=t[l]&&t[l][o]?t[l][o]:t[l][o]=c()}else r=c();s.charCodeAt(0)===65279&&(s=s.substring(1)),r.styleSheet?r.styleSheet.cssText+=s:r.appendChild(document.createTextNode(s))}function c(){var h=document.createElement("style");if(h.setAttribute("type","text/css"),i.attributes)for(var a=Object.keys(i.attributes),m=0;m<a.length;m++)h.setAttribute(a[m],i.attributes[a[m]]);var y=o==="prepend"?"afterbegin":"beforeend";return u.insertAdjacentElement(y,h),h}}var css=".cesium-zoom-controller{border-radius:100px;box-sizing:border-box;display:flex;flex-direction:column;line-height:1.2rem;pointer-events:auto;position:absolute;right:30px;text-align:center;top:187px;user-select:none}.cesium-zoom-controller .refresh,.cesium-zoom-controller .zoom-in,.cesium-zoom-controller .zoom-out{border-radius:14%;margin-bottom:5px}.cesium-zoom-controller .cesium-button{background:#2a2e39;border:none;margin-right:0;transition:all .3s cubic-bezier(.645,.045,.355,1);transition-delay:0s;transition-duration:.2s;transition-property:all;transition-timing-function:cubic-bezier(.645,.045,.355,1)}.cesium-zoom-controller .cesium-button:hover{background:#48b;box-shadow:none}.cesium-zoom-controller .cesium-button:active{fill:#edffff;background:#adf;color:#edffff}.cesium-zoom-controller .cesium-toolbar-button{align-items:center;display:flex;height:30px;justify-content:center;width:30px}";n(css,{});var heatmap$1={exports:{}},heatmap=heatmap$1.exports,hasRequiredHeatmap;function requireHeatmap(){return hasRequiredHeatmap||(hasRequiredHeatmap=1,function(s){(function(i,r,o){s.exports?s.exports=o():r[i]=o()})("h337",heatmap,function(){var i={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},r=function(){var a=function(g){this._coordinator={},this._data=[],this._radi=[],this._min=10,this._max=1,this._xField=g.xField||g.defaultXField,this._yField=g.yField||g.defaultYField,this._valueField=g.valueField||g.defaultValueField,g.radius&&(this._cfgRadius=g.radius)},m=i.defaultRadius;return a.prototype={_organiseData:function(y,g){var p=y[this._xField],v=y[this._yField],b=this._radi,w=this._data,x=this._max,_=this._min,T=y[this._valueField]||1,O=y.radius||this._cfgRadius||m;w[p]||(w[p]=[],b[p]=[]),w[p][v]?w[p][v]+=T:(w[p][v]=T,b[p][v]=O);var E=w[p][v];return E>x?(g?this.setDataMax(E):this._max=E,!1):E<_?(g?this.setDataMin(E):this._min=E,!1):{x:p,y:v,value:T,radius:O,min:_,max:x}},_unOrganizeData:function(){var y=[],g=this._data,p=this._radi;for(var v in g)for(var b in g[v])y.push({x:v,y:b,radius:p[v][b],value:g[v][b]});return{min:this._min,max:this._max,data:y}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var y=arguments[0],g=y.length;g--;)this.addData.call(this,y[g]);else{var p=this._organiseData(arguments[0],!0);p&&(this._data.length===0&&(this._min=this._max=p.value),this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[p]}))}return this},setData:function(y){var g=y.data,p=g.length;this._data=[],this._radi=[];for(var v=0;v<p;v++)this._organiseData(g[v],!1);return this._max=y.max,this._min=y.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(y){return this._max=y,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(y){return this._min=y,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(y){this._coordinator=y},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},a}(),o=function(){var a=function(p){var v=p.gradient||p.defaultGradient,b=document.createElement("canvas"),w=b.getContext("2d",{willReadFrequently:!0});b.width=256,b.height=1;var x=w.createLinearGradient(0,0,256,1);for(var _ in v)x.addColorStop(_,v[_]);return w.fillStyle=x,w.fillRect(0,0,256,1),w.getImageData(0,0,256,1).data},m=function(p,v){var b=document.createElement("canvas"),w=b.getContext("2d",{willReadFrequently:!0}),x=p,_=p;if(b.width=b.height=p*2,v==1)w.beginPath(),w.arc(x,_,p,0,2*Math.PI,!1),w.fillStyle="rgba(0,0,0,1)",w.fill();else{var T=w.createRadialGradient(x,_,p*v,x,_,p);T.addColorStop(0,"rgba(0,0,0,1)"),T.addColorStop(1,"rgba(0,0,0,0)"),w.fillStyle=T,w.fillRect(0,0,2*p,2*p)}return b},y=function(_){for(var v=[],b=_.min,w=_.max,x=_.radi,_=_.data,T=Object.keys(_),O=T.length;O--;)for(var E=T[O],C=Object.keys(_[E]),R=C.length;R--;){var P=C[R],k=_[E][P],A=x[E][P];v.push({x:E,y:P,value:k,radius:A})}return{min:b,max:w,data:v}};function g(p){var v=p.container,b=this.shadowCanvas=document.createElement("canvas"),w=this.canvas=p.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0];var x=getComputedStyle(p.container)||{};w.className="heatmap-canvas",this._width=w.width=b.width=p.width||+x.width.replace(/px/,""),this._height=w.height=b.height=p.height||+x.height.replace(/px/,""),this.shadowCtx=b.getContext("2d",{willReadFrequently:!0}),this.ctx=w.getContext("2d",{willReadFrequently:!0}),w.style.cssText=b.style.cssText="position:absolute;left:0;top:0;",v.style.position="relative",v.appendChild(w),this._palette=a(p),this._templates={},this._setStyles(p)}return g.prototype={renderPartial:function(p){p.data.length>0&&(this._drawAlpha(p),this._colorize())},renderAll:function(p){this._clear(),p.data.length>0&&(this._drawAlpha(y(p)),this._colorize())},_updateGradient:function(p){this._palette=a(p)},updateConfig:function(p){p.gradient&&this._updateGradient(p),this._setStyles(p)},setDimensions:function(p,v){this._width=p,this._height=v,this.canvas.width=this.shadowCanvas.width=p,this.canvas.height=this.shadowCanvas.height=v},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(p){this._blur=p.blur==0?0:p.blur||p.defaultBlur,p.backgroundColor&&(this.canvas.style.backgroundColor=p.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=p.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=p.height||this._height,this._opacity=(p.opacity||0)*255,this._maxOpacity=(p.maxOpacity||p.defaultMaxOpacity)*255,this._minOpacity=(p.minOpacity||p.defaultMinOpacity)*255,this._useGradientOpacity=!!p.useGradientOpacity},_drawAlpha:function(w){for(var v=this._min=w.min,b=this._max=w.max,w=w.data||[],x=w.length,_=1-this._blur;x--;){var T=w[x],O=T.x,E=T.y,C=T.radius,R=Math.min(T.value,b),P=O-C,k=E-C,A=this.shadowCtx,I;this._templates[C]?I=this._templates[C]:this._templates[C]=I=m(C,_);var $=(R-v)/(b-v);A.globalAlpha=$<.01?.01:$,A.drawImage(I,P,k),P<this._renderBoundaries[0]&&(this._renderBoundaries[0]=P),k<this._renderBoundaries[1]&&(this._renderBoundaries[1]=k),P+2*C>this._renderBoundaries[2]&&(this._renderBoundaries[2]=P+2*C),k+2*C>this._renderBoundaries[3]&&(this._renderBoundaries[3]=k+2*C)}},_colorize:function(){var p=this._renderBoundaries[0],v=this._renderBoundaries[1],b=this._renderBoundaries[2]-p,w=this._renderBoundaries[3]-v,x=this._width,_=this._height,T=this._opacity,O=this._maxOpacity,E=this._minOpacity,C=this._useGradientOpacity;p<0&&(p=0),v<0&&(v=0),p+b>x&&(b=x-p),v+w>_&&(w=_-v);for(var R=this.shadowCtx.getImageData(p,v,b,w),P=R.data,k=P.length,A=this._palette,I=3;I<k;I+=4){var $=P[I],F=$*4;if(F){var q;T>0?q=T:$<O?$<E?q=E:q=$:q=O,P[I-3]=A[F],P[I-2]=A[F+1],P[I-1]=A[F+2],P[I]=C?A[F+3]:q}}this.ctx.putImageData(R,p,v),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(p){var v,b=this.shadowCtx,w=b.getImageData(p.x,p.y,1,1),x=w.data[3],_=this._max,T=this._min;return v=Math.abs(_-T)*(x/255)>>0,v},getDataURL:function(){return this.canvas.toDataURL()}},g}(),d=function(){var a=!1;return i.defaultRenderer==="canvas2d"&&(a=o),a}(),u={merge:function(){for(var h={},a=arguments.length,m=0;m<a;m++){var y=arguments[m];for(var g in y)h[g]=y[g]}return h}},l=function(){var a=function(){function p(){this.cStore={}}return p.prototype={on:function(v,b,w){var x=this.cStore;x[v]||(x[v]=[]),x[v].push(function(_){return b.call(w,_)})},emit:function(v,b){var w=this.cStore;if(w[v])for(var x=w[v].length,_=0;_<x;_++){var T=w[v][_];T(b)}}},p}(),m=function(g){var p=g._renderer,v=g._coordinator,b=g._store;v.on("renderpartial",p.renderPartial,p),v.on("renderall",p.renderAll,p),v.on("extremachange",function(w){g._config.onExtremaChange&&g._config.onExtremaChange({min:w.min,max:w.max,gradient:g._config.gradient||g._config.defaultGradient})}),b.setCoordinator(v)};function y(){var g=this._config=u.merge(i,arguments[0]||{});if(this._coordinator=new a,g.plugin){var p=g.plugin;if(i.plugins[p]){var v=i.plugins[p];this._renderer=new v.renderer(g),this._store=new v.store(g)}else throw new Error("Plugin '"+p+"' not found. Maybe it was not registered.")}else this._renderer=new d(g),this._store=new r(g);m(this)}return y.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(g){return this._config=u.merge(this._config,g),this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(g){return this._store.getValueAt?this._store.getValueAt(g):this._renderer.getValueAt?this._renderer.getValueAt(g):null}},y}(),c={create:function(h){return new l(h)},register:function(h,a){i.plugins[h]=a}};return c})}(heatmap$1)),heatmap$1.exports}requireHeatmap();const X=class X extends EventEmitter{constructor(){super();j(this,"popupMap",new Map)}static getInstance(){return X.instance||(X.instance=new X),X.instance}popup(r){var c;const o=r.element;o.style.position="absolute";const d=r.viewer.container,u=()=>{l&&(l.destroy(),d.removeChild(o),this.popupMap.delete(r.id),this.emit("onUnmount",r.id))};d.appendChild(o),this.emit("onMount",r.id),(c=this.popupMap.get(r.id))==null||c.destroy();const l=new Popup(r.viewer,{position:r.position,offset:r.offset??[0,0],element:o});this.popupMap.set(r.id,{popup:l,destroy:u})}close(r){const o=this.popupMap.get(r);o&&(o.destroy(),this.popupMap.delete(r),this.emit("onUnmount",r))}closeAll(){this.popupMap.forEach(r=>r.destroy()),this.popupMap.clear()}};j(X,"instance",null);let PopupCtrl=X;function saveCameraParams(s){const i=s.camera;return{position:i.position,direction:i.direction,up:i.up,right:i.right,transform:i.transform}}function flyToCameraParams(s,i,r=1){s.camera.flyTo({destination:i.position,orientation:{direction:i.direction,up:i.up,right:i.right},duration:r})}const memoizeMap=new WeakMap;function ListenLeftClick(s){if(memoizeMap.has(s))return memoizeMap.get(s);const i=new EventEmitter;return new Cesium__namespace.ScreenSpaceEventHandler(s.scene.canvas).setInputAction(o=>{i.emit("click",o)},Cesium__namespace.ScreenSpaceEventType.LEFT_CLICK),memoizeMap.set(s,i),i}exports.ListenLeftClick=ListenLeftClick;exports.PopupCtrl=PopupCtrl;exports.ShipLayer=ShipLayer;exports.WmsLayer=WmsLayer;exports.WmsLayerController=WmsLayerController;exports.createTdtProvider=createTdtProvider;exports.createTdtTerrain=createTdtTerrain;exports.flyToCameraParams=flyToCameraParams;exports.invertToCanvas=invertToCanvas;exports.saveCameraParams=saveCameraParams;
76
+ <image id="img_1" width="${i}" height="${146/124*i}" transform="translate(${-i/2+a.x} ${a.y})" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHwAAACSCAMAAACwjl5+AAAAq1BMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Nr6iZAAAAOXRSTlMABRshFgkSZg5qJmFdWlEqOXBFPYVJQYB1VXtNLpc1mzKguZCKtJONxc69yaukwa/SqN/k1trs6fBhRQqRAAAVcElEQVR42rSX3ZKaQBCFgxoIICh/ggjiIMPPMAOy6yZ5/yfLaTBVSa5istu1Vepe+M3p7jkHPz1Vmqav99umYLxsh7bvO6oeb8ZR1XUS7TaftU8fVdqX9cWpGBt5WeJvKbwbOJvyujEPlv5RcLBXZyesc1lyMSk5qWmS0zQxNQrGVF2Fpv9hdOg+2HFzZZwPQjFWFAxV4FUNJd5VcWr4u4+hgx0YcVgVchRtOSmW50wpVoA+lS0vWB6mifkxdE2H7jSOazaVfYtJo91yHKVSUmLq/Yihp2Zi09a9N1rb7Hxi07oN/dAOgnMwB4F9E3jtW1Y1oWea2yhbve/Oa583WWR4SRLnGHAPVkd3bblpA70XvcjDKjVs24ku70rX9NU5OgIeV9ect0L03a3rbve3l5e3+6273Vp0opVVmnrG1jkFl9UX7R3HfY5c2zCTOLxKNHzobzdCv3779voK/ls3tOi+ihPPcI5uFGRrXdPeZ8t16+y7zpbgVcHFWLb9fUZ/RX0D/e2txew5zxPTcNzIP+xBR+vfgb2x9oeTe3Rs04sLXuKmDWg5sb+jFnqH9ZejrL3t1o0Oh+CcrWG1/4v//GW1OwfR6XRybC+5SrBLPnTd/YXYC/3l7XYfJB+VVA3aHgX7/fli/TddA3ud7Q++758cI6kUVwo3rOu7t9/ht46rETe/iA3Az5cs261X+hfQ/4Otb9a7bB/sA9+1zbCYGIOx4FID/voV9AWOje8GxSaY3jW1XYzcsnbWf9E1DfNeW1l2yc6B75hxDjNVk6Q4Rdtp3x4zv3dt23Oy+bquUvsUZNYa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"/>
77
+ </svg>`;return{url:URL.createObjectURL(new Blob([b],{type:"image/svg+xml"})),viewBox:p,scale:v}},s=>`${s.color},${s.isMoving},${s.designBeam??0},${s.designLength??0},${s.aisFromBow??0},${s.aisFromCenter??0}`),shipTypeColorMap=new Map([[-1,"#00FF00"],[70,"#95B3D7"],[37,"#00FF00"],[50,"#366092"],[51,"#366092"],[52,"#366092"],[53,"#366092"],[54,"#366092"],[55,"#366092"],[56,"#366092"],[57,"#366092"],[58,"#366092"],[59,"#366092"],[80,"red"],[81,"red"],[82,"red"],[83,"red"],[84,"red"],[85,"red"],[86,"red"],[87,"red"],[88,"red"],[89,"red"]]);function createAlphaSampled(s){const i=new Cesium__namespace.SampledProperty(Cesium__namespace.Color),r=(s==null?void 0:s.startTime)??Cesium__namespace.JulianDate.now(),a=Cesium__namespace.JulianDate.addMinutes(r,1,new Cesium__namespace.JulianDate),d=Cesium__namespace.JulianDate.addMinutes(r,5,new Cesium__namespace.JulianDate),u=Cesium__namespace.JulianDate.fromIso8601("2100-01-01T00:00:00Z"),l=(s==null?void 0:s.color)??Cesium__namespace.Color.WHITE;return i.addSample(r,l.withAlpha(1)),i.addSample(a,l.withAlpha(1)),i.addSample(d,l.withAlpha(.2)),i.addSample(u,l.withAlpha(.1)),i}function getHideAfterFiveMinutesProperty(s){const i=s??Cesium__namespace.JulianDate.now(),r=Cesium__namespace.JulianDate.addMinutes(i,5,new Cesium__namespace.JulianDate);return new Cesium__namespace.CallbackProperty(a=>a?Cesium__namespace.JulianDate.lessThan(a,r):!0,!1)}function createRoundedRectImage({text:s="未知",fill:i="#5582DF",stroke:r="#FFFFFF",strokeWidth:a=2,textColor:d="#FFFFFF",fontFamily:u="微软雅黑, Segoe UI, Helvetica, Arial, sans-serif",fontWeight:l="normal",fontSize:c=12,padding:h=6,radius:o=5}={}){const m=Math.max(0,s.length*c*.6+h*2),y=c*1.6,g=2,p=Math.ceil(a/2)+1,v=m+p*2,b=y+p*2,w=document.createElement("canvas");w.width=Math.round(v*g),w.height=Math.round(b*g),w.style.width=`${v}px`,w.style.height=`${b}px`;const x=w.getContext("2d");if(!x)throw new Error("无法获取2D绘图上下文");x.scale(g,g),x.clearRect(0,0,v,b),x.lineJoin="round",x.lineCap="round";const _=p,T=p,O=v-p,E=b-p,C=O-_,R=E-T,P=Math.min(o,Math.min(C,R)/2);x.beginPath(),x.moveTo(_+P,T),x.lineTo(O-P,T),x.quadraticCurveTo(O,T,O,T+P),x.lineTo(O,E-P),x.quadraticCurveTo(O,E,O-P,E),x.lineTo(_+P,E),x.quadraticCurveTo(_,E,_,E-P),x.lineTo(_,T+P),x.quadraticCurveTo(_,T,_+P,T),x.closePath(),i&&i!=="transparent"&&(x.fillStyle=i,x.fill()),x.lineWidth=a,x.strokeStyle=r,x.stroke();const k=Math.max(0,m-h*2);let A=c;for(x.fillStyle=d,x.textAlign="center",x.textBaseline="middle",x.font=`${l} ${A}px ${u}`;x.measureText(s).width>k&&A>10;)A-=1,x.font=`${l} ${A}px ${u}`;return x.fillText(s,v/2,b/2+1),w}function hookClusterEvent(s){s.clustering.clusterEvent.addEventListener((r,a)=>{const d=r[0],u=d.billboard,l=d.label,c=d.point;a.label.show=!1,a.point.show=!1,u&&(a.billboard=Cesium__namespace.clone(u)),l&&(a.label=Cesium__namespace.clone(l)),c?a.point=Cesium__namespace.clone(c):(a.billboard.show=!0,a.billboard.image=Cesium__namespace.buildModuleUrl("Widgets/Images/clusterIcon.png"))})}class ShipLayer extends EventEmitter{constructor(r,a,d){var u,l,c;super();j(this,"db");j(this,"labelDataSource",new Cesium__namespace.CustomDataSource("ship-labels"));j(this,"isMounted",!1);j(this,"_viewer",null);j(this,"entityMap",new Map);j(this,"IS_MOVING_THRESHOLD",1);j(this,"shadowEntityMap",new WeakMap);j(this,"hookFilterEntityFn");this.key=r,this.zIndex=a,this.db=new Cesium__namespace.CustomDataSource(r),this.labelDataSource.clustering.enabled=((u=d==null?void 0:d.clustering)==null?void 0:u.enabled)??!0,this.labelDataSource.clustering.pixelRange=((l=d==null?void 0:d.clustering)==null?void 0:l.pixelRange)??15,this.labelDataSource.clustering.minimumClusterSize=((c=d==null?void 0:d.clustering)==null?void 0:c.minimumClusterSize)??2,hookClusterEvent(this.labelDataSource)}show(r){this.isMounted||(r.dataSources.add(this.db),r.dataSources.add(this.labelDataSource),this._viewer=r,this.isMounted=!0),this.db.show=!0}hide(){this.isMounted&&(this.db.show=!1,this.labelDataSource.show=!1)}contain(r){const a=r.id.replace(/_shadow\d*$/,"");return this.entityMap.has(a)}render(r){r.features.forEach(a=>{this.renderFeature(a)})}getIdByFeature(r){var d;const a=String(((d=r.properties)==null?void 0:d.mmsi)??r.id);if(!a)throw new Error("feature必须有mmsi或id");return"ship_mmsi_"+a}renderFeature(r){var o,m;const a=this.getIdByFeature(r),d=new Cesium__namespace.SampledPositionProperty;d.backwardExtrapolationType=Cesium__namespace.ExtrapolationType.HOLD,d.forwardExtrapolationType=Cesium__namespace.ExtrapolationType.HOLD;const u=Cesium__namespace.Cartesian3.fromDegrees(r.geometry.coordinates[0],r.geometry.coordinates[1]);d.addSample(((o=this._viewer)==null?void 0:o.clock.currentTime)??Cesium__namespace.JulianDate.now(),u);const l=((m=r.properties)==null?void 0:m.courseOverGroundTrue)??0,c=new Cesium__namespace.Entity({id:a,position:d,orientation:new Cesium__namespace.ConstantProperty(Cesium__namespace.Transforms.headingPitchRollQuaternion(u,new Cesium__namespace.HeadingPitchRoll(l,0,0))),properties:r.properties??{}});this.entityMap.set(a,c),this.db.entities.add(c),this.renderEntity(c);const h=new Cesium__namespace.Entity({id:a+"_shadow1",position:d,properties:r.properties??{}});this.labelDataSource.entities.add(h),this.renderLabelEntity(h),this.emit("createEntity",c)}update(r){var d,u,l,c,h,o,m,y,g,p;const a=this.db.entities.getById(this.getIdByFeature(r));if(a){const v=this.labelDataSource.entities.getById(a.id+"_shadow1"),b=this.shadowEntityMap.get(a),w=((d=r.properties)==null?void 0:d.shipTypeId)??-1,x=shipTypeColorMap.get(w)??shipTypeColorMap.get(-1),[_,T]=r.geometry.coordinates,O=((u=this._viewer)==null?void 0:u.clock.currentTime)??Cesium__namespace.JulianDate.now(),E=(l=a.position)==null?void 0:l.getValue(O),C=Cesium__namespace.Cartesian3.fromDegrees(_,T),R=new Cesium__namespace.SampledPositionProperty;R.backwardExtrapolationType=Cesium__namespace.ExtrapolationType.HOLD,R.forwardExtrapolationType=Cesium__namespace.ExtrapolationType.HOLD;const P=(c=a.properties)==null?void 0:c.getValue().updateTime,k=(h=r.properties)==null?void 0:h.updateTime;if(P&&k&&new Date(k).getTime()-new Date(P).getTime()>=3*1e3*60)R.addSample(O,C);else{const A=Cesium__namespace.JulianDate.addSeconds(O,3,new Cesium__namespace.JulianDate);R.addSample(Cesium__namespace.JulianDate.addSeconds(O,1,new Cesium__namespace.JulianDate),E??C),R.addSample(A,C)}if(a.position=R,b&&(b.position=R),v&&(v.position=R),a.properties)for(const[A,I]of Object.entries(r.properties??{})){if(A=="speedOverGround"){const $=a.properties.getValue().speedOverGround??0,F=Number($)>this.IS_MOVING_THRESHOLD,q=Number(I)>this.IS_MOVING_THRESHOLD;if(F!==q&&(a.billboard&&(a.billboard.image=new Cesium__namespace.ConstantProperty(createShipIconUrl(x,q))),b!=null&&b.plane)){const V=((o=r.properties)==null?void 0:o.designBeam)??8,J=((m=r.properties)==null?void 0:m.designLength)??20,U=createShipIconV2({color:x,isMoving:q,...r.properties,designBeam:V,designLength:J}),K=(y=b.plane)==null?void 0:y.material;K&&(K.image=new Cesium__namespace.ConstantProperty(U.url),b.plane.dimensions=new Cesium__namespace.ConstantProperty(new Cesium__namespace.Cartesian2(V*U.scale.x,J*U.scale.y))),b.plane.dimensions=new Cesium__namespace.CallbackProperty(()=>new Cesium__namespace.Cartesian2(V*U.scale.x,J*U.scale.y),!0)}}if(A=="courseOverGroundTrue"){const $=((g=r.properties)==null?void 0:g.courseOverGroundTrue)??0;a.billboard.rotation=new Cesium__namespace.ConstantProperty(typeof I=="number"?-1*I:0);const F=new Cesium__namespace.ConstantProperty(Cesium__namespace.Transforms.headingPitchRollQuaternion(C,new Cesium__namespace.HeadingPitchRoll($,0,0)));b&&(b.orientation=F)}if(A=="updateTime"){const $=Cesium__namespace.JulianDate.fromDate(new Date(I));a.billboard.color=createAlphaSampled({startTime:$});const F=(p=b==null?void 0:b.plane)==null?void 0:p.material;F&&(F.color=createAlphaSampled({startTime:$}));const q=getHideAfterFiveMinutesProperty($);v!=null&&v.billboard&&(v.billboard.show=q),a.point.show=q}a.properties[A]=I,b!=null&&b.properties&&(b.properties[A]=I)}}else this.renderFeature(r)}renderEntity(r){var m,y,g;const a=(m=r.properties)==null?void 0:m.getValue(),d=(a==null?void 0:a.shipTypeId)??-1,u=shipTypeColorMap.get(d)??shipTypeColorMap.get(-1),l=Number((a==null?void 0:a.speedOverGround)??0),c=a!=null&&a.updateTime?new Date(a.updateTime):new Date,h=Cesium__namespace.JulianDate.fromDate(c),o=createShipIconUrl(u,l>this.IS_MOVING_THRESHOLD);r.point=new Cesium__namespace.PointGraphics({pixelSize:4,color:Cesium__namespace.Color.fromCssColorString("#8AF22C"),disableDepthTestDistance:3e6,distanceDisplayCondition:new Cesium__namespace.DistanceDisplayCondition(15e3),show:getHideAfterFiveMinutesProperty(h)}),r.billboard=new Cesium__namespace.BillboardGraphics({image:o,width:14,height:70,disableDepthTestDistance:3e6,distanceDisplayCondition:new Cesium__namespace.DistanceDisplayCondition(4e3,15e3),pixelOffset:new Cesium__namespace.Cartesian2(0,0),alignedAxis:Cesium__namespace.Cartesian3.UNIT_Z,color:createAlphaSampled({startTime:h}),rotation:new Cesium__namespace.ConstantProperty((g=(y=r.properties)==null?void 0:y.getValue())!=null&&g.courseOverGroundTrue?-1*r.properties.getValue().courseOverGroundTrue:0)}),this.createShipPlane(r)}renderLabelEntity(r){var h,o,m,y,g;const a=(h=r.properties)==null?void 0:h.getValue(),d=a!=null&&a.updateTime?new Date(a.updateTime):new Date,u=Cesium__namespace.JulianDate.fromDate(d),l=((m=(o=r.properties)==null?void 0:o.getValue())==null?void 0:m.name)??((y=r.properties)!=null&&y.getValue().mmsi?"mmsi:"+((g=r.properties)==null?void 0:g.getValue().mmsi):"未知"),c=createRoundedRectImage({text:l});r.billboard=new Cesium__namespace.BillboardGraphics({image:new Cesium__namespace.ConstantProperty(c),width:new Cesium__namespace.ConstantProperty(Number(c.style.width.replace("px",""))),height:new Cesium__namespace.ConstantProperty(Number(c.style.height.replace("px",""))),scale:new Cesium__namespace.ConstantProperty(1),pixelOffset:new Cesium__namespace.ConstantProperty(new Cesium__namespace.Cartesian2(0,-20)),horizontalOrigin:new Cesium__namespace.ConstantProperty(Cesium__namespace.HorizontalOrigin.CENTER),verticalOrigin:new Cesium__namespace.ConstantProperty(Cesium__namespace.VerticalOrigin.CENTER),distanceDisplayCondition:new Cesium__namespace.DistanceDisplayCondition(0,15e3),disableDepthTestDistance:5e3,show:getHideAfterFiveMinutesProperty(u)})}createShipPlane(r){var p;const a=new Cesium__namespace.Entity({id:r.id+"_shadow",position:r.position,orientation:r.orientation,properties:r.properties});this.shadowEntityMap.set(r,a),this.db.entities.add(a);const d=(p=r.properties)==null?void 0:p.getValue(),u=d!=null&&d.updateTime?new Date(d.updateTime):new Date,l=Cesium__namespace.JulianDate.fromDate(u),c=Number((d==null?void 0:d.speedOverGround)??0),h=(d==null?void 0:d.designLength)??20,o=(d==null?void 0:d.designBeam)??8,m=(d==null?void 0:d.shipTypeId)??-1,y=shipTypeColorMap.get(m)??shipTypeColorMap.get(-1),g=createShipIconV2({color:y,isMoving:c>this.IS_MOVING_THRESHOLD,...d,designBeam:(d==null?void 0:d.designBeam)??8,designLength:(d==null?void 0:d.designLength)??20});a.plane=new Cesium__namespace.PlaneGraphics({plane:new Cesium__namespace.Plane(Cesium__namespace.Cartesian3.UNIT_Z,0),dimensions:new Cesium__namespace.Cartesian2(o*g.scale.x,h*g.scale.y),show:new Cesium__namespace.CallbackProperty(()=>{var x;if(!this._viewer)return!0;const v=this._viewer.clock.currentTime,b=(x=r.position)==null?void 0:x.getValue(v);return b?Cesium__namespace.Cartesian3.distance(this._viewer.camera.positionWC,b)<=4e3:!1},!1),material:new Cesium__namespace.ImageMaterialProperty({image:g.url,transparent:!0,repeat:new Cesium__namespace.Cartesian2(1,1),color:createAlphaSampled({startTime:l})})})}hideEntityByCondition(r){this.hookFilterEntityFn&&this.off("createEntity",this.hookFilterEntityFn),this.hookFilterEntityFn=a=>{const d=(r==null?void 0:r(a))??!0;a.show=d;const u=this.shadowEntityMap.get(a);u&&(u.show=d)},this.db.entities.values.forEach(a=>{var d;(d=this.hookFilterEntityFn)==null||d.call(this,a)}),r&&this.on("createEntity",this.hookFilterEntityFn)}}Cesium.Color.fromCssColorString("#FC4C02");Cesium.Color.WHITE;new Cesium.Color;new Array(4);var e$2=[],t$2=[];function n$2(s,i){if(s&&typeof document<"u"){var r,a=i.prepend===!0?"prepend":"append",d=i.singleTag===!0,u=typeof i.container=="string"?document.querySelector(i.container):document.getElementsByTagName("head")[0];if(d){var l=e$2.indexOf(u);l===-1&&(l=e$2.push(u)-1,t$2[l]={}),r=t$2[l]&&t$2[l][a]?t$2[l][a]:t$2[l][a]=c()}else r=c();s.charCodeAt(0)===65279&&(s=s.substring(1)),r.styleSheet?r.styleSheet.cssText+=s:r.appendChild(document.createTextNode(s))}function c(){var h=document.createElement("style");if(h.setAttribute("type","text/css"),i.attributes)for(var o=Object.keys(i.attributes),m=0;m<o.length;m++)h.setAttribute(o[m],i.attributes[o[m]]);var y=a==="prepend"?"afterbegin":"beforeend";return u.insertAdjacentElement(y,h),h}}var css$2='.cesium-tool-tip{background:rgba(0,0,0,.6);border-radius:4px;color:#fff;left:0;line-height:30px;min-height:30px;min-width:100px;padding:0 10px;pointer-events:none;position:absolute;top:0;visibility:hidden;z-index:-1}.cesium-tool-tip:before{border-bottom:10px solid transparent;border-right:10px solid rgba(0,0,0,.6);border-top:10px solid transparent;content:"";display:block;left:-10px;pointer-events:none;position:absolute;top:calc(50% - 10px)}';n$2(css$2,{});Cesium.Color.YELLOW,Cesium.Color.YELLOW,Cesium.Color.DARKTURQUOISE.withAlpha(.5),Cesium.Color.BLUE,Cesium.Color.WHITE,Cesium.Color.YELLOW.withAlpha(.5),Cesium.Color.YELLOW.withAlpha(.5);Cesium.Color.WHITE,new Cesium.Color(.165,.165,.165,.8),new Cesium.Cartesian2(4,4),Cesium.LabelStyle.FILL_AND_OUTLINE,new Cesium.Cartesian2(4,0),new Cesium.NearFarScalar(1,.85,8e6,.75),Cesium.HeightReference.CLAMP_TO_GROUND;class Popup{constructor(i,r){j(this,"_position");j(this,"_screenPosition",new Cesium.Cartesian2);j(this,"_element");j(this,"_viewer");j(this,"_options");j(this,"_destroyed",!1);j(this,"_offset");j(this,"setPosition",()=>{if(this._position&&this._viewer&&this._position){if(this._viewer.scene.mode===Cesium.SceneMode.SCENE3D){const a=this._viewer.scene.camera.position,d=new Cesium.BoundingSphere(new Cesium.Cartesian3(0,0,0),635e4);if(!new Cesium.Occluder(d,a).isPointVisible(this._position)){this.switchElementShow(!1);return}}const i=Cesium.SceneTransforms.worldToWindowCoordinates(this._viewer.scene,this._position),{_element:r}=this;if(r&&i){if(this._screenPosition&&this._screenPosition.x===i.x&&this._screenPosition.y===i.y)return;this.switchElementShow(!0);const a=i.x-r.clientWidth/2+this._offset[0],d=i.y-r.clientHeight+this._offset[1];r.style.left=`${a}px`,r.style.top=`${d}px`,this._screenPosition=i}}});this._viewer=i,this._options=r;const{position:a,element:d,offset:u}=r;if(!d)throw Error("no element!");this._position=a?Cesium.Cartesian3.fromDegrees(a[0],a[1],a[2]):null,this._element=d,this._offset=[(u==null?void 0:u[0])??0,(u==null?void 0:u[1])??0],this.addMapListener()}set position(i){if(!i){this.switchElementShow(!1),this._position=null,this._options.position=null;return}this._position=Cesium.Cartesian3.fromDegrees(i[0],i[1],i[2]),this._options.position=i,this.setPosition()}get position(){return this._options.position}get destroyed(){return this._destroyed}switchElementShow(i){this._element&&(this._element.style.display=i?"block":"none")}addMapListener(){var i;(i=this._viewer)==null||i.scene.postRender.addEventListener(this.setPosition)}destroy(){this._viewer.isDestroyed()||this._viewer.scene.postRender.removeEventListener(this.setPosition),this.setPosition=void 0,this._destroyed=!0}}var e$1=[],t$1=[];function n$1(s,i){if(s&&typeof document<"u"){var r,a=i.prepend===!0?"prepend":"append",d=i.singleTag===!0,u=typeof i.container=="string"?document.querySelector(i.container):document.getElementsByTagName("head")[0];if(d){var l=e$1.indexOf(u);l===-1&&(l=e$1.push(u)-1,t$1[l]={}),r=t$1[l]&&t$1[l][a]?t$1[l][a]:t$1[l][a]=c()}else r=c();s.charCodeAt(0)===65279&&(s=s.substring(1)),r.styleSheet?r.styleSheet.cssText+=s:r.appendChild(document.createTextNode(s))}function c(){var h=document.createElement("style");if(h.setAttribute("type","text/css"),i.attributes)for(var o=Object.keys(i.attributes),m=0;m<o.length;m++)h.setAttribute(o[m],i.attributes[o[m]]);var y=a==="prepend"?"afterbegin":"beforeend";return u.insertAdjacentElement(y,h),h}}var css$1=".cesium-compass{cursor:pointer;height:60px;pointer-events:auto;position:absolute;right:15px;top:100px;user-select:none;width:60px}.cesium-compass .out-ring{fill:rgba(23,49,71,.702);background-repeat:no-repeat;background-size:contain;border-radius:50%;height:60px;left:0;position:absolute;top:0;transition:all .3s ease;width:60px}.cesium-compass .out-ring svg{height:60px;width:60px}.cesium-compass:hover .rotation_marker svg{height:70.2px;width:70.2px}.cesium-compass .gyro{align-items:center;background:#fff;border-radius:50%;box-sizing:border-box;display:flex;height:30px;justify-content:center;margin:0 auto;padding:4px;position:relative;text-align:center;top:50%;transform:translateY(-50%);transition:all .3s ease;width:30px}.cesium-compass .gyro svg{height:20px;width:20px}.rotation_marker{background-repeat:no-repeat;background-size:contain;border-radius:50%;position:relative}.rotation_marker svg{height:60px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);transition:all .3s ease;width:60px}.cesium-compass .gyro-active,.cesium-compass .gyro:hover{fill:#68adfe}";n$1(css$1,{});var e=[],t=[];function n(s,i){if(s&&typeof document<"u"){var r,a=i.prepend===!0?"prepend":"append",d=i.singleTag===!0,u=typeof i.container=="string"?document.querySelector(i.container):document.getElementsByTagName("head")[0];if(d){var l=e.indexOf(u);l===-1&&(l=e.push(u)-1,t[l]={}),r=t[l]&&t[l][a]?t[l][a]:t[l][a]=c()}else r=c();s.charCodeAt(0)===65279&&(s=s.substring(1)),r.styleSheet?r.styleSheet.cssText+=s:r.appendChild(document.createTextNode(s))}function c(){var h=document.createElement("style");if(h.setAttribute("type","text/css"),i.attributes)for(var o=Object.keys(i.attributes),m=0;m<o.length;m++)h.setAttribute(o[m],i.attributes[o[m]]);var y=a==="prepend"?"afterbegin":"beforeend";return u.insertAdjacentElement(y,h),h}}var css=".cesium-zoom-controller{border-radius:100px;box-sizing:border-box;display:flex;flex-direction:column;line-height:1.2rem;pointer-events:auto;position:absolute;right:30px;text-align:center;top:187px;user-select:none}.cesium-zoom-controller .refresh,.cesium-zoom-controller .zoom-in,.cesium-zoom-controller .zoom-out{border-radius:14%;margin-bottom:5px}.cesium-zoom-controller .cesium-button{background:#2a2e39;border:none;margin-right:0;transition:all .3s cubic-bezier(.645,.045,.355,1);transition-delay:0s;transition-duration:.2s;transition-property:all;transition-timing-function:cubic-bezier(.645,.045,.355,1)}.cesium-zoom-controller .cesium-button:hover{background:#48b;box-shadow:none}.cesium-zoom-controller .cesium-button:active{fill:#edffff;background:#adf;color:#edffff}.cesium-zoom-controller .cesium-toolbar-button{align-items:center;display:flex;height:30px;justify-content:center;width:30px}";n(css,{});var heatmap$1={exports:{}},heatmap=heatmap$1.exports,hasRequiredHeatmap;function requireHeatmap(){return hasRequiredHeatmap||(hasRequiredHeatmap=1,function(s){(function(i,r,a){s.exports?s.exports=a():r[i]=a()})("h337",heatmap,function(){var i={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},r=function(){var o=function(g){this._coordinator={},this._data=[],this._radi=[],this._min=10,this._max=1,this._xField=g.xField||g.defaultXField,this._yField=g.yField||g.defaultYField,this._valueField=g.valueField||g.defaultValueField,g.radius&&(this._cfgRadius=g.radius)},m=i.defaultRadius;return o.prototype={_organiseData:function(y,g){var p=y[this._xField],v=y[this._yField],b=this._radi,w=this._data,x=this._max,_=this._min,T=y[this._valueField]||1,O=y.radius||this._cfgRadius||m;w[p]||(w[p]=[],b[p]=[]),w[p][v]?w[p][v]+=T:(w[p][v]=T,b[p][v]=O);var E=w[p][v];return E>x?(g?this.setDataMax(E):this._max=E,!1):E<_?(g?this.setDataMin(E):this._min=E,!1):{x:p,y:v,value:T,radius:O,min:_,max:x}},_unOrganizeData:function(){var y=[],g=this._data,p=this._radi;for(var v in g)for(var b in g[v])y.push({x:v,y:b,radius:p[v][b],value:g[v][b]});return{min:this._min,max:this._max,data:y}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var y=arguments[0],g=y.length;g--;)this.addData.call(this,y[g]);else{var p=this._organiseData(arguments[0],!0);p&&(this._data.length===0&&(this._min=this._max=p.value),this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[p]}))}return this},setData:function(y){var g=y.data,p=g.length;this._data=[],this._radi=[];for(var v=0;v<p;v++)this._organiseData(g[v],!1);return this._max=y.max,this._min=y.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(y){return this._max=y,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(y){return this._min=y,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(y){this._coordinator=y},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},o}(),a=function(){var o=function(p){var v=p.gradient||p.defaultGradient,b=document.createElement("canvas"),w=b.getContext("2d",{willReadFrequently:!0});b.width=256,b.height=1;var x=w.createLinearGradient(0,0,256,1);for(var _ in v)x.addColorStop(_,v[_]);return w.fillStyle=x,w.fillRect(0,0,256,1),w.getImageData(0,0,256,1).data},m=function(p,v){var b=document.createElement("canvas"),w=b.getContext("2d",{willReadFrequently:!0}),x=p,_=p;if(b.width=b.height=p*2,v==1)w.beginPath(),w.arc(x,_,p,0,2*Math.PI,!1),w.fillStyle="rgba(0,0,0,1)",w.fill();else{var T=w.createRadialGradient(x,_,p*v,x,_,p);T.addColorStop(0,"rgba(0,0,0,1)"),T.addColorStop(1,"rgba(0,0,0,0)"),w.fillStyle=T,w.fillRect(0,0,2*p,2*p)}return b},y=function(_){for(var v=[],b=_.min,w=_.max,x=_.radi,_=_.data,T=Object.keys(_),O=T.length;O--;)for(var E=T[O],C=Object.keys(_[E]),R=C.length;R--;){var P=C[R],k=_[E][P],A=x[E][P];v.push({x:E,y:P,value:k,radius:A})}return{min:b,max:w,data:v}};function g(p){var v=p.container,b=this.shadowCanvas=document.createElement("canvas"),w=this.canvas=p.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0];var x=getComputedStyle(p.container)||{};w.className="heatmap-canvas",this._width=w.width=b.width=p.width||+x.width.replace(/px/,""),this._height=w.height=b.height=p.height||+x.height.replace(/px/,""),this.shadowCtx=b.getContext("2d",{willReadFrequently:!0}),this.ctx=w.getContext("2d",{willReadFrequently:!0}),w.style.cssText=b.style.cssText="position:absolute;left:0;top:0;",v.style.position="relative",v.appendChild(w),this._palette=o(p),this._templates={},this._setStyles(p)}return g.prototype={renderPartial:function(p){p.data.length>0&&(this._drawAlpha(p),this._colorize())},renderAll:function(p){this._clear(),p.data.length>0&&(this._drawAlpha(y(p)),this._colorize())},_updateGradient:function(p){this._palette=o(p)},updateConfig:function(p){p.gradient&&this._updateGradient(p),this._setStyles(p)},setDimensions:function(p,v){this._width=p,this._height=v,this.canvas.width=this.shadowCanvas.width=p,this.canvas.height=this.shadowCanvas.height=v},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(p){this._blur=p.blur==0?0:p.blur||p.defaultBlur,p.backgroundColor&&(this.canvas.style.backgroundColor=p.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=p.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=p.height||this._height,this._opacity=(p.opacity||0)*255,this._maxOpacity=(p.maxOpacity||p.defaultMaxOpacity)*255,this._minOpacity=(p.minOpacity||p.defaultMinOpacity)*255,this._useGradientOpacity=!!p.useGradientOpacity},_drawAlpha:function(w){for(var v=this._min=w.min,b=this._max=w.max,w=w.data||[],x=w.length,_=1-this._blur;x--;){var T=w[x],O=T.x,E=T.y,C=T.radius,R=Math.min(T.value,b),P=O-C,k=E-C,A=this.shadowCtx,I;this._templates[C]?I=this._templates[C]:this._templates[C]=I=m(C,_);var $=(R-v)/(b-v);A.globalAlpha=$<.01?.01:$,A.drawImage(I,P,k),P<this._renderBoundaries[0]&&(this._renderBoundaries[0]=P),k<this._renderBoundaries[1]&&(this._renderBoundaries[1]=k),P+2*C>this._renderBoundaries[2]&&(this._renderBoundaries[2]=P+2*C),k+2*C>this._renderBoundaries[3]&&(this._renderBoundaries[3]=k+2*C)}},_colorize:function(){var p=this._renderBoundaries[0],v=this._renderBoundaries[1],b=this._renderBoundaries[2]-p,w=this._renderBoundaries[3]-v,x=this._width,_=this._height,T=this._opacity,O=this._maxOpacity,E=this._minOpacity,C=this._useGradientOpacity;p<0&&(p=0),v<0&&(v=0),p+b>x&&(b=x-p),v+w>_&&(w=_-v);for(var R=this.shadowCtx.getImageData(p,v,b,w),P=R.data,k=P.length,A=this._palette,I=3;I<k;I+=4){var $=P[I],F=$*4;if(F){var q;T>0?q=T:$<O?$<E?q=E:q=$:q=O,P[I-3]=A[F],P[I-2]=A[F+1],P[I-1]=A[F+2],P[I]=C?A[F+3]:q}}this.ctx.putImageData(R,p,v),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(p){var v,b=this.shadowCtx,w=b.getImageData(p.x,p.y,1,1),x=w.data[3],_=this._max,T=this._min;return v=Math.abs(_-T)*(x/255)>>0,v},getDataURL:function(){return this.canvas.toDataURL()}},g}(),d=function(){var o=!1;return i.defaultRenderer==="canvas2d"&&(o=a),o}(),u={merge:function(){for(var h={},o=arguments.length,m=0;m<o;m++){var y=arguments[m];for(var g in y)h[g]=y[g]}return h}},l=function(){var o=function(){function p(){this.cStore={}}return p.prototype={on:function(v,b,w){var x=this.cStore;x[v]||(x[v]=[]),x[v].push(function(_){return b.call(w,_)})},emit:function(v,b){var w=this.cStore;if(w[v])for(var x=w[v].length,_=0;_<x;_++){var T=w[v][_];T(b)}}},p}(),m=function(g){var p=g._renderer,v=g._coordinator,b=g._store;v.on("renderpartial",p.renderPartial,p),v.on("renderall",p.renderAll,p),v.on("extremachange",function(w){g._config.onExtremaChange&&g._config.onExtremaChange({min:w.min,max:w.max,gradient:g._config.gradient||g._config.defaultGradient})}),b.setCoordinator(v)};function y(){var g=this._config=u.merge(i,arguments[0]||{});if(this._coordinator=new o,g.plugin){var p=g.plugin;if(i.plugins[p]){var v=i.plugins[p];this._renderer=new v.renderer(g),this._store=new v.store(g)}else throw new Error("Plugin '"+p+"' not found. Maybe it was not registered.")}else this._renderer=new d(g),this._store=new r(g);m(this)}return y.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(g){return this._config=u.merge(this._config,g),this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(g){return this._store.getValueAt?this._store.getValueAt(g):this._renderer.getValueAt?this._renderer.getValueAt(g):null}},y}(),c={create:function(h){return new l(h)},register:function(h,o){i.plugins[h]=o}};return c})}(heatmap$1)),heatmap$1.exports}requireHeatmap();const X=class X extends EventEmitter{constructor(){super();j(this,"popupMap",new Map)}static getInstance(){return X.instance||(X.instance=new X),X.instance}popup(r){var c;const a=r.element;a.style.position="absolute";const d=r.viewer.container,u=()=>{l&&(l.destroy(),d.removeChild(a),this.popupMap.delete(r.id),this.emit("onUnmount",r.id))};d.appendChild(a),this.emit("onMount",r.id),(c=this.popupMap.get(r.id))==null||c.destroy();const l=new Popup(r.viewer,{position:r.position,offset:r.offset??[0,0],element:a});this.popupMap.set(r.id,{popup:l,destroy:u})}close(r){const a=this.popupMap.get(r);a&&(a.destroy(),this.popupMap.delete(r),this.emit("onUnmount",r))}closeAll(){this.popupMap.forEach(r=>r.destroy()),this.popupMap.clear()}};j(X,"instance",null);let PopupCtrl=X;function saveCameraParams(s){const i=s.camera;return{position:i.position,direction:i.direction,up:i.up,right:i.right,transform:i.transform}}function flyToCameraParams(s,i,r=1){s.camera.flyTo({destination:i.position,orientation:{direction:i.direction,up:i.up,right:i.right},duration:r})}const memoizeMap=new WeakMap;function ListenLeftClick(s){if(memoizeMap.has(s))return memoizeMap.get(s);const i=new EventEmitter;return new Cesium__namespace.ScreenSpaceEventHandler(s.scene.canvas).setInputAction(a=>{i.emit("click",a)},Cesium__namespace.ScreenSpaceEventType.LEFT_CLICK),memoizeMap.set(s,i),i}exports.ListenLeftClick=ListenLeftClick;exports.PopupCtrl=PopupCtrl;exports.ShipLayer=ShipLayer;exports.WmsLayer=WmsLayer;exports.WmsLayerController=WmsLayerController;exports.createTdtProvider=createTdtProvider;exports.createTdtTerrain=createTdtTerrain;exports.flyToCameraParams=flyToCameraParams;exports.invertToCanvas=invertToCanvas;exports.saveCameraParams=saveCameraParams;