@loaders.gl/i3s 4.3.0-alpha.4 → 4.3.0-alpha.5

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.
package/dist/dist.min.js CHANGED
@@ -4,6 +4,6 @@
4
4
  else if (typeof define === 'function' && define.amd) define([], factory);
5
5
  else if (typeof exports === 'object') exports['loaders'] = factory();
6
6
  else root['loaders'] = factory();})(globalThis, function () {
7
- "use strict";var __exports__=(()=>{var Xl=Object.create;var sn=Object.defineProperty;var Wl=Object.getOwnPropertyDescriptor;var ql=Object.getOwnPropertyNames;var Zl=Object.getPrototypeOf,Ql=Object.prototype.hasOwnProperty;var tt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),an=(t,e)=>{for(var r in e)sn(t,r,{get:e[r],enumerable:!0})},on=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ql(e))!Ql.call(t,o)&&o!==r&&sn(t,o,{get:()=>e[o],enumerable:!(n=Wl(e,o))||n.enumerable});return t},cn=(t,e,r)=>(on(t,e,"default"),r&&on(r,e,"default")),Bt=(t,e,r)=>(r=t!=null?Xl(Zl(t)):{},on(e||!t||!t.__esModule?sn(r,"default",{value:t,enumerable:!0}):r,t)),Yl=t=>on(sn({},"__esModule",{value:!0}),t);var Vt=tt((Am,fs)=>{fs.exports=globalThis.loaders});var Zt=tt(ct=>{"use strict";var qd=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Zd(t,e){return Object.prototype.hasOwnProperty.call(t,e)}ct.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)Zd(r,n)&&(t[n]=r[n])}}return t};ct.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var Qd={arraySet:function(t,e,r,n,o){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+n),o);return}for(var i=0;i<n;i++)t[o+i]=e[r+i]},flattenChunks:function(t){var e,r,n,o,i,s;for(n=0,e=0,r=t.length;e<r;e++)n+=t[e].length;for(s=new Uint8Array(n),o=0,e=0,r=t.length;e<r;e++)i=t[e],s.set(i,o),o+=i.length;return s}},Yd={arraySet:function(t,e,r,n,o){for(var i=0;i<n;i++)t[o+i]=e[r+i]},flattenChunks:function(t){return[].concat.apply([],t)}};ct.setTyped=function(t){t?(ct.Buf8=Uint8Array,ct.Buf16=Uint16Array,ct.Buf32=Int32Array,ct.assign(ct,Qd)):(ct.Buf8=Array,ct.Buf16=Array,ct.Buf32=Array,ct.assign(ct,Yd))};ct.setTyped(qd)});var cf=tt(Ye=>{"use strict";var jd=Zt(),Jd=4,Gc=0,kc=1,$d=2;function Qe(t){for(var e=t.length;--e>=0;)t[e]=0}var tu=0,Wc=1,eu=2,ru=3,nu=258,bi=29,zr=256,Fr=zr+1+bi,Ze=30,Ci=19,qc=2*Fr+1,Ee=15,Ri=16,ou=7,Bi=256,Zc=16,Qc=17,Yc=18,wi=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],qn=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],iu=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],jc=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],su=512,Qt=new Array((Fr+2)*2);Qe(Qt);var Nr=new Array(Ze*2);Qe(Nr);var Ur=new Array(su);Qe(Ur);var Gr=new Array(nu-ru+1);Qe(Gr);var Di=new Array(bi);Qe(Di);var Zn=new Array(Ze);Qe(Zn);function Ti(t,e,r,n,o){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=o,this.has_stree=t&&t.length}var Jc,$c,tf;function Mi(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function ef(t){return t<256?Ur[t]:Ur[256+(t>>>7)]}function kr(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}function _t(t,e,r){t.bi_valid>Ri-r?(t.bi_buf|=e<<t.bi_valid&65535,kr(t,t.bi_buf),t.bi_buf=e>>Ri-t.bi_valid,t.bi_valid+=r-Ri):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function Gt(t,e,r){_t(t,r[e*2],r[e*2+1])}function rf(t,e){var r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1}function au(t){t.bi_valid===16?(kr(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}function cu(t,e){var r=e.dyn_tree,n=e.max_code,o=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,f=e.stat_desc.max_length,c,l,d,_,h,u,x=0;for(_=0;_<=Ee;_++)t.bl_count[_]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<qc;c++)l=t.heap[c],_=r[r[l*2+1]*2+1]+1,_>f&&(_=f,x++),r[l*2+1]=_,!(l>n)&&(t.bl_count[_]++,h=0,l>=a&&(h=s[l-a]),u=r[l*2],t.opt_len+=u*(_+h),i&&(t.static_len+=u*(o[l*2+1]+h)));if(x!==0){do{for(_=f-1;t.bl_count[_]===0;)_--;t.bl_count[_]--,t.bl_count[_+1]+=2,t.bl_count[f]--,x-=2}while(x>0);for(_=f;_!==0;_--)for(l=t.bl_count[_];l!==0;)d=t.heap[--c],!(d>n)&&(r[d*2+1]!==_&&(t.opt_len+=(_-r[d*2+1])*r[d*2],r[d*2+1]=_),l--)}}function nf(t,e,r){var n=new Array(Ee+1),o=0,i,s;for(i=1;i<=Ee;i++)n[i]=o=o+r[i-1]<<1;for(s=0;s<=e;s++){var a=t[s*2+1];a!==0&&(t[s*2]=rf(n[a]++,a))}}function fu(){var t,e,r,n,o,i=new Array(Ee+1);for(r=0,n=0;n<bi-1;n++)for(Di[n]=r,t=0;t<1<<wi[n];t++)Gr[r++]=n;for(Gr[r-1]=n,o=0,n=0;n<16;n++)for(Zn[n]=o,t=0;t<1<<qn[n];t++)Ur[o++]=n;for(o>>=7;n<Ze;n++)for(Zn[n]=o<<7,t=0;t<1<<qn[n]-7;t++)Ur[256+o++]=n;for(e=0;e<=Ee;e++)i[e]=0;for(t=0;t<=143;)Qt[t*2+1]=8,t++,i[8]++;for(;t<=255;)Qt[t*2+1]=9,t++,i[9]++;for(;t<=279;)Qt[t*2+1]=7,t++,i[7]++;for(;t<=287;)Qt[t*2+1]=8,t++,i[8]++;for(nf(Qt,Fr+1,i),t=0;t<Ze;t++)Nr[t*2+1]=5,Nr[t*2]=rf(t,5);Jc=new Ti(Qt,wi,zr+1,Fr,Ee),$c=new Ti(Nr,qn,0,Ze,Ee),tf=new Ti(new Array(0),iu,0,Ci,ou)}function of(t){var e;for(e=0;e<Fr;e++)t.dyn_ltree[e*2]=0;for(e=0;e<Ze;e++)t.dyn_dtree[e*2]=0;for(e=0;e<Ci;e++)t.bl_tree[e*2]=0;t.dyn_ltree[Bi*2]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function sf(t){t.bi_valid>8?kr(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function lu(t,e,r,n){sf(t),n&&(kr(t,r),kr(t,~r)),jd.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function zc(t,e,r,n){var o=e*2,i=r*2;return t[o]<t[i]||t[o]===t[i]&&n[e]<=n[r]}function yi(t,e,r){for(var n=t.heap[r],o=r<<1;o<=t.heap_len&&(o<t.heap_len&&zc(e,t.heap[o+1],t.heap[o],t.depth)&&o++,!zc(e,n,t.heap[o],t.depth));)t.heap[r]=t.heap[o],r=o,o<<=1;t.heap[r]=n}function Kc(t,e,r){var n,o,i=0,s,a;if(t.last_lit!==0)do n=t.pending_buf[t.d_buf+i*2]<<8|t.pending_buf[t.d_buf+i*2+1],o=t.pending_buf[t.l_buf+i],i++,n===0?Gt(t,o,e):(s=Gr[o],Gt(t,s+zr+1,e),a=wi[s],a!==0&&(o-=Di[s],_t(t,o,a)),n--,s=ef(n),Gt(t,s,r),a=qn[s],a!==0&&(n-=Zn[s],_t(t,n,a)));while(i<t.last_lit);Gt(t,Bi,e)}function Oi(t,e){var r=e.dyn_tree,n=e.stat_desc.static_tree,o=e.stat_desc.has_stree,i=e.stat_desc.elems,s,a,f=-1,c;for(t.heap_len=0,t.heap_max=qc,s=0;s<i;s++)r[s*2]!==0?(t.heap[++t.heap_len]=f=s,t.depth[s]=0):r[s*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=f<2?++f:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,o&&(t.static_len-=n[c*2+1]);for(e.max_code=f,s=t.heap_len>>1;s>=1;s--)yi(t,r,s);c=i;do s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],yi(t,r,1),a=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=a,r[c*2]=r[s*2]+r[a*2],t.depth[c]=(t.depth[s]>=t.depth[a]?t.depth[s]:t.depth[a])+1,r[s*2+1]=r[a*2+1]=c,t.heap[1]=c++,yi(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],cu(t,e),nf(r,f,t.bl_count)}function Hc(t,e,r){var n,o=-1,i,s=e[0*2+1],a=0,f=7,c=4;for(s===0&&(f=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)i=s,s=e[(n+1)*2+1],!(++a<f&&i===s)&&(a<c?t.bl_tree[i*2]+=a:i!==0?(i!==o&&t.bl_tree[i*2]++,t.bl_tree[Zc*2]++):a<=10?t.bl_tree[Qc*2]++:t.bl_tree[Yc*2]++,a=0,o=i,s===0?(f=138,c=3):i===s?(f=6,c=3):(f=7,c=4))}function Vc(t,e,r){var n,o=-1,i,s=e[0*2+1],a=0,f=7,c=4;for(s===0&&(f=138,c=3),n=0;n<=r;n++)if(i=s,s=e[(n+1)*2+1],!(++a<f&&i===s)){if(a<c)do Gt(t,i,t.bl_tree);while(--a!==0);else i!==0?(i!==o&&(Gt(t,i,t.bl_tree),a--),Gt(t,Zc,t.bl_tree),_t(t,a-3,2)):a<=10?(Gt(t,Qc,t.bl_tree),_t(t,a-3,3)):(Gt(t,Yc,t.bl_tree),_t(t,a-11,7));a=0,o=i,s===0?(f=138,c=3):i===s?(f=6,c=3):(f=7,c=4)}}function hu(t){var e;for(Hc(t,t.dyn_ltree,t.l_desc.max_code),Hc(t,t.dyn_dtree,t.d_desc.max_code),Oi(t,t.bl_desc),e=Ci-1;e>=3&&t.bl_tree[jc[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function _u(t,e,r,n){var o;for(_t(t,e-257,5),_t(t,r-1,5),_t(t,n-4,4),o=0;o<n;o++)_t(t,t.bl_tree[jc[o]*2+1],3);Vc(t,t.dyn_ltree,e-1),Vc(t,t.dyn_dtree,r-1)}function du(t){var e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return Gc;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return kc;for(r=32;r<zr;r++)if(t.dyn_ltree[r*2]!==0)return kc;return Gc}var Xc=!1;function uu(t){Xc||(fu(),Xc=!0),t.l_desc=new Mi(t.dyn_ltree,Jc),t.d_desc=new Mi(t.dyn_dtree,$c),t.bl_desc=new Mi(t.bl_tree,tf),t.bi_buf=0,t.bi_valid=0,of(t)}function af(t,e,r,n){_t(t,(tu<<1)+(n?1:0),3),lu(t,e,r,!0)}function pu(t){_t(t,Wc<<1,3),Gt(t,Bi,Qt),au(t)}function mu(t,e,r,n){var o,i,s=0;t.level>0?(t.strm.data_type===$d&&(t.strm.data_type=du(t)),Oi(t,t.l_desc),Oi(t,t.d_desc),s=hu(t),o=t.opt_len+3+7>>>3,i=t.static_len+3+7>>>3,i<=o&&(o=i)):o=i=r+5,r+4<=o&&e!==-1?af(t,e,r,n):t.strategy===Jd||i===o?(_t(t,(Wc<<1)+(n?1:0),3),Kc(t,Qt,Nr)):(_t(t,(eu<<1)+(n?1:0),3),_u(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),Kc(t,t.dyn_ltree,t.dyn_dtree)),of(t),n&&sf(t)}function xu(t,e,r){return t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(Gr[r]+zr+1)*2]++,t.dyn_dtree[ef(e)*2]++),t.last_lit===t.lit_bufsize-1}Ye._tr_init=uu;Ye._tr_stored_block=af;Ye._tr_flush_block=mu;Ye._tr_tally=xu;Ye._tr_align=pu});var Ii=tt((rT,ff)=>{"use strict";function Au(t,e,r,n){for(var o=t&65535|0,i=t>>>16&65535|0,s=0;r!==0;){s=r>2e3?2e3:r,r-=s;do o=o+e[n++]|0,i=i+o|0;while(--s);o%=65521,i%=65521}return o|i<<16|0}ff.exports=Au});var vi=tt((nT,lf)=>{"use strict";function gu(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e}var Eu=gu();function Su(t,e,r,n){var o=Eu,i=n+r;t^=-1;for(var s=n;s<i;s++)t=t>>>8^o[(t^e[s])&255];return t^-1}lf.exports=Su});var Qn=tt((oT,hf)=>{"use strict";hf.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Ef=tt(Kt=>{"use strict";var ft=Zt(),Rt=cf(),pf=Ii(),ae=vi(),Ru=Qn(),Me=0,Tu=1,Mu=3,_e=4,_f=5,zt=0,df=1,Tt=-2,yu=-3,Li=-5,wu=-1,Ou=1,Yn=2,bu=3,Cu=4,Bu=0,Du=2,to=8,Iu=9,vu=15,Lu=8,Pu=29,Nu=256,Ni=Nu+1+Pu,Fu=30,Uu=19,Gu=2*Ni+1,ku=15,k=3,le=258,wt=le+k+1,zu=32,eo=42,Fi=69,jn=73,Jn=91,$n=103,Se=113,Hr=666,$=1,Vr=2,Re=3,$e=4,Ku=3;function he(t,e){return t.msg=Ru[e],e}function uf(t){return(t<<1)-(t>4?9:0)}function fe(t){for(var e=t.length;--e>=0;)t[e]=0}function ce(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(ft.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))}function nt(t,e){Rt._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,ce(t.strm)}function K(t,e){t.pending_buf[t.pending++]=e}function Kr(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}function Hu(t,e,r,n){var o=t.avail_in;return o>n&&(o=n),o===0?0:(t.avail_in-=o,ft.arraySet(e,t.input,t.next_in,o,r),t.state.wrap===1?t.adler=pf(t.adler,e,o,r):t.state.wrap===2&&(t.adler=ae(t.adler,e,o,r)),t.next_in+=o,t.total_in+=o,o)}function mf(t,e){var r=t.max_chain_length,n=t.strstart,o,i,s=t.prev_length,a=t.nice_match,f=t.strstart>t.w_size-wt?t.strstart-(t.w_size-wt):0,c=t.window,l=t.w_mask,d=t.prev,_=t.strstart+le,h=c[n+s-1],u=c[n+s];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do if(o=e,!(c[o+s]!==u||c[o+s-1]!==h||c[o]!==c[n]||c[++o]!==c[n+1])){n+=2,o++;do;while(c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&n<_);if(i=le-(_-n),n=_-le,i>s){if(t.match_start=e,s=i,i>=a)break;h=c[n+s-1],u=c[n+s]}}while((e=d[e&l])>f&&--r!==0);return s<=t.lookahead?s:t.lookahead}function Te(t){var e=t.w_size,r,n,o,i,s;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-wt)){ft.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,n=t.hash_size,r=n;do o=t.head[--r],t.head[r]=o>=e?o-e:0;while(--n);n=e,r=n;do o=t.prev[--r],t.prev[r]=o>=e?o-e:0;while(--n);i+=e}if(t.strm.avail_in===0)break;if(n=Hu(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=n,t.lookahead+t.insert>=k)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+k-1])&t.hash_mask,t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<k)););}while(t.lookahead<wt&&t.strm.avail_in!==0)}function Vu(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Te(t),t.lookahead===0&&e===Me)return $;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((t.strstart===0||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,nt(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-wt&&(nt(t,!1),t.strm.avail_out===0))return $}return t.insert=0,e===_e?(nt(t,!0),t.strm.avail_out===0?Re:$e):(t.strstart>t.block_start&&(nt(t,!1),t.strm.avail_out===0),$)}function Pi(t,e){for(var r,n;;){if(t.lookahead<wt){if(Te(t),t.lookahead<wt&&e===Me)return $;if(t.lookahead===0)break}if(r=0,t.lookahead>=k&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+k-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-wt&&(t.match_length=mf(t,r)),t.match_length>=k)if(n=Rt._tr_tally(t,t.strstart-t.match_start,t.match_length-k),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=k){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+k-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=Rt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(nt(t,!1),t.strm.avail_out===0))return $}return t.insert=t.strstart<k-1?t.strstart:k-1,e===_e?(nt(t,!0),t.strm.avail_out===0?Re:$e):t.last_lit&&(nt(t,!1),t.strm.avail_out===0)?$:Vr}function je(t,e){for(var r,n,o;;){if(t.lookahead<wt){if(Te(t),t.lookahead<wt&&e===Me)return $;if(t.lookahead===0)break}if(r=0,t.lookahead>=k&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+k-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=k-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-wt&&(t.match_length=mf(t,r),t.match_length<=5&&(t.strategy===Ou||t.match_length===k&&t.strstart-t.match_start>4096)&&(t.match_length=k-1)),t.prev_length>=k&&t.match_length<=t.prev_length){o=t.strstart+t.lookahead-k,n=Rt._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-k),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=o&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+k-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=k-1,t.strstart++,n&&(nt(t,!1),t.strm.avail_out===0))return $}else if(t.match_available){if(n=Rt._tr_tally(t,0,t.window[t.strstart-1]),n&&nt(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return $}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Rt._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<k-1?t.strstart:k-1,e===_e?(nt(t,!0),t.strm.avail_out===0?Re:$e):t.last_lit&&(nt(t,!1),t.strm.avail_out===0)?$:Vr}function Xu(t,e){for(var r,n,o,i,s=t.window;;){if(t.lookahead<=le){if(Te(t),t.lookahead<=le&&e===Me)return $;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=k&&t.strstart>0&&(o=t.strstart-1,n=s[o],n===s[++o]&&n===s[++o]&&n===s[++o])){i=t.strstart+le;do;while(n===s[++o]&&n===s[++o]&&n===s[++o]&&n===s[++o]&&n===s[++o]&&n===s[++o]&&n===s[++o]&&n===s[++o]&&o<i);t.match_length=le-(i-o),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=k?(r=Rt._tr_tally(t,1,t.match_length-k),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Rt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(nt(t,!1),t.strm.avail_out===0))return $}return t.insert=0,e===_e?(nt(t,!0),t.strm.avail_out===0?Re:$e):t.last_lit&&(nt(t,!1),t.strm.avail_out===0)?$:Vr}function Wu(t,e){for(var r;;){if(t.lookahead===0&&(Te(t),t.lookahead===0)){if(e===Me)return $;break}if(t.match_length=0,r=Rt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(nt(t,!1),t.strm.avail_out===0))return $}return t.insert=0,e===_e?(nt(t,!0),t.strm.avail_out===0?Re:$e):t.last_lit&&(nt(t,!1),t.strm.avail_out===0)?$:Vr}function kt(t,e,r,n,o){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=o}var Je;Je=[new kt(0,0,0,0,Vu),new kt(4,4,8,4,Pi),new kt(4,5,16,8,Pi),new kt(4,6,32,32,Pi),new kt(4,4,16,16,je),new kt(8,16,32,32,je),new kt(8,16,128,128,je),new kt(8,32,128,256,je),new kt(32,128,258,1024,je),new kt(32,258,258,4096,je)];function qu(t){t.window_size=2*t.w_size,fe(t.head),t.max_lazy_match=Je[t.level].max_lazy,t.good_match=Je[t.level].good_length,t.nice_match=Je[t.level].nice_length,t.max_chain_length=Je[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=k-1,t.match_available=0,t.ins_h=0}function Zu(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=to,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new ft.Buf16(Gu*2),this.dyn_dtree=new ft.Buf16((2*Fu+1)*2),this.bl_tree=new ft.Buf16((2*Uu+1)*2),fe(this.dyn_ltree),fe(this.dyn_dtree),fe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new ft.Buf16(ku+1),this.heap=new ft.Buf16(2*Ni+1),fe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new ft.Buf16(2*Ni+1),fe(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function xf(t){var e;return!t||!t.state?he(t,Tt):(t.total_in=t.total_out=0,t.data_type=Du,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?eo:Se,t.adler=e.wrap===2?0:1,e.last_flush=Me,Rt._tr_init(e),zt)}function Af(t){var e=xf(t);return e===zt&&qu(t.state),e}function Qu(t,e){return!t||!t.state||t.state.wrap!==2?Tt:(t.state.gzhead=e,zt)}function gf(t,e,r,n,o,i){if(!t)return Tt;var s=1;if(e===wu&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),o<1||o>Iu||r!==to||n<8||n>15||e<0||e>9||i<0||i>Cu)return he(t,Tt);n===8&&(n=9);var a=new Zu;return t.state=a,a.strm=t,a.wrap=s,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=o+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+k-1)/k),a.window=new ft.Buf8(a.w_size*2),a.head=new ft.Buf16(a.hash_size),a.prev=new ft.Buf16(a.w_size),a.lit_bufsize=1<<o+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new ft.Buf8(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=(1+2)*a.lit_bufsize,a.level=e,a.strategy=i,a.method=r,Af(t)}function Yu(t,e){return gf(t,e,to,vu,Lu,Bu)}function ju(t,e){var r,n,o,i;if(!t||!t.state||e>_f||e<0)return t?he(t,Tt):Tt;if(n=t.state,!t.output||!t.input&&t.avail_in!==0||n.status===Hr&&e!==_e)return he(t,t.avail_out===0?Li:Tt);if(n.strm=t,r=n.last_flush,n.last_flush=e,n.status===eo)if(n.wrap===2)t.adler=0,K(n,31),K(n,139),K(n,8),n.gzhead?(K(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),K(n,n.gzhead.time&255),K(n,n.gzhead.time>>8&255),K(n,n.gzhead.time>>16&255),K(n,n.gzhead.time>>24&255),K(n,n.level===9?2:n.strategy>=Yn||n.level<2?4:0),K(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(K(n,n.gzhead.extra.length&255),K(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=ae(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Fi):(K(n,0),K(n,0),K(n,0),K(n,0),K(n,0),K(n,n.level===9?2:n.strategy>=Yn||n.level<2?4:0),K(n,Ku),n.status=Se);else{var s=to+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=Yn||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,s|=a<<6,n.strstart!==0&&(s|=zu),s+=31-s%31,n.status=Se,Kr(n,s),n.strstart!==0&&(Kr(n,t.adler>>>16),Kr(n,t.adler&65535)),t.adler=1}if(n.status===Fi)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=ae(t.adler,n.pending_buf,n.pending-o,o)),ce(t),o=n.pending,n.pending===n.pending_buf_size));)K(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=ae(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=jn)}else n.status=jn;if(n.status===jn)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=ae(t.adler,n.pending_buf,n.pending-o,o)),ce(t),o=n.pending,n.pending===n.pending_buf_size)){i=1;break}n.gzindex<n.gzhead.name.length?i=n.gzhead.name.charCodeAt(n.gzindex++)&255:i=0,K(n,i)}while(i!==0);n.gzhead.hcrc&&n.pending>o&&(t.adler=ae(t.adler,n.pending_buf,n.pending-o,o)),i===0&&(n.gzindex=0,n.status=Jn)}else n.status=Jn;if(n.status===Jn)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=ae(t.adler,n.pending_buf,n.pending-o,o)),ce(t),o=n.pending,n.pending===n.pending_buf_size)){i=1;break}n.gzindex<n.gzhead.comment.length?i=n.gzhead.comment.charCodeAt(n.gzindex++)&255:i=0,K(n,i)}while(i!==0);n.gzhead.hcrc&&n.pending>o&&(t.adler=ae(t.adler,n.pending_buf,n.pending-o,o)),i===0&&(n.status=$n)}else n.status=$n;if(n.status===$n&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&ce(t),n.pending+2<=n.pending_buf_size&&(K(n,t.adler&255),K(n,t.adler>>8&255),t.adler=0,n.status=Se)):n.status=Se),n.pending!==0){if(ce(t),t.avail_out===0)return n.last_flush=-1,zt}else if(t.avail_in===0&&uf(e)<=uf(r)&&e!==_e)return he(t,Li);if(n.status===Hr&&t.avail_in!==0)return he(t,Li);if(t.avail_in!==0||n.lookahead!==0||e!==Me&&n.status!==Hr){var f=n.strategy===Yn?Wu(n,e):n.strategy===bu?Xu(n,e):Je[n.level].func(n,e);if((f===Re||f===$e)&&(n.status=Hr),f===$||f===Re)return t.avail_out===0&&(n.last_flush=-1),zt;if(f===Vr&&(e===Tu?Rt._tr_align(n):e!==_f&&(Rt._tr_stored_block(n,0,0,!1),e===Mu&&(fe(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),ce(t),t.avail_out===0))return n.last_flush=-1,zt}return e!==_e?zt:n.wrap<=0?df:(n.wrap===2?(K(n,t.adler&255),K(n,t.adler>>8&255),K(n,t.adler>>16&255),K(n,t.adler>>24&255),K(n,t.total_in&255),K(n,t.total_in>>8&255),K(n,t.total_in>>16&255),K(n,t.total_in>>24&255)):(Kr(n,t.adler>>>16),Kr(n,t.adler&65535)),ce(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?zt:df)}function Ju(t){var e;return!t||!t.state?Tt:(e=t.state.status,e!==eo&&e!==Fi&&e!==jn&&e!==Jn&&e!==$n&&e!==Se&&e!==Hr?he(t,Tt):(t.state=null,e===Se?he(t,yu):zt))}function $u(t,e){var r=e.length,n,o,i,s,a,f,c,l;if(!t||!t.state||(n=t.state,s=n.wrap,s===2||s===1&&n.status!==eo||n.lookahead))return Tt;for(s===1&&(t.adler=pf(t.adler,e,r,0)),n.wrap=0,r>=n.w_size&&(s===0&&(fe(n.head),n.strstart=0,n.block_start=0,n.insert=0),l=new ft.Buf8(n.w_size),ft.arraySet(l,e,r-n.w_size,n.w_size,0),e=l,r=n.w_size),a=t.avail_in,f=t.next_in,c=t.input,t.avail_in=r,t.next_in=0,t.input=e,Te(n);n.lookahead>=k;){o=n.strstart,i=n.lookahead-(k-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[o+k-1])&n.hash_mask,n.prev[o&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=o,o++;while(--i);n.strstart=o,n.lookahead=k-1,Te(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=k-1,n.match_available=0,t.next_in=f,t.input=c,t.avail_in=a,n.wrap=s,zt}Kt.deflateInit=Yu;Kt.deflateInit2=gf;Kt.deflateReset=Af;Kt.deflateResetKeep=xf;Kt.deflateSetHeader=Qu;Kt.deflate=ju;Kt.deflateEnd=Ju;Kt.deflateSetDictionary=$u;Kt.deflateInfo="pako deflate (from Nodeca project)"});var Ui=tt(tr=>{"use strict";var ro=Zt(),Sf=!0,Rf=!0;try{String.fromCharCode.apply(null,[0])}catch{Sf=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Rf=!1}var Xr=new ro.Buf8(256);for(Yt=0;Yt<256;Yt++)Xr[Yt]=Yt>=252?6:Yt>=248?5:Yt>=240?4:Yt>=224?3:Yt>=192?2:1;var Yt;Xr[254]=Xr[254]=1;tr.string2buf=function(t){var e,r,n,o,i,s=t.length,a=0;for(o=0;o<s;o++)r=t.charCodeAt(o),(r&64512)===55296&&o+1<s&&(n=t.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(e=new ro.Buf8(a),i=0,o=0;i<a;o++)r=t.charCodeAt(o),(r&64512)===55296&&o+1<s&&(n=t.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),r<128?e[i++]=r:r<2048?(e[i++]=192|r>>>6,e[i++]=128|r&63):r<65536?(e[i++]=224|r>>>12,e[i++]=128|r>>>6&63,e[i++]=128|r&63):(e[i++]=240|r>>>18,e[i++]=128|r>>>12&63,e[i++]=128|r>>>6&63,e[i++]=128|r&63);return e};function Tf(t,e){if(e<65534&&(t.subarray&&Rf||!t.subarray&&Sf))return String.fromCharCode.apply(null,ro.shrinkBuf(t,e));for(var r="",n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r}tr.buf2binstring=function(t){return Tf(t,t.length)};tr.binstring2buf=function(t){for(var e=new ro.Buf8(t.length),r=0,n=e.length;r<n;r++)e[r]=t.charCodeAt(r);return e};tr.buf2string=function(t,e){var r,n,o,i,s=e||t.length,a=new Array(s*2);for(n=0,r=0;r<s;){if(o=t[r++],o<128){a[n++]=o;continue}if(i=Xr[o],i>4){a[n++]=65533,r+=i-1;continue}for(o&=i===2?31:i===3?15:7;i>1&&r<s;)o=o<<6|t[r++]&63,i--;if(i>1){a[n++]=65533;continue}o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|o&1023)}return Tf(a,n)};tr.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+Xr[t[r]]>e?r:e}});var Gi=tt((aT,Mf)=>{"use strict";function tp(){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}Mf.exports=tp});var bf=tt(Zr=>{"use strict";var Wr=Ef(),qr=Zt(),zi=Ui(),Ki=Qn(),ep=Gi(),Of=Object.prototype.toString,rp=0,ki=4,er=0,yf=1,wf=2,np=-1,op=0,ip=8;function ye(t){if(!(this instanceof ye))return new ye(t);this.options=qr.assign({level:np,method:ip,chunkSize:16384,windowBits:15,memLevel:8,strategy:op,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ep,this.strm.avail_out=0;var r=Wr.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==er)throw new Error(Ki[r]);if(e.header&&Wr.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(typeof e.dictionary=="string"?n=zi.string2buf(e.dictionary):Of.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=Wr.deflateSetDictionary(this.strm,n),r!==er)throw new Error(Ki[r]);this._dict_set=!0}}ye.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,o,i;if(this.ended)return!1;i=e===~~e?e:e===!0?ki:rp,typeof t=="string"?r.input=zi.string2buf(t):Of.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new qr.Buf8(n),r.next_out=0,r.avail_out=n),o=Wr.deflate(r,i),o!==yf&&o!==er)return this.onEnd(o),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(i===ki||i===wf))&&(this.options.to==="string"?this.onData(zi.buf2binstring(qr.shrinkBuf(r.output,r.next_out))):this.onData(qr.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&o!==yf);return i===ki?(o=Wr.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===er):(i===wf&&(this.onEnd(er),r.avail_out=0),!0)};ye.prototype.onData=function(t){this.chunks.push(t)};ye.prototype.onEnd=function(t){t===er&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=qr.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Hi(t,e){var r=new ye(e);if(r.push(t,!0),r.err)throw r.msg||Ki[r.err];return r.result}function sp(t,e){return e=e||{},e.raw=!0,Hi(t,e)}function ap(t,e){return e=e||{},e.gzip=!0,Hi(t,e)}Zr.Deflate=ye;Zr.deflate=Hi;Zr.deflateRaw=sp;Zr.gzip=ap});var Bf=tt((fT,Cf)=>{"use strict";var no=30,cp=12;Cf.exports=function(e,r){var n,o,i,s,a,f,c,l,d,_,h,u,x,p,S,y,B,T,R,D,I,L,A,m,g;n=e.state,o=e.next_in,m=e.input,i=o+(e.avail_in-5),s=e.next_out,g=e.output,a=s-(r-e.avail_out),f=s+(e.avail_out-257),c=n.dmax,l=n.wsize,d=n.whave,_=n.wnext,h=n.window,u=n.hold,x=n.bits,p=n.lencode,S=n.distcode,y=(1<<n.lenbits)-1,B=(1<<n.distbits)-1;t:do{x<15&&(u+=m[o++]<<x,x+=8,u+=m[o++]<<x,x+=8),T=p[u&y];e:for(;;){if(R=T>>>24,u>>>=R,x-=R,R=T>>>16&255,R===0)g[s++]=T&65535;else if(R&16){D=T&65535,R&=15,R&&(x<R&&(u+=m[o++]<<x,x+=8),D+=u&(1<<R)-1,u>>>=R,x-=R),x<15&&(u+=m[o++]<<x,x+=8,u+=m[o++]<<x,x+=8),T=S[u&B];r:for(;;){if(R=T>>>24,u>>>=R,x-=R,R=T>>>16&255,R&16){if(I=T&65535,R&=15,x<R&&(u+=m[o++]<<x,x+=8,x<R&&(u+=m[o++]<<x,x+=8)),I+=u&(1<<R)-1,I>c){e.msg="invalid distance too far back",n.mode=no;break t}if(u>>>=R,x-=R,R=s-a,I>R){if(R=I-R,R>d&&n.sane){e.msg="invalid distance too far back",n.mode=no;break t}if(L=0,A=h,_===0){if(L+=l-R,R<D){D-=R;do g[s++]=h[L++];while(--R);L=s-I,A=g}}else if(_<R){if(L+=l+_-R,R-=_,R<D){D-=R;do g[s++]=h[L++];while(--R);if(L=0,_<D){R=_,D-=R;do g[s++]=h[L++];while(--R);L=s-I,A=g}}}else if(L+=_-R,R<D){D-=R;do g[s++]=h[L++];while(--R);L=s-I,A=g}for(;D>2;)g[s++]=A[L++],g[s++]=A[L++],g[s++]=A[L++],D-=3;D&&(g[s++]=A[L++],D>1&&(g[s++]=A[L++]))}else{L=s-I;do g[s++]=g[L++],g[s++]=g[L++],g[s++]=g[L++],D-=3;while(D>2);D&&(g[s++]=g[L++],D>1&&(g[s++]=g[L++]))}}else if(R&64){e.msg="invalid distance code",n.mode=no;break t}else{T=S[(T&65535)+(u&(1<<R)-1)];continue r}break}}else if(R&64)if(R&32){n.mode=cp;break t}else{e.msg="invalid literal/length code",n.mode=no;break t}else{T=p[(T&65535)+(u&(1<<R)-1)];continue e}break}}while(o<i&&s<f);D=x>>3,o-=D,x-=D<<3,u&=(1<<x)-1,e.next_in=o,e.next_out=s,e.avail_in=o<i?5+(i-o):5-(o-i),e.avail_out=s<f?257+(f-s):257-(s-f),n.hold=u,n.bits=x}});var Ff=tt((lT,Nf)=>{"use strict";var Df=Zt(),rr=15,If=852,vf=592,Lf=0,Vi=1,Pf=2,fp=[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],lp=[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],hp=[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],_p=[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];Nf.exports=function(e,r,n,o,i,s,a,f){var c=f.bits,l=0,d=0,_=0,h=0,u=0,x=0,p=0,S=0,y=0,B=0,T,R,D,I,L,A=null,m=0,g,E=new Df.Buf16(rr+1),U=new Df.Buf16(rr+1),F=null,G=0,P,J,ot;for(l=0;l<=rr;l++)E[l]=0;for(d=0;d<o;d++)E[r[n+d]]++;for(u=c,h=rr;h>=1&&E[h]===0;h--);if(u>h&&(u=h),h===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,f.bits=1,0;for(_=1;_<h&&E[_]===0;_++);for(u<_&&(u=_),S=1,l=1;l<=rr;l++)if(S<<=1,S-=E[l],S<0)return-1;if(S>0&&(e===Lf||h!==1))return-1;for(U[1]=0,l=1;l<rr;l++)U[l+1]=U[l]+E[l];for(d=0;d<o;d++)r[n+d]!==0&&(a[U[r[n+d]]++]=d);if(e===Lf?(A=F=a,g=19):e===Vi?(A=fp,m-=257,F=lp,G-=257,g=256):(A=hp,F=_p,g=-1),B=0,d=0,l=_,L=s,x=u,p=0,D=-1,y=1<<u,I=y-1,e===Vi&&y>If||e===Pf&&y>vf)return 1;for(;;){P=l-p,a[d]<g?(J=0,ot=a[d]):a[d]>g?(J=F[G+a[d]],ot=A[m+a[d]]):(J=32+64,ot=0),T=1<<l-p,R=1<<x,_=R;do R-=T,i[L+(B>>p)+R]=P<<24|J<<16|ot|0;while(R!==0);for(T=1<<l-1;B&T;)T>>=1;if(T!==0?(B&=T-1,B+=T):B=0,d++,--E[l]===0){if(l===h)break;l=r[n+a[d]]}if(l>u&&(B&I)!==D){for(p===0&&(p=u),L+=_,x=l-p,S=1<<x;x+p<h&&(S-=E[x+p],!(S<=0));)x++,S<<=1;if(y+=1<<x,e===Vi&&y>If||e===Pf&&y>vf)return 1;D=B&I,i[D]=u<<24|x<<16|L-s|0}}return B!==0&&(i[L+B]=l-p<<24|64<<16|0),f.bits=u,0}});var Al=tt(Ot=>{"use strict";var xt=Zt(),Yi=Ii(),Ht=vi(),dp=Bf(),Qr=Ff(),up=0,fl=1,ll=2,Uf=4,pp=5,oo=6,we=0,mp=1,xp=2,Mt=-2,hl=-3,ji=-4,Ap=-5,Gf=8,_l=1,kf=2,zf=3,Kf=4,Hf=5,Vf=6,Xf=7,Wf=8,qf=9,Zf=10,ao=11,jt=12,Xi=13,Qf=14,Wi=15,Yf=16,jf=17,Jf=18,$f=19,io=20,so=21,tl=22,el=23,rl=24,nl=25,ol=26,qi=27,il=28,sl=29,Z=30,Ji=31,gp=32,Ep=852,Sp=592,Rp=15,Tp=Rp;function al(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function Mp(){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 xt.Buf16(320),this.work=new xt.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function dl(t){var e;return!t||!t.state?Mt:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=_l,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new xt.Buf32(Ep),e.distcode=e.distdyn=new xt.Buf32(Sp),e.sane=1,e.back=-1,we)}function ul(t){var e;return!t||!t.state?Mt:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,dl(t))}function pl(t,e){var r,n;return!t||!t.state||(n=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?Mt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,ul(t))}function ml(t,e){var r,n;return t?(n=new Mp,t.state=n,n.window=null,r=pl(t,e),r!==we&&(t.state=null),r):Mt}function yp(t){return ml(t,Tp)}var cl=!0,Zi,Qi;function wp(t){if(cl){var e;for(Zi=new xt.Buf32(512),Qi=new xt.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Qr(fl,t.lens,0,288,Zi,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Qr(ll,t.lens,0,32,Qi,0,t.work,{bits:5}),cl=!1}t.lencode=Zi,t.lenbits=9,t.distcode=Qi,t.distbits=5}function xl(t,e,r,n){var o,i=t.state;return i.window===null&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new xt.Buf8(i.wsize)),n>=i.wsize?(xt.arraySet(i.window,e,r-i.wsize,i.wsize,0),i.wnext=0,i.whave=i.wsize):(o=i.wsize-i.wnext,o>n&&(o=n),xt.arraySet(i.window,e,r-n,o,i.wnext),n-=o,n?(xt.arraySet(i.window,e,r-n,n,0),i.wnext=n,i.whave=i.wsize):(i.wnext+=o,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=o))),0}function Op(t,e){var r,n,o,i,s,a,f,c,l,d,_,h,u,x,p=0,S,y,B,T,R,D,I,L,A=new xt.Buf8(4),m,g,E=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&t.avail_in!==0)return Mt;r=t.state,r.mode===jt&&(r.mode=Xi),s=t.next_out,o=t.output,f=t.avail_out,i=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,d=a,_=f,L=we;t:for(;;)switch(r.mode){case _l:if(r.wrap===0){r.mode=Xi;break}for(;l<16;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if(r.wrap&2&&c===35615){r.check=0,A[0]=c&255,A[1]=c>>>8&255,r.check=Ht(r.check,A,2,0),c=0,l=0,r.mode=kf;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=Z;break}if((c&15)!==Gf){t.msg="unknown compression method",r.mode=Z;break}if(c>>>=4,l-=4,I=(c&15)+8,r.wbits===0)r.wbits=I;else if(I>r.wbits){t.msg="invalid window size",r.mode=Z;break}r.dmax=1<<I,t.adler=r.check=1,r.mode=c&512?Zf:jt,c=0,l=0;break;case kf:for(;l<16;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==Gf){t.msg="unknown compression method",r.mode=Z;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=Z;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(A[0]=c&255,A[1]=c>>>8&255,r.check=Ht(r.check,A,2,0)),c=0,l=0,r.mode=zf;case zf:for(;l<32;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&(A[0]=c&255,A[1]=c>>>8&255,A[2]=c>>>16&255,A[3]=c>>>24&255,r.check=Ht(r.check,A,4,0)),c=0,l=0,r.mode=Kf;case Kf:for(;l<16;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(A[0]=c&255,A[1]=c>>>8&255,r.check=Ht(r.check,A,2,0)),c=0,l=0,r.mode=Hf;case Hf:if(r.flags&1024){for(;l<16;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(A[0]=c&255,A[1]=c>>>8&255,r.check=Ht(r.check,A,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=Vf;case Vf:if(r.flags&1024&&(h=r.length,h>a&&(h=a),h&&(r.head&&(I=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),xt.arraySet(r.head.extra,n,i,h,I)),r.flags&512&&(r.check=Ht(r.check,n,h,i)),a-=h,i+=h,r.length-=h),r.length))break t;r.length=0,r.mode=Xf;case Xf:if(r.flags&2048){if(a===0)break t;h=0;do I=n[i+h++],r.head&&I&&r.length<65536&&(r.head.name+=String.fromCharCode(I));while(I&&h<a);if(r.flags&512&&(r.check=Ht(r.check,n,h,i)),a-=h,i+=h,I)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=Wf;case Wf:if(r.flags&4096){if(a===0)break t;h=0;do I=n[i+h++],r.head&&I&&r.length<65536&&(r.head.comment+=String.fromCharCode(I));while(I&&h<a);if(r.flags&512&&(r.check=Ht(r.check,n,h,i)),a-=h,i+=h,I)break t}else r.head&&(r.head.comment=null);r.mode=qf;case qf:if(r.flags&512){for(;l<16;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if(c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=Z;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=jt;break;case Zf:for(;l<32;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}t.adler=r.check=al(c),c=0,l=0,r.mode=ao;case ao:if(r.havedict===0)return t.next_out=s,t.avail_out=f,t.next_in=i,t.avail_in=a,r.hold=c,r.bits=l,xp;t.adler=r.check=1,r.mode=jt;case jt:if(e===pp||e===oo)break t;case Xi:if(r.last){c>>>=l&7,l-=l&7,r.mode=qi;break}for(;l<3;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=Qf;break;case 1:if(wp(r),r.mode=io,e===oo){c>>>=2,l-=2;break t}break;case 2:r.mode=jf;break;case 3:t.msg="invalid block type",r.mode=Z}c>>>=2,l-=2;break;case Qf:for(c>>>=l&7,l-=l&7;l<32;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=Z;break}if(r.length=c&65535,c=0,l=0,r.mode=Wi,e===oo)break t;case Wi:r.mode=Yf;case Yf:if(h=r.length,h){if(h>a&&(h=a),h>f&&(h=f),h===0)break t;xt.arraySet(o,n,i,h,s),a-=h,i+=h,f-=h,s+=h,r.length-=h;break}r.mode=jt;break;case jf:for(;l<14;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=Z;break}r.have=0,r.mode=Jf;case Jf:for(;r.have<r.ncode;){for(;l<3;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}r.lens[E[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[E[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,m={bits:r.lenbits},L=Qr(up,r.lens,0,19,r.lencode,0,r.work,m),r.lenbits=m.bits,L){t.msg="invalid code lengths set",r.mode=Z;break}r.have=0,r.mode=$f;case $f:for(;r.have<r.nlen+r.ndist;){for(;p=r.lencode[c&(1<<r.lenbits)-1],S=p>>>24,y=p>>>16&255,B=p&65535,!(S<=l);){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if(B<16)c>>>=S,l-=S,r.lens[r.have++]=B;else{if(B===16){for(g=S+2;l<g;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if(c>>>=S,l-=S,r.have===0){t.msg="invalid bit length repeat",r.mode=Z;break}I=r.lens[r.have-1],h=3+(c&3),c>>>=2,l-=2}else if(B===17){for(g=S+3;l<g;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}c>>>=S,l-=S,I=0,h=3+(c&7),c>>>=3,l-=3}else{for(g=S+7;l<g;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}c>>>=S,l-=S,I=0,h=11+(c&127),c>>>=7,l-=7}if(r.have+h>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=Z;break}for(;h--;)r.lens[r.have++]=I}}if(r.mode===Z)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=Z;break}if(r.lenbits=9,m={bits:r.lenbits},L=Qr(fl,r.lens,0,r.nlen,r.lencode,0,r.work,m),r.lenbits=m.bits,L){t.msg="invalid literal/lengths set",r.mode=Z;break}if(r.distbits=6,r.distcode=r.distdyn,m={bits:r.distbits},L=Qr(ll,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,m),r.distbits=m.bits,L){t.msg="invalid distances set",r.mode=Z;break}if(r.mode=io,e===oo)break t;case io:r.mode=so;case so:if(a>=6&&f>=258){t.next_out=s,t.avail_out=f,t.next_in=i,t.avail_in=a,r.hold=c,r.bits=l,dp(t,_),s=t.next_out,o=t.output,f=t.avail_out,i=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,r.mode===jt&&(r.back=-1);break}for(r.back=0;p=r.lencode[c&(1<<r.lenbits)-1],S=p>>>24,y=p>>>16&255,B=p&65535,!(S<=l);){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if(y&&!(y&240)){for(T=S,R=y,D=B;p=r.lencode[D+((c&(1<<T+R)-1)>>T)],S=p>>>24,y=p>>>16&255,B=p&65535,!(T+S<=l);){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}c>>>=T,l-=T,r.back+=T}if(c>>>=S,l-=S,r.back+=S,r.length=B,y===0){r.mode=ol;break}if(y&32){r.back=-1,r.mode=jt;break}if(y&64){t.msg="invalid literal/length code",r.mode=Z;break}r.extra=y&15,r.mode=tl;case tl:if(r.extra){for(g=r.extra;l<g;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=el;case el:for(;p=r.distcode[c&(1<<r.distbits)-1],S=p>>>24,y=p>>>16&255,B=p&65535,!(S<=l);){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if(!(y&240)){for(T=S,R=y,D=B;p=r.distcode[D+((c&(1<<T+R)-1)>>T)],S=p>>>24,y=p>>>16&255,B=p&65535,!(T+S<=l);){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}c>>>=T,l-=T,r.back+=T}if(c>>>=S,l-=S,r.back+=S,y&64){t.msg="invalid distance code",r.mode=Z;break}r.offset=B,r.extra=y&15,r.mode=rl;case rl:if(r.extra){for(g=r.extra;l<g;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=Z;break}r.mode=nl;case nl:if(f===0)break t;if(h=_-f,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=Z;break}h>r.wnext?(h-=r.wnext,u=r.wsize-h):u=r.wnext-h,h>r.length&&(h=r.length),x=r.window}else x=o,u=s-r.offset,h=r.length;h>f&&(h=f),f-=h,r.length-=h;do o[s++]=x[u++];while(--h);r.length===0&&(r.mode=so);break;case ol:if(f===0)break t;o[s++]=r.length,f--,r.mode=so;break;case qi:if(r.wrap){for(;l<32;){if(a===0)break t;a--,c|=n[i++]<<l,l+=8}if(_-=f,t.total_out+=_,r.total+=_,_&&(t.adler=r.check=r.flags?Ht(r.check,o,_,s-_):Yi(r.check,o,_,s-_)),_=f,(r.flags?c:al(c))!==r.check){t.msg="incorrect data check",r.mode=Z;break}c=0,l=0}r.mode=il;case il:if(r.wrap&&r.flags){for(;l<32;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if(c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=Z;break}c=0,l=0}r.mode=sl;case sl:L=mp;break t;case Z:L=hl;break t;case Ji:return ji;case gp:default:return Mt}return t.next_out=s,t.avail_out=f,t.next_in=i,t.avail_in=a,r.hold=c,r.bits=l,(r.wsize||_!==t.avail_out&&r.mode<Z&&(r.mode<qi||e!==Uf))&&xl(t,t.output,t.next_out,_-t.avail_out)?(r.mode=Ji,ji):(d-=t.avail_in,_-=t.avail_out,t.total_in+=d,t.total_out+=_,r.total+=_,r.wrap&&_&&(t.adler=r.check=r.flags?Ht(r.check,o,_,t.next_out-_):Yi(r.check,o,_,t.next_out-_)),t.data_type=r.bits+(r.last?64:0)+(r.mode===jt?128:0)+(r.mode===io||r.mode===Wi?256:0),(d===0&&_===0||e===Uf)&&L===we&&(L=Ap),L)}function bp(t){if(!t||!t.state)return Mt;var e=t.state;return e.window&&(e.window=null),t.state=null,we}function Cp(t,e){var r;return!t||!t.state||(r=t.state,!(r.wrap&2))?Mt:(r.head=e,e.done=!1,we)}function Bp(t,e){var r=e.length,n,o,i;return!t||!t.state||(n=t.state,n.wrap!==0&&n.mode!==ao)?Mt:n.mode===ao&&(o=1,o=Yi(o,e,r,0),o!==n.check)?hl:(i=xl(t,e,r,r),i?(n.mode=Ji,ji):(n.havedict=1,we))}Ot.inflateReset=ul;Ot.inflateReset2=pl;Ot.inflateResetKeep=dl;Ot.inflateInit=yp;Ot.inflateInit2=ml;Ot.inflate=Op;Ot.inflateEnd=bp;Ot.inflateGetHeader=Cp;Ot.inflateSetDictionary=Bp;Ot.inflateInfo="pako inflate (from Nodeca project)"});var $i=tt((_T,gl)=>{"use strict";gl.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var Sl=tt((dT,El)=>{"use strict";function Dp(){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}El.exports=Dp});var Tl=tt(jr=>{"use strict";var nr=Al(),Yr=Zt(),co=Ui(),Y=$i(),ts=Qn(),Ip=Gi(),vp=Sl(),Rl=Object.prototype.toString;function Oe(t){if(!(this instanceof Oe))return new Oe(t);this.options=Yr.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ip,this.strm.avail_out=0;var r=nr.inflateInit2(this.strm,e.windowBits);if(r!==Y.Z_OK)throw new Error(ts[r]);if(this.header=new vp,nr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=co.string2buf(e.dictionary):Rl.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=nr.inflateSetDictionary(this.strm,e.dictionary),r!==Y.Z_OK)))throw new Error(ts[r])}Oe.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,o=this.options.dictionary,i,s,a,f,c,l=!1;if(this.ended)return!1;s=e===~~e?e:e===!0?Y.Z_FINISH:Y.Z_NO_FLUSH,typeof t=="string"?r.input=co.binstring2buf(t):Rl.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Yr.Buf8(n),r.next_out=0,r.avail_out=n),i=nr.inflate(r,Y.Z_NO_FLUSH),i===Y.Z_NEED_DICT&&o&&(i=nr.inflateSetDictionary(this.strm,o)),i===Y.Z_BUF_ERROR&&l===!0&&(i=Y.Z_OK,l=!1),i!==Y.Z_STREAM_END&&i!==Y.Z_OK)return this.onEnd(i),this.ended=!0,!1;r.next_out&&(r.avail_out===0||i===Y.Z_STREAM_END||r.avail_in===0&&(s===Y.Z_FINISH||s===Y.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=co.utf8border(r.output,r.next_out),f=r.next_out-a,c=co.buf2string(r.output,a),r.next_out=f,r.avail_out=n-f,f&&Yr.arraySet(r.output,r.output,a,f,0),this.onData(c)):this.onData(Yr.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(l=!0)}while((r.avail_in>0||r.avail_out===0)&&i!==Y.Z_STREAM_END);return i===Y.Z_STREAM_END&&(s=Y.Z_FINISH),s===Y.Z_FINISH?(i=nr.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Y.Z_OK):(s===Y.Z_SYNC_FLUSH&&(this.onEnd(Y.Z_OK),r.avail_out=0),!0)};Oe.prototype.onData=function(t){this.chunks.push(t)};Oe.prototype.onEnd=function(t){t===Y.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Yr.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function es(t,e){var r=new Oe(e);if(r.push(t,!0),r.err)throw r.msg||ts[r.err];return r.result}function Lp(t,e){return e=e||{},e.raw=!0,es(t,e)}jr.Inflate=Oe;jr.inflate=es;jr.inflateRaw=Lp;jr.ungzip=es});var wl=tt((pT,yl)=>{"use strict";var Pp=Zt().assign,Np=bf(),Fp=Tl(),Up=$i(),Ml={};Pp(Ml,Np,Fp,Up);yl.exports=Ml});var Ol=tt(()=>{});var en={};an(en,{ArcGISWebSceneLoader:()=>kl,COORDINATE_SYSTEM:()=>Pt,I3SAttributeLoader:()=>$r,I3SBuildingSceneLayerLoader:()=>Nl,I3SContentLoader:()=>Un,I3SLoader:()=>Ir,I3SNodePageLoader:()=>Kn,LayerError:()=>tn,SLPKArchive:()=>or,SLPKLoader:()=>bl,customizeColors:()=>Hl,loadFeatureAttributes:()=>vl,parseSLPKArchive:()=>lo});cn(en,Bt(Vt(),1));var jl={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Jl={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},de={...jl,...Jl};async function uo(t,e,r,n){return n._parse(t,e,r,n)}function $t(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var Dt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},$l=Dt.self||Dt.window||Dt.global||{},t0=Dt.window||Dt.self||Dt.global||{},e0=Dt.global||Dt.self||Dt.window||{},r0=Dt.document||{};var At=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var ls=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),n0=ls&&parseFloat(ls[1])||0;function te(t){return te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},te(t)}function po(t,e){if(te(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(te(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mo(t){var e=po(t,"string");return te(e)==="symbol"?e:String(e)}function V(t,e,r){return e=mo(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sr(t){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,t)}function xo(t){return globalThis.loaders?.modules?.[t]||null}function o0(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.0-alpha.3"),globalThis._loadersgl_.version}var hs=o0();function _s(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var It={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Lm=It.self||It.window||It.global||{},Pm=It.window||It.self||It.global||{},Nm=It.global||It.self||It.window||{},Fm=It.document||{};var Ie=typeof process!="object"||String(process)!=="[object process]"||process.browser,fn=typeof importScripts=="function",Um=typeof window<"u"&&typeof window.orientation<"u",ds=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Gm=ds&&parseFloat(ds[1])||0;var Ao={};async function vt(t,e=null,r={},n=null){return e&&(t=us(t,e,r,n)),Ao[t]=Ao[t]||i0(t),await Ao[t]}function us(t,e,r={},n=null){if(!r.useLocalLibraries&&t.startsWith("http"))return t;n=n||t;let o=r.modules||{};return o[n]?o[n]:Ie?r.CDN?(_s(r.CDN.startsWith("http")),`${r.CDN}/${e}@${hs}/dist/libs/${n}`):fn?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}async function i0(t){if(t.endsWith("wasm"))return await a0(t);if(!Ie)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(t)}catch(r){return console.error(r),null}if(fn)return importScripts(t);let e=await c0(t);return s0(e,t)}function s0(t,e){if(!Ie){let{requireFromString:n}=globalThis.loaders||{};return n?.(t,e)}if(fn)return eval.call(globalThis,t),null;let r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch{r.text=t}return document.body.appendChild(r),null}async function a0(t){let{readFileAsArrayBuffer:e}=globalThis.loaders||{};return Ie||!e||t.startsWith("http")?await(await fetch(t)).arrayBuffer():await e(t)}async function c0(t){let{readFileAsText:e}=globalThis.loaders||{};return Ie||!e||t.startsWith("http")?await(await fetch(t)).text():await e(t)}function ee(t,e,r){if(r=r||t.byteLength,t.byteLength<r||e.byteLength<r)return!1;let n=new Uint8Array(t),o=new Uint8Array(e);for(let i=0;i<n.length;++i)if(n[i]!==o[i])return!1;return!0}function ve(...t){return ps(t)}function ps(t){let e=t.map(i=>i instanceof ArrayBuffer?new Uint8Array(i):i),r=e.reduce((i,s)=>i+s.byteLength,0),n=new Uint8Array(r),o=0;for(let i of e)n.set(i,o),o+=i.byteLength;return n.buffer}async function ar(t){let e=[];for await(let r of t)e.push(r);return ve(...e)}function ms(t){return t&&typeof t=="object"&&t.isBuffer}function Le(t){if(ms(t))return t;if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if(typeof t=="string"){let e=t;return new TextEncoder().encode(e).buffer}if(t&&typeof t=="object"&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function Pe(t){return e=>new Promise((r,n)=>t(e,(o,i)=>o?n(o):r(i)))}var cr=new Error("Not implemented"),ln=class{handle;size=0;bigsize=0n;url="";constructor(e,r,n){if(globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(e,r,n);throw At?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(e,r){throw cr}async write(e,r,n){throw cr}async stat(){throw cr}async truncate(e){throw cr}async append(e){throw cr}async close(){}};var go=t=>t?.getUint8&&t?.slice&&t?.length;var fr=class{file;constructor(e,r=!1){this.file=new ln(e,r?"a+":"r")}async truncate(e){await this.file.truncate(e)}async append(e){await this.file.append(e)}async destroy(){await this.file.close()}async getUint8(e){let r=await this.file.read(e,1),n=new Uint8Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint16(e){let r=await this.file.read(e,2),n=new Uint16Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint32(e){let r=await this.file.read(e,4),n=new Uint32Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getBigUint64(e){let r=await this.file.read(e,8),n=new BigInt64Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async slice(e,r){let n=r-e;if(n>Number.MAX_SAFE_INTEGER)throw new Error("too big slice");let o=Number(n);return await this.file.read(e,o)}get length(){return this.file.bigsize}};var Ne=t=>{if(t>Number.MAX_SAFE_INTEGER)throw new Error("Offset is out of bounds");return Number(t)},ue=class{file;constructor(e){this.file=e}async destroy(){}async getUint8(e){return this.file.getUint8(Ne(e))}async getUint16(e){return this.file.getUint16(Ne(e),!0)}async getUint32(e){return this.file.getUint32(Ne(e),!0)}async getBigUint64(e){return this.file.getBigUint64(Ne(e),!0)}async slice(e,r){return this.file.buffer.slice(Ne(e),Ne(r))}get length(){return BigInt(this.file.byteLength)}};var f0=1/Math.PI*180,l0=1/180*Math.PI,h0={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...h0}};var W=globalThis.mathgl.config;function Eo(t,{precision:e=W.precision}={}){return t=_0(t),"".concat(parseFloat(t.toPrecision(e)))}function Lt(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function So(t){return xs(t)}function Ro(t){return As(t)}function xs(t,e){return gs(t,r=>r*l0,e)}function As(t,e){return gs(t,r=>r*f0,e)}function dt(t,e,r){let n=W.EPSILON;r&&(W.EPSILON=r);try{if(t===e)return!0;if(Lt(t)&&Lt(e)){if(t.length!==e.length)return!1;for(let o=0;o<t.length;++o)if(!dt(t[o],e[o]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=W.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{W.EPSILON=n}}function _0(t){return Math.round(t/W.EPSILON)*W.EPSILON}function d0(t){return t.clone?t.clone():new Array(t.length)}function gs(t,e,r){if(Lt(t)){let n=t;r=r||d0(n);for(let o=0;o<r.length&&o<n.length;++o){let i=typeof t=="number"?t:t[o];r[o]=e(i,o,r)}return r}return e(t)}function u0(t){function e(){var r=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}var re=class extends u0(Array){clone(){return new this.constructor().copy(this)}fromArray(e,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+r];return this.check()}toArray(e=[],r=0){for(let n=0;n<this.ELEMENTS;++n)e[r+n]=this[n];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:Lt(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(W)}formatString(e){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+Eo(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!dt(this[r],e[r]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==e[r])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,r,n){if(n===void 0)return this.lerp(this,e,r);for(let o=0;o<this.ELEMENTS;++o){let i=e[o],s=typeof r=="number"?r:r[o];this[o]=i+n*(s-i)}return this.check()}min(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(e[r],this[r]);return this.check()}max(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(e[r],this[r]);return this.check()}clamp(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),r[n]);return this.check()}add(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(e){if(typeof e=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;else for(let r=0;r<this.ELEMENTS&&r<e.length;++r)this[r]*=e[r];return this.check()}multiplyByScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}check(){if(W.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let e=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)e=e&&Number.isFinite(this[r]);return e}sub(e){return this.subtract(e)}setScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=e;return this.check()}addScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}divideScalar(e){return this.multiplyByScalar(1/e)}clampScalar(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),r);return this.check()}get elements(){return this}};function p0(t,e){if(t.length!==e)return!1;for(let r=0;r<t.length;++r)if(!Number.isFinite(t[r]))return!1;return!0}function z(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(JSON.stringify(t)));return t}function ne(t,e,r=""){if(W.debug&&!p0(t,e))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return t}function et(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}var Fe=class extends re{get x(){return this[0]}set x(e){this[0]=z(e)}get y(){return this[1]}set y(e){this[1]=z(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*this[r];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let r=0;for(let n=0;n<this.ELEMENTS;++n){let o=this[n]-e[n];r+=o*o}return z(r)}dot(e){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*e[n];return z(r)}normalize(){let e=this.magnitude();if(e!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=e;return this.check()}multiply(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return et(e>=0&&e<this.ELEMENTS,"index is out of range"),z(this[e])}setComponent(e,r){return et(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=r,this.check()}addVectors(e,r){return this.copy(e).add(r)}subVectors(e,r){return this.copy(e).subtract(r)}multiplyVectors(e,r){return this.copy(e).multiply(r)}addScaledVector(e,r){return this.add(new this.constructor(e).multiplyScalar(r))}};var q=typeof Float32Array<"u"?Float32Array:Array,lr=Math.random;function Ue(t){return t>=0?Math.round(t):t%.5===0?Math.floor(t):Math.round(t)}var Fx=Math.PI/180;function m0(){let t=new q(2);return q!=Float32Array&&(t[0]=0,t[1]=0),t}function Es(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[3]*o+r[6],t[1]=r[1]*n+r[4]*o+r[7],t}function Ss(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[4]*o+r[12],t[1]=r[1]*n+r[5]*o+r[13],t}var Ux=function(){let t=m0();return function(e,r,n,o,i,s){let a,f;for(r||(r=2),n||(n=0),o?f=Math.min(o*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],i(t,t,s),e[a]=t[0],e[a+1]=t[1];return e}}();function Rs(t,e,r){let n=e[0],o=e[1],i=r[3]*n+r[7]*o||1;return t[0]=(r[0]*n+r[4]*o)/i,t[1]=(r[1]*n+r[5]*o)/i,t}function hn(t,e,r){let n=e[0],o=e[1],i=e[2],s=r[3]*n+r[7]*o+r[11]*i||1;return t[0]=(r[0]*n+r[4]*o+r[8]*i)/s,t[1]=(r[1]*n+r[5]*o+r[9]*i)/s,t[2]=(r[2]*n+r[6]*o+r[10]*i)/s,t}function Ts(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o,t[1]=r[1]*n+r[3]*o,t[2]=e[2],t}function Ms(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o,t[1]=r[1]*n+r[3]*o,t[2]=e[2],t[3]=e[3],t}function _n(t,e,r){let n=e[0],o=e[1],i=e[2];return t[0]=r[0]*n+r[3]*o+r[6]*i,t[1]=r[1]*n+r[4]*o+r[7]*i,t[2]=r[2]*n+r[5]*o+r[8]*i,t[3]=e[3],t}var ke={};an(ke,{add:()=>E0,angle:()=>Oo,bezier:()=>v0,ceil:()=>S0,clone:()=>x0,copy:()=>A0,create:()=>dn,cross:()=>pe,dist:()=>K0,distance:()=>Cs,div:()=>z0,divide:()=>bs,dot:()=>hr,equals:()=>U0,exactEquals:()=>F0,floor:()=>R0,forEach:()=>X0,fromValues:()=>un,hermite:()=>I0,inverse:()=>C0,len:()=>bo,length:()=>ys,lerp:()=>B0,max:()=>M0,min:()=>T0,mul:()=>k0,multiply:()=>Os,negate:()=>b0,normalize:()=>To,random:()=>L0,rotateX:()=>Mo,rotateY:()=>yo,rotateZ:()=>wo,round:()=>y0,scale:()=>w0,scaleAndAdd:()=>O0,set:()=>g0,slerp:()=>D0,sqrDist:()=>H0,sqrLen:()=>V0,squaredDistance:()=>Bs,squaredLength:()=>Ds,str:()=>N0,sub:()=>G0,subtract:()=>ws,transformMat3:()=>_r,transformMat4:()=>me,transformQuat:()=>dr,zero:()=>P0});function dn(){let t=new q(3);return q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function x0(t){let e=new q(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function ys(t){let e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function un(t,e,r){let n=new q(3);return n[0]=t,n[1]=e,n[2]=r,n}function A0(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function g0(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function E0(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function ws(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function Os(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function bs(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function S0(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function R0(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function T0(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function M0(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function y0(t,e){return t[0]=Ue(e[0]),t[1]=Ue(e[1]),t[2]=Ue(e[2]),t}function w0(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function O0(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function Cs(t,e){let r=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2];return Math.sqrt(r*r+n*n+o*o)}function Bs(t,e){let r=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2];return r*r+n*n+o*o}function Ds(t){let e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function b0(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function C0(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function To(t,e){let r=e[0],n=e[1],o=e[2],i=r*r+n*n+o*o;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function hr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function pe(t,e,r){let n=e[0],o=e[1],i=e[2],s=r[0],a=r[1],f=r[2];return t[0]=o*f-i*a,t[1]=i*s-n*f,t[2]=n*a-o*s,t}function B0(t,e,r,n){let o=e[0],i=e[1],s=e[2];return t[0]=o+n*(r[0]-o),t[1]=i+n*(r[1]-i),t[2]=s+n*(r[2]-s),t}function D0(t,e,r,n){let o=Math.acos(Math.min(Math.max(hr(e,r),-1),1)),i=Math.sin(o),s=Math.sin((1-n)*o)/i,a=Math.sin(n*o)/i;return t[0]=s*e[0]+a*r[0],t[1]=s*e[1]+a*r[1],t[2]=s*e[2]+a*r[2],t}function I0(t,e,r,n,o,i){let s=i*i,a=s*(2*i-3)+1,f=s*(i-2)+i,c=s*(i-1),l=s*(3-2*i);return t[0]=e[0]*a+r[0]*f+n[0]*c+o[0]*l,t[1]=e[1]*a+r[1]*f+n[1]*c+o[1]*l,t[2]=e[2]*a+r[2]*f+n[2]*c+o[2]*l,t}function v0(t,e,r,n,o,i){let s=1-i,a=s*s,f=i*i,c=a*s,l=3*i*a,d=3*f*s,_=f*i;return t[0]=e[0]*c+r[0]*l+n[0]*d+o[0]*_,t[1]=e[1]*c+r[1]*l+n[1]*d+o[1]*_,t[2]=e[2]*c+r[2]*l+n[2]*d+o[2]*_,t}function L0(t,e){e=e===void 0?1:e;let r=lr()*2*Math.PI,n=lr()*2-1,o=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*o,t[1]=Math.sin(r)*o,t[2]=n*e,t}function me(t,e,r){let n=e[0],o=e[1],i=e[2],s=r[3]*n+r[7]*o+r[11]*i+r[15];return s=s||1,t[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/s,t[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/s,t[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/s,t}function _r(t,e,r){let n=e[0],o=e[1],i=e[2];return t[0]=n*r[0]+o*r[3]+i*r[6],t[1]=n*r[1]+o*r[4]+i*r[7],t[2]=n*r[2]+o*r[5]+i*r[8],t}function dr(t,e,r){let n=r[0],o=r[1],i=r[2],s=r[3],a=e[0],f=e[1],c=e[2],l=o*c-i*f,d=i*a-n*c,_=n*f-o*a,h=o*_-i*d,u=i*l-n*_,x=n*d-o*l,p=s*2;return l*=p,d*=p,_*=p,h*=2,u*=2,x*=2,t[0]=a+l+h,t[1]=f+d+u,t[2]=c+_+x,t}function Mo(t,e,r,n){let o=[],i=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],i[0]=o[0],i[1]=o[1]*Math.cos(n)-o[2]*Math.sin(n),i[2]=o[1]*Math.sin(n)+o[2]*Math.cos(n),t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function yo(t,e,r,n){let o=[],i=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],i[0]=o[2]*Math.sin(n)+o[0]*Math.cos(n),i[1]=o[1],i[2]=o[2]*Math.cos(n)-o[0]*Math.sin(n),t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function wo(t,e,r,n){let o=[],i=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],i[0]=o[0]*Math.cos(n)-o[1]*Math.sin(n),i[1]=o[0]*Math.sin(n)+o[1]*Math.cos(n),i[2]=o[2],t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function Oo(t,e){let r=t[0],n=t[1],o=t[2],i=e[0],s=e[1],a=e[2],f=Math.sqrt((r*r+n*n+o*o)*(i*i+s*s+a*a)),c=f&&hr(t,e)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function P0(t){return t[0]=0,t[1]=0,t[2]=0,t}function N0(t){return"vec3(".concat(t[0],", ").concat(t[1],", ").concat(t[2],")")}function F0(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function U0(t,e){let r=t[0],n=t[1],o=t[2],i=e[0],s=e[1],a=e[2];return Math.abs(r-i)<=1e-6*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-s)<=1e-6*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(o-a)<=1e-6*Math.max(1,Math.abs(o),Math.abs(a))}var G0=ws,k0=Os,z0=bs,K0=Cs,H0=Bs,bo=ys,V0=Ds,X0=function(){let t=dn();return function(e,r,n,o,i,s){let a,f;for(r||(r=3),n||(n=0),o?f=Math.min(o*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],i(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}}();var Co=[0,0,0],pn,v=class extends Fe{static get ZERO(){return pn||(pn=new v(0,0,0),Object.freeze(pn)),pn}constructor(e=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Lt(e)?this.copy(e):(W.debug&&(z(e),z(r),z(n)),this[0]=e,this[1]=r,this[2]=n)}set(e,r,n){return this[0]=e,this[1]=r,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return W.debug&&(z(e.x),z(e.y),z(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=z(e)}angle(e){return Oo(this,e)}cross(e){return pe(this,this,e),this.check()}rotateX({radians:e,origin:r=Co}){return Mo(this,this,r,e),this.check()}rotateY({radians:e,origin:r=Co}){return yo(this,this,r,e),this.check()}rotateZ({radians:e,origin:r=Co}){return wo(this,this,r,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return me(this,this,e),this.check()}transformAsVector(e){return hn(this,this,e),this.check()}transformByMatrix3(e){return _r(this,this,e),this.check()}transformByMatrix2(e){return Ts(this,this,e),this.check()}transformByQuaternion(e){return dr(this,this,e),this.check()}};var mn,ze=class extends Fe{static get ZERO(){return mn||(mn=new ze(0,0,0,0),Object.freeze(mn)),mn}constructor(e=0,r=0,n=0,o=0){super(-0,-0,-0,-0),Lt(e)&&arguments.length===1?this.copy(e):(W.debug&&(z(e),z(r),z(n),z(o)),this[0]=e,this[1]=r,this[2]=n,this[3]=o)}set(e,r,n,o){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}fromObject(e){return W.debug&&(z(e.x),z(e.y),z(e.z),z(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}get ELEMENTS(){return 4}get z(){return this[2]}set z(e){this[2]=z(e)}get w(){return this[3]}set w(e){this[3]=z(e)}transform(e){return me(this,this,e),this.check()}transformByMatrix3(e){return _n(this,this,e),this.check()}transformByMatrix2(e){return Ms(this,this,e),this.check()}transformByQuaternion(e){return dr(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}};var Ke=class extends re{toString(){let e="[";if(W.printRowMajor){e+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)e+=" ".concat(this[n*this.RANK+r])}else{e+="column-major:";for(let r=0;r<this.ELEMENTS;++r)e+=" ".concat(this[r])}return e+="]",e}getElementIndex(e,r){return r*this.RANK+e}getElement(e,r){return this[r*this.RANK+e]}setElement(e,r,n){return this[r*this.RANK+e]=z(n),this}getColumn(e,r=new Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let o=0;o<this.RANK;++o)r[o]=this[n+o];return r}setColumn(e,r){let n=e*this.RANK;for(let o=0;o<this.RANK;++o)this[n+o]=r[o];return this}};function Is(){let t=new q(9);return q!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function vs(t,e){if(t===e){let r=e[1],n=e[2],o=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=o}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Ls(t,e){let r=e[0],n=e[1],o=e[2],i=e[3],s=e[4],a=e[5],f=e[6],c=e[7],l=e[8],d=l*s-a*c,_=-l*i+a*f,h=c*i-s*f,u=r*d+n*_+o*h;return u?(u=1/u,t[0]=d*u,t[1]=(-l*n+o*c)*u,t[2]=(a*n-o*s)*u,t[3]=_*u,t[4]=(l*r-o*f)*u,t[5]=(-a*r+o*i)*u,t[6]=h*u,t[7]=(-c*r+n*f)*u,t[8]=(s*r-n*i)*u,t):null}function Ps(t){let e=t[0],r=t[1],n=t[2],o=t[3],i=t[4],s=t[5],a=t[6],f=t[7],c=t[8];return e*(c*i-s*f)+r*(-c*o+s*a)+n*(f*o-i*a)}function Bo(t,e,r){let n=e[0],o=e[1],i=e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=e[8],_=r[0],h=r[1],u=r[2],x=r[3],p=r[4],S=r[5],y=r[6],B=r[7],T=r[8];return t[0]=_*n+h*s+u*c,t[1]=_*o+h*a+u*l,t[2]=_*i+h*f+u*d,t[3]=x*n+p*s+S*c,t[4]=x*o+p*a+S*l,t[5]=x*i+p*f+S*d,t[6]=y*n+B*s+T*c,t[7]=y*o+B*a+T*l,t[8]=y*i+B*f+T*d,t}function Ns(t,e,r){let n=e[0],o=e[1],i=e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=e[8],_=r[0],h=r[1];return t[0]=n,t[1]=o,t[2]=i,t[3]=s,t[4]=a,t[5]=f,t[6]=_*n+h*s+c,t[7]=_*o+h*a+l,t[8]=_*i+h*f+d,t}function Fs(t,e,r){let n=e[0],o=e[1],i=e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=e[8],_=Math.sin(r),h=Math.cos(r);return t[0]=h*n+_*s,t[1]=h*o+_*a,t[2]=h*i+_*f,t[3]=h*s-_*n,t[4]=h*a-_*o,t[5]=h*f-_*i,t[6]=c,t[7]=l,t[8]=d,t}function Do(t,e,r){let n=r[0],o=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=o*e[3],t[4]=o*e[4],t[5]=o*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Us(t,e){let r=e[0],n=e[1],o=e[2],i=e[3],s=r+r,a=n+n,f=o+o,c=r*s,l=n*s,d=n*a,_=o*s,h=o*a,u=o*f,x=i*s,p=i*a,S=i*f;return t[0]=1-d-u,t[3]=l-S,t[6]=_+p,t[1]=l+S,t[4]=1-c-u,t[7]=h-x,t[2]=_-p,t[5]=h+x,t[8]=1-c-d,t}var Io;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL1ROW0=3]="COL1ROW0",t[t.COL1ROW1=4]="COL1ROW1",t[t.COL1ROW2=5]="COL1ROW2",t[t.COL2ROW0=6]="COL2ROW0",t[t.COL2ROW1=7]="COL2ROW1",t[t.COL2ROW2=8]="COL2ROW2"})(Io||(Io={}));var q0=Object.freeze([1,0,0,0,1,0,0,0,1]),j=class extends Ke{static get IDENTITY(){return Q0()}static get ZERO(){return Z0()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return Io}constructor(e,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):r.length>0?this.copy([e,...r]):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(q0)}fromObject(e){return this.check()}fromQuaternion(e){return Us(this,e),this.check()}set(e,r,n,o,i,s,a,f,c){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this[4]=i,this[5]=s,this[6]=a,this[7]=f,this[8]=c,this.check()}setRowMajor(e,r,n,o,i,s,a,f,c){return this[0]=e,this[1]=o,this[2]=a,this[3]=r,this[4]=i,this[5]=f,this[6]=n,this[7]=s,this[8]=c,this.check()}determinant(){return Ps(this)}transpose(){return vs(this,this),this.check()}invert(){return Ls(this,this),this.check()}multiplyLeft(e){return Bo(this,e,this),this.check()}multiplyRight(e){return Bo(this,this,e),this.check()}rotate(e){return Fs(this,this,e),this.check()}scale(e){return Array.isArray(e)?Do(this,this,e):Do(this,this,[e,e]),this.check()}translate(e){return Ns(this,this,e),this.check()}transform(e,r){let n;switch(e.length){case 2:n=Es(r||[-0,-0],e,this);break;case 3:n=_r(r||[-0,-0,-0],e,this);break;case 4:n=_n(r||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return ne(n,e.length),n}transformVector(e,r){return this.transform(e,r)}transformVector2(e,r){return this.transform(e,r)}transformVector3(e,r){return this.transform(e,r)}},xn,An=null;function Z0(){return xn||(xn=new j([0,0,0,0,0,0,0,0,0]),Object.freeze(xn)),xn}function Q0(){return An||(An=new j,Object.freeze(An)),An}var gn={};an(gn,{add:()=>Eh,adjoint:()=>eh,clone:()=>j0,copy:()=>J0,create:()=>Y0,decompose:()=>hh,determinant:()=>Po,equals:()=>Mh,exactEquals:()=>Th,frob:()=>gh,fromQuat:()=>Ko,fromQuat2:()=>ch,fromRotation:()=>oh,fromRotationTranslation:()=>ks,fromRotationTranslationScale:()=>_h,fromRotationTranslationScaleOrigin:()=>dh,fromScaling:()=>nh,fromTranslation:()=>rh,fromValues:()=>$0,fromXRotation:()=>ih,fromYRotation:()=>sh,fromZRotation:()=>ah,frustum:()=>Ho,getRotation:()=>lh,getScaling:()=>zs,getTranslation:()=>fh,identity:()=>Gs,invert:()=>Lo,lookAt:()=>Wo,mul:()=>yh,multiply:()=>ur,multiplyScalar:()=>Sh,multiplyScalarAndAdd:()=>Rh,ortho:()=>Xo,orthoNO:()=>Hs,orthoZO:()=>mh,perspective:()=>Vo,perspectiveFromFieldOfView:()=>ph,perspectiveNO:()=>Ks,perspectiveZO:()=>uh,rotate:()=>Uo,rotateX:()=>Go,rotateY:()=>ko,rotateZ:()=>zo,scale:()=>Fo,set:()=>th,str:()=>Ah,sub:()=>wh,subtract:()=>Vs,targetTo:()=>xh,translate:()=>No,transpose:()=>vo});function Y0(){let t=new q(16);return q!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function j0(t){let e=new q(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function J0(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function $0(t,e,r,n,o,i,s,a,f,c,l,d,_,h,u,x){let p=new q(16);return p[0]=t,p[1]=e,p[2]=r,p[3]=n,p[4]=o,p[5]=i,p[6]=s,p[7]=a,p[8]=f,p[9]=c,p[10]=l,p[11]=d,p[12]=_,p[13]=h,p[14]=u,p[15]=x,p}function th(t,e,r,n,o,i,s,a,f,c,l,d,_,h,u,x,p){return t[0]=e,t[1]=r,t[2]=n,t[3]=o,t[4]=i,t[5]=s,t[6]=a,t[7]=f,t[8]=c,t[9]=l,t[10]=d,t[11]=_,t[12]=h,t[13]=u,t[14]=x,t[15]=p,t}function Gs(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function vo(t,e){if(t===e){let r=e[1],n=e[2],o=e[3],i=e[6],s=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[11]=e[14],t[12]=o,t[13]=s,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function Lo(t,e){let r=e[0],n=e[1],o=e[2],i=e[3],s=e[4],a=e[5],f=e[6],c=e[7],l=e[8],d=e[9],_=e[10],h=e[11],u=e[12],x=e[13],p=e[14],S=e[15],y=r*a-n*s,B=r*f-o*s,T=r*c-i*s,R=n*f-o*a,D=n*c-i*a,I=o*c-i*f,L=l*x-d*u,A=l*p-_*u,m=l*S-h*u,g=d*p-_*x,E=d*S-h*x,U=_*S-h*p,F=y*U-B*E+T*g+R*m-D*A+I*L;return F?(F=1/F,t[0]=(a*U-f*E+c*g)*F,t[1]=(o*E-n*U-i*g)*F,t[2]=(x*I-p*D+S*R)*F,t[3]=(_*D-d*I-h*R)*F,t[4]=(f*m-s*U-c*A)*F,t[5]=(r*U-o*m+i*A)*F,t[6]=(p*T-u*I-S*B)*F,t[7]=(l*I-_*T+h*B)*F,t[8]=(s*E-a*m+c*L)*F,t[9]=(n*m-r*E-i*L)*F,t[10]=(u*D-x*T+S*y)*F,t[11]=(d*T-l*D-h*y)*F,t[12]=(a*A-s*g-f*L)*F,t[13]=(r*g-n*A+o*L)*F,t[14]=(x*B-u*R-p*y)*F,t[15]=(l*R-d*B+_*y)*F,t):null}function eh(t,e){let r=e[0],n=e[1],o=e[2],i=e[3],s=e[4],a=e[5],f=e[6],c=e[7],l=e[8],d=e[9],_=e[10],h=e[11],u=e[12],x=e[13],p=e[14],S=e[15],y=r*a-n*s,B=r*f-o*s,T=r*c-i*s,R=n*f-o*a,D=n*c-i*a,I=o*c-i*f,L=l*x-d*u,A=l*p-_*u,m=l*S-h*u,g=d*p-_*x,E=d*S-h*x,U=_*S-h*p;return t[0]=a*U-f*E+c*g,t[1]=o*E-n*U-i*g,t[2]=x*I-p*D+S*R,t[3]=_*D-d*I-h*R,t[4]=f*m-s*U-c*A,t[5]=r*U-o*m+i*A,t[6]=p*T-u*I-S*B,t[7]=l*I-_*T+h*B,t[8]=s*E-a*m+c*L,t[9]=n*m-r*E-i*L,t[10]=u*D-x*T+S*y,t[11]=d*T-l*D-h*y,t[12]=a*A-s*g-f*L,t[13]=r*g-n*A+o*L,t[14]=x*B-u*R-p*y,t[15]=l*R-d*B+_*y,t}function Po(t){let e=t[0],r=t[1],n=t[2],o=t[3],i=t[4],s=t[5],a=t[6],f=t[7],c=t[8],l=t[9],d=t[10],_=t[11],h=t[12],u=t[13],x=t[14],p=t[15],S=e*s-r*i,y=e*a-n*i,B=r*a-n*s,T=c*u-l*h,R=c*x-d*h,D=l*x-d*u,I=e*D-r*R+n*T,L=i*D-s*R+a*T,A=c*B-l*y+d*S,m=h*B-u*y+x*S;return f*I-o*L+p*A-_*m}function ur(t,e,r){let n=e[0],o=e[1],i=e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=e[8],_=e[9],h=e[10],u=e[11],x=e[12],p=e[13],S=e[14],y=e[15],B=r[0],T=r[1],R=r[2],D=r[3];return t[0]=B*n+T*a+R*d+D*x,t[1]=B*o+T*f+R*_+D*p,t[2]=B*i+T*c+R*h+D*S,t[3]=B*s+T*l+R*u+D*y,B=r[4],T=r[5],R=r[6],D=r[7],t[4]=B*n+T*a+R*d+D*x,t[5]=B*o+T*f+R*_+D*p,t[6]=B*i+T*c+R*h+D*S,t[7]=B*s+T*l+R*u+D*y,B=r[8],T=r[9],R=r[10],D=r[11],t[8]=B*n+T*a+R*d+D*x,t[9]=B*o+T*f+R*_+D*p,t[10]=B*i+T*c+R*h+D*S,t[11]=B*s+T*l+R*u+D*y,B=r[12],T=r[13],R=r[14],D=r[15],t[12]=B*n+T*a+R*d+D*x,t[13]=B*o+T*f+R*_+D*p,t[14]=B*i+T*c+R*h+D*S,t[15]=B*s+T*l+R*u+D*y,t}function No(t,e,r){let n=r[0],o=r[1],i=r[2],s,a,f,c,l,d,_,h,u,x,p,S;return e===t?(t[12]=e[0]*n+e[4]*o+e[8]*i+e[12],t[13]=e[1]*n+e[5]*o+e[9]*i+e[13],t[14]=e[2]*n+e[6]*o+e[10]*i+e[14],t[15]=e[3]*n+e[7]*o+e[11]*i+e[15]):(s=e[0],a=e[1],f=e[2],c=e[3],l=e[4],d=e[5],_=e[6],h=e[7],u=e[8],x=e[9],p=e[10],S=e[11],t[0]=s,t[1]=a,t[2]=f,t[3]=c,t[4]=l,t[5]=d,t[6]=_,t[7]=h,t[8]=u,t[9]=x,t[10]=p,t[11]=S,t[12]=s*n+l*o+u*i+e[12],t[13]=a*n+d*o+x*i+e[13],t[14]=f*n+_*o+p*i+e[14],t[15]=c*n+h*o+S*i+e[15]),t}function Fo(t,e,r){let n=r[0],o=r[1],i=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*o,t[5]=e[5]*o,t[6]=e[6]*o,t[7]=e[7]*o,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Uo(t,e,r,n){let o=n[0],i=n[1],s=n[2],a=Math.sqrt(o*o+i*i+s*s),f,c,l,d,_,h,u,x,p,S,y,B,T,R,D,I,L,A,m,g,E,U,F,G;return a<1e-6?null:(a=1/a,o*=a,i*=a,s*=a,c=Math.sin(r),f=Math.cos(r),l=1-f,d=e[0],_=e[1],h=e[2],u=e[3],x=e[4],p=e[5],S=e[6],y=e[7],B=e[8],T=e[9],R=e[10],D=e[11],I=o*o*l+f,L=i*o*l+s*c,A=s*o*l-i*c,m=o*i*l-s*c,g=i*i*l+f,E=s*i*l+o*c,U=o*s*l+i*c,F=i*s*l-o*c,G=s*s*l+f,t[0]=d*I+x*L+B*A,t[1]=_*I+p*L+T*A,t[2]=h*I+S*L+R*A,t[3]=u*I+y*L+D*A,t[4]=d*m+x*g+B*E,t[5]=_*m+p*g+T*E,t[6]=h*m+S*g+R*E,t[7]=u*m+y*g+D*E,t[8]=d*U+x*F+B*G,t[9]=_*U+p*F+T*G,t[10]=h*U+S*F+R*G,t[11]=u*U+y*F+D*G,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function Go(t,e,r){let n=Math.sin(r),o=Math.cos(r),i=e[4],s=e[5],a=e[6],f=e[7],c=e[8],l=e[9],d=e[10],_=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=i*o+c*n,t[5]=s*o+l*n,t[6]=a*o+d*n,t[7]=f*o+_*n,t[8]=c*o-i*n,t[9]=l*o-s*n,t[10]=d*o-a*n,t[11]=_*o-f*n,t}function ko(t,e,r){let n=Math.sin(r),o=Math.cos(r),i=e[0],s=e[1],a=e[2],f=e[3],c=e[8],l=e[9],d=e[10],_=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*o-c*n,t[1]=s*o-l*n,t[2]=a*o-d*n,t[3]=f*o-_*n,t[8]=i*n+c*o,t[9]=s*n+l*o,t[10]=a*n+d*o,t[11]=f*n+_*o,t}function zo(t,e,r){let n=Math.sin(r),o=Math.cos(r),i=e[0],s=e[1],a=e[2],f=e[3],c=e[4],l=e[5],d=e[6],_=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*o+c*n,t[1]=s*o+l*n,t[2]=a*o+d*n,t[3]=f*o+_*n,t[4]=c*o-i*n,t[5]=l*o-s*n,t[6]=d*o-a*n,t[7]=_*o-f*n,t}function rh(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function nh(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function oh(t,e,r){let n=r[0],o=r[1],i=r[2],s=Math.sqrt(n*n+o*o+i*i),a,f,c;return s<1e-6?null:(s=1/s,n*=s,o*=s,i*=s,f=Math.sin(e),a=Math.cos(e),c=1-a,t[0]=n*n*c+a,t[1]=o*n*c+i*f,t[2]=i*n*c-o*f,t[3]=0,t[4]=n*o*c-i*f,t[5]=o*o*c+a,t[6]=i*o*c+n*f,t[7]=0,t[8]=n*i*c+o*f,t[9]=o*i*c-n*f,t[10]=i*i*c+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function ih(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function sh(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ah(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ks(t,e,r){let n=e[0],o=e[1],i=e[2],s=e[3],a=n+n,f=o+o,c=i+i,l=n*a,d=n*f,_=n*c,h=o*f,u=o*c,x=i*c,p=s*a,S=s*f,y=s*c;return t[0]=1-(h+x),t[1]=d+y,t[2]=_-S,t[3]=0,t[4]=d-y,t[5]=1-(l+x),t[6]=u+p,t[7]=0,t[8]=_+S,t[9]=u-p,t[10]=1-(l+h),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function ch(t,e){let r=new q(3),n=-e[0],o=-e[1],i=-e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=n*n+o*o+i*i+s*s;return d>0?(r[0]=(a*s+l*n+f*i-c*o)*2/d,r[1]=(f*s+l*o+c*n-a*i)*2/d,r[2]=(c*s+l*i+a*o-f*n)*2/d):(r[0]=(a*s+l*n+f*i-c*o)*2,r[1]=(f*s+l*o+c*n-a*i)*2,r[2]=(c*s+l*i+a*o-f*n)*2),ks(t,e,r),t}function fh(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function zs(t,e){let r=e[0],n=e[1],o=e[2],i=e[4],s=e[5],a=e[6],f=e[8],c=e[9],l=e[10];return t[0]=Math.sqrt(r*r+n*n+o*o),t[1]=Math.sqrt(i*i+s*s+a*a),t[2]=Math.sqrt(f*f+c*c+l*l),t}function lh(t,e){let r=new q(3);zs(r,e);let n=1/r[0],o=1/r[1],i=1/r[2],s=e[0]*n,a=e[1]*o,f=e[2]*i,c=e[4]*n,l=e[5]*o,d=e[6]*i,_=e[8]*n,h=e[9]*o,u=e[10]*i,x=s+l+u,p=0;return x>0?(p=Math.sqrt(x+1)*2,t[3]=.25*p,t[0]=(d-h)/p,t[1]=(_-f)/p,t[2]=(a-c)/p):s>l&&s>u?(p=Math.sqrt(1+s-l-u)*2,t[3]=(d-h)/p,t[0]=.25*p,t[1]=(a+c)/p,t[2]=(_+f)/p):l>u?(p=Math.sqrt(1+l-s-u)*2,t[3]=(_-f)/p,t[0]=(a+c)/p,t[1]=.25*p,t[2]=(d+h)/p):(p=Math.sqrt(1+u-s-l)*2,t[3]=(a-c)/p,t[0]=(_+f)/p,t[1]=(d+h)/p,t[2]=.25*p),t}function hh(t,e,r,n){e[0]=n[12],e[1]=n[13],e[2]=n[14];let o=n[0],i=n[1],s=n[2],a=n[4],f=n[5],c=n[6],l=n[8],d=n[9],_=n[10];r[0]=Math.sqrt(o*o+i*i+s*s),r[1]=Math.sqrt(a*a+f*f+c*c),r[2]=Math.sqrt(l*l+d*d+_*_);let h=1/r[0],u=1/r[1],x=1/r[2],p=o*h,S=i*u,y=s*x,B=a*h,T=f*u,R=c*x,D=l*h,I=d*u,L=_*x,A=p+T+L,m=0;return A>0?(m=Math.sqrt(A+1)*2,t[3]=.25*m,t[0]=(R-I)/m,t[1]=(D-y)/m,t[2]=(S-B)/m):p>T&&p>L?(m=Math.sqrt(1+p-T-L)*2,t[3]=(R-I)/m,t[0]=.25*m,t[1]=(S+B)/m,t[2]=(D+y)/m):T>L?(m=Math.sqrt(1+T-p-L)*2,t[3]=(D-y)/m,t[0]=(S+B)/m,t[1]=.25*m,t[2]=(R+I)/m):(m=Math.sqrt(1+L-p-T)*2,t[3]=(S-B)/m,t[0]=(D+y)/m,t[1]=(R+I)/m,t[2]=.25*m),t}function _h(t,e,r,n){let o=e[0],i=e[1],s=e[2],a=e[3],f=o+o,c=i+i,l=s+s,d=o*f,_=o*c,h=o*l,u=i*c,x=i*l,p=s*l,S=a*f,y=a*c,B=a*l,T=n[0],R=n[1],D=n[2];return t[0]=(1-(u+p))*T,t[1]=(_+B)*T,t[2]=(h-y)*T,t[3]=0,t[4]=(_-B)*R,t[5]=(1-(d+p))*R,t[6]=(x+S)*R,t[7]=0,t[8]=(h+y)*D,t[9]=(x-S)*D,t[10]=(1-(d+u))*D,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function dh(t,e,r,n,o){let i=e[0],s=e[1],a=e[2],f=e[3],c=i+i,l=s+s,d=a+a,_=i*c,h=i*l,u=i*d,x=s*l,p=s*d,S=a*d,y=f*c,B=f*l,T=f*d,R=n[0],D=n[1],I=n[2],L=o[0],A=o[1],m=o[2],g=(1-(x+S))*R,E=(h+T)*R,U=(u-B)*R,F=(h-T)*D,G=(1-(_+S))*D,P=(p+y)*D,J=(u+B)*I,ot=(p-y)*I,X=(1-(_+x))*I;return t[0]=g,t[1]=E,t[2]=U,t[3]=0,t[4]=F,t[5]=G,t[6]=P,t[7]=0,t[8]=J,t[9]=ot,t[10]=X,t[11]=0,t[12]=r[0]+L-(g*L+F*A+J*m),t[13]=r[1]+A-(E*L+G*A+ot*m),t[14]=r[2]+m-(U*L+P*A+X*m),t[15]=1,t}function Ko(t,e){let r=e[0],n=e[1],o=e[2],i=e[3],s=r+r,a=n+n,f=o+o,c=r*s,l=n*s,d=n*a,_=o*s,h=o*a,u=o*f,x=i*s,p=i*a,S=i*f;return t[0]=1-d-u,t[1]=l+S,t[2]=_-p,t[3]=0,t[4]=l-S,t[5]=1-c-u,t[6]=h+x,t[7]=0,t[8]=_+p,t[9]=h-x,t[10]=1-c-d,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ho(t,e,r,n,o,i,s){let a=1/(r-e),f=1/(o-n),c=1/(i-s);return t[0]=i*2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i*2*f,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(o+n)*f,t[10]=(s+i)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*i*2*c,t[15]=0,t}function Ks(t,e,r,n,o){let i=1/Math.tan(e/2);if(t[0]=i/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,o!=null&&o!==1/0){let s=1/(n-o);t[10]=(o+n)*s,t[14]=2*o*n*s}else t[10]=-1,t[14]=-2*n;return t}var Vo=Ks;function uh(t,e,r,n,o){let i=1/Math.tan(e/2);if(t[0]=i/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,o!=null&&o!==1/0){let s=1/(n-o);t[10]=o*s,t[14]=o*n*s}else t[10]=-1,t[14]=-n;return t}function ph(t,e,r,n){let o=Math.tan(e.upDegrees*Math.PI/180),i=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),f=2/(s+a),c=2/(o+i);return t[0]=f,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-((s-a)*f*.5),t[9]=(o-i)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function Hs(t,e,r,n,o,i,s){let a=1/(e-r),f=1/(n-o),c=1/(i-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*f,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*a,t[13]=(o+n)*f,t[14]=(s+i)*c,t[15]=1,t}var Xo=Hs;function mh(t,e,r,n,o,i,s){let a=1/(e-r),f=1/(n-o),c=1/(i-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*f,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+r)*a,t[13]=(o+n)*f,t[14]=i*c,t[15]=1,t}function Wo(t,e,r,n){let o,i,s,a,f,c,l,d,_,h,u=e[0],x=e[1],p=e[2],S=n[0],y=n[1],B=n[2],T=r[0],R=r[1],D=r[2];return Math.abs(u-T)<1e-6&&Math.abs(x-R)<1e-6&&Math.abs(p-D)<1e-6?Gs(t):(d=u-T,_=x-R,h=p-D,o=1/Math.sqrt(d*d+_*_+h*h),d*=o,_*=o,h*=o,i=y*h-B*_,s=B*d-S*h,a=S*_-y*d,o=Math.sqrt(i*i+s*s+a*a),o?(o=1/o,i*=o,s*=o,a*=o):(i=0,s=0,a=0),f=_*a-h*s,c=h*i-d*a,l=d*s-_*i,o=Math.sqrt(f*f+c*c+l*l),o?(o=1/o,f*=o,c*=o,l*=o):(f=0,c=0,l=0),t[0]=i,t[1]=f,t[2]=d,t[3]=0,t[4]=s,t[5]=c,t[6]=_,t[7]=0,t[8]=a,t[9]=l,t[10]=h,t[11]=0,t[12]=-(i*u+s*x+a*p),t[13]=-(f*u+c*x+l*p),t[14]=-(d*u+_*x+h*p),t[15]=1,t)}function xh(t,e,r,n){let o=e[0],i=e[1],s=e[2],a=n[0],f=n[1],c=n[2],l=o-r[0],d=i-r[1],_=s-r[2],h=l*l+d*d+_*_;h>0&&(h=1/Math.sqrt(h),l*=h,d*=h,_*=h);let u=f*_-c*d,x=c*l-a*_,p=a*d-f*l;return h=u*u+x*x+p*p,h>0&&(h=1/Math.sqrt(h),u*=h,x*=h,p*=h),t[0]=u,t[1]=x,t[2]=p,t[3]=0,t[4]=d*p-_*x,t[5]=_*u-l*p,t[6]=l*x-d*u,t[7]=0,t[8]=l,t[9]=d,t[10]=_,t[11]=0,t[12]=o,t[13]=i,t[14]=s,t[15]=1,t}function Ah(t){return"mat4(".concat(t[0],", ").concat(t[1],", ").concat(t[2],", ").concat(t[3],", ").concat(t[4],", ").concat(t[5],", ").concat(t[6],", ").concat(t[7],", ").concat(t[8],", ").concat(t[9],", ").concat(t[10],", ").concat(t[11],", ").concat(t[12],", ").concat(t[13],", ").concat(t[14],", ").concat(t[15],")")}function gh(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3]+t[4]*t[4]+t[5]*t[5]+t[6]*t[6]+t[7]*t[7]+t[8]*t[8]+t[9]*t[9]+t[10]*t[10]+t[11]*t[11]+t[12]*t[12]+t[13]*t[13]+t[14]*t[14]+t[15]*t[15])}function Eh(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Vs(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Sh(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function Rh(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function Th(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function Mh(t,e){let r=t[0],n=t[1],o=t[2],i=t[3],s=t[4],a=t[5],f=t[6],c=t[7],l=t[8],d=t[9],_=t[10],h=t[11],u=t[12],x=t[13],p=t[14],S=t[15],y=e[0],B=e[1],T=e[2],R=e[3],D=e[4],I=e[5],L=e[6],A=e[7],m=e[8],g=e[9],E=e[10],U=e[11],F=e[12],G=e[13],P=e[14],J=e[15];return Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-B)<=1e-6*Math.max(1,Math.abs(n),Math.abs(B))&&Math.abs(o-T)<=1e-6*Math.max(1,Math.abs(o),Math.abs(T))&&Math.abs(i-R)<=1e-6*Math.max(1,Math.abs(i),Math.abs(R))&&Math.abs(s-D)<=1e-6*Math.max(1,Math.abs(s),Math.abs(D))&&Math.abs(a-I)<=1e-6*Math.max(1,Math.abs(a),Math.abs(I))&&Math.abs(f-L)<=1e-6*Math.max(1,Math.abs(f),Math.abs(L))&&Math.abs(c-A)<=1e-6*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(l-m)<=1e-6*Math.max(1,Math.abs(l),Math.abs(m))&&Math.abs(d-g)<=1e-6*Math.max(1,Math.abs(d),Math.abs(g))&&Math.abs(_-E)<=1e-6*Math.max(1,Math.abs(_),Math.abs(E))&&Math.abs(h-U)<=1e-6*Math.max(1,Math.abs(h),Math.abs(U))&&Math.abs(u-F)<=1e-6*Math.max(1,Math.abs(u),Math.abs(F))&&Math.abs(x-G)<=1e-6*Math.max(1,Math.abs(x),Math.abs(G))&&Math.abs(p-P)<=1e-6*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(S-J)<=1e-6*Math.max(1,Math.abs(S),Math.abs(J))}var yh=ur,wh=Vs;function Oh(){let t=new q(4);return q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Xs(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function Ws(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function qs(t){let e=t[0],r=t[1],n=t[2],o=t[3];return Math.sqrt(e*e+r*r+n*n+o*o)}function Zs(t){let e=t[0],r=t[1],n=t[2],o=t[3];return e*e+r*r+n*n+o*o}function Qs(t,e){let r=e[0],n=e[1],o=e[2],i=e[3],s=r*r+n*n+o*o+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=r*s,t[1]=n*s,t[2]=o*s,t[3]=i*s,t}function Ys(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function js(t,e,r,n){let o=e[0],i=e[1],s=e[2],a=e[3];return t[0]=o+n*(r[0]-o),t[1]=i+n*(r[1]-i),t[2]=s+n*(r[2]-s),t[3]=a+n*(r[3]-a),t}function Js(t,e,r){let n=e[0],o=e[1],i=e[2],s=e[3];return t[0]=r[0]*n+r[4]*o+r[8]*i+r[12]*s,t[1]=r[1]*n+r[5]*o+r[9]*i+r[13]*s,t[2]=r[2]*n+r[6]*o+r[10]*i+r[14]*s,t[3]=r[3]*n+r[7]*o+r[11]*i+r[15]*s,t}function $s(t,e,r){let n=e[0],o=e[1],i=e[2],s=r[0],a=r[1],f=r[2],c=r[3],l=c*n+a*i-f*o,d=c*o+f*n-s*i,_=c*i+s*o-a*n,h=-s*n-a*o-f*i;return t[0]=l*c+h*-s+d*-f-_*-a,t[1]=d*c+h*-a+_*-s-l*-f,t[2]=_*c+h*-f+l*-a-d*-s,t[3]=e[3],t}var lA=function(){let t=Oh();return function(e,r,n,o,i,s){let a,f;for(r||(r=4),n||(n=0),o?f=Math.min(o*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],t[3]=e[a+3],i(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2],e[a+3]=t[3];return e}}();var Qo;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"})(Qo||(Qo={}));var Ch=45*Math.PI/180,Bh=1,qo=.1,Zo=500,Dh=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),ut=class extends Ke{static get IDENTITY(){return vh()}static get ZERO(){return Ih()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Qo}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,r,n,o,i,s,a,f,c,l,d,_,h,u,x,p){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this[4]=i,this[5]=s,this[6]=a,this[7]=f,this[8]=c,this[9]=l,this[10]=d,this[11]=_,this[12]=h,this[13]=u,this[14]=x,this[15]=p,this.check()}setRowMajor(e,r,n,o,i,s,a,f,c,l,d,_,h,u,x,p){return this[0]=e,this[1]=i,this[2]=c,this[3]=h,this[4]=r,this[5]=s,this[6]=l,this[7]=u,this[8]=n,this[9]=a,this[10]=d,this[11]=x,this[12]=o,this[13]=f,this[14]=_,this[15]=p,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(Dh)}fromObject(e){return this.check()}fromQuaternion(e){return Ko(this,e),this.check()}frustum(e){let{left:r,right:n,bottom:o,top:i,near:s=qo,far:a=Zo}=e;return a===1/0?Lh(this,r,n,o,i,s):Ho(this,r,n,o,i,s,a),this.check()}lookAt(e){let{eye:r,center:n=[0,0,0],up:o=[0,1,0]}=e;return Wo(this,r,n,o),this.check()}ortho(e){let{left:r,right:n,bottom:o,top:i,near:s=qo,far:a=Zo}=e;return Xo(this,r,n,o,i,s,a),this.check()}orthographic(e){let{fovy:r=Ch,aspect:n=Bh,focalDistance:o=1,near:i=qo,far:s=Zo}=e;ta(r);let a=r/2,f=o*Math.tan(a),c=f*n;return this.ortho({left:-c,right:c,bottom:-f,top:f,near:i,far:s})}perspective(e){let{fovy:r=45*Math.PI/180,aspect:n=1,near:o=.1,far:i=500}=e;return ta(r),Vo(this,r,n,o,i),this.check()}determinant(){return Po(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),o=1/n[0],i=1/n[1],s=1/n[2];return e[0]=this[0]*o,e[1]=this[1]*i,e[2]=this[2]*s,e[3]=0,e[4]=this[4]*o,e[5]=this[5]*i,e[6]=this[6]*s,e[7]=0,e[8]=this[8]*o,e[9]=this[9]*i,e[10]=this[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),o=1/n[0],i=1/n[1],s=1/n[2];return e[0]=this[0]*o,e[1]=this[1]*i,e[2]=this[2]*s,e[3]=this[4]*o,e[4]=this[5]*i,e[5]=this[6]*s,e[6]=this[8]*o,e[7]=this[9]*i,e[8]=this[10]*s,e}transpose(){return vo(this,this),this.check()}invert(){return Lo(this,this),this.check()}multiplyLeft(e){return ur(this,e,this),this.check()}multiplyRight(e){return ur(this,this,e),this.check()}rotateX(e){return Go(this,this,e),this.check()}rotateY(e){return ko(this,this,e),this.check()}rotateZ(e){return zo(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,r){return Uo(this,this,e,r),this.check()}scale(e){return Fo(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return No(this,this,e),this.check()}transform(e,r){return e.length===4?(r=Js(r||[-0,-0,-0,-0],e,this),ne(r,4),r):this.transformAsPoint(e,r)}transformAsPoint(e,r){let{length:n}=e,o;switch(n){case 2:o=Ss(r||[-0,-0],e,this);break;case 3:o=me(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return ne(o,e.length),o}transformAsVector(e,r){let n;switch(e.length){case 2:n=Rs(r||[-0,-0],e,this);break;case 3:n=hn(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return ne(n,e.length),n}transformPoint(e,r){return this.transformAsPoint(e,r)}transformVector(e,r){return this.transformAsPoint(e,r)}transformDirection(e,r){return this.transformAsVector(e,r)}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,r,n){return this.identity().translate([e,r,n])}},En,Sn;function Ih(){return En||(En=new ut([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(En)),En}function vh(){return Sn||(Sn=new ut,Object.freeze(Sn)),Sn}function ta(t){if(t>Math.PI*2)throw Error("expected radians")}function Lh(t,e,r,n,o,i){let s=2*i/(r-e),a=2*i/(o-n),f=(r+e)/(r-e),c=(o+n)/(o-n),l=-1,d=-1,_=-2*i;return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=f,t[9]=c,t[10]=l,t[11]=d,t[12]=0,t[13]=0,t[14]=_,t[15]=0,t}function ea(){let t=new q(4);return q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ra(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Yo(t,e,r){r=r*.5;let n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function jo(t,e,r){let n=e[0],o=e[1],i=e[2],s=e[3],a=r[0],f=r[1],c=r[2],l=r[3];return t[0]=n*l+s*a+o*c-i*f,t[1]=o*l+s*f+i*a-n*c,t[2]=i*l+s*c+n*f-o*a,t[3]=s*l-n*a-o*f-i*c,t}function na(t,e,r){r*=.5;let n=e[0],o=e[1],i=e[2],s=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f+s*a,t[1]=o*f+i*a,t[2]=i*f-o*a,t[3]=s*f-n*a,t}function oa(t,e,r){r*=.5;let n=e[0],o=e[1],i=e[2],s=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f-i*a,t[1]=o*f+s*a,t[2]=i*f+n*a,t[3]=s*f-o*a,t}function ia(t,e,r){r*=.5;let n=e[0],o=e[1],i=e[2],s=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f+o*a,t[1]=o*f-n*a,t[2]=i*f+s*a,t[3]=s*f-i*a,t}function sa(t,e){let r=e[0],n=e[1],o=e[2];return t[0]=r,t[1]=n,t[2]=o,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-o*o)),t}function pr(t,e,r,n){let o=e[0],i=e[1],s=e[2],a=e[3],f=r[0],c=r[1],l=r[2],d=r[3],_,h,u,x,p;return _=o*f+i*c+s*l+a*d,_<0&&(_=-_,f=-f,c=-c,l=-l,d=-d),1-_>1e-6?(h=Math.acos(_),p=Math.sin(h),u=Math.sin((1-n)*h)/p,x=Math.sin(n*h)/p):(u=1-n,x=n),t[0]=u*o+x*f,t[1]=u*i+x*c,t[2]=u*s+x*l,t[3]=u*a+x*d,t}function aa(t,e){let r=e[0],n=e[1],o=e[2],i=e[3],s=r*r+n*n+o*o+i*i,a=s?1/s:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-o*a,t[3]=i*a,t}function ca(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Jo(t,e){let r=e[0]+e[4]+e[8],n;if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{let o=0;e[4]>e[0]&&(o=1),e[8]>e[o*3+o]&&(o=2);let i=(o+1)%3,s=(o+2)%3;n=Math.sqrt(e[o*3+o]-e[i*3+i]-e[s*3+s]+1),t[o]=.5*n,n=.5/n,t[3]=(e[i*3+s]-e[s*3+i])*n,t[i]=(e[i*3+o]+e[o*3+i])*n,t[s]=(e[s*3+o]+e[o*3+s])*n}return t}var fa=Xs;var la=Ws,ha=Ys,_a=js,da=qs;var ua=Zs;var pa=Qs;var ma=function(){let t=dn(),e=un(1,0,0),r=un(0,1,0);return function(n,o,i){let s=hr(o,i);return s<-.999999?(pe(t,e,o),bo(t)<1e-6&&pe(t,r,o),To(t,t),Yo(n,t,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(pe(t,o,i),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+s,pa(n,n))}}(),MA=function(){let t=ea(),e=ea();return function(r,n,o,i,s,a){return pr(t,n,s,a),pr(e,o,i,a),pr(r,t,e,2*a*(1-a)),r}}(),yA=function(){let t=Is();return function(e,r,n,o){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=o[0],t[4]=o[1],t[7]=o[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],pa(e,Jo(e,t))}}();var Ph=[0,0,0,1],He=class extends re{constructor(e=0,r=0,n=0,o=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,r,n,o)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,r,n,o){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return Jo(this,e),this.check()}fromAxisRotation(e,r){return Yo(this,e,r),this.check()}identity(){return ra(this),this.check()}setAxisAngle(e,r){return this.fromAxisRotation(e,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=z(e)}get y(){return this[1]}set y(e){this[1]=z(e)}get z(){return this[2]}set z(e){this[2]=z(e)}get w(){return this[3]}set w(e){this[3]=z(e)}len(){return da(this)}lengthSquared(){return ua(this)}dot(e){return ha(this,e)}rotationTo(e,r){return ma(this,e,r),this.check()}add(e){return fa(this,this,e),this.check()}calculateW(){return sa(this,this),this.check()}conjugate(){return ca(this,this),this.check()}invert(){return aa(this,this),this.check()}lerp(e,r,n){return n===void 0?this.lerp(this,e,r):(_a(this,e,r,n),this.check())}multiplyRight(e){return jo(this,this,e),this.check()}multiplyLeft(e){return jo(this,e,this),this.check()}normalize(){let e=this.len(),r=e>0?1/e:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,e===0&&(this[3]=1),this.check()}rotateX(e){return na(this,this,e),this.check()}rotateY(e){return oa(this,this,e),this.check()}rotateZ(e){return ia(this,this,e),this.check()}scale(e){return la(this,this,e),this.check()}slerp(e,r,n){let o,i,s;switch(arguments.length){case 1:({start:o=Ph,target:i,ratio:s}=e);break;case 2:o=this,i=e,s=r;break;default:o=e,i=r,s=n}return pr(this,o,i,s),this.check()}transformVector4(e,r=new ze){return $s(r,e,this),ne(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,r){return this.setAxisAngle(e,r)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}};var oe={};an(oe,{EPSILON1:()=>Nh,EPSILON10:()=>Xh,EPSILON11:()=>Wh,EPSILON12:()=>qh,EPSILON13:()=>Zh,EPSILON14:()=>Qh,EPSILON15:()=>Yh,EPSILON16:()=>jh,EPSILON17:()=>Jh,EPSILON18:()=>$h,EPSILON19:()=>t1,EPSILON2:()=>Fh,EPSILON20:()=>e1,EPSILON3:()=>Uh,EPSILON4:()=>Gh,EPSILON5:()=>kh,EPSILON6:()=>zh,EPSILON7:()=>Kh,EPSILON8:()=>Hh,EPSILON9:()=>Vh,PI_OVER_FOUR:()=>n1,PI_OVER_SIX:()=>o1,PI_OVER_TWO:()=>r1,TWO_PI:()=>i1});var Nh=.1,Fh=.01,Uh=.001,Gh=1e-4,kh=1e-5,zh=1e-6,Kh=1e-7,Hh=1e-8,Vh=1e-9,Xh=1e-10,Wh=1e-11,qh=1e-12,Zh=1e-13,Qh=1e-14,Yh=1e-15,jh=1e-16,Jh=1e-17,$h=1e-18,t1=1e-19,e1=1e-20,r1=Math.PI/2,n1=Math.PI/4,o1=Math.PI/6,i1=Math.PI*2;function $o(t){switch(t){case"UInt8":return Uint8Array;case"UInt16":return Uint16Array;case"UInt32":return Uint32Array;case"Float32":return Float32Array;case"UInt64":return Float64Array;default:throw new Error(`parse i3s tile content: unknown type of data: ${t}`)}}var xa={UInt8:de.UNSIGNED_BYTE,UInt16:de.UNSIGNED_SHORT,Float32:de.FLOAT,UInt32:de.UNSIGNED_INT,UInt64:de.DOUBLE};function Ve(t){switch(t){case"UInt8":return 1;case"UInt16":case"Int16":return 2;case"UInt32":case"Int32":case"Float32":return 4;case"UInt64":case"Int64":case"Float64":return 8;default:throw new Error(`parse i3s tile content: unknown size of data: ${t}`)}}var Aa="String",ga="Oid32",Ea="Float64",Sa="Int16",Pt;(function(t){t[t.DEFAULT=-1]="DEFAULT",t[t.LNGLAT=1]="LNGLAT",t[t.METER_OFFSETS=2]="METER_OFFSETS",t[t.LNGLAT_OFFSETS=3]="LNGLAT_OFFSETS",t[t.CARTESIAN=0]="CARTESIAN"})(Pt||(Pt={}));var Oc=Bt(Vt(),1);var wr=Bt(Vt(),1);var Xt=6356752314245179e-9,s1={radii:[6378137,6378137,Xt],radiiSquared:[6378137*6378137,6378137*6378137,Xt*Xt],oneOverRadii:[1/6378137,1/6378137,1/Xt],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Xt*Xt)],maximumRadius:Math.max(6378137,6378137,Xt),centerToleranceSquared:.1};function Rn(t){return t}var i2=new v;function a1(t,e=[],r=Rn){return"longitude"in t?(e[0]=r(t.longitude),e[1]=r(t.latitude),e[2]=t.height):"x"in t?(e[0]=r(t.x),e[1]=r(t.y),e[2]=t.z):(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]),e}function Ra(t,e=[]){return a1(t,e,W._cartographicRadians?Rn:So)}function c1(t,e,r=Rn){return"longitude"in e?(e.longitude=r(t[0]),e.latitude=r(t[1]),e.height=t[2]):"x"in e?(e.x=r(t[0]),e.y=r(t[1]),e.z=t[2]):(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]),e}function Ta(t,e){return c1(t,e,W._cartographicRadians?Rn:Ro)}var Ma=1e-14,f1=new v,ya={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},ti={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},mr={east:new v,north:new v,up:new v,west:new v,south:new v,down:new v},l1=new v,h1=new v,_1=new v;function ei(t,e,r,n,o,i){let s=ya[e]&&ya[e][r];et(s&&(!n||n===s));let a,f,c,l=f1.copy(o);if(dt(l.x,0,Ma)&&dt(l.y,0,Ma)){let _=Math.sign(l.z);a=l1.fromArray(ti[e]),e!=="east"&&e!=="west"&&a.scale(_),f=h1.fromArray(ti[r]),r!=="east"&&r!=="west"&&f.scale(_),c=_1.fromArray(ti[n]),n!=="east"&&n!=="west"&&c.scale(_)}else{let{up:_,east:h,north:u}=mr;h.set(-l.y,l.x,0).normalize(),t.geodeticSurfaceNormal(l,_),u.copy(_).cross(h);let{down:x,west:p,south:S}=mr;x.copy(_).scale(-1),p.copy(h).scale(-1),S.copy(u).scale(-1),a=mr[e],f=mr[r],c=mr[n]}return i[0]=a.x,i[1]=a.y,i[2]=a.z,i[3]=0,i[4]=f.x,i[5]=f.y,i[6]=f.z,i[7]=0,i[8]=c.x,i[9]=c.y,i[10]=c.z,i[11]=0,i[12]=l.x,i[13]=l.y,i[14]=l.z,i[15]=1,i}var Xe=new v,d1=new v,u1=new v;function wa(t,e,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:o,centerToleranceSquared:i}=e;Xe.from(t);let s=Xe.x,a=Xe.y,f=Xe.z,c=n.x,l=n.y,d=n.z,_=s*s*c*c,h=a*a*l*l,u=f*f*d*d,x=_+h+u,p=Math.sqrt(1/x);if(!Number.isFinite(p))return;let S=d1;if(S.copy(t).scale(p),x<i)return S.to(r);let y=o.x,B=o.y,T=o.z,R=u1;R.set(S.x*y*2,S.y*B*2,S.z*T*2);let D=(1-p)*Xe.len()/(.5*R.len()),I=0,L,A,m,g;do{D-=I,L=1/(1+D*y),A=1/(1+D*B),m=1/(1+D*T);let E=L*L,U=A*A,F=m*m,G=E*L,P=U*A,J=F*m;g=_*E+h*U+u*F-1;let X=-2*(_*G*y+h*P*B+u*J*T);I=g/X}while(Math.abs(g)>oe.EPSILON12);return Xe.scale([L,A,m]).to(r)}var Tn=new v,Oa=new v,x1=new v,yt=new v,A1=new v,Mn=new v,gt=class{constructor(e=0,r=0,n=0){V(this,"radii",void 0),V(this,"radiiSquared",void 0),V(this,"radiiToTheFourth",void 0),V(this,"oneOverRadii",void 0),V(this,"oneOverRadiiSquared",void 0),V(this,"minimumRadius",void 0),V(this,"maximumRadius",void 0),V(this,"centerToleranceSquared",oe.EPSILON1),V(this,"squaredXOverSquaredZ",void 0),et(e>=0),et(r>=0),et(n>=0),this.radii=new v(e,r,n),this.radiiSquared=new v(e*e,r*r,n*n),this.radiiToTheFourth=new v(e*e*e*e,r*r*r*r,n*n*n*n),this.oneOverRadii=new v(e===0?0:1/e,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new v(e===0?0:1/(e*e),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(e,r,n),this.maximumRadius=Math.max(e,r,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,r=[0,0,0]){let n=Oa,o=x1,[,,i]=e;this.geodeticSurfaceNormalCartographic(e,n),o.copy(this.radiiSquared).scale(n);let s=Math.sqrt(n.dot(o));return o.scale(1/s),n.scale(i),o.add(n),o.to(r)}cartesianToCartographic(e,r=[0,0,0]){Mn.from(e);let n=this.scaleToGeodeticSurface(Mn,yt);if(!n)return;let o=this.geodeticSurfaceNormal(n,Oa),i=A1;i.copy(Mn).subtract(n);let s=Math.atan2(o.y,o.x),a=Math.asin(o.z),f=Math.sign(ke.dot(i,Mn))*ke.length(i);return Ta([s,a,f],r)}eastNorthUpToFixedFrame(e,r=new ut){return ei(this,"east","north","up",e,r)}localFrameToFixedFrame(e,r,n,o,i=new ut){return ei(this,e,r,n,o,i)}geocentricSurfaceNormal(e,r=[0,0,0]){return Tn.from(e).normalize().to(r)}geodeticSurfaceNormalCartographic(e,r=[0,0,0]){let n=Ra(e),o=n[0],i=n[1],s=Math.cos(i);return Tn.set(s*Math.cos(o),s*Math.sin(o),Math.sin(i)).normalize(),Tn.to(r)}geodeticSurfaceNormal(e,r=[0,0,0]){return Tn.from(e).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(e,r){return wa(e,this,r)}scaleToGeocentricSurface(e,r=[0,0,0]){yt.from(e);let n=yt.x,o=yt.y,i=yt.z,s=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*s.x+o*o*s.y+i*i*s.z);return yt.multiplyScalar(a).to(r)}transformPositionToScaledSpace(e,r=[0,0,0]){return yt.from(e).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(e,r=[0,0,0]){return yt.from(e).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(e,r=0,n=[0,0,0]){et(dt(this.radii.x,this.radii.y,oe.EPSILON15)),et(this.radii.z>0),yt.from(e);let o=yt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(o)>=this.radii.z-r))return yt.set(0,0,o).to(n)}};V(gt,"WGS84",new gt(6378137,6378137,Xt));var ba="4.3.0-alpha.3";var g1=globalThis.loaders?.parseImageNode,ri=typeof Image<"u",ni=typeof ImageBitmap<"u",E1=Boolean(g1),oi=At?!0:E1;function Ca(t){switch(t){case"auto":return ni||ri||oi;case"imagebitmap":return ni;case"image":return ri;case"data":return oi;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function Ba(){if(ni)return"imagebitmap";if(ri)return"image";if(oi)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function S1(t){let e=R1(t);if(!e)throw new Error("Not an image");return e}function Da(t){switch(S1(t)){case"data":return t;case"image":case"imagebitmap":let e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function R1(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var T1=/^data:image\/svg\+xml/,M1=/\.svg((\?|#).*)?$/;function yn(t){return t&&(T1.test(t)||M1.test(t))}function Ia(t,e){if(yn(e)){let n=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(i){throw new Error(i.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return ii(t,e)}function ii(t,e){if(yn(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function wn(t,e,r){let n=Ia(t,r),o=self.URL||self.webkitURL,i=typeof n!="string"&&o.createObjectURL(n);try{return await y1(i||n,e)}finally{i&&o.revokeObjectURL(i)}}async function y1(t,e){let r=new Image;return r.src=t,e.image&&e.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,o)=>{try{r.onload=()=>n(r),r.onerror=i=>{let s=i instanceof Error?i.message:"error";o(new Error(s))}}catch(i){o(i)}})}var w1={},va=!0;async function La(t,e,r){let n;yn(r)?n=await wn(t,e,r):n=ii(t,r);let o=e&&e.imagebitmap;return await O1(n,o)}async function O1(t,e=null){if((b1(e)||!va)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),va=!1}return await createImageBitmap(t)}function b1(t){for(let e in t||w1)return!1;return!0}function Pa(t){return!I1(t,"ftyp",4)||!(t[8]&96)?null:C1(t)}function C1(t){switch(B1(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function B1(t,e,r){return String.fromCharCode(...t.slice(e,r))}function D1(t){return[...t].map(e=>e.charCodeAt(0))}function I1(t,e,r=0){let n=D1(e);for(let o=0;o<n.length;++o)if(n[o]!==t[o+r])return!1;return!0}var Nt=!1,xr=!0;function On(t){let e=Ar(t);return L1(e)||F1(e)||P1(e)||N1(e)||v1(e)}function v1(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=Pa(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function L1(t){let e=Ar(t);return e.byteLength>=24&&e.getUint32(0,Nt)===2303741511?{mimeType:"image/png",width:e.getUint32(16,Nt),height:e.getUint32(20,Nt)}:null}function P1(t){let e=Ar(t);return e.byteLength>=10&&e.getUint32(0,Nt)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,xr),height:e.getUint16(8,xr)}:null}function N1(t){let e=Ar(t);return e.byteLength>=14&&e.getUint16(0,Nt)===16973&&e.getUint32(2,xr)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,xr),height:e.getUint32(22,xr)}:null}function F1(t){let e=Ar(t);if(!(e.byteLength>=3&&e.getUint16(0,Nt)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:o}=U1(),i=2;for(;i+9<e.byteLength;){let s=e.getUint16(i,Nt);if(o.has(s))return{mimeType:"image/jpeg",height:e.getUint16(i+5,Nt),width:e.getUint16(i+7,Nt)};if(!n.has(s))return null;i+=2,i+=e.getUint16(i,Nt)}return null}function U1(){let t=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)t.add(r);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Ar(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function Na(t,e){let{mimeType:r}=On(t)||{},n=globalThis.loaders?.parseImageNode;return $t(n),await n(t,r)}async function Fa(t,e,r){e=e||{};let o=(e.image||{}).type||"auto",{url:i}=r||{},s=G1(o),a;switch(s){case"imagebitmap":a=await La(t,e,i);break;case"image":a=await wn(t,e,i);break;case"data":a=await Na(t,e);break;default:$t(!1)}return o==="data"&&(a=Da(a)),a}function G1(t){switch(t){case"auto":case"data":return Ba();default:return Ca(t),t}}var k1=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],z1=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],K1={image:{type:"auto",decode:!0}},bn={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:ba,mimeTypes:z1,extensions:k1,parse:Fa,tests:[t=>Boolean(On(new DataView(t)))],options:K1};var Ua="4.3.0-alpha.3";var Ga={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:Ua,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function ka(t){switch(t.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function si(t){let e=1/0,r=1/0,n=1/0,o=-1/0,i=-1/0,s=-1/0,a=t.POSITION?t.POSITION.value:[],f=a&&a.length;for(let c=0;c<f;c+=3){let l=a[c],d=a[c+1],_=a[c+2];e=l<e?l:e,r=d<r?d:r,n=_<n?_:n,o=l>o?l:o,i=d>i?d:i,s=_>s?_:s}return[[e,r,n],[o,i,s]]}function ai(t,e,r){let n=ka(e.value),o=r||za(e);return{name:t,type:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:n}]},nullable:!1,metadata:o}}function za(t){let e={};return"byteOffset"in t&&(e.byteOffset=t.byteOffset.toString(10)),"byteStride"in t&&(e.byteStride=t.byteStride.toString(10)),"normalized"in t&&(e.normalized=t.normalized.toString()),e}function Ha(t,e,r){let n=Va(e.metadata),o=[],i=H1(e.attributes);for(let s in t){let a=t[s],f=Ka(s,a,i[s]);o.push(f)}if(r){let s=Ka("indices",r);o.push(s)}return{fields:o,metadata:n}}function H1(t){let e={};for(let r in t){let n=t[r];e[n.name||"undefined"]=n}return e}function Ka(t,e,r){let n=r?Va(r.metadata):void 0;return ai(t,e,n)}function Va(t){Object.entries(t);let e={};for(let r in t)e[`${r}.string`]=JSON.stringify(t[r]);return e}var Xa={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},V1={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},X1=4,gr=class{draco;decoder;metadataQuerier;constructor(e){this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(r);let o=this.decoder.GetEncodedGeometryType(n),i=o===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let s;switch(o){case this.draco.TRIANGULAR_MESH:s=this.decoder.DecodeBufferToMesh(n,i);break;case this.draco.POINT_CLOUD:s=this.decoder.DecodeBufferToPointCloud(n,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!s.ok()||!i.ptr){let _=`DRACO decompression failed: ${s.error_msg()}`;throw new Error(_)}let a=this._getDracoLoaderData(i,o,r),f=this._getMeshData(i,a,r),c=si(f.attributes),l=Ha(f.attributes,a,f.indices);return{loader:"draco",loaderData:a,header:{vertexCount:i.num_points(),boundingBox:c},...f,schema:l}}finally{this.draco.destroy(n),i&&this.draco.destroy(i)}}_getDracoLoaderData(e,r,n){let o=this._getTopLevelMetadata(e),i=this._getDracoAttributes(e,n);return{geometry_type:r,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:o,attributes:i}}_getDracoAttributes(e,r){let n={};for(let o=0;o<e.num_attributes();o++){let i=this.decoder.GetAttribute(e,o),s=this._getAttributeMetadata(e,o);n[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:o,metadata:s};let a=this._getQuantizationTransform(i,r);a&&(n[i.unique_id()].quantization_transform=a);let f=this._getOctahedronTransform(i,r);f&&(n[i.unique_id()].octahedron_transform=f)}return n}_getMeshData(e,r,n){let o=this._getMeshAttributes(r,e,n);if(!o.POSITION)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:o,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:o,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:o}}_getMeshAttributes(e,r,n){let o={};for(let i of Object.values(e.attributes)){let s=this._deduceAttributeName(i,n);i.name=s;let a=this._getAttributeValues(r,i);if(a){let{value:f,size:c}=a;o[s]={value:f,size:c,byteOffset:i.byte_offset,byteStride:i.byte_stride,normalized:i.normalized}}}return o}_getTriangleListIndices(e){let n=e.num_faces()*3,o=n*X1,i=this.draco._malloc(o);try{return this.decoder.GetTrianglesUInt32Array(e,o,i),new Uint32Array(this.draco.HEAPF32.buffer,i,n).slice()}finally{this.draco._free(i)}}_getTriangleStripIndices(e){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,r),Z1(r)}finally{this.draco.destroy(r)}}_getAttributeValues(e,r){let n=V1[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let o=r.num_components,s=e.num_points()*o,a=s*n.BYTES_PER_ELEMENT,f=W1(this.draco,n),c,l=this.draco._malloc(a);try{let d=this.decoder.GetAttribute(e,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,d,f,a,l),c=new n(this.draco.HEAPF32.buffer,l,s).slice()}finally{this.draco._free(l)}return{value:c,size:o}}_deduceAttributeName(e,r){let n=e.unique_id;for(let[s,a]of Object.entries(r.extraAttributes||{}))if(a===n)return s;let o=e.attribute_type;for(let s in Xa)if(this.draco[s]===o)return Xa[s];let i=r.attributeNameEntry||"name";return e.metadata[i]?e.metadata[i].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(e){let r=this.decoder.GetMetadata(e);return this._getDracoMetadata(r)}_getAttributeMetadata(e,r){let n=this.decoder.GetAttributeMetadata(e,r);return this._getDracoMetadata(n)}_getDracoMetadata(e){if(!e||!e.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(e);for(let o=0;o<n;o++){let i=this.metadataQuerier.GetEntryName(e,o);r[i]=this._getDracoMetadataField(e,i)}return r}_getDracoMetadataField(e,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,r,n);let o=q1(n);return{int:this.metadataQuerier.GetIntEntry(e,r),string:this.metadataQuerier.GetStringEntry(e,r),double:this.metadataQuerier.GetDoubleEntry(e,r),intArray:o}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(e){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=e,o=[...r,...n];for(let i of o)this.decoder.SkipAttributeTransform(this.draco[i])}_getQuantizationTransform(e,r){let{quantizedAttributes:n=[]}=r,o=e.attribute_type();if(n.map(s=>this.decoder[s]).includes(o)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(e))return{quantization_bits:s.quantization_bits(),range:s.range(),min_values:new Float32Array([1,2,3]).map(a=>s.min_value(a))}}finally{this.draco.destroy(s)}}return null}_getOctahedronTransform(e,r){let{octahedronAttributes:n=[]}=r,o=e.attribute_type();if(n.map(s=>this.decoder[s]).includes(o)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(e))return{quantization_bits:s.quantization_bits()}}finally{this.draco.destroy(s)}}return null}};function W1(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}function q1(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}function Z1(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}var Q1="1.5.6",Y1="1.4.1",ci=`https://www.gstatic.com/draco/versioned/decoders/${Q1}`,ht={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},fi={[ht.DECODER]:`${ci}/${ht.DECODER}`,[ht.DECODER_WASM]:`${ci}/${ht.DECODER_WASM}`,[ht.FALLBACK_DECODER]:`${ci}/${ht.FALLBACK_DECODER}`,[ht.ENCODER]:`https://raw.githubusercontent.com/google/draco/${Y1}/javascript/${ht.ENCODER}`},li;async function Wa(t){let e=t.modules||{};return e.draco3d?li||=e.draco3d.createDecoderModule({}).then(r=>({draco:r})):li||=j1(t),await li}async function j1(t){let e,r;switch(t.draco&&t.draco.decoderType){case"js":e=await vt(fi[ht.FALLBACK_DECODER],"draco",t,ht.FALLBACK_DECODER);break;case"wasm":default:[e,r]=await Promise.all([await vt(fi[ht.DECODER],"draco",t,ht.DECODER),await vt(fi[ht.DECODER_WASM],"draco",t,ht.DECODER_WASM)])}return e=e||globalThis.DracoDecoderModule,await J1(e,r)}function J1(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t({...r,onModuleLoaded:o=>n({draco:o})})})}var qa={...Ga,parse:$1};async function $1(t,e){let{draco:r}=await Wa(e),n=new gr(r);try{return n.parseSync(t,e?.draco)}finally{n.destroy()}}var Cn="4.3.0-alpha.3";var Bn={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},Za;async function _i(t){sr(t.modules);let e=xo("basis");return e||(Za||=t_(t),await Za)}async function t_(t){let e=null,r=null;return[e,r]=await Promise.all([await vt(Bn.TRANSCODER,"textures",t),await vt(Bn.TRANSCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await e_(e,r)}function e_(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(o=>{let{BasisFile:i,initializeBasis:s}=o;s(),n({BasisFile:i})})})}var hi;async function di(t){let e=t.modules||{};return e.basisEncoder?e.basisEncoder:(hi=hi||r_(t),await hi)}async function r_(t){let e=null,r=null;return[e,r]=await Promise.all([await vt(Bn.ENCODER,"textures",t),await vt(Bn.ENCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await n_(e,r)}function n_(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(o=>{let{BasisFile:i,KTX2File:s,initializeBasis:a,BasisEncoder:f}=o;a(),n({BasisFile:i,KTX2File:s,BasisEncoder:f})})})}var M={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};var o_=["","WEBKIT_","MOZ_"],Qa={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},Dn=null;function Er(t){if(!Dn){t=t||i_()||void 0,Dn=new Set;for(let e of o_)for(let r in Qa)if(t&&t.getExtension(`${e}${r}`)){let n=Qa[r];Dn.add(n)}}return Dn}function i_(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var ui=class{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}},xe=class{constructor(e,r,n,o){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+r,n),this._littleEndian=o,this._offset=0}_nextUint8(){let e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){let e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){let e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){let e=this._dataView.getUint32(this._offset,this._littleEndian),r=this._dataView.getUint32(this._offset+4,this._littleEndian),n=e+2**32*r;return this._offset+=8,n}_nextInt32(){let e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){let r=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,r}_skip(e){return this._offset+=e,this}_scan(e,r=0){let n=this._offset,o=0;for(;this._dataView.getUint8(this._offset)!==r&&o<e;)o++,this._offset++;return o<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,o)}};var wg=new Uint8Array([0]),at=[171,75,84,88,32,50,48,187,13,10,26,10];function Ya(t){return typeof TextDecoder<"u"?new TextDecoder().decode(t):Buffer.from(t).toString("utf8")}function ja(t){let e=new Uint8Array(t.buffer,t.byteOffset,at.length);if(e[0]!==at[0]||e[1]!==at[1]||e[2]!==at[2]||e[3]!==at[3]||e[4]!==at[4]||e[5]!==at[5]||e[6]!==at[6]||e[7]!==at[7]||e[8]!==at[8]||e[9]!==at[9]||e[10]!==at[10]||e[11]!==at[11])throw new Error("Missing KTX 2.0 identifier.");let r=new ui,n=17*Uint32Array.BYTES_PER_ELEMENT,o=new xe(t,at.length,n,!0);r.vkFormat=o._nextUint32(),r.typeSize=o._nextUint32(),r.pixelWidth=o._nextUint32(),r.pixelHeight=o._nextUint32(),r.pixelDepth=o._nextUint32(),r.layerCount=o._nextUint32(),r.faceCount=o._nextUint32();let i=o._nextUint32();r.supercompressionScheme=o._nextUint32();let s=o._nextUint32(),a=o._nextUint32(),f=o._nextUint32(),c=o._nextUint32(),l=o._nextUint64(),d=o._nextUint64(),_=i*3*8,h=new xe(t,at.length+n,_,!0);for(let it=0;it<i;it++)r.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+h._nextUint64(),h._nextUint64()),uncompressedByteLength:h._nextUint64()});let u=new xe(t,s,a,!0),x={vendorId:u._skip(4)._nextUint16(),descriptorType:u._nextUint16(),versionNumber:u._nextUint16(),descriptorBlockSize:u._nextUint16(),colorModel:u._nextUint8(),colorPrimaries:u._nextUint8(),transferFunction:u._nextUint8(),flags:u._nextUint8(),texelBlockDimension:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],bytesPlane:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],samples:[]},p=6,S=4,y=(x.descriptorBlockSize/4-p)/S;for(let it=0;it<y;it++){let bt={bitOffset:u._nextUint16(),bitLength:u._nextUint8(),channelType:u._nextUint8(),samplePosition:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};bt.channelType&64?(bt.sampleLower=u._nextInt32(),bt.sampleUpper=u._nextInt32()):(bt.sampleLower=u._nextUint32(),bt.sampleUpper=u._nextUint32()),x.samples[it]=bt}r.dataFormatDescriptor.length=0,r.dataFormatDescriptor.push(x);let B=new xe(t,f,c,!0);for(;B._offset<c;){let it=B._nextUint32(),bt=B._scan(it),De=Ya(bt);if(r.keyValue[De]=B._nextUint8Array(it-bt.byteLength-1),De.match(/^ktx/i)){let w=Ya(r.keyValue[De]);r.keyValue[De]=w.substring(0,w.lastIndexOf("\0"))}let O=it%4?4-it%4:0;B._skip(O)}if(d<=0)return r;let T=new xe(t,l,d,!0),R=T._nextUint16(),D=T._nextUint16(),I=T._nextUint32(),L=T._nextUint32(),A=T._nextUint32(),m=T._nextUint32(),g=[];for(let it=0;it<i;it++)g.push({imageFlags:T._nextUint32(),rgbSliceByteOffset:T._nextUint32(),rgbSliceByteLength:T._nextUint32(),alphaSliceByteOffset:T._nextUint32(),alphaSliceByteLength:T._nextUint32()});let E=l+T._offset,U=E+I,F=U+L,G=F+A,P=new Uint8Array(t.buffer,t.byteOffset+E,I),J=new Uint8Array(t.buffer,t.byteOffset+U,L),ot=new Uint8Array(t.buffer,t.byteOffset+F,A),X=new Uint8Array(t.buffer,t.byteOffset+G,m);return r.globalData={endpointCount:R,selectorCount:D,imageDescs:g,endpointsData:P,selectorsData:J,tablesData:ot,extendedData:X},r}function We(t,e){let r=new Array(e.mipMapLevels),n=e.width,o=e.height,i=0;for(let s=0;s<e.mipMapLevels;++s){let a=a_(e,n,o,t,s),f=s_(t,s,i,a);r[s]={compressed:!0,format:e.internalFormat,data:f,width:n,height:o,levelSize:a},n=Math.max(1,n>>1),o=Math.max(1,o>>1),i+=a}return r}function s_(t,e,r,n){return Array.isArray(t)?t[e].levelData:new Uint8Array(t.buffer,t.byteOffset+r,n)}function a_(t,e,r,n,o){return Array.isArray(n)?t.sizeFunction(n[o]):t.sizeFunction(e,r)}var c_={131:M.COMPRESSED_RGB_S3TC_DXT1_EXT,132:M.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:M.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:M.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:M.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:M.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:M.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:M.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:M.COMPRESSED_RED_RGTC1_EXT,140:M.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:M.COMPRESSED_RED_GREEN_RGTC2_EXT,142:M.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:M.COMPRESSED_RGB8_ETC2,148:M.COMPRESSED_SRGB8_ETC2,149:M.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:M.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:M.COMPRESSED_RGBA8_ETC2_EAC,152:M.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:M.COMPRESSED_R11_EAC,154:M.COMPRESSED_SIGNED_R11_EAC,155:M.COMPRESSED_RG11_EAC,156:M.COMPRESSED_SIGNED_RG11_EAC,157:M.COMPRESSED_RGBA_ASTC_4x4_KHR,158:M.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:M.COMPRESSED_RGBA_ASTC_5x4_KHR,160:M.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:M.COMPRESSED_RGBA_ASTC_5x5_KHR,162:M.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:M.COMPRESSED_RGBA_ASTC_6x5_KHR,164:M.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:M.COMPRESSED_RGBA_ASTC_6x6_KHR,166:M.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:M.COMPRESSED_RGBA_ASTC_8x5_KHR,168:M.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:M.COMPRESSED_RGBA_ASTC_8x6_KHR,170:M.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:M.COMPRESSED_RGBA_ASTC_8x8_KHR,172:M.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:M.COMPRESSED_RGBA_ASTC_10x5_KHR,174:M.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:M.COMPRESSED_RGBA_ASTC_10x6_KHR,176:M.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:M.COMPRESSED_RGBA_ASTC_10x8_KHR,178:M.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:M.COMPRESSED_RGBA_ASTC_10x10_KHR,180:M.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:M.COMPRESSED_RGBA_ASTC_12x10_KHR,182:M.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:M.COMPRESSED_RGBA_ASTC_12x12_KHR,184:M.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:M.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:M.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:M.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:M.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:M.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:M.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:M.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:M.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:M.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:M.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:M.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:M.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:M.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:M.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:M.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:M.COMPRESSED_RGBA_ASTC_12x12_KHR};function Ja(t){return c_[t]}var pt=[171,75,84,88,32,50,48,187,13,10,26,10];function In(t){let e=new Uint8Array(t);return!(e.byteLength<pt.length||e[0]!==pt[0]||e[1]!==pt[1]||e[2]!==pt[2]||e[3]!==pt[3]||e[4]!==pt[4]||e[5]!==pt[5]||e[6]!==pt[6]||e[7]!==pt[7]||e[8]!==pt[8]||e[9]!==pt[9]||e[10]!==pt[10]||e[11]!==pt[11])}function $a(t){let e=new Uint8Array(t),r=ja(e),n=Math.max(1,r.levels.length),o=r.pixelWidth,i=r.pixelHeight,s=Ja(r.vkFormat);return We(r.levels,{mipMapLevels:n,width:o,height:i,sizeFunction:a=>a.uncompressedByteLength,internalFormat:s})}var f_={etc1:{basisFormat:0,compressed:!0,format:M.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:M.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:M.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:M.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:M.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:M.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function Sr(t,e){if(e.basis.containerFormat==="auto"){if(In(t)){let n=await di(e);return tc(n.KTX2File,t,e)}let{BasisFile:r}=await _i(e);return pi(r,t,e)}switch(e.basis.module){case"encoder":let r=await di(e);switch(e.basis.containerFormat){case"ktx2":return tc(r.KTX2File,t,e);case"basis":default:return pi(r.BasisFile,t,e)}case"transcoder":default:let{BasisFile:n}=await _i(e);return pi(n,t,e)}}function pi(t,e,r){let n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let o=n.getNumImages(),i=[];for(let s=0;s<o;s++){let a=n.getNumLevels(s),f=[];for(let c=0;c<a;c++)f.push(l_(n,s,c,r));i.push(f)}return i}finally{n.close(),n.delete()}}function l_(t,e,r,n){let o=t.getImageWidth(e,r),i=t.getImageHeight(e,r),s=t.getHasAlpha(),{compressed:a,format:f,basisFormat:c}=ec(n,s),l=t.getImageTranscodedSizeInBytes(e,r,c),d=new Uint8Array(l);if(!t.transcodeImage(d,e,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:o,height:i,data:d,compressed:a,format:f,hasAlpha:s}}function tc(t,e,r){let n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let o=n.getLevels(),i=[];for(let s=0;s<o;s++)i.push(h_(n,s,r));return[i]}finally{n.close(),n.delete()}}function h_(t,e,r){let{alphaFlag:n,height:o,width:i}=t.getImageLevelInfo(e,0,0),{compressed:s,format:a,basisFormat:f}=ec(r,n),c=t.getImageTranscodedSizeInBytes(e,0,0,f),l=new Uint8Array(c);if(!t.transcodeImage(l,e,0,0,f,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:i,height:o,data:l,compressed:s,levelSize:c,hasAlpha:n,format:a}}function ec(t,e){let r=t&&t.basis&&t.basis.format;return r==="auto"&&(r=vn()),typeof r=="object"&&(r=e?r.alpha:r.noAlpha),r=r.toLowerCase(),f_[r]}function vn(){let t=Er();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}var rc={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:Cn,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},Rr={...rc,parse:Sr};var mt={MAGIC_NUMBER:542327876,HEADER_LENGTH:31,MAGIC_NUMBER_INDEX:0,HEADER_SIZE_INDEX:1,HEADER_FLAGS_INDEX:2,HEADER_HEIGHT_INDEX:3,HEADER_WIDTH_INDEX:4,MIPMAPCOUNT_INDEX:7,HEADER_PF_FLAGS_INDEX:20,HEADER_PF_FOURCC_INDEX:21,DDSD_MIPMAPCOUNT:131072,DDPF_FOURCC:4},__={DXT1:M.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:M.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:M.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":M.COMPRESSED_RGB_ATC_WEBGL,ATCA:M.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:M.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},d_=ic,u_=Ln,p_=Ln,m_={DXT1:ic,DXT3:Ln,DXT5:Ln,"ATC ":d_,ATCA:u_,ATCI:p_};function nc(t){return new Uint32Array(t,0,mt.HEADER_LENGTH)[mt.MAGIC_NUMBER_INDEX]===mt.MAGIC_NUMBER}function oc(t){let e=new Int32Array(t,0,mt.HEADER_LENGTH),r=e[mt.HEADER_PF_FOURCC_INDEX];$t(Boolean(e[mt.HEADER_PF_FLAGS_INDEX]&mt.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=x_(r),o=__[n],i=m_[n];$t(o&&i,`DDS: Unknown pixel format ${r}`);let s=1;e[mt.HEADER_FLAGS_INDEX]&mt.DDSD_MIPMAPCOUNT&&(s=Math.max(1,e[mt.MIPMAPCOUNT_INDEX]));let a=e[mt.HEADER_WIDTH_INDEX],f=e[mt.HEADER_HEIGHT_INDEX],c=e[mt.HEADER_SIZE_INDEX]+4,l=new Uint8Array(t,c);return We(l,{mipMapLevels:s,width:a,height:f,sizeFunction:i,internalFormat:o})}function ic(t,e){return(t+3>>2)*(e+3>>2)*8}function Ln(t,e){return(t+3>>2)*(e+3>>2)*16}function x_(t){return String.fromCharCode(t&255,t>>8&255,t>>16&255,t>>24&255)}var Et={MAGIC_NUMBER:55727696,MAGIC_NUMBER_EXTRA:1347834371,HEADER_LENGTH:13,HEADER_SIZE:52,MAGIC_NUMBER_INDEX:0,PIXEL_FORMAT_INDEX:2,COLOUR_SPACE_INDEX:4,HEIGHT_INDEX:6,WIDTH_INDEX:7,MIPMAPCOUNT_INDEX:11,METADATA_SIZE_INDEX:12},A_={0:[M.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[M.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[M.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[M.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[M.COMPRESSED_RGB_ETC1_WEBGL],7:[M.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[M.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[M.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[M.COMPRESSED_RGB8_ETC2],23:[M.COMPRESSED_RGBA8_ETC2_EAC],24:[M.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[M.COMPRESSED_R11_EAC],26:[M.COMPRESSED_RG11_EAC],27:[M.COMPRESSED_RGBA_ASTC_4X4_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[M.COMPRESSED_RGBA_ASTC_5X4_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[M.COMPRESSED_RGBA_ASTC_5X5_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[M.COMPRESSED_RGBA_ASTC_6X5_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[M.COMPRESSED_RGBA_ASTC_6X6_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[M.COMPRESSED_RGBA_ASTC_8X5_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[M.COMPRESSED_RGBA_ASTC_8X6_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[M.COMPRESSED_RGBA_ASTC_8X8_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[M.COMPRESSED_RGBA_ASTC_10X5_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[M.COMPRESSED_RGBA_ASTC_10X6_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[M.COMPRESSED_RGBA_ASTC_10X8_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[M.COMPRESSED_RGBA_ASTC_10X10_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[M.COMPRESSED_RGBA_ASTC_12X10_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[M.COMPRESSED_RGBA_ASTC_12X12_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},g_={0:sc,1:sc,2:ac,3:ac,6:Tr,7:Tr,9:Mr,11:Mr,22:Tr,23:Mr,24:Tr,25:Tr,26:Mr,27:Mr,28:E_,29:S_,30:R_,31:T_,32:M_,33:y_,34:w_,35:O_,36:b_,37:C_,38:B_,39:D_,40:I_};function cc(t){let r=new Uint32Array(t,0,Et.HEADER_LENGTH)[Et.MAGIC_NUMBER_INDEX];return r===Et.MAGIC_NUMBER||r===Et.MAGIC_NUMBER_EXTRA}function fc(t){let e=new Uint32Array(t,0,Et.HEADER_LENGTH),r=e[Et.PIXEL_FORMAT_INDEX],n=e[Et.COLOUR_SPACE_INDEX],o=A_[r]||[],i=o.length>1&&n?o[1]:o[0],s=g_[r],a=e[Et.MIPMAPCOUNT_INDEX],f=e[Et.WIDTH_INDEX],c=e[Et.HEIGHT_INDEX],l=Et.HEADER_SIZE+e[Et.METADATA_SIZE_INDEX],d=new Uint8Array(t,l);return We(d,{mipMapLevels:a,width:f,height:c,sizeFunction:s,internalFormat:i})}function sc(t,e){return t=Math.max(t,16),e=Math.max(e,8),t*e/4}function ac(t,e){return t=Math.max(t,8),e=Math.max(e,8),t*e/2}function Tr(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8}function Mr(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16}function E_(t,e){return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16}function S_(t,e){return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16}function R_(t,e){return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16}function T_(t,e){return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16}function M_(t,e){return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16}function y_(t,e){return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16}function w_(t,e){return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16}function O_(t,e){return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16}function b_(t,e){return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16}function C_(t,e){return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16}function B_(t,e){return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16}function D_(t,e){return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16}function I_(t,e){return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16}function lc(t){if(In(t))return $a(t);if(nc(t))return oc(t);if(cc(t))return fc(t);throw new Error("Texture container format not recognized")}var hc={dataType:null,batchType:null,name:"Texture Containers",id:"compressed-texture",module:"textures",version:Cn,worker:!0,extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0,options:{"compressed-texture":{libraryPath:"libs/",useBasis:!1}}},Pn={...hc,parse:async(t,e)=>e?.["compressed-texture"]?.useBasis?(e.basis={format:{alpha:"BC3",noAlpha:"BC1"},...e.basis,containerFormat:"ktx2",module:"encoder"},(await Sr(t,e))[0]):lc(t)};var yr;(function(t){t.vertexCount="vertexCount",t.featureCount="featureCount"})(yr||(yr={}));function Nn(t){let e;try{let r=new URL(t);e=`${r.origin}${r.pathname}`,e.startsWith("null")&&(e=null)}catch{e=null}return e||t}function Ft(t,e=null){return e?`${t}?token=${e}`:t}function _c(t,e){let{attributeData:r=[]}=e,n=[];for(let o=0;o<r.length;o++){let i=r[o].href.replace("./","");n.push(`${t}/${i}`)}return n}function dc(t,e,r){let n=[],{attributeStorageInfo:o=[]}=t;for(let i=0;i<o.length;i++){let s=o[i].key;n.push(`${e}/nodes/${r}/attributes/${s}/0`)}return n}var Fn=new v([0,0,0]);function v_(t){switch(t){case"ktx-etc2":case"dds":return Pn;case"ktx2":return Rr;case"jpg":case"png":default:return bn}}var L_="i3s-attribute-type";async function xc(t,e,r,n,o){let i={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new ut,coordinateSystem:0,byteLength:0,texture:null};if(e.textureUrl){let s=Ft(e.textureUrl,n?.i3s?.token),a=v_(e.textureFormat),l=await(await(o?.fetch||fetch)(s)).arrayBuffer();if(n?.i3s.decodeTextures){if(a===bn){let d={...e.textureLoaderOptions,image:{type:"data"}};try{let _=await uo(l,[],d,o);i.texture=_}catch{let h=await(0,wr.parse)(l,a,d,o);i.texture=h}}else if(a===Pn||a===Rr){let d=await(0,wr.load)(l,a,e.textureLoaderOptions);a===Rr&&(d=d[0]),i.texture={compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}}else i.texture=l}return i.material=H_(e.materialDefinition,i.texture),i.material&&(i.texture=null),await P_(t,i,e,r,n)}async function P_(t,e,r,n,o){let i=t.byteLength,s,a,f=0,c=0,l;if(r.isDracoGeometry){let d=await(0,wr.parse)(t,qa,{draco:{attributeNameEntry:L_}});a=d.header.vertexCount,l=d.indices?.value;let{POSITION:_,NORMAL:h,COLOR_0:u,TEXCOORD_0:x,["feature-index"]:p,["uv-region"]:S}=d.attributes;s={position:_,normal:h,color:u,uv0:x,uvRegion:S,id:p},N_(s,d);let y=q_(p);y&&W_(s,y)}else{let{vertexAttributes:d,ordering:_,featureAttributes:h,featureAttributeOrder:u}=n.store.defaultGeometrySchema,x=U_(t,n);f=x.byteOffset,a=x.vertexCount,c=x.featureCount;let{attributes:p,byteOffset:S}=pc(t,f,d,a,_),{attributes:y}=pc(t,S,h,c,u);X_(y),s=F_(p,y)}if(!o?.i3s?.coordinateSystem||o.i3s.coordinateSystem===Pt.METER_OFFSETS){let d=k_(s.position,r);e.modelMatrix=d.invert(),e.coordinateSystem=Pt.METER_OFFSETS}else e.modelMatrix=K_(s.position),e.coordinateSystem=Pt.LNGLAT_OFFSETS;e.attributes={positions:s.position,normals:s.normal,colors:uc(s.color),texCoords:s.uv0,uvRegions:uc(s.uvRegion||s.region)},e.indices=l||null,s.id&&s.id.value&&(e.featureIds=s.id.value);for(let d in e.attributes)e.attributes[d]||delete e.attributes[d];return e.vertexCount=a,e.byteLength=i,e}function N_(t,e){for(let r in e.loaderData.attributes){let n=e.loaderData.attributes[r];switch(n.name){case"POSITION":t.position.metadata=n.metadata;break;case"feature-index":t.id.metadata=n.metadata;break;default:break}}}function F_(t,e){return{...t,...e}}function uc(t){return t&&(t.normalized=!0,t)}function U_(t,e){let r=0,n=0,o=0;for(let{property:i,type:s}of e.store.defaultGeometrySchema.header){let a=$o(s);switch(i){case yr.vertexCount.toString():n=new a(t,0,4)[0],r+=Ve(s);break;case yr.featureCount.toString():o=new a(t,4,4)[0],r+=Ve(s);break;default:break}}return{vertexCount:n,featureCount:o,byteOffset:r}}function pc(t,e,r,n,o){let i={};for(let s of o)if(r[s]){let{valueType:a,valuesPerElement:f}=r[s];if(e+n*f*Ve(a)<=t.byteLength){let c=t.slice(e),l;if(a==="UInt64")l=G_(c,n*f,Ve(a));else{let d=$o(a);l=new d(c,0,n*f)}switch(i[s]={value:l,type:xa[a],size:f},s){case"color":i.color.normalized=!0;break;case"position":case"region":case"normal":default:}e=e+n*f*Ve(a)}else if(s!=="uv0")break}return{attributes:i,byteOffset:e}}function G_(t,e,r){let n=[],o=new DataView(t),i=0;for(let s=0;s<e;s++){let a=o.getUint32(i,!0),f=o.getUint32(i+4,!0),c=a+2**32*f;n.push(c),i+=r}return new Uint32Array(n)}function k_(t,e){let r=e.mbs,n=t.value,o=t.metadata,i=new ut,s=new v(r[0],r[1],r[2]),a=new v;return gt.WGS84.cartographicToCartesian(s,a),gt.WGS84.eastNorthUpToFixedFrame(a,i),t.value=z_(n,o,s),i}function z_(t,e={},r){let n=new Float64Array(t.length),o=e["i3s-scale_x"]&&e["i3s-scale_x"].double||1,i=e["i3s-scale_y"]&&e["i3s-scale_y"].double||1;for(let s=0;s<n.length;s+=3)n[s]=t[s]*o+r.x,n[s+1]=t[s+1]*i+r.y,n[s+2]=t[s+2]+r.z;for(let s=0;s<n.length;s+=3)gt.WGS84.cartographicToCartesian(n.subarray(s,s+3),Fn),n[s]=Fn.x,n[s+1]=Fn.y,n[s+2]=Fn.z;return n}function K_(t){let e=t.metadata,r=e?.["i3s-scale_x"]?.double||1,n=e?.["i3s-scale_y"]?.double||1,o=new ut;return o[0]=r,o[5]=n,o}function H_(t,e){let r;return t?r={...t,pbrMetallicRoughness:t.pbrMetallicRoughness?{...t.pbrMetallicRoughness}:{baseColorFactor:[255,255,255,255]}}:(r={pbrMetallicRoughness:{}},e?r.pbrMetallicRoughness.baseColorTexture={texCoord:0}:r.pbrMetallicRoughness.baseColorFactor=[255,255,255,255]),r.alphaCutoff=r.alphaCutoff||.25,r.alphaMode&&(r.alphaMode=r.alphaMode.toUpperCase()),r.emissiveFactor&&(r.emissiveFactor=mc(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=mc(r.pbrMetallicRoughness.baseColorFactor)),e&&V_(r,e),r}function mc(t){let e=[...t];for(let r=0;r<t.length;r++)e[r]=t[r]/255;return e}function V_(t,e){let r={source:{image:e}};t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture?t.pbrMetallicRoughness.baseColorTexture={...t.pbrMetallicRoughness.baseColorTexture,texture:r}:t.emissiveTexture?t.emissiveTexture={...t.emissiveTexture,texture:r}:t.pbrMetallicRoughness&&t.pbrMetallicRoughness.metallicRoughnessTexture?t.pbrMetallicRoughness.metallicRoughnessTexture={...t.pbrMetallicRoughness.metallicRoughnessTexture,texture:r}:t.normalTexture?t.normalTexture={...t.normalTexture,texture:r}:t.occlusionTexture&&(t.occlusionTexture={...t.occlusionTexture,texture:r})}function X_(t){let{id:e,faceRange:r}=t;if(!e||!r)return;let n=e.value,o=r.value,i=o[o.length-1]+1,s=new Uint32Array(i*3),a=0,f=0;for(let c=1;c<o.length;c+=2){let l=Number(n[a]),d=o[c],_=o[c-1],h=d-_+1,u=f+h*3;s.fill(l,f,u),a++,f=u}t.id.value=s}function W_(t,e){let r=t.id.value,n=new Float32Array(r.length);for(let o=0;o<r.length;o++)n[o]=e[r[o]];t.id.value=n}function q_(t){return t?.metadata?.["i3s-feature-ids"]?.intArray}var Z_="4.3.0-alpha.3",Un={dataType:null,batchType:null,name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:Z_,mimeTypes:["application/octet-stream"],parse:Q_,extensions:["bin"],options:{"i3s-content":{}}};async function Q_(t,e,r){let{tile:n,_tileOptions:o,tileset:i,_tilesetOptions:s}=e?.i3s||{},a=o||n,f=s||i;return!a||!f?null:await xc(t,a,f,e,r)}var rt={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var OE=new v,bE=new v;var Or=new v,Ac=new v,ie=class{constructor(e=[0,0,0],r=0){V(this,"center",void 0),V(this,"radius",void 0),this.radius=-0,this.center=new v,this.fromCenterRadius(e,r)}fromCenterRadius(e,r){return this.center.from(e),this.radius=r,this}fromCornerPoints(e,r){return r=Or.from(r),this.center=new v().from(e).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new ie(this.center,this.radius)}union(e){let r=this.center,n=this.radius,o=e.center,i=e.radius,s=Or.copy(o).subtract(r),a=s.magnitude();if(n>=a+i)return this.clone();if(i>=a+n)return e.clone();let f=(n+a+i)*.5;return Ac.copy(s).scale((-n+f)/a).add(r),this.center.copy(Ac),this.radius=f,this}expand(e){let n=Or.from(e).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(e){this.center.transform(e);let r=gn.getScaling(Or,e);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(e){let r=this.distanceTo(e);return r*r}distanceTo(e){let n=Or.from(e).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(e){let r=this.center,n=this.radius,i=e.normal.dot(r)+e.distance;return i<-n?rt.OUTSIDE:i<n?rt.INTERSECTING:rt.INSIDE}};var Y_=new v,j_=new v,Gn=new v,kn=new v,zn=new v,J_=new v,$_=new v,Wt={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},se=class{constructor(e=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){V(this,"center",void 0),V(this,"halfAxes",void 0),this.center=new v().from(e),this.halfAxes=new j(r)}get halfSize(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new v(e).len(),new v(r).len(),new v(n).len()]}get quaternion(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),o=new v(e).normalize(),i=new v(r).normalize(),s=new v(n).normalize();return new He().fromMatrix3(new j([...o,...i,...s]))}fromCenterHalfSizeQuaternion(e,r,n){let o=new He(n),i=new j().fromQuaternion(o);return i[0]=i[0]*r[0],i[1]=i[1]*r[0],i[2]=i[2]*r[0],i[3]=i[3]*r[1],i[4]=i[4]*r[1],i[5]=i[5]*r[1],i[6]=i[6]*r[2],i[7]=i[7]*r[2],i[8]=i[8]*r[2],this.center=new v().from(e),this.halfAxes=i,this}clone(){return new se(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new ie){let r=this.halfAxes,n=r.getColumn(0,Gn),o=r.getColumn(1,kn),i=r.getColumn(2,zn),s=Y_.copy(n).add(o).add(i);return e.center.copy(this.center),e.radius=s.magnitude(),e}intersectPlane(e){let r=this.center,n=e.normal,o=this.halfAxes,i=n.x,s=n.y,a=n.z,f=Math.abs(i*o[Wt.COLUMN0ROW0]+s*o[Wt.COLUMN0ROW1]+a*o[Wt.COLUMN0ROW2])+Math.abs(i*o[Wt.COLUMN1ROW0]+s*o[Wt.COLUMN1ROW1]+a*o[Wt.COLUMN1ROW2])+Math.abs(i*o[Wt.COLUMN2ROW0]+s*o[Wt.COLUMN2ROW1]+a*o[Wt.COLUMN2ROW2]),c=n.dot(r)+e.distance;return c<=-f?rt.OUTSIDE:c>=f?rt.INSIDE:rt.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let r=j_.from(e).subtract(this.center),n=this.halfAxes,o=n.getColumn(0,Gn),i=n.getColumn(1,kn),s=n.getColumn(2,zn),a=o.magnitude(),f=i.magnitude(),c=s.magnitude();o.normalize(),i.normalize(),s.normalize();let l=0,d;return d=Math.abs(r.dot(o))-a,d>0&&(l+=d*d),d=Math.abs(r.dot(i))-f,d>0&&(l+=d*d),d=Math.abs(r.dot(s))-c,d>0&&(l+=d*d),l}computePlaneDistances(e,r,n=[-0,-0]){let o=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=this.center,a=this.halfAxes,f=a.getColumn(0,Gn),c=a.getColumn(1,kn),l=a.getColumn(2,zn),d=J_.copy(f).add(c).add(l).add(s),_=$_.copy(d).subtract(e),h=r.dot(_);return o=Math.min(h,o),i=Math.max(h,i),d.copy(s).add(f).add(c).subtract(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),i=Math.max(h,i),d.copy(s).add(f).subtract(c).add(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),i=Math.max(h,i),d.copy(s).add(f).subtract(c).subtract(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),i=Math.max(h,i),s.copy(d).subtract(f).add(c).add(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),i=Math.max(h,i),s.copy(d).subtract(f).add(c).subtract(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),i=Math.max(h,i),s.copy(d).subtract(f).subtract(c).add(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),i=Math.max(h,i),s.copy(d).subtract(f).subtract(c).subtract(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),i=Math.max(h,i),n[0]=o,n[1]=i,n}transform(e){this.center.transformAsPoint(e);let r=this.halfAxes.getColumn(0,Gn);r.transformAsPoint(e);let n=this.halfAxes.getColumn(1,kn);n.transformAsPoint(e);let o=this.halfAxes.getColumn(2,zn);return o.transformAsPoint(e),this.halfAxes=new j([...r,...n,...o]),this}getTransform(){throw new Error("not implemented")}};var gc=new v,Ec=new v,qt=class{constructor(e=[0,0,1],r=0){V(this,"normal",void 0),V(this,"distance",void 0),this.normal=new v,this.distance=-0,this.fromNormalDistance(e,r)}fromNormalDistance(e,r){return et(Number.isFinite(r)),this.normal.from(e).normalize(),this.distance=r,this}fromPointNormal(e,r){e=gc.from(e),this.normal.from(r).normalize();let n=-this.normal.dot(e);return this.distance=n,this}fromCoefficients(e,r,n,o){return this.normal.set(e,r,n),et(dt(this.normal.len(),1)),this.distance=o,this}clone(){return new qt(this.normal,this.distance)}equals(e){return dt(this.distance,e.distance)&&dt(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){let r=Ec.copy(this.normal).transformAsVector(e).normalize(),n=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(n,r)}projectPointOntoPlane(e,r=[0,0,0]){let n=gc.from(e),o=this.getPointDistance(n),i=Ec.copy(this.normal).scale(o);return n.subtract(i).to(r)}};var Sc=[new v([1,0,0]),new v([0,1,0]),new v([0,0,1])],Rc=new v,td=new v,St=class{constructor(e=[]){V(this,"planes",void 0),this.planes=e}fromBoundingSphere(e){this.planes.length=2*Sc.length;let r=e.center,n=e.radius,o=0;for(let i of Sc){let s=this.planes[o],a=this.planes[o+1];s||(s=this.planes[o]=new qt),a||(a=this.planes[o+1]=new qt);let f=Rc.copy(i).scale(-n).add(r);s.fromPointNormal(f,i);let c=Rc.copy(i).scale(n).add(r),l=td.copy(i).negate();a.fromPointNormal(c,l),o+=2}return this}computeVisibility(e){let r=rt.INSIDE;for(let n of this.planes)switch(e.intersectPlane(n)){case rt.OUTSIDE:return rt.OUTSIDE;case rt.INTERSECTING:r=rt.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(e,r){if(et(Number.isFinite(r),"parentPlaneMask is required."),r===St.MASK_OUTSIDE||r===St.MASK_INSIDE)return r;let n=St.MASK_INSIDE,o=this.planes;for(let i=0;i<this.planes.length;++i){let s=i<31?1<<i:0;if(i<31&&!(r&s))continue;let a=o[i],f=e.intersectPlane(a);if(f===rt.OUTSIDE)return St.MASK_OUTSIDE;f===rt.INTERSECTING&&(n|=s)}return n}};V(St,"MASK_OUTSIDE",4294967295);V(St,"MASK_INSIDE",0);V(St,"MASK_INDETERMINATE",2147483647);var jE=new v,JE=new v,$E=new v,tS=new v,eS=new v;var cS=new v,fS=new v,lS=new v,hS=new v,_S=new v,dS=new v,uS=new v,pS=new v,mS=new v,xS=new v,AS=new v,gS=new v;var RS=new j,TS=new j,MS=new j,yS=new j,wS=new j;var IS=new v,vS=new v,LS=new v,PS=new v,NS=new v,FS=new j,US={diagonal:new j,unitary:new j};var Mc=Bt(Vt(),1);var br;(function(t){t[t.ADD=1]="ADD",t[t.REPLACE=2]="REPLACE"})(br||(br={}));var Cr;(function(t){t.EMPTY="empty",t.SCENEGRAPH="scenegraph",t.POINTCLOUD="pointcloud",t.MESH="mesh"})(Cr||(Cr={}));var Br;(function(t){t.I3S="I3S",t.TILES3D="TILES3D"})(Br||(Br={}));var mi;(function(t){t.GEOMETRIC_ERROR="geometricError",t.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(mi||(mi={}));var Tc=Bt(Vt(),1);var od="4.3.0-alpha.3",Kn={dataType:null,batchType:null,name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:od,mimeTypes:["application/json"],parse:id,extensions:["json"],options:{i3s:{}}};async function id(t,e){return JSON.parse(new TextDecoder().decode(t))}var Dr=class{tileset;nodePages=[];pendingNodePages=[];nodesPerPage;options;lodSelectionMetricType;textureDefinitionsSelectedFormats=[];nodesInNodePages;url;textureLoaderOptions={};constructor(e,r="",n){this.tileset={...e},this.url=r,this.nodesPerPage=e.nodePages?.nodesPerPage||64,this.lodSelectionMetricType=e.nodePages?.lodSelectionMetricType,this.options=n,this.nodesInNodePages=0,this.initSelectedFormatsForTextureDefinitions(e)}async getNodeById(e){let r=Math.floor(e/this.nodesPerPage);if(!this.nodePages[r]&&!this.pendingNodePages[r]){let o=Ft(`${this.url}/nodepages/${r}`,this.options.i3s?.token);this.pendingNodePages[r]={status:"Pending",promise:(0,Tc.load)(o,Kn,this.options)},this.nodePages[r]=await this.pendingNodePages[r].promise,this.nodesInNodePages+=this.nodePages[r].nodes.length,this.pendingNodePages[r].status="Done"}this.pendingNodePages[r].status==="Pending"&&(this.nodePages[r]=await this.pendingNodePages[r].promise);let n=e%this.nodesPerPage;return this.nodePages[r].nodes[n]}async formTileFromNodePages(e){let r=await this.getNodeById(e),n=[],o=[];for(let h of r.children||[])o.push(this.getNodeById(h));let i=await Promise.all(o);for(let h of i)n.push({id:h.index.toString(),obb:h.obb});let s,a,f,c="jpg",l=[],d=!1;if(r&&r.mesh){let{url:h,isDracoGeometry:u}=r.mesh.geometry&&this.getContentUrl(r.mesh.geometry)||{isDracoGeometry:!1};s=h,d=u;let{textureData:x,materialDefinition:p}=this.getInformationFromMaterial(r.mesh.material);f=p,c=x.format||c,x.name&&(a=`${this.url}/nodes/${r.mesh.material.resource}/textures/${x.name}`),this.tileset.attributeStorageInfo&&(l=dc(this.tileset,this.url,r.mesh.attribute.resource))}let _=this.getLodSelection(r);return xi({id:e.toString(),lodSelection:_,obb:r.obb,contentUrl:s,textureUrl:a,attributeUrls:l,materialDefinition:f,textureFormat:c,textureLoaderOptions:this.textureLoaderOptions,children:n,isDracoGeometry:d})}getContentUrl(e){let r=null,n=this.tileset.geometryDefinitions[e.definition],o=-1;if(this.options.i3s&&this.options.i3s.useDracoGeometry&&(o=n.geometryBuffers.findIndex(i=>i.compressedAttributes&&i.compressedAttributes.encoding==="draco")),o===-1&&(o=n.geometryBuffers.findIndex(i=>!i.compressedAttributes)),o!==-1){let i=Boolean(n.geometryBuffers[o].compressedAttributes);r={url:`${this.url}/nodes/${e.resource}/geometries/${o}`,isDracoGeometry:i}}return r}getLodSelection(e){let r=[];return this.lodSelectionMetricType==="maxScreenThresholdSQ"&&r.push({metricType:"maxScreenThreshold",maxError:Math.sqrt(e.lodThreshold/(Math.PI*.25))}),r.push({metricType:this.lodSelectionMetricType,maxError:e.lodThreshold}),r}getInformationFromMaterial(e){let r={textureData:{name:null}};if(e){let n=this.tileset.materialDefinitions?.[e.definition];if(n){r.materialDefinition=n;let o=n?.pbrMetallicRoughness?.baseColorTexture?.textureSetDefinitionId;typeof o=="number"&&(r.textureData=this.textureDefinitionsSelectedFormats[o]||r.textureData)}}return r}initSelectedFormatsForTextureDefinitions(e){this.textureDefinitionsSelectedFormats=[];let r=this.getSupportedTextureFormats(),n=e.textureSetDefinitions||[];for(let o of n){let i=o&&o.formats||[],s=null;for(let a of r){let f=i.find(c=>c.format===a);if(f){s=f;break}}s&&s.format==="ktx2"&&(this.textureLoaderOptions.basis={format:vn(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(s)}}getSupportedTextureFormats(){let e=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=Er();r.has("etc2")&&e.push("ktx-etc2"),r.has("dxt")&&e.push("dds"),e.push("ktx2")}return e.push("jpg"),e.push("png"),e}};function yc(t,e){let r=e.url||"",n;t.geometryData&&(n=`${r}/${t.geometryData[0].href}`);let o;t.textureData&&(o=`${r}/${t.textureData[0].href}`);let i;t.attributeData&&(i=_c(r,t));let s=t.children||[];return xi({...t,children:s,url:r,contentUrl:n,textureUrl:o,textureFormat:"jpg",attributeUrls:i,isDracoGeometry:!1})}function xi(t){let e={},r=[0,0,0,1];if(t.mbs)r=t.mbs,e.sphere=[...gt.WGS84.cartographicToCartesian(t.mbs.slice(0,3)),t.mbs[3]];else if(t.obb){e.box=[...gt.WGS84.cartographicToCartesian(t.obb.center),...t.obb.halfSize,...t.obb.quaternion];let f=new se().fromCenterHalfSizeQuaternion(e.box.slice(0,3),t.obb.halfSize,t.obb.quaternion).getBoundingSphere();e.sphere=[...f.center,f.radius],r=[...t.obb.center,f.radius]}let n=t.lodSelection?.[0].metricType,o=t.lodSelection?.[0].maxError,i=Cr.MESH,s=br.REPLACE;return{...t,mbs:r,boundingVolume:e,lodMetricType:n,lodMetricValue:o,type:i,refine:s}}async function wc(t,e,r){let n=Nn(r.url||""),o,i;if(t.nodePages)o=new Dr(t,n,e),i=await o.formTileFromNodePages(0);else{let s=e.i3s,a=Ft(`${n}/nodes/root`,s.token);i=await(0,Mc.load)(a,Ir,{...e,i3s:{...e.i3s,loadContent:!1,isTileHeader:!0,isTileset:!1}})}return{...t,loader:Ir,url:n,basePath:n,type:Br.I3S,nodePagesTile:o,root:i,lodMetricType:i.lodMetricType,lodMetricValue:i.lodMetricValue}}var sd="4.3.0-alpha.3",ad=/layers\/[0-9]+$/,cd=/\.slpk$/,fd=/nodes\/([0-9-]+|root)$/,ld="504b0304",hd="PointCloud",Ir={dataType:null,batchType:null,name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:sd,mimeTypes:["application/octet-stream"],parse:_d,extensions:["bin"],options:{i3s:{token:null,isTileset:"auto",isTileHeader:"auto",tile:null,tileset:null,_tileOptions:null,_tilesetOptions:null,useDracoGeometry:!0,useCompressedTextures:!0,decodeTextures:!0,coordinateSystem:Pt.METER_OFFSETS}}};async function _d(t,e={},r){let n=r.url;if(e.i3s=e.i3s||{},md(t)===ld)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let i=Nn(n),s;e.i3s.isTileset==="auto"?s=ad.test(i)||cd.test(i):s=e.i3s.isTileset;let a;return e.isTileHeader==="auto"?a=fd.test(i):a=e.i3s.isTileHeader,s?t=await ud(t,e,r):a?t=await pd(t,r):t=await dd(t,e),t}async function dd(t,e){return await(0,Oc.parse)(t,Un,e)}async function ud(t,e,r){let n=JSON.parse(new TextDecoder().decode(t));if(n?.layerType===hd)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return await wc(n,e,r)}async function pd(t,e){return t=JSON.parse(new TextDecoder().decode(t)),yc(t,e)}function md(t){return t instanceof ArrayBuffer?[...new Uint8Array(t,0,4)].map(e=>e.toString(16).padStart(2,"0")).join(""):null}var vr=async(t,e)=>{let r=[await t.getUint8(t.length-1n),await t.getUint8(t.length-2n),await t.getUint8(t.length-3n),void 0],n=-1,o=t.length-4n;do{let i=o;o-=BigInt(1024),o=o>=0n?o:0n;let s=new Uint8Array(await t.slice(o,i));for(let a=s.length-1;a>-1;a--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=s[a],r.every((f,c)=>f===e[c])){n=a;break}}while(n===-1&&o>0n);return o+BigInt(n)};var bc=new Uint8Array([80,75,5,6]),Cc=new Uint8Array([80,75,6,7]),Bc=new Uint8Array([80,75,6,6]),xd=8n;var Ad=12n,gd=16n;var Ed=8n,Sd=24n;var Rd=40n,Td=48n;var Dc=async t=>{let e=await vr(t,bc),r=BigInt(await t.getUint16(e+xd)),n=BigInt(await t.getUint32(e+Ad)),o=BigInt(await t.getUint32(e+gd)),i=e-20n,s=0n,a=await t.slice(i,i+4n);if(ee(a,Cc)){s=await t.getBigUint64(i+Ed);let f=await t.slice(s,s+4n);if(!ee(f,Bc.buffer))throw new Error("zip64 EoCD not found");r=await t.getBigUint64(s+Sd),n=await t.getBigUint64(s+Rd),o=await t.getBigUint64(s+Td)}else i=0n;return{cdRecordsNumber:r,cdStartOffset:o,cdByteSize:n,offsets:{zip64EoCDOffset:s,zip64EoCDLocatorOffset:i,zipEoCDOffset:e}}};var OR=[{offset:0,size:4,default:new DataView(bc.buffer).getUint32(0,!0)},{offset:4,size:2,default:0},{offset:6,size:2,default:0},{offset:8,size:2,name:"recordsNumber"},{offset:10,size:2,name:"recordsNumber"},{offset:12,size:4,name:"cdSize"},{offset:16,size:4,name:"cdOffset"},{offset:20,size:2,default:0}];var bR=[{offset:0,size:4,default:new DataView(Cc.buffer).getUint32(0,!0)},{offset:4,size:4,default:0},{offset:8,size:8,name:"eoCDStart"},{offset:16,size:4,default:1}],CR=[{offset:0,size:4,default:new DataView(Bc.buffer).getUint32(0,!0)},{offset:4,size:8,default:44},{offset:12,size:2,default:45},{offset:14,size:2,default:45},{offset:16,size:4,default:0},{offset:20,size:4,default:0},{offset:24,size:8,name:"recordsNumber"},{offset:32,size:8,name:"recordsNumber"},{offset:40,size:8,name:"cdSize"},{offset:48,size:8,name:"cdOffset"}];var Md=20,yd=24,wd=28,Od=30,bd=32,Cd=42,Hn=46n,Pr=new Uint8Array([80,75,1,2]),Lr=async(t,e)=>{if(t>=e.length)return null;let r=new DataView(await e.slice(t,t+Hn)),n=r.buffer.slice(0,4);if(!ee(n,Pr.buffer))return null;let o=BigInt(r.getUint32(Md,!0)),i=BigInt(r.getUint32(yd,!0)),s=r.getUint16(Od,!0),a=BigInt(r.getUint16(bd,!0)),f=r.getUint16(wd,!0),c=await e.slice(t+Hn,t+Hn+BigInt(f+s)),l=c.slice(0,f),d=new TextDecoder().decode(l),_=t+Hn+BigInt(f),h=r.getUint32(Cd,!0),u=BigInt(h),x=new DataView(c.slice(f,c.byteLength)),p={uncompressedSize:i,compressedSize:o,localHeaderOffset:u,startDisk:a},S=Bd(p,x);return{...p,...S,extraFieldLength:s,fileNameLength:f,fileName:d,extraOffset:_}};async function*qe(t){let{cdStartOffset:e,cdByteSize:r}=await Dc(t),n=new ue(new DataView(await t.slice(e,e+r))),o=await Lr(0n,n);for(;o;)yield o,o=await Lr(o.extraOffset+BigInt(o.extraFieldLength),n)}var Ic=(...t)=>t[0]+t[1]*16,Bd=(t,e)=>{let r=Dd(t),n={};if(r.length>0){let o=r.reduce((a,f)=>a+f.length,0),i=new Uint8Array(e.buffer).findIndex((a,f,c)=>Ic(c[f],c[f+1])===1&&Ic(c[f+2],c[f+3])===o),s=0;for(let a of r){let f=s;n[a.name]=e.getBigUint64(i+4+f,!0),s=f+a.length}}return n},Dd=t=>{let e=[];return t.uncompressedSize===BigInt(4294967295)&&e.push({name:"uncompressedSize",length:8}),t.compressedSize===BigInt(4294967295)&&e.push({name:"compressedSize",length:8}),t.localHeaderOffset===BigInt(4294967295)&&e.push({name:"localHeaderOffset",length:8}),t.startDisk===BigInt(4294967295)&&e.push({name:"startDisk",length:4}),e};var vR=[{offset:0,size:4,default:new DataView(Pr.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:45},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:2,default:0},{offset:16,size:4,name:"crc32"},{offset:20,size:4,name:"length"},{offset:24,size:4,name:"length"},{offset:28,size:2,name:"fnlength"},{offset:30,size:2,default:0,name:"extraLength"},{offset:32,size:2,default:0},{offset:34,size:2,default:0},{offset:36,size:2,default:0},{offset:38,size:4,default:0},{offset:42,size:4,name:"offset"}];var Id=8,vd=18,Ld=22,Pd=26,Nd=28,Vn=30n,Ai=new Uint8Array([80,75,3,4]),Ae=async(t,e)=>{let r=new DataView(await e.slice(t,t+Vn)),n=r.buffer.slice(0,4);if(!ee(n,Ai))return null;let o=r.getUint16(Pd,!0),i=r.getUint16(Nd,!0),s=await e.slice(t+Vn,t+Vn+BigInt(o+i)),a=s.slice(0,o),f=new DataView(s.slice(o,s.byteLength)),c=new TextDecoder().decode(a).split("\\").join("/"),l=t+Vn+BigInt(o+i),d=r.getUint16(Id,!0),_=BigInt(r.getUint32(vd,!0)),h=BigInt(r.getUint32(Ld,!0)),u=4;return h===BigInt(4294967295)&&(h=f.getBigUint64(u,!0),u+=8),_===BigInt(4294967295)&&(_=f.getBigUint64(u,!0),u+=8),l===BigInt(4294967295)&&(l=f.getBigUint64(u,!0)),{fileNameLength:o,fileName:c,extraFieldLength:i,fileDataOffset:l,compressedSize:_,compressionMethod:d}};var NR=[{offset:0,size:4,default:new DataView(Ai.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:0},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:4,name:"crc32"},{offset:18,size:4,name:"length"},{offset:22,size:4,name:"length"},{offset:26,size:2,name:"fnlength"},{offset:28,size:2,default:0,name:"extraLength"}];var Xn=class{constructor(e={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(e,r="base64"){let n=[];for await(let s of e)n.push(s),yield s;let o=await this.concatenate(n),i=await this.hash(o,r);this.options.crypto?.onEnd?.({hash:i})}async concatenate(e){return await ar(e)}};function vc(t){t=`${t}`;for(let r=0;r<t.length;r++)if(t.charCodeAt(r)>255)return null;let e="";for(let r=0;r<t.length;r+=3){let n=[void 0,void 0,void 0,void 0];n[0]=t.charCodeAt(r)>>2,n[1]=(t.charCodeAt(r)&3)<<4,t.length>r+1&&(n[1]|=t.charCodeAt(r+1)>>4,n[2]=(t.charCodeAt(r+1)&15)<<2),t.length>r+2&&(n[2]|=t.charCodeAt(r+2)>>6,n[3]=t.charCodeAt(r+2)&63);for(let o=0;o<n.length;o++)typeof n[o]>"u"?e+="=":e+=Fd(n[o])}return e}function Fd(t){if(t<26)return String.fromCharCode(t+"A".charCodeAt(0));if(t<52)return String.fromCharCode(t-26+"a".charCodeAt(0));if(t<62)return String.fromCharCode(t-52+"0".charCodeAt(0));if(t===62)return"+";if(t===63)return"/"}function Lc(t,e){switch(e){case"hex":return t;case"base64":return Ud(t);default:throw new Error(e)}}function Ud(t){t.length%2!==0&&(t=`0${t}`);let r=(t.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return vc(r)||""}var Nc=typeof atob=="function"?atob:typeof Buffer=="function"?Xd:Uc,Gd=Nc("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALB7oCJQhvbmVGdWxsQQAYCG9uZUZ1bGxCABkIb25lRnVsbEMAGghvbmVGdWxsRAAbBWxvb3BzAAEEbG9vcAACBXByaW1lAAMFbG9vcEEABAZsb29wQTEABQZsb29wQTIABgZsb29wQTMABwZsb29wQTQACAVsb29wQgAJBmxvb3BCMQAKBmxvb3BCMgALBmxvb3BCMwAMBmxvb3BCNAANBWxvb3BDAA4GbG9vcEMxAA8GbG9vcEMyABAGbG9vcEMzABEGbG9vcEM0ABIFbG9vcEQAEwZsb29wRDEAFAZsb29wRDIAFQZsb29wRDMAFgZsb29wRDQAFwRnZXRBACgEZ2V0QgApBGdldEMAKgRnZXREACsEZ2V0WAAsBHNldEEALQRzZXRCAC4Ec2V0QwAvBHNldEQAMARzZXRYADEKzA0xWwEBf0EAJAggAEEGdCEBAkADQCMIIAFGDQEjACQEIwEkBSMCJAYjAyQHEAIjBCMAaiQAIwUjAWokASMGIwJqJAIjByMDaiQDIwhBwABqJAgMAAsLIwgjGmokGgsTACMIIxpqJAkQAxAEEAkQDhATC6IBAEEAIwlqKAIAJApBBCMJaigCACQLQQgjCWooAgAkDEEMIwlqKAIAJA1BECMJaigCACQOQRQjCWooAgAkD0EYIwlqKAIAJBBBHCMJaigCACQRQSAjCWooAgAkEkEkIwlqKAIAJBNBKCMJaigCACQUQSwjCWooAgAkFUEwIwlqKAIAJBZBNCMJaigCACQXQTgjCWooAgAkGEE8IwlqKAIAJBkLCgAQBRAGEAcQCAsuAEH4yKq7fSMKahAYQdbunsZ+IwtqEBtB2+GBoQIjDGoQGkHunfeNfCMNahAZCy0AQa+f8Kt/Iw5qEBhBqoyfvAQjD2oQG0GTjMHBeiMQahAaQYGqmmojEWoQGQssAEHYsYLMBiMSahAYQa/vk9p4IxNqEBtBsbd9IxRqEBpBvq/zyngjFWoQGQstAEGiosDcBiMWahAYQZPj4WwjF2oQG0GOh+WzeiMYahAaQaGQ0M0EIxlqEBkLCgAQChALEAwQDQsuAEHiyviwfyMLahAcQcDmgoJ8IxBqEB9B0bT5sgIjFWoQHkGqj9vNfiMKahAdCy0AQd2gvLF9Iw9qEBxB06iQEiMUahAfQYHNh8V9IxlqEB5ByPfPvn4jDmoQHQsuAEHmm4ePAiMTahAcQdaP3Jl8IxhqEB9Bh5vUpn8jDWoQHkHtqeiqBCMSahAdCy0AQYXSj896IxdqEBxB+Me+ZyMMahAfQdmFvLsGIxFqEB5Bipmp6XgjFmoQHQsKABAPEBAQERASCysAQcLyaCMPahAgQYHtx7t4IxJqECNBosL17AYjFWoQIkGM8JRvIxhqECELLgBBxNT7pXojC2oQIEGpn/veBCMOahAjQeCW7bV/IxFqECJB8Pj+9XsjFGoQIQstAEHG/e3EAiMXahAgQfrPhNV+IwpqECNBheG8p30jDWoQIkGFuqAkIxBqECELLgBBuaDTzn0jE2oQIEHls+62fiMWahAjQfj5if0BIxlqECJB5ayxpXwjDGoQIQsKABAUEBUQFhAXCy0AQcTEpKF/IwpqECRBl/+rmQQjEWoQJ0Gnx9DceiMYahAmQbnAzmQjD2oQJQstAEHDs+2qBiMWahAkQZKZs/h4Iw1qECdB/ei/fyMUahAmQdG7kax4IwtqECULLQBBz/yh/QYjEmoQJEHgzbNxIxlqECdBlIaFmHojEGoQJkGho6DwBCMXahAlCy4AQYL9zbp/Iw5qECRBteTr6XsjFWoQJ0G7pd/WAiMMahAmQZGnm9x+IxNqECULKAEBf0F/IwFzIwNxIwEjAnFyIwBqIABqIgFBB3QgAUEZdnIjAWokAAsoAQF/QX8jAnMjAHEjAiMDcXIjAWogAGoiAUEWdCABQQp2ciMCaiQBCygBAX9BfyMDcyMBcSMDIwBxciMCaiAAaiIBQRF0IAFBD3ZyIwNqJAILKAEBf0F/IwBzIwJxIwAjAXFyIwNqIABqIgFBDHQgAUEUdnIjAGokAwsoAQF/IwJBfyMDc3EjASMDcXIjAGogAGoiAUEFdCABQRt2ciMBaiQACygBAX8jA0F/IwBzcSMCIwBxciMBaiAAaiIBQRR0IAFBDHZyIwJqJAELKAEBfyMAQX8jAXNxIwMjAXFyIwJqIABqIgFBDnQgAUESdnIjA2okAgsoAQF/IwFBfyMCc3EjACMCcXIjA2ogAGoiAUEJdCABQRd2ciMAaiQDCyIBAX8jASMCcyMDcyMAaiAAaiIBQQR0IAFBHHZyIwFqJAALIgEBfyMCIwNzIwBzIwFqIABqIgFBF3QgAUEJdnIjAmokAQsiAQF/IwMjAHMjAXMjAmogAGoiAUEQdCABQRB2ciMDaiQCCyIBAX8jACMBcyMCcyMDaiAAaiIBQQt0IAFBFXZyIwBqJAMLJQEBf0F/IwNzIwFyIwJzIwBqIABqIgFBBnQgAUEadnIjAWokAAslAQF/QX8jAHMjAnIjA3MjAWogAGoiAUEVdCABQQt2ciMCaiQBCyUBAX9BfyMBcyMDciMAcyMCaiAAaiIBQQ90IAFBEXZyIwNqJAILJQEBf0F/IwJzIwByIwFzIwNqIABqIgFBCnQgAUEWdnIjAGokAwsEACMACwQAIwELBAAjAgsEACMDCwQAIxoLBgAgACQACwYAIAAkAQsGACAAJAILBgAgACQDCwYAIAAkGgsA6gQEbmFtZQGSAzIAA2xvZwEFbG9vcHMCBGxvb3ADBXByaW1lBAVsb29wQQUGbG9vcEExBgZsb29wQTIHBmxvb3BBMwgGbG9vcEE0CQVsb29wQgoGbG9vcEIxCwZsb29wQjIMBmxvb3BCMw0GbG9vcEI0DgVsb29wQw8GbG9vcEMxEAZsb29wQzIRBmxvb3BDMxIGbG9vcEM0EwVsb29wRBQGbG9vcEQxFQZsb29wRDIWBmxvb3BEMxcGbG9vcEQ0GAhvbmVGdWxsQRkIb25lRnVsbEIaCG9uZUZ1bGxDGwhvbmVGdWxsRBwIdHdvRnVsbEEdCHR3b0Z1bGxCHgh0d29GdWxsQx8IdHdvRnVsbEQgCHRyZUZ1bGxBIQh0cmVGdWxsQiIIdHJlRnVsbEMjCHRyZUZ1bGxEJAhxdWFGdWxsQSUIcXVhRnVsbEImCHF1YUZ1bGxDJwhxdWFGdWxsRCgEZ2V0QSkEZ2V0QioEZ2V0QysEZ2V0RCwEZ2V0WC0Ec2V0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),gi=WebAssembly&&Nc!==Uc?Vd(Gd).buffer:!1,Ut=Wd(),Ei=240*16*16,Fc=Math.floor(Ei*16*1.066666667),kd=268435456-65536,Pc="Parameter must be Buffer, ArrayBuffer or Uint8Array",zd="Parameter exceeds max size of 255.9 Mbytes";gi||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function Si(t){var e,r,n,o,i,s,a,f,c,l;let d=Hd(),_=Kd(),h={},u=new Date().getTime();return h.then=function(y){return a=y,p(),h},h.catch=function(y){return f=y,h},t&&typeof t=="object"?typeof Buffer=="function"&&t.constructor===Buffer?s=t:t.constructor===Uint8Array||t.constructor===ArrayBuffer?s=t.constructor===ArrayBuffer?new Uint8Array(t):t:S(new TypeError(Pc)):S(new TypeError(Pc)),s&&(i=s.length,gi&&i>Fc?i>kd?S(new Error(zd)):(e=new WebAssembly.Memory({initial:i>32e6?i>64e6?i>128e6?4096:2048:1024:512}),r=new Uint32Array(e.buffer),o={mem:e,log:console.log},n={imports:o},WebAssembly.instantiate(gi,n).then(x)):p(d(s))),h;function x(y){p(_(s,y.instance.exports,r))}function p(y){var B=Boolean(y)?y:c;Boolean(y)&&(l=new Date().getTime()),typeof a=="function"?Boolean(B)&&(a(B,l-u),a=f=null):Boolean(y)&&(c=y)}function S(y){typeof f=="function"&&f(y)}}function Kd(){var t,e,r,n,o,i,s,a,f,c,l,d,_,h=function(u){var x,p,S,y,B,T,R,D,I,L,A,m,g,E,U,F,G,P,J,ot,X,it,bt=new Date().getTime(),De=0,O=1732584193,w=-271733879,b=-1732584194,C=271733878,Q=0,ir=u.length*8,rn;for(rn=Vl(u,_),_[ir>>>5]|=128<<ir%32,_[(ir+64>>>9<<4)+14]=ir,rn=(ir+64>>>9<<4)+15,X=_;Q<rn;)rn>Q+Fc?(n(O),i(w),a(b),c(C),e(Ei),Q=Q+Ei*16,O=r(),w=o(),b=s(),C=f(),De++):(G=O,P=w,J=b,ot=C,x=X[Q+0]>>>0,p=X[Q+1]>>>0,S=X[Q+2]>>>0,y=X[Q+3]>>>0,B=X[Q+4]>>>0,T=X[Q+5]>>>0,R=X[Q+6]>>>0,D=X[Q+7]>>>0,I=X[Q+8]>>>0,L=X[Q+9]>>>0,A=X[Q+10]>>>0,m=X[Q+11]>>>0,g=X[Q+12]>>>0,E=X[Q+13]>>>0,U=X[Q+14]>>>0,F=X[Q+15]>>>0,O=N(7,25,O+(w&b|~w&C)+x-680876936)+w,C=N(12,20,C+(O&w|~O&b)+p-389564586)+O,b=N(17,15,b+(C&O|~C&w)+S+606105819)+C,w=N(22,10,w+(b&C|~b&O)+y-1044525330)+b,O=N(7,25,O+(w&b|~w&C)+B-176418897)+w,C=N(12,20,C+(O&w|~O&b)+T+1200080426)+O,b=N(17,15,b+(C&O|~C&w)+R-1473231341)+C,w=N(22,10,w+(b&C|~b&O)+D-45705983)+b,O=N(7,25,O+(w&b|~w&C)+I+1770035416)+w,C=N(12,20,C+(O&w|~O&b)+L-1958414417)+O,b=N(17,15,b+(C&O|~C&w)+A-42063)+C,w=N(22,10,w+(b&C|~b&O)+m-1990404162)+b,O=N(7,25,O+(w&b|~w&C)+g+1804603682)+w,C=N(12,20,C+(O&w|~O&b)+E-40341101)+O,b=N(17,15,b+(C&O|~C&w)+U-1502002290)+C,w=N(22,10,w+(b&C|~b&O)+F+1236535329)+b,O=N(5,27,O+(w&C|b&~C)+p-165796510)+w,C=N(9,23,C+(O&b|w&~b)+R-1069501632)+O,b=N(14,18,b+(C&w|O&~w)+m+643717713)+C,w=N(20,12,w+(b&O|C&~O)+x-373897302)+b,O=N(5,27,O+(w&C|b&~C)+T-701558691)+w,C=N(9,23,C+(O&b|w&~b)+A+38016083)+O,b=N(14,18,b+(C&w|O&~w)+F-660478335)+C,w=N(20,12,w+(b&O|C&~O)+B-405537848)+b,O=N(5,27,O+(w&C|b&~C)+L+568446438)+w,C=N(9,23,C+(O&b|w&~b)+U-1019803690)+O,b=N(14,18,b+(C&w|O&~w)+y-187363961)+C,w=N(20,12,w+(b&O|C&~O)+I+1163531501)+b,O=N(5,27,O+(w&C|b&~C)+E-1444681467)+w,C=N(9,23,C+(O&b|w&~b)+S-51403784)+O,b=N(14,18,b+(C&w|O&~w)+D+1735328473)+C,w=N(20,12,w+(b&O|C&~O)+g-1926607734)+b,O=N(4,28,O+(w^b^C)+T-378558)+w,C=N(11,21,C+(O^w^b)+I-2022574463)+O,b=N(16,16,b+(C^O^w)+m+1839030562)+C,w=N(23,9,w+(b^C^O)+U-35309556)+b,O=N(4,28,O+(w^b^C)+p-1530992060)+w,C=N(11,21,C+(O^w^b)+B+1272893353)+O,b=N(16,16,b+(C^O^w)+D-155497632)+C,w=N(23,9,w+(b^C^O)+A-1094730640)+b,O=N(4,28,O+(w^b^C)+E+681279174)+w,C=N(11,21,C+(O^w^b)+x-358537222)+O,b=N(16,16,b+(C^O^w)+y-722521979)+C,w=N(23,9,w+(b^C^O)+R+76029189)+b,O=N(4,28,O+(w^b^C)+L-640364487)+w,C=N(11,21,C+(O^w^b)+g-421815835)+O,b=N(16,16,b+(C^O^w)+F+530742520)+C,w=N(23,9,w+(b^C^O)+S-995338651)+b,O=N(6,26,O+(b^(w|~C))+x-198630844)+w,C=N(10,22,C+(w^(O|~b))+D+1126891415)+O,b=N(15,17,b+(O^(C|~w))+U-1416354905)+C,w=N(21,11,w+(C^(b|~O))+T-57434055)+b,O=N(6,26,O+(b^(w|~C))+g+1700485571)+w,C=N(10,22,C+(w^(O|~b))+y-1894986606)+O,b=N(15,17,b+(O^(C|~w))+A-1051523)+C,w=N(21,11,w+(C^(b|~O))+p-2054922799)+b,O=N(6,26,O+(b^(w|~C))+I+1873313359)+w,C=N(10,22,C+(w^(O|~b))+F-30611744)+O,b=N(15,17,b+(O^(C|~w))+R-1560198380)+C,w=N(21,11,w+(C^(b|~O))+E+1309151649)+b,O=N(6,26,O+(b^(w|~C))+B-145523070)+w,C=N(10,22,C+(w^(O|~b))+m-1120210379)+O,b=N(15,17,b+(O^(C|~w))+S+718787259)+C,w=N(21,11,w+(C^(b|~O))+L-343485551)+b,Q=Q+16,O=O+G>>>0,w=w+P>>>0,b=b+J>>>0,C=C+ot>>>0);return Ut.endian([O,w,b,C]);function N(st,nn,Ct){return Ct<<st|Ct>>>nn}function Vl(st,nn){for(var Ct=-1,_o=Math.floor((st.length-1)/4),lt=0,is,ss,as,cs;_o-8>Ct++;)lt=Ct<<2,nn[Ct]=st[lt+0]|st[lt+1]<<8|st[lt+2]<<16|st[lt+3]<<24;for(Ct--;_o>Ct++;)lt=Ct<<2,is=typeof st[lt+0]>"u"?0:st[lt+0],ss=typeof st[lt+1]>"u"?0:st[lt+1],as=typeof st[lt+2]>"u"?0:st[lt+2],cs=typeof st[lt+3]>"u"?0:st[lt+3],nn[Ct]=is|ss<<8|as<<16|cs<<24;return _o+1}};return function(u,x,p,S){var y;return e=x.loops,t=x.loop,r=x.getA,o=x.getB,s=x.getC,f=x.getD,l=x.getX,n=x.setA,i=x.setB,a=x.setC,c=x.setD,d=x.setX,_=p,y=Ut.wordsToBytes(h(u)),S&&S.asBytes?y:Ut.bytesconvertNumberToHex(y)}}function Hd(){var t=function(e,r){var n,o,i,s,a,f,c,l,d,_,h,u,x,p,S,y,B,T,R,D,I,L=new Date().getTime(),A=1732584193,m=-271733879,g=-1732584194,E=271733878,U=e.length*8;I=Ut.bytesToWords(e);for(var F=0;F<I.length;F++)I[F]=(I[F]<<8|I[F]>>>24)&16711935|(I[F]<<24|I[F]>>>8)&4278255360;I[U>>>5]|=128<<U%32,I[(U+64>>>9<<4)+14]=U;for(var G=0;G<I.length;G+=16)B=A,T=m,R=g,D=E,n=I[G+0]>>>0,o=I[G+1]>>>0,i=I[G+2]>>>0,s=I[G+3]>>>0,a=I[G+4]>>>0,f=I[G+5]>>>0,c=I[G+6]>>>0,l=I[G+7]>>>0,d=I[G+8]>>>0,_=I[G+9]>>>0,h=I[G+10]>>>0,u=I[G+11]>>>0,x=I[G+12]>>>0,p=I[G+13]>>>0,S=I[G+14]>>>0,y=I[G+15]>>>0,A=P(7,25,A+(m&g|~m&E)+n-680876936)+m,E=P(12,20,E+(A&m|~A&g)+o-389564586)+A,g=P(17,15,g+(E&A|~E&m)+i+606105819)+E,m=P(22,10,m+(g&E|~g&A)+s-1044525330)+g,A=P(7,25,A+(m&g|~m&E)+a-176418897)+m,E=P(12,20,E+(A&m|~A&g)+f+1200080426)+A,g=P(17,15,g+(E&A|~E&m)+c-1473231341)+E,m=P(22,10,m+(g&E|~g&A)+l-45705983)+g,A=P(7,25,A+(m&g|~m&E)+d+1770035416)+m,E=P(12,20,E+(A&m|~A&g)+_-1958414417)+A,g=P(17,15,g+(E&A|~E&m)+h-42063)+E,m=P(22,10,m+(g&E|~g&A)+u-1990404162)+g,A=P(7,25,A+(m&g|~m&E)+x+1804603682)+m,E=P(12,20,E+(A&m|~A&g)+p-40341101)+A,g=P(17,15,g+(E&A|~E&m)+S-1502002290)+E,m=P(22,10,m+(g&E|~g&A)+y+1236535329)+g,A=P(5,27,A+(m&E|g&~E)+o-165796510)+m,E=P(9,23,E+(A&g|m&~g)+c-1069501632)+A,g=P(14,18,g+(E&m|A&~m)+u+643717713)+E,m=P(20,12,m+(g&A|E&~A)+n-373897302)+g,A=P(5,27,A+(m&E|g&~E)+f-701558691)+m,E=P(9,23,E+(A&g|m&~g)+h+38016083)+A,g=P(14,18,g+(E&m|A&~m)+y-660478335)+E,m=P(20,12,m+(g&A|E&~A)+a-405537848)+g,A=P(5,27,A+(m&E|g&~E)+_+568446438)+m,E=P(9,23,E+(A&g|m&~g)+S-1019803690)+A,g=P(14,18,g+(E&m|A&~m)+s-187363961)+E,m=P(20,12,m+(g&A|E&~A)+d+1163531501)+g,A=P(5,27,A+(m&E|g&~E)+p-1444681467)+m,E=P(9,23,E+(A&g|m&~g)+i-51403784)+A,g=P(14,18,g+(E&m|A&~m)+l+1735328473)+E,m=P(20,12,m+(g&A|E&~A)+x-1926607734)+g,A=P(4,28,A+(m^g^E)+f-378558)+m,E=P(11,21,E+(A^m^g)+d-2022574463)+A,g=P(16,16,g+(E^A^m)+u+1839030562)+E,m=P(23,9,m+(g^E^A)+S-35309556)+g,A=P(4,28,A+(m^g^E)+o-1530992060)+m,E=P(11,21,E+(A^m^g)+a+1272893353)+A,g=P(16,16,g+(E^A^m)+l-155497632)+E,m=P(23,9,m+(g^E^A)+h-1094730640)+g,A=P(4,28,A+(m^g^E)+p+681279174)+m,E=P(11,21,E+(A^m^g)+n-358537222)+A,g=P(16,16,g+(E^A^m)+s-722521979)+E,m=P(23,9,m+(g^E^A)+c+76029189)+g,A=P(4,28,A+(m^g^E)+_-640364487)+m,E=P(11,21,E+(A^m^g)+x-421815835)+A,g=P(16,16,g+(E^A^m)+y+530742520)+E,m=P(23,9,m+(g^E^A)+i-995338651)+g,A=P(6,26,A+(g^(m|~E))+n-198630844)+m,E=P(10,22,E+(m^(A|~g))+l+1126891415)+A,g=P(15,17,g+(A^(E|~m))+S-1416354905)+E,m=P(21,11,m+(E^(g|~A))+f-57434055)+g,A=P(6,26,A+(g^(m|~E))+x+1700485571)+m,E=P(10,22,E+(m^(A|~g))+s-1894986606)+A,g=P(15,17,g+(A^(E|~m))+h-1051523)+E,m=P(21,11,m+(E^(g|~A))+o-2054922799)+g,A=P(6,26,A+(g^(m|~E))+d+1873313359)+m,E=P(10,22,E+(m^(A|~g))+y-30611744)+A,g=P(15,17,g+(A^(E|~m))+c-1560198380)+E,m=P(21,11,m+(E^(g|~A))+p+1309151649)+g,A=P(6,26,A+(g^(m|~E))+a-145523070)+m,E=P(10,22,E+(m^(A|~g))+u-1120210379)+A,g=P(15,17,g+(A^(E|~m))+i+718787259)+E,m=P(21,11,m+(E^(g|~A))+_-343485551)+g,A=A+B>>>0,m=m+T>>>0,g=g+R>>>0,E=E+D>>>0;return Ut.endian([A,m,g,E]);function P(J,ot,X){return X<<J|X>>>ot}};return function(e,r){var n=Ut.wordsToBytes(t(e,r)),o=r&&r.asBytes?n:Ut.bytesconvertNumberToHex(n);return o}}function Vd(t){var e,r,n,o=-1;for(e=t.length-1,r=new ArrayBuffer(t.length),n=new Uint8Array(r);e>o++;)n[o]=t.charCodeAt(o);return n}function Xd(t){return Buffer.from(t,"base64").toString("binary")}function Uc(t){return t}function Wd(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(e,r){return e<<r|e>>>32-r},endian:function(e){if(e.constructor==Number)return Ut.rotl(e,8)&16711935|Ut.rotl(e,24)&4278255360;for(var r=0;r<e.length;r++)e[r]=Ut.endian(e[r]);return e},bytesToWords:function(e){for(var r=[],n=0,o=0;n<e.length;n++,o+=8)r[o>>>5]|=e[n]<<24-o%32;return r},wordsToBytes:function(e){for(var r=[],n=0;n<e.length*32;n+=8)r.push(e[n>>>5]>>>24-n%32&255);return r},bytesconvertNumberToHex:function(e){for(var r=[],n=0;n<e.length;n++)r.push((e[n]>>>4).toString(16)),r.push((e[n]&15).toString(16));return r.join("")}}}var ge=class extends Xn{name="md5";options;constructor(e={}){super(),this.options=e}async hash(e,r){let o=await new Promise((i,s)=>Si(e).then(i).catch(s));return Lc(o,r)}};var Wn=class{constructor(e){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(e={}){sr(e)}async compress(e){return await this.preload(),this.compressSync(e)}async decompress(e,r){return await this.preload(),this.decompressSync(e,r)}compressSync(e){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(e,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(e){let r=await this.concatenate(e);yield this.compress(r)}async*decompressBatches(e){let r=await this.concatenate(e);yield this.decompress(r)}concatenate(e){return ar(e)}improveError(e){return e.message.includes(this.name)||(e.message=`${this.name} ${e.message}`),e}};var be=Bt(wl(),1),Jt=Bt(Ol(),1);var Ce=class extends Wn{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(e={}){super(e),this.options=e}async compress(e){if(!At&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Pe(Jt.default.gzip)(e):await Pe(Jt.default.deflate)(e);return Le(r)}return this.compressSync(e)}async decompress(e){if(!At&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Pe(Jt.default.gunzip)(e):await Pe(Jt.default.inflate)(e);return Le(r)}return this.decompressSync(e)}compressSync(e){if(!At&&this.options.deflate?.useZlib){let i=this.options.deflate?.gzip?Jt.default.gzipSync(e):Jt.default.deflateSync(e);return Le(i)}let r=this.options?.deflate||{},n=new Uint8Array(e);return(this.options?.raw?be.default.deflateRaw:be.default.deflate)(n,r).buffer}decompressSync(e){if(!At&&this.options.deflate?.useZlib){let i=this.options.deflate?.gzip?Jt.default.gunzipSync(e):Jt.default.inflateSync(e);return Le(i)}let r=this.options?.deflate||{},n=new Uint8Array(e);return(this.options?.raw?be.default.inflateRaw:be.default.inflate)(n,r).buffer}async*compressBatches(e){let r=this.options?.deflate||{},n=new be.default.Deflate(r);yield*this.transformBatches(n,e)}async*decompressBatches(e){let r=this.options?.deflate||{},n=new be.default.Inflate(r);yield*this.transformBatches(n,e)}async*transformBatches(e,r){e.onData=this._onData.bind(this),e.onEnd=this._onEnd.bind(this);for await(let s of r){let a=new Uint8Array(s);if(!e.push(a,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),o=e.push(n,!0);yield*this._getChunks()}_onData(e){this._chunks.push(e)}_onEnd(e){if(e!==0)throw new Error(this._getError(e)+this._chunks.length)}_getChunks(){let e=this._chunks;return this._chunks=[],e}_getError(e=0){let r={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"};return`${this.name}: ${r[e]}`}};var Jr=class extends Ce{name="gzip";extensions=["gz","gzip"];contentEncodings=["gzip","x-gzip"];isSupported=!0;constructor(e){super({...e,deflate:{...e?.gzip,gzip:!0}})}};var Gp={0:async t=>t,8:async t=>await new Ce({raw:!0}).decompress(t)},fo=class{fileProvider=null;fileName;archive=null;constructor(e){if(typeof e=="string")if(this.fileName=e,!At)this.fileProvider=new fr(e);else throw new Error("Cannot open file for random access in a WEB browser");else e instanceof Be?(this.fileProvider=e.fileProvider,this.archive=e,this.fileName=e.fileName):go(e)&&(this.fileProvider=e)}async destroy(){this.fileProvider&&await this.fileProvider.destroy()}async readdir(){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let e=[],r=qe(this.fileProvider);for await(let n of r)e.push(n.fileName);return e}async stat(e){let r=await this.getCDFileHeader(e);return{...r,size:Number(r.uncompressedSize)}}async fetch(e){this.fileName&&e.indexOf(this.fileName)===0&&(e=e.substring(this.fileName.length+1));let r;if(this.archive)r=await this.archive.getFile(e,"http");else{if(!this.fileProvider)throw new Error("No data detected in the zip archive");let o=await this.getCDFileHeader(e),i=await Ae(o.localHeaderOffset,this.fileProvider);if(!i)throw new Error("Local file header has not been found in the zip archive`");let s=Gp[i.compressionMethod.toString()];if(!s)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(i.fileDataOffset,i.fileDataOffset+i.compressedSize);r=await s(a)}let n=new Response(r);return Object.defineProperty(n,"url",{value:e?`${this.fileName||""}/${e}`:this.fileName||""}),n}async getCDFileHeader(e){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=qe(this.fileProvider),n=null;for await(let o of r)if(o.fileName===e){n=o;break}if(!n)throw new Error("File has not been found in the zip archive");return n}};var Be=class{fileProvider;fileName;constructor(e,r,n){this.fileProvider=e,this.fileName=n}async getFileWithoutHash(e){return await(await new fo(this.fileProvider).fetch(e)).arrayBuffer()}};function rs(t){let e=new DataView(t),r={};for(let n=0;n<t.byteLength;n=n+24){let o=e.getBigUint64(n+16,!0),i=kp(t,n,16);r[i]=o}return r}function kp(t,e,r){return[...new Uint8Array(t,e,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function ns(t){let e=qe(t);return zp(e)}async function zp(t){let e=new ge,r=new TextEncoder,n={};for await(let o of t){let i=o.fileName.split("\\").join("/").toLocaleLowerCase(),s=r.encode(i).buffer,a=await e.hash(s,"hex");n[a]=o.localHeaderOffset}return n}var Kp=[{test:/^$/,extensions:["3dSceneLayer.json.gz"]},{test:/^nodepages\/\d+$/,extensions:[".json.gz"]},{test:/^nodes\/(\d+|root)$/,extensions:["/3dNodeIndexDocument.json.gz"]},{test:/^nodes\/\d+\/textures\/.+$/,extensions:[".jpg",".png",".bin.dds.gz",".ktx"]},{test:/^nodes\/\d+\/geometries\/\d+$/,extensions:[".bin.gz",".draco.gz"]},{test:/^nodes\/\d+\/attributes\/f_\d+\/\d+$/,extensions:[".bin.gz"]},{test:/^statistics\/f_\d+\/\d+$/,extensions:[".json.gz"]},{test:/^nodes\/\d+\/shared$/,extensions:["/sharedResource.json.gz"]}],or=class extends Be{hashTable;_textEncoder=new TextEncoder;_textDecoder=new TextDecoder;_md5Hash=new ge;constructor(e,r,n){super(e,r,n),this.hashTable=r}async getFile(e,r="raw"){if(r==="http"){let n=Kp.find(o=>o.test.test(e))?.extensions;if(n){let o;for(let i of n)if(o=await this.getDataByPath(`${e}${i}`),o)break;if(o)return o}}if(r==="raw"){let n=await this.getDataByPath(`${e}.gz`);if(n)return n;let o=await this.getFileBytes(e);if(o)return o}throw new Error(`No such file in the archive: ${e}`)}async getDataByPath(e){let r=await this.getFileBytes(e.toLocaleLowerCase());if(r||(r=await this.getFileBytes(e)),!!r)return/\.gz$/.test(e)?await new Jr().decompress(r):r}async getFileBytes(e){let r;if(this.hashTable){let n=this._textEncoder.encode(e),o=await this._md5Hash.hash(n.buffer,"hex"),i=this.hashTable[o];if(i===void 0)return;let s=await Ae(i,this.fileProvider);if(!s)return;r=await this.fileProvider.slice(s.fileDataOffset,s.fileDataOffset+s.compressedSize)}else try{r=await this.getFileWithoutHash(e)}catch{r=void 0}return r}};async function lo(t,e,r){let n=await vr(t,Pr),o=await Lr(n,t),i;if(o?.fileName!=="@specialIndexFileHASH128@")i=await ns(t),e?.("SLPK doesnt contain hash file, hash info has been composed according to zip archive headers");else{let s=await Ae(o.localHeaderOffset,t);if(!s)throw new Error("corrupted SLPK");let a=s.fileDataOffset,f=await t.slice(a,a+s.compressedSize);i=rs(f)}return new or(t,i,r)}var Hp="4.3.0-alpha.3",bl={dataType:null,batchType:null,name:"I3S SLPK (Scene Layer Package)",id:"slpk",module:"i3s",version:Hp,mimeTypes:["application/octet-stream"],extensions:["slpk"],options:{},parse:async(t,e={})=>(await lo(new ue(new DataView(t)))).getFile(e.slpk?.path??"",e.slpk?.pathMode)};var Il=Bt(Vt(),1);function Bl(t,e){let{attributeName:r,attributeType:n}=e;return r?{[r]:n?Vp(n,t):null}:{}}function Vp(t,e){switch(t){case Aa:return qp(e);case ga:return Cl(e);case Ea:return Wp(e);case Sa:return Xp(e);default:return Cl(e)}}function Cl(t){return new Uint32Array(t,4)}function Xp(t){return new Int16Array(t,4)}function Wp(t){return new Float64Array(t,8)}function qp(t){let o=[];try{let i=new DataView(t,0,4).getUint32(0,!0),s=new Uint32Array(t,8,i),a=8+i*4;for(let f of s){let c=new TextDecoder("utf-8"),l=new Uint8Array(t,a,f);o.push(c.decode(l)),a+=f}}catch(i){console.error("Parse string attribute error: ",i.message)}return o}var Zp="4.3.0-alpha.3",Dl="",Qp="rejected",$r={dataType:null,batchType:null,name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:Zp,mimeTypes:["application/binary"],parse:async(t,e)=>Bl(t,e),extensions:["bin"],options:{},binary:!0};async function vl(t,e,r={}){let{attributeStorageInfo:n,attributeUrls:o,tilesetFields:i}=Yp(t);if(!n||!o||e<0)return null;let s=[],a=[];for(let f=0;f<n.length;f++){let c=Ft(o[f],r.i3s?.token),l=n[f].name,d=os(n[f]),_={...r,attributeName:l,attributeType:d},h=(0,Il.load)(c,$r,_);a.push(h)}try{s=await Promise.allSettled(a)}catch{}return s.length?Jp(s,n,e,i):null}function Yp(t){let e=t.tileset?.tileset?.attributeStorageInfo,r=t.header?.attributeUrls,n=t.tileset?.tileset?.fields||[];return{attributeStorageInfo:e,attributeUrls:r,tilesetFields:n}}function os(t){return t.hasOwnProperty("objectIds")?"Oid32":t.hasOwnProperty("attributeValues")?t.attributeValues.valueType:""}function jp(t){return t.find(r=>r.name.includes("OBJECTID"))?.name}function Jp(t,e,r,n){let o=jp(e),i=t.find(a=>a.value[o]);if(!i)return null;let s=i.value[o].indexOf(r);return s<0?null:$p(t,s,e,n)}function $p(t,e,r,n){let o={};for(let i=0;i<r.length;i++){let s=r[i].name,a=tm(s,n),f=em(t,i,s);o[s]=rm(f,e,a)}return o}function tm(t,e){return e.find(n=>n.name===t||n.alias===t)?.domain?.codedValues||[]}function em(t,e,r){let n=t[e];return n.status===Qp?null:n.value[r]}function rm(t,e,r){let n=Dl;return t&&e in t&&(n=String(t[e]).replace(/\u0000|NaN/g,"").trim()),r.length&&(n=r.find(i=>i.code===Number(n))?.name||Dl),n}var nm="3DObject";async function Ll(t,e){let r=JSON.parse(new TextDecoder().decode(t)),{sublayers:n}=r;return{header:r,sublayers:Pl(n,e)}}function Pl(t,e){let r=[];for(let n=0;n<t.length;n++){let o=t[n],{id:i,layerType:s,visibility:a=!0,...f}=o;if(s===nm){let c=`${e}/sublayers/${i}`;r.push({url:c,id:i,layerType:s,visibility:a,...f})}o?.sublayers?.length&&(r=[...r,...Pl(o.sublayers,e)])}return r}var om="4.3.0-alpha.3",Nl={dataType:null,batchType:null,name:"I3S Building Scene Layer",id:"i3s-building-scene-layer",module:"i3s",version:om,mimeTypes:["application/json"],parse:im,extensions:["json"],options:{}};async function im(t,e,r){if(!r?.url)throw new Error("Url is not provided");return Ll(t,r.url)}var ho=Bt(Vt(),1),sm=4326,am="ArcGISSceneServiceLayer",cm="BuildingSceneLayer",fm="IntegratedMeshLayer",Fl="GroupLayer",lm=[am,fm,cm,Fl],hm="NO_AVAILABLE_SUPPORTED_LAYERS_ERROR",_m="NOT_SUPPORTED_CRS_ERROR",tn=class extends Error{details;constructor(e,r){super(e),this.details=r,this.name="LayerError"}};async function Ul(t){let e=JSON.parse(new TextDecoder().decode(t)),{operationalLayers:r}=e,{layers:n,unsupportedLayers:o}=await Gl(r,!0);if(!n.length)throw new tn(hm,o);return{header:e,layers:n,unsupportedLayers:o}}async function Gl(t,e){let r=[],n=[];for(let o=0;o<t.length;o++){let i=t[o];if(lm.includes(i.layerType)?(e&&i.layerType!==Fl&&(await dm(i),e=!1),r.push(i)):n.push(i),i.layers?.length){let{layers:a,unsupportedLayers:f}=await Gl(i.layers,e);i.layers=a,n=[...n,...f]}}return{layers:r,unsupportedLayers:n}}async function dm(t){try{if((await(0,ho.load)(t.url,ho.JSONLoader))?.spatialReference?.wkid!==sm)throw new Error(_m)}catch(e){throw e}}var um="4.3.0-alpha.3",kl={dataType:null,batchType:null,name:"ArcGIS Web Scene Loader",id:"arcgis-web-scene",module:"i3s",version:um,mimeTypes:["application/json"],parse:pm,extensions:["json"],options:{}};async function pm(t){return Ul(t)}var Kl=Bt(Vt(),1);async function Hl(t,e,r,n,o,i,s){if(!i)return t;let a={...t,value:new Uint8Array(t.value)},f=n.find(({name:h})=>h===i?.attributeName);if(!f||!["esriFieldTypeDouble","esriFieldTypeInteger","esriFieldTypeSmallInteger"].includes(f.type))return t;let c=await zl(f.name,r,o,s);if(!c)return t;let l=n.find(({type:h})=>h==="esriFieldTypeOID");if(!l)return t;let d=await zl(l.name,r,o,s);if(!d)return t;let _={};for(let h=0;h<d[l.name].length;h++)_[d[l.name][h]]=mm(c[f.name][h],i);for(let h=0;h<e.length;h++){let u=_[e[h]];u&&(i.mode==="multiply"?u.forEach((x,p)=>{a.value[h*4+p]=a.value[h*4+p]*x/255}):a.value.set(u,h*4))}return a}function mm(t,e){if(!e)return[255,255,255,255];let{minValue:r,maxValue:n,minColor:o,maxColor:i}=e,s=(t-r)/(n-r),a=[255,255,255,255];for(let f=0;f<o.length;f++)a[f]=Math.round((i[f]-o[f])*s+o[f]);return a}async function zl(t,e,r,n){let o=r.findIndex(({name:f})=>t===f);if(o===-1)return null;let i=Ft(e[o],n),s=os(r[o]);return await(0,Kl.load)(i,$r,{attributeName:t,attributeType:s})}return Yl(en);})();
7
+ "use strict";var __exports__=(()=>{var Xl=Object.create;var sn=Object.defineProperty;var Wl=Object.getOwnPropertyDescriptor;var ql=Object.getOwnPropertyNames;var Zl=Object.getPrototypeOf,Ql=Object.prototype.hasOwnProperty;var tt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),an=(t,e)=>{for(var r in e)sn(t,r,{get:e[r],enumerable:!0})},on=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ql(e))!Ql.call(t,o)&&o!==r&&sn(t,o,{get:()=>e[o],enumerable:!(n=Wl(e,o))||n.enumerable});return t},cn=(t,e,r)=>(on(t,e,"default"),r&&on(r,e,"default")),Bt=(t,e,r)=>(r=t!=null?Xl(Zl(t)):{},on(e||!t||!t.__esModule?sn(r,"default",{value:t,enumerable:!0}):r,t)),Yl=t=>on(sn({},"__esModule",{value:!0}),t);var Vt=tt((Am,fs)=>{fs.exports=globalThis.loaders});var Zt=tt(ct=>{"use strict";var qd=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Zd(t,e){return Object.prototype.hasOwnProperty.call(t,e)}ct.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)Zd(r,n)&&(t[n]=r[n])}}return t};ct.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var Qd={arraySet:function(t,e,r,n,o){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+n),o);return}for(var i=0;i<n;i++)t[o+i]=e[r+i]},flattenChunks:function(t){var e,r,n,o,i,s;for(n=0,e=0,r=t.length;e<r;e++)n+=t[e].length;for(s=new Uint8Array(n),o=0,e=0,r=t.length;e<r;e++)i=t[e],s.set(i,o),o+=i.length;return s}},Yd={arraySet:function(t,e,r,n,o){for(var i=0;i<n;i++)t[o+i]=e[r+i]},flattenChunks:function(t){return[].concat.apply([],t)}};ct.setTyped=function(t){t?(ct.Buf8=Uint8Array,ct.Buf16=Uint16Array,ct.Buf32=Int32Array,ct.assign(ct,Qd)):(ct.Buf8=Array,ct.Buf16=Array,ct.Buf32=Array,ct.assign(ct,Yd))};ct.setTyped(qd)});var cf=tt(Ye=>{"use strict";var jd=Zt(),Jd=4,Gc=0,kc=1,$d=2;function Qe(t){for(var e=t.length;--e>=0;)t[e]=0}var tu=0,Wc=1,eu=2,ru=3,nu=258,bi=29,zr=256,Fr=zr+1+bi,Ze=30,Ci=19,qc=2*Fr+1,Ee=15,Ri=16,ou=7,Bi=256,Zc=16,Qc=17,Yc=18,wi=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],qn=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],iu=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],jc=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],su=512,Qt=new Array((Fr+2)*2);Qe(Qt);var Nr=new Array(Ze*2);Qe(Nr);var Ur=new Array(su);Qe(Ur);var Gr=new Array(nu-ru+1);Qe(Gr);var Di=new Array(bi);Qe(Di);var Zn=new Array(Ze);Qe(Zn);function Ti(t,e,r,n,o){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=o,this.has_stree=t&&t.length}var Jc,$c,tf;function Mi(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function ef(t){return t<256?Ur[t]:Ur[256+(t>>>7)]}function kr(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}function _t(t,e,r){t.bi_valid>Ri-r?(t.bi_buf|=e<<t.bi_valid&65535,kr(t,t.bi_buf),t.bi_buf=e>>Ri-t.bi_valid,t.bi_valid+=r-Ri):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function Gt(t,e,r){_t(t,r[e*2],r[e*2+1])}function rf(t,e){var r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1}function au(t){t.bi_valid===16?(kr(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}function cu(t,e){var r=e.dyn_tree,n=e.max_code,o=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,f=e.stat_desc.max_length,c,l,d,_,h,u,x=0;for(_=0;_<=Ee;_++)t.bl_count[_]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<qc;c++)l=t.heap[c],_=r[r[l*2+1]*2+1]+1,_>f&&(_=f,x++),r[l*2+1]=_,!(l>n)&&(t.bl_count[_]++,h=0,l>=a&&(h=s[l-a]),u=r[l*2],t.opt_len+=u*(_+h),i&&(t.static_len+=u*(o[l*2+1]+h)));if(x!==0){do{for(_=f-1;t.bl_count[_]===0;)_--;t.bl_count[_]--,t.bl_count[_+1]+=2,t.bl_count[f]--,x-=2}while(x>0);for(_=f;_!==0;_--)for(l=t.bl_count[_];l!==0;)d=t.heap[--c],!(d>n)&&(r[d*2+1]!==_&&(t.opt_len+=(_-r[d*2+1])*r[d*2],r[d*2+1]=_),l--)}}function nf(t,e,r){var n=new Array(Ee+1),o=0,i,s;for(i=1;i<=Ee;i++)n[i]=o=o+r[i-1]<<1;for(s=0;s<=e;s++){var a=t[s*2+1];a!==0&&(t[s*2]=rf(n[a]++,a))}}function fu(){var t,e,r,n,o,i=new Array(Ee+1);for(r=0,n=0;n<bi-1;n++)for(Di[n]=r,t=0;t<1<<wi[n];t++)Gr[r++]=n;for(Gr[r-1]=n,o=0,n=0;n<16;n++)for(Zn[n]=o,t=0;t<1<<qn[n];t++)Ur[o++]=n;for(o>>=7;n<Ze;n++)for(Zn[n]=o<<7,t=0;t<1<<qn[n]-7;t++)Ur[256+o++]=n;for(e=0;e<=Ee;e++)i[e]=0;for(t=0;t<=143;)Qt[t*2+1]=8,t++,i[8]++;for(;t<=255;)Qt[t*2+1]=9,t++,i[9]++;for(;t<=279;)Qt[t*2+1]=7,t++,i[7]++;for(;t<=287;)Qt[t*2+1]=8,t++,i[8]++;for(nf(Qt,Fr+1,i),t=0;t<Ze;t++)Nr[t*2+1]=5,Nr[t*2]=rf(t,5);Jc=new Ti(Qt,wi,zr+1,Fr,Ee),$c=new Ti(Nr,qn,0,Ze,Ee),tf=new Ti(new Array(0),iu,0,Ci,ou)}function of(t){var e;for(e=0;e<Fr;e++)t.dyn_ltree[e*2]=0;for(e=0;e<Ze;e++)t.dyn_dtree[e*2]=0;for(e=0;e<Ci;e++)t.bl_tree[e*2]=0;t.dyn_ltree[Bi*2]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function sf(t){t.bi_valid>8?kr(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function lu(t,e,r,n){sf(t),n&&(kr(t,r),kr(t,~r)),jd.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function zc(t,e,r,n){var o=e*2,i=r*2;return t[o]<t[i]||t[o]===t[i]&&n[e]<=n[r]}function yi(t,e,r){for(var n=t.heap[r],o=r<<1;o<=t.heap_len&&(o<t.heap_len&&zc(e,t.heap[o+1],t.heap[o],t.depth)&&o++,!zc(e,n,t.heap[o],t.depth));)t.heap[r]=t.heap[o],r=o,o<<=1;t.heap[r]=n}function Kc(t,e,r){var n,o,i=0,s,a;if(t.last_lit!==0)do n=t.pending_buf[t.d_buf+i*2]<<8|t.pending_buf[t.d_buf+i*2+1],o=t.pending_buf[t.l_buf+i],i++,n===0?Gt(t,o,e):(s=Gr[o],Gt(t,s+zr+1,e),a=wi[s],a!==0&&(o-=Di[s],_t(t,o,a)),n--,s=ef(n),Gt(t,s,r),a=qn[s],a!==0&&(n-=Zn[s],_t(t,n,a)));while(i<t.last_lit);Gt(t,Bi,e)}function Oi(t,e){var r=e.dyn_tree,n=e.stat_desc.static_tree,o=e.stat_desc.has_stree,i=e.stat_desc.elems,s,a,f=-1,c;for(t.heap_len=0,t.heap_max=qc,s=0;s<i;s++)r[s*2]!==0?(t.heap[++t.heap_len]=f=s,t.depth[s]=0):r[s*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=f<2?++f:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,o&&(t.static_len-=n[c*2+1]);for(e.max_code=f,s=t.heap_len>>1;s>=1;s--)yi(t,r,s);c=i;do s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],yi(t,r,1),a=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=a,r[c*2]=r[s*2]+r[a*2],t.depth[c]=(t.depth[s]>=t.depth[a]?t.depth[s]:t.depth[a])+1,r[s*2+1]=r[a*2+1]=c,t.heap[1]=c++,yi(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],cu(t,e),nf(r,f,t.bl_count)}function Hc(t,e,r){var n,o=-1,i,s=e[0*2+1],a=0,f=7,c=4;for(s===0&&(f=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)i=s,s=e[(n+1)*2+1],!(++a<f&&i===s)&&(a<c?t.bl_tree[i*2]+=a:i!==0?(i!==o&&t.bl_tree[i*2]++,t.bl_tree[Zc*2]++):a<=10?t.bl_tree[Qc*2]++:t.bl_tree[Yc*2]++,a=0,o=i,s===0?(f=138,c=3):i===s?(f=6,c=3):(f=7,c=4))}function Vc(t,e,r){var n,o=-1,i,s=e[0*2+1],a=0,f=7,c=4;for(s===0&&(f=138,c=3),n=0;n<=r;n++)if(i=s,s=e[(n+1)*2+1],!(++a<f&&i===s)){if(a<c)do Gt(t,i,t.bl_tree);while(--a!==0);else i!==0?(i!==o&&(Gt(t,i,t.bl_tree),a--),Gt(t,Zc,t.bl_tree),_t(t,a-3,2)):a<=10?(Gt(t,Qc,t.bl_tree),_t(t,a-3,3)):(Gt(t,Yc,t.bl_tree),_t(t,a-11,7));a=0,o=i,s===0?(f=138,c=3):i===s?(f=6,c=3):(f=7,c=4)}}function hu(t){var e;for(Hc(t,t.dyn_ltree,t.l_desc.max_code),Hc(t,t.dyn_dtree,t.d_desc.max_code),Oi(t,t.bl_desc),e=Ci-1;e>=3&&t.bl_tree[jc[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function _u(t,e,r,n){var o;for(_t(t,e-257,5),_t(t,r-1,5),_t(t,n-4,4),o=0;o<n;o++)_t(t,t.bl_tree[jc[o]*2+1],3);Vc(t,t.dyn_ltree,e-1),Vc(t,t.dyn_dtree,r-1)}function du(t){var e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return Gc;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return kc;for(r=32;r<zr;r++)if(t.dyn_ltree[r*2]!==0)return kc;return Gc}var Xc=!1;function uu(t){Xc||(fu(),Xc=!0),t.l_desc=new Mi(t.dyn_ltree,Jc),t.d_desc=new Mi(t.dyn_dtree,$c),t.bl_desc=new Mi(t.bl_tree,tf),t.bi_buf=0,t.bi_valid=0,of(t)}function af(t,e,r,n){_t(t,(tu<<1)+(n?1:0),3),lu(t,e,r,!0)}function pu(t){_t(t,Wc<<1,3),Gt(t,Bi,Qt),au(t)}function mu(t,e,r,n){var o,i,s=0;t.level>0?(t.strm.data_type===$d&&(t.strm.data_type=du(t)),Oi(t,t.l_desc),Oi(t,t.d_desc),s=hu(t),o=t.opt_len+3+7>>>3,i=t.static_len+3+7>>>3,i<=o&&(o=i)):o=i=r+5,r+4<=o&&e!==-1?af(t,e,r,n):t.strategy===Jd||i===o?(_t(t,(Wc<<1)+(n?1:0),3),Kc(t,Qt,Nr)):(_t(t,(eu<<1)+(n?1:0),3),_u(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),Kc(t,t.dyn_ltree,t.dyn_dtree)),of(t),n&&sf(t)}function xu(t,e,r){return t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(Gr[r]+zr+1)*2]++,t.dyn_dtree[ef(e)*2]++),t.last_lit===t.lit_bufsize-1}Ye._tr_init=uu;Ye._tr_stored_block=af;Ye._tr_flush_block=mu;Ye._tr_tally=xu;Ye._tr_align=pu});var Ii=tt((rT,ff)=>{"use strict";function Au(t,e,r,n){for(var o=t&65535|0,i=t>>>16&65535|0,s=0;r!==0;){s=r>2e3?2e3:r,r-=s;do o=o+e[n++]|0,i=i+o|0;while(--s);o%=65521,i%=65521}return o|i<<16|0}ff.exports=Au});var vi=tt((nT,lf)=>{"use strict";function gu(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e}var Eu=gu();function Su(t,e,r,n){var o=Eu,i=n+r;t^=-1;for(var s=n;s<i;s++)t=t>>>8^o[(t^e[s])&255];return t^-1}lf.exports=Su});var Qn=tt((oT,hf)=>{"use strict";hf.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Ef=tt(Kt=>{"use strict";var ft=Zt(),Rt=cf(),pf=Ii(),ae=vi(),Ru=Qn(),Me=0,Tu=1,Mu=3,_e=4,_f=5,zt=0,df=1,Tt=-2,yu=-3,Li=-5,wu=-1,Ou=1,Yn=2,bu=3,Cu=4,Bu=0,Du=2,to=8,Iu=9,vu=15,Lu=8,Pu=29,Nu=256,Ni=Nu+1+Pu,Fu=30,Uu=19,Gu=2*Ni+1,ku=15,k=3,le=258,wt=le+k+1,zu=32,eo=42,Fi=69,jn=73,Jn=91,$n=103,Se=113,Hr=666,$=1,Vr=2,Re=3,$e=4,Ku=3;function he(t,e){return t.msg=Ru[e],e}function uf(t){return(t<<1)-(t>4?9:0)}function fe(t){for(var e=t.length;--e>=0;)t[e]=0}function ce(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(ft.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))}function nt(t,e){Rt._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,ce(t.strm)}function K(t,e){t.pending_buf[t.pending++]=e}function Kr(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}function Hu(t,e,r,n){var o=t.avail_in;return o>n&&(o=n),o===0?0:(t.avail_in-=o,ft.arraySet(e,t.input,t.next_in,o,r),t.state.wrap===1?t.adler=pf(t.adler,e,o,r):t.state.wrap===2&&(t.adler=ae(t.adler,e,o,r)),t.next_in+=o,t.total_in+=o,o)}function mf(t,e){var r=t.max_chain_length,n=t.strstart,o,i,s=t.prev_length,a=t.nice_match,f=t.strstart>t.w_size-wt?t.strstart-(t.w_size-wt):0,c=t.window,l=t.w_mask,d=t.prev,_=t.strstart+le,h=c[n+s-1],u=c[n+s];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do if(o=e,!(c[o+s]!==u||c[o+s-1]!==h||c[o]!==c[n]||c[++o]!==c[n+1])){n+=2,o++;do;while(c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&n<_);if(i=le-(_-n),n=_-le,i>s){if(t.match_start=e,s=i,i>=a)break;h=c[n+s-1],u=c[n+s]}}while((e=d[e&l])>f&&--r!==0);return s<=t.lookahead?s:t.lookahead}function Te(t){var e=t.w_size,r,n,o,i,s;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-wt)){ft.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,n=t.hash_size,r=n;do o=t.head[--r],t.head[r]=o>=e?o-e:0;while(--n);n=e,r=n;do o=t.prev[--r],t.prev[r]=o>=e?o-e:0;while(--n);i+=e}if(t.strm.avail_in===0)break;if(n=Hu(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=n,t.lookahead+t.insert>=k)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+k-1])&t.hash_mask,t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<k)););}while(t.lookahead<wt&&t.strm.avail_in!==0)}function Vu(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Te(t),t.lookahead===0&&e===Me)return $;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((t.strstart===0||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,nt(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-wt&&(nt(t,!1),t.strm.avail_out===0))return $}return t.insert=0,e===_e?(nt(t,!0),t.strm.avail_out===0?Re:$e):(t.strstart>t.block_start&&(nt(t,!1),t.strm.avail_out===0),$)}function Pi(t,e){for(var r,n;;){if(t.lookahead<wt){if(Te(t),t.lookahead<wt&&e===Me)return $;if(t.lookahead===0)break}if(r=0,t.lookahead>=k&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+k-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-wt&&(t.match_length=mf(t,r)),t.match_length>=k)if(n=Rt._tr_tally(t,t.strstart-t.match_start,t.match_length-k),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=k){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+k-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=Rt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(nt(t,!1),t.strm.avail_out===0))return $}return t.insert=t.strstart<k-1?t.strstart:k-1,e===_e?(nt(t,!0),t.strm.avail_out===0?Re:$e):t.last_lit&&(nt(t,!1),t.strm.avail_out===0)?$:Vr}function je(t,e){for(var r,n,o;;){if(t.lookahead<wt){if(Te(t),t.lookahead<wt&&e===Me)return $;if(t.lookahead===0)break}if(r=0,t.lookahead>=k&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+k-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=k-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-wt&&(t.match_length=mf(t,r),t.match_length<=5&&(t.strategy===Ou||t.match_length===k&&t.strstart-t.match_start>4096)&&(t.match_length=k-1)),t.prev_length>=k&&t.match_length<=t.prev_length){o=t.strstart+t.lookahead-k,n=Rt._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-k),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=o&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+k-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=k-1,t.strstart++,n&&(nt(t,!1),t.strm.avail_out===0))return $}else if(t.match_available){if(n=Rt._tr_tally(t,0,t.window[t.strstart-1]),n&&nt(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return $}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Rt._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<k-1?t.strstart:k-1,e===_e?(nt(t,!0),t.strm.avail_out===0?Re:$e):t.last_lit&&(nt(t,!1),t.strm.avail_out===0)?$:Vr}function Xu(t,e){for(var r,n,o,i,s=t.window;;){if(t.lookahead<=le){if(Te(t),t.lookahead<=le&&e===Me)return $;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=k&&t.strstart>0&&(o=t.strstart-1,n=s[o],n===s[++o]&&n===s[++o]&&n===s[++o])){i=t.strstart+le;do;while(n===s[++o]&&n===s[++o]&&n===s[++o]&&n===s[++o]&&n===s[++o]&&n===s[++o]&&n===s[++o]&&n===s[++o]&&o<i);t.match_length=le-(i-o),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=k?(r=Rt._tr_tally(t,1,t.match_length-k),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Rt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(nt(t,!1),t.strm.avail_out===0))return $}return t.insert=0,e===_e?(nt(t,!0),t.strm.avail_out===0?Re:$e):t.last_lit&&(nt(t,!1),t.strm.avail_out===0)?$:Vr}function Wu(t,e){for(var r;;){if(t.lookahead===0&&(Te(t),t.lookahead===0)){if(e===Me)return $;break}if(t.match_length=0,r=Rt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(nt(t,!1),t.strm.avail_out===0))return $}return t.insert=0,e===_e?(nt(t,!0),t.strm.avail_out===0?Re:$e):t.last_lit&&(nt(t,!1),t.strm.avail_out===0)?$:Vr}function kt(t,e,r,n,o){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=o}var Je;Je=[new kt(0,0,0,0,Vu),new kt(4,4,8,4,Pi),new kt(4,5,16,8,Pi),new kt(4,6,32,32,Pi),new kt(4,4,16,16,je),new kt(8,16,32,32,je),new kt(8,16,128,128,je),new kt(8,32,128,256,je),new kt(32,128,258,1024,je),new kt(32,258,258,4096,je)];function qu(t){t.window_size=2*t.w_size,fe(t.head),t.max_lazy_match=Je[t.level].max_lazy,t.good_match=Je[t.level].good_length,t.nice_match=Je[t.level].nice_length,t.max_chain_length=Je[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=k-1,t.match_available=0,t.ins_h=0}function Zu(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=to,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new ft.Buf16(Gu*2),this.dyn_dtree=new ft.Buf16((2*Fu+1)*2),this.bl_tree=new ft.Buf16((2*Uu+1)*2),fe(this.dyn_ltree),fe(this.dyn_dtree),fe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new ft.Buf16(ku+1),this.heap=new ft.Buf16(2*Ni+1),fe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new ft.Buf16(2*Ni+1),fe(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function xf(t){var e;return!t||!t.state?he(t,Tt):(t.total_in=t.total_out=0,t.data_type=Du,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?eo:Se,t.adler=e.wrap===2?0:1,e.last_flush=Me,Rt._tr_init(e),zt)}function Af(t){var e=xf(t);return e===zt&&qu(t.state),e}function Qu(t,e){return!t||!t.state||t.state.wrap!==2?Tt:(t.state.gzhead=e,zt)}function gf(t,e,r,n,o,i){if(!t)return Tt;var s=1;if(e===wu&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),o<1||o>Iu||r!==to||n<8||n>15||e<0||e>9||i<0||i>Cu)return he(t,Tt);n===8&&(n=9);var a=new Zu;return t.state=a,a.strm=t,a.wrap=s,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=o+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+k-1)/k),a.window=new ft.Buf8(a.w_size*2),a.head=new ft.Buf16(a.hash_size),a.prev=new ft.Buf16(a.w_size),a.lit_bufsize=1<<o+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new ft.Buf8(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=(1+2)*a.lit_bufsize,a.level=e,a.strategy=i,a.method=r,Af(t)}function Yu(t,e){return gf(t,e,to,vu,Lu,Bu)}function ju(t,e){var r,n,o,i;if(!t||!t.state||e>_f||e<0)return t?he(t,Tt):Tt;if(n=t.state,!t.output||!t.input&&t.avail_in!==0||n.status===Hr&&e!==_e)return he(t,t.avail_out===0?Li:Tt);if(n.strm=t,r=n.last_flush,n.last_flush=e,n.status===eo)if(n.wrap===2)t.adler=0,K(n,31),K(n,139),K(n,8),n.gzhead?(K(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),K(n,n.gzhead.time&255),K(n,n.gzhead.time>>8&255),K(n,n.gzhead.time>>16&255),K(n,n.gzhead.time>>24&255),K(n,n.level===9?2:n.strategy>=Yn||n.level<2?4:0),K(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(K(n,n.gzhead.extra.length&255),K(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=ae(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Fi):(K(n,0),K(n,0),K(n,0),K(n,0),K(n,0),K(n,n.level===9?2:n.strategy>=Yn||n.level<2?4:0),K(n,Ku),n.status=Se);else{var s=to+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=Yn||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,s|=a<<6,n.strstart!==0&&(s|=zu),s+=31-s%31,n.status=Se,Kr(n,s),n.strstart!==0&&(Kr(n,t.adler>>>16),Kr(n,t.adler&65535)),t.adler=1}if(n.status===Fi)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=ae(t.adler,n.pending_buf,n.pending-o,o)),ce(t),o=n.pending,n.pending===n.pending_buf_size));)K(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=ae(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=jn)}else n.status=jn;if(n.status===jn)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=ae(t.adler,n.pending_buf,n.pending-o,o)),ce(t),o=n.pending,n.pending===n.pending_buf_size)){i=1;break}n.gzindex<n.gzhead.name.length?i=n.gzhead.name.charCodeAt(n.gzindex++)&255:i=0,K(n,i)}while(i!==0);n.gzhead.hcrc&&n.pending>o&&(t.adler=ae(t.adler,n.pending_buf,n.pending-o,o)),i===0&&(n.gzindex=0,n.status=Jn)}else n.status=Jn;if(n.status===Jn)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=ae(t.adler,n.pending_buf,n.pending-o,o)),ce(t),o=n.pending,n.pending===n.pending_buf_size)){i=1;break}n.gzindex<n.gzhead.comment.length?i=n.gzhead.comment.charCodeAt(n.gzindex++)&255:i=0,K(n,i)}while(i!==0);n.gzhead.hcrc&&n.pending>o&&(t.adler=ae(t.adler,n.pending_buf,n.pending-o,o)),i===0&&(n.status=$n)}else n.status=$n;if(n.status===$n&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&ce(t),n.pending+2<=n.pending_buf_size&&(K(n,t.adler&255),K(n,t.adler>>8&255),t.adler=0,n.status=Se)):n.status=Se),n.pending!==0){if(ce(t),t.avail_out===0)return n.last_flush=-1,zt}else if(t.avail_in===0&&uf(e)<=uf(r)&&e!==_e)return he(t,Li);if(n.status===Hr&&t.avail_in!==0)return he(t,Li);if(t.avail_in!==0||n.lookahead!==0||e!==Me&&n.status!==Hr){var f=n.strategy===Yn?Wu(n,e):n.strategy===bu?Xu(n,e):Je[n.level].func(n,e);if((f===Re||f===$e)&&(n.status=Hr),f===$||f===Re)return t.avail_out===0&&(n.last_flush=-1),zt;if(f===Vr&&(e===Tu?Rt._tr_align(n):e!==_f&&(Rt._tr_stored_block(n,0,0,!1),e===Mu&&(fe(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),ce(t),t.avail_out===0))return n.last_flush=-1,zt}return e!==_e?zt:n.wrap<=0?df:(n.wrap===2?(K(n,t.adler&255),K(n,t.adler>>8&255),K(n,t.adler>>16&255),K(n,t.adler>>24&255),K(n,t.total_in&255),K(n,t.total_in>>8&255),K(n,t.total_in>>16&255),K(n,t.total_in>>24&255)):(Kr(n,t.adler>>>16),Kr(n,t.adler&65535)),ce(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?zt:df)}function Ju(t){var e;return!t||!t.state?Tt:(e=t.state.status,e!==eo&&e!==Fi&&e!==jn&&e!==Jn&&e!==$n&&e!==Se&&e!==Hr?he(t,Tt):(t.state=null,e===Se?he(t,yu):zt))}function $u(t,e){var r=e.length,n,o,i,s,a,f,c,l;if(!t||!t.state||(n=t.state,s=n.wrap,s===2||s===1&&n.status!==eo||n.lookahead))return Tt;for(s===1&&(t.adler=pf(t.adler,e,r,0)),n.wrap=0,r>=n.w_size&&(s===0&&(fe(n.head),n.strstart=0,n.block_start=0,n.insert=0),l=new ft.Buf8(n.w_size),ft.arraySet(l,e,r-n.w_size,n.w_size,0),e=l,r=n.w_size),a=t.avail_in,f=t.next_in,c=t.input,t.avail_in=r,t.next_in=0,t.input=e,Te(n);n.lookahead>=k;){o=n.strstart,i=n.lookahead-(k-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[o+k-1])&n.hash_mask,n.prev[o&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=o,o++;while(--i);n.strstart=o,n.lookahead=k-1,Te(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=k-1,n.match_available=0,t.next_in=f,t.input=c,t.avail_in=a,n.wrap=s,zt}Kt.deflateInit=Yu;Kt.deflateInit2=gf;Kt.deflateReset=Af;Kt.deflateResetKeep=xf;Kt.deflateSetHeader=Qu;Kt.deflate=ju;Kt.deflateEnd=Ju;Kt.deflateSetDictionary=$u;Kt.deflateInfo="pako deflate (from Nodeca project)"});var Ui=tt(tr=>{"use strict";var ro=Zt(),Sf=!0,Rf=!0;try{String.fromCharCode.apply(null,[0])}catch{Sf=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Rf=!1}var Xr=new ro.Buf8(256);for(Yt=0;Yt<256;Yt++)Xr[Yt]=Yt>=252?6:Yt>=248?5:Yt>=240?4:Yt>=224?3:Yt>=192?2:1;var Yt;Xr[254]=Xr[254]=1;tr.string2buf=function(t){var e,r,n,o,i,s=t.length,a=0;for(o=0;o<s;o++)r=t.charCodeAt(o),(r&64512)===55296&&o+1<s&&(n=t.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(e=new ro.Buf8(a),i=0,o=0;i<a;o++)r=t.charCodeAt(o),(r&64512)===55296&&o+1<s&&(n=t.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),r<128?e[i++]=r:r<2048?(e[i++]=192|r>>>6,e[i++]=128|r&63):r<65536?(e[i++]=224|r>>>12,e[i++]=128|r>>>6&63,e[i++]=128|r&63):(e[i++]=240|r>>>18,e[i++]=128|r>>>12&63,e[i++]=128|r>>>6&63,e[i++]=128|r&63);return e};function Tf(t,e){if(e<65534&&(t.subarray&&Rf||!t.subarray&&Sf))return String.fromCharCode.apply(null,ro.shrinkBuf(t,e));for(var r="",n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r}tr.buf2binstring=function(t){return Tf(t,t.length)};tr.binstring2buf=function(t){for(var e=new ro.Buf8(t.length),r=0,n=e.length;r<n;r++)e[r]=t.charCodeAt(r);return e};tr.buf2string=function(t,e){var r,n,o,i,s=e||t.length,a=new Array(s*2);for(n=0,r=0;r<s;){if(o=t[r++],o<128){a[n++]=o;continue}if(i=Xr[o],i>4){a[n++]=65533,r+=i-1;continue}for(o&=i===2?31:i===3?15:7;i>1&&r<s;)o=o<<6|t[r++]&63,i--;if(i>1){a[n++]=65533;continue}o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|o&1023)}return Tf(a,n)};tr.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+Xr[t[r]]>e?r:e}});var Gi=tt((aT,Mf)=>{"use strict";function tp(){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}Mf.exports=tp});var bf=tt(Zr=>{"use strict";var Wr=Ef(),qr=Zt(),zi=Ui(),Ki=Qn(),ep=Gi(),Of=Object.prototype.toString,rp=0,ki=4,er=0,yf=1,wf=2,np=-1,op=0,ip=8;function ye(t){if(!(this instanceof ye))return new ye(t);this.options=qr.assign({level:np,method:ip,chunkSize:16384,windowBits:15,memLevel:8,strategy:op,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ep,this.strm.avail_out=0;var r=Wr.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==er)throw new Error(Ki[r]);if(e.header&&Wr.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(typeof e.dictionary=="string"?n=zi.string2buf(e.dictionary):Of.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=Wr.deflateSetDictionary(this.strm,n),r!==er)throw new Error(Ki[r]);this._dict_set=!0}}ye.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,o,i;if(this.ended)return!1;i=e===~~e?e:e===!0?ki:rp,typeof t=="string"?r.input=zi.string2buf(t):Of.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new qr.Buf8(n),r.next_out=0,r.avail_out=n),o=Wr.deflate(r,i),o!==yf&&o!==er)return this.onEnd(o),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(i===ki||i===wf))&&(this.options.to==="string"?this.onData(zi.buf2binstring(qr.shrinkBuf(r.output,r.next_out))):this.onData(qr.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&o!==yf);return i===ki?(o=Wr.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===er):(i===wf&&(this.onEnd(er),r.avail_out=0),!0)};ye.prototype.onData=function(t){this.chunks.push(t)};ye.prototype.onEnd=function(t){t===er&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=qr.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Hi(t,e){var r=new ye(e);if(r.push(t,!0),r.err)throw r.msg||Ki[r.err];return r.result}function sp(t,e){return e=e||{},e.raw=!0,Hi(t,e)}function ap(t,e){return e=e||{},e.gzip=!0,Hi(t,e)}Zr.Deflate=ye;Zr.deflate=Hi;Zr.deflateRaw=sp;Zr.gzip=ap});var Bf=tt((fT,Cf)=>{"use strict";var no=30,cp=12;Cf.exports=function(e,r){var n,o,i,s,a,f,c,l,d,_,h,u,x,p,S,y,B,T,R,D,I,L,A,m,g;n=e.state,o=e.next_in,m=e.input,i=o+(e.avail_in-5),s=e.next_out,g=e.output,a=s-(r-e.avail_out),f=s+(e.avail_out-257),c=n.dmax,l=n.wsize,d=n.whave,_=n.wnext,h=n.window,u=n.hold,x=n.bits,p=n.lencode,S=n.distcode,y=(1<<n.lenbits)-1,B=(1<<n.distbits)-1;t:do{x<15&&(u+=m[o++]<<x,x+=8,u+=m[o++]<<x,x+=8),T=p[u&y];e:for(;;){if(R=T>>>24,u>>>=R,x-=R,R=T>>>16&255,R===0)g[s++]=T&65535;else if(R&16){D=T&65535,R&=15,R&&(x<R&&(u+=m[o++]<<x,x+=8),D+=u&(1<<R)-1,u>>>=R,x-=R),x<15&&(u+=m[o++]<<x,x+=8,u+=m[o++]<<x,x+=8),T=S[u&B];r:for(;;){if(R=T>>>24,u>>>=R,x-=R,R=T>>>16&255,R&16){if(I=T&65535,R&=15,x<R&&(u+=m[o++]<<x,x+=8,x<R&&(u+=m[o++]<<x,x+=8)),I+=u&(1<<R)-1,I>c){e.msg="invalid distance too far back",n.mode=no;break t}if(u>>>=R,x-=R,R=s-a,I>R){if(R=I-R,R>d&&n.sane){e.msg="invalid distance too far back",n.mode=no;break t}if(L=0,A=h,_===0){if(L+=l-R,R<D){D-=R;do g[s++]=h[L++];while(--R);L=s-I,A=g}}else if(_<R){if(L+=l+_-R,R-=_,R<D){D-=R;do g[s++]=h[L++];while(--R);if(L=0,_<D){R=_,D-=R;do g[s++]=h[L++];while(--R);L=s-I,A=g}}}else if(L+=_-R,R<D){D-=R;do g[s++]=h[L++];while(--R);L=s-I,A=g}for(;D>2;)g[s++]=A[L++],g[s++]=A[L++],g[s++]=A[L++],D-=3;D&&(g[s++]=A[L++],D>1&&(g[s++]=A[L++]))}else{L=s-I;do g[s++]=g[L++],g[s++]=g[L++],g[s++]=g[L++],D-=3;while(D>2);D&&(g[s++]=g[L++],D>1&&(g[s++]=g[L++]))}}else if(R&64){e.msg="invalid distance code",n.mode=no;break t}else{T=S[(T&65535)+(u&(1<<R)-1)];continue r}break}}else if(R&64)if(R&32){n.mode=cp;break t}else{e.msg="invalid literal/length code",n.mode=no;break t}else{T=p[(T&65535)+(u&(1<<R)-1)];continue e}break}}while(o<i&&s<f);D=x>>3,o-=D,x-=D<<3,u&=(1<<x)-1,e.next_in=o,e.next_out=s,e.avail_in=o<i?5+(i-o):5-(o-i),e.avail_out=s<f?257+(f-s):257-(s-f),n.hold=u,n.bits=x}});var Ff=tt((lT,Nf)=>{"use strict";var Df=Zt(),rr=15,If=852,vf=592,Lf=0,Vi=1,Pf=2,fp=[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],lp=[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],hp=[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],_p=[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];Nf.exports=function(e,r,n,o,i,s,a,f){var c=f.bits,l=0,d=0,_=0,h=0,u=0,x=0,p=0,S=0,y=0,B=0,T,R,D,I,L,A=null,m=0,g,E=new Df.Buf16(rr+1),U=new Df.Buf16(rr+1),F=null,G=0,P,J,ot;for(l=0;l<=rr;l++)E[l]=0;for(d=0;d<o;d++)E[r[n+d]]++;for(u=c,h=rr;h>=1&&E[h]===0;h--);if(u>h&&(u=h),h===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,f.bits=1,0;for(_=1;_<h&&E[_]===0;_++);for(u<_&&(u=_),S=1,l=1;l<=rr;l++)if(S<<=1,S-=E[l],S<0)return-1;if(S>0&&(e===Lf||h!==1))return-1;for(U[1]=0,l=1;l<rr;l++)U[l+1]=U[l]+E[l];for(d=0;d<o;d++)r[n+d]!==0&&(a[U[r[n+d]]++]=d);if(e===Lf?(A=F=a,g=19):e===Vi?(A=fp,m-=257,F=lp,G-=257,g=256):(A=hp,F=_p,g=-1),B=0,d=0,l=_,L=s,x=u,p=0,D=-1,y=1<<u,I=y-1,e===Vi&&y>If||e===Pf&&y>vf)return 1;for(;;){P=l-p,a[d]<g?(J=0,ot=a[d]):a[d]>g?(J=F[G+a[d]],ot=A[m+a[d]]):(J=32+64,ot=0),T=1<<l-p,R=1<<x,_=R;do R-=T,i[L+(B>>p)+R]=P<<24|J<<16|ot|0;while(R!==0);for(T=1<<l-1;B&T;)T>>=1;if(T!==0?(B&=T-1,B+=T):B=0,d++,--E[l]===0){if(l===h)break;l=r[n+a[d]]}if(l>u&&(B&I)!==D){for(p===0&&(p=u),L+=_,x=l-p,S=1<<x;x+p<h&&(S-=E[x+p],!(S<=0));)x++,S<<=1;if(y+=1<<x,e===Vi&&y>If||e===Pf&&y>vf)return 1;D=B&I,i[D]=u<<24|x<<16|L-s|0}}return B!==0&&(i[L+B]=l-p<<24|64<<16|0),f.bits=u,0}});var Al=tt(Ot=>{"use strict";var xt=Zt(),Yi=Ii(),Ht=vi(),dp=Bf(),Qr=Ff(),up=0,fl=1,ll=2,Uf=4,pp=5,oo=6,we=0,mp=1,xp=2,Mt=-2,hl=-3,ji=-4,Ap=-5,Gf=8,_l=1,kf=2,zf=3,Kf=4,Hf=5,Vf=6,Xf=7,Wf=8,qf=9,Zf=10,ao=11,jt=12,Xi=13,Qf=14,Wi=15,Yf=16,jf=17,Jf=18,$f=19,io=20,so=21,tl=22,el=23,rl=24,nl=25,ol=26,qi=27,il=28,sl=29,Z=30,Ji=31,gp=32,Ep=852,Sp=592,Rp=15,Tp=Rp;function al(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function Mp(){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 xt.Buf16(320),this.work=new xt.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function dl(t){var e;return!t||!t.state?Mt:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=_l,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new xt.Buf32(Ep),e.distcode=e.distdyn=new xt.Buf32(Sp),e.sane=1,e.back=-1,we)}function ul(t){var e;return!t||!t.state?Mt:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,dl(t))}function pl(t,e){var r,n;return!t||!t.state||(n=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?Mt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,ul(t))}function ml(t,e){var r,n;return t?(n=new Mp,t.state=n,n.window=null,r=pl(t,e),r!==we&&(t.state=null),r):Mt}function yp(t){return ml(t,Tp)}var cl=!0,Zi,Qi;function wp(t){if(cl){var e;for(Zi=new xt.Buf32(512),Qi=new xt.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Qr(fl,t.lens,0,288,Zi,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Qr(ll,t.lens,0,32,Qi,0,t.work,{bits:5}),cl=!1}t.lencode=Zi,t.lenbits=9,t.distcode=Qi,t.distbits=5}function xl(t,e,r,n){var o,i=t.state;return i.window===null&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new xt.Buf8(i.wsize)),n>=i.wsize?(xt.arraySet(i.window,e,r-i.wsize,i.wsize,0),i.wnext=0,i.whave=i.wsize):(o=i.wsize-i.wnext,o>n&&(o=n),xt.arraySet(i.window,e,r-n,o,i.wnext),n-=o,n?(xt.arraySet(i.window,e,r-n,n,0),i.wnext=n,i.whave=i.wsize):(i.wnext+=o,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=o))),0}function Op(t,e){var r,n,o,i,s,a,f,c,l,d,_,h,u,x,p=0,S,y,B,T,R,D,I,L,A=new xt.Buf8(4),m,g,E=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&t.avail_in!==0)return Mt;r=t.state,r.mode===jt&&(r.mode=Xi),s=t.next_out,o=t.output,f=t.avail_out,i=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,d=a,_=f,L=we;t:for(;;)switch(r.mode){case _l:if(r.wrap===0){r.mode=Xi;break}for(;l<16;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if(r.wrap&2&&c===35615){r.check=0,A[0]=c&255,A[1]=c>>>8&255,r.check=Ht(r.check,A,2,0),c=0,l=0,r.mode=kf;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=Z;break}if((c&15)!==Gf){t.msg="unknown compression method",r.mode=Z;break}if(c>>>=4,l-=4,I=(c&15)+8,r.wbits===0)r.wbits=I;else if(I>r.wbits){t.msg="invalid window size",r.mode=Z;break}r.dmax=1<<I,t.adler=r.check=1,r.mode=c&512?Zf:jt,c=0,l=0;break;case kf:for(;l<16;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==Gf){t.msg="unknown compression method",r.mode=Z;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=Z;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(A[0]=c&255,A[1]=c>>>8&255,r.check=Ht(r.check,A,2,0)),c=0,l=0,r.mode=zf;case zf:for(;l<32;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&(A[0]=c&255,A[1]=c>>>8&255,A[2]=c>>>16&255,A[3]=c>>>24&255,r.check=Ht(r.check,A,4,0)),c=0,l=0,r.mode=Kf;case Kf:for(;l<16;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(A[0]=c&255,A[1]=c>>>8&255,r.check=Ht(r.check,A,2,0)),c=0,l=0,r.mode=Hf;case Hf:if(r.flags&1024){for(;l<16;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(A[0]=c&255,A[1]=c>>>8&255,r.check=Ht(r.check,A,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=Vf;case Vf:if(r.flags&1024&&(h=r.length,h>a&&(h=a),h&&(r.head&&(I=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),xt.arraySet(r.head.extra,n,i,h,I)),r.flags&512&&(r.check=Ht(r.check,n,h,i)),a-=h,i+=h,r.length-=h),r.length))break t;r.length=0,r.mode=Xf;case Xf:if(r.flags&2048){if(a===0)break t;h=0;do I=n[i+h++],r.head&&I&&r.length<65536&&(r.head.name+=String.fromCharCode(I));while(I&&h<a);if(r.flags&512&&(r.check=Ht(r.check,n,h,i)),a-=h,i+=h,I)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=Wf;case Wf:if(r.flags&4096){if(a===0)break t;h=0;do I=n[i+h++],r.head&&I&&r.length<65536&&(r.head.comment+=String.fromCharCode(I));while(I&&h<a);if(r.flags&512&&(r.check=Ht(r.check,n,h,i)),a-=h,i+=h,I)break t}else r.head&&(r.head.comment=null);r.mode=qf;case qf:if(r.flags&512){for(;l<16;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if(c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=Z;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=jt;break;case Zf:for(;l<32;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}t.adler=r.check=al(c),c=0,l=0,r.mode=ao;case ao:if(r.havedict===0)return t.next_out=s,t.avail_out=f,t.next_in=i,t.avail_in=a,r.hold=c,r.bits=l,xp;t.adler=r.check=1,r.mode=jt;case jt:if(e===pp||e===oo)break t;case Xi:if(r.last){c>>>=l&7,l-=l&7,r.mode=qi;break}for(;l<3;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=Qf;break;case 1:if(wp(r),r.mode=io,e===oo){c>>>=2,l-=2;break t}break;case 2:r.mode=jf;break;case 3:t.msg="invalid block type",r.mode=Z}c>>>=2,l-=2;break;case Qf:for(c>>>=l&7,l-=l&7;l<32;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=Z;break}if(r.length=c&65535,c=0,l=0,r.mode=Wi,e===oo)break t;case Wi:r.mode=Yf;case Yf:if(h=r.length,h){if(h>a&&(h=a),h>f&&(h=f),h===0)break t;xt.arraySet(o,n,i,h,s),a-=h,i+=h,f-=h,s+=h,r.length-=h;break}r.mode=jt;break;case jf:for(;l<14;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=Z;break}r.have=0,r.mode=Jf;case Jf:for(;r.have<r.ncode;){for(;l<3;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}r.lens[E[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[E[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,m={bits:r.lenbits},L=Qr(up,r.lens,0,19,r.lencode,0,r.work,m),r.lenbits=m.bits,L){t.msg="invalid code lengths set",r.mode=Z;break}r.have=0,r.mode=$f;case $f:for(;r.have<r.nlen+r.ndist;){for(;p=r.lencode[c&(1<<r.lenbits)-1],S=p>>>24,y=p>>>16&255,B=p&65535,!(S<=l);){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if(B<16)c>>>=S,l-=S,r.lens[r.have++]=B;else{if(B===16){for(g=S+2;l<g;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if(c>>>=S,l-=S,r.have===0){t.msg="invalid bit length repeat",r.mode=Z;break}I=r.lens[r.have-1],h=3+(c&3),c>>>=2,l-=2}else if(B===17){for(g=S+3;l<g;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}c>>>=S,l-=S,I=0,h=3+(c&7),c>>>=3,l-=3}else{for(g=S+7;l<g;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}c>>>=S,l-=S,I=0,h=11+(c&127),c>>>=7,l-=7}if(r.have+h>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=Z;break}for(;h--;)r.lens[r.have++]=I}}if(r.mode===Z)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=Z;break}if(r.lenbits=9,m={bits:r.lenbits},L=Qr(fl,r.lens,0,r.nlen,r.lencode,0,r.work,m),r.lenbits=m.bits,L){t.msg="invalid literal/lengths set",r.mode=Z;break}if(r.distbits=6,r.distcode=r.distdyn,m={bits:r.distbits},L=Qr(ll,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,m),r.distbits=m.bits,L){t.msg="invalid distances set",r.mode=Z;break}if(r.mode=io,e===oo)break t;case io:r.mode=so;case so:if(a>=6&&f>=258){t.next_out=s,t.avail_out=f,t.next_in=i,t.avail_in=a,r.hold=c,r.bits=l,dp(t,_),s=t.next_out,o=t.output,f=t.avail_out,i=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,r.mode===jt&&(r.back=-1);break}for(r.back=0;p=r.lencode[c&(1<<r.lenbits)-1],S=p>>>24,y=p>>>16&255,B=p&65535,!(S<=l);){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if(y&&!(y&240)){for(T=S,R=y,D=B;p=r.lencode[D+((c&(1<<T+R)-1)>>T)],S=p>>>24,y=p>>>16&255,B=p&65535,!(T+S<=l);){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}c>>>=T,l-=T,r.back+=T}if(c>>>=S,l-=S,r.back+=S,r.length=B,y===0){r.mode=ol;break}if(y&32){r.back=-1,r.mode=jt;break}if(y&64){t.msg="invalid literal/length code",r.mode=Z;break}r.extra=y&15,r.mode=tl;case tl:if(r.extra){for(g=r.extra;l<g;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=el;case el:for(;p=r.distcode[c&(1<<r.distbits)-1],S=p>>>24,y=p>>>16&255,B=p&65535,!(S<=l);){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if(!(y&240)){for(T=S,R=y,D=B;p=r.distcode[D+((c&(1<<T+R)-1)>>T)],S=p>>>24,y=p>>>16&255,B=p&65535,!(T+S<=l);){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}c>>>=T,l-=T,r.back+=T}if(c>>>=S,l-=S,r.back+=S,y&64){t.msg="invalid distance code",r.mode=Z;break}r.offset=B,r.extra=y&15,r.mode=rl;case rl:if(r.extra){for(g=r.extra;l<g;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=Z;break}r.mode=nl;case nl:if(f===0)break t;if(h=_-f,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=Z;break}h>r.wnext?(h-=r.wnext,u=r.wsize-h):u=r.wnext-h,h>r.length&&(h=r.length),x=r.window}else x=o,u=s-r.offset,h=r.length;h>f&&(h=f),f-=h,r.length-=h;do o[s++]=x[u++];while(--h);r.length===0&&(r.mode=so);break;case ol:if(f===0)break t;o[s++]=r.length,f--,r.mode=so;break;case qi:if(r.wrap){for(;l<32;){if(a===0)break t;a--,c|=n[i++]<<l,l+=8}if(_-=f,t.total_out+=_,r.total+=_,_&&(t.adler=r.check=r.flags?Ht(r.check,o,_,s-_):Yi(r.check,o,_,s-_)),_=f,(r.flags?c:al(c))!==r.check){t.msg="incorrect data check",r.mode=Z;break}c=0,l=0}r.mode=il;case il:if(r.wrap&&r.flags){for(;l<32;){if(a===0)break t;a--,c+=n[i++]<<l,l+=8}if(c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=Z;break}c=0,l=0}r.mode=sl;case sl:L=mp;break t;case Z:L=hl;break t;case Ji:return ji;case gp:default:return Mt}return t.next_out=s,t.avail_out=f,t.next_in=i,t.avail_in=a,r.hold=c,r.bits=l,(r.wsize||_!==t.avail_out&&r.mode<Z&&(r.mode<qi||e!==Uf))&&xl(t,t.output,t.next_out,_-t.avail_out)?(r.mode=Ji,ji):(d-=t.avail_in,_-=t.avail_out,t.total_in+=d,t.total_out+=_,r.total+=_,r.wrap&&_&&(t.adler=r.check=r.flags?Ht(r.check,o,_,t.next_out-_):Yi(r.check,o,_,t.next_out-_)),t.data_type=r.bits+(r.last?64:0)+(r.mode===jt?128:0)+(r.mode===io||r.mode===Wi?256:0),(d===0&&_===0||e===Uf)&&L===we&&(L=Ap),L)}function bp(t){if(!t||!t.state)return Mt;var e=t.state;return e.window&&(e.window=null),t.state=null,we}function Cp(t,e){var r;return!t||!t.state||(r=t.state,!(r.wrap&2))?Mt:(r.head=e,e.done=!1,we)}function Bp(t,e){var r=e.length,n,o,i;return!t||!t.state||(n=t.state,n.wrap!==0&&n.mode!==ao)?Mt:n.mode===ao&&(o=1,o=Yi(o,e,r,0),o!==n.check)?hl:(i=xl(t,e,r,r),i?(n.mode=Ji,ji):(n.havedict=1,we))}Ot.inflateReset=ul;Ot.inflateReset2=pl;Ot.inflateResetKeep=dl;Ot.inflateInit=yp;Ot.inflateInit2=ml;Ot.inflate=Op;Ot.inflateEnd=bp;Ot.inflateGetHeader=Cp;Ot.inflateSetDictionary=Bp;Ot.inflateInfo="pako inflate (from Nodeca project)"});var $i=tt((_T,gl)=>{"use strict";gl.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var Sl=tt((dT,El)=>{"use strict";function Dp(){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}El.exports=Dp});var Tl=tt(jr=>{"use strict";var nr=Al(),Yr=Zt(),co=Ui(),Y=$i(),ts=Qn(),Ip=Gi(),vp=Sl(),Rl=Object.prototype.toString;function Oe(t){if(!(this instanceof Oe))return new Oe(t);this.options=Yr.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ip,this.strm.avail_out=0;var r=nr.inflateInit2(this.strm,e.windowBits);if(r!==Y.Z_OK)throw new Error(ts[r]);if(this.header=new vp,nr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=co.string2buf(e.dictionary):Rl.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=nr.inflateSetDictionary(this.strm,e.dictionary),r!==Y.Z_OK)))throw new Error(ts[r])}Oe.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,o=this.options.dictionary,i,s,a,f,c,l=!1;if(this.ended)return!1;s=e===~~e?e:e===!0?Y.Z_FINISH:Y.Z_NO_FLUSH,typeof t=="string"?r.input=co.binstring2buf(t):Rl.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Yr.Buf8(n),r.next_out=0,r.avail_out=n),i=nr.inflate(r,Y.Z_NO_FLUSH),i===Y.Z_NEED_DICT&&o&&(i=nr.inflateSetDictionary(this.strm,o)),i===Y.Z_BUF_ERROR&&l===!0&&(i=Y.Z_OK,l=!1),i!==Y.Z_STREAM_END&&i!==Y.Z_OK)return this.onEnd(i),this.ended=!0,!1;r.next_out&&(r.avail_out===0||i===Y.Z_STREAM_END||r.avail_in===0&&(s===Y.Z_FINISH||s===Y.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=co.utf8border(r.output,r.next_out),f=r.next_out-a,c=co.buf2string(r.output,a),r.next_out=f,r.avail_out=n-f,f&&Yr.arraySet(r.output,r.output,a,f,0),this.onData(c)):this.onData(Yr.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(l=!0)}while((r.avail_in>0||r.avail_out===0)&&i!==Y.Z_STREAM_END);return i===Y.Z_STREAM_END&&(s=Y.Z_FINISH),s===Y.Z_FINISH?(i=nr.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Y.Z_OK):(s===Y.Z_SYNC_FLUSH&&(this.onEnd(Y.Z_OK),r.avail_out=0),!0)};Oe.prototype.onData=function(t){this.chunks.push(t)};Oe.prototype.onEnd=function(t){t===Y.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Yr.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function es(t,e){var r=new Oe(e);if(r.push(t,!0),r.err)throw r.msg||ts[r.err];return r.result}function Lp(t,e){return e=e||{},e.raw=!0,es(t,e)}jr.Inflate=Oe;jr.inflate=es;jr.inflateRaw=Lp;jr.ungzip=es});var wl=tt((pT,yl)=>{"use strict";var Pp=Zt().assign,Np=bf(),Fp=Tl(),Up=$i(),Ml={};Pp(Ml,Np,Fp,Up);yl.exports=Ml});var Ol=tt(()=>{});var en={};an(en,{ArcGISWebSceneLoader:()=>kl,COORDINATE_SYSTEM:()=>Pt,I3SAttributeLoader:()=>$r,I3SBuildingSceneLayerLoader:()=>Nl,I3SContentLoader:()=>Un,I3SLoader:()=>Ir,I3SNodePageLoader:()=>Kn,LayerError:()=>tn,SLPKArchive:()=>or,SLPKLoader:()=>bl,customizeColors:()=>Hl,loadFeatureAttributes:()=>vl,parseSLPKArchive:()=>lo});cn(en,Bt(Vt(),1));var jl={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Jl={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},de={...jl,...Jl};async function uo(t,e,r,n){return n._parse(t,e,r,n)}function $t(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var Dt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},$l=Dt.self||Dt.window||Dt.global||{},t0=Dt.window||Dt.self||Dt.global||{},e0=Dt.global||Dt.self||Dt.window||{},r0=Dt.document||{};var At=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var ls=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),n0=ls&&parseFloat(ls[1])||0;function te(t){return te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},te(t)}function po(t,e){if(te(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(te(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mo(t){var e=po(t,"string");return te(e)==="symbol"?e:String(e)}function V(t,e,r){return e=mo(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sr(t){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,t)}function xo(t){return globalThis.loaders?.modules?.[t]||null}function o0(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.0-alpha.4"),globalThis._loadersgl_.version}var hs=o0();function _s(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var It={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Lm=It.self||It.window||It.global||{},Pm=It.window||It.self||It.global||{},Nm=It.global||It.self||It.window||{},Fm=It.document||{};var Ie=typeof process!="object"||String(process)!=="[object process]"||process.browser,fn=typeof importScripts=="function",Um=typeof window<"u"&&typeof window.orientation<"u",ds=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Gm=ds&&parseFloat(ds[1])||0;var Ao={};async function vt(t,e=null,r={},n=null){return e&&(t=us(t,e,r,n)),Ao[t]=Ao[t]||i0(t),await Ao[t]}function us(t,e,r={},n=null){if(!r.useLocalLibraries&&t.startsWith("http"))return t;n=n||t;let o=r.modules||{};return o[n]?o[n]:Ie?r.CDN?(_s(r.CDN.startsWith("http")),`${r.CDN}/${e}@${hs}/dist/libs/${n}`):fn?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}async function i0(t){if(t.endsWith("wasm"))return await a0(t);if(!Ie)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(t)}catch(r){return console.error(r),null}if(fn)return importScripts(t);let e=await c0(t);return s0(e,t)}function s0(t,e){if(!Ie){let{requireFromString:n}=globalThis.loaders||{};return n?.(t,e)}if(fn)return eval.call(globalThis,t),null;let r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch{r.text=t}return document.body.appendChild(r),null}async function a0(t){let{readFileAsArrayBuffer:e}=globalThis.loaders||{};return Ie||!e||t.startsWith("http")?await(await fetch(t)).arrayBuffer():await e(t)}async function c0(t){let{readFileAsText:e}=globalThis.loaders||{};return Ie||!e||t.startsWith("http")?await(await fetch(t)).text():await e(t)}function ee(t,e,r){if(r=r||t.byteLength,t.byteLength<r||e.byteLength<r)return!1;let n=new Uint8Array(t),o=new Uint8Array(e);for(let i=0;i<n.length;++i)if(n[i]!==o[i])return!1;return!0}function ve(...t){return ps(t)}function ps(t){let e=t.map(i=>i instanceof ArrayBuffer?new Uint8Array(i):i),r=e.reduce((i,s)=>i+s.byteLength,0),n=new Uint8Array(r),o=0;for(let i of e)n.set(i,o),o+=i.byteLength;return n.buffer}async function ar(t){let e=[];for await(let r of t)e.push(r);return ve(...e)}function ms(t){return t&&typeof t=="object"&&t.isBuffer}function Le(t){if(ms(t))return t;if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if(typeof t=="string"){let e=t;return new TextEncoder().encode(e).buffer}if(t&&typeof t=="object"&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function Pe(t){return e=>new Promise((r,n)=>t(e,(o,i)=>o?n(o):r(i)))}var cr=new Error("Not implemented"),ln=class{handle;size=0;bigsize=0n;url="";constructor(e,r,n){if(globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(e,r,n);throw At?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(e,r){throw cr}async write(e,r,n){throw cr}async stat(){throw cr}async truncate(e){throw cr}async append(e){throw cr}async close(){}};var go=t=>t?.getUint8&&t?.slice&&t?.length;var fr=class{file;constructor(e,r=!1){this.file=new ln(e,r?"a+":"r")}async truncate(e){await this.file.truncate(e)}async append(e){await this.file.append(e)}async destroy(){await this.file.close()}async getUint8(e){let r=await this.file.read(e,1),n=new Uint8Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint16(e){let r=await this.file.read(e,2),n=new Uint16Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint32(e){let r=await this.file.read(e,4),n=new Uint32Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getBigUint64(e){let r=await this.file.read(e,8),n=new BigInt64Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async slice(e,r){let n=r-e;if(n>Number.MAX_SAFE_INTEGER)throw new Error("too big slice");let o=Number(n);return await this.file.read(e,o)}get length(){return this.file.bigsize}};var Ne=t=>{if(t>Number.MAX_SAFE_INTEGER)throw new Error("Offset is out of bounds");return Number(t)},ue=class{file;constructor(e){this.file=e}async destroy(){}async getUint8(e){return this.file.getUint8(Ne(e))}async getUint16(e){return this.file.getUint16(Ne(e),!0)}async getUint32(e){return this.file.getUint32(Ne(e),!0)}async getBigUint64(e){return this.file.getBigUint64(Ne(e),!0)}async slice(e,r){return this.file.buffer.slice(Ne(e),Ne(r))}get length(){return BigInt(this.file.byteLength)}};var f0=1/Math.PI*180,l0=1/180*Math.PI,h0={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...h0}};var W=globalThis.mathgl.config;function Eo(t,{precision:e=W.precision}={}){return t=_0(t),"".concat(parseFloat(t.toPrecision(e)))}function Lt(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function So(t){return xs(t)}function Ro(t){return As(t)}function xs(t,e){return gs(t,r=>r*l0,e)}function As(t,e){return gs(t,r=>r*f0,e)}function dt(t,e,r){let n=W.EPSILON;r&&(W.EPSILON=r);try{if(t===e)return!0;if(Lt(t)&&Lt(e)){if(t.length!==e.length)return!1;for(let o=0;o<t.length;++o)if(!dt(t[o],e[o]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=W.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{W.EPSILON=n}}function _0(t){return Math.round(t/W.EPSILON)*W.EPSILON}function d0(t){return t.clone?t.clone():new Array(t.length)}function gs(t,e,r){if(Lt(t)){let n=t;r=r||d0(n);for(let o=0;o<r.length&&o<n.length;++o){let i=typeof t=="number"?t:t[o];r[o]=e(i,o,r)}return r}return e(t)}function u0(t){function e(){var r=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}var re=class extends u0(Array){clone(){return new this.constructor().copy(this)}fromArray(e,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+r];return this.check()}toArray(e=[],r=0){for(let n=0;n<this.ELEMENTS;++n)e[r+n]=this[n];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:Lt(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(W)}formatString(e){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+Eo(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!dt(this[r],e[r]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==e[r])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,r,n){if(n===void 0)return this.lerp(this,e,r);for(let o=0;o<this.ELEMENTS;++o){let i=e[o],s=typeof r=="number"?r:r[o];this[o]=i+n*(s-i)}return this.check()}min(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(e[r],this[r]);return this.check()}max(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(e[r],this[r]);return this.check()}clamp(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),r[n]);return this.check()}add(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(e){if(typeof e=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;else for(let r=0;r<this.ELEMENTS&&r<e.length;++r)this[r]*=e[r];return this.check()}multiplyByScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}check(){if(W.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let e=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)e=e&&Number.isFinite(this[r]);return e}sub(e){return this.subtract(e)}setScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=e;return this.check()}addScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}divideScalar(e){return this.multiplyByScalar(1/e)}clampScalar(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),r);return this.check()}get elements(){return this}};function p0(t,e){if(t.length!==e)return!1;for(let r=0;r<t.length;++r)if(!Number.isFinite(t[r]))return!1;return!0}function z(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(JSON.stringify(t)));return t}function ne(t,e,r=""){if(W.debug&&!p0(t,e))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return t}function et(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}var Fe=class extends re{get x(){return this[0]}set x(e){this[0]=z(e)}get y(){return this[1]}set y(e){this[1]=z(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*this[r];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let r=0;for(let n=0;n<this.ELEMENTS;++n){let o=this[n]-e[n];r+=o*o}return z(r)}dot(e){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*e[n];return z(r)}normalize(){let e=this.magnitude();if(e!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=e;return this.check()}multiply(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return et(e>=0&&e<this.ELEMENTS,"index is out of range"),z(this[e])}setComponent(e,r){return et(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=r,this.check()}addVectors(e,r){return this.copy(e).add(r)}subVectors(e,r){return this.copy(e).subtract(r)}multiplyVectors(e,r){return this.copy(e).multiply(r)}addScaledVector(e,r){return this.add(new this.constructor(e).multiplyScalar(r))}};var q=typeof Float32Array<"u"?Float32Array:Array,lr=Math.random;function Ue(t){return t>=0?Math.round(t):t%.5===0?Math.floor(t):Math.round(t)}var Fx=Math.PI/180;function m0(){let t=new q(2);return q!=Float32Array&&(t[0]=0,t[1]=0),t}function Es(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[3]*o+r[6],t[1]=r[1]*n+r[4]*o+r[7],t}function Ss(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[4]*o+r[12],t[1]=r[1]*n+r[5]*o+r[13],t}var Ux=function(){let t=m0();return function(e,r,n,o,i,s){let a,f;for(r||(r=2),n||(n=0),o?f=Math.min(o*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],i(t,t,s),e[a]=t[0],e[a+1]=t[1];return e}}();function Rs(t,e,r){let n=e[0],o=e[1],i=r[3]*n+r[7]*o||1;return t[0]=(r[0]*n+r[4]*o)/i,t[1]=(r[1]*n+r[5]*o)/i,t}function hn(t,e,r){let n=e[0],o=e[1],i=e[2],s=r[3]*n+r[7]*o+r[11]*i||1;return t[0]=(r[0]*n+r[4]*o+r[8]*i)/s,t[1]=(r[1]*n+r[5]*o+r[9]*i)/s,t[2]=(r[2]*n+r[6]*o+r[10]*i)/s,t}function Ts(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o,t[1]=r[1]*n+r[3]*o,t[2]=e[2],t}function Ms(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o,t[1]=r[1]*n+r[3]*o,t[2]=e[2],t[3]=e[3],t}function _n(t,e,r){let n=e[0],o=e[1],i=e[2];return t[0]=r[0]*n+r[3]*o+r[6]*i,t[1]=r[1]*n+r[4]*o+r[7]*i,t[2]=r[2]*n+r[5]*o+r[8]*i,t[3]=e[3],t}var ke={};an(ke,{add:()=>E0,angle:()=>Oo,bezier:()=>v0,ceil:()=>S0,clone:()=>x0,copy:()=>A0,create:()=>dn,cross:()=>pe,dist:()=>K0,distance:()=>Cs,div:()=>z0,divide:()=>bs,dot:()=>hr,equals:()=>U0,exactEquals:()=>F0,floor:()=>R0,forEach:()=>X0,fromValues:()=>un,hermite:()=>I0,inverse:()=>C0,len:()=>bo,length:()=>ys,lerp:()=>B0,max:()=>M0,min:()=>T0,mul:()=>k0,multiply:()=>Os,negate:()=>b0,normalize:()=>To,random:()=>L0,rotateX:()=>Mo,rotateY:()=>yo,rotateZ:()=>wo,round:()=>y0,scale:()=>w0,scaleAndAdd:()=>O0,set:()=>g0,slerp:()=>D0,sqrDist:()=>H0,sqrLen:()=>V0,squaredDistance:()=>Bs,squaredLength:()=>Ds,str:()=>N0,sub:()=>G0,subtract:()=>ws,transformMat3:()=>_r,transformMat4:()=>me,transformQuat:()=>dr,zero:()=>P0});function dn(){let t=new q(3);return q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function x0(t){let e=new q(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function ys(t){let e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function un(t,e,r){let n=new q(3);return n[0]=t,n[1]=e,n[2]=r,n}function A0(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function g0(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function E0(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function ws(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function Os(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function bs(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function S0(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function R0(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function T0(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function M0(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function y0(t,e){return t[0]=Ue(e[0]),t[1]=Ue(e[1]),t[2]=Ue(e[2]),t}function w0(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function O0(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function Cs(t,e){let r=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2];return Math.sqrt(r*r+n*n+o*o)}function Bs(t,e){let r=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2];return r*r+n*n+o*o}function Ds(t){let e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function b0(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function C0(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function To(t,e){let r=e[0],n=e[1],o=e[2],i=r*r+n*n+o*o;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function hr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function pe(t,e,r){let n=e[0],o=e[1],i=e[2],s=r[0],a=r[1],f=r[2];return t[0]=o*f-i*a,t[1]=i*s-n*f,t[2]=n*a-o*s,t}function B0(t,e,r,n){let o=e[0],i=e[1],s=e[2];return t[0]=o+n*(r[0]-o),t[1]=i+n*(r[1]-i),t[2]=s+n*(r[2]-s),t}function D0(t,e,r,n){let o=Math.acos(Math.min(Math.max(hr(e,r),-1),1)),i=Math.sin(o),s=Math.sin((1-n)*o)/i,a=Math.sin(n*o)/i;return t[0]=s*e[0]+a*r[0],t[1]=s*e[1]+a*r[1],t[2]=s*e[2]+a*r[2],t}function I0(t,e,r,n,o,i){let s=i*i,a=s*(2*i-3)+1,f=s*(i-2)+i,c=s*(i-1),l=s*(3-2*i);return t[0]=e[0]*a+r[0]*f+n[0]*c+o[0]*l,t[1]=e[1]*a+r[1]*f+n[1]*c+o[1]*l,t[2]=e[2]*a+r[2]*f+n[2]*c+o[2]*l,t}function v0(t,e,r,n,o,i){let s=1-i,a=s*s,f=i*i,c=a*s,l=3*i*a,d=3*f*s,_=f*i;return t[0]=e[0]*c+r[0]*l+n[0]*d+o[0]*_,t[1]=e[1]*c+r[1]*l+n[1]*d+o[1]*_,t[2]=e[2]*c+r[2]*l+n[2]*d+o[2]*_,t}function L0(t,e){e=e===void 0?1:e;let r=lr()*2*Math.PI,n=lr()*2-1,o=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*o,t[1]=Math.sin(r)*o,t[2]=n*e,t}function me(t,e,r){let n=e[0],o=e[1],i=e[2],s=r[3]*n+r[7]*o+r[11]*i+r[15];return s=s||1,t[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/s,t[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/s,t[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/s,t}function _r(t,e,r){let n=e[0],o=e[1],i=e[2];return t[0]=n*r[0]+o*r[3]+i*r[6],t[1]=n*r[1]+o*r[4]+i*r[7],t[2]=n*r[2]+o*r[5]+i*r[8],t}function dr(t,e,r){let n=r[0],o=r[1],i=r[2],s=r[3],a=e[0],f=e[1],c=e[2],l=o*c-i*f,d=i*a-n*c,_=n*f-o*a,h=o*_-i*d,u=i*l-n*_,x=n*d-o*l,p=s*2;return l*=p,d*=p,_*=p,h*=2,u*=2,x*=2,t[0]=a+l+h,t[1]=f+d+u,t[2]=c+_+x,t}function Mo(t,e,r,n){let o=[],i=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],i[0]=o[0],i[1]=o[1]*Math.cos(n)-o[2]*Math.sin(n),i[2]=o[1]*Math.sin(n)+o[2]*Math.cos(n),t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function yo(t,e,r,n){let o=[],i=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],i[0]=o[2]*Math.sin(n)+o[0]*Math.cos(n),i[1]=o[1],i[2]=o[2]*Math.cos(n)-o[0]*Math.sin(n),t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function wo(t,e,r,n){let o=[],i=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],i[0]=o[0]*Math.cos(n)-o[1]*Math.sin(n),i[1]=o[0]*Math.sin(n)+o[1]*Math.cos(n),i[2]=o[2],t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function Oo(t,e){let r=t[0],n=t[1],o=t[2],i=e[0],s=e[1],a=e[2],f=Math.sqrt((r*r+n*n+o*o)*(i*i+s*s+a*a)),c=f&&hr(t,e)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function P0(t){return t[0]=0,t[1]=0,t[2]=0,t}function N0(t){return"vec3(".concat(t[0],", ").concat(t[1],", ").concat(t[2],")")}function F0(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function U0(t,e){let r=t[0],n=t[1],o=t[2],i=e[0],s=e[1],a=e[2];return Math.abs(r-i)<=1e-6*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-s)<=1e-6*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(o-a)<=1e-6*Math.max(1,Math.abs(o),Math.abs(a))}var G0=ws,k0=Os,z0=bs,K0=Cs,H0=Bs,bo=ys,V0=Ds,X0=function(){let t=dn();return function(e,r,n,o,i,s){let a,f;for(r||(r=3),n||(n=0),o?f=Math.min(o*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],i(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}}();var Co=[0,0,0],pn,v=class extends Fe{static get ZERO(){return pn||(pn=new v(0,0,0),Object.freeze(pn)),pn}constructor(e=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Lt(e)?this.copy(e):(W.debug&&(z(e),z(r),z(n)),this[0]=e,this[1]=r,this[2]=n)}set(e,r,n){return this[0]=e,this[1]=r,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return W.debug&&(z(e.x),z(e.y),z(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=z(e)}angle(e){return Oo(this,e)}cross(e){return pe(this,this,e),this.check()}rotateX({radians:e,origin:r=Co}){return Mo(this,this,r,e),this.check()}rotateY({radians:e,origin:r=Co}){return yo(this,this,r,e),this.check()}rotateZ({radians:e,origin:r=Co}){return wo(this,this,r,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return me(this,this,e),this.check()}transformAsVector(e){return hn(this,this,e),this.check()}transformByMatrix3(e){return _r(this,this,e),this.check()}transformByMatrix2(e){return Ts(this,this,e),this.check()}transformByQuaternion(e){return dr(this,this,e),this.check()}};var mn,ze=class extends Fe{static get ZERO(){return mn||(mn=new ze(0,0,0,0),Object.freeze(mn)),mn}constructor(e=0,r=0,n=0,o=0){super(-0,-0,-0,-0),Lt(e)&&arguments.length===1?this.copy(e):(W.debug&&(z(e),z(r),z(n),z(o)),this[0]=e,this[1]=r,this[2]=n,this[3]=o)}set(e,r,n,o){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}fromObject(e){return W.debug&&(z(e.x),z(e.y),z(e.z),z(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}get ELEMENTS(){return 4}get z(){return this[2]}set z(e){this[2]=z(e)}get w(){return this[3]}set w(e){this[3]=z(e)}transform(e){return me(this,this,e),this.check()}transformByMatrix3(e){return _n(this,this,e),this.check()}transformByMatrix2(e){return Ms(this,this,e),this.check()}transformByQuaternion(e){return dr(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}};var Ke=class extends re{toString(){let e="[";if(W.printRowMajor){e+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)e+=" ".concat(this[n*this.RANK+r])}else{e+="column-major:";for(let r=0;r<this.ELEMENTS;++r)e+=" ".concat(this[r])}return e+="]",e}getElementIndex(e,r){return r*this.RANK+e}getElement(e,r){return this[r*this.RANK+e]}setElement(e,r,n){return this[r*this.RANK+e]=z(n),this}getColumn(e,r=new Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let o=0;o<this.RANK;++o)r[o]=this[n+o];return r}setColumn(e,r){let n=e*this.RANK;for(let o=0;o<this.RANK;++o)this[n+o]=r[o];return this}};function Is(){let t=new q(9);return q!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function vs(t,e){if(t===e){let r=e[1],n=e[2],o=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=o}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Ls(t,e){let r=e[0],n=e[1],o=e[2],i=e[3],s=e[4],a=e[5],f=e[6],c=e[7],l=e[8],d=l*s-a*c,_=-l*i+a*f,h=c*i-s*f,u=r*d+n*_+o*h;return u?(u=1/u,t[0]=d*u,t[1]=(-l*n+o*c)*u,t[2]=(a*n-o*s)*u,t[3]=_*u,t[4]=(l*r-o*f)*u,t[5]=(-a*r+o*i)*u,t[6]=h*u,t[7]=(-c*r+n*f)*u,t[8]=(s*r-n*i)*u,t):null}function Ps(t){let e=t[0],r=t[1],n=t[2],o=t[3],i=t[4],s=t[5],a=t[6],f=t[7],c=t[8];return e*(c*i-s*f)+r*(-c*o+s*a)+n*(f*o-i*a)}function Bo(t,e,r){let n=e[0],o=e[1],i=e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=e[8],_=r[0],h=r[1],u=r[2],x=r[3],p=r[4],S=r[5],y=r[6],B=r[7],T=r[8];return t[0]=_*n+h*s+u*c,t[1]=_*o+h*a+u*l,t[2]=_*i+h*f+u*d,t[3]=x*n+p*s+S*c,t[4]=x*o+p*a+S*l,t[5]=x*i+p*f+S*d,t[6]=y*n+B*s+T*c,t[7]=y*o+B*a+T*l,t[8]=y*i+B*f+T*d,t}function Ns(t,e,r){let n=e[0],o=e[1],i=e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=e[8],_=r[0],h=r[1];return t[0]=n,t[1]=o,t[2]=i,t[3]=s,t[4]=a,t[5]=f,t[6]=_*n+h*s+c,t[7]=_*o+h*a+l,t[8]=_*i+h*f+d,t}function Fs(t,e,r){let n=e[0],o=e[1],i=e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=e[8],_=Math.sin(r),h=Math.cos(r);return t[0]=h*n+_*s,t[1]=h*o+_*a,t[2]=h*i+_*f,t[3]=h*s-_*n,t[4]=h*a-_*o,t[5]=h*f-_*i,t[6]=c,t[7]=l,t[8]=d,t}function Do(t,e,r){let n=r[0],o=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=o*e[3],t[4]=o*e[4],t[5]=o*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Us(t,e){let r=e[0],n=e[1],o=e[2],i=e[3],s=r+r,a=n+n,f=o+o,c=r*s,l=n*s,d=n*a,_=o*s,h=o*a,u=o*f,x=i*s,p=i*a,S=i*f;return t[0]=1-d-u,t[3]=l-S,t[6]=_+p,t[1]=l+S,t[4]=1-c-u,t[7]=h-x,t[2]=_-p,t[5]=h+x,t[8]=1-c-d,t}var Io;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL1ROW0=3]="COL1ROW0",t[t.COL1ROW1=4]="COL1ROW1",t[t.COL1ROW2=5]="COL1ROW2",t[t.COL2ROW0=6]="COL2ROW0",t[t.COL2ROW1=7]="COL2ROW1",t[t.COL2ROW2=8]="COL2ROW2"})(Io||(Io={}));var q0=Object.freeze([1,0,0,0,1,0,0,0,1]),j=class extends Ke{static get IDENTITY(){return Q0()}static get ZERO(){return Z0()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return Io}constructor(e,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):r.length>0?this.copy([e,...r]):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(q0)}fromObject(e){return this.check()}fromQuaternion(e){return Us(this,e),this.check()}set(e,r,n,o,i,s,a,f,c){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this[4]=i,this[5]=s,this[6]=a,this[7]=f,this[8]=c,this.check()}setRowMajor(e,r,n,o,i,s,a,f,c){return this[0]=e,this[1]=o,this[2]=a,this[3]=r,this[4]=i,this[5]=f,this[6]=n,this[7]=s,this[8]=c,this.check()}determinant(){return Ps(this)}transpose(){return vs(this,this),this.check()}invert(){return Ls(this,this),this.check()}multiplyLeft(e){return Bo(this,e,this),this.check()}multiplyRight(e){return Bo(this,this,e),this.check()}rotate(e){return Fs(this,this,e),this.check()}scale(e){return Array.isArray(e)?Do(this,this,e):Do(this,this,[e,e]),this.check()}translate(e){return Ns(this,this,e),this.check()}transform(e,r){let n;switch(e.length){case 2:n=Es(r||[-0,-0],e,this);break;case 3:n=_r(r||[-0,-0,-0],e,this);break;case 4:n=_n(r||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return ne(n,e.length),n}transformVector(e,r){return this.transform(e,r)}transformVector2(e,r){return this.transform(e,r)}transformVector3(e,r){return this.transform(e,r)}},xn,An=null;function Z0(){return xn||(xn=new j([0,0,0,0,0,0,0,0,0]),Object.freeze(xn)),xn}function Q0(){return An||(An=new j,Object.freeze(An)),An}var gn={};an(gn,{add:()=>Eh,adjoint:()=>eh,clone:()=>j0,copy:()=>J0,create:()=>Y0,decompose:()=>hh,determinant:()=>Po,equals:()=>Mh,exactEquals:()=>Th,frob:()=>gh,fromQuat:()=>Ko,fromQuat2:()=>ch,fromRotation:()=>oh,fromRotationTranslation:()=>ks,fromRotationTranslationScale:()=>_h,fromRotationTranslationScaleOrigin:()=>dh,fromScaling:()=>nh,fromTranslation:()=>rh,fromValues:()=>$0,fromXRotation:()=>ih,fromYRotation:()=>sh,fromZRotation:()=>ah,frustum:()=>Ho,getRotation:()=>lh,getScaling:()=>zs,getTranslation:()=>fh,identity:()=>Gs,invert:()=>Lo,lookAt:()=>Wo,mul:()=>yh,multiply:()=>ur,multiplyScalar:()=>Sh,multiplyScalarAndAdd:()=>Rh,ortho:()=>Xo,orthoNO:()=>Hs,orthoZO:()=>mh,perspective:()=>Vo,perspectiveFromFieldOfView:()=>ph,perspectiveNO:()=>Ks,perspectiveZO:()=>uh,rotate:()=>Uo,rotateX:()=>Go,rotateY:()=>ko,rotateZ:()=>zo,scale:()=>Fo,set:()=>th,str:()=>Ah,sub:()=>wh,subtract:()=>Vs,targetTo:()=>xh,translate:()=>No,transpose:()=>vo});function Y0(){let t=new q(16);return q!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function j0(t){let e=new q(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function J0(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function $0(t,e,r,n,o,i,s,a,f,c,l,d,_,h,u,x){let p=new q(16);return p[0]=t,p[1]=e,p[2]=r,p[3]=n,p[4]=o,p[5]=i,p[6]=s,p[7]=a,p[8]=f,p[9]=c,p[10]=l,p[11]=d,p[12]=_,p[13]=h,p[14]=u,p[15]=x,p}function th(t,e,r,n,o,i,s,a,f,c,l,d,_,h,u,x,p){return t[0]=e,t[1]=r,t[2]=n,t[3]=o,t[4]=i,t[5]=s,t[6]=a,t[7]=f,t[8]=c,t[9]=l,t[10]=d,t[11]=_,t[12]=h,t[13]=u,t[14]=x,t[15]=p,t}function Gs(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function vo(t,e){if(t===e){let r=e[1],n=e[2],o=e[3],i=e[6],s=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[11]=e[14],t[12]=o,t[13]=s,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function Lo(t,e){let r=e[0],n=e[1],o=e[2],i=e[3],s=e[4],a=e[5],f=e[6],c=e[7],l=e[8],d=e[9],_=e[10],h=e[11],u=e[12],x=e[13],p=e[14],S=e[15],y=r*a-n*s,B=r*f-o*s,T=r*c-i*s,R=n*f-o*a,D=n*c-i*a,I=o*c-i*f,L=l*x-d*u,A=l*p-_*u,m=l*S-h*u,g=d*p-_*x,E=d*S-h*x,U=_*S-h*p,F=y*U-B*E+T*g+R*m-D*A+I*L;return F?(F=1/F,t[0]=(a*U-f*E+c*g)*F,t[1]=(o*E-n*U-i*g)*F,t[2]=(x*I-p*D+S*R)*F,t[3]=(_*D-d*I-h*R)*F,t[4]=(f*m-s*U-c*A)*F,t[5]=(r*U-o*m+i*A)*F,t[6]=(p*T-u*I-S*B)*F,t[7]=(l*I-_*T+h*B)*F,t[8]=(s*E-a*m+c*L)*F,t[9]=(n*m-r*E-i*L)*F,t[10]=(u*D-x*T+S*y)*F,t[11]=(d*T-l*D-h*y)*F,t[12]=(a*A-s*g-f*L)*F,t[13]=(r*g-n*A+o*L)*F,t[14]=(x*B-u*R-p*y)*F,t[15]=(l*R-d*B+_*y)*F,t):null}function eh(t,e){let r=e[0],n=e[1],o=e[2],i=e[3],s=e[4],a=e[5],f=e[6],c=e[7],l=e[8],d=e[9],_=e[10],h=e[11],u=e[12],x=e[13],p=e[14],S=e[15],y=r*a-n*s,B=r*f-o*s,T=r*c-i*s,R=n*f-o*a,D=n*c-i*a,I=o*c-i*f,L=l*x-d*u,A=l*p-_*u,m=l*S-h*u,g=d*p-_*x,E=d*S-h*x,U=_*S-h*p;return t[0]=a*U-f*E+c*g,t[1]=o*E-n*U-i*g,t[2]=x*I-p*D+S*R,t[3]=_*D-d*I-h*R,t[4]=f*m-s*U-c*A,t[5]=r*U-o*m+i*A,t[6]=p*T-u*I-S*B,t[7]=l*I-_*T+h*B,t[8]=s*E-a*m+c*L,t[9]=n*m-r*E-i*L,t[10]=u*D-x*T+S*y,t[11]=d*T-l*D-h*y,t[12]=a*A-s*g-f*L,t[13]=r*g-n*A+o*L,t[14]=x*B-u*R-p*y,t[15]=l*R-d*B+_*y,t}function Po(t){let e=t[0],r=t[1],n=t[2],o=t[3],i=t[4],s=t[5],a=t[6],f=t[7],c=t[8],l=t[9],d=t[10],_=t[11],h=t[12],u=t[13],x=t[14],p=t[15],S=e*s-r*i,y=e*a-n*i,B=r*a-n*s,T=c*u-l*h,R=c*x-d*h,D=l*x-d*u,I=e*D-r*R+n*T,L=i*D-s*R+a*T,A=c*B-l*y+d*S,m=h*B-u*y+x*S;return f*I-o*L+p*A-_*m}function ur(t,e,r){let n=e[0],o=e[1],i=e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=e[8],_=e[9],h=e[10],u=e[11],x=e[12],p=e[13],S=e[14],y=e[15],B=r[0],T=r[1],R=r[2],D=r[3];return t[0]=B*n+T*a+R*d+D*x,t[1]=B*o+T*f+R*_+D*p,t[2]=B*i+T*c+R*h+D*S,t[3]=B*s+T*l+R*u+D*y,B=r[4],T=r[5],R=r[6],D=r[7],t[4]=B*n+T*a+R*d+D*x,t[5]=B*o+T*f+R*_+D*p,t[6]=B*i+T*c+R*h+D*S,t[7]=B*s+T*l+R*u+D*y,B=r[8],T=r[9],R=r[10],D=r[11],t[8]=B*n+T*a+R*d+D*x,t[9]=B*o+T*f+R*_+D*p,t[10]=B*i+T*c+R*h+D*S,t[11]=B*s+T*l+R*u+D*y,B=r[12],T=r[13],R=r[14],D=r[15],t[12]=B*n+T*a+R*d+D*x,t[13]=B*o+T*f+R*_+D*p,t[14]=B*i+T*c+R*h+D*S,t[15]=B*s+T*l+R*u+D*y,t}function No(t,e,r){let n=r[0],o=r[1],i=r[2],s,a,f,c,l,d,_,h,u,x,p,S;return e===t?(t[12]=e[0]*n+e[4]*o+e[8]*i+e[12],t[13]=e[1]*n+e[5]*o+e[9]*i+e[13],t[14]=e[2]*n+e[6]*o+e[10]*i+e[14],t[15]=e[3]*n+e[7]*o+e[11]*i+e[15]):(s=e[0],a=e[1],f=e[2],c=e[3],l=e[4],d=e[5],_=e[6],h=e[7],u=e[8],x=e[9],p=e[10],S=e[11],t[0]=s,t[1]=a,t[2]=f,t[3]=c,t[4]=l,t[5]=d,t[6]=_,t[7]=h,t[8]=u,t[9]=x,t[10]=p,t[11]=S,t[12]=s*n+l*o+u*i+e[12],t[13]=a*n+d*o+x*i+e[13],t[14]=f*n+_*o+p*i+e[14],t[15]=c*n+h*o+S*i+e[15]),t}function Fo(t,e,r){let n=r[0],o=r[1],i=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*o,t[5]=e[5]*o,t[6]=e[6]*o,t[7]=e[7]*o,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Uo(t,e,r,n){let o=n[0],i=n[1],s=n[2],a=Math.sqrt(o*o+i*i+s*s),f,c,l,d,_,h,u,x,p,S,y,B,T,R,D,I,L,A,m,g,E,U,F,G;return a<1e-6?null:(a=1/a,o*=a,i*=a,s*=a,c=Math.sin(r),f=Math.cos(r),l=1-f,d=e[0],_=e[1],h=e[2],u=e[3],x=e[4],p=e[5],S=e[6],y=e[7],B=e[8],T=e[9],R=e[10],D=e[11],I=o*o*l+f,L=i*o*l+s*c,A=s*o*l-i*c,m=o*i*l-s*c,g=i*i*l+f,E=s*i*l+o*c,U=o*s*l+i*c,F=i*s*l-o*c,G=s*s*l+f,t[0]=d*I+x*L+B*A,t[1]=_*I+p*L+T*A,t[2]=h*I+S*L+R*A,t[3]=u*I+y*L+D*A,t[4]=d*m+x*g+B*E,t[5]=_*m+p*g+T*E,t[6]=h*m+S*g+R*E,t[7]=u*m+y*g+D*E,t[8]=d*U+x*F+B*G,t[9]=_*U+p*F+T*G,t[10]=h*U+S*F+R*G,t[11]=u*U+y*F+D*G,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function Go(t,e,r){let n=Math.sin(r),o=Math.cos(r),i=e[4],s=e[5],a=e[6],f=e[7],c=e[8],l=e[9],d=e[10],_=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=i*o+c*n,t[5]=s*o+l*n,t[6]=a*o+d*n,t[7]=f*o+_*n,t[8]=c*o-i*n,t[9]=l*o-s*n,t[10]=d*o-a*n,t[11]=_*o-f*n,t}function ko(t,e,r){let n=Math.sin(r),o=Math.cos(r),i=e[0],s=e[1],a=e[2],f=e[3],c=e[8],l=e[9],d=e[10],_=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*o-c*n,t[1]=s*o-l*n,t[2]=a*o-d*n,t[3]=f*o-_*n,t[8]=i*n+c*o,t[9]=s*n+l*o,t[10]=a*n+d*o,t[11]=f*n+_*o,t}function zo(t,e,r){let n=Math.sin(r),o=Math.cos(r),i=e[0],s=e[1],a=e[2],f=e[3],c=e[4],l=e[5],d=e[6],_=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*o+c*n,t[1]=s*o+l*n,t[2]=a*o+d*n,t[3]=f*o+_*n,t[4]=c*o-i*n,t[5]=l*o-s*n,t[6]=d*o-a*n,t[7]=_*o-f*n,t}function rh(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function nh(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function oh(t,e,r){let n=r[0],o=r[1],i=r[2],s=Math.sqrt(n*n+o*o+i*i),a,f,c;return s<1e-6?null:(s=1/s,n*=s,o*=s,i*=s,f=Math.sin(e),a=Math.cos(e),c=1-a,t[0]=n*n*c+a,t[1]=o*n*c+i*f,t[2]=i*n*c-o*f,t[3]=0,t[4]=n*o*c-i*f,t[5]=o*o*c+a,t[6]=i*o*c+n*f,t[7]=0,t[8]=n*i*c+o*f,t[9]=o*i*c-n*f,t[10]=i*i*c+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function ih(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function sh(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ah(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ks(t,e,r){let n=e[0],o=e[1],i=e[2],s=e[3],a=n+n,f=o+o,c=i+i,l=n*a,d=n*f,_=n*c,h=o*f,u=o*c,x=i*c,p=s*a,S=s*f,y=s*c;return t[0]=1-(h+x),t[1]=d+y,t[2]=_-S,t[3]=0,t[4]=d-y,t[5]=1-(l+x),t[6]=u+p,t[7]=0,t[8]=_+S,t[9]=u-p,t[10]=1-(l+h),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function ch(t,e){let r=new q(3),n=-e[0],o=-e[1],i=-e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=n*n+o*o+i*i+s*s;return d>0?(r[0]=(a*s+l*n+f*i-c*o)*2/d,r[1]=(f*s+l*o+c*n-a*i)*2/d,r[2]=(c*s+l*i+a*o-f*n)*2/d):(r[0]=(a*s+l*n+f*i-c*o)*2,r[1]=(f*s+l*o+c*n-a*i)*2,r[2]=(c*s+l*i+a*o-f*n)*2),ks(t,e,r),t}function fh(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function zs(t,e){let r=e[0],n=e[1],o=e[2],i=e[4],s=e[5],a=e[6],f=e[8],c=e[9],l=e[10];return t[0]=Math.sqrt(r*r+n*n+o*o),t[1]=Math.sqrt(i*i+s*s+a*a),t[2]=Math.sqrt(f*f+c*c+l*l),t}function lh(t,e){let r=new q(3);zs(r,e);let n=1/r[0],o=1/r[1],i=1/r[2],s=e[0]*n,a=e[1]*o,f=e[2]*i,c=e[4]*n,l=e[5]*o,d=e[6]*i,_=e[8]*n,h=e[9]*o,u=e[10]*i,x=s+l+u,p=0;return x>0?(p=Math.sqrt(x+1)*2,t[3]=.25*p,t[0]=(d-h)/p,t[1]=(_-f)/p,t[2]=(a-c)/p):s>l&&s>u?(p=Math.sqrt(1+s-l-u)*2,t[3]=(d-h)/p,t[0]=.25*p,t[1]=(a+c)/p,t[2]=(_+f)/p):l>u?(p=Math.sqrt(1+l-s-u)*2,t[3]=(_-f)/p,t[0]=(a+c)/p,t[1]=.25*p,t[2]=(d+h)/p):(p=Math.sqrt(1+u-s-l)*2,t[3]=(a-c)/p,t[0]=(_+f)/p,t[1]=(d+h)/p,t[2]=.25*p),t}function hh(t,e,r,n){e[0]=n[12],e[1]=n[13],e[2]=n[14];let o=n[0],i=n[1],s=n[2],a=n[4],f=n[5],c=n[6],l=n[8],d=n[9],_=n[10];r[0]=Math.sqrt(o*o+i*i+s*s),r[1]=Math.sqrt(a*a+f*f+c*c),r[2]=Math.sqrt(l*l+d*d+_*_);let h=1/r[0],u=1/r[1],x=1/r[2],p=o*h,S=i*u,y=s*x,B=a*h,T=f*u,R=c*x,D=l*h,I=d*u,L=_*x,A=p+T+L,m=0;return A>0?(m=Math.sqrt(A+1)*2,t[3]=.25*m,t[0]=(R-I)/m,t[1]=(D-y)/m,t[2]=(S-B)/m):p>T&&p>L?(m=Math.sqrt(1+p-T-L)*2,t[3]=(R-I)/m,t[0]=.25*m,t[1]=(S+B)/m,t[2]=(D+y)/m):T>L?(m=Math.sqrt(1+T-p-L)*2,t[3]=(D-y)/m,t[0]=(S+B)/m,t[1]=.25*m,t[2]=(R+I)/m):(m=Math.sqrt(1+L-p-T)*2,t[3]=(S-B)/m,t[0]=(D+y)/m,t[1]=(R+I)/m,t[2]=.25*m),t}function _h(t,e,r,n){let o=e[0],i=e[1],s=e[2],a=e[3],f=o+o,c=i+i,l=s+s,d=o*f,_=o*c,h=o*l,u=i*c,x=i*l,p=s*l,S=a*f,y=a*c,B=a*l,T=n[0],R=n[1],D=n[2];return t[0]=(1-(u+p))*T,t[1]=(_+B)*T,t[2]=(h-y)*T,t[3]=0,t[4]=(_-B)*R,t[5]=(1-(d+p))*R,t[6]=(x+S)*R,t[7]=0,t[8]=(h+y)*D,t[9]=(x-S)*D,t[10]=(1-(d+u))*D,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function dh(t,e,r,n,o){let i=e[0],s=e[1],a=e[2],f=e[3],c=i+i,l=s+s,d=a+a,_=i*c,h=i*l,u=i*d,x=s*l,p=s*d,S=a*d,y=f*c,B=f*l,T=f*d,R=n[0],D=n[1],I=n[2],L=o[0],A=o[1],m=o[2],g=(1-(x+S))*R,E=(h+T)*R,U=(u-B)*R,F=(h-T)*D,G=(1-(_+S))*D,P=(p+y)*D,J=(u+B)*I,ot=(p-y)*I,X=(1-(_+x))*I;return t[0]=g,t[1]=E,t[2]=U,t[3]=0,t[4]=F,t[5]=G,t[6]=P,t[7]=0,t[8]=J,t[9]=ot,t[10]=X,t[11]=0,t[12]=r[0]+L-(g*L+F*A+J*m),t[13]=r[1]+A-(E*L+G*A+ot*m),t[14]=r[2]+m-(U*L+P*A+X*m),t[15]=1,t}function Ko(t,e){let r=e[0],n=e[1],o=e[2],i=e[3],s=r+r,a=n+n,f=o+o,c=r*s,l=n*s,d=n*a,_=o*s,h=o*a,u=o*f,x=i*s,p=i*a,S=i*f;return t[0]=1-d-u,t[1]=l+S,t[2]=_-p,t[3]=0,t[4]=l-S,t[5]=1-c-u,t[6]=h+x,t[7]=0,t[8]=_+p,t[9]=h-x,t[10]=1-c-d,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ho(t,e,r,n,o,i,s){let a=1/(r-e),f=1/(o-n),c=1/(i-s);return t[0]=i*2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i*2*f,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(o+n)*f,t[10]=(s+i)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*i*2*c,t[15]=0,t}function Ks(t,e,r,n,o){let i=1/Math.tan(e/2);if(t[0]=i/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,o!=null&&o!==1/0){let s=1/(n-o);t[10]=(o+n)*s,t[14]=2*o*n*s}else t[10]=-1,t[14]=-2*n;return t}var Vo=Ks;function uh(t,e,r,n,o){let i=1/Math.tan(e/2);if(t[0]=i/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,o!=null&&o!==1/0){let s=1/(n-o);t[10]=o*s,t[14]=o*n*s}else t[10]=-1,t[14]=-n;return t}function ph(t,e,r,n){let o=Math.tan(e.upDegrees*Math.PI/180),i=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),f=2/(s+a),c=2/(o+i);return t[0]=f,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-((s-a)*f*.5),t[9]=(o-i)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function Hs(t,e,r,n,o,i,s){let a=1/(e-r),f=1/(n-o),c=1/(i-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*f,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*a,t[13]=(o+n)*f,t[14]=(s+i)*c,t[15]=1,t}var Xo=Hs;function mh(t,e,r,n,o,i,s){let a=1/(e-r),f=1/(n-o),c=1/(i-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*f,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+r)*a,t[13]=(o+n)*f,t[14]=i*c,t[15]=1,t}function Wo(t,e,r,n){let o,i,s,a,f,c,l,d,_,h,u=e[0],x=e[1],p=e[2],S=n[0],y=n[1],B=n[2],T=r[0],R=r[1],D=r[2];return Math.abs(u-T)<1e-6&&Math.abs(x-R)<1e-6&&Math.abs(p-D)<1e-6?Gs(t):(d=u-T,_=x-R,h=p-D,o=1/Math.sqrt(d*d+_*_+h*h),d*=o,_*=o,h*=o,i=y*h-B*_,s=B*d-S*h,a=S*_-y*d,o=Math.sqrt(i*i+s*s+a*a),o?(o=1/o,i*=o,s*=o,a*=o):(i=0,s=0,a=0),f=_*a-h*s,c=h*i-d*a,l=d*s-_*i,o=Math.sqrt(f*f+c*c+l*l),o?(o=1/o,f*=o,c*=o,l*=o):(f=0,c=0,l=0),t[0]=i,t[1]=f,t[2]=d,t[3]=0,t[4]=s,t[5]=c,t[6]=_,t[7]=0,t[8]=a,t[9]=l,t[10]=h,t[11]=0,t[12]=-(i*u+s*x+a*p),t[13]=-(f*u+c*x+l*p),t[14]=-(d*u+_*x+h*p),t[15]=1,t)}function xh(t,e,r,n){let o=e[0],i=e[1],s=e[2],a=n[0],f=n[1],c=n[2],l=o-r[0],d=i-r[1],_=s-r[2],h=l*l+d*d+_*_;h>0&&(h=1/Math.sqrt(h),l*=h,d*=h,_*=h);let u=f*_-c*d,x=c*l-a*_,p=a*d-f*l;return h=u*u+x*x+p*p,h>0&&(h=1/Math.sqrt(h),u*=h,x*=h,p*=h),t[0]=u,t[1]=x,t[2]=p,t[3]=0,t[4]=d*p-_*x,t[5]=_*u-l*p,t[6]=l*x-d*u,t[7]=0,t[8]=l,t[9]=d,t[10]=_,t[11]=0,t[12]=o,t[13]=i,t[14]=s,t[15]=1,t}function Ah(t){return"mat4(".concat(t[0],", ").concat(t[1],", ").concat(t[2],", ").concat(t[3],", ").concat(t[4],", ").concat(t[5],", ").concat(t[6],", ").concat(t[7],", ").concat(t[8],", ").concat(t[9],", ").concat(t[10],", ").concat(t[11],", ").concat(t[12],", ").concat(t[13],", ").concat(t[14],", ").concat(t[15],")")}function gh(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3]+t[4]*t[4]+t[5]*t[5]+t[6]*t[6]+t[7]*t[7]+t[8]*t[8]+t[9]*t[9]+t[10]*t[10]+t[11]*t[11]+t[12]*t[12]+t[13]*t[13]+t[14]*t[14]+t[15]*t[15])}function Eh(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Vs(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Sh(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function Rh(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function Th(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function Mh(t,e){let r=t[0],n=t[1],o=t[2],i=t[3],s=t[4],a=t[5],f=t[6],c=t[7],l=t[8],d=t[9],_=t[10],h=t[11],u=t[12],x=t[13],p=t[14],S=t[15],y=e[0],B=e[1],T=e[2],R=e[3],D=e[4],I=e[5],L=e[6],A=e[7],m=e[8],g=e[9],E=e[10],U=e[11],F=e[12],G=e[13],P=e[14],J=e[15];return Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-B)<=1e-6*Math.max(1,Math.abs(n),Math.abs(B))&&Math.abs(o-T)<=1e-6*Math.max(1,Math.abs(o),Math.abs(T))&&Math.abs(i-R)<=1e-6*Math.max(1,Math.abs(i),Math.abs(R))&&Math.abs(s-D)<=1e-6*Math.max(1,Math.abs(s),Math.abs(D))&&Math.abs(a-I)<=1e-6*Math.max(1,Math.abs(a),Math.abs(I))&&Math.abs(f-L)<=1e-6*Math.max(1,Math.abs(f),Math.abs(L))&&Math.abs(c-A)<=1e-6*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(l-m)<=1e-6*Math.max(1,Math.abs(l),Math.abs(m))&&Math.abs(d-g)<=1e-6*Math.max(1,Math.abs(d),Math.abs(g))&&Math.abs(_-E)<=1e-6*Math.max(1,Math.abs(_),Math.abs(E))&&Math.abs(h-U)<=1e-6*Math.max(1,Math.abs(h),Math.abs(U))&&Math.abs(u-F)<=1e-6*Math.max(1,Math.abs(u),Math.abs(F))&&Math.abs(x-G)<=1e-6*Math.max(1,Math.abs(x),Math.abs(G))&&Math.abs(p-P)<=1e-6*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(S-J)<=1e-6*Math.max(1,Math.abs(S),Math.abs(J))}var yh=ur,wh=Vs;function Oh(){let t=new q(4);return q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Xs(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function Ws(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function qs(t){let e=t[0],r=t[1],n=t[2],o=t[3];return Math.sqrt(e*e+r*r+n*n+o*o)}function Zs(t){let e=t[0],r=t[1],n=t[2],o=t[3];return e*e+r*r+n*n+o*o}function Qs(t,e){let r=e[0],n=e[1],o=e[2],i=e[3],s=r*r+n*n+o*o+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=r*s,t[1]=n*s,t[2]=o*s,t[3]=i*s,t}function Ys(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function js(t,e,r,n){let o=e[0],i=e[1],s=e[2],a=e[3];return t[0]=o+n*(r[0]-o),t[1]=i+n*(r[1]-i),t[2]=s+n*(r[2]-s),t[3]=a+n*(r[3]-a),t}function Js(t,e,r){let n=e[0],o=e[1],i=e[2],s=e[3];return t[0]=r[0]*n+r[4]*o+r[8]*i+r[12]*s,t[1]=r[1]*n+r[5]*o+r[9]*i+r[13]*s,t[2]=r[2]*n+r[6]*o+r[10]*i+r[14]*s,t[3]=r[3]*n+r[7]*o+r[11]*i+r[15]*s,t}function $s(t,e,r){let n=e[0],o=e[1],i=e[2],s=r[0],a=r[1],f=r[2],c=r[3],l=c*n+a*i-f*o,d=c*o+f*n-s*i,_=c*i+s*o-a*n,h=-s*n-a*o-f*i;return t[0]=l*c+h*-s+d*-f-_*-a,t[1]=d*c+h*-a+_*-s-l*-f,t[2]=_*c+h*-f+l*-a-d*-s,t[3]=e[3],t}var lA=function(){let t=Oh();return function(e,r,n,o,i,s){let a,f;for(r||(r=4),n||(n=0),o?f=Math.min(o*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],t[3]=e[a+3],i(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2],e[a+3]=t[3];return e}}();var Qo;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"})(Qo||(Qo={}));var Ch=45*Math.PI/180,Bh=1,qo=.1,Zo=500,Dh=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),ut=class extends Ke{static get IDENTITY(){return vh()}static get ZERO(){return Ih()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Qo}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,r,n,o,i,s,a,f,c,l,d,_,h,u,x,p){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this[4]=i,this[5]=s,this[6]=a,this[7]=f,this[8]=c,this[9]=l,this[10]=d,this[11]=_,this[12]=h,this[13]=u,this[14]=x,this[15]=p,this.check()}setRowMajor(e,r,n,o,i,s,a,f,c,l,d,_,h,u,x,p){return this[0]=e,this[1]=i,this[2]=c,this[3]=h,this[4]=r,this[5]=s,this[6]=l,this[7]=u,this[8]=n,this[9]=a,this[10]=d,this[11]=x,this[12]=o,this[13]=f,this[14]=_,this[15]=p,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(Dh)}fromObject(e){return this.check()}fromQuaternion(e){return Ko(this,e),this.check()}frustum(e){let{left:r,right:n,bottom:o,top:i,near:s=qo,far:a=Zo}=e;return a===1/0?Lh(this,r,n,o,i,s):Ho(this,r,n,o,i,s,a),this.check()}lookAt(e){let{eye:r,center:n=[0,0,0],up:o=[0,1,0]}=e;return Wo(this,r,n,o),this.check()}ortho(e){let{left:r,right:n,bottom:o,top:i,near:s=qo,far:a=Zo}=e;return Xo(this,r,n,o,i,s,a),this.check()}orthographic(e){let{fovy:r=Ch,aspect:n=Bh,focalDistance:o=1,near:i=qo,far:s=Zo}=e;ta(r);let a=r/2,f=o*Math.tan(a),c=f*n;return this.ortho({left:-c,right:c,bottom:-f,top:f,near:i,far:s})}perspective(e){let{fovy:r=45*Math.PI/180,aspect:n=1,near:o=.1,far:i=500}=e;return ta(r),Vo(this,r,n,o,i),this.check()}determinant(){return Po(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),o=1/n[0],i=1/n[1],s=1/n[2];return e[0]=this[0]*o,e[1]=this[1]*i,e[2]=this[2]*s,e[3]=0,e[4]=this[4]*o,e[5]=this[5]*i,e[6]=this[6]*s,e[7]=0,e[8]=this[8]*o,e[9]=this[9]*i,e[10]=this[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),o=1/n[0],i=1/n[1],s=1/n[2];return e[0]=this[0]*o,e[1]=this[1]*i,e[2]=this[2]*s,e[3]=this[4]*o,e[4]=this[5]*i,e[5]=this[6]*s,e[6]=this[8]*o,e[7]=this[9]*i,e[8]=this[10]*s,e}transpose(){return vo(this,this),this.check()}invert(){return Lo(this,this),this.check()}multiplyLeft(e){return ur(this,e,this),this.check()}multiplyRight(e){return ur(this,this,e),this.check()}rotateX(e){return Go(this,this,e),this.check()}rotateY(e){return ko(this,this,e),this.check()}rotateZ(e){return zo(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,r){return Uo(this,this,e,r),this.check()}scale(e){return Fo(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return No(this,this,e),this.check()}transform(e,r){return e.length===4?(r=Js(r||[-0,-0,-0,-0],e,this),ne(r,4),r):this.transformAsPoint(e,r)}transformAsPoint(e,r){let{length:n}=e,o;switch(n){case 2:o=Ss(r||[-0,-0],e,this);break;case 3:o=me(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return ne(o,e.length),o}transformAsVector(e,r){let n;switch(e.length){case 2:n=Rs(r||[-0,-0],e,this);break;case 3:n=hn(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return ne(n,e.length),n}transformPoint(e,r){return this.transformAsPoint(e,r)}transformVector(e,r){return this.transformAsPoint(e,r)}transformDirection(e,r){return this.transformAsVector(e,r)}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,r,n){return this.identity().translate([e,r,n])}},En,Sn;function Ih(){return En||(En=new ut([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(En)),En}function vh(){return Sn||(Sn=new ut,Object.freeze(Sn)),Sn}function ta(t){if(t>Math.PI*2)throw Error("expected radians")}function Lh(t,e,r,n,o,i){let s=2*i/(r-e),a=2*i/(o-n),f=(r+e)/(r-e),c=(o+n)/(o-n),l=-1,d=-1,_=-2*i;return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=f,t[9]=c,t[10]=l,t[11]=d,t[12]=0,t[13]=0,t[14]=_,t[15]=0,t}function ea(){let t=new q(4);return q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ra(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Yo(t,e,r){r=r*.5;let n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function jo(t,e,r){let n=e[0],o=e[1],i=e[2],s=e[3],a=r[0],f=r[1],c=r[2],l=r[3];return t[0]=n*l+s*a+o*c-i*f,t[1]=o*l+s*f+i*a-n*c,t[2]=i*l+s*c+n*f-o*a,t[3]=s*l-n*a-o*f-i*c,t}function na(t,e,r){r*=.5;let n=e[0],o=e[1],i=e[2],s=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f+s*a,t[1]=o*f+i*a,t[2]=i*f-o*a,t[3]=s*f-n*a,t}function oa(t,e,r){r*=.5;let n=e[0],o=e[1],i=e[2],s=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f-i*a,t[1]=o*f+s*a,t[2]=i*f+n*a,t[3]=s*f-o*a,t}function ia(t,e,r){r*=.5;let n=e[0],o=e[1],i=e[2],s=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f+o*a,t[1]=o*f-n*a,t[2]=i*f+s*a,t[3]=s*f-i*a,t}function sa(t,e){let r=e[0],n=e[1],o=e[2];return t[0]=r,t[1]=n,t[2]=o,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-o*o)),t}function pr(t,e,r,n){let o=e[0],i=e[1],s=e[2],a=e[3],f=r[0],c=r[1],l=r[2],d=r[3],_,h,u,x,p;return _=o*f+i*c+s*l+a*d,_<0&&(_=-_,f=-f,c=-c,l=-l,d=-d),1-_>1e-6?(h=Math.acos(_),p=Math.sin(h),u=Math.sin((1-n)*h)/p,x=Math.sin(n*h)/p):(u=1-n,x=n),t[0]=u*o+x*f,t[1]=u*i+x*c,t[2]=u*s+x*l,t[3]=u*a+x*d,t}function aa(t,e){let r=e[0],n=e[1],o=e[2],i=e[3],s=r*r+n*n+o*o+i*i,a=s?1/s:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-o*a,t[3]=i*a,t}function ca(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Jo(t,e){let r=e[0]+e[4]+e[8],n;if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{let o=0;e[4]>e[0]&&(o=1),e[8]>e[o*3+o]&&(o=2);let i=(o+1)%3,s=(o+2)%3;n=Math.sqrt(e[o*3+o]-e[i*3+i]-e[s*3+s]+1),t[o]=.5*n,n=.5/n,t[3]=(e[i*3+s]-e[s*3+i])*n,t[i]=(e[i*3+o]+e[o*3+i])*n,t[s]=(e[s*3+o]+e[o*3+s])*n}return t}var fa=Xs;var la=Ws,ha=Ys,_a=js,da=qs;var ua=Zs;var pa=Qs;var ma=function(){let t=dn(),e=un(1,0,0),r=un(0,1,0);return function(n,o,i){let s=hr(o,i);return s<-.999999?(pe(t,e,o),bo(t)<1e-6&&pe(t,r,o),To(t,t),Yo(n,t,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(pe(t,o,i),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+s,pa(n,n))}}(),MA=function(){let t=ea(),e=ea();return function(r,n,o,i,s,a){return pr(t,n,s,a),pr(e,o,i,a),pr(r,t,e,2*a*(1-a)),r}}(),yA=function(){let t=Is();return function(e,r,n,o){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=o[0],t[4]=o[1],t[7]=o[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],pa(e,Jo(e,t))}}();var Ph=[0,0,0,1],He=class extends re{constructor(e=0,r=0,n=0,o=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,r,n,o)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,r,n,o){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return Jo(this,e),this.check()}fromAxisRotation(e,r){return Yo(this,e,r),this.check()}identity(){return ra(this),this.check()}setAxisAngle(e,r){return this.fromAxisRotation(e,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=z(e)}get y(){return this[1]}set y(e){this[1]=z(e)}get z(){return this[2]}set z(e){this[2]=z(e)}get w(){return this[3]}set w(e){this[3]=z(e)}len(){return da(this)}lengthSquared(){return ua(this)}dot(e){return ha(this,e)}rotationTo(e,r){return ma(this,e,r),this.check()}add(e){return fa(this,this,e),this.check()}calculateW(){return sa(this,this),this.check()}conjugate(){return ca(this,this),this.check()}invert(){return aa(this,this),this.check()}lerp(e,r,n){return n===void 0?this.lerp(this,e,r):(_a(this,e,r,n),this.check())}multiplyRight(e){return jo(this,this,e),this.check()}multiplyLeft(e){return jo(this,e,this),this.check()}normalize(){let e=this.len(),r=e>0?1/e:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,e===0&&(this[3]=1),this.check()}rotateX(e){return na(this,this,e),this.check()}rotateY(e){return oa(this,this,e),this.check()}rotateZ(e){return ia(this,this,e),this.check()}scale(e){return la(this,this,e),this.check()}slerp(e,r,n){let o,i,s;switch(arguments.length){case 1:({start:o=Ph,target:i,ratio:s}=e);break;case 2:o=this,i=e,s=r;break;default:o=e,i=r,s=n}return pr(this,o,i,s),this.check()}transformVector4(e,r=new ze){return $s(r,e,this),ne(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,r){return this.setAxisAngle(e,r)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}};var oe={};an(oe,{EPSILON1:()=>Nh,EPSILON10:()=>Xh,EPSILON11:()=>Wh,EPSILON12:()=>qh,EPSILON13:()=>Zh,EPSILON14:()=>Qh,EPSILON15:()=>Yh,EPSILON16:()=>jh,EPSILON17:()=>Jh,EPSILON18:()=>$h,EPSILON19:()=>t1,EPSILON2:()=>Fh,EPSILON20:()=>e1,EPSILON3:()=>Uh,EPSILON4:()=>Gh,EPSILON5:()=>kh,EPSILON6:()=>zh,EPSILON7:()=>Kh,EPSILON8:()=>Hh,EPSILON9:()=>Vh,PI_OVER_FOUR:()=>n1,PI_OVER_SIX:()=>o1,PI_OVER_TWO:()=>r1,TWO_PI:()=>i1});var Nh=.1,Fh=.01,Uh=.001,Gh=1e-4,kh=1e-5,zh=1e-6,Kh=1e-7,Hh=1e-8,Vh=1e-9,Xh=1e-10,Wh=1e-11,qh=1e-12,Zh=1e-13,Qh=1e-14,Yh=1e-15,jh=1e-16,Jh=1e-17,$h=1e-18,t1=1e-19,e1=1e-20,r1=Math.PI/2,n1=Math.PI/4,o1=Math.PI/6,i1=Math.PI*2;function $o(t){switch(t){case"UInt8":return Uint8Array;case"UInt16":return Uint16Array;case"UInt32":return Uint32Array;case"Float32":return Float32Array;case"UInt64":return Float64Array;default:throw new Error(`parse i3s tile content: unknown type of data: ${t}`)}}var xa={UInt8:de.UNSIGNED_BYTE,UInt16:de.UNSIGNED_SHORT,Float32:de.FLOAT,UInt32:de.UNSIGNED_INT,UInt64:de.DOUBLE};function Ve(t){switch(t){case"UInt8":return 1;case"UInt16":case"Int16":return 2;case"UInt32":case"Int32":case"Float32":return 4;case"UInt64":case"Int64":case"Float64":return 8;default:throw new Error(`parse i3s tile content: unknown size of data: ${t}`)}}var Aa="String",ga="Oid32",Ea="Float64",Sa="Int16",Pt;(function(t){t[t.DEFAULT=-1]="DEFAULT",t[t.LNGLAT=1]="LNGLAT",t[t.METER_OFFSETS=2]="METER_OFFSETS",t[t.LNGLAT_OFFSETS=3]="LNGLAT_OFFSETS",t[t.CARTESIAN=0]="CARTESIAN"})(Pt||(Pt={}));var Oc=Bt(Vt(),1);var wr=Bt(Vt(),1);var Xt=6356752314245179e-9,s1={radii:[6378137,6378137,Xt],radiiSquared:[6378137*6378137,6378137*6378137,Xt*Xt],oneOverRadii:[1/6378137,1/6378137,1/Xt],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Xt*Xt)],maximumRadius:Math.max(6378137,6378137,Xt),centerToleranceSquared:.1};function Rn(t){return t}var i2=new v;function a1(t,e=[],r=Rn){return"longitude"in t?(e[0]=r(t.longitude),e[1]=r(t.latitude),e[2]=t.height):"x"in t?(e[0]=r(t.x),e[1]=r(t.y),e[2]=t.z):(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]),e}function Ra(t,e=[]){return a1(t,e,W._cartographicRadians?Rn:So)}function c1(t,e,r=Rn){return"longitude"in e?(e.longitude=r(t[0]),e.latitude=r(t[1]),e.height=t[2]):"x"in e?(e.x=r(t[0]),e.y=r(t[1]),e.z=t[2]):(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]),e}function Ta(t,e){return c1(t,e,W._cartographicRadians?Rn:Ro)}var Ma=1e-14,f1=new v,ya={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},ti={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},mr={east:new v,north:new v,up:new v,west:new v,south:new v,down:new v},l1=new v,h1=new v,_1=new v;function ei(t,e,r,n,o,i){let s=ya[e]&&ya[e][r];et(s&&(!n||n===s));let a,f,c,l=f1.copy(o);if(dt(l.x,0,Ma)&&dt(l.y,0,Ma)){let _=Math.sign(l.z);a=l1.fromArray(ti[e]),e!=="east"&&e!=="west"&&a.scale(_),f=h1.fromArray(ti[r]),r!=="east"&&r!=="west"&&f.scale(_),c=_1.fromArray(ti[n]),n!=="east"&&n!=="west"&&c.scale(_)}else{let{up:_,east:h,north:u}=mr;h.set(-l.y,l.x,0).normalize(),t.geodeticSurfaceNormal(l,_),u.copy(_).cross(h);let{down:x,west:p,south:S}=mr;x.copy(_).scale(-1),p.copy(h).scale(-1),S.copy(u).scale(-1),a=mr[e],f=mr[r],c=mr[n]}return i[0]=a.x,i[1]=a.y,i[2]=a.z,i[3]=0,i[4]=f.x,i[5]=f.y,i[6]=f.z,i[7]=0,i[8]=c.x,i[9]=c.y,i[10]=c.z,i[11]=0,i[12]=l.x,i[13]=l.y,i[14]=l.z,i[15]=1,i}var Xe=new v,d1=new v,u1=new v;function wa(t,e,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:o,centerToleranceSquared:i}=e;Xe.from(t);let s=Xe.x,a=Xe.y,f=Xe.z,c=n.x,l=n.y,d=n.z,_=s*s*c*c,h=a*a*l*l,u=f*f*d*d,x=_+h+u,p=Math.sqrt(1/x);if(!Number.isFinite(p))return;let S=d1;if(S.copy(t).scale(p),x<i)return S.to(r);let y=o.x,B=o.y,T=o.z,R=u1;R.set(S.x*y*2,S.y*B*2,S.z*T*2);let D=(1-p)*Xe.len()/(.5*R.len()),I=0,L,A,m,g;do{D-=I,L=1/(1+D*y),A=1/(1+D*B),m=1/(1+D*T);let E=L*L,U=A*A,F=m*m,G=E*L,P=U*A,J=F*m;g=_*E+h*U+u*F-1;let X=-2*(_*G*y+h*P*B+u*J*T);I=g/X}while(Math.abs(g)>oe.EPSILON12);return Xe.scale([L,A,m]).to(r)}var Tn=new v,Oa=new v,x1=new v,yt=new v,A1=new v,Mn=new v,gt=class{constructor(e=0,r=0,n=0){V(this,"radii",void 0),V(this,"radiiSquared",void 0),V(this,"radiiToTheFourth",void 0),V(this,"oneOverRadii",void 0),V(this,"oneOverRadiiSquared",void 0),V(this,"minimumRadius",void 0),V(this,"maximumRadius",void 0),V(this,"centerToleranceSquared",oe.EPSILON1),V(this,"squaredXOverSquaredZ",void 0),et(e>=0),et(r>=0),et(n>=0),this.radii=new v(e,r,n),this.radiiSquared=new v(e*e,r*r,n*n),this.radiiToTheFourth=new v(e*e*e*e,r*r*r*r,n*n*n*n),this.oneOverRadii=new v(e===0?0:1/e,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new v(e===0?0:1/(e*e),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(e,r,n),this.maximumRadius=Math.max(e,r,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,r=[0,0,0]){let n=Oa,o=x1,[,,i]=e;this.geodeticSurfaceNormalCartographic(e,n),o.copy(this.radiiSquared).scale(n);let s=Math.sqrt(n.dot(o));return o.scale(1/s),n.scale(i),o.add(n),o.to(r)}cartesianToCartographic(e,r=[0,0,0]){Mn.from(e);let n=this.scaleToGeodeticSurface(Mn,yt);if(!n)return;let o=this.geodeticSurfaceNormal(n,Oa),i=A1;i.copy(Mn).subtract(n);let s=Math.atan2(o.y,o.x),a=Math.asin(o.z),f=Math.sign(ke.dot(i,Mn))*ke.length(i);return Ta([s,a,f],r)}eastNorthUpToFixedFrame(e,r=new ut){return ei(this,"east","north","up",e,r)}localFrameToFixedFrame(e,r,n,o,i=new ut){return ei(this,e,r,n,o,i)}geocentricSurfaceNormal(e,r=[0,0,0]){return Tn.from(e).normalize().to(r)}geodeticSurfaceNormalCartographic(e,r=[0,0,0]){let n=Ra(e),o=n[0],i=n[1],s=Math.cos(i);return Tn.set(s*Math.cos(o),s*Math.sin(o),Math.sin(i)).normalize(),Tn.to(r)}geodeticSurfaceNormal(e,r=[0,0,0]){return Tn.from(e).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(e,r){return wa(e,this,r)}scaleToGeocentricSurface(e,r=[0,0,0]){yt.from(e);let n=yt.x,o=yt.y,i=yt.z,s=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*s.x+o*o*s.y+i*i*s.z);return yt.multiplyScalar(a).to(r)}transformPositionToScaledSpace(e,r=[0,0,0]){return yt.from(e).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(e,r=[0,0,0]){return yt.from(e).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(e,r=0,n=[0,0,0]){et(dt(this.radii.x,this.radii.y,oe.EPSILON15)),et(this.radii.z>0),yt.from(e);let o=yt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(o)>=this.radii.z-r))return yt.set(0,0,o).to(n)}};V(gt,"WGS84",new gt(6378137,6378137,Xt));var ba="4.3.0-alpha.4";var g1=globalThis.loaders?.parseImageNode,ri=typeof Image<"u",ni=typeof ImageBitmap<"u",E1=Boolean(g1),oi=At?!0:E1;function Ca(t){switch(t){case"auto":return ni||ri||oi;case"imagebitmap":return ni;case"image":return ri;case"data":return oi;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function Ba(){if(ni)return"imagebitmap";if(ri)return"image";if(oi)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function S1(t){let e=R1(t);if(!e)throw new Error("Not an image");return e}function Da(t){switch(S1(t)){case"data":return t;case"image":case"imagebitmap":let e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function R1(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var T1=/^data:image\/svg\+xml/,M1=/\.svg((\?|#).*)?$/;function yn(t){return t&&(T1.test(t)||M1.test(t))}function Ia(t,e){if(yn(e)){let n=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(i){throw new Error(i.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return ii(t,e)}function ii(t,e){if(yn(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function wn(t,e,r){let n=Ia(t,r),o=self.URL||self.webkitURL,i=typeof n!="string"&&o.createObjectURL(n);try{return await y1(i||n,e)}finally{i&&o.revokeObjectURL(i)}}async function y1(t,e){let r=new Image;return r.src=t,e.image&&e.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,o)=>{try{r.onload=()=>n(r),r.onerror=i=>{let s=i instanceof Error?i.message:"error";o(new Error(s))}}catch(i){o(i)}})}var w1={},va=!0;async function La(t,e,r){let n;yn(r)?n=await wn(t,e,r):n=ii(t,r);let o=e&&e.imagebitmap;return await O1(n,o)}async function O1(t,e=null){if((b1(e)||!va)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),va=!1}return await createImageBitmap(t)}function b1(t){for(let e in t||w1)return!1;return!0}function Pa(t){return!I1(t,"ftyp",4)||!(t[8]&96)?null:C1(t)}function C1(t){switch(B1(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function B1(t,e,r){return String.fromCharCode(...t.slice(e,r))}function D1(t){return[...t].map(e=>e.charCodeAt(0))}function I1(t,e,r=0){let n=D1(e);for(let o=0;o<n.length;++o)if(n[o]!==t[o+r])return!1;return!0}var Nt=!1,xr=!0;function On(t){let e=Ar(t);return L1(e)||F1(e)||P1(e)||N1(e)||v1(e)}function v1(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=Pa(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function L1(t){let e=Ar(t);return e.byteLength>=24&&e.getUint32(0,Nt)===2303741511?{mimeType:"image/png",width:e.getUint32(16,Nt),height:e.getUint32(20,Nt)}:null}function P1(t){let e=Ar(t);return e.byteLength>=10&&e.getUint32(0,Nt)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,xr),height:e.getUint16(8,xr)}:null}function N1(t){let e=Ar(t);return e.byteLength>=14&&e.getUint16(0,Nt)===16973&&e.getUint32(2,xr)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,xr),height:e.getUint32(22,xr)}:null}function F1(t){let e=Ar(t);if(!(e.byteLength>=3&&e.getUint16(0,Nt)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:o}=U1(),i=2;for(;i+9<e.byteLength;){let s=e.getUint16(i,Nt);if(o.has(s))return{mimeType:"image/jpeg",height:e.getUint16(i+5,Nt),width:e.getUint16(i+7,Nt)};if(!n.has(s))return null;i+=2,i+=e.getUint16(i,Nt)}return null}function U1(){let t=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)t.add(r);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Ar(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function Na(t,e){let{mimeType:r}=On(t)||{},n=globalThis.loaders?.parseImageNode;return $t(n),await n(t,r)}async function Fa(t,e,r){e=e||{};let o=(e.image||{}).type||"auto",{url:i}=r||{},s=G1(o),a;switch(s){case"imagebitmap":a=await La(t,e,i);break;case"image":a=await wn(t,e,i);break;case"data":a=await Na(t,e);break;default:$t(!1)}return o==="data"&&(a=Da(a)),a}function G1(t){switch(t){case"auto":case"data":return Ba();default:return Ca(t),t}}var k1=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],z1=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],K1={image:{type:"auto",decode:!0}},bn={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:ba,mimeTypes:z1,extensions:k1,parse:Fa,tests:[t=>Boolean(On(new DataView(t)))],options:K1};var Ua="4.3.0-alpha.4";var Ga={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:Ua,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function ka(t){switch(t.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function si(t){let e=1/0,r=1/0,n=1/0,o=-1/0,i=-1/0,s=-1/0,a=t.POSITION?t.POSITION.value:[],f=a&&a.length;for(let c=0;c<f;c+=3){let l=a[c],d=a[c+1],_=a[c+2];e=l<e?l:e,r=d<r?d:r,n=_<n?_:n,o=l>o?l:o,i=d>i?d:i,s=_>s?_:s}return[[e,r,n],[o,i,s]]}function ai(t,e,r){let n=ka(e.value),o=r||za(e);return{name:t,type:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:n}]},nullable:!1,metadata:o}}function za(t){let e={};return"byteOffset"in t&&(e.byteOffset=t.byteOffset.toString(10)),"byteStride"in t&&(e.byteStride=t.byteStride.toString(10)),"normalized"in t&&(e.normalized=t.normalized.toString()),e}function Ha(t,e,r){let n=Va(e.metadata),o=[],i=H1(e.attributes);for(let s in t){let a=t[s],f=Ka(s,a,i[s]);o.push(f)}if(r){let s=Ka("indices",r);o.push(s)}return{fields:o,metadata:n}}function H1(t){let e={};for(let r in t){let n=t[r];e[n.name||"undefined"]=n}return e}function Ka(t,e,r){let n=r?Va(r.metadata):void 0;return ai(t,e,n)}function Va(t){Object.entries(t);let e={};for(let r in t)e[`${r}.string`]=JSON.stringify(t[r]);return e}var Xa={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},V1={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},X1=4,gr=class{draco;decoder;metadataQuerier;constructor(e){this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(r);let o=this.decoder.GetEncodedGeometryType(n),i=o===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let s;switch(o){case this.draco.TRIANGULAR_MESH:s=this.decoder.DecodeBufferToMesh(n,i);break;case this.draco.POINT_CLOUD:s=this.decoder.DecodeBufferToPointCloud(n,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!s.ok()||!i.ptr){let _=`DRACO decompression failed: ${s.error_msg()}`;throw new Error(_)}let a=this._getDracoLoaderData(i,o,r),f=this._getMeshData(i,a,r),c=si(f.attributes),l=Ha(f.attributes,a,f.indices);return{loader:"draco",loaderData:a,header:{vertexCount:i.num_points(),boundingBox:c},...f,schema:l}}finally{this.draco.destroy(n),i&&this.draco.destroy(i)}}_getDracoLoaderData(e,r,n){let o=this._getTopLevelMetadata(e),i=this._getDracoAttributes(e,n);return{geometry_type:r,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:o,attributes:i}}_getDracoAttributes(e,r){let n={};for(let o=0;o<e.num_attributes();o++){let i=this.decoder.GetAttribute(e,o),s=this._getAttributeMetadata(e,o);n[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:o,metadata:s};let a=this._getQuantizationTransform(i,r);a&&(n[i.unique_id()].quantization_transform=a);let f=this._getOctahedronTransform(i,r);f&&(n[i.unique_id()].octahedron_transform=f)}return n}_getMeshData(e,r,n){let o=this._getMeshAttributes(r,e,n);if(!o.POSITION)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:o,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:o,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:o}}_getMeshAttributes(e,r,n){let o={};for(let i of Object.values(e.attributes)){let s=this._deduceAttributeName(i,n);i.name=s;let a=this._getAttributeValues(r,i);if(a){let{value:f,size:c}=a;o[s]={value:f,size:c,byteOffset:i.byte_offset,byteStride:i.byte_stride,normalized:i.normalized}}}return o}_getTriangleListIndices(e){let n=e.num_faces()*3,o=n*X1,i=this.draco._malloc(o);try{return this.decoder.GetTrianglesUInt32Array(e,o,i),new Uint32Array(this.draco.HEAPF32.buffer,i,n).slice()}finally{this.draco._free(i)}}_getTriangleStripIndices(e){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,r),Z1(r)}finally{this.draco.destroy(r)}}_getAttributeValues(e,r){let n=V1[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let o=r.num_components,s=e.num_points()*o,a=s*n.BYTES_PER_ELEMENT,f=W1(this.draco,n),c,l=this.draco._malloc(a);try{let d=this.decoder.GetAttribute(e,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,d,f,a,l),c=new n(this.draco.HEAPF32.buffer,l,s).slice()}finally{this.draco._free(l)}return{value:c,size:o}}_deduceAttributeName(e,r){let n=e.unique_id;for(let[s,a]of Object.entries(r.extraAttributes||{}))if(a===n)return s;let o=e.attribute_type;for(let s in Xa)if(this.draco[s]===o)return Xa[s];let i=r.attributeNameEntry||"name";return e.metadata[i]?e.metadata[i].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(e){let r=this.decoder.GetMetadata(e);return this._getDracoMetadata(r)}_getAttributeMetadata(e,r){let n=this.decoder.GetAttributeMetadata(e,r);return this._getDracoMetadata(n)}_getDracoMetadata(e){if(!e||!e.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(e);for(let o=0;o<n;o++){let i=this.metadataQuerier.GetEntryName(e,o);r[i]=this._getDracoMetadataField(e,i)}return r}_getDracoMetadataField(e,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,r,n);let o=q1(n);return{int:this.metadataQuerier.GetIntEntry(e,r),string:this.metadataQuerier.GetStringEntry(e,r),double:this.metadataQuerier.GetDoubleEntry(e,r),intArray:o}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(e){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=e,o=[...r,...n];for(let i of o)this.decoder.SkipAttributeTransform(this.draco[i])}_getQuantizationTransform(e,r){let{quantizedAttributes:n=[]}=r,o=e.attribute_type();if(n.map(s=>this.decoder[s]).includes(o)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(e))return{quantization_bits:s.quantization_bits(),range:s.range(),min_values:new Float32Array([1,2,3]).map(a=>s.min_value(a))}}finally{this.draco.destroy(s)}}return null}_getOctahedronTransform(e,r){let{octahedronAttributes:n=[]}=r,o=e.attribute_type();if(n.map(s=>this.decoder[s]).includes(o)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(e))return{quantization_bits:s.quantization_bits()}}finally{this.draco.destroy(s)}}return null}};function W1(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}function q1(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}function Z1(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}var Q1="1.5.6",Y1="1.4.1",ci=`https://www.gstatic.com/draco/versioned/decoders/${Q1}`,ht={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},fi={[ht.DECODER]:`${ci}/${ht.DECODER}`,[ht.DECODER_WASM]:`${ci}/${ht.DECODER_WASM}`,[ht.FALLBACK_DECODER]:`${ci}/${ht.FALLBACK_DECODER}`,[ht.ENCODER]:`https://raw.githubusercontent.com/google/draco/${Y1}/javascript/${ht.ENCODER}`},li;async function Wa(t){let e=t.modules||{};return e.draco3d?li||=e.draco3d.createDecoderModule({}).then(r=>({draco:r})):li||=j1(t),await li}async function j1(t){let e,r;switch(t.draco&&t.draco.decoderType){case"js":e=await vt(fi[ht.FALLBACK_DECODER],"draco",t,ht.FALLBACK_DECODER);break;case"wasm":default:[e,r]=await Promise.all([await vt(fi[ht.DECODER],"draco",t,ht.DECODER),await vt(fi[ht.DECODER_WASM],"draco",t,ht.DECODER_WASM)])}return e=e||globalThis.DracoDecoderModule,await J1(e,r)}function J1(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t({...r,onModuleLoaded:o=>n({draco:o})})})}var qa={...Ga,parse:$1};async function $1(t,e){let{draco:r}=await Wa(e),n=new gr(r);try{return n.parseSync(t,e?.draco)}finally{n.destroy()}}var Cn="4.3.0-alpha.4";var Bn={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},Za;async function _i(t){sr(t.modules);let e=xo("basis");return e||(Za||=t_(t),await Za)}async function t_(t){let e=null,r=null;return[e,r]=await Promise.all([await vt(Bn.TRANSCODER,"textures",t),await vt(Bn.TRANSCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await e_(e,r)}function e_(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(o=>{let{BasisFile:i,initializeBasis:s}=o;s(),n({BasisFile:i})})})}var hi;async function di(t){let e=t.modules||{};return e.basisEncoder?e.basisEncoder:(hi=hi||r_(t),await hi)}async function r_(t){let e=null,r=null;return[e,r]=await Promise.all([await vt(Bn.ENCODER,"textures",t),await vt(Bn.ENCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await n_(e,r)}function n_(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(o=>{let{BasisFile:i,KTX2File:s,initializeBasis:a,BasisEncoder:f}=o;a(),n({BasisFile:i,KTX2File:s,BasisEncoder:f})})})}var M={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};var o_=["","WEBKIT_","MOZ_"],Qa={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},Dn=null;function Er(t){if(!Dn){t=t||i_()||void 0,Dn=new Set;for(let e of o_)for(let r in Qa)if(t&&t.getExtension(`${e}${r}`)){let n=Qa[r];Dn.add(n)}}return Dn}function i_(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var ui=class{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}},xe=class{constructor(e,r,n,o){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+r,n),this._littleEndian=o,this._offset=0}_nextUint8(){let e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){let e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){let e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){let e=this._dataView.getUint32(this._offset,this._littleEndian),r=this._dataView.getUint32(this._offset+4,this._littleEndian),n=e+2**32*r;return this._offset+=8,n}_nextInt32(){let e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){let r=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,r}_skip(e){return this._offset+=e,this}_scan(e,r=0){let n=this._offset,o=0;for(;this._dataView.getUint8(this._offset)!==r&&o<e;)o++,this._offset++;return o<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,o)}};var wg=new Uint8Array([0]),at=[171,75,84,88,32,50,48,187,13,10,26,10];function Ya(t){return typeof TextDecoder<"u"?new TextDecoder().decode(t):Buffer.from(t).toString("utf8")}function ja(t){let e=new Uint8Array(t.buffer,t.byteOffset,at.length);if(e[0]!==at[0]||e[1]!==at[1]||e[2]!==at[2]||e[3]!==at[3]||e[4]!==at[4]||e[5]!==at[5]||e[6]!==at[6]||e[7]!==at[7]||e[8]!==at[8]||e[9]!==at[9]||e[10]!==at[10]||e[11]!==at[11])throw new Error("Missing KTX 2.0 identifier.");let r=new ui,n=17*Uint32Array.BYTES_PER_ELEMENT,o=new xe(t,at.length,n,!0);r.vkFormat=o._nextUint32(),r.typeSize=o._nextUint32(),r.pixelWidth=o._nextUint32(),r.pixelHeight=o._nextUint32(),r.pixelDepth=o._nextUint32(),r.layerCount=o._nextUint32(),r.faceCount=o._nextUint32();let i=o._nextUint32();r.supercompressionScheme=o._nextUint32();let s=o._nextUint32(),a=o._nextUint32(),f=o._nextUint32(),c=o._nextUint32(),l=o._nextUint64(),d=o._nextUint64(),_=i*3*8,h=new xe(t,at.length+n,_,!0);for(let it=0;it<i;it++)r.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+h._nextUint64(),h._nextUint64()),uncompressedByteLength:h._nextUint64()});let u=new xe(t,s,a,!0),x={vendorId:u._skip(4)._nextUint16(),descriptorType:u._nextUint16(),versionNumber:u._nextUint16(),descriptorBlockSize:u._nextUint16(),colorModel:u._nextUint8(),colorPrimaries:u._nextUint8(),transferFunction:u._nextUint8(),flags:u._nextUint8(),texelBlockDimension:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],bytesPlane:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],samples:[]},p=6,S=4,y=(x.descriptorBlockSize/4-p)/S;for(let it=0;it<y;it++){let bt={bitOffset:u._nextUint16(),bitLength:u._nextUint8(),channelType:u._nextUint8(),samplePosition:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};bt.channelType&64?(bt.sampleLower=u._nextInt32(),bt.sampleUpper=u._nextInt32()):(bt.sampleLower=u._nextUint32(),bt.sampleUpper=u._nextUint32()),x.samples[it]=bt}r.dataFormatDescriptor.length=0,r.dataFormatDescriptor.push(x);let B=new xe(t,f,c,!0);for(;B._offset<c;){let it=B._nextUint32(),bt=B._scan(it),De=Ya(bt);if(r.keyValue[De]=B._nextUint8Array(it-bt.byteLength-1),De.match(/^ktx/i)){let w=Ya(r.keyValue[De]);r.keyValue[De]=w.substring(0,w.lastIndexOf("\0"))}let O=it%4?4-it%4:0;B._skip(O)}if(d<=0)return r;let T=new xe(t,l,d,!0),R=T._nextUint16(),D=T._nextUint16(),I=T._nextUint32(),L=T._nextUint32(),A=T._nextUint32(),m=T._nextUint32(),g=[];for(let it=0;it<i;it++)g.push({imageFlags:T._nextUint32(),rgbSliceByteOffset:T._nextUint32(),rgbSliceByteLength:T._nextUint32(),alphaSliceByteOffset:T._nextUint32(),alphaSliceByteLength:T._nextUint32()});let E=l+T._offset,U=E+I,F=U+L,G=F+A,P=new Uint8Array(t.buffer,t.byteOffset+E,I),J=new Uint8Array(t.buffer,t.byteOffset+U,L),ot=new Uint8Array(t.buffer,t.byteOffset+F,A),X=new Uint8Array(t.buffer,t.byteOffset+G,m);return r.globalData={endpointCount:R,selectorCount:D,imageDescs:g,endpointsData:P,selectorsData:J,tablesData:ot,extendedData:X},r}function We(t,e){let r=new Array(e.mipMapLevels),n=e.width,o=e.height,i=0;for(let s=0;s<e.mipMapLevels;++s){let a=a_(e,n,o,t,s),f=s_(t,s,i,a);r[s]={compressed:!0,format:e.internalFormat,data:f,width:n,height:o,levelSize:a},n=Math.max(1,n>>1),o=Math.max(1,o>>1),i+=a}return r}function s_(t,e,r,n){return Array.isArray(t)?t[e].levelData:new Uint8Array(t.buffer,t.byteOffset+r,n)}function a_(t,e,r,n,o){return Array.isArray(n)?t.sizeFunction(n[o]):t.sizeFunction(e,r)}var c_={131:M.COMPRESSED_RGB_S3TC_DXT1_EXT,132:M.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:M.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:M.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:M.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:M.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:M.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:M.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:M.COMPRESSED_RED_RGTC1_EXT,140:M.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:M.COMPRESSED_RED_GREEN_RGTC2_EXT,142:M.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:M.COMPRESSED_RGB8_ETC2,148:M.COMPRESSED_SRGB8_ETC2,149:M.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:M.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:M.COMPRESSED_RGBA8_ETC2_EAC,152:M.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:M.COMPRESSED_R11_EAC,154:M.COMPRESSED_SIGNED_R11_EAC,155:M.COMPRESSED_RG11_EAC,156:M.COMPRESSED_SIGNED_RG11_EAC,157:M.COMPRESSED_RGBA_ASTC_4x4_KHR,158:M.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:M.COMPRESSED_RGBA_ASTC_5x4_KHR,160:M.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:M.COMPRESSED_RGBA_ASTC_5x5_KHR,162:M.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:M.COMPRESSED_RGBA_ASTC_6x5_KHR,164:M.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:M.COMPRESSED_RGBA_ASTC_6x6_KHR,166:M.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:M.COMPRESSED_RGBA_ASTC_8x5_KHR,168:M.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:M.COMPRESSED_RGBA_ASTC_8x6_KHR,170:M.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:M.COMPRESSED_RGBA_ASTC_8x8_KHR,172:M.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:M.COMPRESSED_RGBA_ASTC_10x5_KHR,174:M.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:M.COMPRESSED_RGBA_ASTC_10x6_KHR,176:M.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:M.COMPRESSED_RGBA_ASTC_10x8_KHR,178:M.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:M.COMPRESSED_RGBA_ASTC_10x10_KHR,180:M.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:M.COMPRESSED_RGBA_ASTC_12x10_KHR,182:M.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:M.COMPRESSED_RGBA_ASTC_12x12_KHR,184:M.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:M.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:M.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:M.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:M.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:M.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:M.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:M.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:M.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:M.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:M.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:M.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:M.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:M.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:M.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:M.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:M.COMPRESSED_RGBA_ASTC_12x12_KHR};function Ja(t){return c_[t]}var pt=[171,75,84,88,32,50,48,187,13,10,26,10];function In(t){let e=new Uint8Array(t);return!(e.byteLength<pt.length||e[0]!==pt[0]||e[1]!==pt[1]||e[2]!==pt[2]||e[3]!==pt[3]||e[4]!==pt[4]||e[5]!==pt[5]||e[6]!==pt[6]||e[7]!==pt[7]||e[8]!==pt[8]||e[9]!==pt[9]||e[10]!==pt[10]||e[11]!==pt[11])}function $a(t){let e=new Uint8Array(t),r=ja(e),n=Math.max(1,r.levels.length),o=r.pixelWidth,i=r.pixelHeight,s=Ja(r.vkFormat);return We(r.levels,{mipMapLevels:n,width:o,height:i,sizeFunction:a=>a.uncompressedByteLength,internalFormat:s})}var f_={etc1:{basisFormat:0,compressed:!0,format:M.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:M.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:M.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:M.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:M.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:M.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function Sr(t,e){if(e.basis.containerFormat==="auto"){if(In(t)){let n=await di(e);return tc(n.KTX2File,t,e)}let{BasisFile:r}=await _i(e);return pi(r,t,e)}switch(e.basis.module){case"encoder":let r=await di(e);switch(e.basis.containerFormat){case"ktx2":return tc(r.KTX2File,t,e);case"basis":default:return pi(r.BasisFile,t,e)}case"transcoder":default:let{BasisFile:n}=await _i(e);return pi(n,t,e)}}function pi(t,e,r){let n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let o=n.getNumImages(),i=[];for(let s=0;s<o;s++){let a=n.getNumLevels(s),f=[];for(let c=0;c<a;c++)f.push(l_(n,s,c,r));i.push(f)}return i}finally{n.close(),n.delete()}}function l_(t,e,r,n){let o=t.getImageWidth(e,r),i=t.getImageHeight(e,r),s=t.getHasAlpha(),{compressed:a,format:f,basisFormat:c}=ec(n,s),l=t.getImageTranscodedSizeInBytes(e,r,c),d=new Uint8Array(l);if(!t.transcodeImage(d,e,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:o,height:i,data:d,compressed:a,format:f,hasAlpha:s}}function tc(t,e,r){let n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let o=n.getLevels(),i=[];for(let s=0;s<o;s++)i.push(h_(n,s,r));return[i]}finally{n.close(),n.delete()}}function h_(t,e,r){let{alphaFlag:n,height:o,width:i}=t.getImageLevelInfo(e,0,0),{compressed:s,format:a,basisFormat:f}=ec(r,n),c=t.getImageTranscodedSizeInBytes(e,0,0,f),l=new Uint8Array(c);if(!t.transcodeImage(l,e,0,0,f,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:i,height:o,data:l,compressed:s,levelSize:c,hasAlpha:n,format:a}}function ec(t,e){let r=t&&t.basis&&t.basis.format;return r==="auto"&&(r=vn()),typeof r=="object"&&(r=e?r.alpha:r.noAlpha),r=r.toLowerCase(),f_[r]}function vn(){let t=Er();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}var rc={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:Cn,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},Rr={...rc,parse:Sr};var mt={MAGIC_NUMBER:542327876,HEADER_LENGTH:31,MAGIC_NUMBER_INDEX:0,HEADER_SIZE_INDEX:1,HEADER_FLAGS_INDEX:2,HEADER_HEIGHT_INDEX:3,HEADER_WIDTH_INDEX:4,MIPMAPCOUNT_INDEX:7,HEADER_PF_FLAGS_INDEX:20,HEADER_PF_FOURCC_INDEX:21,DDSD_MIPMAPCOUNT:131072,DDPF_FOURCC:4},__={DXT1:M.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:M.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:M.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":M.COMPRESSED_RGB_ATC_WEBGL,ATCA:M.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:M.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},d_=ic,u_=Ln,p_=Ln,m_={DXT1:ic,DXT3:Ln,DXT5:Ln,"ATC ":d_,ATCA:u_,ATCI:p_};function nc(t){return new Uint32Array(t,0,mt.HEADER_LENGTH)[mt.MAGIC_NUMBER_INDEX]===mt.MAGIC_NUMBER}function oc(t){let e=new Int32Array(t,0,mt.HEADER_LENGTH),r=e[mt.HEADER_PF_FOURCC_INDEX];$t(Boolean(e[mt.HEADER_PF_FLAGS_INDEX]&mt.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=x_(r),o=__[n],i=m_[n];$t(o&&i,`DDS: Unknown pixel format ${r}`);let s=1;e[mt.HEADER_FLAGS_INDEX]&mt.DDSD_MIPMAPCOUNT&&(s=Math.max(1,e[mt.MIPMAPCOUNT_INDEX]));let a=e[mt.HEADER_WIDTH_INDEX],f=e[mt.HEADER_HEIGHT_INDEX],c=e[mt.HEADER_SIZE_INDEX]+4,l=new Uint8Array(t,c);return We(l,{mipMapLevels:s,width:a,height:f,sizeFunction:i,internalFormat:o})}function ic(t,e){return(t+3>>2)*(e+3>>2)*8}function Ln(t,e){return(t+3>>2)*(e+3>>2)*16}function x_(t){return String.fromCharCode(t&255,t>>8&255,t>>16&255,t>>24&255)}var Et={MAGIC_NUMBER:55727696,MAGIC_NUMBER_EXTRA:1347834371,HEADER_LENGTH:13,HEADER_SIZE:52,MAGIC_NUMBER_INDEX:0,PIXEL_FORMAT_INDEX:2,COLOUR_SPACE_INDEX:4,HEIGHT_INDEX:6,WIDTH_INDEX:7,MIPMAPCOUNT_INDEX:11,METADATA_SIZE_INDEX:12},A_={0:[M.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[M.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[M.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[M.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[M.COMPRESSED_RGB_ETC1_WEBGL],7:[M.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[M.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[M.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[M.COMPRESSED_RGB8_ETC2],23:[M.COMPRESSED_RGBA8_ETC2_EAC],24:[M.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[M.COMPRESSED_R11_EAC],26:[M.COMPRESSED_RG11_EAC],27:[M.COMPRESSED_RGBA_ASTC_4X4_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[M.COMPRESSED_RGBA_ASTC_5X4_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[M.COMPRESSED_RGBA_ASTC_5X5_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[M.COMPRESSED_RGBA_ASTC_6X5_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[M.COMPRESSED_RGBA_ASTC_6X6_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[M.COMPRESSED_RGBA_ASTC_8X5_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[M.COMPRESSED_RGBA_ASTC_8X6_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[M.COMPRESSED_RGBA_ASTC_8X8_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[M.COMPRESSED_RGBA_ASTC_10X5_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[M.COMPRESSED_RGBA_ASTC_10X6_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[M.COMPRESSED_RGBA_ASTC_10X8_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[M.COMPRESSED_RGBA_ASTC_10X10_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[M.COMPRESSED_RGBA_ASTC_12X10_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[M.COMPRESSED_RGBA_ASTC_12X12_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},g_={0:sc,1:sc,2:ac,3:ac,6:Tr,7:Tr,9:Mr,11:Mr,22:Tr,23:Mr,24:Tr,25:Tr,26:Mr,27:Mr,28:E_,29:S_,30:R_,31:T_,32:M_,33:y_,34:w_,35:O_,36:b_,37:C_,38:B_,39:D_,40:I_};function cc(t){let r=new Uint32Array(t,0,Et.HEADER_LENGTH)[Et.MAGIC_NUMBER_INDEX];return r===Et.MAGIC_NUMBER||r===Et.MAGIC_NUMBER_EXTRA}function fc(t){let e=new Uint32Array(t,0,Et.HEADER_LENGTH),r=e[Et.PIXEL_FORMAT_INDEX],n=e[Et.COLOUR_SPACE_INDEX],o=A_[r]||[],i=o.length>1&&n?o[1]:o[0],s=g_[r],a=e[Et.MIPMAPCOUNT_INDEX],f=e[Et.WIDTH_INDEX],c=e[Et.HEIGHT_INDEX],l=Et.HEADER_SIZE+e[Et.METADATA_SIZE_INDEX],d=new Uint8Array(t,l);return We(d,{mipMapLevels:a,width:f,height:c,sizeFunction:s,internalFormat:i})}function sc(t,e){return t=Math.max(t,16),e=Math.max(e,8),t*e/4}function ac(t,e){return t=Math.max(t,8),e=Math.max(e,8),t*e/2}function Tr(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8}function Mr(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16}function E_(t,e){return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16}function S_(t,e){return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16}function R_(t,e){return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16}function T_(t,e){return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16}function M_(t,e){return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16}function y_(t,e){return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16}function w_(t,e){return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16}function O_(t,e){return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16}function b_(t,e){return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16}function C_(t,e){return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16}function B_(t,e){return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16}function D_(t,e){return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16}function I_(t,e){return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16}function lc(t){if(In(t))return $a(t);if(nc(t))return oc(t);if(cc(t))return fc(t);throw new Error("Texture container format not recognized")}var hc={dataType:null,batchType:null,name:"Texture Containers",id:"compressed-texture",module:"textures",version:Cn,worker:!0,extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0,options:{"compressed-texture":{libraryPath:"libs/",useBasis:!1}}},Pn={...hc,parse:async(t,e)=>e?.["compressed-texture"]?.useBasis?(e.basis={format:{alpha:"BC3",noAlpha:"BC1"},...e.basis,containerFormat:"ktx2",module:"encoder"},(await Sr(t,e))[0]):lc(t)};var yr;(function(t){t.vertexCount="vertexCount",t.featureCount="featureCount"})(yr||(yr={}));function Nn(t){let e;try{let r=new URL(t);e=`${r.origin}${r.pathname}`,e.startsWith("null")&&(e=null)}catch{e=null}return e||t}function Ft(t,e=null){return e?`${t}?token=${e}`:t}function _c(t,e){let{attributeData:r=[]}=e,n=[];for(let o=0;o<r.length;o++){let i=r[o].href.replace("./","");n.push(`${t}/${i}`)}return n}function dc(t,e,r){let n=[],{attributeStorageInfo:o=[]}=t;for(let i=0;i<o.length;i++){let s=o[i].key;n.push(`${e}/nodes/${r}/attributes/${s}/0`)}return n}var Fn=new v([0,0,0]);function v_(t){switch(t){case"ktx-etc2":case"dds":return Pn;case"ktx2":return Rr;case"jpg":case"png":default:return bn}}var L_="i3s-attribute-type";async function xc(t,e,r,n,o){let i={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new ut,coordinateSystem:0,byteLength:0,texture:null};if(e.textureUrl){let s=Ft(e.textureUrl,n?.i3s?.token),a=v_(e.textureFormat),l=await(await(o?.fetch||fetch)(s)).arrayBuffer();if(n?.i3s.decodeTextures){if(a===bn){let d={...e.textureLoaderOptions,image:{type:"data"}};try{let _=await uo(l,[],d,o);i.texture=_}catch{let h=await(0,wr.parse)(l,a,d,o);i.texture=h}}else if(a===Pn||a===Rr){let d=await(0,wr.load)(l,a,e.textureLoaderOptions);a===Rr&&(d=d[0]),i.texture={compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}}else i.texture=l}return i.material=H_(e.materialDefinition,i.texture),i.material&&(i.texture=null),await P_(t,i,e,r,n)}async function P_(t,e,r,n,o){let i=t.byteLength,s,a,f=0,c=0,l;if(r.isDracoGeometry){let d=await(0,wr.parse)(t,qa,{draco:{attributeNameEntry:L_}});a=d.header.vertexCount,l=d.indices?.value;let{POSITION:_,NORMAL:h,COLOR_0:u,TEXCOORD_0:x,["feature-index"]:p,["uv-region"]:S}=d.attributes;s={position:_,normal:h,color:u,uv0:x,uvRegion:S,id:p},N_(s,d);let y=q_(p);y&&W_(s,y)}else{let{vertexAttributes:d,ordering:_,featureAttributes:h,featureAttributeOrder:u}=n.store.defaultGeometrySchema,x=U_(t,n);f=x.byteOffset,a=x.vertexCount,c=x.featureCount;let{attributes:p,byteOffset:S}=pc(t,f,d,a,_),{attributes:y}=pc(t,S,h,c,u);X_(y),s=F_(p,y)}if(!o?.i3s?.coordinateSystem||o.i3s.coordinateSystem===Pt.METER_OFFSETS){let d=k_(s.position,r);e.modelMatrix=d.invert(),e.coordinateSystem=Pt.METER_OFFSETS}else e.modelMatrix=K_(s.position),e.coordinateSystem=Pt.LNGLAT_OFFSETS;e.attributes={positions:s.position,normals:s.normal,colors:uc(s.color),texCoords:s.uv0,uvRegions:uc(s.uvRegion||s.region)},e.indices=l||null,s.id&&s.id.value&&(e.featureIds=s.id.value);for(let d in e.attributes)e.attributes[d]||delete e.attributes[d];return e.vertexCount=a,e.byteLength=i,e}function N_(t,e){for(let r in e.loaderData.attributes){let n=e.loaderData.attributes[r];switch(n.name){case"POSITION":t.position.metadata=n.metadata;break;case"feature-index":t.id.metadata=n.metadata;break;default:break}}}function F_(t,e){return{...t,...e}}function uc(t){return t&&(t.normalized=!0,t)}function U_(t,e){let r=0,n=0,o=0;for(let{property:i,type:s}of e.store.defaultGeometrySchema.header){let a=$o(s);switch(i){case yr.vertexCount.toString():n=new a(t,0,4)[0],r+=Ve(s);break;case yr.featureCount.toString():o=new a(t,4,4)[0],r+=Ve(s);break;default:break}}return{vertexCount:n,featureCount:o,byteOffset:r}}function pc(t,e,r,n,o){let i={};for(let s of o)if(r[s]){let{valueType:a,valuesPerElement:f}=r[s];if(e+n*f*Ve(a)<=t.byteLength){let c=t.slice(e),l;if(a==="UInt64")l=G_(c,n*f,Ve(a));else{let d=$o(a);l=new d(c,0,n*f)}switch(i[s]={value:l,type:xa[a],size:f},s){case"color":i.color.normalized=!0;break;case"position":case"region":case"normal":default:}e=e+n*f*Ve(a)}else if(s!=="uv0")break}return{attributes:i,byteOffset:e}}function G_(t,e,r){let n=[],o=new DataView(t),i=0;for(let s=0;s<e;s++){let a=o.getUint32(i,!0),f=o.getUint32(i+4,!0),c=a+2**32*f;n.push(c),i+=r}return new Uint32Array(n)}function k_(t,e){let r=e.mbs,n=t.value,o=t.metadata,i=new ut,s=new v(r[0],r[1],r[2]),a=new v;return gt.WGS84.cartographicToCartesian(s,a),gt.WGS84.eastNorthUpToFixedFrame(a,i),t.value=z_(n,o,s),i}function z_(t,e={},r){let n=new Float64Array(t.length),o=e["i3s-scale_x"]&&e["i3s-scale_x"].double||1,i=e["i3s-scale_y"]&&e["i3s-scale_y"].double||1;for(let s=0;s<n.length;s+=3)n[s]=t[s]*o+r.x,n[s+1]=t[s+1]*i+r.y,n[s+2]=t[s+2]+r.z;for(let s=0;s<n.length;s+=3)gt.WGS84.cartographicToCartesian(n.subarray(s,s+3),Fn),n[s]=Fn.x,n[s+1]=Fn.y,n[s+2]=Fn.z;return n}function K_(t){let e=t.metadata,r=e?.["i3s-scale_x"]?.double||1,n=e?.["i3s-scale_y"]?.double||1,o=new ut;return o[0]=r,o[5]=n,o}function H_(t,e){let r;return t?r={...t,pbrMetallicRoughness:t.pbrMetallicRoughness?{...t.pbrMetallicRoughness}:{baseColorFactor:[255,255,255,255]}}:(r={pbrMetallicRoughness:{}},e?r.pbrMetallicRoughness.baseColorTexture={texCoord:0}:r.pbrMetallicRoughness.baseColorFactor=[255,255,255,255]),r.alphaCutoff=r.alphaCutoff||.25,r.alphaMode&&(r.alphaMode=r.alphaMode.toUpperCase()),r.emissiveFactor&&(r.emissiveFactor=mc(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=mc(r.pbrMetallicRoughness.baseColorFactor)),e&&V_(r,e),r}function mc(t){let e=[...t];for(let r=0;r<t.length;r++)e[r]=t[r]/255;return e}function V_(t,e){let r={source:{image:e}};t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture?t.pbrMetallicRoughness.baseColorTexture={...t.pbrMetallicRoughness.baseColorTexture,texture:r}:t.emissiveTexture?t.emissiveTexture={...t.emissiveTexture,texture:r}:t.pbrMetallicRoughness&&t.pbrMetallicRoughness.metallicRoughnessTexture?t.pbrMetallicRoughness.metallicRoughnessTexture={...t.pbrMetallicRoughness.metallicRoughnessTexture,texture:r}:t.normalTexture?t.normalTexture={...t.normalTexture,texture:r}:t.occlusionTexture&&(t.occlusionTexture={...t.occlusionTexture,texture:r})}function X_(t){let{id:e,faceRange:r}=t;if(!e||!r)return;let n=e.value,o=r.value,i=o[o.length-1]+1,s=new Uint32Array(i*3),a=0,f=0;for(let c=1;c<o.length;c+=2){let l=Number(n[a]),d=o[c],_=o[c-1],h=d-_+1,u=f+h*3;s.fill(l,f,u),a++,f=u}t.id.value=s}function W_(t,e){let r=t.id.value,n=new Float32Array(r.length);for(let o=0;o<r.length;o++)n[o]=e[r[o]];t.id.value=n}function q_(t){return t?.metadata?.["i3s-feature-ids"]?.intArray}var Z_="4.3.0-alpha.4",Un={dataType:null,batchType:null,name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:Z_,mimeTypes:["application/octet-stream"],parse:Q_,extensions:["bin"],options:{"i3s-content":{}}};async function Q_(t,e,r){let{tile:n,_tileOptions:o,tileset:i,_tilesetOptions:s}=e?.i3s||{},a=o||n,f=s||i;return!a||!f?null:await xc(t,a,f,e,r)}var rt={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var OE=new v,bE=new v;var Or=new v,Ac=new v,ie=class{constructor(e=[0,0,0],r=0){V(this,"center",void 0),V(this,"radius",void 0),this.radius=-0,this.center=new v,this.fromCenterRadius(e,r)}fromCenterRadius(e,r){return this.center.from(e),this.radius=r,this}fromCornerPoints(e,r){return r=Or.from(r),this.center=new v().from(e).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new ie(this.center,this.radius)}union(e){let r=this.center,n=this.radius,o=e.center,i=e.radius,s=Or.copy(o).subtract(r),a=s.magnitude();if(n>=a+i)return this.clone();if(i>=a+n)return e.clone();let f=(n+a+i)*.5;return Ac.copy(s).scale((-n+f)/a).add(r),this.center.copy(Ac),this.radius=f,this}expand(e){let n=Or.from(e).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(e){this.center.transform(e);let r=gn.getScaling(Or,e);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(e){let r=this.distanceTo(e);return r*r}distanceTo(e){let n=Or.from(e).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(e){let r=this.center,n=this.radius,i=e.normal.dot(r)+e.distance;return i<-n?rt.OUTSIDE:i<n?rt.INTERSECTING:rt.INSIDE}};var Y_=new v,j_=new v,Gn=new v,kn=new v,zn=new v,J_=new v,$_=new v,Wt={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},se=class{constructor(e=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){V(this,"center",void 0),V(this,"halfAxes",void 0),this.center=new v().from(e),this.halfAxes=new j(r)}get halfSize(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new v(e).len(),new v(r).len(),new v(n).len()]}get quaternion(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),o=new v(e).normalize(),i=new v(r).normalize(),s=new v(n).normalize();return new He().fromMatrix3(new j([...o,...i,...s]))}fromCenterHalfSizeQuaternion(e,r,n){let o=new He(n),i=new j().fromQuaternion(o);return i[0]=i[0]*r[0],i[1]=i[1]*r[0],i[2]=i[2]*r[0],i[3]=i[3]*r[1],i[4]=i[4]*r[1],i[5]=i[5]*r[1],i[6]=i[6]*r[2],i[7]=i[7]*r[2],i[8]=i[8]*r[2],this.center=new v().from(e),this.halfAxes=i,this}clone(){return new se(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new ie){let r=this.halfAxes,n=r.getColumn(0,Gn),o=r.getColumn(1,kn),i=r.getColumn(2,zn),s=Y_.copy(n).add(o).add(i);return e.center.copy(this.center),e.radius=s.magnitude(),e}intersectPlane(e){let r=this.center,n=e.normal,o=this.halfAxes,i=n.x,s=n.y,a=n.z,f=Math.abs(i*o[Wt.COLUMN0ROW0]+s*o[Wt.COLUMN0ROW1]+a*o[Wt.COLUMN0ROW2])+Math.abs(i*o[Wt.COLUMN1ROW0]+s*o[Wt.COLUMN1ROW1]+a*o[Wt.COLUMN1ROW2])+Math.abs(i*o[Wt.COLUMN2ROW0]+s*o[Wt.COLUMN2ROW1]+a*o[Wt.COLUMN2ROW2]),c=n.dot(r)+e.distance;return c<=-f?rt.OUTSIDE:c>=f?rt.INSIDE:rt.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let r=j_.from(e).subtract(this.center),n=this.halfAxes,o=n.getColumn(0,Gn),i=n.getColumn(1,kn),s=n.getColumn(2,zn),a=o.magnitude(),f=i.magnitude(),c=s.magnitude();o.normalize(),i.normalize(),s.normalize();let l=0,d;return d=Math.abs(r.dot(o))-a,d>0&&(l+=d*d),d=Math.abs(r.dot(i))-f,d>0&&(l+=d*d),d=Math.abs(r.dot(s))-c,d>0&&(l+=d*d),l}computePlaneDistances(e,r,n=[-0,-0]){let o=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=this.center,a=this.halfAxes,f=a.getColumn(0,Gn),c=a.getColumn(1,kn),l=a.getColumn(2,zn),d=J_.copy(f).add(c).add(l).add(s),_=$_.copy(d).subtract(e),h=r.dot(_);return o=Math.min(h,o),i=Math.max(h,i),d.copy(s).add(f).add(c).subtract(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),i=Math.max(h,i),d.copy(s).add(f).subtract(c).add(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),i=Math.max(h,i),d.copy(s).add(f).subtract(c).subtract(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),i=Math.max(h,i),s.copy(d).subtract(f).add(c).add(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),i=Math.max(h,i),s.copy(d).subtract(f).add(c).subtract(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),i=Math.max(h,i),s.copy(d).subtract(f).subtract(c).add(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),i=Math.max(h,i),s.copy(d).subtract(f).subtract(c).subtract(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),i=Math.max(h,i),n[0]=o,n[1]=i,n}transform(e){this.center.transformAsPoint(e);let r=this.halfAxes.getColumn(0,Gn);r.transformAsPoint(e);let n=this.halfAxes.getColumn(1,kn);n.transformAsPoint(e);let o=this.halfAxes.getColumn(2,zn);return o.transformAsPoint(e),this.halfAxes=new j([...r,...n,...o]),this}getTransform(){throw new Error("not implemented")}};var gc=new v,Ec=new v,qt=class{constructor(e=[0,0,1],r=0){V(this,"normal",void 0),V(this,"distance",void 0),this.normal=new v,this.distance=-0,this.fromNormalDistance(e,r)}fromNormalDistance(e,r){return et(Number.isFinite(r)),this.normal.from(e).normalize(),this.distance=r,this}fromPointNormal(e,r){e=gc.from(e),this.normal.from(r).normalize();let n=-this.normal.dot(e);return this.distance=n,this}fromCoefficients(e,r,n,o){return this.normal.set(e,r,n),et(dt(this.normal.len(),1)),this.distance=o,this}clone(){return new qt(this.normal,this.distance)}equals(e){return dt(this.distance,e.distance)&&dt(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){let r=Ec.copy(this.normal).transformAsVector(e).normalize(),n=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(n,r)}projectPointOntoPlane(e,r=[0,0,0]){let n=gc.from(e),o=this.getPointDistance(n),i=Ec.copy(this.normal).scale(o);return n.subtract(i).to(r)}};var Sc=[new v([1,0,0]),new v([0,1,0]),new v([0,0,1])],Rc=new v,td=new v,St=class{constructor(e=[]){V(this,"planes",void 0),this.planes=e}fromBoundingSphere(e){this.planes.length=2*Sc.length;let r=e.center,n=e.radius,o=0;for(let i of Sc){let s=this.planes[o],a=this.planes[o+1];s||(s=this.planes[o]=new qt),a||(a=this.planes[o+1]=new qt);let f=Rc.copy(i).scale(-n).add(r);s.fromPointNormal(f,i);let c=Rc.copy(i).scale(n).add(r),l=td.copy(i).negate();a.fromPointNormal(c,l),o+=2}return this}computeVisibility(e){let r=rt.INSIDE;for(let n of this.planes)switch(e.intersectPlane(n)){case rt.OUTSIDE:return rt.OUTSIDE;case rt.INTERSECTING:r=rt.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(e,r){if(et(Number.isFinite(r),"parentPlaneMask is required."),r===St.MASK_OUTSIDE||r===St.MASK_INSIDE)return r;let n=St.MASK_INSIDE,o=this.planes;for(let i=0;i<this.planes.length;++i){let s=i<31?1<<i:0;if(i<31&&!(r&s))continue;let a=o[i],f=e.intersectPlane(a);if(f===rt.OUTSIDE)return St.MASK_OUTSIDE;f===rt.INTERSECTING&&(n|=s)}return n}};V(St,"MASK_OUTSIDE",4294967295);V(St,"MASK_INSIDE",0);V(St,"MASK_INDETERMINATE",2147483647);var jE=new v,JE=new v,$E=new v,tS=new v,eS=new v;var cS=new v,fS=new v,lS=new v,hS=new v,_S=new v,dS=new v,uS=new v,pS=new v,mS=new v,xS=new v,AS=new v,gS=new v;var RS=new j,TS=new j,MS=new j,yS=new j,wS=new j;var IS=new v,vS=new v,LS=new v,PS=new v,NS=new v,FS=new j,US={diagonal:new j,unitary:new j};var Mc=Bt(Vt(),1);var br;(function(t){t[t.ADD=1]="ADD",t[t.REPLACE=2]="REPLACE"})(br||(br={}));var Cr;(function(t){t.EMPTY="empty",t.SCENEGRAPH="scenegraph",t.POINTCLOUD="pointcloud",t.MESH="mesh"})(Cr||(Cr={}));var Br;(function(t){t.I3S="I3S",t.TILES3D="TILES3D"})(Br||(Br={}));var mi;(function(t){t.GEOMETRIC_ERROR="geometricError",t.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(mi||(mi={}));var Tc=Bt(Vt(),1);var od="4.3.0-alpha.4",Kn={dataType:null,batchType:null,name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:od,mimeTypes:["application/json"],parse:id,extensions:["json"],options:{i3s:{}}};async function id(t,e){return JSON.parse(new TextDecoder().decode(t))}var Dr=class{tileset;nodePages=[];pendingNodePages=[];nodesPerPage;options;lodSelectionMetricType;textureDefinitionsSelectedFormats=[];nodesInNodePages;url;textureLoaderOptions={};constructor(e,r="",n){this.tileset={...e},this.url=r,this.nodesPerPage=e.nodePages?.nodesPerPage||64,this.lodSelectionMetricType=e.nodePages?.lodSelectionMetricType,this.options=n,this.nodesInNodePages=0,this.initSelectedFormatsForTextureDefinitions(e)}async getNodeById(e){let r=Math.floor(e/this.nodesPerPage);if(!this.nodePages[r]&&!this.pendingNodePages[r]){let o=Ft(`${this.url}/nodepages/${r}`,this.options.i3s?.token);this.pendingNodePages[r]={status:"Pending",promise:(0,Tc.load)(o,Kn,this.options)},this.nodePages[r]=await this.pendingNodePages[r].promise,this.nodesInNodePages+=this.nodePages[r].nodes.length,this.pendingNodePages[r].status="Done"}this.pendingNodePages[r].status==="Pending"&&(this.nodePages[r]=await this.pendingNodePages[r].promise);let n=e%this.nodesPerPage;return this.nodePages[r].nodes[n]}async formTileFromNodePages(e){let r=await this.getNodeById(e),n=[],o=[];for(let h of r.children||[])o.push(this.getNodeById(h));let i=await Promise.all(o);for(let h of i)n.push({id:h.index.toString(),obb:h.obb});let s,a,f,c="jpg",l=[],d=!1;if(r&&r.mesh){let{url:h,isDracoGeometry:u}=r.mesh.geometry&&this.getContentUrl(r.mesh.geometry)||{isDracoGeometry:!1};s=h,d=u;let{textureData:x,materialDefinition:p}=this.getInformationFromMaterial(r.mesh.material);f=p,c=x.format||c,x.name&&(a=`${this.url}/nodes/${r.mesh.material.resource}/textures/${x.name}`),this.tileset.attributeStorageInfo&&(l=dc(this.tileset,this.url,r.mesh.attribute.resource))}let _=this.getLodSelection(r);return xi({id:e.toString(),lodSelection:_,obb:r.obb,contentUrl:s,textureUrl:a,attributeUrls:l,materialDefinition:f,textureFormat:c,textureLoaderOptions:this.textureLoaderOptions,children:n,isDracoGeometry:d})}getContentUrl(e){let r=null,n=this.tileset.geometryDefinitions[e.definition],o=-1;if(this.options.i3s&&this.options.i3s.useDracoGeometry&&(o=n.geometryBuffers.findIndex(i=>i.compressedAttributes&&i.compressedAttributes.encoding==="draco")),o===-1&&(o=n.geometryBuffers.findIndex(i=>!i.compressedAttributes)),o!==-1){let i=Boolean(n.geometryBuffers[o].compressedAttributes);r={url:`${this.url}/nodes/${e.resource}/geometries/${o}`,isDracoGeometry:i}}return r}getLodSelection(e){let r=[];return this.lodSelectionMetricType==="maxScreenThresholdSQ"&&r.push({metricType:"maxScreenThreshold",maxError:Math.sqrt(e.lodThreshold/(Math.PI*.25))}),r.push({metricType:this.lodSelectionMetricType,maxError:e.lodThreshold}),r}getInformationFromMaterial(e){let r={textureData:{name:null}};if(e){let n=this.tileset.materialDefinitions?.[e.definition];if(n){r.materialDefinition=n;let o=n?.pbrMetallicRoughness?.baseColorTexture?.textureSetDefinitionId;typeof o=="number"&&(r.textureData=this.textureDefinitionsSelectedFormats[o]||r.textureData)}}return r}initSelectedFormatsForTextureDefinitions(e){this.textureDefinitionsSelectedFormats=[];let r=this.getSupportedTextureFormats(),n=e.textureSetDefinitions||[];for(let o of n){let i=o&&o.formats||[],s=null;for(let a of r){let f=i.find(c=>c.format===a);if(f){s=f;break}}s&&s.format==="ktx2"&&(this.textureLoaderOptions.basis={format:vn(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(s)}}getSupportedTextureFormats(){let e=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=Er();r.has("etc2")&&e.push("ktx-etc2"),r.has("dxt")&&e.push("dds"),e.push("ktx2")}return e.push("jpg"),e.push("png"),e}};function yc(t,e){let r=e.url||"",n;t.geometryData&&(n=`${r}/${t.geometryData[0].href}`);let o;t.textureData&&(o=`${r}/${t.textureData[0].href}`);let i;t.attributeData&&(i=_c(r,t));let s=t.children||[];return xi({...t,children:s,url:r,contentUrl:n,textureUrl:o,textureFormat:"jpg",attributeUrls:i,isDracoGeometry:!1})}function xi(t){let e={},r=[0,0,0,1];if(t.mbs)r=t.mbs,e.sphere=[...gt.WGS84.cartographicToCartesian(t.mbs.slice(0,3)),t.mbs[3]];else if(t.obb){e.box=[...gt.WGS84.cartographicToCartesian(t.obb.center),...t.obb.halfSize,...t.obb.quaternion];let f=new se().fromCenterHalfSizeQuaternion(e.box.slice(0,3),t.obb.halfSize,t.obb.quaternion).getBoundingSphere();e.sphere=[...f.center,f.radius],r=[...t.obb.center,f.radius]}let n=t.lodSelection?.[0].metricType,o=t.lodSelection?.[0].maxError,i=Cr.MESH,s=br.REPLACE;return{...t,mbs:r,boundingVolume:e,lodMetricType:n,lodMetricValue:o,type:i,refine:s}}async function wc(t,e,r){let n=Nn(r.url||""),o,i;if(t.nodePages)o=new Dr(t,n,e),i=await o.formTileFromNodePages(0);else{let s=e.i3s,a=Ft(`${n}/nodes/root`,s.token);i=await(0,Mc.load)(a,Ir,{...e,i3s:{...e.i3s,loadContent:!1,isTileHeader:!0,isTileset:!1}})}return{...t,loader:Ir,url:n,basePath:n,type:Br.I3S,nodePagesTile:o,root:i,lodMetricType:i.lodMetricType,lodMetricValue:i.lodMetricValue}}var sd="4.3.0-alpha.4",ad=/layers\/[0-9]+$/,cd=/\.slpk$/,fd=/nodes\/([0-9-]+|root)$/,ld="504b0304",hd="PointCloud",Ir={dataType:null,batchType:null,name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:sd,mimeTypes:["application/octet-stream"],parse:_d,extensions:["bin"],options:{i3s:{token:null,isTileset:"auto",isTileHeader:"auto",tile:null,tileset:null,_tileOptions:null,_tilesetOptions:null,useDracoGeometry:!0,useCompressedTextures:!0,decodeTextures:!0,coordinateSystem:Pt.METER_OFFSETS}}};async function _d(t,e={},r){let n=r.url;if(e.i3s=e.i3s||{},md(t)===ld)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let i=Nn(n),s;e.i3s.isTileset==="auto"?s=ad.test(i)||cd.test(i):s=e.i3s.isTileset;let a;return e.isTileHeader==="auto"?a=fd.test(i):a=e.i3s.isTileHeader,s?t=await ud(t,e,r):a?t=await pd(t,r):t=await dd(t,e),t}async function dd(t,e){return await(0,Oc.parse)(t,Un,e)}async function ud(t,e,r){let n=JSON.parse(new TextDecoder().decode(t));if(n?.layerType===hd)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return await wc(n,e,r)}async function pd(t,e){return t=JSON.parse(new TextDecoder().decode(t)),yc(t,e)}function md(t){return t instanceof ArrayBuffer?[...new Uint8Array(t,0,4)].map(e=>e.toString(16).padStart(2,"0")).join(""):null}var vr=async(t,e)=>{let r=[await t.getUint8(t.length-1n),await t.getUint8(t.length-2n),await t.getUint8(t.length-3n),void 0],n=-1,o=t.length-4n;do{let i=o;o-=BigInt(1024),o=o>=0n?o:0n;let s=new Uint8Array(await t.slice(o,i));for(let a=s.length-1;a>-1;a--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=s[a],r.every((f,c)=>f===e[c])){n=a;break}}while(n===-1&&o>0n);return o+BigInt(n)};var bc=new Uint8Array([80,75,5,6]),Cc=new Uint8Array([80,75,6,7]),Bc=new Uint8Array([80,75,6,6]),xd=8n;var Ad=12n,gd=16n;var Ed=8n,Sd=24n;var Rd=40n,Td=48n;var Dc=async t=>{let e=await vr(t,bc),r=BigInt(await t.getUint16(e+xd)),n=BigInt(await t.getUint32(e+Ad)),o=BigInt(await t.getUint32(e+gd)),i=e-20n,s=0n,a=await t.slice(i,i+4n);if(ee(a,Cc)){s=await t.getBigUint64(i+Ed);let f=await t.slice(s,s+4n);if(!ee(f,Bc.buffer))throw new Error("zip64 EoCD not found");r=await t.getBigUint64(s+Sd),n=await t.getBigUint64(s+Rd),o=await t.getBigUint64(s+Td)}else i=0n;return{cdRecordsNumber:r,cdStartOffset:o,cdByteSize:n,offsets:{zip64EoCDOffset:s,zip64EoCDLocatorOffset:i,zipEoCDOffset:e}}};var OR=[{offset:0,size:4,default:new DataView(bc.buffer).getUint32(0,!0)},{offset:4,size:2,default:0},{offset:6,size:2,default:0},{offset:8,size:2,name:"recordsNumber"},{offset:10,size:2,name:"recordsNumber"},{offset:12,size:4,name:"cdSize"},{offset:16,size:4,name:"cdOffset"},{offset:20,size:2,default:0}];var bR=[{offset:0,size:4,default:new DataView(Cc.buffer).getUint32(0,!0)},{offset:4,size:4,default:0},{offset:8,size:8,name:"eoCDStart"},{offset:16,size:4,default:1}],CR=[{offset:0,size:4,default:new DataView(Bc.buffer).getUint32(0,!0)},{offset:4,size:8,default:44},{offset:12,size:2,default:45},{offset:14,size:2,default:45},{offset:16,size:4,default:0},{offset:20,size:4,default:0},{offset:24,size:8,name:"recordsNumber"},{offset:32,size:8,name:"recordsNumber"},{offset:40,size:8,name:"cdSize"},{offset:48,size:8,name:"cdOffset"}];var Md=20,yd=24,wd=28,Od=30,bd=32,Cd=42,Hn=46n,Pr=new Uint8Array([80,75,1,2]),Lr=async(t,e)=>{if(t>=e.length)return null;let r=new DataView(await e.slice(t,t+Hn)),n=r.buffer.slice(0,4);if(!ee(n,Pr.buffer))return null;let o=BigInt(r.getUint32(Md,!0)),i=BigInt(r.getUint32(yd,!0)),s=r.getUint16(Od,!0),a=BigInt(r.getUint16(bd,!0)),f=r.getUint16(wd,!0),c=await e.slice(t+Hn,t+Hn+BigInt(f+s)),l=c.slice(0,f),d=new TextDecoder().decode(l),_=t+Hn+BigInt(f),h=r.getUint32(Cd,!0),u=BigInt(h),x=new DataView(c.slice(f,c.byteLength)),p={uncompressedSize:i,compressedSize:o,localHeaderOffset:u,startDisk:a},S=Bd(p,x);return{...p,...S,extraFieldLength:s,fileNameLength:f,fileName:d,extraOffset:_}};async function*qe(t){let{cdStartOffset:e,cdByteSize:r}=await Dc(t),n=new ue(new DataView(await t.slice(e,e+r))),o=await Lr(0n,n);for(;o;)yield o,o=await Lr(o.extraOffset+BigInt(o.extraFieldLength),n)}var Ic=(...t)=>t[0]+t[1]*16,Bd=(t,e)=>{let r=Dd(t),n={};if(r.length>0){let o=r.reduce((a,f)=>a+f.length,0),i=new Uint8Array(e.buffer).findIndex((a,f,c)=>Ic(c[f],c[f+1])===1&&Ic(c[f+2],c[f+3])===o),s=0;for(let a of r){let f=s;n[a.name]=e.getBigUint64(i+4+f,!0),s=f+a.length}}return n},Dd=t=>{let e=[];return t.uncompressedSize===BigInt(4294967295)&&e.push({name:"uncompressedSize",length:8}),t.compressedSize===BigInt(4294967295)&&e.push({name:"compressedSize",length:8}),t.localHeaderOffset===BigInt(4294967295)&&e.push({name:"localHeaderOffset",length:8}),t.startDisk===BigInt(4294967295)&&e.push({name:"startDisk",length:4}),e};var vR=[{offset:0,size:4,default:new DataView(Pr.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:45},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:2,default:0},{offset:16,size:4,name:"crc32"},{offset:20,size:4,name:"length"},{offset:24,size:4,name:"length"},{offset:28,size:2,name:"fnlength"},{offset:30,size:2,default:0,name:"extraLength"},{offset:32,size:2,default:0},{offset:34,size:2,default:0},{offset:36,size:2,default:0},{offset:38,size:4,default:0},{offset:42,size:4,name:"offset"}];var Id=8,vd=18,Ld=22,Pd=26,Nd=28,Vn=30n,Ai=new Uint8Array([80,75,3,4]),Ae=async(t,e)=>{let r=new DataView(await e.slice(t,t+Vn)),n=r.buffer.slice(0,4);if(!ee(n,Ai))return null;let o=r.getUint16(Pd,!0),i=r.getUint16(Nd,!0),s=await e.slice(t+Vn,t+Vn+BigInt(o+i)),a=s.slice(0,o),f=new DataView(s.slice(o,s.byteLength)),c=new TextDecoder().decode(a).split("\\").join("/"),l=t+Vn+BigInt(o+i),d=r.getUint16(Id,!0),_=BigInt(r.getUint32(vd,!0)),h=BigInt(r.getUint32(Ld,!0)),u=4;return h===BigInt(4294967295)&&(h=f.getBigUint64(u,!0),u+=8),_===BigInt(4294967295)&&(_=f.getBigUint64(u,!0),u+=8),l===BigInt(4294967295)&&(l=f.getBigUint64(u,!0)),{fileNameLength:o,fileName:c,extraFieldLength:i,fileDataOffset:l,compressedSize:_,compressionMethod:d}};var NR=[{offset:0,size:4,default:new DataView(Ai.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:0},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:4,name:"crc32"},{offset:18,size:4,name:"length"},{offset:22,size:4,name:"length"},{offset:26,size:2,name:"fnlength"},{offset:28,size:2,default:0,name:"extraLength"}];var Xn=class{constructor(e={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(e,r="base64"){let n=[];for await(let s of e)n.push(s),yield s;let o=await this.concatenate(n),i=await this.hash(o,r);this.options.crypto?.onEnd?.({hash:i})}async concatenate(e){return await ar(e)}};function vc(t){t=`${t}`;for(let r=0;r<t.length;r++)if(t.charCodeAt(r)>255)return null;let e="";for(let r=0;r<t.length;r+=3){let n=[void 0,void 0,void 0,void 0];n[0]=t.charCodeAt(r)>>2,n[1]=(t.charCodeAt(r)&3)<<4,t.length>r+1&&(n[1]|=t.charCodeAt(r+1)>>4,n[2]=(t.charCodeAt(r+1)&15)<<2),t.length>r+2&&(n[2]|=t.charCodeAt(r+2)>>6,n[3]=t.charCodeAt(r+2)&63);for(let o=0;o<n.length;o++)typeof n[o]>"u"?e+="=":e+=Fd(n[o])}return e}function Fd(t){if(t<26)return String.fromCharCode(t+"A".charCodeAt(0));if(t<52)return String.fromCharCode(t-26+"a".charCodeAt(0));if(t<62)return String.fromCharCode(t-52+"0".charCodeAt(0));if(t===62)return"+";if(t===63)return"/"}function Lc(t,e){switch(e){case"hex":return t;case"base64":return Ud(t);default:throw new Error(e)}}function Ud(t){t.length%2!==0&&(t=`0${t}`);let r=(t.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return vc(r)||""}var Nc=typeof atob=="function"?atob:typeof Buffer=="function"?Xd:Uc,Gd=Nc("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALB7oCJQhvbmVGdWxsQQAYCG9uZUZ1bGxCABkIb25lRnVsbEMAGghvbmVGdWxsRAAbBWxvb3BzAAEEbG9vcAACBXByaW1lAAMFbG9vcEEABAZsb29wQTEABQZsb29wQTIABgZsb29wQTMABwZsb29wQTQACAVsb29wQgAJBmxvb3BCMQAKBmxvb3BCMgALBmxvb3BCMwAMBmxvb3BCNAANBWxvb3BDAA4GbG9vcEMxAA8GbG9vcEMyABAGbG9vcEMzABEGbG9vcEM0ABIFbG9vcEQAEwZsb29wRDEAFAZsb29wRDIAFQZsb29wRDMAFgZsb29wRDQAFwRnZXRBACgEZ2V0QgApBGdldEMAKgRnZXREACsEZ2V0WAAsBHNldEEALQRzZXRCAC4Ec2V0QwAvBHNldEQAMARzZXRYADEKzA0xWwEBf0EAJAggAEEGdCEBAkADQCMIIAFGDQEjACQEIwEkBSMCJAYjAyQHEAIjBCMAaiQAIwUjAWokASMGIwJqJAIjByMDaiQDIwhBwABqJAgMAAsLIwgjGmokGgsTACMIIxpqJAkQAxAEEAkQDhATC6IBAEEAIwlqKAIAJApBBCMJaigCACQLQQgjCWooAgAkDEEMIwlqKAIAJA1BECMJaigCACQOQRQjCWooAgAkD0EYIwlqKAIAJBBBHCMJaigCACQRQSAjCWooAgAkEkEkIwlqKAIAJBNBKCMJaigCACQUQSwjCWooAgAkFUEwIwlqKAIAJBZBNCMJaigCACQXQTgjCWooAgAkGEE8IwlqKAIAJBkLCgAQBRAGEAcQCAsuAEH4yKq7fSMKahAYQdbunsZ+IwtqEBtB2+GBoQIjDGoQGkHunfeNfCMNahAZCy0AQa+f8Kt/Iw5qEBhBqoyfvAQjD2oQG0GTjMHBeiMQahAaQYGqmmojEWoQGQssAEHYsYLMBiMSahAYQa/vk9p4IxNqEBtBsbd9IxRqEBpBvq/zyngjFWoQGQstAEGiosDcBiMWahAYQZPj4WwjF2oQG0GOh+WzeiMYahAaQaGQ0M0EIxlqEBkLCgAQChALEAwQDQsuAEHiyviwfyMLahAcQcDmgoJ8IxBqEB9B0bT5sgIjFWoQHkGqj9vNfiMKahAdCy0AQd2gvLF9Iw9qEBxB06iQEiMUahAfQYHNh8V9IxlqEB5ByPfPvn4jDmoQHQsuAEHmm4ePAiMTahAcQdaP3Jl8IxhqEB9Bh5vUpn8jDWoQHkHtqeiqBCMSahAdCy0AQYXSj896IxdqEBxB+Me+ZyMMahAfQdmFvLsGIxFqEB5Bipmp6XgjFmoQHQsKABAPEBAQERASCysAQcLyaCMPahAgQYHtx7t4IxJqECNBosL17AYjFWoQIkGM8JRvIxhqECELLgBBxNT7pXojC2oQIEGpn/veBCMOahAjQeCW7bV/IxFqECJB8Pj+9XsjFGoQIQstAEHG/e3EAiMXahAgQfrPhNV+IwpqECNBheG8p30jDWoQIkGFuqAkIxBqECELLgBBuaDTzn0jE2oQIEHls+62fiMWahAjQfj5if0BIxlqECJB5ayxpXwjDGoQIQsKABAUEBUQFhAXCy0AQcTEpKF/IwpqECRBl/+rmQQjEWoQJ0Gnx9DceiMYahAmQbnAzmQjD2oQJQstAEHDs+2qBiMWahAkQZKZs/h4Iw1qECdB/ei/fyMUahAmQdG7kax4IwtqECULLQBBz/yh/QYjEmoQJEHgzbNxIxlqECdBlIaFmHojEGoQJkGho6DwBCMXahAlCy4AQYL9zbp/Iw5qECRBteTr6XsjFWoQJ0G7pd/WAiMMahAmQZGnm9x+IxNqECULKAEBf0F/IwFzIwNxIwEjAnFyIwBqIABqIgFBB3QgAUEZdnIjAWokAAsoAQF/QX8jAnMjAHEjAiMDcXIjAWogAGoiAUEWdCABQQp2ciMCaiQBCygBAX9BfyMDcyMBcSMDIwBxciMCaiAAaiIBQRF0IAFBD3ZyIwNqJAILKAEBf0F/IwBzIwJxIwAjAXFyIwNqIABqIgFBDHQgAUEUdnIjAGokAwsoAQF/IwJBfyMDc3EjASMDcXIjAGogAGoiAUEFdCABQRt2ciMBaiQACygBAX8jA0F/IwBzcSMCIwBxciMBaiAAaiIBQRR0IAFBDHZyIwJqJAELKAEBfyMAQX8jAXNxIwMjAXFyIwJqIABqIgFBDnQgAUESdnIjA2okAgsoAQF/IwFBfyMCc3EjACMCcXIjA2ogAGoiAUEJdCABQRd2ciMAaiQDCyIBAX8jASMCcyMDcyMAaiAAaiIBQQR0IAFBHHZyIwFqJAALIgEBfyMCIwNzIwBzIwFqIABqIgFBF3QgAUEJdnIjAmokAQsiAQF/IwMjAHMjAXMjAmogAGoiAUEQdCABQRB2ciMDaiQCCyIBAX8jACMBcyMCcyMDaiAAaiIBQQt0IAFBFXZyIwBqJAMLJQEBf0F/IwNzIwFyIwJzIwBqIABqIgFBBnQgAUEadnIjAWokAAslAQF/QX8jAHMjAnIjA3MjAWogAGoiAUEVdCABQQt2ciMCaiQBCyUBAX9BfyMBcyMDciMAcyMCaiAAaiIBQQ90IAFBEXZyIwNqJAILJQEBf0F/IwJzIwByIwFzIwNqIABqIgFBCnQgAUEWdnIjAGokAwsEACMACwQAIwELBAAjAgsEACMDCwQAIxoLBgAgACQACwYAIAAkAQsGACAAJAILBgAgACQDCwYAIAAkGgsA6gQEbmFtZQGSAzIAA2xvZwEFbG9vcHMCBGxvb3ADBXByaW1lBAVsb29wQQUGbG9vcEExBgZsb29wQTIHBmxvb3BBMwgGbG9vcEE0CQVsb29wQgoGbG9vcEIxCwZsb29wQjIMBmxvb3BCMw0GbG9vcEI0DgVsb29wQw8GbG9vcEMxEAZsb29wQzIRBmxvb3BDMxIGbG9vcEM0EwVsb29wRBQGbG9vcEQxFQZsb29wRDIWBmxvb3BEMxcGbG9vcEQ0GAhvbmVGdWxsQRkIb25lRnVsbEIaCG9uZUZ1bGxDGwhvbmVGdWxsRBwIdHdvRnVsbEEdCHR3b0Z1bGxCHgh0d29GdWxsQx8IdHdvRnVsbEQgCHRyZUZ1bGxBIQh0cmVGdWxsQiIIdHJlRnVsbEMjCHRyZUZ1bGxEJAhxdWFGdWxsQSUIcXVhRnVsbEImCHF1YUZ1bGxDJwhxdWFGdWxsRCgEZ2V0QSkEZ2V0QioEZ2V0QysEZ2V0RCwEZ2V0WC0Ec2V0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),gi=WebAssembly&&Nc!==Uc?Vd(Gd).buffer:!1,Ut=Wd(),Ei=240*16*16,Fc=Math.floor(Ei*16*1.066666667),kd=268435456-65536,Pc="Parameter must be Buffer, ArrayBuffer or Uint8Array",zd="Parameter exceeds max size of 255.9 Mbytes";gi||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function Si(t){var e,r,n,o,i,s,a,f,c,l;let d=Hd(),_=Kd(),h={},u=new Date().getTime();return h.then=function(y){return a=y,p(),h},h.catch=function(y){return f=y,h},t&&typeof t=="object"?typeof Buffer=="function"&&t.constructor===Buffer?s=t:t.constructor===Uint8Array||t.constructor===ArrayBuffer?s=t.constructor===ArrayBuffer?new Uint8Array(t):t:S(new TypeError(Pc)):S(new TypeError(Pc)),s&&(i=s.length,gi&&i>Fc?i>kd?S(new Error(zd)):(e=new WebAssembly.Memory({initial:i>32e6?i>64e6?i>128e6?4096:2048:1024:512}),r=new Uint32Array(e.buffer),o={mem:e,log:console.log},n={imports:o},WebAssembly.instantiate(gi,n).then(x)):p(d(s))),h;function x(y){p(_(s,y.instance.exports,r))}function p(y){var B=Boolean(y)?y:c;Boolean(y)&&(l=new Date().getTime()),typeof a=="function"?Boolean(B)&&(a(B,l-u),a=f=null):Boolean(y)&&(c=y)}function S(y){typeof f=="function"&&f(y)}}function Kd(){var t,e,r,n,o,i,s,a,f,c,l,d,_,h=function(u){var x,p,S,y,B,T,R,D,I,L,A,m,g,E,U,F,G,P,J,ot,X,it,bt=new Date().getTime(),De=0,O=1732584193,w=-271733879,b=-1732584194,C=271733878,Q=0,ir=u.length*8,rn;for(rn=Vl(u,_),_[ir>>>5]|=128<<ir%32,_[(ir+64>>>9<<4)+14]=ir,rn=(ir+64>>>9<<4)+15,X=_;Q<rn;)rn>Q+Fc?(n(O),i(w),a(b),c(C),e(Ei),Q=Q+Ei*16,O=r(),w=o(),b=s(),C=f(),De++):(G=O,P=w,J=b,ot=C,x=X[Q+0]>>>0,p=X[Q+1]>>>0,S=X[Q+2]>>>0,y=X[Q+3]>>>0,B=X[Q+4]>>>0,T=X[Q+5]>>>0,R=X[Q+6]>>>0,D=X[Q+7]>>>0,I=X[Q+8]>>>0,L=X[Q+9]>>>0,A=X[Q+10]>>>0,m=X[Q+11]>>>0,g=X[Q+12]>>>0,E=X[Q+13]>>>0,U=X[Q+14]>>>0,F=X[Q+15]>>>0,O=N(7,25,O+(w&b|~w&C)+x-680876936)+w,C=N(12,20,C+(O&w|~O&b)+p-389564586)+O,b=N(17,15,b+(C&O|~C&w)+S+606105819)+C,w=N(22,10,w+(b&C|~b&O)+y-1044525330)+b,O=N(7,25,O+(w&b|~w&C)+B-176418897)+w,C=N(12,20,C+(O&w|~O&b)+T+1200080426)+O,b=N(17,15,b+(C&O|~C&w)+R-1473231341)+C,w=N(22,10,w+(b&C|~b&O)+D-45705983)+b,O=N(7,25,O+(w&b|~w&C)+I+1770035416)+w,C=N(12,20,C+(O&w|~O&b)+L-1958414417)+O,b=N(17,15,b+(C&O|~C&w)+A-42063)+C,w=N(22,10,w+(b&C|~b&O)+m-1990404162)+b,O=N(7,25,O+(w&b|~w&C)+g+1804603682)+w,C=N(12,20,C+(O&w|~O&b)+E-40341101)+O,b=N(17,15,b+(C&O|~C&w)+U-1502002290)+C,w=N(22,10,w+(b&C|~b&O)+F+1236535329)+b,O=N(5,27,O+(w&C|b&~C)+p-165796510)+w,C=N(9,23,C+(O&b|w&~b)+R-1069501632)+O,b=N(14,18,b+(C&w|O&~w)+m+643717713)+C,w=N(20,12,w+(b&O|C&~O)+x-373897302)+b,O=N(5,27,O+(w&C|b&~C)+T-701558691)+w,C=N(9,23,C+(O&b|w&~b)+A+38016083)+O,b=N(14,18,b+(C&w|O&~w)+F-660478335)+C,w=N(20,12,w+(b&O|C&~O)+B-405537848)+b,O=N(5,27,O+(w&C|b&~C)+L+568446438)+w,C=N(9,23,C+(O&b|w&~b)+U-1019803690)+O,b=N(14,18,b+(C&w|O&~w)+y-187363961)+C,w=N(20,12,w+(b&O|C&~O)+I+1163531501)+b,O=N(5,27,O+(w&C|b&~C)+E-1444681467)+w,C=N(9,23,C+(O&b|w&~b)+S-51403784)+O,b=N(14,18,b+(C&w|O&~w)+D+1735328473)+C,w=N(20,12,w+(b&O|C&~O)+g-1926607734)+b,O=N(4,28,O+(w^b^C)+T-378558)+w,C=N(11,21,C+(O^w^b)+I-2022574463)+O,b=N(16,16,b+(C^O^w)+m+1839030562)+C,w=N(23,9,w+(b^C^O)+U-35309556)+b,O=N(4,28,O+(w^b^C)+p-1530992060)+w,C=N(11,21,C+(O^w^b)+B+1272893353)+O,b=N(16,16,b+(C^O^w)+D-155497632)+C,w=N(23,9,w+(b^C^O)+A-1094730640)+b,O=N(4,28,O+(w^b^C)+E+681279174)+w,C=N(11,21,C+(O^w^b)+x-358537222)+O,b=N(16,16,b+(C^O^w)+y-722521979)+C,w=N(23,9,w+(b^C^O)+R+76029189)+b,O=N(4,28,O+(w^b^C)+L-640364487)+w,C=N(11,21,C+(O^w^b)+g-421815835)+O,b=N(16,16,b+(C^O^w)+F+530742520)+C,w=N(23,9,w+(b^C^O)+S-995338651)+b,O=N(6,26,O+(b^(w|~C))+x-198630844)+w,C=N(10,22,C+(w^(O|~b))+D+1126891415)+O,b=N(15,17,b+(O^(C|~w))+U-1416354905)+C,w=N(21,11,w+(C^(b|~O))+T-57434055)+b,O=N(6,26,O+(b^(w|~C))+g+1700485571)+w,C=N(10,22,C+(w^(O|~b))+y-1894986606)+O,b=N(15,17,b+(O^(C|~w))+A-1051523)+C,w=N(21,11,w+(C^(b|~O))+p-2054922799)+b,O=N(6,26,O+(b^(w|~C))+I+1873313359)+w,C=N(10,22,C+(w^(O|~b))+F-30611744)+O,b=N(15,17,b+(O^(C|~w))+R-1560198380)+C,w=N(21,11,w+(C^(b|~O))+E+1309151649)+b,O=N(6,26,O+(b^(w|~C))+B-145523070)+w,C=N(10,22,C+(w^(O|~b))+m-1120210379)+O,b=N(15,17,b+(O^(C|~w))+S+718787259)+C,w=N(21,11,w+(C^(b|~O))+L-343485551)+b,Q=Q+16,O=O+G>>>0,w=w+P>>>0,b=b+J>>>0,C=C+ot>>>0);return Ut.endian([O,w,b,C]);function N(st,nn,Ct){return Ct<<st|Ct>>>nn}function Vl(st,nn){for(var Ct=-1,_o=Math.floor((st.length-1)/4),lt=0,is,ss,as,cs;_o-8>Ct++;)lt=Ct<<2,nn[Ct]=st[lt+0]|st[lt+1]<<8|st[lt+2]<<16|st[lt+3]<<24;for(Ct--;_o>Ct++;)lt=Ct<<2,is=typeof st[lt+0]>"u"?0:st[lt+0],ss=typeof st[lt+1]>"u"?0:st[lt+1],as=typeof st[lt+2]>"u"?0:st[lt+2],cs=typeof st[lt+3]>"u"?0:st[lt+3],nn[Ct]=is|ss<<8|as<<16|cs<<24;return _o+1}};return function(u,x,p,S){var y;return e=x.loops,t=x.loop,r=x.getA,o=x.getB,s=x.getC,f=x.getD,l=x.getX,n=x.setA,i=x.setB,a=x.setC,c=x.setD,d=x.setX,_=p,y=Ut.wordsToBytes(h(u)),S&&S.asBytes?y:Ut.bytesconvertNumberToHex(y)}}function Hd(){var t=function(e,r){var n,o,i,s,a,f,c,l,d,_,h,u,x,p,S,y,B,T,R,D,I,L=new Date().getTime(),A=1732584193,m=-271733879,g=-1732584194,E=271733878,U=e.length*8;I=Ut.bytesToWords(e);for(var F=0;F<I.length;F++)I[F]=(I[F]<<8|I[F]>>>24)&16711935|(I[F]<<24|I[F]>>>8)&4278255360;I[U>>>5]|=128<<U%32,I[(U+64>>>9<<4)+14]=U;for(var G=0;G<I.length;G+=16)B=A,T=m,R=g,D=E,n=I[G+0]>>>0,o=I[G+1]>>>0,i=I[G+2]>>>0,s=I[G+3]>>>0,a=I[G+4]>>>0,f=I[G+5]>>>0,c=I[G+6]>>>0,l=I[G+7]>>>0,d=I[G+8]>>>0,_=I[G+9]>>>0,h=I[G+10]>>>0,u=I[G+11]>>>0,x=I[G+12]>>>0,p=I[G+13]>>>0,S=I[G+14]>>>0,y=I[G+15]>>>0,A=P(7,25,A+(m&g|~m&E)+n-680876936)+m,E=P(12,20,E+(A&m|~A&g)+o-389564586)+A,g=P(17,15,g+(E&A|~E&m)+i+606105819)+E,m=P(22,10,m+(g&E|~g&A)+s-1044525330)+g,A=P(7,25,A+(m&g|~m&E)+a-176418897)+m,E=P(12,20,E+(A&m|~A&g)+f+1200080426)+A,g=P(17,15,g+(E&A|~E&m)+c-1473231341)+E,m=P(22,10,m+(g&E|~g&A)+l-45705983)+g,A=P(7,25,A+(m&g|~m&E)+d+1770035416)+m,E=P(12,20,E+(A&m|~A&g)+_-1958414417)+A,g=P(17,15,g+(E&A|~E&m)+h-42063)+E,m=P(22,10,m+(g&E|~g&A)+u-1990404162)+g,A=P(7,25,A+(m&g|~m&E)+x+1804603682)+m,E=P(12,20,E+(A&m|~A&g)+p-40341101)+A,g=P(17,15,g+(E&A|~E&m)+S-1502002290)+E,m=P(22,10,m+(g&E|~g&A)+y+1236535329)+g,A=P(5,27,A+(m&E|g&~E)+o-165796510)+m,E=P(9,23,E+(A&g|m&~g)+c-1069501632)+A,g=P(14,18,g+(E&m|A&~m)+u+643717713)+E,m=P(20,12,m+(g&A|E&~A)+n-373897302)+g,A=P(5,27,A+(m&E|g&~E)+f-701558691)+m,E=P(9,23,E+(A&g|m&~g)+h+38016083)+A,g=P(14,18,g+(E&m|A&~m)+y-660478335)+E,m=P(20,12,m+(g&A|E&~A)+a-405537848)+g,A=P(5,27,A+(m&E|g&~E)+_+568446438)+m,E=P(9,23,E+(A&g|m&~g)+S-1019803690)+A,g=P(14,18,g+(E&m|A&~m)+s-187363961)+E,m=P(20,12,m+(g&A|E&~A)+d+1163531501)+g,A=P(5,27,A+(m&E|g&~E)+p-1444681467)+m,E=P(9,23,E+(A&g|m&~g)+i-51403784)+A,g=P(14,18,g+(E&m|A&~m)+l+1735328473)+E,m=P(20,12,m+(g&A|E&~A)+x-1926607734)+g,A=P(4,28,A+(m^g^E)+f-378558)+m,E=P(11,21,E+(A^m^g)+d-2022574463)+A,g=P(16,16,g+(E^A^m)+u+1839030562)+E,m=P(23,9,m+(g^E^A)+S-35309556)+g,A=P(4,28,A+(m^g^E)+o-1530992060)+m,E=P(11,21,E+(A^m^g)+a+1272893353)+A,g=P(16,16,g+(E^A^m)+l-155497632)+E,m=P(23,9,m+(g^E^A)+h-1094730640)+g,A=P(4,28,A+(m^g^E)+p+681279174)+m,E=P(11,21,E+(A^m^g)+n-358537222)+A,g=P(16,16,g+(E^A^m)+s-722521979)+E,m=P(23,9,m+(g^E^A)+c+76029189)+g,A=P(4,28,A+(m^g^E)+_-640364487)+m,E=P(11,21,E+(A^m^g)+x-421815835)+A,g=P(16,16,g+(E^A^m)+y+530742520)+E,m=P(23,9,m+(g^E^A)+i-995338651)+g,A=P(6,26,A+(g^(m|~E))+n-198630844)+m,E=P(10,22,E+(m^(A|~g))+l+1126891415)+A,g=P(15,17,g+(A^(E|~m))+S-1416354905)+E,m=P(21,11,m+(E^(g|~A))+f-57434055)+g,A=P(6,26,A+(g^(m|~E))+x+1700485571)+m,E=P(10,22,E+(m^(A|~g))+s-1894986606)+A,g=P(15,17,g+(A^(E|~m))+h-1051523)+E,m=P(21,11,m+(E^(g|~A))+o-2054922799)+g,A=P(6,26,A+(g^(m|~E))+d+1873313359)+m,E=P(10,22,E+(m^(A|~g))+y-30611744)+A,g=P(15,17,g+(A^(E|~m))+c-1560198380)+E,m=P(21,11,m+(E^(g|~A))+p+1309151649)+g,A=P(6,26,A+(g^(m|~E))+a-145523070)+m,E=P(10,22,E+(m^(A|~g))+u-1120210379)+A,g=P(15,17,g+(A^(E|~m))+i+718787259)+E,m=P(21,11,m+(E^(g|~A))+_-343485551)+g,A=A+B>>>0,m=m+T>>>0,g=g+R>>>0,E=E+D>>>0;return Ut.endian([A,m,g,E]);function P(J,ot,X){return X<<J|X>>>ot}};return function(e,r){var n=Ut.wordsToBytes(t(e,r)),o=r&&r.asBytes?n:Ut.bytesconvertNumberToHex(n);return o}}function Vd(t){var e,r,n,o=-1;for(e=t.length-1,r=new ArrayBuffer(t.length),n=new Uint8Array(r);e>o++;)n[o]=t.charCodeAt(o);return n}function Xd(t){return Buffer.from(t,"base64").toString("binary")}function Uc(t){return t}function Wd(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(e,r){return e<<r|e>>>32-r},endian:function(e){if(e.constructor==Number)return Ut.rotl(e,8)&16711935|Ut.rotl(e,24)&4278255360;for(var r=0;r<e.length;r++)e[r]=Ut.endian(e[r]);return e},bytesToWords:function(e){for(var r=[],n=0,o=0;n<e.length;n++,o+=8)r[o>>>5]|=e[n]<<24-o%32;return r},wordsToBytes:function(e){for(var r=[],n=0;n<e.length*32;n+=8)r.push(e[n>>>5]>>>24-n%32&255);return r},bytesconvertNumberToHex:function(e){for(var r=[],n=0;n<e.length;n++)r.push((e[n]>>>4).toString(16)),r.push((e[n]&15).toString(16));return r.join("")}}}var ge=class extends Xn{name="md5";options;constructor(e={}){super(),this.options=e}async hash(e,r){let o=await new Promise((i,s)=>Si(e).then(i).catch(s));return Lc(o,r)}};var Wn=class{constructor(e){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(e={}){sr(e)}async compress(e){return await this.preload(),this.compressSync(e)}async decompress(e,r){return await this.preload(),this.decompressSync(e,r)}compressSync(e){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(e,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(e){let r=await this.concatenate(e);yield this.compress(r)}async*decompressBatches(e){let r=await this.concatenate(e);yield this.decompress(r)}concatenate(e){return ar(e)}improveError(e){return e.message.includes(this.name)||(e.message=`${this.name} ${e.message}`),e}};var be=Bt(wl(),1),Jt=Bt(Ol(),1);var Ce=class extends Wn{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(e={}){super(e),this.options=e}async compress(e){if(!At&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Pe(Jt.default.gzip)(e):await Pe(Jt.default.deflate)(e);return Le(r)}return this.compressSync(e)}async decompress(e){if(!At&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Pe(Jt.default.gunzip)(e):await Pe(Jt.default.inflate)(e);return Le(r)}return this.decompressSync(e)}compressSync(e){if(!At&&this.options.deflate?.useZlib){let i=this.options.deflate?.gzip?Jt.default.gzipSync(e):Jt.default.deflateSync(e);return Le(i)}let r=this.options?.deflate||{},n=new Uint8Array(e);return(this.options?.raw?be.default.deflateRaw:be.default.deflate)(n,r).buffer}decompressSync(e){if(!At&&this.options.deflate?.useZlib){let i=this.options.deflate?.gzip?Jt.default.gunzipSync(e):Jt.default.inflateSync(e);return Le(i)}let r=this.options?.deflate||{},n=new Uint8Array(e);return(this.options?.raw?be.default.inflateRaw:be.default.inflate)(n,r).buffer}async*compressBatches(e){let r=this.options?.deflate||{},n=new be.default.Deflate(r);yield*this.transformBatches(n,e)}async*decompressBatches(e){let r=this.options?.deflate||{},n=new be.default.Inflate(r);yield*this.transformBatches(n,e)}async*transformBatches(e,r){e.onData=this._onData.bind(this),e.onEnd=this._onEnd.bind(this);for await(let s of r){let a=new Uint8Array(s);if(!e.push(a,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),o=e.push(n,!0);yield*this._getChunks()}_onData(e){this._chunks.push(e)}_onEnd(e){if(e!==0)throw new Error(this._getError(e)+this._chunks.length)}_getChunks(){let e=this._chunks;return this._chunks=[],e}_getError(e=0){let r={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"};return`${this.name}: ${r[e]}`}};var Jr=class extends Ce{name="gzip";extensions=["gz","gzip"];contentEncodings=["gzip","x-gzip"];isSupported=!0;constructor(e){super({...e,deflate:{...e?.gzip,gzip:!0}})}};var Gp={0:async t=>t,8:async t=>await new Ce({raw:!0}).decompress(t)},fo=class{fileProvider=null;fileName;archive=null;constructor(e){if(typeof e=="string")if(this.fileName=e,!At)this.fileProvider=new fr(e);else throw new Error("Cannot open file for random access in a WEB browser");else e instanceof Be?(this.fileProvider=e.fileProvider,this.archive=e,this.fileName=e.fileName):go(e)&&(this.fileProvider=e)}async destroy(){this.fileProvider&&await this.fileProvider.destroy()}async readdir(){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let e=[],r=qe(this.fileProvider);for await(let n of r)e.push(n.fileName);return e}async stat(e){let r=await this.getCDFileHeader(e);return{...r,size:Number(r.uncompressedSize)}}async fetch(e){this.fileName&&e.indexOf(this.fileName)===0&&(e=e.substring(this.fileName.length+1));let r;if(this.archive)r=await this.archive.getFile(e,"http");else{if(!this.fileProvider)throw new Error("No data detected in the zip archive");let o=await this.getCDFileHeader(e),i=await Ae(o.localHeaderOffset,this.fileProvider);if(!i)throw new Error("Local file header has not been found in the zip archive`");let s=Gp[i.compressionMethod.toString()];if(!s)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(i.fileDataOffset,i.fileDataOffset+i.compressedSize);r=await s(a)}let n=new Response(r);return Object.defineProperty(n,"url",{value:e?`${this.fileName||""}/${e}`:this.fileName||""}),n}async getCDFileHeader(e){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=qe(this.fileProvider),n=null;for await(let o of r)if(o.fileName===e){n=o;break}if(!n)throw new Error("File has not been found in the zip archive");return n}};var Be=class{fileProvider;fileName;constructor(e,r,n){this.fileProvider=e,this.fileName=n}async getFileWithoutHash(e){return await(await new fo(this.fileProvider).fetch(e)).arrayBuffer()}};function rs(t){let e=new DataView(t),r={};for(let n=0;n<t.byteLength;n=n+24){let o=e.getBigUint64(n+16,!0),i=kp(t,n,16);r[i]=o}return r}function kp(t,e,r){return[...new Uint8Array(t,e,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function ns(t){let e=qe(t);return zp(e)}async function zp(t){let e=new ge,r=new TextEncoder,n={};for await(let o of t){let i=o.fileName.split("\\").join("/").toLocaleLowerCase(),s=r.encode(i).buffer,a=await e.hash(s,"hex");n[a]=o.localHeaderOffset}return n}var Kp=[{test:/^$/,extensions:["3dSceneLayer.json.gz"]},{test:/^nodepages\/\d+$/,extensions:[".json.gz"]},{test:/^nodes\/(\d+|root)$/,extensions:["/3dNodeIndexDocument.json.gz"]},{test:/^nodes\/\d+\/textures\/.+$/,extensions:[".jpg",".png",".bin.dds.gz",".ktx",".ktx2"]},{test:/^nodes\/\d+\/geometries\/\d+$/,extensions:[".bin.gz",".draco.gz"]},{test:/^nodes\/\d+\/attributes\/f_\d+\/\d+$/,extensions:[".bin.gz"]},{test:/^statistics\/f_\d+\/\d+$/,extensions:[".json.gz"]},{test:/^nodes\/\d+\/shared$/,extensions:["/sharedResource.json.gz"]}],or=class extends Be{hashTable;_textEncoder=new TextEncoder;_textDecoder=new TextDecoder;_md5Hash=new ge;constructor(e,r,n){super(e,r,n),this.hashTable=r}async getFile(e,r="raw"){if(r==="http"){let n=Kp.find(o=>o.test.test(e))?.extensions;if(n){let o;for(let i of n)if(o=await this.getDataByPath(`${e}${i}`),o)break;if(o)return o}}if(r==="raw"){let n=await this.getDataByPath(`${e}.gz`);if(n)return n;let o=await this.getFileBytes(e);if(o)return o}throw new Error(`No such file in the archive: ${e}`)}async getDataByPath(e){let r=await this.getFileBytes(e.toLocaleLowerCase());if(r||(r=await this.getFileBytes(e)),!!r)return/\.gz$/.test(e)?await new Jr().decompress(r):r}async getFileBytes(e){let r;if(this.hashTable){let n=this._textEncoder.encode(e),o=await this._md5Hash.hash(n.buffer,"hex"),i=this.hashTable[o];if(i===void 0)return;let s=await Ae(i,this.fileProvider);if(!s)return;r=await this.fileProvider.slice(s.fileDataOffset,s.fileDataOffset+s.compressedSize)}else try{r=await this.getFileWithoutHash(e)}catch{r=void 0}return r}};async function lo(t,e,r){let n=await vr(t,Pr),o=await Lr(n,t),i;if(o?.fileName!=="@specialIndexFileHASH128@")i=await ns(t),e?.("SLPK doesnt contain hash file, hash info has been composed according to zip archive headers");else{let s=await Ae(o.localHeaderOffset,t);if(!s)throw new Error("corrupted SLPK");let a=s.fileDataOffset,f=await t.slice(a,a+s.compressedSize);i=rs(f)}return new or(t,i,r)}var Hp="4.3.0-alpha.4",bl={dataType:null,batchType:null,name:"I3S SLPK (Scene Layer Package)",id:"slpk",module:"i3s",version:Hp,mimeTypes:["application/octet-stream"],extensions:["slpk"],options:{},parse:async(t,e={})=>(await lo(new ue(new DataView(t)))).getFile(e.slpk?.path??"",e.slpk?.pathMode)};var Il=Bt(Vt(),1);function Bl(t,e){let{attributeName:r,attributeType:n}=e;return r?{[r]:n?Vp(n,t):null}:{}}function Vp(t,e){switch(t){case Aa:return qp(e);case ga:return Cl(e);case Ea:return Wp(e);case Sa:return Xp(e);default:return Cl(e)}}function Cl(t){return new Uint32Array(t,4)}function Xp(t){return new Int16Array(t,4)}function Wp(t){return new Float64Array(t,8)}function qp(t){let o=[];try{let i=new DataView(t,0,4).getUint32(0,!0),s=new Uint32Array(t,8,i),a=8+i*4;for(let f of s){let c=new TextDecoder("utf-8"),l=new Uint8Array(t,a,f);o.push(c.decode(l)),a+=f}}catch(i){console.error("Parse string attribute error: ",i.message)}return o}var Zp="4.3.0-alpha.4",Dl="",Qp="rejected",$r={dataType:null,batchType:null,name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:Zp,mimeTypes:["application/binary"],parse:async(t,e)=>Bl(t,e),extensions:["bin"],options:{},binary:!0};async function vl(t,e,r={}){let{attributeStorageInfo:n,attributeUrls:o,tilesetFields:i}=Yp(t);if(!n||!o||e<0)return null;let s=[],a=[];for(let f=0;f<n.length;f++){let c=Ft(o[f],r.i3s?.token),l=n[f].name,d=os(n[f]),_={...r,attributeName:l,attributeType:d},h=(0,Il.load)(c,$r,_);a.push(h)}try{s=await Promise.allSettled(a)}catch{}return s.length?Jp(s,n,e,i):null}function Yp(t){let e=t.tileset?.tileset?.attributeStorageInfo,r=t.header?.attributeUrls,n=t.tileset?.tileset?.fields||[];return{attributeStorageInfo:e,attributeUrls:r,tilesetFields:n}}function os(t){return t.hasOwnProperty("objectIds")?"Oid32":t.hasOwnProperty("attributeValues")?t.attributeValues.valueType:""}function jp(t){return t.find(r=>r.name.includes("OBJECTID"))?.name}function Jp(t,e,r,n){let o=jp(e),i=t.find(a=>a.value[o]);if(!i)return null;let s=i.value[o].indexOf(r);return s<0?null:$p(t,s,e,n)}function $p(t,e,r,n){let o={};for(let i=0;i<r.length;i++){let s=r[i].name,a=tm(s,n),f=em(t,i,s);o[s]=rm(f,e,a)}return o}function tm(t,e){return e.find(n=>n.name===t||n.alias===t)?.domain?.codedValues||[]}function em(t,e,r){let n=t[e];return n.status===Qp?null:n.value[r]}function rm(t,e,r){let n=Dl;return t&&e in t&&(n=String(t[e]).replace(/\u0000|NaN/g,"").trim()),r.length&&(n=r.find(i=>i.code===Number(n))?.name||Dl),n}var nm="3DObject";async function Ll(t,e){let r=JSON.parse(new TextDecoder().decode(t)),{sublayers:n}=r;return{header:r,sublayers:Pl(n,e)}}function Pl(t,e){let r=[];for(let n=0;n<t.length;n++){let o=t[n],{id:i,layerType:s,visibility:a=!0,...f}=o;if(s===nm){let c=`${e}/sublayers/${i}`;r.push({url:c,id:i,layerType:s,visibility:a,...f})}o?.sublayers?.length&&(r=[...r,...Pl(o.sublayers,e)])}return r}var om="4.3.0-alpha.4",Nl={dataType:null,batchType:null,name:"I3S Building Scene Layer",id:"i3s-building-scene-layer",module:"i3s",version:om,mimeTypes:["application/json"],parse:im,extensions:["json"],options:{}};async function im(t,e,r){if(!r?.url)throw new Error("Url is not provided");return Ll(t,r.url)}var ho=Bt(Vt(),1),sm=4326,am="ArcGISSceneServiceLayer",cm="BuildingSceneLayer",fm="IntegratedMeshLayer",Fl="GroupLayer",lm=[am,fm,cm,Fl],hm="NO_AVAILABLE_SUPPORTED_LAYERS_ERROR",_m="NOT_SUPPORTED_CRS_ERROR",tn=class extends Error{details;constructor(e,r){super(e),this.details=r,this.name="LayerError"}};async function Ul(t){let e=JSON.parse(new TextDecoder().decode(t)),{operationalLayers:r}=e,{layers:n,unsupportedLayers:o}=await Gl(r,!0);if(!n.length)throw new tn(hm,o);return{header:e,layers:n,unsupportedLayers:o}}async function Gl(t,e){let r=[],n=[];for(let o=0;o<t.length;o++){let i=t[o];if(lm.includes(i.layerType)?(e&&i.layerType!==Fl&&(await dm(i),e=!1),r.push(i)):n.push(i),i.layers?.length){let{layers:a,unsupportedLayers:f}=await Gl(i.layers,e);i.layers=a,n=[...n,...f]}}return{layers:r,unsupportedLayers:n}}async function dm(t){try{if((await(0,ho.load)(t.url,ho.JSONLoader))?.spatialReference?.wkid!==sm)throw new Error(_m)}catch(e){throw e}}var um="4.3.0-alpha.4",kl={dataType:null,batchType:null,name:"ArcGIS Web Scene Loader",id:"arcgis-web-scene",module:"i3s",version:um,mimeTypes:["application/json"],parse:pm,extensions:["json"],options:{}};async function pm(t){return Ul(t)}var Kl=Bt(Vt(),1);async function Hl(t,e,r,n,o,i,s){if(!i)return t;let a={...t,value:new Uint8Array(t.value)},f=n.find(({name:h})=>h===i?.attributeName);if(!f||!["esriFieldTypeDouble","esriFieldTypeInteger","esriFieldTypeSmallInteger"].includes(f.type))return t;let c=await zl(f.name,r,o,s);if(!c)return t;let l=n.find(({type:h})=>h==="esriFieldTypeOID");if(!l)return t;let d=await zl(l.name,r,o,s);if(!d)return t;let _={};for(let h=0;h<d[l.name].length;h++)_[d[l.name][h]]=mm(c[f.name][h],i);for(let h=0;h<e.length;h++){let u=_[e[h]];u&&(i.mode==="multiply"?u.forEach((x,p)=>{a.value[h*4+p]=a.value[h*4+p]*x/255}):a.value.set(u,h*4))}return a}function mm(t,e){if(!e)return[255,255,255,255];let{minValue:r,maxValue:n,minColor:o,maxColor:i}=e,s=(t-r)/(n-r),a=[255,255,255,255];for(let f=0;f<o.length;f++)a[f]=Math.round((i[f]-o[f])*s+o[f]);return a}async function zl(t,e,r,n){let o=r.findIndex(({name:f})=>t===f);if(o===-1)return null;let i=Ft(e[o],n),s=os(r[o]);return await(0,Kl.load)(i,$r,{attributeName:t,attributeType:s})}return Yl(en);})();
8
8
  return __exports__;
9
9
  });