@loaders.gl/3d-tiles 4.3.0-alpha.8 → 4.3.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dist.min.js CHANGED
@@ -4,7 +4,7 @@
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 n0=Object.create;var lo=Object.defineProperty;var o0=Object.getOwnPropertyDescriptor;var s0=Object.getOwnPropertyNames;var i0=Object.getPrototypeOf,a0=Object.prototype.hasOwnProperty;var it=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),lt=(t,e)=>{for(var r in e)lo(t,r,{get:e[r],enumerable:!0})},fo=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of s0(e))!a0.call(t,o)&&o!==r&&lo(t,o,{get:()=>e[o],enumerable:!(n=o0(e,o))||n.enumerable});return t},ho=(t,e,r)=>(fo(t,e,"default"),r&&fo(r,e,"default")),mr=(t,e,r)=>(r=t!=null?n0(i0(t)):{},fo(e||!t||!t.__esModule?lo(r,"default",{value:t,enumerable:!0}):r,t)),c0=t=>fo(lo({},"__esModule",{value:!0}),t);var un=it((q_,Lc)=>{Lc.exports=globalThis.loaders});var Ae=it(At=>{"use strict";var qx=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function $x(t,e){return Object.prototype.hasOwnProperty.call(t,e)}At.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)$x(r,n)&&(t[n]=r[n])}}return t};At.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var tE={arraySet:function(t,e,r,n,o){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+n),o);return}for(var s=0;s<n;s++)t[o+s]=e[r+s]},flattenChunks:function(t){var e,r,n,o,s,i;for(n=0,e=0,r=t.length;e<r;e++)n+=t[e].length;for(i=new Uint8Array(n),o=0,e=0,r=t.length;e<r;e++)s=t[e],i.set(s,o),o+=s.length;return i}},eE={arraySet:function(t,e,r,n,o){for(var s=0;s<n;s++)t[o+s]=e[r+s]},flattenChunks:function(t){return[].concat.apply([],t)}};At.setTyped=function(t){t?(At.Buf8=Uint8Array,At.Buf16=Uint16Array,At.Buf32=Int32Array,At.assign(At,tE)):(At.Buf8=Array,At.Buf16=Array,At.Buf32=Array,At.assign(At,eE))};At.setTyped(qx)});var Iu=it(tn=>{"use strict";var rE=Ae(),nE=4,iu=0,au=1,oE=2;function $r(t){for(var e=t.length;--e>=0;)t[e]=0}var sE=0,du=1,iE=2,aE=3,cE=258,qa=29,Zn=256,Vn=Zn+1+qa,qr=30,$a=19,Au=2*Vn+1,nr=15,ja=16,fE=7,tc=256,mu=16,pu=17,gu=18,Ya=[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],gs=[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],lE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Bu=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],hE=512,me=new Array((Vn+2)*2);$r(me);var Qn=new Array(qr*2);$r(Qn);var jn=new Array(hE);$r(jn);var Kn=new Array(cE-aE+1);$r(Kn);var ec=new Array(qa);$r(ec);var Bs=new Array(qr);$r(Bs);function Ka(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 xu,Eu,_u;function Xa(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function yu(t){return t<256?jn[t]:jn[256+(t>>>7)]}function Xn(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}function Ct(t,e,r){t.bi_valid>ja-r?(t.bi_buf|=e<<t.bi_valid&65535,Xn(t,t.bi_buf),t.bi_buf=e>>ja-t.bi_valid,t.bi_valid+=r-ja):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function ee(t,e,r){Ct(t,r[e*2],r[e*2+1])}function Cu(t,e){var r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1}function uE(t){t.bi_valid===16?(Xn(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 dE(t,e){var r=e.dyn_tree,n=e.max_code,o=e.stat_desc.static_tree,s=e.stat_desc.has_stree,i=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,f=e.stat_desc.max_length,c,l,h,u,d,A,m=0;for(u=0;u<=nr;u++)t.bl_count[u]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<Au;c++)l=t.heap[c],u=r[r[l*2+1]*2+1]+1,u>f&&(u=f,m++),r[l*2+1]=u,!(l>n)&&(t.bl_count[u]++,d=0,l>=a&&(d=i[l-a]),A=r[l*2],t.opt_len+=A*(u+d),s&&(t.static_len+=A*(o[l*2+1]+d)));if(m!==0){do{for(u=f-1;t.bl_count[u]===0;)u--;t.bl_count[u]--,t.bl_count[u+1]+=2,t.bl_count[f]--,m-=2}while(m>0);for(u=f;u!==0;u--)for(l=t.bl_count[u];l!==0;)h=t.heap[--c],!(h>n)&&(r[h*2+1]!==u&&(t.opt_len+=(u-r[h*2+1])*r[h*2],r[h*2+1]=u),l--)}}function Tu(t,e,r){var n=new Array(nr+1),o=0,s,i;for(s=1;s<=nr;s++)n[s]=o=o+r[s-1]<<1;for(i=0;i<=e;i++){var a=t[i*2+1];a!==0&&(t[i*2]=Cu(n[a]++,a))}}function AE(){var t,e,r,n,o,s=new Array(nr+1);for(r=0,n=0;n<qa-1;n++)for(ec[n]=r,t=0;t<1<<Ya[n];t++)Kn[r++]=n;for(Kn[r-1]=n,o=0,n=0;n<16;n++)for(Bs[n]=o,t=0;t<1<<gs[n];t++)jn[o++]=n;for(o>>=7;n<qr;n++)for(Bs[n]=o<<7,t=0;t<1<<gs[n]-7;t++)jn[256+o++]=n;for(e=0;e<=nr;e++)s[e]=0;for(t=0;t<=143;)me[t*2+1]=8,t++,s[8]++;for(;t<=255;)me[t*2+1]=9,t++,s[9]++;for(;t<=279;)me[t*2+1]=7,t++,s[7]++;for(;t<=287;)me[t*2+1]=8,t++,s[8]++;for(Tu(me,Vn+1,s),t=0;t<qr;t++)Qn[t*2+1]=5,Qn[t*2]=Cu(t,5);xu=new Ka(me,Ya,Zn+1,Vn,nr),Eu=new Ka(Qn,gs,0,qr,nr),_u=new Ka(new Array(0),lE,0,$a,fE)}function bu(t){var e;for(e=0;e<Vn;e++)t.dyn_ltree[e*2]=0;for(e=0;e<qr;e++)t.dyn_dtree[e*2]=0;for(e=0;e<$a;e++)t.bl_tree[e*2]=0;t.dyn_ltree[tc*2]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function Mu(t){t.bi_valid>8?Xn(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 mE(t,e,r,n){Mu(t),n&&(Xn(t,r),Xn(t,~r)),rE.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function cu(t,e,r,n){var o=e*2,s=r*2;return t[o]<t[s]||t[o]===t[s]&&n[e]<=n[r]}function Za(t,e,r){for(var n=t.heap[r],o=r<<1;o<=t.heap_len&&(o<t.heap_len&&cu(e,t.heap[o+1],t.heap[o],t.depth)&&o++,!cu(e,n,t.heap[o],t.depth));)t.heap[r]=t.heap[o],r=o,o<<=1;t.heap[r]=n}function fu(t,e,r){var n,o,s=0,i,a;if(t.last_lit!==0)do n=t.pending_buf[t.d_buf+s*2]<<8|t.pending_buf[t.d_buf+s*2+1],o=t.pending_buf[t.l_buf+s],s++,n===0?ee(t,o,e):(i=Kn[o],ee(t,i+Zn+1,e),a=Ya[i],a!==0&&(o-=ec[i],Ct(t,o,a)),n--,i=yu(n),ee(t,i,r),a=gs[i],a!==0&&(n-=Bs[i],Ct(t,n,a)));while(s<t.last_lit);ee(t,tc,e)}function Wa(t,e){var r=e.dyn_tree,n=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.elems,i,a,f=-1,c;for(t.heap_len=0,t.heap_max=Au,i=0;i<s;i++)r[i*2]!==0?(t.heap[++t.heap_len]=f=i,t.depth[i]=0):r[i*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,i=t.heap_len>>1;i>=1;i--)Za(t,r,i);c=s;do i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Za(t,r,1),a=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=a,r[c*2]=r[i*2]+r[a*2],t.depth[c]=(t.depth[i]>=t.depth[a]?t.depth[i]:t.depth[a])+1,r[i*2+1]=r[a*2+1]=c,t.heap[1]=c++,Za(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],dE(t,e),Tu(r,f,t.bl_count)}function lu(t,e,r){var n,o=-1,s,i=e[0*2+1],a=0,f=7,c=4;for(i===0&&(f=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)s=i,i=e[(n+1)*2+1],!(++a<f&&s===i)&&(a<c?t.bl_tree[s*2]+=a:s!==0?(s!==o&&t.bl_tree[s*2]++,t.bl_tree[mu*2]++):a<=10?t.bl_tree[pu*2]++:t.bl_tree[gu*2]++,a=0,o=s,i===0?(f=138,c=3):s===i?(f=6,c=3):(f=7,c=4))}function hu(t,e,r){var n,o=-1,s,i=e[0*2+1],a=0,f=7,c=4;for(i===0&&(f=138,c=3),n=0;n<=r;n++)if(s=i,i=e[(n+1)*2+1],!(++a<f&&s===i)){if(a<c)do ee(t,s,t.bl_tree);while(--a!==0);else s!==0?(s!==o&&(ee(t,s,t.bl_tree),a--),ee(t,mu,t.bl_tree),Ct(t,a-3,2)):a<=10?(ee(t,pu,t.bl_tree),Ct(t,a-3,3)):(ee(t,gu,t.bl_tree),Ct(t,a-11,7));a=0,o=s,i===0?(f=138,c=3):s===i?(f=6,c=3):(f=7,c=4)}}function pE(t){var e;for(lu(t,t.dyn_ltree,t.l_desc.max_code),lu(t,t.dyn_dtree,t.d_desc.max_code),Wa(t,t.bl_desc),e=$a-1;e>=3&&t.bl_tree[Bu[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function gE(t,e,r,n){var o;for(Ct(t,e-257,5),Ct(t,r-1,5),Ct(t,n-4,4),o=0;o<n;o++)Ct(t,t.bl_tree[Bu[o]*2+1],3);hu(t,t.dyn_ltree,e-1),hu(t,t.dyn_dtree,r-1)}function BE(t){var e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return iu;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return au;for(r=32;r<Zn;r++)if(t.dyn_ltree[r*2]!==0)return au;return iu}var uu=!1;function xE(t){uu||(AE(),uu=!0),t.l_desc=new Xa(t.dyn_ltree,xu),t.d_desc=new Xa(t.dyn_dtree,Eu),t.bl_desc=new Xa(t.bl_tree,_u),t.bi_buf=0,t.bi_valid=0,bu(t)}function wu(t,e,r,n){Ct(t,(sE<<1)+(n?1:0),3),mE(t,e,r,!0)}function EE(t){Ct(t,du<<1,3),ee(t,tc,me),uE(t)}function _E(t,e,r,n){var o,s,i=0;t.level>0?(t.strm.data_type===oE&&(t.strm.data_type=BE(t)),Wa(t,t.l_desc),Wa(t,t.d_desc),i=pE(t),o=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=o&&(o=s)):o=s=r+5,r+4<=o&&e!==-1?wu(t,e,r,n):t.strategy===nE||s===o?(Ct(t,(du<<1)+(n?1:0),3),fu(t,me,Qn)):(Ct(t,(iE<<1)+(n?1:0),3),gE(t,t.l_desc.max_code+1,t.d_desc.max_code+1,i+1),fu(t,t.dyn_ltree,t.dyn_dtree)),bu(t),n&&Mu(t)}function yE(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[(Kn[r]+Zn+1)*2]++,t.dyn_dtree[yu(e)*2]++),t.last_lit===t.lit_bufsize-1}tn._tr_init=xE;tn._tr_stored_block=wu;tn._tr_flush_block=_E;tn._tr_tally=yE;tn._tr_align=EE});var rc=it((gR,Su)=>{"use strict";function CE(t,e,r,n){for(var o=t&65535|0,s=t>>>16&65535|0,i=0;r!==0;){i=r>2e3?2e3:r,r-=i;do o=o+e[n++]|0,s=s+o|0;while(--i);o%=65521,s%=65521}return o|s<<16|0}Su.exports=CE});var nc=it((BR,Fu)=>{"use strict";function TE(){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 bE=TE();function ME(t,e,r,n){var o=bE,s=n+r;t^=-1;for(var i=n;i<s;i++)t=t>>>8^o[(t^e[i])&255];return t^-1}Fu.exports=ME});var xs=it((xR,Ru)=>{"use strict";Ru.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 Hu=it(oe=>{"use strict";var mt=Ae(),Gt=Iu(),vu=rc(),Re=nc(),wE=xs(),ar=0,IE=1,SE=3,Ge=4,Du=5,ne=0,Ou=1,Nt=-2,FE=-3,oc=-5,RE=-1,DE=1,Es=2,OE=3,LE=4,vE=0,GE=2,Ts=8,NE=9,UE=15,PE=8,HE=29,kE=256,ic=kE+1+HE,JE=30,zE=19,QE=2*ic+1,VE=15,J=3,Le=258,Vt=Le+J+1,jE=32,bs=42,ac=69,_s=73,ys=91,Cs=103,or=113,Wn=666,st=1,qn=2,sr=3,nn=4,KE=3;function ve(t,e){return t.msg=wE[e],e}function Lu(t){return(t<<1)-(t>4?9:0)}function Oe(t){for(var e=t.length;--e>=0;)t[e]=0}function De(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(mt.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 ft(t,e){Gt._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,De(t.strm)}function j(t,e){t.pending_buf[t.pending++]=e}function Yn(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}function XE(t,e,r,n){var o=t.avail_in;return o>n&&(o=n),o===0?0:(t.avail_in-=o,mt.arraySet(e,t.input,t.next_in,o,r),t.state.wrap===1?t.adler=vu(t.adler,e,o,r):t.state.wrap===2&&(t.adler=Re(t.adler,e,o,r)),t.next_in+=o,t.total_in+=o,o)}function Gu(t,e){var r=t.max_chain_length,n=t.strstart,o,s,i=t.prev_length,a=t.nice_match,f=t.strstart>t.w_size-Vt?t.strstart-(t.w_size-Vt):0,c=t.window,l=t.w_mask,h=t.prev,u=t.strstart+Le,d=c[n+i-1],A=c[n+i];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do if(o=e,!(c[o+i]!==A||c[o+i-1]!==d||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<u);if(s=Le-(u-n),n=u-Le,s>i){if(t.match_start=e,i=s,s>=a)break;d=c[n+i-1],A=c[n+i]}}while((e=h[e&l])>f&&--r!==0);return i<=t.lookahead?i:t.lookahead}function ir(t){var e=t.w_size,r,n,o,s,i;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Vt)){mt.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);s+=e}if(t.strm.avail_in===0)break;if(n=XE(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=n,t.lookahead+t.insert>=J)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=(t.ins_h<<t.hash_shift^t.window[i+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[i+J-1])&t.hash_mask,t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<J)););}while(t.lookahead<Vt&&t.strm.avail_in!==0)}function ZE(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ir(t),t.lookahead===0&&e===ar)return st;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,ft(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-Vt&&(ft(t,!1),t.strm.avail_out===0))return st}return t.insert=0,e===Ge?(ft(t,!0),t.strm.avail_out===0?sr:nn):(t.strstart>t.block_start&&(ft(t,!1),t.strm.avail_out===0),st)}function sc(t,e){for(var r,n;;){if(t.lookahead<Vt){if(ir(t),t.lookahead<Vt&&e===ar)return st;if(t.lookahead===0)break}if(r=0,t.lookahead>=J&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+J-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-Vt&&(t.match_length=Gu(t,r)),t.match_length>=J)if(n=Gt._tr_tally(t,t.strstart-t.match_start,t.match_length-J),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=J){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+J-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=Gt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(ft(t,!1),t.strm.avail_out===0))return st}return t.insert=t.strstart<J-1?t.strstart:J-1,e===Ge?(ft(t,!0),t.strm.avail_out===0?sr:nn):t.last_lit&&(ft(t,!1),t.strm.avail_out===0)?st:qn}function en(t,e){for(var r,n,o;;){if(t.lookahead<Vt){if(ir(t),t.lookahead<Vt&&e===ar)return st;if(t.lookahead===0)break}if(r=0,t.lookahead>=J&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+J-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=J-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Vt&&(t.match_length=Gu(t,r),t.match_length<=5&&(t.strategy===DE||t.match_length===J&&t.strstart-t.match_start>4096)&&(t.match_length=J-1)),t.prev_length>=J&&t.match_length<=t.prev_length){o=t.strstart+t.lookahead-J,n=Gt._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-J),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+J-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=J-1,t.strstart++,n&&(ft(t,!1),t.strm.avail_out===0))return st}else if(t.match_available){if(n=Gt._tr_tally(t,0,t.window[t.strstart-1]),n&&ft(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return st}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Gt._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<J-1?t.strstart:J-1,e===Ge?(ft(t,!0),t.strm.avail_out===0?sr:nn):t.last_lit&&(ft(t,!1),t.strm.avail_out===0)?st:qn}function YE(t,e){for(var r,n,o,s,i=t.window;;){if(t.lookahead<=Le){if(ir(t),t.lookahead<=Le&&e===ar)return st;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=J&&t.strstart>0&&(o=t.strstart-1,n=i[o],n===i[++o]&&n===i[++o]&&n===i[++o])){s=t.strstart+Le;do;while(n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&o<s);t.match_length=Le-(s-o),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=J?(r=Gt._tr_tally(t,1,t.match_length-J),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Gt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(ft(t,!1),t.strm.avail_out===0))return st}return t.insert=0,e===Ge?(ft(t,!0),t.strm.avail_out===0?sr:nn):t.last_lit&&(ft(t,!1),t.strm.avail_out===0)?st:qn}function WE(t,e){for(var r;;){if(t.lookahead===0&&(ir(t),t.lookahead===0)){if(e===ar)return st;break}if(t.match_length=0,r=Gt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(ft(t,!1),t.strm.avail_out===0))return st}return t.insert=0,e===Ge?(ft(t,!0),t.strm.avail_out===0?sr:nn):t.last_lit&&(ft(t,!1),t.strm.avail_out===0)?st:qn}function re(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 rn;rn=[new re(0,0,0,0,ZE),new re(4,4,8,4,sc),new re(4,5,16,8,sc),new re(4,6,32,32,sc),new re(4,4,16,16,en),new re(8,16,32,32,en),new re(8,16,128,128,en),new re(8,32,128,256,en),new re(32,128,258,1024,en),new re(32,258,258,4096,en)];function qE(t){t.window_size=2*t.w_size,Oe(t.head),t.max_lazy_match=rn[t.level].max_lazy,t.good_match=rn[t.level].good_length,t.nice_match=rn[t.level].nice_length,t.max_chain_length=rn[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=J-1,t.match_available=0,t.ins_h=0}function $E(){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=Ts,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 mt.Buf16(QE*2),this.dyn_dtree=new mt.Buf16((2*JE+1)*2),this.bl_tree=new mt.Buf16((2*zE+1)*2),Oe(this.dyn_ltree),Oe(this.dyn_dtree),Oe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new mt.Buf16(VE+1),this.heap=new mt.Buf16(2*ic+1),Oe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new mt.Buf16(2*ic+1),Oe(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 Nu(t){var e;return!t||!t.state?ve(t,Nt):(t.total_in=t.total_out=0,t.data_type=GE,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?bs:or,t.adler=e.wrap===2?0:1,e.last_flush=ar,Gt._tr_init(e),ne)}function Uu(t){var e=Nu(t);return e===ne&&qE(t.state),e}function t_(t,e){return!t||!t.state||t.state.wrap!==2?Nt:(t.state.gzhead=e,ne)}function Pu(t,e,r,n,o,s){if(!t)return Nt;var i=1;if(e===RE&&(e=6),n<0?(i=0,n=-n):n>15&&(i=2,n-=16),o<1||o>NE||r!==Ts||n<8||n>15||e<0||e>9||s<0||s>LE)return ve(t,Nt);n===8&&(n=9);var a=new $E;return t.state=a,a.strm=t,a.wrap=i,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+J-1)/J),a.window=new mt.Buf8(a.w_size*2),a.head=new mt.Buf16(a.hash_size),a.prev=new mt.Buf16(a.w_size),a.lit_bufsize=1<<o+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new mt.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=s,a.method=r,Uu(t)}function e_(t,e){return Pu(t,e,Ts,UE,PE,vE)}function r_(t,e){var r,n,o,s;if(!t||!t.state||e>Du||e<0)return t?ve(t,Nt):Nt;if(n=t.state,!t.output||!t.input&&t.avail_in!==0||n.status===Wn&&e!==Ge)return ve(t,t.avail_out===0?oc:Nt);if(n.strm=t,r=n.last_flush,n.last_flush=e,n.status===bs)if(n.wrap===2)t.adler=0,j(n,31),j(n,139),j(n,8),n.gzhead?(j(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)),j(n,n.gzhead.time&255),j(n,n.gzhead.time>>8&255),j(n,n.gzhead.time>>16&255),j(n,n.gzhead.time>>24&255),j(n,n.level===9?2:n.strategy>=Es||n.level<2?4:0),j(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(j(n,n.gzhead.extra.length&255),j(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=Re(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=ac):(j(n,0),j(n,0),j(n,0),j(n,0),j(n,0),j(n,n.level===9?2:n.strategy>=Es||n.level<2?4:0),j(n,KE),n.status=or);else{var i=Ts+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=Es||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=jE),i+=31-i%31,n.status=or,Yn(n,i),n.strstart!==0&&(Yn(n,t.adler>>>16),Yn(n,t.adler&65535)),t.adler=1}if(n.status===ac)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=Re(t.adler,n.pending_buf,n.pending-o,o)),De(t),o=n.pending,n.pending===n.pending_buf_size));)j(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=Re(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=_s)}else n.status=_s;if(n.status===_s)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=Re(t.adler,n.pending_buf,n.pending-o,o)),De(t),o=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.name.length?s=n.gzhead.name.charCodeAt(n.gzindex++)&255:s=0,j(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>o&&(t.adler=Re(t.adler,n.pending_buf,n.pending-o,o)),s===0&&(n.gzindex=0,n.status=ys)}else n.status=ys;if(n.status===ys)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=Re(t.adler,n.pending_buf,n.pending-o,o)),De(t),o=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.comment.length?s=n.gzhead.comment.charCodeAt(n.gzindex++)&255:s=0,j(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>o&&(t.adler=Re(t.adler,n.pending_buf,n.pending-o,o)),s===0&&(n.status=Cs)}else n.status=Cs;if(n.status===Cs&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&De(t),n.pending+2<=n.pending_buf_size&&(j(n,t.adler&255),j(n,t.adler>>8&255),t.adler=0,n.status=or)):n.status=or),n.pending!==0){if(De(t),t.avail_out===0)return n.last_flush=-1,ne}else if(t.avail_in===0&&Lu(e)<=Lu(r)&&e!==Ge)return ve(t,oc);if(n.status===Wn&&t.avail_in!==0)return ve(t,oc);if(t.avail_in!==0||n.lookahead!==0||e!==ar&&n.status!==Wn){var f=n.strategy===Es?WE(n,e):n.strategy===OE?YE(n,e):rn[n.level].func(n,e);if((f===sr||f===nn)&&(n.status=Wn),f===st||f===sr)return t.avail_out===0&&(n.last_flush=-1),ne;if(f===qn&&(e===IE?Gt._tr_align(n):e!==Du&&(Gt._tr_stored_block(n,0,0,!1),e===SE&&(Oe(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),De(t),t.avail_out===0))return n.last_flush=-1,ne}return e!==Ge?ne:n.wrap<=0?Ou:(n.wrap===2?(j(n,t.adler&255),j(n,t.adler>>8&255),j(n,t.adler>>16&255),j(n,t.adler>>24&255),j(n,t.total_in&255),j(n,t.total_in>>8&255),j(n,t.total_in>>16&255),j(n,t.total_in>>24&255)):(Yn(n,t.adler>>>16),Yn(n,t.adler&65535)),De(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?ne:Ou)}function n_(t){var e;return!t||!t.state?Nt:(e=t.state.status,e!==bs&&e!==ac&&e!==_s&&e!==ys&&e!==Cs&&e!==or&&e!==Wn?ve(t,Nt):(t.state=null,e===or?ve(t,FE):ne))}function o_(t,e){var r=e.length,n,o,s,i,a,f,c,l;if(!t||!t.state||(n=t.state,i=n.wrap,i===2||i===1&&n.status!==bs||n.lookahead))return Nt;for(i===1&&(t.adler=vu(t.adler,e,r,0)),n.wrap=0,r>=n.w_size&&(i===0&&(Oe(n.head),n.strstart=0,n.block_start=0,n.insert=0),l=new mt.Buf8(n.w_size),mt.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,ir(n);n.lookahead>=J;){o=n.strstart,s=n.lookahead-(J-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[o+J-1])&n.hash_mask,n.prev[o&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=o,o++;while(--s);n.strstart=o,n.lookahead=J-1,ir(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=J-1,n.match_available=0,t.next_in=f,t.input=c,t.avail_in=a,n.wrap=i,ne}oe.deflateInit=e_;oe.deflateInit2=Pu;oe.deflateReset=Uu;oe.deflateResetKeep=Nu;oe.deflateSetHeader=t_;oe.deflate=r_;oe.deflateEnd=n_;oe.deflateSetDictionary=o_;oe.deflateInfo="pako deflate (from Nodeca project)"});var cc=it(on=>{"use strict";var Ms=Ae(),ku=!0,Ju=!0;try{String.fromCharCode.apply(null,[0])}catch{ku=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Ju=!1}var $n=new Ms.Buf8(256);for(pe=0;pe<256;pe++)$n[pe]=pe>=252?6:pe>=248?5:pe>=240?4:pe>=224?3:pe>=192?2:1;var pe;$n[254]=$n[254]=1;on.string2buf=function(t){var e,r,n,o,s,i=t.length,a=0;for(o=0;o<i;o++)r=t.charCodeAt(o),(r&64512)===55296&&o+1<i&&(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 Ms.Buf8(a),s=0,o=0;s<a;o++)r=t.charCodeAt(o),(r&64512)===55296&&o+1<i&&(n=t.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),r<128?e[s++]=r:r<2048?(e[s++]=192|r>>>6,e[s++]=128|r&63):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|r&63):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|r&63);return e};function zu(t,e){if(e<65534&&(t.subarray&&Ju||!t.subarray&&ku))return String.fromCharCode.apply(null,Ms.shrinkBuf(t,e));for(var r="",n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r}on.buf2binstring=function(t){return zu(t,t.length)};on.binstring2buf=function(t){for(var e=new Ms.Buf8(t.length),r=0,n=e.length;r<n;r++)e[r]=t.charCodeAt(r);return e};on.buf2string=function(t,e){var r,n,o,s,i=e||t.length,a=new Array(i*2);for(n=0,r=0;r<i;){if(o=t[r++],o<128){a[n++]=o;continue}if(s=$n[o],s>4){a[n++]=65533,r+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&r<i;)o=o<<6|t[r++]&63,s--;if(s>1){a[n++]=65533;continue}o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|o&1023)}return zu(a,n)};on.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+$n[t[r]]>e?r:e}});var fc=it((yR,Qu)=>{"use strict";function s_(){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}Qu.exports=s_});var Xu=it(ro=>{"use strict";var to=Hu(),eo=Ae(),hc=cc(),uc=xs(),i_=fc(),Ku=Object.prototype.toString,a_=0,lc=4,sn=0,Vu=1,ju=2,c_=-1,f_=0,l_=8;function cr(t){if(!(this instanceof cr))return new cr(t);this.options=eo.assign({level:c_,method:l_,chunkSize:16384,windowBits:15,memLevel:8,strategy:f_,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 i_,this.strm.avail_out=0;var r=to.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==sn)throw new Error(uc[r]);if(e.header&&to.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(typeof e.dictionary=="string"?n=hc.string2buf(e.dictionary):Ku.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=to.deflateSetDictionary(this.strm,n),r!==sn)throw new Error(uc[r]);this._dict_set=!0}}cr.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,o,s;if(this.ended)return!1;s=e===~~e?e:e===!0?lc:a_,typeof t=="string"?r.input=hc.string2buf(t):Ku.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 eo.Buf8(n),r.next_out=0,r.avail_out=n),o=to.deflate(r,s),o!==Vu&&o!==sn)return this.onEnd(o),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(s===lc||s===ju))&&(this.options.to==="string"?this.onData(hc.buf2binstring(eo.shrinkBuf(r.output,r.next_out))):this.onData(eo.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&o!==Vu);return s===lc?(o=to.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===sn):(s===ju&&(this.onEnd(sn),r.avail_out=0),!0)};cr.prototype.onData=function(t){this.chunks.push(t)};cr.prototype.onEnd=function(t){t===sn&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=eo.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function dc(t,e){var r=new cr(e);if(r.push(t,!0),r.err)throw r.msg||uc[r.err];return r.result}function h_(t,e){return e=e||{},e.raw=!0,dc(t,e)}function u_(t,e){return e=e||{},e.gzip=!0,dc(t,e)}ro.Deflate=cr;ro.deflate=dc;ro.deflateRaw=h_;ro.gzip=u_});var Yu=it((TR,Zu)=>{"use strict";var ws=30,d_=12;Zu.exports=function(e,r){var n,o,s,i,a,f,c,l,h,u,d,A,m,p,E,y,T,b,C,w,I,O,B,g,x;n=e.state,o=e.next_in,g=e.input,s=o+(e.avail_in-5),i=e.next_out,x=e.output,a=i-(r-e.avail_out),f=i+(e.avail_out-257),c=n.dmax,l=n.wsize,h=n.whave,u=n.wnext,d=n.window,A=n.hold,m=n.bits,p=n.lencode,E=n.distcode,y=(1<<n.lenbits)-1,T=(1<<n.distbits)-1;t:do{m<15&&(A+=g[o++]<<m,m+=8,A+=g[o++]<<m,m+=8),b=p[A&y];e:for(;;){if(C=b>>>24,A>>>=C,m-=C,C=b>>>16&255,C===0)x[i++]=b&65535;else if(C&16){w=b&65535,C&=15,C&&(m<C&&(A+=g[o++]<<m,m+=8),w+=A&(1<<C)-1,A>>>=C,m-=C),m<15&&(A+=g[o++]<<m,m+=8,A+=g[o++]<<m,m+=8),b=E[A&T];r:for(;;){if(C=b>>>24,A>>>=C,m-=C,C=b>>>16&255,C&16){if(I=b&65535,C&=15,m<C&&(A+=g[o++]<<m,m+=8,m<C&&(A+=g[o++]<<m,m+=8)),I+=A&(1<<C)-1,I>c){e.msg="invalid distance too far back",n.mode=ws;break t}if(A>>>=C,m-=C,C=i-a,I>C){if(C=I-C,C>h&&n.sane){e.msg="invalid distance too far back",n.mode=ws;break t}if(O=0,B=d,u===0){if(O+=l-C,C<w){w-=C;do x[i++]=d[O++];while(--C);O=i-I,B=x}}else if(u<C){if(O+=l+u-C,C-=u,C<w){w-=C;do x[i++]=d[O++];while(--C);if(O=0,u<w){C=u,w-=C;do x[i++]=d[O++];while(--C);O=i-I,B=x}}}else if(O+=u-C,C<w){w-=C;do x[i++]=d[O++];while(--C);O=i-I,B=x}for(;w>2;)x[i++]=B[O++],x[i++]=B[O++],x[i++]=B[O++],w-=3;w&&(x[i++]=B[O++],w>1&&(x[i++]=B[O++]))}else{O=i-I;do x[i++]=x[O++],x[i++]=x[O++],x[i++]=x[O++],w-=3;while(w>2);w&&(x[i++]=x[O++],w>1&&(x[i++]=x[O++]))}}else if(C&64){e.msg="invalid distance code",n.mode=ws;break t}else{b=E[(b&65535)+(A&(1<<C)-1)];continue r}break}}else if(C&64)if(C&32){n.mode=d_;break t}else{e.msg="invalid literal/length code",n.mode=ws;break t}else{b=p[(b&65535)+(A&(1<<C)-1)];continue e}break}}while(o<s&&i<f);w=m>>3,o-=w,m-=w<<3,A&=(1<<m)-1,e.next_in=o,e.next_out=i,e.avail_in=o<s?5+(s-o):5-(o-s),e.avail_out=i<f?257+(f-i):257-(i-f),n.hold=A,n.bits=m}});var nd=it((bR,rd)=>{"use strict";var Wu=Ae(),an=15,qu=852,$u=592,td=0,Ac=1,ed=2,A_=[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],m_=[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],p_=[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],g_=[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];rd.exports=function(e,r,n,o,s,i,a,f){var c=f.bits,l=0,h=0,u=0,d=0,A=0,m=0,p=0,E=0,y=0,T=0,b,C,w,I,O,B=null,g=0,x,_=new Wu.Buf16(an+1),U=new Wu.Buf16(an+1),N=null,P=0,v,tt,pt;for(l=0;l<=an;l++)_[l]=0;for(h=0;h<o;h++)_[r[n+h]]++;for(A=c,d=an;d>=1&&_[d]===0;d--);if(A>d&&(A=d),d===0)return s[i++]=1<<24|64<<16|0,s[i++]=1<<24|64<<16|0,f.bits=1,0;for(u=1;u<d&&_[u]===0;u++);for(A<u&&(A=u),E=1,l=1;l<=an;l++)if(E<<=1,E-=_[l],E<0)return-1;if(E>0&&(e===td||d!==1))return-1;for(U[1]=0,l=1;l<an;l++)U[l+1]=U[l]+_[l];for(h=0;h<o;h++)r[n+h]!==0&&(a[U[r[n+h]]++]=h);if(e===td?(B=N=a,x=19):e===Ac?(B=A_,g-=257,N=m_,P-=257,x=256):(B=p_,N=g_,x=-1),T=0,h=0,l=u,O=i,m=A,p=0,w=-1,y=1<<A,I=y-1,e===Ac&&y>qu||e===ed&&y>$u)return 1;for(;;){v=l-p,a[h]<x?(tt=0,pt=a[h]):a[h]>x?(tt=N[P+a[h]],pt=B[g+a[h]]):(tt=32+64,pt=0),b=1<<l-p,C=1<<m,u=C;do C-=b,s[O+(T>>p)+C]=v<<24|tt<<16|pt|0;while(C!==0);for(b=1<<l-1;T&b;)b>>=1;if(b!==0?(T&=b-1,T+=b):T=0,h++,--_[l]===0){if(l===d)break;l=r[n+a[h]]}if(l>A&&(T&I)!==w){for(p===0&&(p=A),O+=u,m=l-p,E=1<<m;m+p<d&&(E-=_[m+p],!(E<=0));)m++,E<<=1;if(y+=1<<m,e===Ac&&y>qu||e===ed&&y>$u)return 1;w=T&I,s[w]=A<<24|m<<16|O-i|0}}return T!==0&&(s[O+T]=l-p<<24|64<<16|0),f.bits=A,0}});var Ud=it(jt=>{"use strict";var wt=Ae(),Ec=rc(),se=nc(),B_=Yu(),no=nd(),x_=0,Sd=1,Fd=2,od=4,E_=5,Is=6,fr=0,__=1,y_=2,Ut=-2,Rd=-3,_c=-4,C_=-5,sd=8,Dd=1,id=2,ad=3,cd=4,fd=5,ld=6,hd=7,ud=8,dd=9,Ad=10,Rs=11,ge=12,mc=13,md=14,pc=15,pd=16,gd=17,Bd=18,xd=19,Ss=20,Fs=21,Ed=22,_d=23,yd=24,Cd=25,Td=26,gc=27,bd=28,Md=29,$=30,yc=31,T_=32,b_=852,M_=592,w_=15,I_=w_;function wd(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function S_(){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 wt.Buf16(320),this.work=new wt.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Od(t){var e;return!t||!t.state?Ut:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Dd,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new wt.Buf32(b_),e.distcode=e.distdyn=new wt.Buf32(M_),e.sane=1,e.back=-1,fr)}function Ld(t){var e;return!t||!t.state?Ut:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,Od(t))}function vd(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))?Ut:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,Ld(t))}function Gd(t,e){var r,n;return t?(n=new S_,t.state=n,n.window=null,r=vd(t,e),r!==fr&&(t.state=null),r):Ut}function F_(t){return Gd(t,I_)}var Id=!0,Bc,xc;function R_(t){if(Id){var e;for(Bc=new wt.Buf32(512),xc=new wt.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(no(Sd,t.lens,0,288,Bc,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;no(Fd,t.lens,0,32,xc,0,t.work,{bits:5}),Id=!1}t.lencode=Bc,t.lenbits=9,t.distcode=xc,t.distbits=5}function Nd(t,e,r,n){var o,s=t.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new wt.Buf8(s.wsize)),n>=s.wsize?(wt.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(o=s.wsize-s.wnext,o>n&&(o=n),wt.arraySet(s.window,e,r-n,o,s.wnext),n-=o,n?(wt.arraySet(s.window,e,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}function D_(t,e){var r,n,o,s,i,a,f,c,l,h,u,d,A,m,p=0,E,y,T,b,C,w,I,O,B=new wt.Buf8(4),g,x,_=[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 Ut;r=t.state,r.mode===ge&&(r.mode=mc),i=t.next_out,o=t.output,f=t.avail_out,s=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,h=a,u=f,O=fr;t:for(;;)switch(r.mode){case Dd:if(r.wrap===0){r.mode=mc;break}for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(r.wrap&2&&c===35615){r.check=0,B[0]=c&255,B[1]=c>>>8&255,r.check=se(r.check,B,2,0),c=0,l=0,r.mode=id;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=$;break}if((c&15)!==sd){t.msg="unknown compression method",r.mode=$;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=$;break}r.dmax=1<<I,t.adler=r.check=1,r.mode=c&512?Ad:ge,c=0,l=0;break;case id:for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==sd){t.msg="unknown compression method",r.mode=$;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=$;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(B[0]=c&255,B[1]=c>>>8&255,r.check=se(r.check,B,2,0)),c=0,l=0,r.mode=ad;case ad:for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&(B[0]=c&255,B[1]=c>>>8&255,B[2]=c>>>16&255,B[3]=c>>>24&255,r.check=se(r.check,B,4,0)),c=0,l=0,r.mode=cd;case cd:for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(B[0]=c&255,B[1]=c>>>8&255,r.check=se(r.check,B,2,0)),c=0,l=0,r.mode=fd;case fd:if(r.flags&1024){for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(B[0]=c&255,B[1]=c>>>8&255,r.check=se(r.check,B,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=ld;case ld:if(r.flags&1024&&(d=r.length,d>a&&(d=a),d&&(r.head&&(I=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),wt.arraySet(r.head.extra,n,s,d,I)),r.flags&512&&(r.check=se(r.check,n,d,s)),a-=d,s+=d,r.length-=d),r.length))break t;r.length=0,r.mode=hd;case hd:if(r.flags&2048){if(a===0)break t;d=0;do I=n[s+d++],r.head&&I&&r.length<65536&&(r.head.name+=String.fromCharCode(I));while(I&&d<a);if(r.flags&512&&(r.check=se(r.check,n,d,s)),a-=d,s+=d,I)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=ud;case ud:if(r.flags&4096){if(a===0)break t;d=0;do I=n[s+d++],r.head&&I&&r.length<65536&&(r.head.comment+=String.fromCharCode(I));while(I&&d<a);if(r.flags&512&&(r.check=se(r.check,n,d,s)),a-=d,s+=d,I)break t}else r.head&&(r.head.comment=null);r.mode=dd;case dd:if(r.flags&512){for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=$;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=ge;break;case Ad:for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}t.adler=r.check=wd(c),c=0,l=0,r.mode=Rs;case Rs:if(r.havedict===0)return t.next_out=i,t.avail_out=f,t.next_in=s,t.avail_in=a,r.hold=c,r.bits=l,y_;t.adler=r.check=1,r.mode=ge;case ge:if(e===E_||e===Is)break t;case mc:if(r.last){c>>>=l&7,l-=l&7,r.mode=gc;break}for(;l<3;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=md;break;case 1:if(R_(r),r.mode=Ss,e===Is){c>>>=2,l-=2;break t}break;case 2:r.mode=gd;break;case 3:t.msg="invalid block type",r.mode=$}c>>>=2,l-=2;break;case md:for(c>>>=l&7,l-=l&7;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=$;break}if(r.length=c&65535,c=0,l=0,r.mode=pc,e===Is)break t;case pc:r.mode=pd;case pd:if(d=r.length,d){if(d>a&&(d=a),d>f&&(d=f),d===0)break t;wt.arraySet(o,n,s,d,i),a-=d,s+=d,f-=d,i+=d,r.length-=d;break}r.mode=ge;break;case gd:for(;l<14;){if(a===0)break t;a--,c+=n[s++]<<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=$;break}r.have=0,r.mode=Bd;case Bd:for(;r.have<r.ncode;){for(;l<3;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.lens[_[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[_[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,g={bits:r.lenbits},O=no(x_,r.lens,0,19,r.lencode,0,r.work,g),r.lenbits=g.bits,O){t.msg="invalid code lengths set",r.mode=$;break}r.have=0,r.mode=xd;case xd:for(;r.have<r.nlen+r.ndist;){for(;p=r.lencode[c&(1<<r.lenbits)-1],E=p>>>24,y=p>>>16&255,T=p&65535,!(E<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(T<16)c>>>=E,l-=E,r.lens[r.have++]=T;else{if(T===16){for(x=E+2;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c>>>=E,l-=E,r.have===0){t.msg="invalid bit length repeat",r.mode=$;break}I=r.lens[r.have-1],d=3+(c&3),c>>>=2,l-=2}else if(T===17){for(x=E+3;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=E,l-=E,I=0,d=3+(c&7),c>>>=3,l-=3}else{for(x=E+7;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=E,l-=E,I=0,d=11+(c&127),c>>>=7,l-=7}if(r.have+d>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=$;break}for(;d--;)r.lens[r.have++]=I}}if(r.mode===$)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=$;break}if(r.lenbits=9,g={bits:r.lenbits},O=no(Sd,r.lens,0,r.nlen,r.lencode,0,r.work,g),r.lenbits=g.bits,O){t.msg="invalid literal/lengths set",r.mode=$;break}if(r.distbits=6,r.distcode=r.distdyn,g={bits:r.distbits},O=no(Fd,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,g),r.distbits=g.bits,O){t.msg="invalid distances set",r.mode=$;break}if(r.mode=Ss,e===Is)break t;case Ss:r.mode=Fs;case Fs:if(a>=6&&f>=258){t.next_out=i,t.avail_out=f,t.next_in=s,t.avail_in=a,r.hold=c,r.bits=l,B_(t,u),i=t.next_out,o=t.output,f=t.avail_out,s=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,r.mode===ge&&(r.back=-1);break}for(r.back=0;p=r.lencode[c&(1<<r.lenbits)-1],E=p>>>24,y=p>>>16&255,T=p&65535,!(E<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(y&&!(y&240)){for(b=E,C=y,w=T;p=r.lencode[w+((c&(1<<b+C)-1)>>b)],E=p>>>24,y=p>>>16&255,T=p&65535,!(b+E<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=b,l-=b,r.back+=b}if(c>>>=E,l-=E,r.back+=E,r.length=T,y===0){r.mode=Td;break}if(y&32){r.back=-1,r.mode=ge;break}if(y&64){t.msg="invalid literal/length code",r.mode=$;break}r.extra=y&15,r.mode=Ed;case Ed:if(r.extra){for(x=r.extra;l<x;){if(a===0)break t;a--,c+=n[s++]<<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=_d;case _d:for(;p=r.distcode[c&(1<<r.distbits)-1],E=p>>>24,y=p>>>16&255,T=p&65535,!(E<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(!(y&240)){for(b=E,C=y,w=T;p=r.distcode[w+((c&(1<<b+C)-1)>>b)],E=p>>>24,y=p>>>16&255,T=p&65535,!(b+E<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=b,l-=b,r.back+=b}if(c>>>=E,l-=E,r.back+=E,y&64){t.msg="invalid distance code",r.mode=$;break}r.offset=T,r.extra=y&15,r.mode=yd;case yd:if(r.extra){for(x=r.extra;l<x;){if(a===0)break t;a--,c+=n[s++]<<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=$;break}r.mode=Cd;case Cd:if(f===0)break t;if(d=u-f,r.offset>d){if(d=r.offset-d,d>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=$;break}d>r.wnext?(d-=r.wnext,A=r.wsize-d):A=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=o,A=i-r.offset,d=r.length;d>f&&(d=f),f-=d,r.length-=d;do o[i++]=m[A++];while(--d);r.length===0&&(r.mode=Fs);break;case Td:if(f===0)break t;o[i++]=r.length,f--,r.mode=Fs;break;case gc:if(r.wrap){for(;l<32;){if(a===0)break t;a--,c|=n[s++]<<l,l+=8}if(u-=f,t.total_out+=u,r.total+=u,u&&(t.adler=r.check=r.flags?se(r.check,o,u,i-u):Ec(r.check,o,u,i-u)),u=f,(r.flags?c:wd(c))!==r.check){t.msg="incorrect data check",r.mode=$;break}c=0,l=0}r.mode=bd;case bd:if(r.wrap&&r.flags){for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=$;break}c=0,l=0}r.mode=Md;case Md:O=__;break t;case $:O=Rd;break t;case yc:return _c;case T_:default:return Ut}return t.next_out=i,t.avail_out=f,t.next_in=s,t.avail_in=a,r.hold=c,r.bits=l,(r.wsize||u!==t.avail_out&&r.mode<$&&(r.mode<gc||e!==od))&&Nd(t,t.output,t.next_out,u-t.avail_out)?(r.mode=yc,_c):(h-=t.avail_in,u-=t.avail_out,t.total_in+=h,t.total_out+=u,r.total+=u,r.wrap&&u&&(t.adler=r.check=r.flags?se(r.check,o,u,t.next_out-u):Ec(r.check,o,u,t.next_out-u)),t.data_type=r.bits+(r.last?64:0)+(r.mode===ge?128:0)+(r.mode===Ss||r.mode===pc?256:0),(h===0&&u===0||e===od)&&O===fr&&(O=C_),O)}function O_(t){if(!t||!t.state)return Ut;var e=t.state;return e.window&&(e.window=null),t.state=null,fr}function L_(t,e){var r;return!t||!t.state||(r=t.state,!(r.wrap&2))?Ut:(r.head=e,e.done=!1,fr)}function v_(t,e){var r=e.length,n,o,s;return!t||!t.state||(n=t.state,n.wrap!==0&&n.mode!==Rs)?Ut:n.mode===Rs&&(o=1,o=Ec(o,e,r,0),o!==n.check)?Rd:(s=Nd(t,e,r,r),s?(n.mode=yc,_c):(n.havedict=1,fr))}jt.inflateReset=Ld;jt.inflateReset2=vd;jt.inflateResetKeep=Od;jt.inflateInit=F_;jt.inflateInit2=Gd;jt.inflate=D_;jt.inflateEnd=O_;jt.inflateGetHeader=L_;jt.inflateSetDictionary=v_;jt.inflateInfo="pako inflate (from Nodeca project)"});var Cc=it((wR,Pd)=>{"use strict";Pd.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 kd=it((IR,Hd)=>{"use strict";function G_(){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}Hd.exports=G_});var zd=it(so=>{"use strict";var cn=Ud(),oo=Ae(),Ds=cc(),nt=Cc(),Tc=xs(),N_=fc(),U_=kd(),Jd=Object.prototype.toString;function lr(t){if(!(this instanceof lr))return new lr(t);this.options=oo.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 N_,this.strm.avail_out=0;var r=cn.inflateInit2(this.strm,e.windowBits);if(r!==nt.Z_OK)throw new Error(Tc[r]);if(this.header=new U_,cn.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Ds.string2buf(e.dictionary):Jd.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=cn.inflateSetDictionary(this.strm,e.dictionary),r!==nt.Z_OK)))throw new Error(Tc[r])}lr.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,o=this.options.dictionary,s,i,a,f,c,l=!1;if(this.ended)return!1;i=e===~~e?e:e===!0?nt.Z_FINISH:nt.Z_NO_FLUSH,typeof t=="string"?r.input=Ds.binstring2buf(t):Jd.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 oo.Buf8(n),r.next_out=0,r.avail_out=n),s=cn.inflate(r,nt.Z_NO_FLUSH),s===nt.Z_NEED_DICT&&o&&(s=cn.inflateSetDictionary(this.strm,o)),s===nt.Z_BUF_ERROR&&l===!0&&(s=nt.Z_OK,l=!1),s!==nt.Z_STREAM_END&&s!==nt.Z_OK)return this.onEnd(s),this.ended=!0,!1;r.next_out&&(r.avail_out===0||s===nt.Z_STREAM_END||r.avail_in===0&&(i===nt.Z_FINISH||i===nt.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=Ds.utf8border(r.output,r.next_out),f=r.next_out-a,c=Ds.buf2string(r.output,a),r.next_out=f,r.avail_out=n-f,f&&oo.arraySet(r.output,r.output,a,f,0),this.onData(c)):this.onData(oo.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)&&s!==nt.Z_STREAM_END);return s===nt.Z_STREAM_END&&(i=nt.Z_FINISH),i===nt.Z_FINISH?(s=cn.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===nt.Z_OK):(i===nt.Z_SYNC_FLUSH&&(this.onEnd(nt.Z_OK),r.avail_out=0),!0)};lr.prototype.onData=function(t){this.chunks.push(t)};lr.prototype.onEnd=function(t){t===nt.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=oo.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function bc(t,e){var r=new lr(e);if(r.push(t,!0),r.err)throw r.msg||Tc[r.err];return r.result}function P_(t,e){return e=e||{},e.raw=!0,bc(t,e)}so.Inflate=lr;so.inflate=bc;so.inflateRaw=P_;so.ungzip=bc});var jd=it((FR,Vd)=>{"use strict";var H_=Ae().assign,k_=Xu(),J_=zd(),z_=Cc(),Qd={};H_(Qd,k_,J_,z_);Vd.exports=Qd});var Kd=it(()=>{});var io={};lt(io,{CesiumIonLoader:()=>ka,TILE3D_TYPE:()=>xt,Tile3DBatchTable:()=>ue,Tile3DFeatureTable:()=>kt,Tile3DSubtreeLoader:()=>Jr,Tile3DWriter:()=>e0,Tiles3DArchive:()=>fn,Tiles3DArchiveFileLoader:()=>Zd,Tiles3DLoader:()=>tr,_getIonTilesetMetadata:()=>ds});ho(io,mr(un(),1));async function Pt(t,e,r,n){return n._parse(t,e,r,n)}function z(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var Xt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},f0=Xt.self||Xt.window||Xt.global||{},l0=Xt.window||Xt.self||Xt.global||{},h0=Xt.global||Xt.self||Xt.window||{},u0=Xt.document||{};var Bt=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var vc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),d0=vc&&parseFloat(vc[1])||0;function dn(t){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,t)}function vs(t){return globalThis.loaders?.modules?.[t]||null}function A0(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.0-alpha.7"),globalThis._loadersgl_.version}var Gc=A0();function Nc(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var Zt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},s2=Zt.self||Zt.window||Zt.global||{},i2=Zt.window||Zt.self||Zt.global||{},a2=Zt.global||Zt.self||Zt.window||{},c2=Zt.document||{};var pr=typeof process!="object"||String(process)!=="[object process]"||process.browser,uo=typeof importScripts=="function",f2=typeof window<"u"&&typeof window.orientation<"u",Uc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),l2=Uc&&parseFloat(Uc[1])||0;var Gs={};async function Yt(t,e=null,r={},n=null){return e&&(t=Pc(t,e,r,n)),Gs[t]=Gs[t]||m0(t),await Gs[t]}function Pc(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]:pr?r.CDN?(Nc(r.CDN.startsWith("http")),`${r.CDN}/${e}@${Gc}/dist/libs/${n}`):uo?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}async function m0(t){if(t.endsWith("wasm"))return await g0(t);if(!pr)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(t)}catch(r){return console.error(r),null}if(uo)return importScripts(t);let e=await B0(t);return p0(e,t)}function p0(t,e){if(!pr){let{requireFromString:n}=globalThis.loaders||{};return n?.(t,e)}if(uo)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 g0(t){let{readFileAsArrayBuffer:e}=globalThis.loaders||{};return pr||!e||t.startsWith("http")?await(await fetch(t)).arrayBuffer():await e(t)}async function B0(t){let{readFileAsText:e}=globalThis.loaders||{};return pr||!e||t.startsWith("http")?await(await fetch(t)).text():await e(t)}function kc(t,e=5){return typeof t=="string"?t.slice(0,e):ArrayBuffer.isView(t)?Hc(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?Hc(t,0,e):""}function Hc(t,e,r){if(t.byteLength<=e+r)return"";let n=new DataView(t),o="";for(let s=0;s<r;s++)o+=String.fromCharCode(n.getUint8(e+s));return o}function Ns(t){try{return JSON.parse(t)}catch{throw new Error(`Failed to parse JSON from data starting with "${kc(t)}"`)}}function xe(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 s=0;s<n.length;++s)if(n[s]!==o[s])return!1;return!0}function gr(...t){return Jc(t)}function Jc(t){let e=t.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),r=e.reduce((s,i)=>s+i.byteLength,0),n=new Uint8Array(r),o=0;for(let s of e)n.set(s,o),o+=s.byteLength;return n.buffer}function Pe(t,e,r){let n=r!==void 0?new Uint8Array(t).subarray(e,e+r):new Uint8Array(t).subarray(e);return new Uint8Array(n).buffer}function Tt(t,e){return z(t>=0),z(e>0),t+(e-1)&~(e-1)}function Us(t,e,r){let n;if(t instanceof ArrayBuffer)n=new Uint8Array(t);else{let o=t.byteOffset,s=t.byteLength;n=new Uint8Array(t.buffer||t.arrayBuffer,o,s)}return e.set(n,r),r+Tt(n.byteLength,4)}function Ps(t,e){let r=t.length,o=Math.ceil(r/e)*e-r,s="";for(let i=0;i<o;++i)s+=" ";return t+s}function Br(t,e,r,n){if(t)for(let o=0;o<n;o++)t.setUint8(e+o,r.charCodeAt(o));return e+n}function An(t,e,r,n){if(t)for(let o=0;o<n;o++)t.setUint8(e+o,r[o]);return e+n}function zc(t,e,r,n){let o=Tt(r.byteLength,n),s=o-r.byteLength;if(t){let i=new Uint8Array(t.buffer,t.byteOffset+e,r.byteLength),a=new Uint8Array(r);i.set(a);for(let f=0;f<s;++f)t.setUint8(e+r.byteLength+f,32)}return e+=o,e}function Ao(t,e,r,n){let s=new TextEncoder().encode(r);return e=zc(t,e,s,n),e}async function mn(t){let e=[];for await(let r of t)e.push(r);return gr(...e)}function Qc(t){return t&&typeof t=="object"&&t.isBuffer}function xr(t){if(Qc(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 Er(t){return e=>new Promise((r,n)=>t(e,(o,s)=>o?n(o):r(s)))}var _r={};lt(_r,{dirname:()=>E0,filename:()=>x0,join:()=>_0,resolve:()=>y0});function Vc(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let t=window.location?.pathname;return t?.slice(0,t.lastIndexOf("/")+1)||""}function x0(t){let e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(e+1):""}function E0(t){let e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(0,e):""}function _0(...t){let e="/";return t=t.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${e}`),"")),n!==t.length-1&&(r=r.replace(new RegExp(`${e}$`),"")),r)),t.join(e)}function y0(...t){let e=[];for(let s=0;s<t.length;s++)e[s]=t[s];let r="",n=!1,o;for(let s=e.length-1;s>=-1&&!n;s--){let i;s>=0?i=e[s]:(o===void 0&&(o=Vc()),i=o),i.length!==0&&(r=`${i}/${r}`,n=i.charCodeAt(0)===pn)}return r=C0(r,!n),n?`/${r}`:r.length>0?r:"."}var pn=47,Hs=46;function C0(t,e){let r="",n=-1,o=0,s,i=!1;for(let a=0;a<=t.length;++a){if(a<t.length)s=t.charCodeAt(a);else{if(s===pn)break;s=pn}if(s===pn){if(!(n===a-1||o===1))if(n!==a-1&&o===2){if(r.length<2||!i||r.charCodeAt(r.length-1)!==Hs||r.charCodeAt(r.length-2)!==Hs){if(r.length>2){let f=r.length-1,c=f;for(;c>=0&&r.charCodeAt(c)!==pn;--c);if(c!==f){r=c===-1?"":r.slice(0,c),n=a,o=0,i=!1;continue}}else if(r.length===2||r.length===1){r="",n=a,o=0,i=!1;continue}}e&&(r.length>0?r+="/..":r="..",i=!0)}else{let f=t.slice(n+1,a);r.length>0?r+=`/${f}`:r=f,i=!1}n=a,o=0}else s===Hs&&o!==-1?++o:o=-1}return r}var gn=new Error("Not implemented"),mo=class{handle;size=0;bigsize=0n;url="";constructor(e,r,n){if(globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(e,r,n);throw Bt?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 gn}async write(e,r,n){throw gn}async stat(){throw gn}async truncate(e){throw gn}async append(e){throw gn}async close(){}};var ks=t=>t?.getUint8&&t?.slice&&t?.length;var Bn=class{file;constructor(e,r=!1){this.file=new mo(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 yr=t=>{if(t>Number.MAX_SAFE_INTEGER)throw new Error("Offset is out of bounds");return Number(t)},He=class{file;constructor(e){this.file=e}async destroy(){}async getUint8(e){return this.file.getUint8(yr(e))}async getUint16(e){return this.file.getUint16(yr(e),!0)}async getUint32(e){return this.file.getUint32(yr(e),!0)}async getBigUint64(e){return this.file.getBigUint64(yr(e),!0)}async slice(e,r){return this.file.buffer.slice(yr(e),yr(r))}get length(){return BigInt(this.file.byteLength)}};var T0=1/Math.PI*180,b0=1/180*Math.PI,M0={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...M0}};var Z=globalThis.mathgl.config;function Js(t,{precision:e=Z.precision}={}){return t=w0(t),`${parseFloat(t.toPrecision(e))}`}function It(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function zs(t){return jc(t)}function Qs(t){return Kc(t)}function jc(t,e){return js(t,r=>r*b0,e)}function Kc(t,e){return js(t,r=>r*T0,e)}function Vs(t,e,r){return js(t,n=>Math.max(e,Math.min(r,n)))}function bt(t,e,r){let n=Z.EPSILON;r&&(Z.EPSILON=r);try{if(t===e)return!0;if(It(t)&&It(e)){if(t.length!==e.length)return!1;for(let o=0;o<t.length;++o)if(!bt(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)<=Z.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{Z.EPSILON=n}}function w0(t){return Math.round(t/Z.EPSILON)*Z.EPSILON}function I0(t){return t.clone?t.clone():new Array(t.length)}function js(t,e,r){if(It(t)){let n=t;r=r||I0(n);for(let o=0;o<r.length&&o<n.length;++o){let s=typeof t=="number"?t:t[o];r[o]=e(s,o,r)}return r}return e(t)}var Ee=class extends 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:It(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Z)}formatString(e){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+Js(this[n],e);return`${e.printTypes?this.constructor.name:""}[${r}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!bt(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 s=e[o],i=typeof r=="number"?r:r[o];this[o]=s+n*(i-s)}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(Z.debug&&!this.validate())throw new Error(`math.gl: ${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 S0(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 k(t){if(!Number.isFinite(t))throw new Error(`Invalid number ${JSON.stringify(t)}`);return t}function _e(t,e,r=""){if(Z.debug&&!S0(t,e))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return t}function at(t,e){if(!t)throw new Error(`math.gl assertion ${e}`)}var ye=class extends Ee{get x(){return this[0]}set x(e){this[0]=k(e)}get y(){return this[1]}set y(e){this[1]=k(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 k(r)}dot(e){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*e[n];return k(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 at(e>=0&&e<this.ELEMENTS,"index is out of range"),k(this[e])}setComponent(e,r){return at(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,xn=Math.random;function Cr(t){return t>=0?Math.round(t):t%.5===0?Math.floor(t):Math.round(t)}var Ey=Math.PI/180;function F0(){let t=new q(2);return q!=Float32Array&&(t[0]=0,t[1]=0),t}function Xc(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}function Zc(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o+r[4],t[1]=r[1]*n+r[3]*o+r[5],t}function po(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 go(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 _y=function(){let t=F0();return function(e,r,n,o,s,i){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],s(t,t,i),e[a]=t[0],e[a+1]=t[1];return e}}();function Bo(t,e,r){let n=e[0],o=e[1],s=r[3]*n+r[7]*o||1;return t[0]=(r[0]*n+r[4]*o)/s,t[1]=(r[1]*n+r[5]*o)/s,t}function xo(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[3]*n+r[7]*o+r[11]*s||1;return t[0]=(r[0]*n+r[4]*o+r[8]*s)/i,t[1]=(r[1]*n+r[5]*o+r[9]*s)/i,t[2]=(r[2]*n+r[6]*o+r[10]*s)/i,t}function Yc(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 Wc(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 Eo(t,e,r){let n=e[0],o=e[1],s=e[2];return t[0]=r[0]*n+r[3]*o+r[6]*s,t[1]=r[1]*n+r[4]*o+r[7]*s,t[2]=r[2]*n+r[5]*o+r[8]*s,t[3]=e[3],t}var ke=class extends ye{constructor(e=0,r=0){super(2),It(e)&&arguments.length===1?this.copy(e):(Z.debug&&(k(e),k(r)),this[0]=e,this[1]=r)}set(e,r){return this[0]=e,this[1]=r,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this.check()}fromObject(e){return Z.debug&&(k(e.x),k(e.y)),this[0]=e.x,this[1]=e.y,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return go(this,this,e),this.check()}transformAsVector(e){return Bo(this,this,e),this.check()}transformByMatrix3(e){return po(this,this,e),this.check()}transformByMatrix2x3(e){return Zc(this,this,e),this.check()}transformByMatrix2(e){return Xc(this,this,e),this.check()}};var Qe={};lt(Qe,{add:()=>L0,angle:()=>Ws,bezier:()=>K0,ceil:()=>v0,clone:()=>R0,copy:()=>D0,create:()=>_o,cross:()=>Je,dist:()=>rA,distance:()=>rf,div:()=>eA,divide:()=>ef,dot:()=>En,equals:()=>q0,exactEquals:()=>W0,floor:()=>G0,forEach:()=>sA,fromValues:()=>yo,hermite:()=>j0,inverse:()=>z0,len:()=>qs,length:()=>qc,lerp:()=>Q0,max:()=>U0,min:()=>N0,mul:()=>tA,multiply:()=>tf,negate:()=>J0,normalize:()=>Ks,random:()=>X0,rotateX:()=>Xs,rotateY:()=>Zs,rotateZ:()=>Ys,round:()=>P0,scale:()=>H0,scaleAndAdd:()=>k0,set:()=>O0,slerp:()=>V0,sqrDist:()=>nA,sqrLen:()=>oA,squaredDistance:()=>nf,squaredLength:()=>of,str:()=>Y0,sub:()=>$0,subtract:()=>$c,transformMat3:()=>_n,transformMat4:()=>ze,transformQuat:()=>yn,zero:()=>Z0});function _o(){let t=new q(3);return q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function R0(t){let e=new q(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function qc(t){let e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function yo(t,e,r){let n=new q(3);return n[0]=t,n[1]=e,n[2]=r,n}function D0(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function O0(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function L0(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function $c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function tf(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function ef(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function v0(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function G0(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function N0(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 U0(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 P0(t,e){return t[0]=Cr(e[0]),t[1]=Cr(e[1]),t[2]=Cr(e[2]),t}function H0(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function k0(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 rf(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 nf(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 of(t){let e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function J0(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function z0(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function Ks(t,e){let r=e[0],n=e[1],o=e[2],s=r*r+n*n+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function En(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Je(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[0],a=r[1],f=r[2];return t[0]=o*f-s*a,t[1]=s*i-n*f,t[2]=n*a-o*i,t}function Q0(t,e,r,n){let o=e[0],s=e[1],i=e[2];return t[0]=o+n*(r[0]-o),t[1]=s+n*(r[1]-s),t[2]=i+n*(r[2]-i),t}function V0(t,e,r,n){let o=Math.acos(Math.min(Math.max(En(e,r),-1),1)),s=Math.sin(o),i=Math.sin((1-n)*o)/s,a=Math.sin(n*o)/s;return t[0]=i*e[0]+a*r[0],t[1]=i*e[1]+a*r[1],t[2]=i*e[2]+a*r[2],t}function j0(t,e,r,n,o,s){let i=s*s,a=i*(2*s-3)+1,f=i*(s-2)+s,c=i*(s-1),l=i*(3-2*s);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 K0(t,e,r,n,o,s){let i=1-s,a=i*i,f=s*s,c=a*i,l=3*s*a,h=3*f*i,u=f*s;return t[0]=e[0]*c+r[0]*l+n[0]*h+o[0]*u,t[1]=e[1]*c+r[1]*l+n[1]*h+o[1]*u,t[2]=e[2]*c+r[2]*l+n[2]*h+o[2]*u,t}function X0(t,e){e=e===void 0?1:e;let r=xn()*2*Math.PI,n=xn()*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 ze(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[3]*n+r[7]*o+r[11]*s+r[15];return i=i||1,t[0]=(r[0]*n+r[4]*o+r[8]*s+r[12])/i,t[1]=(r[1]*n+r[5]*o+r[9]*s+r[13])/i,t[2]=(r[2]*n+r[6]*o+r[10]*s+r[14])/i,t}function _n(t,e,r){let n=e[0],o=e[1],s=e[2];return t[0]=n*r[0]+o*r[3]+s*r[6],t[1]=n*r[1]+o*r[4]+s*r[7],t[2]=n*r[2]+o*r[5]+s*r[8],t}function yn(t,e,r){let n=r[0],o=r[1],s=r[2],i=r[3],a=e[0],f=e[1],c=e[2],l=o*c-s*f,h=s*a-n*c,u=n*f-o*a,d=o*u-s*h,A=s*l-n*u,m=n*h-o*l,p=i*2;return l*=p,h*=p,u*=p,d*=2,A*=2,m*=2,t[0]=a+l+d,t[1]=f+h+A,t[2]=c+u+m,t}function Xs(t,e,r,n){let o=[],s=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],s[0]=o[0],s[1]=o[1]*Math.cos(n)-o[2]*Math.sin(n),s[2]=o[1]*Math.sin(n)+o[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Zs(t,e,r,n){let o=[],s=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],s[0]=o[2]*Math.sin(n)+o[0]*Math.cos(n),s[1]=o[1],s[2]=o[2]*Math.cos(n)-o[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Ys(t,e,r,n){let o=[],s=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],s[0]=o[0]*Math.cos(n)-o[1]*Math.sin(n),s[1]=o[0]*Math.sin(n)+o[1]*Math.cos(n),s[2]=o[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Ws(t,e){let r=t[0],n=t[1],o=t[2],s=e[0],i=e[1],a=e[2],f=Math.sqrt((r*r+n*n+o*o)*(s*s+i*i+a*a)),c=f&&En(t,e)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function Z0(t){return t[0]=0,t[1]=0,t[2]=0,t}function Y0(t){return`vec3(${t[0]}, ${t[1]}, ${t[2]})`}function W0(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function q0(t,e){let r=t[0],n=t[1],o=t[2],s=e[0],i=e[1],a=e[2];return Math.abs(r-s)<=1e-6*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(o-a)<=1e-6*Math.max(1,Math.abs(o),Math.abs(a))}var $0=$c,tA=tf,eA=ef,rA=rf,nA=nf,qs=qc,oA=of,sA=function(){let t=_o();return function(e,r,n,o,s,i){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],s(t,t,i),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}}();var $s=[0,0,0],Co,M=class extends ye{static get ZERO(){return Co||(Co=new M(0,0,0),Object.freeze(Co)),Co}constructor(e=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&It(e)?this.copy(e):(Z.debug&&(k(e),k(r),k(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 Z.debug&&(k(e.x),k(e.y),k(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]=k(e)}angle(e){return Ws(this,e)}cross(e){return Je(this,this,e),this.check()}rotateX({radians:e,origin:r=$s}){return Xs(this,this,r,e),this.check()}rotateY({radians:e,origin:r=$s}){return Zs(this,this,r,e),this.check()}rotateZ({radians:e,origin:r=$s}){return Ys(this,this,r,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return ze(this,this,e),this.check()}transformAsVector(e){return xo(this,this,e),this.check()}transformByMatrix3(e){return _n(this,this,e),this.check()}transformByMatrix2(e){return Yc(this,this,e),this.check()}transformByQuaternion(e){return yn(this,this,e),this.check()}};var To,br=class extends ye{static get ZERO(){return To||(To=new br(0,0,0,0),Object.freeze(To)),To}constructor(e=0,r=0,n=0,o=0){super(-0,-0,-0,-0),It(e)&&arguments.length===1?this.copy(e):(Z.debug&&(k(e),k(r),k(n),k(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 Z.debug&&(k(e.x),k(e.y),k(e.z),k(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]=k(e)}get w(){return this[3]}set w(e){this[3]=k(e)}transform(e){return ze(this,this,e),this.check()}transformByMatrix3(e){return Eo(this,this,e),this.check()}transformByMatrix2(e){return Wc(this,this,e),this.check()}transformByQuaternion(e){return yn(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}};var Mr=class extends Ee{toString(){let e="[";if(Z.printRowMajor){e+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)e+=` ${this[n*this.RANK+r]}`}else{e+="column-major:";for(let r=0;r<this.ELEMENTS;++r)e+=` ${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]=k(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 sf(){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 af(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 cf(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=e[4],a=e[5],f=e[6],c=e[7],l=e[8],h=l*i-a*c,u=-l*s+a*f,d=c*s-i*f,A=r*h+n*u+o*d;return A?(A=1/A,t[0]=h*A,t[1]=(-l*n+o*c)*A,t[2]=(a*n-o*i)*A,t[3]=u*A,t[4]=(l*r-o*f)*A,t[5]=(-a*r+o*s)*A,t[6]=d*A,t[7]=(-c*r+n*f)*A,t[8]=(i*r-n*s)*A,t):null}function ff(t){let e=t[0],r=t[1],n=t[2],o=t[3],s=t[4],i=t[5],a=t[6],f=t[7],c=t[8];return e*(c*s-i*f)+r*(-c*o+i*a)+n*(f*o-s*a)}function ti(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=e[8],u=r[0],d=r[1],A=r[2],m=r[3],p=r[4],E=r[5],y=r[6],T=r[7],b=r[8];return t[0]=u*n+d*i+A*c,t[1]=u*o+d*a+A*l,t[2]=u*s+d*f+A*h,t[3]=m*n+p*i+E*c,t[4]=m*o+p*a+E*l,t[5]=m*s+p*f+E*h,t[6]=y*n+T*i+b*c,t[7]=y*o+T*a+b*l,t[8]=y*s+T*f+b*h,t}function lf(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=e[8],u=r[0],d=r[1];return t[0]=n,t[1]=o,t[2]=s,t[3]=i,t[4]=a,t[5]=f,t[6]=u*n+d*i+c,t[7]=u*o+d*a+l,t[8]=u*s+d*f+h,t}function hf(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=e[8],u=Math.sin(r),d=Math.cos(r);return t[0]=d*n+u*i,t[1]=d*o+u*a,t[2]=d*s+u*f,t[3]=d*i-u*n,t[4]=d*a-u*o,t[5]=d*f-u*s,t[6]=c,t[7]=l,t[8]=h,t}function ei(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 uf(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r+r,a=n+n,f=o+o,c=r*i,l=n*i,h=n*a,u=o*i,d=o*a,A=o*f,m=s*i,p=s*a,E=s*f;return t[0]=1-h-A,t[3]=l-E,t[6]=u+p,t[1]=l+E,t[4]=1-c-A,t[7]=d-m,t[2]=u-p,t[5]=d+m,t[8]=1-c-h,t}var ri;(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"})(ri||(ri={}));var aA=Object.freeze([1,0,0,0,1,0,0,0,1]),X=class extends Mr{static get IDENTITY(){return fA()}static get ZERO(){return cA()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return ri}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(aA)}fromObject(e){return this.check()}fromQuaternion(e){return uf(this,e),this.check()}set(e,r,n,o,s,i,a,f,c){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this[4]=s,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this.check()}setRowMajor(e,r,n,o,s,i,a,f,c){return this[0]=e,this[1]=o,this[2]=a,this[3]=r,this[4]=s,this[5]=f,this[6]=n,this[7]=i,this[8]=c,this.check()}determinant(){return ff(this)}transpose(){return af(this,this),this.check()}invert(){return cf(this,this),this.check()}multiplyLeft(e){return ti(this,e,this),this.check()}multiplyRight(e){return ti(this,this,e),this.check()}rotate(e){return hf(this,this,e),this.check()}scale(e){return Array.isArray(e)?ei(this,this,e):ei(this,this,[e,e]),this.check()}translate(e){return lf(this,this,e),this.check()}transform(e,r){let n;switch(e.length){case 2:n=po(r||[-0,-0],e,this);break;case 3:n=_n(r||[-0,-0,-0],e,this);break;case 4:n=Eo(r||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return _e(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)}},bo,Mo=null;function cA(){return bo||(bo=new X([0,0,0,0,0,0,0,0,0]),Object.freeze(bo)),bo}function fA(){return Mo||(Mo=new X,Object.freeze(Mo)),Mo}var Tn={};lt(Tn,{add:()=>LA,adjoint:()=>mA,clone:()=>hA,copy:()=>uA,create:()=>lA,decompose:()=>bA,determinant:()=>si,equals:()=>UA,exactEquals:()=>NA,frob:()=>OA,fromQuat:()=>ui,fromQuat2:()=>yA,fromRotation:()=>BA,fromRotationTranslation:()=>Af,fromRotationTranslationScale:()=>MA,fromRotationTranslationScaleOrigin:()=>wA,fromScaling:()=>gA,fromTranslation:()=>pA,fromValues:()=>dA,fromXRotation:()=>xA,fromYRotation:()=>EA,fromZRotation:()=>_A,frustum:()=>di,getRotation:()=>TA,getScaling:()=>mf,getTranslation:()=>CA,identity:()=>df,invert:()=>oi,lookAt:()=>pi,mul:()=>PA,multiply:()=>Cn,multiplyScalar:()=>vA,multiplyScalarAndAdd:()=>GA,ortho:()=>mi,orthoNO:()=>gf,orthoZO:()=>FA,perspective:()=>Ai,perspectiveFromFieldOfView:()=>SA,perspectiveNO:()=>pf,perspectiveZO:()=>IA,rotate:()=>ci,rotateX:()=>fi,rotateY:()=>li,rotateZ:()=>hi,scale:()=>ai,set:()=>AA,str:()=>DA,sub:()=>HA,subtract:()=>Bf,targetTo:()=>RA,translate:()=>ii,transpose:()=>ni});function lA(){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 hA(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 uA(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 dA(t,e,r,n,o,s,i,a,f,c,l,h,u,d,A,m){let p=new q(16);return p[0]=t,p[1]=e,p[2]=r,p[3]=n,p[4]=o,p[5]=s,p[6]=i,p[7]=a,p[8]=f,p[9]=c,p[10]=l,p[11]=h,p[12]=u,p[13]=d,p[14]=A,p[15]=m,p}function AA(t,e,r,n,o,s,i,a,f,c,l,h,u,d,A,m,p){return t[0]=e,t[1]=r,t[2]=n,t[3]=o,t[4]=s,t[5]=i,t[6]=a,t[7]=f,t[8]=c,t[9]=l,t[10]=h,t[11]=u,t[12]=d,t[13]=A,t[14]=m,t[15]=p,t}function df(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 ni(t,e){if(t===e){let r=e[1],n=e[2],o=e[3],s=e[6],i=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]=s,t[11]=e[14],t[12]=o,t[13]=i,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 oi(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=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B+o*O,t[14]=m*T-A*C-p*y,t[15]=l*C-h*T+u*y,t}function si(t){let e=t[0],r=t[1],n=t[2],o=t[3],s=t[4],i=t[5],a=t[6],f=t[7],c=t[8],l=t[9],h=t[10],u=t[11],d=t[12],A=t[13],m=t[14],p=t[15],E=e*i-r*s,y=e*a-n*s,T=r*a-n*i,b=c*A-l*d,C=c*m-h*d,w=l*m-h*A,I=e*w-r*C+n*b,O=s*w-i*C+a*b,B=c*T-l*y+h*E,g=d*T-A*y+m*E;return f*I-o*O+p*B-u*g}function Cn(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=e[8],u=e[9],d=e[10],A=e[11],m=e[12],p=e[13],E=e[14],y=e[15],T=r[0],b=r[1],C=r[2],w=r[3];return t[0]=T*n+b*a+C*h+w*m,t[1]=T*o+b*f+C*u+w*p,t[2]=T*s+b*c+C*d+w*E,t[3]=T*i+b*l+C*A+w*y,T=r[4],b=r[5],C=r[6],w=r[7],t[4]=T*n+b*a+C*h+w*m,t[5]=T*o+b*f+C*u+w*p,t[6]=T*s+b*c+C*d+w*E,t[7]=T*i+b*l+C*A+w*y,T=r[8],b=r[9],C=r[10],w=r[11],t[8]=T*n+b*a+C*h+w*m,t[9]=T*o+b*f+C*u+w*p,t[10]=T*s+b*c+C*d+w*E,t[11]=T*i+b*l+C*A+w*y,T=r[12],b=r[13],C=r[14],w=r[15],t[12]=T*n+b*a+C*h+w*m,t[13]=T*o+b*f+C*u+w*p,t[14]=T*s+b*c+C*d+w*E,t[15]=T*i+b*l+C*A+w*y,t}function ii(t,e,r){let n=r[0],o=r[1],s=r[2],i,a,f,c,l,h,u,d,A,m,p,E;return e===t?(t[12]=e[0]*n+e[4]*o+e[8]*s+e[12],t[13]=e[1]*n+e[5]*o+e[9]*s+e[13],t[14]=e[2]*n+e[6]*o+e[10]*s+e[14],t[15]=e[3]*n+e[7]*o+e[11]*s+e[15]):(i=e[0],a=e[1],f=e[2],c=e[3],l=e[4],h=e[5],u=e[6],d=e[7],A=e[8],m=e[9],p=e[10],E=e[11],t[0]=i,t[1]=a,t[2]=f,t[3]=c,t[4]=l,t[5]=h,t[6]=u,t[7]=d,t[8]=A,t[9]=m,t[10]=p,t[11]=E,t[12]=i*n+l*o+A*s+e[12],t[13]=a*n+h*o+m*s+e[13],t[14]=f*n+u*o+p*s+e[14],t[15]=c*n+d*o+E*s+e[15]),t}function ai(t,e,r){let n=r[0],o=r[1],s=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]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ci(t,e,r,n){let o=n[0],s=n[1],i=n[2],a=Math.sqrt(o*o+s*s+i*i),f,c,l,h,u,d,A,m,p,E,y,T,b,C,w,I,O,B,g,x,_,U,N,P;return a<1e-6?null:(a=1/a,o*=a,s*=a,i*=a,c=Math.sin(r),f=Math.cos(r),l=1-f,h=e[0],u=e[1],d=e[2],A=e[3],m=e[4],p=e[5],E=e[6],y=e[7],T=e[8],b=e[9],C=e[10],w=e[11],I=o*o*l+f,O=s*o*l+i*c,B=i*o*l-s*c,g=o*s*l-i*c,x=s*s*l+f,_=i*s*l+o*c,U=o*i*l+s*c,N=s*i*l-o*c,P=i*i*l+f,t[0]=h*I+m*O+T*B,t[1]=u*I+p*O+b*B,t[2]=d*I+E*O+C*B,t[3]=A*I+y*O+w*B,t[4]=h*g+m*x+T*_,t[5]=u*g+p*x+b*_,t[6]=d*g+E*x+C*_,t[7]=A*g+y*x+w*_,t[8]=h*U+m*N+T*P,t[9]=u*U+p*N+b*P,t[10]=d*U+E*N+C*P,t[11]=A*U+y*N+w*P,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function fi(t,e,r){let n=Math.sin(r),o=Math.cos(r),s=e[4],i=e[5],a=e[6],f=e[7],c=e[8],l=e[9],h=e[10],u=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]=s*o+c*n,t[5]=i*o+l*n,t[6]=a*o+h*n,t[7]=f*o+u*n,t[8]=c*o-s*n,t[9]=l*o-i*n,t[10]=h*o-a*n,t[11]=u*o-f*n,t}function li(t,e,r){let n=Math.sin(r),o=Math.cos(r),s=e[0],i=e[1],a=e[2],f=e[3],c=e[8],l=e[9],h=e[10],u=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]=s*o-c*n,t[1]=i*o-l*n,t[2]=a*o-h*n,t[3]=f*o-u*n,t[8]=s*n+c*o,t[9]=i*n+l*o,t[10]=a*n+h*o,t[11]=f*n+u*o,t}function hi(t,e,r){let n=Math.sin(r),o=Math.cos(r),s=e[0],i=e[1],a=e[2],f=e[3],c=e[4],l=e[5],h=e[6],u=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]=s*o+c*n,t[1]=i*o+l*n,t[2]=a*o+h*n,t[3]=f*o+u*n,t[4]=c*o-s*n,t[5]=l*o-i*n,t[6]=h*o-a*n,t[7]=u*o-f*n,t}function pA(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 gA(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 BA(t,e,r){let n=r[0],o=r[1],s=r[2],i=Math.sqrt(n*n+o*o+s*s),a,f,c;return i<1e-6?null:(i=1/i,n*=i,o*=i,s*=i,f=Math.sin(e),a=Math.cos(e),c=1-a,t[0]=n*n*c+a,t[1]=o*n*c+s*f,t[2]=s*n*c-o*f,t[3]=0,t[4]=n*o*c-s*f,t[5]=o*o*c+a,t[6]=s*o*c+n*f,t[7]=0,t[8]=n*s*c+o*f,t[9]=o*s*c-n*f,t[10]=s*s*c+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function xA(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 EA(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 _A(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 Af(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=n+n,f=o+o,c=s+s,l=n*a,h=n*f,u=n*c,d=o*f,A=o*c,m=s*c,p=i*a,E=i*f,y=i*c;return t[0]=1-(d+m),t[1]=h+y,t[2]=u-E,t[3]=0,t[4]=h-y,t[5]=1-(l+m),t[6]=A+p,t[7]=0,t[8]=u+E,t[9]=A-p,t[10]=1-(l+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function yA(t,e){let r=new q(3),n=-e[0],o=-e[1],s=-e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=n*n+o*o+s*s+i*i;return h>0?(r[0]=(a*i+l*n+f*s-c*o)*2/h,r[1]=(f*i+l*o+c*n-a*s)*2/h,r[2]=(c*i+l*s+a*o-f*n)*2/h):(r[0]=(a*i+l*n+f*s-c*o)*2,r[1]=(f*i+l*o+c*n-a*s)*2,r[2]=(c*i+l*s+a*o-f*n)*2),Af(t,e,r),t}function CA(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function mf(t,e){let r=e[0],n=e[1],o=e[2],s=e[4],i=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(s*s+i*i+a*a),t[2]=Math.sqrt(f*f+c*c+l*l),t}function TA(t,e){let r=new q(3);mf(r,e);let n=1/r[0],o=1/r[1],s=1/r[2],i=e[0]*n,a=e[1]*o,f=e[2]*s,c=e[4]*n,l=e[5]*o,h=e[6]*s,u=e[8]*n,d=e[9]*o,A=e[10]*s,m=i+l+A,p=0;return m>0?(p=Math.sqrt(m+1)*2,t[3]=.25*p,t[0]=(h-d)/p,t[1]=(u-f)/p,t[2]=(a-c)/p):i>l&&i>A?(p=Math.sqrt(1+i-l-A)*2,t[3]=(h-d)/p,t[0]=.25*p,t[1]=(a+c)/p,t[2]=(u+f)/p):l>A?(p=Math.sqrt(1+l-i-A)*2,t[3]=(u-f)/p,t[0]=(a+c)/p,t[1]=.25*p,t[2]=(h+d)/p):(p=Math.sqrt(1+A-i-l)*2,t[3]=(a-c)/p,t[0]=(u+f)/p,t[1]=(h+d)/p,t[2]=.25*p),t}function bA(t,e,r,n){e[0]=n[12],e[1]=n[13],e[2]=n[14];let o=n[0],s=n[1],i=n[2],a=n[4],f=n[5],c=n[6],l=n[8],h=n[9],u=n[10];r[0]=Math.sqrt(o*o+s*s+i*i),r[1]=Math.sqrt(a*a+f*f+c*c),r[2]=Math.sqrt(l*l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,t[9]=pt,t[10]=Y,t[11]=0,t[12]=r[0]+O-(x*O+N*B+tt*g),t[13]=r[1]+B-(_*O+P*B+pt*g),t[14]=r[2]+g-(U*O+v*B+Y*g),t[15]=1,t}function ui(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r+r,a=n+n,f=o+o,c=r*i,l=n*i,h=n*a,u=o*i,d=o*a,A=o*f,m=s*i,p=s*a,E=s*f;return t[0]=1-h-A,t[1]=l+E,t[2]=u-p,t[3]=0,t[4]=l-E,t[5]=1-c-A,t[6]=d+m,t[7]=0,t[8]=u+p,t[9]=d-m,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function di(t,e,r,n,o,s,i){let a=1/(r-e),f=1/(o-n),c=1/(s-i);return t[0]=s*2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s*2*f,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(o+n)*f,t[10]=(i+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=i*s*2*c,t[15]=0,t}function pf(t,e,r,n,o){let s=1/Math.tan(e/2);if(t[0]=s/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,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 i=1/(n-o);t[10]=(o+n)*i,t[14]=2*o*n*i}else t[10]=-1,t[14]=-2*n;return t}var Ai=pf;function IA(t,e,r,n,o){let s=1/Math.tan(e/2);if(t[0]=s/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,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 i=1/(n-o);t[10]=o*i,t[14]=o*n*i}else t[10]=-1,t[14]=-n;return t}function SA(t,e,r,n){let o=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),i=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),f=2/(i+a),c=2/(o+s);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]=-((i-a)*f*.5),t[9]=(o-s)*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 gf(t,e,r,n,o,s,i){let a=1/(e-r),f=1/(n-o),c=1/(s-i);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]=(i+s)*c,t[15]=1,t}var mi=gf;function FA(t,e,r,n,o,s,i){let a=1/(e-r),f=1/(n-o),c=1/(s-i);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]=s*c,t[15]=1,t}function pi(t,e,r,n){let o,s,i,a,f,c,l,h,u,d,A=e[0],m=e[1],p=e[2],E=n[0],y=n[1],T=n[2],b=r[0],C=r[1],w=r[2];return Math.abs(A-b)<1e-6&&Math.abs(m-C)<1e-6&&Math.abs(p-w)<1e-6?df(t):(h=A-b,u=m-C,d=p-w,o=1/Math.sqrt(h*h+u*u+d*d),h*=o,u*=o,d*=o,s=y*d-T*u,i=T*h-E*d,a=E*u-y*h,o=Math.sqrt(s*s+i*i+a*a),o?(o=1/o,s*=o,i*=o,a*=o):(s=0,i=0,a=0),f=u*a-d*i,c=d*s-h*a,l=h*i-u*s,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]=s,t[1]=f,t[2]=h,t[3]=0,t[4]=i,t[5]=c,t[6]=u,t[7]=0,t[8]=a,t[9]=l,t[10]=d,t[11]=0,t[12]=-(s*A+i*m+a*p),t[13]=-(f*A+c*m+l*p),t[14]=-(h*A+u*m+d*p),t[15]=1,t)}function RA(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=n[0],f=n[1],c=n[2],l=o-r[0],h=s-r[1],u=i-r[2],d=l*l+h*h+u*u;d>0&&(d=1/Math.sqrt(d),l*=d,h*=d,u*=d);let A=f*u-c*h,m=c*l-a*u,p=a*h-f*l;return d=A*A+m*m+p*p,d>0&&(d=1/Math.sqrt(d),A*=d,m*=d,p*=d),t[0]=A,t[1]=m,t[2]=p,t[3]=0,t[4]=h*p-u*m,t[5]=u*A-l*p,t[6]=l*m-h*A,t[7]=0,t[8]=l,t[9]=h,t[10]=u,t[11]=0,t[12]=o,t[13]=s,t[14]=i,t[15]=1,t}function DA(t){return`mat4(${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}, ${t[4]}, ${t[5]}, ${t[6]}, ${t[7]}, ${t[8]}, ${t[9]}, ${t[10]}, ${t[11]}, ${t[12]}, ${t[13]}, ${t[14]}, ${t[15]})`}function OA(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 LA(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 Bf(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 vA(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 GA(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 NA(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 UA(t,e){let r=t[0],n=t[1],o=t[2],s=t[3],i=t[4],a=t[5],f=t[6],c=t[7],l=t[8],h=t[9],u=t[10],d=t[11],A=t[12],m=t[13],p=t[14],E=t[15],y=e[0],T=e[1],b=e[2],C=e[3],w=e[4],I=e[5],O=e[6],B=e[7],g=e[8],x=e[9],_=e[10],U=e[11],N=e[12],P=e[13],v=e[14],tt=e[15];return Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-T)<=1e-6*Math.max(1,Math.abs(n),Math.abs(T))&&Math.abs(o-b)<=1e-6*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(s-C)<=1e-6*Math.max(1,Math.abs(s),Math.abs(C))&&Math.abs(i-w)<=1e-6*Math.max(1,Math.abs(i),Math.abs(w))&&Math.abs(a-I)<=1e-6*Math.max(1,Math.abs(a),Math.abs(I))&&Math.abs(f-O)<=1e-6*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(c-B)<=1e-6*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(l-g)<=1e-6*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(h-x)<=1e-6*Math.max(1,Math.abs(h),Math.abs(x))&&Math.abs(u-_)<=1e-6*Math.max(1,Math.abs(u),Math.abs(_))&&Math.abs(d-U)<=1e-6*Math.max(1,Math.abs(d),Math.abs(U))&&Math.abs(A-N)<=1e-6*Math.max(1,Math.abs(A),Math.abs(N))&&Math.abs(m-P)<=1e-6*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(p-v)<=1e-6*Math.max(1,Math.abs(p),Math.abs(v))&&Math.abs(E-tt)<=1e-6*Math.max(1,Math.abs(E),Math.abs(tt))}var PA=Cn,HA=Bf;function kA(){let t=new q(4);return q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function xf(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 Ef(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 _f(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 yf(t){let e=t[0],r=t[1],n=t[2],o=t[3];return e*e+r*r+n*n+o*o}function Cf(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r*r+n*n+o*o+s*s;return i>0&&(i=1/Math.sqrt(i)),t[0]=r*i,t[1]=n*i,t[2]=o*i,t[3]=s*i,t}function Tf(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function bf(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=e[3];return t[0]=o+n*(r[0]-o),t[1]=s+n*(r[1]-s),t[2]=i+n*(r[2]-i),t[3]=a+n*(r[3]-a),t}function Mf(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3];return t[0]=r[0]*n+r[4]*o+r[8]*s+r[12]*i,t[1]=r[1]*n+r[5]*o+r[9]*s+r[13]*i,t[2]=r[2]*n+r[6]*o+r[10]*s+r[14]*i,t[3]=r[3]*n+r[7]*o+r[11]*s+r[15]*i,t}function wf(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[0],a=r[1],f=r[2],c=r[3],l=c*n+a*s-f*o,h=c*o+f*n-i*s,u=c*s+i*o-a*n,d=-i*n-a*o-f*s;return t[0]=l*c+d*-i+h*-f-u*-a,t[1]=h*c+d*-a+u*-i-l*-f,t[2]=u*c+d*-f+l*-a-h*-i,t[3]=e[3],t}var $y=function(){let t=kA();return function(e,r,n,o,s,i){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],s(t,t,i),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2],e[a+3]=t[3];return e}}();var xi;(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"})(xi||(xi={}));var zA=45*Math.PI/180,QA=1,gi=.1,Bi=500,VA=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),St=class extends Mr{static get IDENTITY(){return KA()}static get ZERO(){return jA()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return xi}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,s,i,a,f,c,l,h,u,d,A,m,p){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this[4]=s,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this[9]=l,this[10]=h,this[11]=u,this[12]=d,this[13]=A,this[14]=m,this[15]=p,this.check()}setRowMajor(e,r,n,o,s,i,a,f,c,l,h,u,d,A,m,p){return this[0]=e,this[1]=s,this[2]=c,this[3]=d,this[4]=r,this[5]=i,this[6]=l,this[7]=A,this[8]=n,this[9]=a,this[10]=h,this[11]=m,this[12]=o,this[13]=f,this[14]=u,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(VA)}fromObject(e){return this.check()}fromQuaternion(e){return ui(this,e),this.check()}frustum(e){let{left:r,right:n,bottom:o,top:s,near:i=gi,far:a=Bi}=e;return a===1/0?XA(this,r,n,o,s,i):di(this,r,n,o,s,i,a),this.check()}lookAt(e){let{eye:r,center:n=[0,0,0],up:o=[0,1,0]}=e;return pi(this,r,n,o),this.check()}ortho(e){let{left:r,right:n,bottom:o,top:s,near:i=gi,far:a=Bi}=e;return mi(this,r,n,o,s,i,a),this.check()}orthographic(e){let{fovy:r=zA,aspect:n=QA,focalDistance:o=1,near:s=gi,far:i=Bi}=e;If(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:s,far:i})}perspective(e){let{fovy:r=45*Math.PI/180,aspect:n=1,near:o=.1,far:s=500}=e;return If(r),Ai(this,r,n,o,s),this.check()}determinant(){return si(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],s=1/n[1],i=1/n[2];return e[0]=this[0]*o,e[1]=this[1]*s,e[2]=this[2]*i,e[3]=0,e[4]=this[4]*o,e[5]=this[5]*s,e[6]=this[6]*i,e[7]=0,e[8]=this[8]*o,e[9]=this[9]*s,e[10]=this[10]*i,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],s=1/n[1],i=1/n[2];return e[0]=this[0]*o,e[1]=this[1]*s,e[2]=this[2]*i,e[3]=this[4]*o,e[4]=this[5]*s,e[5]=this[6]*i,e[6]=this[8]*o,e[7]=this[9]*s,e[8]=this[10]*i,e}transpose(){return ni(this,this),this.check()}invert(){return oi(this,this),this.check()}multiplyLeft(e){return Cn(this,e,this),this.check()}multiplyRight(e){return Cn(this,this,e),this.check()}rotateX(e){return fi(this,this,e),this.check()}rotateY(e){return li(this,this,e),this.check()}rotateZ(e){return hi(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,r){return ci(this,this,e,r),this.check()}scale(e){return ai(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return ii(this,this,e),this.check()}transform(e,r){return e.length===4?(r=Mf(r||[-0,-0,-0,-0],e,this),_e(r,4),r):this.transformAsPoint(e,r)}transformAsPoint(e,r){let{length:n}=e,o;switch(n){case 2:o=go(r||[-0,-0],e,this);break;case 3:o=ze(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return _e(o,e.length),o}transformAsVector(e,r){let n;switch(e.length){case 2:n=Bo(r||[-0,-0],e,this);break;case 3:n=xo(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return _e(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])}},wo,Io;function jA(){return wo||(wo=new St([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(wo)),wo}function KA(){return Io||(Io=new St,Object.freeze(Io)),Io}function If(t){if(t>Math.PI*2)throw Error("expected radians")}function XA(t,e,r,n,o,s){let i=2*s/(r-e),a=2*s/(o-n),f=(r+e)/(r-e),c=(o+n)/(o-n),l=-1,h=-1,u=-2*s;return t[0]=i,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]=h,t[12]=0,t[13]=0,t[14]=u,t[15]=0,t}function Sf(){let t=new q(4);return q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Ff(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Ei(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 _i(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=r[0],f=r[1],c=r[2],l=r[3];return t[0]=n*l+i*a+o*c-s*f,t[1]=o*l+i*f+s*a-n*c,t[2]=s*l+i*c+n*f-o*a,t[3]=i*l-n*a-o*f-s*c,t}function Rf(t,e,r){r*=.5;let n=e[0],o=e[1],s=e[2],i=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]=s*f-o*a,t[3]=i*f-n*a,t}function Df(t,e,r){r*=.5;let n=e[0],o=e[1],s=e[2],i=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]=s*f+n*a,t[3]=i*f-o*a,t}function Of(t,e,r){r*=.5;let n=e[0],o=e[1],s=e[2],i=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]=s*f+i*a,t[3]=i*f-s*a,t}function Lf(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 bn(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=e[3],f=r[0],c=r[1],l=r[2],h=r[3],u,d,A,m,p;return u=o*f+s*c+i*l+a*h,u<0&&(u=-u,f=-f,c=-c,l=-l,h=-h),1-u>1e-6?(d=Math.acos(u),p=Math.sin(d),A=Math.sin((1-n)*d)/p,m=Math.sin(n*d)/p):(A=1-n,m=n),t[0]=A*o+m*f,t[1]=A*s+m*c,t[2]=A*i+m*l,t[3]=A*a+m*h,t}function vf(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r*r+n*n+o*o+s*s,a=i?1/i:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-o*a,t[3]=s*a,t}function Gf(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function yi(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 s=(o+1)%3,i=(o+2)%3;n=Math.sqrt(e[o*3+o]-e[s*3+s]-e[i*3+i]+1),t[o]=.5*n,n=.5/n,t[3]=(e[s*3+i]-e[i*3+s])*n,t[s]=(e[s*3+o]+e[o*3+s])*n,t[i]=(e[i*3+o]+e[o*3+i])*n}return t}var Nf=xf;var Uf=Ef,Pf=Tf,Hf=bf,kf=_f;var Jf=yf;var zf=Cf;var Qf=function(){let t=_o(),e=yo(1,0,0),r=yo(0,1,0);return function(n,o,s){let i=En(o,s);return i<-.999999?(Je(t,e,o),qs(t)<1e-6&&Je(t,r,o),Ks(t,t),Ei(n,t,Math.PI),n):i>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Je(t,o,s),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+i,zf(n,n))}}(),dC=function(){let t=Sf(),e=Sf();return function(r,n,o,s,i,a){return bn(t,n,i,a),bn(e,o,s,a),bn(r,t,e,2*a*(1-a)),r}}(),AC=function(){let t=sf();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],zf(e,yi(e,t))}}();var ZA=[0,0,0,1],Ce=class extends Ee{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 yi(this,e),this.check()}fromAxisRotation(e,r){return Ei(this,e,r),this.check()}identity(){return Ff(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]=k(e)}get y(){return this[1]}set y(e){this[1]=k(e)}get z(){return this[2]}set z(e){this[2]=k(e)}get w(){return this[3]}set w(e){this[3]=k(e)}len(){return kf(this)}lengthSquared(){return Jf(this)}dot(e){return Pf(this,e)}rotationTo(e,r){return Qf(this,e,r),this.check()}add(e){return Nf(this,this,e),this.check()}calculateW(){return Lf(this,this),this.check()}conjugate(){return Gf(this,this),this.check()}invert(){return vf(this,this),this.check()}lerp(e,r,n){return n===void 0?this.lerp(this,e,r):(Hf(this,e,r,n),this.check())}multiplyRight(e){return _i(this,this,e),this.check()}multiplyLeft(e){return _i(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 Rf(this,this,e),this.check()}rotateY(e){return Df(this,this,e),this.check()}rotateZ(e){return Of(this,this,e),this.check()}scale(e){return Uf(this,this,e),this.check()}slerp(e,r,n){let o,s,i;switch(arguments.length){case 1:({start:o=ZA,target:s,ratio:i}=e);break;case 2:o=this,s=e,i=r;break;default:o=e,s=r,i=n}return bn(this,o,s,i),this.check()}transformVector4(e,r=new br){return wf(r,e,this),_e(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 Ft={};lt(Ft,{EPSILON1:()=>YA,EPSILON10:()=>sm,EPSILON11:()=>im,EPSILON12:()=>am,EPSILON13:()=>cm,EPSILON14:()=>fm,EPSILON15:()=>lm,EPSILON16:()=>hm,EPSILON17:()=>um,EPSILON18:()=>dm,EPSILON19:()=>Am,EPSILON2:()=>WA,EPSILON20:()=>mm,EPSILON3:()=>qA,EPSILON4:()=>$A,EPSILON5:()=>tm,EPSILON6:()=>em,EPSILON7:()=>rm,EPSILON8:()=>nm,EPSILON9:()=>om,PI_OVER_FOUR:()=>gm,PI_OVER_SIX:()=>Bm,PI_OVER_TWO:()=>pm,TWO_PI:()=>xm});var YA=.1,WA=.01,qA=.001,$A=1e-4,tm=1e-5,em=1e-6,rm=1e-7,nm=1e-8,om=1e-9,sm=1e-10,im=1e-11,am=1e-12,cm=1e-13,fm=1e-14,lm=1e-15,hm=1e-16,um=1e-17,dm=1e-18,Am=1e-19,mm=1e-20,pm=Math.PI/2,gm=Math.PI/4,Bm=Math.PI/6,xm=Math.PI*2;var ae=6356752314245179e-9,Em={radii:[6378137,6378137,ae],radiiSquared:[6378137*6378137,6378137*6378137,ae*ae],oneOverRadii:[1/6378137,1/6378137,1/ae],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(ae*ae)],maximumRadius:Math.max(6378137,6378137,ae),centerToleranceSquared:.1};function So(t){return t}var QC=new M;function _m(t,e=[],r=So){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 Vf(t,e=[]){return _m(t,e,Z._cartographicRadians?So:zs)}function ym(t,e,r=So){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 jf(t,e){return ym(t,e,Z._cartographicRadians?So:Qs)}var Kf=1e-14,Cm=new M,Xf={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"}},Ci={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Mn={east:new M,north:new M,up:new M,west:new M,south:new M,down:new M},Tm=new M,bm=new M,Mm=new M;function Ti(t,e,r,n,o,s){let i=Xf[e]&&Xf[e][r];at(i&&(!n||n===i));let a,f,c,l=Cm.copy(o);if(bt(l.x,0,Kf)&&bt(l.y,0,Kf)){let u=Math.sign(l.z);a=Tm.fromArray(Ci[e]),e!=="east"&&e!=="west"&&a.scale(u),f=bm.fromArray(Ci[r]),r!=="east"&&r!=="west"&&f.scale(u),c=Mm.fromArray(Ci[n]),n!=="east"&&n!=="west"&&c.scale(u)}else{let{up:u,east:d,north:A}=Mn;d.set(-l.y,l.x,0).normalize(),t.geodeticSurfaceNormal(l,u),A.copy(u).cross(d);let{down:m,west:p,south:E}=Mn;m.copy(u).scale(-1),p.copy(d).scale(-1),E.copy(A).scale(-1),a=Mn[e],f=Mn[r],c=Mn[n]}return s[0]=a.x,s[1]=a.y,s[2]=a.z,s[3]=0,s[4]=f.x,s[5]=f.y,s[6]=f.z,s[7]=0,s[8]=c.x,s[9]=c.y,s[10]=c.z,s[11]=0,s[12]=l.x,s[13]=l.y,s[14]=l.z,s[15]=1,s}var wr=new M,wm=new M,Im=new M;function Zf(t,e,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:o,centerToleranceSquared:s}=e;wr.from(t);let i=wr.x,a=wr.y,f=wr.z,c=n.x,l=n.y,h=n.z,u=i*i*c*c,d=a*a*l*l,A=f*f*h*h,m=u+d+A,p=Math.sqrt(1/m);if(!Number.isFinite(p))return;let E=wm;if(E.copy(t).scale(p),m<s)return E.to(r);let y=o.x,T=o.y,b=o.z,C=Im;C.set(E.x*y*2,E.y*T*2,E.z*b*2);let w=(1-p)*wr.len()/(.5*C.len()),I=0,O,B,g,x;do{w-=I,O=1/(1+w*y),B=1/(1+w*T),g=1/(1+w*b);let _=O*O,U=B*B,N=g*g,P=_*O,v=U*B,tt=N*g;x=u*_+d*U+A*N-1;let Y=-2*(u*P*y+d*v*T+A*tt*b);I=x/Y}while(Math.abs(x)>Ft.EPSILON12);return wr.scale([O,B,g]).to(r)}var Fo=new M,Yf=new M,Rm=new M,Ht=new M,Dm=new M,Ro=new M,ce=class{constructor(e=0,r=0,n=0){this.centerToleranceSquared=Ft.EPSILON1,at(e>=0),at(r>=0),at(n>=0),this.radii=new M(e,r,n),this.radiiSquared=new M(e*e,r*r,n*n),this.radiiToTheFourth=new M(e*e*e*e,r*r*r*r,n*n*n*n),this.oneOverRadii=new M(e===0?0:1/e,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new M(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=Yf,o=Rm,[,,s]=e;this.geodeticSurfaceNormalCartographic(e,n),o.copy(this.radiiSquared).scale(n);let i=Math.sqrt(n.dot(o));return o.scale(1/i),n.scale(s),o.add(n),o.to(r)}cartesianToCartographic(e,r=[0,0,0]){Ro.from(e);let n=this.scaleToGeodeticSurface(Ro,Ht);if(!n)return;let o=this.geodeticSurfaceNormal(n,Yf),s=Dm;s.copy(Ro).subtract(n);let i=Math.atan2(o.y,o.x),a=Math.asin(o.z),f=Math.sign(Qe.dot(s,Ro))*Qe.length(s);return jf([i,a,f],r)}eastNorthUpToFixedFrame(e,r=new St){return Ti(this,"east","north","up",e,r)}localFrameToFixedFrame(e,r,n,o,s=new St){return Ti(this,e,r,n,o,s)}geocentricSurfaceNormal(e,r=[0,0,0]){return Fo.from(e).normalize().to(r)}geodeticSurfaceNormalCartographic(e,r=[0,0,0]){let n=Vf(e),o=n[0],s=n[1],i=Math.cos(s);return Fo.set(i*Math.cos(o),i*Math.sin(o),Math.sin(s)).normalize(),Fo.to(r)}geodeticSurfaceNormal(e,r=[0,0,0]){return Fo.from(e).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(e,r){return Zf(e,this,r)}scaleToGeocentricSurface(e,r=[0,0,0]){Ht.from(e);let n=Ht.x,o=Ht.y,s=Ht.z,i=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*i.x+o*o*i.y+s*s*i.z);return Ht.multiplyScalar(a).to(r)}transformPositionToScaledSpace(e,r=[0,0,0]){return Ht.from(e).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(e,r=[0,0,0]){return Ht.from(e).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(e,r=0,n=[0,0,0]){at(bt(this.radii.x,this.radii.y,Ft.EPSILON15)),at(this.radii.z>0),Ht.from(e);let o=Ht.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(o)>=this.radii.z-r))return Ht.set(0,0,o).to(n)}};ce.WGS84=new ce(6378137,6378137,ae);var ct={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var fT=new M,lT=new M;var wn=new M,Wf=new M,Te=class{constructor(e=[0,0,0],r=0){this.radius=-0,this.center=new M,this.fromCenterRadius(e,r)}fromCenterRadius(e,r){return this.center.from(e),this.radius=r,this}fromCornerPoints(e,r){return r=wn.from(r),this.center=new M().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 Te(this.center,this.radius)}union(e){let r=this.center,n=this.radius,o=e.center,s=e.radius,i=wn.copy(o).subtract(r),a=i.magnitude();if(n>=a+s)return this.clone();if(s>=a+n)return e.clone();let f=(n+a+s)*.5;return Wf.copy(i).scale((-n+f)/a).add(r),this.center.copy(Wf),this.radius=f,this}expand(e){let n=wn.from(e).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(e){this.center.transform(e);let r=Tn.getScaling(wn,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=wn.from(e).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(e){let r=this.center,n=this.radius,s=e.normal.dot(r)+e.distance;return s<-n?ct.OUTSIDE:s<n?ct.INTERSECTING:ct.INSIDE}};var Om=new M,Lm=new M,Do=new M,Oo=new M,Lo=new M,vm=new M,Gm=new M,fe={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},Ve=class{constructor(e=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){this.center=new M().from(e),this.halfAxes=new X(r)}get halfSize(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new M(e).len(),new M(r).len(),new M(n).len()]}get quaternion(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),o=new M(e).normalize(),s=new M(r).normalize(),i=new M(n).normalize();return new Ce().fromMatrix3(new X([...o,...s,...i]))}fromCenterHalfSizeQuaternion(e,r,n){let o=new Ce(n),s=new X().fromQuaternion(o);return s[0]=s[0]*r[0],s[1]=s[1]*r[0],s[2]=s[2]*r[0],s[3]=s[3]*r[1],s[4]=s[4]*r[1],s[5]=s[5]*r[1],s[6]=s[6]*r[2],s[7]=s[7]*r[2],s[8]=s[8]*r[2],this.center=new M().from(e),this.halfAxes=s,this}clone(){return new Ve(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new Te){let r=this.halfAxes,n=r.getColumn(0,Do),o=r.getColumn(1,Oo),s=r.getColumn(2,Lo),i=Om.copy(n).add(o).add(s);return e.center.copy(this.center),e.radius=i.magnitude(),e}intersectPlane(e){let r=this.center,n=e.normal,o=this.halfAxes,s=n.x,i=n.y,a=n.z,f=Math.abs(s*o[fe.COLUMN0ROW0]+i*o[fe.COLUMN0ROW1]+a*o[fe.COLUMN0ROW2])+Math.abs(s*o[fe.COLUMN1ROW0]+i*o[fe.COLUMN1ROW1]+a*o[fe.COLUMN1ROW2])+Math.abs(s*o[fe.COLUMN2ROW0]+i*o[fe.COLUMN2ROW1]+a*o[fe.COLUMN2ROW2]),c=n.dot(r)+e.distance;return c<=-f?ct.OUTSIDE:c>=f?ct.INSIDE:ct.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let r=Lm.from(e).subtract(this.center),n=this.halfAxes,o=n.getColumn(0,Do),s=n.getColumn(1,Oo),i=n.getColumn(2,Lo),a=o.magnitude(),f=s.magnitude(),c=i.magnitude();o.normalize(),s.normalize(),i.normalize();let l=0,h;return h=Math.abs(r.dot(o))-a,h>0&&(l+=h*h),h=Math.abs(r.dot(s))-f,h>0&&(l+=h*h),h=Math.abs(r.dot(i))-c,h>0&&(l+=h*h),l}computePlaneDistances(e,r,n=[-0,-0]){let o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,i=this.center,a=this.halfAxes,f=a.getColumn(0,Do),c=a.getColumn(1,Oo),l=a.getColumn(2,Lo),h=vm.copy(f).add(c).add(l).add(i),u=Gm.copy(h).subtract(e),d=r.dot(u);return o=Math.min(d,o),s=Math.max(d,s),h.copy(i).add(f).add(c).subtract(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),h.copy(i).add(f).subtract(c).add(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),h.copy(i).add(f).subtract(c).subtract(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),i.copy(h).subtract(f).add(c).add(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),i.copy(h).subtract(f).add(c).subtract(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),i.copy(h).subtract(f).subtract(c).add(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),i.copy(h).subtract(f).subtract(c).subtract(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),n[0]=o,n[1]=s,n}transform(e){this.center.transformAsPoint(e);let r=this.halfAxes.getColumn(0,Do);r.transformAsPoint(e);let n=this.halfAxes.getColumn(1,Oo);n.transformAsPoint(e);let o=this.halfAxes.getColumn(2,Lo);return o.transformAsPoint(e),this.halfAxes=new X([...r,...n,...o]),this}getTransform(){throw new Error("not implemented")}};var qf=new M,$f=new M,le=class{constructor(e=[0,0,1],r=0){this.normal=new M,this.distance=-0,this.fromNormalDistance(e,r)}fromNormalDistance(e,r){return at(Number.isFinite(r)),this.normal.from(e).normalize(),this.distance=r,this}fromPointNormal(e,r){e=qf.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),at(bt(this.normal.len(),1)),this.distance=o,this}clone(){return new le(this.normal,this.distance)}equals(e){return bt(this.distance,e.distance)&&bt(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){let r=$f.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=qf.from(e),o=this.getPointDistance(n),s=$f.copy(this.normal).scale(o);return n.subtract(s).to(r)}};var tl=[new M([1,0,0]),new M([0,1,0]),new M([0,0,1])],el=new M,Nm=new M,Rt=class{constructor(e=[]){this.planes=e}fromBoundingSphere(e){this.planes.length=2*tl.length;let r=e.center,n=e.radius,o=0;for(let s of tl){let i=this.planes[o],a=this.planes[o+1];i||(i=this.planes[o]=new le),a||(a=this.planes[o+1]=new le);let f=el.copy(s).scale(-n).add(r);i.fromPointNormal(f,s);let c=el.copy(s).scale(n).add(r),l=Nm.copy(s).negate();a.fromPointNormal(c,l),o+=2}return this}computeVisibility(e){let r=ct.INSIDE;for(let n of this.planes)switch(e.intersectPlane(n)){case ct.OUTSIDE:return ct.OUTSIDE;case ct.INTERSECTING:r=ct.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(e,r){if(at(Number.isFinite(r),"parentPlaneMask is required."),r===Rt.MASK_OUTSIDE||r===Rt.MASK_INSIDE)return r;let n=Rt.MASK_INSIDE,o=this.planes;for(let s=0;s<this.planes.length;++s){let i=s<31?1<<s:0;if(s<31&&!(r&i))continue;let a=o[s],f=e.intersectPlane(a);if(f===ct.OUTSIDE)return Rt.MASK_OUTSIDE;f===ct.INTERSECTING&&(n|=i)}return n}};Rt.MASK_OUTSIDE=4294967295;Rt.MASK_INSIDE=0;Rt.MASK_INDETERMINATE=2147483647;var IT=new M,ST=new M,FT=new M,RT=new M,DT=new M;var UT=new M,PT=new M,HT=new M,kT=new M,JT=new M,zT=new M,QT=new M,VT=new M,jT=new M,KT=new M,XT=new M,ZT=new M;var Wt=new X,Pm=new X,Hm=new X,vo=new X,rl=new X;function wi(t,e={}){let r=Ft.EPSILON20,n=10,o=0,s=0,i=Pm,a=Hm;i.identity(),a.copy(t);let f=r*km(a);for(;s<n&&Jm(a)>f;)zm(a,vo),rl.copy(vo).transpose(),a.multiplyRight(vo),a.multiplyLeft(rl),i.multiplyRight(vo),++o>2&&(++s,o=0);return e.unitary=i.toTarget(e.unitary),e.diagonal=a.toTarget(e.diagonal),e}function km(t){let e=0;for(let r=0;r<9;++r){let n=t[r];e+=n*n}return Math.sqrt(e)}var bi=[1,0,0],Mi=[2,2,1];function Jm(t){let e=0;for(let r=0;r<3;++r){let n=t[Wt.getElementIndex(Mi[r],bi[r])];e+=2*n*n}return Math.sqrt(e)}function zm(t,e){let r=Ft.EPSILON15,n=0,o=1;for(let c=0;c<3;++c){let l=Math.abs(t[Wt.getElementIndex(Mi[c],bi[c])]);l>n&&(o=c,n=l)}let s=bi[o],i=Mi[o],a=1,f=0;if(Math.abs(t[Wt.getElementIndex(i,s)])>r){let c=t[Wt.getElementIndex(i,i)],l=t[Wt.getElementIndex(s,s)],h=t[Wt.getElementIndex(i,s)],u=(c-l)/2/h,d;u<0?d=-1/(-u+Math.sqrt(1+u*u)):d=1/(u+Math.sqrt(1+u*u)),a=1/Math.sqrt(1+d*d),f=d*a}return X.IDENTITY.to(e),e[Wt.getElementIndex(s,s)]=e[Wt.getElementIndex(i,i)]=a,e[Wt.getElementIndex(i,s)]=f,e[Wt.getElementIndex(s,i)]=-f,e}var be=new M,Vm=new M,jm=new M,Km=new M,Xm=new M,Zm=new X,Ym={diagonal:new X,unitary:new X};function Ii(t,e=new Ve){if(!t||t.length===0)return e.halfAxes=new X([0,0,0,0,0,0,0,0,0]),e.center=new M,e;let r=t.length,n=new M(0,0,0);for(let B of t)n.add(B);let o=1/r;n.multiplyByScalar(o);let s=0,i=0,a=0,f=0,c=0,l=0;for(let B of t){let g=be.copy(B).subtract(n);s+=g.x*g.x,i+=g.x*g.y,a+=g.x*g.z,f+=g.y*g.y,c+=g.y*g.z,l+=g.z*g.z}s*=o,i*=o,a*=o,f*=o,c*=o,l*=o;let h=Zm;h[0]=s,h[1]=i,h[2]=a,h[3]=i,h[4]=f,h[5]=c,h[6]=a,h[7]=c,h[8]=l;let{unitary:u}=wi(h,Ym),d=e.halfAxes.copy(u),A=d.getColumn(0,jm),m=d.getColumn(1,Km),p=d.getColumn(2,Xm),E=-Number.MAX_VALUE,y=-Number.MAX_VALUE,T=-Number.MAX_VALUE,b=Number.MAX_VALUE,C=Number.MAX_VALUE,w=Number.MAX_VALUE;for(let B of t)be.copy(B),E=Math.max(be.dot(A),E),y=Math.max(be.dot(m),y),T=Math.max(be.dot(p),T),b=Math.min(be.dot(A),b),C=Math.min(be.dot(m),C),w=Math.min(be.dot(p),w);A=A.multiplyByScalar(.5*(b+E)),m=m.multiplyByScalar(.5*(C+y)),p=p.multiplyByScalar(.5*(w+T)),e.center.copy(A).add(m).add(p);let I=Vm.set(E-b,y-C,T-w).multiplyByScalar(.5),O=new X([I[0],0,0,0,I[1],0,0,0,I[2]]);return e.halfAxes.multiplyRight(O),e}var Ir;(function(t){t[t.ADD=1]="ADD",t[t.REPLACE=2]="REPLACE"})(Ir||(Ir={}));var Me;(function(t){t.EMPTY="empty",t.SCENEGRAPH="scenegraph",t.POINTCLOUD="pointcloud",t.MESH="mesh"})(Me||(Me={}));var In;(function(t){t.I3S="I3S",t.TILES3D="TILES3D"})(In||(In={}));var he;(function(t){t.GEOMETRIC_ERROR="geometricError",t.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(he||(he={}));var Sr="4.3.0-alpha.7";var xt={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},Tb=Object.keys(xt),we={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function Si(t,e,r){z(t instanceof ArrayBuffer);let n=new TextDecoder("utf8"),o=new Uint8Array(t,e,r);return n.decode(o)}function nl(t,e=0){let r=new DataView(t);return`${String.fromCharCode(r.getUint8(e+0))}${String.fromCharCode(r.getUint8(e+1))}${String.fromCharCode(r.getUint8(e+2))}${String.fromCharCode(r.getUint8(e+3))}`}var ol="4.3.0-alpha.7";var sl={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:ol,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 il(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 Fi(t){let e=1/0,r=1/0,n=1/0,o=-1/0,s=-1/0,i=-1/0,a=t.POSITION?t.POSITION.value:[],f=a&&a.length;for(let c=0;c<f;c+=3){let l=a[c],h=a[c+1],u=a[c+2];e=l<e?l:e,r=h<r?h:r,n=u<n?u:n,o=l>o?l:o,s=h>s?h:s,i=u>i?u:i}return[[e,r,n],[o,s,i]]}function Ri(t,e,r){let n=il(e.value),o=r||al(e);return{name:t,type:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:n}]},nullable:!1,metadata:o}}function al(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 fl(t,e,r){let n=ll(e.metadata),o=[],s=Wm(e.attributes);for(let i in t){let a=t[i],f=cl(i,a,s[i]);o.push(f)}if(r){let i=cl("indices",r);o.push(i)}return{fields:o,metadata:n}}function Wm(t){let e={};for(let r in t){let n=t[r];e[n.name||"undefined"]=n}return e}function cl(t,e,r){let n=r?ll(r.metadata):void 0;return Ri(t,e,n)}function ll(t){Object.entries(t);let e={};for(let r in t)e[`${r}.string`]=JSON.stringify(t[r]);return e}var hl={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},qm={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},$m=4,Sn=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),s=o===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let i;switch(o){case this.draco.TRIANGULAR_MESH:i=this.decoder.DecodeBufferToMesh(n,s);break;case this.draco.POINT_CLOUD:i=this.decoder.DecodeBufferToPointCloud(n,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!i.ok()||!s.ptr){let u=`DRACO decompression failed: ${i.error_msg()}`;throw new Error(u)}let a=this._getDracoLoaderData(s,o,r),f=this._getMeshData(s,a,r),c=Fi(f.attributes),l=fl(f.attributes,a,f.indices);return{loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c},...f,schema:l}}finally{this.draco.destroy(n),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,r,n){let o=this._getTopLevelMetadata(e),s=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:s}}_getDracoAttributes(e,r){let n={};for(let o=0;o<e.num_attributes();o++){let s=this.decoder.GetAttribute(e,o),i=this._getAttributeMetadata(e,o);n[s.unique_id()]={unique_id:s.unique_id(),attribute_type:s.attribute_type(),data_type:s.data_type(),num_components:s.num_components(),byte_offset:s.byte_offset(),byte_stride:s.byte_stride(),normalized:s.normalized(),attribute_index:o,metadata:i};let a=this._getQuantizationTransform(s,r);a&&(n[s.unique_id()].quantization_transform=a);let f=this._getOctahedronTransform(s,r);f&&(n[s.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 s of Object.values(e.attributes)){let i=this._deduceAttributeName(s,n);s.name=i;let a=this._getAttributeValues(r,s);if(a){let{value:f,size:c}=a;o[i]={value:f,size:c,byteOffset:s.byte_offset,byteStride:s.byte_stride,normalized:s.normalized}}}return o}_getTriangleListIndices(e){let n=e.num_faces()*3,o=n*$m,s=this.draco._malloc(o);try{return this.decoder.GetTrianglesUInt32Array(e,o,s),new Uint32Array(this.draco.HEAPF32.buffer,s,n).slice()}finally{this.draco._free(s)}}_getTriangleStripIndices(e){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,r),rp(r)}finally{this.draco.destroy(r)}}_getAttributeValues(e,r){let n=qm[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let o=r.num_components,i=e.num_points()*o,a=i*n.BYTES_PER_ELEMENT,f=tp(this.draco,n),c,l=this.draco._malloc(a);try{let h=this.decoder.GetAttribute(e,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,h,f,a,l),c=new n(this.draco.HEAPF32.buffer,l,i).slice()}finally{this.draco._free(l)}return{value:c,size:o}}_deduceAttributeName(e,r){let n=e.unique_id;for(let[i,a]of Object.entries(r.extraAttributes||{}))if(a===n)return i;let o=e.attribute_type;for(let i in hl)if(this.draco[i]===o)return hl[i];let s=r.attributeNameEntry||"name";return e.metadata[s]?e.metadata[s].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 s=this.metadataQuerier.GetEntryName(e,o);r[s]=this._getDracoMetadataField(e,s)}return r}_getDracoMetadataField(e,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,r,n);let o=ep(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 s of o)this.decoder.SkipAttributeTransform(this.draco[s])}_getQuantizationTransform(e,r){let{quantizedAttributes:n=[]}=r,o=e.attribute_type();if(n.map(i=>this.decoder[i]).includes(o)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(e))return{quantization_bits:i.quantization_bits(),range:i.range(),min_values:new Float32Array([1,2,3]).map(a=>i.min_value(a))}}finally{this.draco.destroy(i)}}return null}_getOctahedronTransform(e,r){let{octahedronAttributes:n=[]}=r,o=e.attribute_type();if(n.map(i=>this.decoder[i]).includes(o)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(e))return{quantization_bits:i.quantization_bits()}}finally{this.draco.destroy(i)}}return null}};function tp(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 ep(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}function rp(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}var np="1.5.6",op="1.4.1",Di=`https://www.gstatic.com/draco/versioned/decoders/${np}`,Et={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},Oi={[Et.DECODER]:`${Di}/${Et.DECODER}`,[Et.DECODER_WASM]:`${Di}/${Et.DECODER_WASM}`,[Et.FALLBACK_DECODER]:`${Di}/${Et.FALLBACK_DECODER}`,[Et.ENCODER]:`https://raw.githubusercontent.com/google/draco/${op}/javascript/${Et.ENCODER}`},Li;async function ul(t){let e=t.modules||{};return e.draco3d?Li||=e.draco3d.createDecoderModule({}).then(r=>({draco:r})):Li||=sp(t),await Li}async function sp(t){let e,r;switch(t.draco&&t.draco.decoderType){case"js":e=await Yt(Oi[Et.FALLBACK_DECODER],"draco",t,Et.FALLBACK_DECODER);break;case"wasm":default:[e,r]=await Promise.all([await Yt(Oi[Et.DECODER],"draco",t,Et.DECODER),await Yt(Oi[Et.DECODER_WASM],"draco",t,Et.DECODER_WASM)])}return e=e||globalThis.DracoDecoderModule,await ip(e,r)}function ip(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t({...r,onModuleLoaded:o=>n({draco:o})})})}var Go={...sl,parse:ap};async function ap(t,e){let{draco:r}=await ul(e),n=new Sn(r);try{return n.parseSync(t,e?.draco)}finally{n.destroy()}}var cp={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},rt={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},H={...cp,...rt};var vi={[rt.DOUBLE]:Float64Array,[rt.FLOAT]:Float32Array,[rt.UNSIGNED_SHORT]:Uint16Array,[rt.UNSIGNED_INT]:Uint32Array,[rt.UNSIGNED_BYTE]:Uint8Array,[rt.BYTE]:Int8Array,[rt.SHORT]:Int16Array,[rt.INT]:Int32Array},fp={DOUBLE:rt.DOUBLE,FLOAT:rt.FLOAT,UNSIGNED_SHORT:rt.UNSIGNED_SHORT,UNSIGNED_INT:rt.UNSIGNED_INT,UNSIGNED_BYTE:rt.UNSIGNED_BYTE,BYTE:rt.BYTE,SHORT:rt.SHORT,INT:rt.INT},Gi="Failed to convert GL type",ht=class{static fromTypedArray(e){e=ArrayBuffer.isView(e)?e.constructor:e;for(let r in vi)if(vi[r]===e)return r;throw new Error(Gi)}static fromName(e){let r=fp[e];if(!r)throw new Error(Gi);return r}static getArrayType(e){switch(e){case rt.UNSIGNED_SHORT_5_6_5:case rt.UNSIGNED_SHORT_4_4_4_4:case rt.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=vi[e];if(!r)throw new Error(Gi);return r}}static getByteSize(e){return ht.getArrayType(e).BYTES_PER_ELEMENT}static validate(e){return Boolean(ht.getArrayType(e))}static createTypedArray(e,r,n=0,o){o===void 0&&(o=(r.byteLength-n)/ht.getByteSize(e));let s=ht.getArrayType(e);return new s(r,n,o)}};function dl(t,e){if(!t)throw new Error(`math.gl assertion failed. ${e}`)}function Ni(t,e=[0,0,0]){let r=t>>11&31,n=t>>5&63,o=t&31;return e[0]=r<<3,e[1]=n<<2,e[2]=o<<3,e}var oM=1/256;var sM=new ke,iM=new M,aM=new ke,cM=new ke,fM=new Uint8Array(1);function Al(t,e=255){return Vs(t,0,e)/e*2-1}function ml(t){return t<0?-1:1}function pl(t,e,r,n){if(dl(n),t<0||t>r||e<0||e>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(n.x=Al(t,r),n.y=Al(e,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){let o=n.x;n.x=(1-Math.abs(n.y))*ml(o),n.y=(1-Math.abs(o))*ml(n.y)}return n.normalize()}function Ui(t,e,r){return pl(t,e,255,r)}var kt=class{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(e,r){this.json=e,this.buffer=r}getExtension(e){return this.json.extensions&&this.json.extensions[e]}hasProperty(e){return Boolean(this.json[e])}getGlobalProperty(e,r=H.UNSIGNED_INT,n=1){let o=this.json[e];return o&&Number.isFinite(o.byteOffset)?this._getTypedArrayFromBinary(e,r,n,1,o.byteOffset):o}getPropertyArray(e,r,n){let o=this.json[e];return o&&Number.isFinite(o.byteOffset)?("componentType"in o&&(r=ht.fromName(o.componentType)),this._getTypedArrayFromBinary(e,r,n,this.featuresLength,o.byteOffset)):this._getTypedArrayFromArray(e,r,o)}getProperty(e,r,n,o,s){let i=this.json[e];if(!i)return i;let a=this.getPropertyArray(e,r,n);if(n===1)return a[o];for(let f=0;f<n;++f)s[f]=a[n*o+f];return s}_getTypedArrayFromBinary(e,r,n,o,s){let i=this._cachedTypedArrays,a=i[e];return a||(a=ht.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+s,o*n),i[e]=a),a}_getTypedArrayFromArray(e,r,n){let o=this._cachedTypedArrays,s=o[e];return s||(s=ht.createTypedArray(r,n),o[e]=s),s}};var lp={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},hp={SCALAR:(t,e)=>t[e],VEC2:(t,e)=>[t[2*e+0],t[2*e+1]],VEC3:(t,e)=>[t[3*e+0],t[3*e+1],t[3*e+2]],VEC4:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT2:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT3:(t,e)=>[t[9*e+0],t[9*e+1],t[9*e+2],t[9*e+3],t[9*e+4],t[9*e+5],t[9*e+6],t[9*e+7],t[9*e+8]],MAT4:(t,e)=>[t[16*e+0],t[16*e+1],t[16*e+2],t[16*e+3],t[16*e+4],t[16*e+5],t[16*e+6],t[16*e+7],t[16*e+8],t[16*e+9],t[16*e+10],t[16*e+11],t[16*e+12],t[16*e+13],t[16*e+14],t[16*e+15]]},up={SCALAR:(t,e,r)=>{e[r]=t},VEC2:(t,e,r)=>{e[2*r+0]=t[0],e[2*r+1]=t[1]},VEC3:(t,e,r)=>{e[3*r+0]=t[0],e[3*r+1]=t[1],e[3*r+2]=t[2]},VEC4:(t,e,r)=>{e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT2:(t,e,r)=>{e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT3:(t,e,r)=>{e[9*r+0]=t[0],e[9*r+1]=t[1],e[9*r+2]=t[2],e[9*r+3]=t[3],e[9*r+4]=t[4],e[9*r+5]=t[5],e[9*r+6]=t[6],e[9*r+7]=t[7],e[9*r+8]=t[8],e[9*r+9]=t[9]},MAT4:(t,e,r)=>{e[16*r+0]=t[0],e[16*r+1]=t[1],e[16*r+2]=t[2],e[16*r+3]=t[3],e[16*r+4]=t[4],e[16*r+5]=t[5],e[16*r+6]=t[6],e[16*r+7]=t[7],e[16*r+8]=t[8],e[16*r+9]=t[9],e[16*r+10]=t[10],e[16*r+11]=t[11],e[16*r+12]=t[12],e[16*r+13]=t[13],e[16*r+14]=t[14],e[16*r+15]=t[15]}};function gl(t,e,r,n){let{componentType:o}=t;z(t.componentType);let s=typeof o=="string"?ht.fromName(o):o,i=lp[t.type],a=hp[t.type],f=up[t.type];return r+=t.byteOffset,{values:ht.createTypedArray(s,e,r,i*n),type:s,size:i,unpacker:a,packer:f}}var qt=t=>t!==void 0;function Bl(t,e,r){if(!e)return null;let n=t.getExtension("3DTILES_batch_table_hierarchy"),o=e.HIERARCHY;return o&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),e.extensions=e.extensions||{},e.extensions["3DTILES_batch_table_hierarchy"]=o,n=o),n?dp(n,r):null}function dp(t,e){let r,n,o,s=t.instancesLength,i=t.classes,a=t.classIds,f=t.parentCounts,c=t.parentIds,l=s;qt(a.byteOffset)&&(a.componentType=defaultValue(a.componentType,GL.UNSIGNED_SHORT),a.type=AttributeType.SCALAR,o=getBinaryAccessor(a),a=o.createArrayBufferView(e.buffer,e.byteOffset+a.byteOffset,s));let h;if(qt(f))for(qt(f.byteOffset)&&(f.componentType=defaultValue(f.componentType,GL.UNSIGNED_SHORT),f.type=AttributeType.SCALAR,o=getBinaryAccessor(f),f=o.createArrayBufferView(e.buffer,e.byteOffset+f.byteOffset,s)),h=new Uint16Array(s),l=0,r=0;r<s;++r)h[r]=l,l+=f[r];qt(c)&&qt(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,o=getBinaryAccessor(c),c=o.createArrayBufferView(e.buffer,e.byteOffset+c.byteOffset,l));let u=i.length;for(r=0;r<u;++r){let p=i[r].length,E=i[r].instances,y=getBinaryProperties(p,E,e);i[r].instances=combine(y,E)}let d=new Array(u).fill(0),A=new Uint16Array(s);for(r=0;r<s;++r)n=a[r],A[r]=d[n],++d[n];let m={classes:i,classIds:a,classIndexes:A,parentCounts:f,parentIndexes:h,parentIds:c};return pp(m),m}function Fr(t,e,r){if(!t)return;let n=t.parentCounts;return t.parentIds?r(t,e):n>0?Ap(t,e,r):mp(t,e,r)}function Ap(t,e,r){let n=t.classIds,o=t.parentCounts,s=t.parentIds,i=t.parentIndexes,a=n.length,f=scratchVisited;f.length=Math.max(f.length,a);let c=++marker,l=scratchStack;for(l.length=0,l.push(e);l.length>0;){if(e=l.pop(),f[e]===c)continue;f[e]=c;let h=r(t,e);if(qt(h))return h;let u=o[e],d=i[e];for(let A=0;A<u;++A){let m=s[d+A];m!==e&&l.push(m)}}return null}function mp(t,e,r){let n=!0;for(;n;){let o=r(t,e);if(qt(o))return o;let s=t.parentIds[e];n=s!==e,e=s}throw new Error("traverseHierarchySingleParent")}function pp(t){let e=[],n=t.classIds.length;for(let o=0;o<n;++o)xl(t,o,stack)}function xl(t,e,r){let n=t.parentCounts,o=t.parentIds,s=t.parentIndexes,a=t.classIds.length;if(!qt(o))return;assert(e<a,`Parent index ${e} exceeds the total number of instances: ${a}`),assert(r.indexOf(e)===-1,"Circular dependency detected in the batch table hierarchy."),r.push(e);let f=qt(n)?n[e]:1,c=qt(n)?s[e]:e;for(let l=0;l<f;++l){let h=o[c+l];h!==e&&xl(t,h,r)}r.pop(e)}function _t(t){return t!=null}var No=(t,e)=>t,gp={HIERARCHY:!0,extensions:!0,extras:!0},ue=class{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(e,r,n,o={}){z(n>=0),this.json=e||{},this.binary=r,this.featureCount=n,this._extensions=this.json?.extensions||{},this._properties={};for(let s in this.json)gp[s]||(this._properties[s]=this.json[s]);this._binaryProperties=this._initializeBinaryProperties(),o["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Bl(this,this.json,this.binary))}getExtension(e){return this.json&&this.json.extensions&&this.json.extensions[e]}memorySizeInBytes(){return 0}isClass(e,r){if(this._checkBatchId(e),z(typeof r=="string",r),this._hierarchy){let n=Fr(this._hierarchy,e,(o,s)=>{let i=o.classIds[s];return o.classes[i].name===r});return _t(n)}return!1}isExactClass(e,r){return z(typeof r=="string",r),this.getExactClassName(e)===r}getExactClassName(e){if(this._checkBatchId(e),this._hierarchy){let r=this._hierarchy.classIds[e];return this._hierarchy.classes[r].name}}hasProperty(e,r){return this._checkBatchId(e),z(typeof r=="string",r),_t(this._properties[r])||this._hasPropertyInHierarchy(e,r)}getPropertyNames(e,r){this._checkBatchId(e),r=_t(r)?r:[],r.length=0;let n=Object.keys(this._properties);return r.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(e,r),r}getProperty(e,r){if(this._checkBatchId(e),z(typeof r=="string",r),this._binaryProperties){let o=this._binaryProperties[r];if(_t(o))return this._getBinaryProperty(o,e)}let n=this._properties[r];if(_t(n))return No(n[e],!0);if(this._hierarchy){let o=this._getHierarchyProperty(e,r);if(_t(o))return o}}setProperty(e,r,n){let o=this.featureCount;if(this._checkBatchId(e),z(typeof r=="string",r),this._binaryProperties){let i=this._binaryProperties[r];if(i){this._setBinaryProperty(i,e,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,e,r,n))return;let s=this._properties[r];_t(s)||(this._properties[r]=new Array(o),s=this._properties[r]),s[e]=No(n,!0)}_checkBatchId(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(e,r){return e.unpack(e.typedArray,r)}_setBinaryProperty(e,r,n){e.pack(n,e.typedArray,r)}_initializeBinaryProperties(){let e=null;for(let r in this._properties){let n=this._properties[r],o=this._initializeBinaryProperty(r,n);o&&(e=e||{},e[r]=o)}return e}_initializeBinaryProperty(e,r){if("byteOffset"in r){let n=r;z(this.binary,`Property ${e} requires a batch table binary.`),z(n.type,`Property ${e} requires a type.`);let o=gl(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:o.values,componentCount:o.size,unpack:o.unpacker,pack:o.packer}}return null}_hasPropertyInHierarchy(e,r){if(!this._hierarchy)return!1;let n=Fr(this._hierarchy,e,(o,s)=>{let i=o.classIds[s],a=o.classes[i].instances;return _t(a[r])});return _t(n)}_getPropertyNamesInHierarchy(e,r){Fr(this._hierarchy,e,(n,o)=>{let s=n.classIds[o],i=n.classes[s].instances;for(let a in i)i.hasOwnProperty(a)&&r.indexOf(a)===-1&&r.push(a)})}_getHierarchyProperty(e,r){return Fr(this._hierarchy,e,(n,o)=>{let s=n.classIds[o],i=n.classes[s],a=n.classIndexes[o],f=i.instances[r];return _t(f)?_t(f.typedArray)?this._getBinaryProperty(f,a):No(f[a],!0):null})}_setHierarchyProperty(e,r,n,o){let s=Fr(this._hierarchy,r,(i,a)=>{let f=i.classIds[a],c=i.classes[f],l=i.classIndexes[a],h=c.instances[n];return _t(h)?(z(a===r,`Inherited property "${n}" is read-only.`),_t(h.typedArray)?this._setBinaryProperty(h,l,o):h[l]=No(o,!0),!0):!1});return _t(s)}};function Ie(t,e,r=0){let n=new DataView(e);if(t.magic=n.getUint32(r,!0),r+=4,t.version=n.getUint32(r,!0),r+=4,t.byteLength=n.getUint32(r,!0),r+=4,t.version!==1)throw new Error(`3D Tile Version ${t.version} not supported`);return r}var Rr=4,El="b3dm tile in legacy format.";function Dr(t,e,r){let n=new DataView(e),o;t.header=t.header||{};let s=n.getUint32(r,!0);r+=Rr;let i=n.getUint32(r,!0);r+=Rr;let a=n.getUint32(r,!0);r+=Rr;let f=n.getUint32(r,!0);return r+=Rr,a>=570425344?(r-=Rr*2,o=s,a=i,f=0,s=0,i=0,console.warn(El)):f>=570425344&&(r-=Rr,o=a,a=s,f=i,s=0,i=0,console.warn(El)),t.header.featureTableJsonByteLength=s,t.header.featureTableBinaryByteLength=i,t.header.batchTableJsonByteLength=a,t.header.batchTableBinaryByteLength=f,t.header.batchLength=o,r}function Or(t,e,r,n){return r=Bp(t,e,r,n),r=xp(t,e,r,n),r}function Bp(t,e,r,n){let{featureTableJsonByteLength:o,featureTableBinaryByteLength:s,batchLength:i}=t.header||{};if(t.featureTableJson={BATCH_LENGTH:i||0},o&&o>0){let a=Si(e,r,o);t.featureTableJson=JSON.parse(a)}return r+=o||0,t.featureTableBinary=new Uint8Array(e,r,s),r+=s||0,r}function xp(t,e,r,n){let{batchTableJsonByteLength:o,batchTableBinaryByteLength:s}=t.header||{};if(o&&o>0){let i=Si(e,r,o);t.batchTableJson=JSON.parse(i),r+=o,s&&s>0&&(t.batchTableBinary=new Uint8Array(e,r,s),t.batchTableBinary=new Uint8Array(t.batchTableBinary),r+=s)}return r}function Pi(t,e,r){if(!e&&(!t||!t.batchIds||!r))return null;let{batchIds:n,isRGB565:o,pointCount:s=0}=t;if(n&&r){let i=new Uint8ClampedArray(s*3);for(let a=0;a<s;a++){let f=n[a],l=r.getProperty(f,"dimensions").map(h=>h*255);i[a*3]=l[0],i[a*3+1]=l[1],i[a*3+2]=l[2]}return{type:H.UNSIGNED_BYTE,value:i,size:3,normalized:!0}}if(e&&o){let i=new Uint8ClampedArray(s*3);for(let a=0;a<s;a++){let f=Ni(e[a]);i[a*3]=f[0],i[a*3+1]=f[1],i[a*3+2]=f[2]}return{type:H.UNSIGNED_BYTE,value:i,size:3,normalized:!0}}return e&&e.length===s*3?{type:H.UNSIGNED_BYTE,value:e,size:3,normalized:!0}:{type:H.UNSIGNED_BYTE,value:e||new Uint8ClampedArray,size:4,normalized:!0}}var _l=new M;function yl(t,e){if(!e)return null;if(t.isOctEncoded16P){let r=new Float32Array((t.pointsLength||0)*3);for(let n=0;n<(t.pointsLength||0);n++)Ui(e[n*2],e[n*2+1],_l),_l.toArray(r,n*3);return{type:H.FLOAT,size:2,value:r}}return{type:H.FLOAT,size:2,value:e}}function Cl(t,e,r){return t.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,Ep(t,e)):{type:H.UNSIGNED_SHORT,value:e,size:3,normalized:!0}:e}function Ep(t,e){let r=new M,n=new Float32Array(t.pointCount*3);for(let o=0;o<t.pointCount;o++)r.set(e[o*3],e[o*3+1],e[o*3+2]).scale(1/t.quantizedRange).multiply(t.quantizedVolumeScale).add(t.quantizedVolumeOffset).toArray(n,o*3);return n}async function Tl(t,e,r,n,o){r=Ie(t,e,r),r=Dr(t,e,r),r=Or(t,e,r,n),_p(t);let{featureTable:s,batchTable:i}=yp(t);return await wp(t,s,i,n,o),Cp(t,s,n),Tp(t,s,i),bp(t,s),r}function _p(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null},t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}function yp(t){let e=new kt(t.featureTableJson,t.featureTableBinary),r=e.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");e.featuresLength=r,t.featuresLength=r,t.pointsLength=r,t.pointCount=r,t.rtcCenter=e.getGlobalProperty("RTC_CENTER",H.FLOAT,3);let n=Mp(t,e);return{featureTable:e,batchTable:n}}function Cp(t,e,r){if(t.attributes=t.attributes||{positions:null,colors:null,normals:null,batchIds:null},!t.attributes.positions){if(e.hasProperty("POSITION"))t.attributes.positions=e.getPropertyArray("POSITION",H.FLOAT,3);else if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3);if(t.isQuantized=!0,t.quantizedRange=(1<<16)-1,t.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",H.FLOAT,3),!t.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(t.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3),!t.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t.attributes.positions=Cl(t,n,r)}}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function Tp(t,e,r){if(t.attributes=t.attributes||{positions:null,colors:null,normals:null,batchIds:null},!t.attributes.colors){let n=null;e.hasProperty("RGBA")?(n=e.getPropertyArray("RGBA",H.UNSIGNED_BYTE,4),t.isTranslucent=!0):e.hasProperty("RGB")?n=e.getPropertyArray("RGB",H.UNSIGNED_BYTE,3):e.hasProperty("RGB565")&&(n=e.getPropertyArray("RGB565",H.UNSIGNED_SHORT,1),t.isRGB565=!0),t.attributes.colors=Pi(t,n,r)}e.hasProperty("CONSTANT_RGBA")&&(t.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",H.UNSIGNED_BYTE,4))}function bp(t,e){if(t.attributes=t.attributes||{positions:null,colors:null,normals:null,batchIds:null},!t.attributes.normals){let r=null;e.hasProperty("NORMAL")?r=e.getPropertyArray("NORMAL",H.FLOAT,3):e.hasProperty("NORMAL_OCT16P")&&(r=e.getPropertyArray("NORMAL_OCT16P",H.UNSIGNED_BYTE,2),t.isOctEncoded16P=!0),t.attributes.normals=yl(t,r)}}function Mp(t,e){let r=null;if(!t.batchIds&&e.hasProperty("BATCH_ID")&&(t.batchIds=e.getPropertyArray("BATCH_ID",H.UNSIGNED_SHORT,1),t.batchIds)){let n=e.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");let{batchTableJson:o,batchTableBinary:s}=t;r=new ue(o,s,n)}return r}async function wp(t,e,r,n,o){let s,i,a,f=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"];f&&(a=f.properties);let c=e.getExtension("3DTILES_draco_point_compression");if(c){i=c.properties;let h=c.byteOffset,u=c.byteLength;if(!i||!Number.isFinite(h)||!u)throw new Error("Draco properties, byteOffset, and byteLength must be defined");s=(t.featureTableBinary||[]).slice(h,h+u),t.hasPositions=Number.isFinite(i.POSITION),t.hasColors=Number.isFinite(i.RGB)||Number.isFinite(i.RGBA),t.hasNormals=Number.isFinite(i.NORMAL),t.hasBatchIds=Number.isFinite(i.BATCH_ID),t.isTranslucent=Number.isFinite(i.RGBA)}if(!s)return!0;let l={buffer:s,properties:{...i,...a},featureTableProperties:i,batchTableProperties:a,dequantizeInShader:!1};return await Ip(t,l,n,o)}async function Ip(t,e,r,n){if(!n)return;let o={...r,draco:{...r?.draco,extraAttributes:e.batchTableProperties||{}}};delete o["3d-tiles"];let s=await Pt(e.buffer,Go,o,n),i=s.attributes.POSITION&&s.attributes.POSITION.value,a=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,f=s.attributes.NORMAL&&s.attributes.NORMAL.value,c=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,l=i&&s.attributes.POSITION.value.quantization,h=f&&s.attributes.NORMAL.value.quantization;if(l){let d=s.POSITION.data.quantization,A=d.range;t.quantizedVolumeScale=new M(A,A,A),t.quantizedVolumeOffset=new M(d.minValues),t.quantizedRange=(1<<d.quantizationBits)-1,t.isQuantizedDraco=!0}h&&(t.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0);let u={};if(e.batchTableProperties)for(let d of Object.keys(e.batchTableProperties))s.attributes[d]&&s.attributes[d].value&&(u[d.toLowerCase()]=s.attributes[d].value);t.attributes={positions:i,colors:Pi(t,a,void 0),normals:f,batchIds:c,...u}}var Ki={};lt(Ki,{createExtMeshFeatures:()=>g1,decode:()=>u1,encode:()=>d1,name:()=>h1});var bl="4.3.0-alpha.7";var Sp=globalThis.loaders?.parseImageNode,Hi=typeof Image<"u",ki=typeof ImageBitmap<"u",Fp=Boolean(Sp),Ji=Bt?!0:Fp;function Ml(t){switch(t){case"auto":return ki||Hi||Ji;case"imagebitmap":return ki;case"image":return Hi;case"data":return Ji;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function wl(){if(ki)return"imagebitmap";if(Hi)return"image";if(Ji)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Il(t){let e=Rp(t);if(!e)throw new Error("Not an image");return e}function Fn(t){switch(Il(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 Rp(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 Dp=/^data:image\/svg\+xml/,Op=/\.svg((\?|#).*)?$/;function Uo(t){return t&&(Dp.test(t)||Op.test(t))}function Sl(t,e){if(Uo(e)){let n=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return zi(t,e)}function zi(t,e){if(Uo(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function Po(t,e,r){let n=Sl(t,r),o=self.URL||self.webkitURL,s=typeof n!="string"&&o.createObjectURL(n);try{return await Lp(s||n,e)}finally{s&&o.revokeObjectURL(s)}}async function Lp(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=s=>{let i=s instanceof Error?s.message:"error";o(new Error(i))}}catch(s){o(s)}})}var vp={},Fl=!0;async function Rl(t,e,r){let n;Uo(r)?n=await Po(t,e,r):n=zi(t,r);let o=e&&e.imagebitmap;return await Gp(n,o)}async function Gp(t,e=null){if((Np(e)||!Fl)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),Fl=!1}return await createImageBitmap(t)}function Np(t){for(let e in t||vp)return!1;return!0}function Dl(t){return!kp(t,"ftyp",4)||!(t[8]&96)?null:Up(t)}function Up(t){switch(Pp(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function Pp(t,e,r){return String.fromCharCode(...t.slice(e,r))}function Hp(t){return[...t].map(e=>e.charCodeAt(0))}function kp(t,e,r=0){let n=Hp(e);for(let o=0;o<n.length;++o)if(n[o]!==t[o+r])return!1;return!0}var $t=!1,Rn=!0;function je(t){let e=Dn(t);return zp(e)||jp(e)||Qp(e)||Vp(e)||Jp(e)}function Jp(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=Dl(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function zp(t){let e=Dn(t);return e.byteLength>=24&&e.getUint32(0,$t)===2303741511?{mimeType:"image/png",width:e.getUint32(16,$t),height:e.getUint32(20,$t)}:null}function Qp(t){let e=Dn(t);return e.byteLength>=10&&e.getUint32(0,$t)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,Rn),height:e.getUint16(8,Rn)}:null}function Vp(t){let e=Dn(t);return e.byteLength>=14&&e.getUint16(0,$t)===16973&&e.getUint32(2,Rn)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Rn),height:e.getUint32(22,Rn)}:null}function jp(t){let e=Dn(t);if(!(e.byteLength>=3&&e.getUint16(0,$t)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:o}=Kp(),s=2;for(;s+9<e.byteLength;){let i=e.getUint16(s,$t);if(o.has(i))return{mimeType:"image/jpeg",height:e.getUint16(s+5,$t),width:e.getUint16(s+7,$t)};if(!n.has(i))return null;s+=2,s+=e.getUint16(s,$t)}return null}function Kp(){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 Dn(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 Ol(t,e){let{mimeType:r}=je(t)||{},n=globalThis.loaders?.parseImageNode;return z(n),await n(t,r)}async function Ll(t,e,r){e=e||{};let o=(e.image||{}).type||"auto",{url:s}=r||{},i=Xp(o),a;switch(i){case"imagebitmap":a=await Rl(t,e,s);break;case"image":a=await Po(t,e,s);break;case"data":a=await Ol(t,e);break;default:z(!1)}return o==="data"&&(a=Fn(a)),a}function Xp(t){switch(t){case"auto":case"data":return wl();default:return Ml(t),t}}var Zp=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],Yp=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],Wp={image:{type:"auto",decode:!0}},Qi={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:bl,mimeTypes:Yp,extensions:Zp,parse:Ll,tests:[t=>Boolean(je(new DataView(t)))],options:Wp};var Vi={};function ji(t){if(Vi[t]===void 0){let e=Bt?$p(t):qp(t);Vi[t]=e}return Vi[t]}function qp(t){let e=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||e,n=globalThis.loaders?.parseImageNode;return Boolean(n)&&r.includes(t)}function $p(t){switch(t){case"image/avif":case"image/webp":return t1(t);default:return!0}}function t1(t){try{return document.createElement("canvas").toDataURL(t).indexOf(`data:${t}`)===0}catch{return!1}}function ot(t,e){if(!t)throw new Error(e||"assert failed: gltf")}var Ho={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ko={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var e1=1.33,vl=["SCALAR","VEC2","VEC3","VEC4"],r1=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],n1=new Map(r1),o1={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},s1={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},i1={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Jo(t){return vl[t-1]||vl[0]}function Se(t){let e=n1.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function Lr(t,e){let r=i1[t.componentType],n=o1[t.type],o=s1[t.componentType],s=t.count*n,i=t.count*n*o;ot(i>=0&&i<=e.byteLength);let a=ko[t.componentType],f=Ho[t.type];return{ArrayType:r,length:s,byteLength:i,componentByteSize:a,numberOfComponentsInElement:f}}function On(t){let{images:e,bufferViews:r}=t;e=e||[],r=r||[];let n=e.map(i=>i.bufferView);r=r.filter(i=>!n.includes(i));let o=r.reduce((i,a)=>i+a.byteLength,0),s=e.reduce((i,a)=>{let{width:f,height:c}=a.image;return i+f*c},0);return o+Math.ceil(4*s*e1)}function Gl(t,e,r){let n=t.bufferViews[r];ot(n);let o=n.buffer,s=e[o];ot(s);let i=(n.byteOffset||0)+s.byteOffset;return new Uint8Array(s.arrayBuffer,i,n.byteLength)}function Nl(t,e,r){let n=typeof r=="number"?t.accessors?.[r]:r;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(r)}`);let o=t.bufferViews?.[n.bufferView||0];if(!o)throw new Error(`No gltf buffer view for accessor ${o}`);let{arrayBuffer:s,byteOffset:i}=e[o.buffer],a=(i||0)+(n.byteOffset||0)+(o.byteOffset||0),{ArrayType:f,length:c,componentByteSize:l,numberOfComponentsInElement:h}=Lr(n,o),u=l*h,d=o.byteStride||u;if(typeof o.byteStride>"u"||o.byteStride===u)return new f(s,a,c);let A=new f(c);for(let m=0;m<n.count;m++){let p=new f(s,a+m*d,h);A.set(p,m*h)}return A}function a1(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var Q=class{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||a1(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){let r=this.getUsedExtensions().find(o=>o===e),n=this.getRequiredExtensions().find(o=>o===e);return typeof r=="string"||typeof n=="string"}getExtension(e){let r=this.getUsedExtensions().find(o=>o===e),n=this.json.extensions||{};return r?n[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(n=>n===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,r){return(e.extensions||{})[r]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,r){if(typeof r=="object")return r;let n=this.json[e]&&this.json[e][r];if(!n)throw new Error(`glTF file error: Could not find ${e}[${r}]`);return n}getTypedArrayForBufferView(e){e=this.getBufferView(e);let r=e.buffer,n=this.gltf.buffers[r];ot(n);let o=(e.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,o,e.byteLength)}getTypedArrayForAccessor(e){let r=this.getAccessor(e);return Nl(this.gltf.json,this.gltf.buffers,r)}getTypedArrayForImageData(e){e=this.getAccessor(e);let r=this.getBufferView(e.bufferView),o=this.getBuffer(r.buffer).data,s=r.byteOffset||0;return new Uint8Array(o,s,r.byteLength)}addApplicationData(e,r){return this.json[e]=r,this}addExtraData(e,r){return this.json.extras=this.json.extras||{},this.json.extras[e]=r,this}addObjectExtension(e,r,n){return e.extensions=e.extensions||{},e.extensions[r]=n,this.registerUsedExtension(r),this}setObjectExtension(e,r,n){let o=e.extensions||{};o[r]=n}removeObjectExtension(e,r){let n=e?.extensions||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let o=this.json.extensionsRemoved;o.includes(r)||o.push(r)}delete n[r]}addExtension(e,r={}){return ot(r),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=r,this.registerUsedExtension(e),r}addRequiredExtension(e,r={}){return ot(r),this.addExtension(e,r),this.registerRequiredExtension(e),r}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let r=this.json.extensionsRemoved;r.includes(e)||r.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){let{nodeIndices:r}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(e){let{meshIndex:r,matrix:n}=e;this.json.nodes=this.json.nodes||[];let o={mesh:r};return n&&(o.matrix=n),this.json.nodes.push(o),this.json.nodes.length-1}addMesh(e){let{attributes:r,indices:n,material:o,mode:s=4}=e,a={primitives:[{attributes:this._addAttributes(r),mode:s}]};if(n){let f=this._addIndices(n);a.primitives[0].indices=f}return Number.isFinite(o)&&(a.primitives[0].material=o),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){let n={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(e,r){let n=je(e),o=r||n?.mimeType,i={bufferView:this.addBufferView(e),mimeType:o};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}addBufferView(e,r=0,n=this.byteLength){let o=e.byteLength;ot(Number.isFinite(o)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);let s={buffer:r,byteOffset:n,byteLength:o};return this.byteLength+=Tt(o,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(s),this.json.bufferViews.length-1}addAccessor(e,r){let n={bufferView:e,type:Jo(r.size),componentType:r.componentType,count:r.count,max:r.max,min:r.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(e,r={size:3}){let n=this.addBufferView(e),o={min:r.min,max:r.max};(!o.min||!o.max)&&(o=this._getAccessorMinMax(e,r.size));let s={size:r.size,componentType:Se(e),count:Math.round(e.length/r.size),min:o.min,max:o.max};return this.addAccessor(n,Object.assign(s,r))}addTexture(e){let{imageIndex:r}=e,n={source:r};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){let e=this.byteLength,r=new ArrayBuffer(e),n=new Uint8Array(r),o=0;for(let s of this.sourceBuffers||[])o=Us(s,n,o);this.json?.buffers?.[0]?this.json.buffers[0].byteLength=e:this.json.buffers=[{byteLength:e}],this.gltf.binary=r,this.sourceBuffers=[r],this.gltf.buffers=[{arrayBuffer:r,byteOffset:0,byteLength:r.byteLength}]}_removeStringFromArray(e,r){let n=!0;for(;n;){let o=e.indexOf(r);o>-1?e.splice(o,1):n=!1}}_addAttributes(e={}){let r={};for(let n in e){let o=e[n],s=this._getGltfAttributeName(n),i=this.addBinaryBuffer(o.value,o);r[s]=i}return r}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,r){let n={min:null,max:null};if(e.length<r)return n;n.min=[],n.max=[];let o=e.subarray(0,r);for(let s of o)n.min.push(s),n.max.push(s);for(let s=r;s<e.length;s+=r)for(let i=0;i<r;i++)n.min[0+i]=Math.min(n.min[0+i],e[s+i]),n.max[0+i]=Math.max(n.max[0+i],e[s+i]);return n}};function Ul(t){return(t%1+1)%1}var Pl={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},c1={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},Hl={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function Ln(t,e){return Hl[e]*Pl[t]}function vr(t,e,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let o=t.getTypedArrayForBufferView(e),s=Gr(o,"SCALAR",r,n+1);return s instanceof BigInt64Array||s instanceof BigUint64Array?null:s}function Gr(t,e,r,n=1){let o=Pl[e],s=c1[r],i=Hl[r],a=n*o,f=a*i,c=t.buffer,l=t.byteOffset;return l%i!==0&&(c=new Uint8Array(c).slice(l,l+f).buffer,l=0),new s(c,l,a)}function Nr(t,e,r){let n=`TEXCOORD_${e.texCoord||0}`,o=r.attributes[n],s=t.getTypedArrayForAccessor(o),i=t.gltf.json,a=e.index,f=i.textures?.[a]?.source;if(typeof f<"u"){let c=i.images?.[f]?.mimeType,l=t.gltf.images?.[f];if(l&&typeof l.width<"u"){let h=[];for(let u=0;u<s.length;u+=2){let d=f1(l,c,s,u,e.channels);h.push(d)}return h}}return[]}function zo(t,e,r,n,o){if(!r?.length)return;let s=[];for(let l of r){let h=n.findIndex(u=>u===l);h===-1&&(h=n.push(l)-1),s.push(h)}let i=new Uint32Array(s),a=t.gltf.buffers.push({arrayBuffer:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength})-1,f=t.addBufferView(i,a,0),c=t.addAccessor(f,{size:1,componentType:Se(i),count:i.length});o.attributes[e]=c}function f1(t,e,r,n,o=[0]){let s={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},i=r[n],a=r[n+1],f=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(f=4);let c=l1(i,a,t,f),l=0;for(let h of o){let u=typeof h=="number"?Object.values(s)[h]:s[h],d=c+u.offset,A=Fn(t);if(A.data.length<=d)throw new Error(`${A.data.length} <= ${d}`);let m=A.data[d];l|=m<<u.shift}return l}function l1(t,e,r,n=1){let o=r.width,s=Ul(t)*(o-1),i=Math.round(s),a=r.height,f=Ul(e)*(a-1),c=Math.round(f),l=r.components?r.components:n;return(c*o+i)*l}function Qo(t,e,r,n,o){let s=[];for(let i=0;i<e;i++){let a=r[i],f=r[i+1]-r[i];if(f+a>n)break;let c=a/o,l=f/o;s.push(t.slice(c,c+l))}return s}function Vo(t,e,r){let n=[];for(let o=0;o<e;o++){let s=o*r;n.push(t.slice(s,s+r))}return n}function jo(t,e,r,n){if(r)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){let o=[],s=new TextDecoder("utf8"),i=0;for(let a=0;a<t;a++){let f=n[a+1]-n[a];if(f+i<=e.length){let c=e.subarray(i,f+i),l=s.decode(c);o.push(l),i+=f}}return o}return[]}var Ur="EXT_mesh_features",h1=Ur;async function u1(t,e){let r=new Q(t);A1(r,e)}function d1(t,e){let r=new Q(t);return p1(r,e),r.createBinaryChunk(),r.gltf}function A1(t,e){let r=t.gltf.json;if(r.meshes)for(let n of r.meshes)for(let o of n.primitives)m1(t,o,e)}function m1(t,e,r){if(!r?.gltf?.loadBuffers)return;let o=e.extensions?.[Ur]?.featureIds;if(o)for(let s of o){let i;if(typeof s.attribute<"u"){let a=`_FEATURE_ID_${s.attribute}`,f=e.attributes[a];i=t.getTypedArrayForAccessor(f)}else typeof s.texture<"u"&&r?.gltf?.loadImages?i=Nr(t,s.texture,e):i=[];s.data=i}}function p1(t,e){let r=t.gltf.json.meshes;if(r)for(let n of r)for(let o of n.primitives)B1(t,o)}function g1(t,e,r,n){e.extensions||(e.extensions={});let o=e.extensions[Ur];o||(o={featureIds:[]},e.extensions[Ur]=o);let{featureIds:s}=o,i={featureCount:r.length,propertyTable:n,data:r};s.push(i),t.addObjectExtension(e,Ur,o)}function B1(t,e){let r=e.extensions?.[Ur];if(!r)return;let n=r.featureIds;n.forEach((o,s)=>{if(o.data){let{accessorKey:i,index:a}=x1(e.attributes),f=new Uint32Array(o.data);n[s]={featureCount:f.length,propertyTable:o.propertyTable,attribute:a},t.gltf.buffers.push({arrayBuffer:f.buffer,byteOffset:f.byteOffset,byteLength:f.byteLength});let c=t.addBufferView(f),l=t.addAccessor(c,{size:1,componentType:Se(f),count:f.length});e.attributes[i]=l}})}function x1(t){let e="_FEATURE_ID_",r=Object.keys(t).filter(s=>s.indexOf(e)===0),n=-1;for(let s of r){let i=Number(s.substring(e.length));i>n&&(n=i)}return n++,{accessorKey:`${e}${n}`,index:n}}var Yi={};lt(Yi,{createExtStructuralMetadata:()=>k1,decode:()=>_1,encode:()=>y1,name:()=>E1});var Pr="EXT_structural_metadata",E1=Pr;async function _1(t,e){let r=new Q(t);C1(r,e)}function y1(t,e){let r=new Q(t);return P1(r,e),r.createBinaryChunk(),r.gltf}function C1(t,e){if(!e.gltf?.loadBuffers)return;let r=t.getExtension(Pr);r&&(e.gltf?.loadImages&&T1(t,r),b1(t,r))}function T1(t,e){let r=e.propertyTextures,n=t.gltf.json;if(r&&n.meshes)for(let o of n.meshes)for(let s of o.primitives)w1(t,r,s,e)}function b1(t,e){let r=e.schema;if(!r)return;let n=r.classes,o=e.propertyTables;if(n&&o)for(let s in n){let i=M1(o,s);i&&S1(t,r,i)}}function M1(t,e){for(let r of t)if(r.class===e)return r;return null}function w1(t,e,r,n){if(!e)return;let s=r.extensions?.[Pr]?.propertyTextures;if(s)for(let i of s){let a=e[i];I1(t,a,r,n)}}function I1(t,e,r,n){if(!e.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let o=e.class;for(let s in e.properties){let i=`${o}_${s}`,a=e.properties?.[s];if(!a)continue;a.data||(a.data=[]);let f=a.data,c=Nr(t,a,r);c!==null&&(zo(t,i,c,f,r),a.data=f,n.dataAttributeNames.push(i))}}function S1(t,e,r){let n=e.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let o=r.count;for(let s in n.properties){let i=n.properties[s],a=r.properties?.[s];if(a){let f=F1(t,e,i,o,a);a.data=f}}}function F1(t,e,r,n,o){let s=[],i=o.values,a=t.getTypedArrayForBufferView(i),f=R1(t,r,o,n),c=D1(t,o,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{s=O1(r,n,a,f);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{s=jo(n,a,f,c);break}case"ENUM":{s=L1(e,r,n,a,f);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return s}function R1(t,e,r,n){return e.array&&typeof e.count>"u"&&typeof r.arrayOffsets<"u"?vr(t,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function D1(t,e,r){return typeof e.stringOffsets<"u"?vr(t,e.stringOffsets,e.stringOffsetType||"UINT32",r):null}function O1(t,e,r,n){let o=t.array,s=t.count,i=Ln(t.type,t.componentType),a=r.byteLength/i,f;return t.componentType?f=Gr(r,t.type,t.componentType,a):f=r,o?n?Qo(f,e,n,r.length,i):s?Vo(f,e,s):[]:f}function L1(t,e,r,n,o){let s=e.enumType;if(!s)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let i=t.enums?.[s];if(!i)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${s}`);let a=i.valueType||"UINT16",f=Ln(e.type,a),c=n.byteLength/f,l=Gr(n,e.type,a,c);if(l||(l=n),e.array){if(o)return v1({valuesData:l,numberOfElements:r,arrayOffsets:o,valuesDataBytesLength:n.length,elementSize:f,enumEntry:i});let h=e.count;return h?G1(l,r,h,i):[]}return Zi(l,0,r,i)}function v1(t){let{valuesData:e,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:o,elementSize:s,enumEntry:i}=t,a=[];for(let f=0;f<r;f++){let c=n[f],l=n[f+1]-n[f];if(l+c>o)break;let h=c/s,u=l/s,d=Zi(e,h,u,i);a.push(d)}return a}function G1(t,e,r,n){let o=[];for(let s=0;s<e;s++){let i=r*s,a=Zi(t,i,r,n);o.push(a)}return o}function Zi(t,e,r,n){let o=[];for(let s=0;s<r;s++)if(t instanceof BigInt64Array||t instanceof BigUint64Array)o.push("");else{let i=t[e+s],a=N1(n,i);a?o.push(a.name):o.push("")}return o}function N1(t,e){for(let r of t.values)if(r.value===e)return r;return null}var U1="schemaClassId";function P1(t,e){let r=t.getExtension(Pr);if(r&&r.propertyTables)for(let n of r.propertyTables){let o=n.class,s=r.schema?.classes?.[o];n.properties&&s&&H1(n,s,t)}}function H1(t,e,r){for(let n in t.properties){let o=t.properties[n].data;if(o){let s=e.properties[n];if(s){let i=Q1(o,s,r);t.properties[n]=i}}}}function k1(t,e,r=U1){let n=t.getExtension(Pr);n||(n=t.addExtension(Pr)),n.schema=J1(e,r,n.schema);let o=z1(e,r,n.schema);return n.propertyTables||(n.propertyTables=[]),n.propertyTables.push(o)-1}function J1(t,e,r){let n=r??{id:"schema_id"},o={properties:{}};for(let s of t){let i={type:s.elementType,componentType:s.componentType};o.properties[s.name]=i}return n.classes={},n.classes[e]=o,n}function z1(t,e,r){let n={class:e,count:0},o=0,s=r.classes?.[e];for(let i of t){if(o===0&&(o=i.values.length),o!==i.values.length&&i.values.length)throw new Error("Illegal values in attributes");s?.properties[i.name]&&(n.properties||(n.properties={}),n.properties[i.name]={values:0,data:i.values})}return n.count=o,n}function Q1(t,e,r){let n={values:0};if(e.type==="STRING"){let{stringData:o,stringOffsets:s}=K1(t);n.stringOffsets=Xi(s,r),n.values=Xi(o,r)}else if(e.type==="SCALAR"&&e.componentType){let o=j1(t,e.componentType);n.values=Xi(o,r)}return n}var V1={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:Int32Array,UINT64:Uint32Array,FLOAT32:Float32Array,FLOAT64:Float64Array};function j1(t,e){let r=[];for(let o of t)r.push(Number(o));let n=V1[e];if(!n)throw new Error("Illegal component type");return new n(r)}function K1(t){let e=new TextEncoder,r=[],n=0;for(let f of t){let c=e.encode(f);n+=c.length,r.push(c)}let o=new Uint8Array(n),s=[],i=0;for(let f of r)o.set(f,i),s.push(i),i+=f.length;s.push(i);let a=new Uint32Array(s);return{stringData:o,stringOffsets:a}}function Xi(t,e){return e.gltf.buffers.push({arrayBuffer:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}),e.addBufferView(t)}var Wi={};lt(Wi,{decode:()=>Z1,name:()=>X1});var kl="EXT_feature_metadata",X1=kl;async function Z1(t,e){let r=new Q(t);Y1(r,e)}function Y1(t,e){if(!e.gltf?.loadBuffers)return;let r=t.getExtension(kl);r&&(e.gltf?.loadImages&&W1(t,r),q1(t,r))}function W1(t,e){let r=e.schema;if(!r)return;let n=r.classes,{featureTextures:o}=e;if(n&&o)for(let s in n){let i=n[s],a=tg(o,s);a&&rg(t,a,i)}}function q1(t,e){let r=e.schema;if(!r)return;let n=r.classes,o=e.featureTables;if(n&&o)for(let s in n){let i=$1(o,s);i&&eg(t,r,i)}}function $1(t,e){for(let r in t){let n=t[r];if(n.class===e)return n}return null}function tg(t,e){for(let r in t){let n=t[r];if(n.class===e)return n}return null}function eg(t,e,r){if(!r.class)return;let n=e.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let o=r.count;for(let s in n.properties){let i=n.properties[s],a=r.properties?.[s];if(a){let f=ng(t,e,i,o,a);a.data=f}}}function rg(t,e,r){let n=e.class;for(let o in r.properties){let s=e?.properties?.[o];if(s){let i=cg(t,s,n);s.data=i}}}function ng(t,e,r,n,o){let s=[],i=o.bufferView,a=t.getTypedArrayForBufferView(i),f=og(t,r,o,n),c=sg(t,r,o,n);return r.type==="STRING"||r.componentType==="STRING"?s=jo(n,a,f,c):ig(r)&&(s=ag(r,n,a,f)),s}function og(t,e,r,n){return e.type==="ARRAY"&&typeof e.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?vr(t,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function sg(t,e,r,n){return typeof r.stringOffsetBufferView<"u"?vr(t,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function ig(t){let e=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return e.includes(t.type)||typeof t.componentType<"u"&&e.includes(t.componentType)}function ag(t,e,r,n){let o=t.type==="ARRAY",s=t.componentCount,i="SCALAR",a=t.componentType||t.type,f=Ln(i,a),c=r.byteLength/f,l=Gr(r,i,a,c);return o?n?Qo(l,e,n,r.length,f):s?Vo(l,e,s):[]:l}function cg(t,e,r){let n=t.gltf.json;if(!n.meshes)return[];let o=[];for(let s of n.meshes)for(let i of s.primitives)fg(t,r,e,o,i);return o}function fg(t,e,r,n,o){let s={channels:r.channels,...r.texture},i=Nr(t,s,o);i&&zo(t,e,i,n,o)}var Jl="4.3.0-alpha.7";var zl="4.3.0-alpha.7";var Ko={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},Ql;async function $i(t){dn(t.modules);let e=vs("basis");return e||(Ql||=lg(t),await Ql)}async function lg(t){let e=null,r=null;return[e,r]=await Promise.all([await Yt(Ko.TRANSCODER,"textures",t),await Yt(Ko.TRANSCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await hg(e,r)}function hg(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(o=>{let{BasisFile:s,initializeBasis:i}=o;i(),n({BasisFile:s})})})}var qi;async function ta(t){let e=t.modules||{};return e.basisEncoder?e.basisEncoder:(qi=qi||ug(t),await qi)}async function ug(t){let e=null,r=null;return[e,r]=await Promise.all([await Yt(Ko.ENCODER,"textures",t),await Yt(Ko.ENCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await dg(e,r)}function dg(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(o=>{let{BasisFile:s,KTX2File:i,initializeBasis:a,BasisEncoder:f}=o;a(),n({BasisFile:s,KTX2File:i,BasisEncoder:f})})})}var Ke={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 Ag=["","WEBKIT_","MOZ_"],Vl={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"},Xo=null;function jl(t){if(!Xo){t=t||mg()||void 0,Xo=new Set;for(let e of Ag)for(let r in Vl)if(t&&t.getExtension(`${e}${r}`)){let n=Vl[r];Xo.add(n)}}return Xo}function mg(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var Mt=[171,75,84,88,32,50,48,187,13,10,26,10];function Kl(t){let e=new Uint8Array(t);return!(e.byteLength<Mt.length||e[0]!==Mt[0]||e[1]!==Mt[1]||e[2]!==Mt[2]||e[3]!==Mt[3]||e[4]!==Mt[4]||e[5]!==Mt[5]||e[6]!==Mt[6]||e[7]!==Mt[7]||e[8]!==Mt[8]||e[9]!==Mt[9]||e[10]!==Mt[10]||e[11]!==Mt[11])}var pg={etc1:{basisFormat:0,compressed:!0,format:Ke.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Ke.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Ke.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:Ke.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Ke.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 ra(t,e){if(e.basis.containerFormat==="auto"){if(Kl(t)){let n=await ta(e);return Xl(n.KTX2File,t,e)}let{BasisFile:r}=await $i(e);return ea(r,t,e)}switch(e.basis.module){case"encoder":let r=await ta(e);switch(e.basis.containerFormat){case"ktx2":return Xl(r.KTX2File,t,e);case"basis":default:return ea(r.BasisFile,t,e)}case"transcoder":default:let{BasisFile:n}=await $i(e);return ea(n,t,e)}}function ea(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(),s=[];for(let i=0;i<o;i++){let a=n.getNumLevels(i),f=[];for(let c=0;c<a;c++)f.push(gg(n,i,c,r));s.push(f)}return s}finally{n.close(),n.delete()}}function gg(t,e,r,n){let o=t.getImageWidth(e,r),s=t.getImageHeight(e,r),i=t.getHasAlpha(),{compressed:a,format:f,basisFormat:c}=Zl(n,i),l=t.getImageTranscodedSizeInBytes(e,r,c),h=new Uint8Array(l);if(!t.transcodeImage(h,e,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:o,height:s,data:h,compressed:a,format:f,hasAlpha:i}}function Xl(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(),s=[];for(let i=0;i<o;i++)s.push(Bg(n,i,r));return[s]}finally{n.close(),n.delete()}}function Bg(t,e,r){let{alphaFlag:n,height:o,width:s}=t.getImageLevelInfo(e,0,0),{compressed:i,format:a,basisFormat:f}=Zl(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:s,height:o,data:l,compressed:i,levelSize:c,hasAlpha:n,format:a}}function Zl(t,e){let r=t&&t.basis&&t.basis.format;return r==="auto"&&(r=Zo()),typeof r=="object"&&(r=e?r.alpha:r.noAlpha),r=r.toLowerCase(),pg[r]}function Zo(){let t=jl();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 Yl={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:zl,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"}}},na={...Yl,parse:ra};var Hr=!0,Wl=1735152710,ia=12,Yo=8,xg=1313821514,Eg=5130562,_g=0,yg=0,Cg=1;function Tg(t,e=0){return`${String.fromCharCode(t.getUint8(e+0))}${String.fromCharCode(t.getUint8(e+1))}${String.fromCharCode(t.getUint8(e+2))}${String.fromCharCode(t.getUint8(e+3))}`}function ql(t,e=0,r={}){let n=new DataView(t),{magic:o=Wl}=r,s=n.getUint32(e,!1);return s===o||s===Wl}function $l(t,e,r=0,n={}){let o=new DataView(e),s=Tg(o,r+0),i=o.getUint32(r+4,Hr),a=o.getUint32(r+8,Hr);switch(Object.assign(t,{header:{byteOffset:r,byteLength:a,hasBinChunk:!1},type:s,version:i,json:{},binChunks:[]}),r+=ia,t.version){case 1:return bg(t,o,r);case 2:return Mg(t,o,r,n={});default:throw new Error(`Invalid GLB version ${t.version}. Only supports version 1 and 2.`)}}function bg(t,e,r){z(t.header.byteLength>ia+Yo);let n=e.getUint32(r+0,Hr),o=e.getUint32(r+4,Hr);return r+=Yo,z(o===_g),oa(t,e,r,n),r+=n,r+=sa(t,e,r,t.header.byteLength),r}function Mg(t,e,r,n){return z(t.header.byteLength>ia+Yo),wg(t,e,r,n),r+t.header.byteLength}function wg(t,e,r,n){for(;r+8<=t.header.byteLength;){let o=e.getUint32(r+0,Hr),s=e.getUint32(r+4,Hr);switch(r+=Yo,s){case xg:oa(t,e,r,o);break;case Eg:sa(t,e,r,o);break;case yg:n.strict||oa(t,e,r,o);break;case Cg:n.strict||sa(t,e,r,o);break;default:break}r+=Tt(o,4)}return r}function oa(t,e,r,n){let o=new Uint8Array(e.buffer,r,n),i=new TextDecoder("utf8").decode(o);return t.json=JSON.parse(i),Tt(n,4)}function sa(t,e,r,n){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:e.buffer}),Tt(n,4)}function aa(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;let n=e.baseUri||e.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${t}`);return n.substr(0,n.lastIndexOf("/")+1)+t}var fa={};lt(fa,{decode:()=>Pg,name:()=>Ug});var Ig="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYA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XAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",Fg=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Rg=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),Dg={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Og={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function th(t,e,r,n,o,s="NONE"){let i=await Lg();Ng(i,i.exports[Og[o]],t,e,r,n,i.exports[Dg[s||"NONE"]])}var ca;async function Lg(){return ca||(ca=vg()),ca}async function vg(){let t=Ig;WebAssembly.validate(Fg)&&(t=Sg,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let e=await WebAssembly.instantiate(Gg(t),{});return await e.instance.exports.__wasm_call_ctors(),e.instance}function Gg(t){let e=new Uint8Array(t.length);for(let n=0;n<t.length;++n){let o=t.charCodeAt(n);e[n]=o>96?o-71:o>64?o-65:o>47?o+4:o>46?63:62}let r=0;for(let n=0;n<t.length;++n)e[r++]=e[n]<60?Rg[e[n]]:(e[n]-60)*64+e[++n];return e.buffer.slice(0,r)}function Ng(t,e,r,n,o,s,i){let a=t.exports.sbrk,f=n+3&-4,c=a(f*o),l=a(s.length),h=new Uint8Array(t.exports.memory.buffer);h.set(s,l);let u=e(c,n,o,l,s.length);if(u===0&&i&&i(c,f,o),r.set(h.subarray(c,c+n*o)),a(c-a(0)),u!==0)throw new Error(`Malformed buffer data: ${u}`)}var Wo="EXT_meshopt_compression",Ug=Wo;async function Pg(t,e){let r=new Q(t);if(!e?.gltf?.decompressMeshes||!e.gltf?.loadBuffers)return;let n=[];for(let o of t.json.bufferViews||[])n.push(Hg(r,o));await Promise.all(n),r.removeExtension(Wo)}async function Hg(t,e){let r=t.getObjectExtension(e,Wo);if(r){let{byteOffset:n=0,byteLength:o=0,byteStride:s,count:i,mode:a,filter:f="NONE",buffer:c}=r,l=t.gltf.buffers[c],h=new Uint8Array(l.arrayBuffer,l.byteOffset+n,o),u=new Uint8Array(t.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength);await th(u,i,s,h,a,f),t.removeObjectExtension(e,Wo)}}var la={};lt(la,{name:()=>kg,preprocess:()=>Jg});var kr="EXT_texture_webp",kg=kr;function Jg(t,e){let r=new Q(t);if(!ji("image/webp")){if(r.getRequiredExtensions().includes(kr))throw new Error(`gltf: Required extension ${kr} not supported by browser`);return}let{json:n}=r;for(let o of n.textures||[]){let s=r.getObjectExtension(o,kr);s&&(o.source=s.source),r.removeObjectExtension(o,kr)}r.removeExtension(kr)}var ha={};lt(ha,{name:()=>zg,preprocess:()=>Qg});var qo="KHR_texture_basisu",zg=qo;function Qg(t,e){let r=new Q(t),{json:n}=r;for(let o of n.textures||[]){let s=r.getObjectExtension(o,qo);s&&(o.source=s.source,r.removeObjectExtension(o,qo))}r.removeExtension(qo)}var da={};lt(da,{decode:()=>Zg,encode:()=>Yg,name:()=>Kg,preprocess:()=>Xg});function eh(t){let e={};for(let r in t){let n=t[r];if(r!=="indices"){let o=ua(n);e[r]=o}}return e}function ua(t){let{buffer:e,size:r,count:n}=Vg(t);return{value:e,size:r,byteOffset:0,count:n,type:Jo(r),componentType:Se(e)}}function Vg(t){let e=t,r=1,n=0;return t&&t.value&&(e=t.value,r=t.size||1),e&&(ArrayBuffer.isView(e)||(e=jg(e,Float32Array)),n=e.length/r),{buffer:e,size:r,count:n}}function jg(t,e,r=!1){return t?Array.isArray(t)?new e(t):r&&!(t instanceof e)?new e(t):t:null}var Fe="KHR_draco_mesh_compression",Kg=Fe;function Xg(t,e,r){let n=new Q(t);for(let o of rh(n))n.getObjectExtension(o,Fe)}async function Zg(t,e,r){if(!e?.gltf?.decompressMeshes)return;let n=new Q(t),o=[];for(let s of rh(n))n.getObjectExtension(s,Fe)&&o.push(Wg(n,s,e,r));await Promise.all(o),n.removeExtension(Fe)}function Yg(t,e={}){let r=new Q(t);for(let n of r.json.meshes||[])qg(n,e),r.addRequiredExtension(Fe)}async function Wg(t,e,r,n){let o=t.getObjectExtension(e,Fe);if(!o)return;let s=t.getTypedArrayForBufferView(o.bufferView),i=Pe(s.buffer,s.byteOffset),a={...r};delete a["3d-tiles"];let f=await Pt(i,Go,a,n),c=eh(f.attributes);for(let[l,h]of Object.entries(c))if(l in e.attributes){let u=e.attributes[l],d=t.getAccessor(u);d?.min&&d?.max&&(h.min=d.min,h.max=d.max)}e.attributes=c,f.indices&&(e.indices=ua(f.indices)),t.removeObjectExtension(e,Fe),$g(e)}function qg(t,e,r=4,n,o){if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let s=n.DracoWriter.encodeSync({attributes:t}),i=o?.parseSync?.({attributes:t}),a=n._addFauxAttributes(i.attributes),f=n.addBufferView(s);return{primitives:[{attributes:a,mode:r,extensions:{[Fe]:{bufferView:f,attributes:a}}}]}}function $g(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*rh(t){for(let e of t.json.meshes||[])for(let r of e.primitives)yield r}var Aa={};lt(Aa,{decode:()=>nB,name:()=>tB});var ts="KHR_texture_transform",tB=ts,$o=new M,eB=new X,rB=new X;async function nB(t,e){if(!new Q(t).hasExtension(ts)||!e.gltf?.loadBuffers)return;let o=t.json.materials||[];for(let s=0;s<o.length;s++)oB(s,t)}function oB(t,e){let r=e.json.materials?.[t],n=[r?.pbrMetallicRoughness?.baseColorTexture,r?.emissiveTexture,r?.normalTexture,r?.occlusionTexture,r?.pbrMetallicRoughness?.metallicRoughnessTexture],o=[];for(let s of n)s&&s?.extensions?.[ts]&&sB(e,t,s,o)}function sB(t,e,r,n){let o=iB(r,n);if(!o)return;let s=t.json.meshes||[];for(let i of s)for(let a of i.primitives){let f=a.material;Number.isFinite(f)&&e===f&&aB(t,a,o)}}function iB(t,e){let r=t.extensions?.[ts],{texCoord:n=0}=t,{texCoord:o=n}=r;if(!(e.findIndex(([i,a])=>i===n&&a===o)!==-1)){let i=lB(r);return n!==o&&(t.texCoord=o),e.push([n,o]),{originalTexCoord:n,texCoord:o,matrix:i}}return null}function aB(t,e,r){let{originalTexCoord:n,texCoord:o,matrix:s}=r,i=e.attributes[`TEXCOORD_${n}`];if(Number.isFinite(i)){let a=t.json.accessors?.[i];if(a&&a.bufferView){let f=t.json.bufferViews?.[a.bufferView];if(f){let{arrayBuffer:c,byteOffset:l}=t.buffers[f.buffer],h=(l||0)+(a.byteOffset||0)+(f.byteOffset||0),{ArrayType:u,length:d}=Lr(a,f),A=ko[a.componentType],m=Ho[a.type],p=f.byteStride||A*m,E=new Float32Array(d);for(let y=0;y<a.count;y++){let T=new u(c,h+y*p,2);$o.set(T[0],T[1],1),$o.transformByMatrix3(s),E.set([$o[0],$o[1]],y*m)}n===o?cB(a,f,t.buffers,E):fB(o,a,e,t,E)}}}}function cB(t,e,r,n){t.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),e.buffer=r.length-1,e.byteLength=n.buffer.byteLength,e.byteOffset=0,delete e.byteStride}function fB(t,e,r,n,o){n.buffers.push({arrayBuffer:o.buffer,byteOffset:0,byteLength:o.buffer.byteLength});let s=n.json.bufferViews;if(!s)return;s.push({buffer:n.buffers.length-1,byteLength:o.buffer.byteLength,byteOffset:0});let i=n.json.accessors;i&&(i.push({bufferView:s?.length-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),r.attributes[`TEXCOORD_${t}`]=i.length-1)}function lB(t){let{offset:e=[0,0],rotation:r=0,scale:n=[1,1]}=t,o=new X().set(1,0,0,0,1,0,e[0],e[1],1),s=eB.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),i=rB.set(n[0],0,0,0,n[1],0,0,0,1);return o.multiplyRight(s).multiplyRight(i)}var ma={};lt(ma,{decode:()=>uB,encode:()=>dB,name:()=>hB});var Xe="KHR_lights_punctual",hB=Xe;async function uB(t){let e=new Q(t),{json:r}=e,n=e.getExtension(Xe);n&&(e.json.lights=n.lights,e.removeExtension(Xe));for(let o of r.nodes||[]){let s=e.getObjectExtension(o,Xe);s&&(o.light=s.light),e.removeObjectExtension(o,Xe)}}async function dB(t){let e=new Q(t),{json:r}=e;if(r.lights){let n=e.addExtension(Xe);ot(!n.lights),n.lights=r.lights,delete r.lights}if(e.json.lights){for(let n of e.json.lights){let o=n.node;e.addObjectExtension(o,Xe,n)}delete e.json.lights}}var pa={};lt(pa,{decode:()=>mB,encode:()=>pB,name:()=>AB});var vn="KHR_materials_unlit",AB=vn;async function mB(t){let e=new Q(t),{json:r}=e;for(let n of r.materials||[])n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),e.removeObjectExtension(n,vn);e.removeExtension(vn)}function pB(t){let e=new Q(t),{json:r}=e;if(e.materials)for(let n of r.materials||[])n.unlit&&(delete n.unlit,e.addObjectExtension(n,vn,{}),e.addExtension(vn))}var ga={};lt(ga,{decode:()=>BB,encode:()=>xB,name:()=>gB});var Gn="KHR_techniques_webgl",gB=Gn;async function BB(t){let e=new Q(t),{json:r}=e,n=e.getExtension(Gn);if(n){let o=EB(n,e);for(let s of r.materials||[]){let i=e.getObjectExtension(s,Gn);i&&(s.technique=Object.assign({},i,o[i.technique]),s.technique.values=_B(s.technique,e)),e.removeObjectExtension(s,Gn)}e.removeExtension(Gn)}}async function xB(t,e){}function EB(t,e){let{programs:r=[],shaders:n=[],techniques:o=[]}=t,s=new TextDecoder;return n.forEach(i=>{if(Number.isFinite(i.bufferView))i.code=s.decode(e.getTypedArrayForBufferView(i.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),r.forEach(i=>{i.fragmentShader=n[i.fragmentShader],i.vertexShader=n[i.vertexShader]}),o.forEach(i=>{i.program=r[i.program]}),o}function _B(t,e){let r=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach(n=>{t.uniforms[n].value&&!(n in r)&&(r[n]=t.uniforms[n].value)}),Object.keys(r).forEach(n=>{typeof r[n]=="object"&&r[n].index!==void 0&&(r[n].texture=e.getTexture(r[n].index))}),r}var nh=[Yi,Ki,fa,la,ha,da,ma,pa,ga,Aa,Wi];function oh(t,e={},r){let n=nh.filter(o=>ih(o.name,e));for(let o of n)o.preprocess?.(t,e,r)}async function sh(t,e={},r){let n=nh.filter(o=>ih(o.name,e));for(let o of n)await o.decode?.(t,e,r)}function ih(t,e){let r=e?.gltf?.excludeExtensions||{};return!(t in r&&!r[t])}var Ba="KHR_binary_glTF";function ah(t){let e=new Q(t),{json:r}=e;for(let n of r.images||[]){let o=e.getObjectExtension(n,Ba);o&&Object.assign(n,o),e.removeObjectExtension(n,Ba)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,e.removeExtension(Ba)}var ch={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},CB={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},xa=class{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(e,r){this.json=e.json;let n=e.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${n.asset.version}`);return}if(!r.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),ah(e),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(let r in ch)this._convertTopLevelObjectToArray(e,r)}_convertTopLevelObjectToArray(e,r){let n=e[r];if(!(!n||Array.isArray(n))){e[r]=[];for(let o in n){let s=n[o];s.id=s.id||o;let i=e[r].length;e[r].push(s),this.idToIndexMap[r][o]=i}}}_convertObjectIdsToArrayIndices(e){for(let r in ch)this._convertIdsToIndices(e,r);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(let r of e.textures)this._convertTextureIds(r);for(let r of e.meshes)this._convertMeshIds(r);for(let r of e.nodes)this._convertNodeIds(r);for(let r of e.scenes)this._convertSceneIds(r)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(let r of e.primitives){let{attributes:n,indices:o,material:s}=r;for(let i in n)n[i]=this._convertIdToIndex(n[i],"accessor");o&&(r.indices=this._convertIdToIndex(o,"accessor")),s&&(r.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(r=>this._convertIdToIndex(r,"node"))),e.meshes&&(e.meshes=e.meshes.map(r=>this._convertIdToIndex(r,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(r=>this._convertIdToIndex(r,"node")))}_convertIdsToIndices(e,r){e[r]||(console.warn(`gltf v1: json doesn't contain attribute ${r}`),e[r]=[]);for(let n of e[r])for(let o in n){let s=n[o],i=this._convertIdToIndex(s,o);n[o]=i}}_convertIdToIndex(e,r){let n=CB[r];if(n in this.idToIndexMap){let o=this.idToIndexMap[n][e];if(!Number.isFinite(o))throw new Error(`gltf v1: failed to resolve ${r} with id ${e}`);return o}return e}_updateObjects(e){for(let r of this.json.buffers)delete r.type}_updateMaterial(e){for(let r of e.materials){r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};let n=r.values?.tex||r.values?.texture2d_0||r.values?.diffuseTex,o=e.textures.findIndex(s=>s.id===n);o!==-1&&(r.pbrMetallicRoughness.baseColorTexture={index:o})}}};function fh(t,e={}){return new xa().normalize(t,e)}async function lh(t,e,r=0,n,o){return TB(t,e,r,n),fh(t,{normalize:n?.gltf?.normalize}),oh(t,n,o),n?.gltf?.loadBuffers&&t.json.buffers&&await bB(t,n,o),n?.gltf?.loadImages&&await MB(t,n,o),await sh(t,n,o),t}function TB(t,e,r,n){if(n.uri&&(t.baseUri=n.uri),e instanceof ArrayBuffer&&!ql(e,r,n)&&(e=new TextDecoder().decode(e)),typeof e=="string")t.json=Ns(e);else if(e instanceof ArrayBuffer){let i={};r=$l(i,e,r,n.glb),ot(i.type==="glTF",`Invalid GLB magic string ${i.type}`),t._glb=i,t.json=i.json}else ot(!1,"GLTF: must be ArrayBuffer or string");let o=t.json.buffers||[];if(t.buffers=new Array(o.length).fill(null),t._glb&&t._glb.header.hasBinChunk){let{binChunks:i}=t._glb;t.buffers[0]={arrayBuffer:i[0].arrayBuffer,byteOffset:i[0].byteOffset,byteLength:i[0].byteLength}}let s=t.json.images||[];t.images=new Array(s.length).fill({})}async function bB(t,e,r){let n=t.json.buffers||[];for(let o=0;o<n.length;++o){let s=n[o];if(s.uri){let{fetch:i}=r;ot(i);let a=aa(s.uri,e),c=await(await r?.fetch?.(a))?.arrayBuffer?.();t.buffers[o]={arrayBuffer:c,byteOffset:0,byteLength:c.byteLength},delete s.uri}else t.buffers[o]===null&&(t.buffers[o]={arrayBuffer:new ArrayBuffer(s.byteLength),byteOffset:0,byteLength:s.byteLength})}}async function MB(t,e,r){let n=wB(t),o=t.json.images||[],s=[];for(let i of n)s.push(IB(t,o[i],i,e,r));return await Promise.all(s)}function wB(t){let e=new Set,r=t.json.textures||[];for(let n of r)n.source!==void 0&&e.add(n.source);return Array.from(e).sort()}async function IB(t,e,r,n,o){let s;if(e.uri&&!e.hasOwnProperty("bufferView")){let a=aa(e.uri,n),{fetch:f}=o;s=await(await f(a)).arrayBuffer(),e.bufferView={data:s}}if(Number.isFinite(e.bufferView)){let a=Gl(t.json,t.buffers,e.bufferView);s=Pe(a.buffer,a.byteOffset,a.byteLength)}ot(s,"glTF image has no data");let i=await Pt(s,[Qi,na],{...n,mimeType:e.mimeType,basis:n.basis||{format:Zo()}},o);i&&i[0]&&(i={compressed:!0,mipmaps:!1,width:i[0].width,height:i[0].height,data:i[0]}),t.images=t.images||[],t.images[r]=i}var Ze={dataType:null,batchType:null,name:"glTF",id:"gltf",module:"gltf",version:Jl,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:SB,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function SB(t,e={},r){e={...Ze.options,...e},e.gltf={...Ze.options.gltf,...e.gltf};let{byteOffset:n=0}=e;return await lh({},t,n,e,r)}var FB={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},RB={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Dt={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},DB={magFilter:Dt.TEXTURE_MAG_FILTER,minFilter:Dt.TEXTURE_MIN_FILTER,wrapS:Dt.TEXTURE_WRAP_S,wrapT:Dt.TEXTURE_WRAP_T},OB={[Dt.TEXTURE_MAG_FILTER]:Dt.LINEAR,[Dt.TEXTURE_MIN_FILTER]:Dt.NEAREST_MIPMAP_LINEAR,[Dt.TEXTURE_WRAP_S]:Dt.REPEAT,[Dt.TEXTURE_WRAP_T]:Dt.REPEAT};function LB(){return{id:"default-sampler",parameters:OB}}function vB(t){return RB[t]}function GB(t){return FB[t]}var Ea=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(e,r={}){let{json:n,buffers:o=[],images:s=[]}=e,{baseUri:i=""}=e;return ot(n),this.baseUri=i,this.buffers=o,this.images=s,this.jsonUnprocessed=n,this.json=this._resolveTree(e.json,r),this.json}_resolveTree(e,r={}){let n={...e};return this.json=n,e.bufferViews&&(n.bufferViews=e.bufferViews.map((o,s)=>this._resolveBufferView(o,s))),e.images&&(n.images=e.images.map((o,s)=>this._resolveImage(o,s))),e.samplers&&(n.samplers=e.samplers.map((o,s)=>this._resolveSampler(o,s))),e.textures&&(n.textures=e.textures.map((o,s)=>this._resolveTexture(o,s))),e.accessors&&(n.accessors=e.accessors.map((o,s)=>this._resolveAccessor(o,s))),e.materials&&(n.materials=e.materials.map((o,s)=>this._resolveMaterial(o,s))),e.meshes&&(n.meshes=e.meshes.map((o,s)=>this._resolveMesh(o,s))),e.nodes&&(n.nodes=e.nodes.map((o,s)=>this._resolveNode(o,s)),n.nodes=n.nodes.map((o,s)=>this._resolveNodeChildren(o))),e.skins&&(n.skins=e.skins.map((o,s)=>this._resolveSkin(o,s))),e.scenes&&(n.scenes=e.scenes.map((o,s)=>this._resolveScene(o,s))),typeof this.json.scene=="number"&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(e){return this._get(this.json.scenes,e)}getNode(e){return this._get(this.json.nodes,e)}getSkin(e){return this._get(this.json.skins,e)}getMesh(e){return this._get(this.json.meshes,e)}getMaterial(e){return this._get(this.json.materials,e)}getAccessor(e){return this._get(this.json.accessors,e)}getCamera(e){return this._get(this.json.cameras,e)}getTexture(e){return this._get(this.json.textures,e)}getSampler(e){return this._get(this.json.samplers,e)}getImage(e){return this._get(this.json.images,e)}getBufferView(e){return this._get(this.json.bufferViews,e)}getBuffer(e){return this._get(this.json.buffers,e)}_get(e,r){if(typeof r=="object")return r;let n=e&&e[r];return n||console.warn(`glTF file error: Could not find ${e}[${r}]`),n}_resolveScene(e,r){return{...e,id:e.id||`scene-${r}`,nodes:(e.nodes||[]).map(n=>this.getNode(n))}}_resolveNode(e,r){let n={...e,id:e?.id||`node-${r}`};return e.mesh!==void 0&&(n.mesh=this.getMesh(e.mesh)),e.camera!==void 0&&(n.camera=this.getCamera(e.camera)),e.skin!==void 0&&(n.skin=this.getSkin(e.skin)),e.meshes!==void 0&&e.meshes.length&&(n.mesh=e.meshes.reduce((o,s)=>{let i=this.getMesh(s);return o.id=i.id,o.primitives=o.primitives.concat(i.primitives),o},{primitives:[]})),n}_resolveNodeChildren(e){return e.children&&(e.children=e.children.map(r=>this.getNode(r))),e}_resolveSkin(e,r){let n=typeof e.inverseBindMatrices=="number"?this.getAccessor(e.inverseBindMatrices):void 0;return{...e,id:e.id||`skin-${r}`,inverseBindMatrices:n}}_resolveMesh(e,r){let n={...e,id:e.id||`mesh-${r}`,primitives:[]};return e.primitives&&(n.primitives=e.primitives.map(o=>{let s={...o,attributes:{},indices:void 0,material:void 0},i=o.attributes;for(let a in i)s.attributes[a]=this.getAccessor(i[a]);return o.indices!==void 0&&(s.indices=this.getAccessor(o.indices)),o.material!==void 0&&(s.material=this.getMaterial(o.material)),s})),n}_resolveMaterial(e,r){let n={...e,id:e.id||`material-${r}`};if(n.normalTexture&&(n.normalTexture={...n.normalTexture},n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlusionTexture={...n.occlusionTexture},n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emissiveTexture={...n.emissiveTexture},n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||(n.emissiveFactor=n.emissiveTexture?[1,1,1]:[0,0,0]),n.pbrMetallicRoughness){n.pbrMetallicRoughness={...n.pbrMetallicRoughness};let o=n.pbrMetallicRoughness;o.baseColorTexture&&(o.baseColorTexture={...o.baseColorTexture},o.baseColorTexture.texture=this.getTexture(o.baseColorTexture.index)),o.metallicRoughnessTexture&&(o.metallicRoughnessTexture={...o.metallicRoughnessTexture},o.metallicRoughnessTexture.texture=this.getTexture(o.metallicRoughnessTexture.index))}return n}_resolveAccessor(e,r){let n=vB(e.componentType),o=GB(e.type),s=n*o,i={...e,id:e.id||`accessor-${r}`,bytesPerComponent:n,components:o,bytesPerElement:s,value:void 0,bufferView:void 0,sparse:void 0};if(e.bufferView!==void 0&&(i.bufferView=this.getBufferView(e.bufferView)),i.bufferView){let a=i.bufferView.buffer,{ArrayType:f,byteLength:c}=Lr(i,i.bufferView),l=(i.bufferView.byteOffset||0)+(i.byteOffset||0)+a.byteOffset,h=a.arrayBuffer.slice(l,l+c);i.bufferView.byteStride&&(h=this._getValueFromInterleavedBuffer(a,l,i.bufferView.byteStride,i.bytesPerElement,i.count)),i.value=new f(h)}return i}_getValueFromInterleavedBuffer(e,r,n,o,s){let i=new Uint8Array(s*o);for(let a=0;a<s;a++){let f=r+a*n;i.set(new Uint8Array(e.arrayBuffer.slice(f,f+o)),a*o)}return i.buffer}_resolveTexture(e,r){return{...e,id:e.id||`texture-${r}`,sampler:typeof e.sampler=="number"?this.getSampler(e.sampler):LB(),source:typeof e.source=="number"?this.getImage(e.source):void 0}}_resolveSampler(e,r){let n={id:e.id||`sampler-${r}`,...e,parameters:{}};for(let o in n){let s=this._enumSamplerParameter(o);s!==void 0&&(n.parameters[s]=n[o])}return n}_enumSamplerParameter(e){return DB[e]}_resolveImage(e,r){let n={...e,id:e.id||`image-${r}`,image:null,bufferView:e.bufferView!==void 0?this.getBufferView(e.bufferView):void 0},o=this.images[r];return o&&(n.image=o),n}_resolveBufferView(e,r){let n=e.buffer,o=this.buffers[n].arrayBuffer,s=this.buffers[n].byteOffset||0;return e.byteOffset&&(s+=e.byteOffset),{id:`bufferView-${r}`,...e,buffer:this.buffers[n],data:new Uint8Array(o,s,e.byteLength)}}_resolveCamera(e,r){let n={...e,id:e.id||`camera-${r}`};return n.perspective,n.orthographic,n}};function Nn(t,e){return new Ea().postProcess(t,e)}var es={URI:0,EMBEDDED:1};function rs(t,e,r,n){t.rotateYtoZ=!0;let o=(t.byteOffset||0)+(t.byteLength||0)-r;if(o===0)throw new Error("glTF byte length must be greater than 0.");return t.gltfUpAxis=n?.["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",t.gltfArrayBuffer=Pe(e,r,o),t.gltfByteOffset=0,t.gltfByteLength=o,r%4===0||console.warn(`${t.type}: embedded glb is not aligned to a 4-byte boundary.`),(t.byteOffset||0)+(t.byteLength||0)}async function ns(t,e,r,n){let o=r?.["3d-tiles"]||{};if(NB(t,e,r),o.loadGLTF){if(!n)return;if(t.gltfUrl){let{fetch:s}=n,i=await s(t.gltfUrl,r);t.gltfArrayBuffer=await i.arrayBuffer(),t.gltfByteOffset=0}if(t.gltfArrayBuffer){let s=await Pt(t.gltfArrayBuffer,Ze,r,n);t.gltf=Nn(s),t.gpuMemoryUsageInBytes=On(t.gltf),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength}}}function NB(t,e,r){switch(e){case es.URI:if(t.gltfArrayBuffer){let n=new Uint8Array(t.gltfArrayBuffer,t.gltfByteOffset),s=new TextDecoder().decode(n);t.gltfUrl=s.replace(/[\s\0]+$/,"")}delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;break;case es.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function hh(t,e,r,n,o){r=UB(t,e,r,n,o),await ns(t,es.EMBEDDED,n,o);let s=t?.gltf?.extensions;return s&&s.CESIUM_RTC&&(t.rtcCenter=s.CESIUM_RTC.center),r}function UB(t,e,r,n,o){r=Ie(t,e,r),r=Dr(t,e,r),r=Or(t,e,r,n),r=rs(t,e,r,n);let s=new kt(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=s.getGlobalProperty("RTC_CENTER",H.FLOAT,3),r}async function uh(t,e,r,n,o){return r=PB(t,e,r,n,o),await ns(t,t.gltfFormat||0,n,o),r}function PB(t,e,r,n,o){if(r=Ie(t,e,r),t.version!==1)throw new Error(`Instanced 3D Model version ${t.version} is not supported`);r=Dr(t,e,r);let s=new DataView(e);if(t.gltfFormat=s.getUint32(r,!0),r+=4,r=Or(t,e,r,n),r=rs(t,e,r,n),!t?.header?.featureTableJsonByteLength||t.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let i=new kt(t.featureTableJson,t.featureTableBinary),a=i.getGlobalProperty("INSTANCES_LENGTH");if(i.featuresLength=a,!Number.isFinite(a))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");t.eastNorthUp=i.getGlobalProperty("EAST_NORTH_UP"),t.rtcCenter=i.getGlobalProperty("RTC_CENTER",H.FLOAT,3);let f=new ue(t.batchTableJson,t.batchTableBinary,a);return HB(t,i,f,a),r}function HB(t,e,r,n){let o=new Array(n),s=new M,i=new M,a=new M,f=new M,c=new X,l=new Ce,h=new M,u={},d=new St,A=[],m=[],p=[],E=[];for(let y=0;y<n;y++){let T;if(e.hasProperty("POSITION"))T=e.getProperty("POSITION",H.FLOAT,3,y,s);else if(e.hasProperty("POSITION_QUANTIZED")){T=e.getProperty("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3,y,s);let g=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3);if(!g)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let x=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",H.FLOAT,3);if(!x)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let _=65535;for(let U=0;U<3;U++)T[U]=T[U]/_*x[U]+g[U]}if(!T)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");s.copy(T),u.translation=s,t.normalUp=e.getProperty("NORMAL_UP",H.FLOAT,3,y,A),t.normalRight=e.getProperty("NORMAL_RIGHT",H.FLOAT,3,y,m);let b=!1;if(t.normalUp){if(!t.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");t.hasCustomOrientation=!0}else{if(t.octNormalUp=e.getProperty("NORMAL_UP_OCT32P",H.UNSIGNED_SHORT,2,y,A),t.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",H.UNSIGNED_SHORT,2,y,m),t.octNormalUp)throw t.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");t.eastNorthUp?(ce.WGS84.eastNorthUpToFixedFrame(s,d),d.getRotationMatrix3(c)):c.identity()}b&&(f.copy(i).cross(a).normalize(),c.setColumn(0,i),c.setColumn(1,a),c.setColumn(2,f)),l.fromMatrix3(c),u.rotation=l,h.set(1,1,1);let C=e.getProperty("SCALE",H.FLOAT,1,y,p);Number.isFinite(C)&&h.multiplyByScalar(C);let w=e.getProperty("SCALE_NON_UNIFORM",H.FLOAT,3,y,A);w&&h.scale(w),u.scale=h;let I=e.getProperty("BATCH_ID",H.UNSIGNED_SHORT,1,y,E);I===void 0&&(I=y);let O=new St().fromQuaternion(u.rotation);d.identity(),d.translate(u.translation),d.multiplyRight(O),d.scale(u.scale);let B=d.clone();o[y]={modelMatrix:B,batchId:I}}t.instances=o}async function dh(t,e,r,n,o,s){r=Ie(t,e,r);let i=new DataView(e);for(t.tilesLength=i.getUint32(r,!0),r+=4,t.tiles=[];t.tiles.length<t.tilesLength&&(t.byteLength||0)-r>12;){let a={shape:"tile3d"};t.tiles.push(a),r=await s(e,r,n,o,a)}return r}async function Ah(t,e,r,n){if(t.rotateYtoZ=!0,t.gltfUpAxis=r?.["3d-tiles"]?.assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",r?.["3d-tiles"]?.loadGLTF){if(!n)return e.byteLength;let o=await Pt(e,Ze,r,n);t.gltf=Nn(o),t.gpuMemoryUsageInBytes=On(t.gltf)}else t.gltfArrayBuffer=e;return e.byteLength}async function _a(t,e=0,r,n,o={shape:"tile3d"}){switch(o.byteOffset=e,o.type=nl(t,e),o.type){case xt.COMPOSITE:return await dh(o,t,e,r,n,_a);case xt.BATCHED_3D_MODEL:return await hh(o,t,e,r,n);case xt.GLTF:return await Ah(o,t,r,n);case xt.INSTANCED_3D_MODEL:return await uh(o,t,e,r,n);case xt.POINT_CLOUD:return await Tl(o,t,e,r,n);default:throw new Error(`3DTileLoader: unknown type ${o.type}`)}}async function ya(t,e,r){if(new Uint32Array(t.slice(0,4))[0]!==1952609651)throw new Error("Wrong subtree file magic number");if(new Uint32Array(t.slice(4,8))[0]!==1)throw new Error("Wrong subtree file verson, must be 1");let s=mh(t.slice(8,16)),i=new Uint8Array(t,24,s),f=new TextDecoder("utf8").decode(i),c=JSON.parse(f),l=mh(t.slice(16,24)),h=new ArrayBuffer(0);if(l&&(h=t.slice(24+s)),await os(c,c.tileAvailability,h,r),Array.isArray(c.contentAvailability))for(let u of c.contentAvailability)await os(c,u,h,r);else await os(c,c.contentAvailability,h,r);return await os(c,c.childSubtreeAvailability,h,r),c}async function os(t,e,r,n){let o=Number.isFinite(e.bitstream)?e.bitstream:e.bufferView;if(typeof o!="number")return;let s=t.bufferViews[o],i=t.buffers[s.buffer];if(!n?.baseUrl)throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(i.uri){let f=`${n?.baseUrl||""}/${i.uri}`,l=await(await n.fetch(f)).arrayBuffer();e.explicitBitstream=new Uint8Array(l,s.byteOffset,s.byteLength);return}let a=t.buffers.slice(0,s.buffer).reduce((f,c)=>f+c.byteLength,0);e.explicitBitstream=new Uint8Array(r.slice(a,a+i.byteLength),s.byteOffset,s.byteLength)}function mh(t){let e=new DataView(t),r=e.getUint32(0,!0),n=e.getUint32(4,!0);return r+2**32*n}var Jr={dataType:null,batchType:null,id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:Sr,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:ya,options:{}};var jh=mr(un(),1);var Jh=mr(un(),1);function Ca(t){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let e=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=t||e;return!!(r&&r.indexOf("Electron")>=0)}function Jt(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Ca()}var kB=globalThis.self||globalThis.window||globalThis.global,zr=globalThis.window||globalThis.self||globalThis.global,JB=globalThis.document||{},Ye=globalThis.process||{},zB=globalThis.console,fS=globalThis.navigator||{};var ss=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",uS=Jt();function QB(t){try{let e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch{return null}}var is=class{constructor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=QB(n),this.id=e,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let e={};if(this.storage){let r=this.storage.getItem(this.id);e=r?JSON.parse(r):{}}return Object.assign(this.config,e),this}};function ph(t){let e;return t<10?e="".concat(t.toFixed(2),"ms"):t<100?e="".concat(t.toFixed(1),"ms"):t<1e3?e="".concat(t.toFixed(0),"ms"):e="".concat((t/1e3).toFixed(2),"s"),e}function gh(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(e-t.length,0);return"".concat(" ".repeat(r)).concat(t)}function as(t,e,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,o=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(r=Math.min(r,n/t.width));let s=t.width*r,i=t.height*r,a=["font-size:1px;","padding:".concat(Math.floor(i/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(i,"px;"),"background:url(".concat(o,");"),"background-size:".concat(s,"px ").concat(i,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}var cs;(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(cs||(cs={}));var VB=10;function Bh(t){return typeof t!="string"?t:(t=t.toUpperCase(),cs[t]||cs.WHITE)}function xh(t,e,r){if(!Jt&&typeof t=="string"){if(e){let n=Bh(e);t="\x1B[".concat(n,"m").concat(t,"\x1B[39m")}if(r){let n=Bh(r);t="\x1B[".concat(n+VB,"m").concat(t,"\x1B[49m")}}return t}function Eh(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(t),n=Object.getOwnPropertyNames(r),o=t;for(let s of n){let i=o[s];typeof i=="function"&&(e.find(a=>s===a)||(o[s]=i.bind(t)))}}function Qr(t,e){if(!t)throw new Error(e||"Assertion failed")}function We(){let t;if(Jt()&&zr.performance){var e,r;t=zr===null||zr===void 0||(e=zr.performance)===null||e===void 0||(r=e.now)===null||r===void 0?void 0:r.call(e)}else if("hrtime"in Ye){var n;let o=Ye===null||Ye===void 0||(n=Ye.hrtime)===null||n===void 0?void 0:n.call(Ye);t=o[0]*1e3+o[1]/1e6}else t=Date.now();return t}var Vr={debug:Jt()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},jB={enabled:!0,level:0};function Ot(){}var _h={},yh={once:!0},Un=class{constructor(){let{id:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=ss,this._startTs=We(),this._deltaTs=We(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new is("__probe-".concat(this.id,"__"),jB),this.timeStamp("".concat(this.id," started")),Eh(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((We()-this._startTs).toPrecision(10))}getDelta(){return Number((We()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,r){this._storage.setConfiguration({[e]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,r){Qr(e,r)}warn(e){return this._getLogFunction(0,e,Vr.warn,arguments,yh)}error(e){return this._getLogFunction(0,e,Vr.error,arguments)}deprecated(e,r){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(e,r){return this.error("`".concat(e,"` has been removed. Use `").concat(r,"` instead"))}probe(e,r){return this._getLogFunction(e,r,Vr.log,arguments,{time:!0,once:!0})}log(e,r){return this._getLogFunction(e,r,Vr.debug,arguments)}info(e,r){return this._getLogFunction(e,r,console.info,arguments)}once(e,r){return this._getLogFunction(e,r,Vr.debug||Vr.info,arguments,yh)}table(e,r,n){return r?this._getLogFunction(e,r,console.table||Ot,n&&[n],{tag:YB(r)}):Ot}image(e){let{logLevel:r,priority:n,image:o,message:s="",scale:i=1}=e;return this._shouldLog(r||n)?Jt()?ZB({image:o,message:s,scale:i}):XB({image:o,message:s,scale:i}):Ot}time(e,r){return this._getLogFunction(e,r,console.time?console.time:console.info)}timeEnd(e,r){return this._getLogFunction(e,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,r){return this._getLogFunction(e,r,console.timeStamp||Ot)}group(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},o=Ch({logLevel:e,message:r,opts:n}),{collapsed:s}=n;return o.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}groupCollapsed(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(e,r,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||Ot)}withGroup(e,r,n){this.group(e,r)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=Th(e)}_getLogFunction(e,r,n,o,s){if(this._shouldLog(e)){s=Ch({logLevel:e,message:r,args:o,opts:s}),n=n||s.method,Qr(n),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=We();let i=s.tag||s.message;if(s.once&&i)if(!_h[i])_h[i]=We();else return Ot;return r=KB(this.id,s.message,s),n.bind(console,r,...s.args)}return Ot}};Un.VERSION=ss;function Th(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return Qr(Number.isFinite(e)&&e>=0),e}function Ch(t){let{logLevel:e,message:r}=t;t.logLevel=Th(e);let n=t.args?Array.from(t.args):[];for(;n.length&&n.shift()!==r;);switch(typeof e){case"string":case"function":r!==void 0&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e);break;default:}typeof t.message=="function"&&(t.message=t.message());let o=typeof t.message;return Qr(o==="string"||o==="object"),Object.assign(t,{args:n},t.opts)}function KB(t,e,r){if(typeof e=="string"){let n=r.time?gh(ph(r.total)):"";e=r.time?"".concat(t,": ").concat(n," ").concat(e):"".concat(t,": ").concat(e),e=xh(e,r.color,r.background)}return e}function XB(t){let{image:e,message:r="",scale:n=1}=t;return console.warn("removed"),Ot}function ZB(t){let{image:e,message:r="",scale:n=1}=t;if(typeof e=="string"){let s=new Image;return s.onload=()=>{let i=as(s,r,n);console.log(...i)},s.src=e,Ot}let o=e.nodeName||"";if(o.toLowerCase()==="img")return console.log(...as(e,r,n)),Ot;if(o.toLowerCase()==="canvas"){let s=new Image;return s.onload=()=>console.log(...as(s,r,n)),s.src=e.toDataURL(),Ot}return Ot}function YB(t){for(let e in t)for(let r in t[e])return r||"untitled";return"empty"}var Ta=new Un({id:"@probe.gl/log"});var Lt=null;try{Lt=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function W(t,e,r){this.low=t|0,this.high=e|0,this.unsigned=!!r}W.prototype.__isLong__;Object.defineProperty(W.prototype,"__isLong__",{value:!0});function ut(t){return(t&&t.__isLong__)===!0}function bh(t){var e=Math.clz32(t&-t);return t?31-e:e}W.isLong=ut;var Mh={},wh={};function qe(t,e){var r,n,o;return e?(t>>>=0,(o=0<=t&&t<256)&&(n=wh[t],n)?n:(r=V(t,0,!0),o&&(wh[t]=r),r)):(t|=0,(o=-128<=t&&t<128)&&(n=Mh[t],n)?n:(r=V(t,t<0?-1:0,!1),o&&(Mh[t]=r),r))}W.fromInt=qe;function vt(t,e){if(isNaN(t))return e?de:zt;if(e){if(t<0)return de;if(t>=Rh)return Lh}else{if(t<=-Sh)return yt;if(t+1>=Sh)return Oh}return t<0?vt(-t,e).neg():V(t%Kr|0,t/Kr|0,e)}W.fromNumber=vt;function V(t,e,r){return new W(t,e,r)}W.fromBits=V;var fs=Math.pow;function Ma(t,e,r){if(t.length===0)throw Error("empty string");if(typeof e=="number"?(r=e,e=!1):e=!!e,t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return e?de:zt;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return Ma(t.substring(1),e,r).neg();for(var o=vt(fs(r,8)),s=zt,i=0;i<t.length;i+=8){var a=Math.min(8,t.length-i),f=parseInt(t.substring(i,i+a),r);if(a<8){var c=vt(fs(r,a));s=s.mul(c).add(vt(f))}else s=s.mul(o),s=s.add(vt(f))}return s.unsigned=e,s}W.fromString=Ma;function Qt(t,e){return typeof t=="number"?vt(t,e):typeof t=="string"?Ma(t,e):V(t.low,t.high,typeof e=="boolean"?e:t.unsigned)}W.fromValue=Qt;var Ih=1<<16,WB=1<<24,Kr=Ih*Ih,Rh=Kr*Kr,Sh=Rh/2,Fh=qe(WB),zt=qe(0);W.ZERO=zt;var de=qe(0,!0);W.UZERO=de;var jr=qe(1);W.ONE=jr;var Dh=qe(1,!0);W.UONE=Dh;var ba=qe(-1);W.NEG_ONE=ba;var Oh=V(-1,2147483647,!1);W.MAX_VALUE=Oh;var Lh=V(-1,-1,!0);W.MAX_UNSIGNED_VALUE=Lh;var yt=V(0,-2147483648,!1);W.MIN_VALUE=yt;var L=W.prototype;L.toInt=function(){return this.unsigned?this.low>>>0:this.low};L.toNumber=function(){return this.unsigned?(this.high>>>0)*Kr+(this.low>>>0):this.high*Kr+(this.low>>>0)};L.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(yt)){var r=vt(e),n=this.div(r),o=n.mul(r).sub(this);return n.toString(e)+o.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var s=vt(fs(e,6),this.unsigned),i=this,a="";;){var f=i.div(s),c=i.sub(f.mul(s)).toInt()>>>0,l=c.toString(e);if(i=f,i.isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}};L.getHighBits=function(){return this.high};L.getHighBitsUnsigned=function(){return this.high>>>0};L.getLowBits=function(){return this.low};L.getLowBitsUnsigned=function(){return this.low>>>0};L.getNumBitsAbs=function(){if(this.isNegative())return this.eq(yt)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,r=31;r>0&&!(e&1<<r);r--);return this.high!=0?r+33:r+1};L.isZero=function(){return this.high===0&&this.low===0};L.eqz=L.isZero;L.isNegative=function(){return!this.unsigned&&this.high<0};L.isPositive=function(){return this.unsigned||this.high>=0};L.isOdd=function(){return(this.low&1)===1};L.isEven=function(){return(this.low&1)===0};L.equals=function(e){return ut(e)||(e=Qt(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low};L.eq=L.equals;L.notEquals=function(e){return!this.eq(e)};L.neq=L.notEquals;L.ne=L.notEquals;L.lessThan=function(e){return this.comp(e)<0};L.lt=L.lessThan;L.lessThanOrEqual=function(e){return this.comp(e)<=0};L.lte=L.lessThanOrEqual;L.le=L.lessThanOrEqual;L.greaterThan=function(e){return this.comp(e)>0};L.gt=L.greaterThan;L.greaterThanOrEqual=function(e){return this.comp(e)>=0};L.gte=L.greaterThanOrEqual;L.ge=L.greaterThanOrEqual;L.compare=function(e){if(ut(e)||(e=Qt(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1};L.comp=L.compare;L.negate=function(){return!this.unsigned&&this.eq(yt)?yt:this.not().add(jr)};L.neg=L.negate;L.add=function(e){ut(e)||(e=Qt(e));var r=this.high>>>16,n=this.high&65535,o=this.low>>>16,s=this.low&65535,i=e.high>>>16,a=e.high&65535,f=e.low>>>16,c=e.low&65535,l=0,h=0,u=0,d=0;return d+=s+c,u+=d>>>16,d&=65535,u+=o+f,h+=u>>>16,u&=65535,h+=n+a,l+=h>>>16,h&=65535,l+=r+i,l&=65535,V(u<<16|d,l<<16|h,this.unsigned)};L.subtract=function(e){return ut(e)||(e=Qt(e)),this.add(e.neg())};L.sub=L.subtract;L.multiply=function(e){if(this.isZero())return this;if(ut(e)||(e=Qt(e)),Lt){var r=Lt.mul(this.low,this.high,e.low,e.high);return V(r,Lt.get_high(),this.unsigned)}if(e.isZero())return this.unsigned?de:zt;if(this.eq(yt))return e.isOdd()?yt:zt;if(e.eq(yt))return this.isOdd()?yt:zt;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(Fh)&&e.lt(Fh))return vt(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,o=this.high&65535,s=this.low>>>16,i=this.low&65535,a=e.high>>>16,f=e.high&65535,c=e.low>>>16,l=e.low&65535,h=0,u=0,d=0,A=0;return A+=i*l,d+=A>>>16,A&=65535,d+=s*l,u+=d>>>16,d&=65535,d+=i*c,u+=d>>>16,d&=65535,u+=o*l,h+=u>>>16,u&=65535,u+=s*c,h+=u>>>16,u&=65535,u+=i*f,h+=u>>>16,u&=65535,h+=n*l+o*c+s*f+i*a,h&=65535,V(d<<16|A,h<<16|u,this.unsigned)};L.mul=L.multiply;L.divide=function(e){if(ut(e)||(e=Qt(e)),e.isZero())throw Error("division by zero");if(Lt){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var r=(this.unsigned?Lt.div_u:Lt.div_s)(this.low,this.high,e.low,e.high);return V(r,Lt.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?de:zt;var n,o,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return de;if(e.gt(this.shru(1)))return Dh;s=de}else{if(this.eq(yt)){if(e.eq(jr)||e.eq(ba))return yt;if(e.eq(yt))return jr;var i=this.shr(1);return n=i.div(e).shl(1),n.eq(zt)?e.isNegative()?jr:ba:(o=this.sub(e.mul(n)),s=n.add(o.div(e)),s)}else if(e.eq(yt))return this.unsigned?de:zt;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=zt}for(o=this;o.gte(e);){n=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),f=a<=48?1:fs(2,a-48),c=vt(n),l=c.mul(e);l.isNegative()||l.gt(o);)n-=f,c=vt(n,this.unsigned),l=c.mul(e);c.isZero()&&(c=jr),s=s.add(c),o=o.sub(l)}return s};L.div=L.divide;L.modulo=function(e){if(ut(e)||(e=Qt(e)),Lt){var r=(this.unsigned?Lt.rem_u:Lt.rem_s)(this.low,this.high,e.low,e.high);return V(r,Lt.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))};L.mod=L.modulo;L.rem=L.modulo;L.not=function(){return V(~this.low,~this.high,this.unsigned)};L.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};L.clz=L.countLeadingZeros;L.countTrailingZeros=function(){return this.low?bh(this.low):bh(this.high)+32};L.ctz=L.countTrailingZeros;L.and=function(e){return ut(e)||(e=Qt(e)),V(this.low&e.low,this.high&e.high,this.unsigned)};L.or=function(e){return ut(e)||(e=Qt(e)),V(this.low|e.low,this.high|e.high,this.unsigned)};L.xor=function(e){return ut(e)||(e=Qt(e)),V(this.low^e.low,this.high^e.high,this.unsigned)};L.shiftLeft=function(e){return ut(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?V(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):V(0,this.low<<e-32,this.unsigned)};L.shl=L.shiftLeft;L.shiftRight=function(e){return ut(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?V(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):V(this.high>>e-32,this.high>=0?0:-1,this.unsigned)};L.shr=L.shiftRight;L.shiftRightUnsigned=function(e){return ut(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?V(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):e===32?V(this.high,0,this.unsigned):V(this.high>>>e-32,0,this.unsigned)};L.shru=L.shiftRightUnsigned;L.shr_u=L.shiftRightUnsigned;L.rotateLeft=function(e){var r;return ut(e)&&(e=e.toInt()),(e&=63)===0?this:e===32?V(this.high,this.low,this.unsigned):e<32?(r=32-e,V(this.low<<e|this.high>>>r,this.high<<e|this.low>>>r,this.unsigned)):(e-=32,r=32-e,V(this.high<<e|this.low>>>r,this.low<<e|this.high>>>r,this.unsigned))};L.rotl=L.rotateLeft;L.rotateRight=function(e){var r;return ut(e)&&(e=e.toInt()),(e&=63)===0?this:e===32?V(this.high,this.low,this.unsigned):e<32?(r=32-e,V(this.high<<r|this.low>>>e,this.low<<r|this.high>>>e,this.unsigned)):(e-=32,r=32-e,V(this.low<<r|this.high>>>e,this.high<<r|this.low>>>e,this.unsigned))};L.rotr=L.rotateRight;L.toSigned=function(){return this.unsigned?V(this.low,this.high,!1):this};L.toUnsigned=function(){return this.unsigned?this:V(this.low,this.high,!0)};L.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()};L.toBytesLE=function(){var e=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]};L.toBytesBE=function(){var e=this.high,r=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};W.fromBytes=function(e,r,n){return n?W.fromBytesLE(e,r):W.fromBytesBE(e,r)};W.fromBytesLE=function(e,r){return new W(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r)};W.fromBytesBE=function(e,r){return new W(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],r)};var Xr=W;var qB=16;function Pn(t){t==="X"&&(t="");let e=t.padEnd(qB,"0");return Xr.fromString(e,!0,16)}function wa(t){if(t.isZero())return"X";let e=t.countTrailingZeros(),r=e%4;e=(e-r)/4;let n=e;e*=4;let s=t.shiftRightUnsigned(e).toString(16).replace(/0+$/,"");return Array(17-n-s.length).join("0")+s}function Ia(t,e){let r=$B(t).shiftRightUnsigned(2);return t.add(Xr.fromNumber(2*e+1-4).multiply(r))}function $B(t){return t.and(t.not().add(1))}var tx=3,ex=30,rx=2*ex+1,vh=180/Math.PI;function Nh(t){if(t.length===0)throw new Error(`Invalid Hilbert quad key ${t}`);let e=t.split("/"),r=parseInt(e[0],10),n=e[1],o=n.length,s=0,i=[0,0];for(let a=o-1;a>=0;a--){s=o-a;let f=n[a],c=0,l=0;f==="1"?l=1:f==="2"?(c=1,l=1):f==="3"&&(c=1);let h=Math.pow(2,s-1);nx(h,i,c,l),i[0]+=h*c,i[1]+=h*l}if(r%2===1){let a=i[0];i[0]=i[1],i[1]=a}return{face:r,ij:i,level:s}}function Uh(t){if(t.isZero())return"";let e=t.toString(2);for(;e.length<tx+rx;)e="0"+e;let r=e.lastIndexOf("1"),n=e.substring(0,3),o=e.substring(3,r),s=o.length/2,i=Xr.fromString(n,!0,2).toString(10),a="";if(s!==0)for(a=Xr.fromString(o,!0,2).toString(4);a.length<s;)a="0"+a;return`${i}/${a}`}function Sa(t,e,r){let n=1<<e;return[(t[0]+r[0])/n,(t[1]+r[1])/n]}function Gh(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function Fa(t){return[Gh(t[0]),Gh(t[1])]}function Ra(t,[e,r]){switch(t){case 0:return[1,e,r];case 1:return[-e,1,r];case 2:return[-e,-r,1];case 3:return[-1,-r,-e];case 4:return[r,-1,-e];case 5:return[r,e,-1];default:throw new Error("Invalid face")}}function Da([t,e,r]){let n=Math.atan2(r,Math.sqrt(t*t+e*e));return[Math.atan2(e,t)*vh,n*vh]}function nx(t,e,r,n){if(n===0){r===1&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);let o=e[0];e[0]=e[1],e[1]=o}}function Ph(t){let e=Sa(t.ij,t.level,[.5,.5]),r=Fa(e),n=Ra(t.face,r);return Da(n)}var ox=100;function Oa(t){let{face:e,ij:r,level:n}=t,o=[[0,0],[0,1],[1,1],[1,0],[0,0]],s=Math.max(1,Math.ceil(ox*Math.pow(2,-n))),i=new Float64Array(4*s*2+2),a=0,f=0;for(let c=0;c<4;c++){let l=o[c].slice(0),h=o[c+1],u=(h[0]-l[0])/s,d=(h[1]-l[1])/s;for(let A=0;A<s;A++){l[0]+=u,l[1]+=d;let m=Sa(r,n,l),p=Fa(m),E=Ra(e,p),y=Da(E);Math.abs(y[1])>89.999&&(y[0]=f);let T=y[0]-f;y[0]+=T>180?-360:T<-180?360:0,i[a++]=y[0],i[a++]=y[1],f=y[0]}}return i[a++]=i[0],i[a++]=i[1],i}function Zr(t){let e=sx(t);return Nh(e)}function sx(t){if(t.indexOf("/")>0)return t;let e=Pn(t);return Uh(e)}function La(t){let e=Zr(t);return Ph(e)}function kh(t){let e;if(t.face===2||t.face===5){let r=null,n=0;for(let o=0;o<4;o++){let s=`${t.face}/${o}`,i=Zr(s),a=Oa(i);(typeof r>"u"||r===null)&&(r=new Float64Array(4*a.length)),r.set(a,n),n+=a.length}e=Hh(r)}else{let r=Oa(t);e=Hh(r)}return e}function Hh(t){if(t.length%2!==0)throw new Error("Invalid corners");let e=[],r=[];for(let n=0;n<t.length;n+=2)e.push(t[n]),r.push(t[n+1]);return e.sort((n,o)=>n-o),r.sort((n,o)=>n-o),{west:e[0],east:e[e.length-1],north:r[r.length-1],south:r[0]}}function va(t,e){let r=e?.minimumHeight||0,n=e?.maximumHeight||0,o=Zr(t),s=kh(o),i=s.west,a=s.south,f=s.east,c=s.north,l=[];return l.push(new M(i,c,r)),l.push(new M(f,c,r)),l.push(new M(f,a,r)),l.push(new M(i,a,r)),l.push(new M(i,c,n)),l.push(new M(f,c,n)),l.push(new M(f,a,n)),l.push(new M(i,a,n)),l}function ls(t){let e=t.token,r={minimumHeight:t.minimumHeight,maximumHeight:t.maximumHeight},n=va(e,r),o=La(e),s=o[0],i=o[1],a=ce.WGS84.cartographicToCartesian([s,i,r.maximumHeight]),f=new M(a[0],a[1],a[2]);n.push(f);let c=Ii(n);return[...c.center,...c.halfAxes]}var ix=4,ax=8,cx={QUADTREE:ix,OCTREE:ax};function fx(t,e,r){if(t?.box){let n=Pn(t.s2VolumeInfo.token),o=Ia(n,e),s=wa(o),i={...t.s2VolumeInfo};switch(i.token=s,r){case"OCTREE":let c=t.s2VolumeInfo,l=c.maximumHeight-c.minimumHeight,h=l/2,u=c.minimumHeight+l/2;c.minimumHeight=u-h,c.maximumHeight=u+h;break;default:break}return{box:ls(i),s2VolumeInfo:i}}}async function Na(t){let{subtree:e,subtreeData:r={level:0,x:0,y:0,z:0},parentData:n={mortonIndex:0,localLevel:-1,localX:0,localY:0,localZ:0},childIndex:o=0,implicitOptions:s,loaderOptions:i,s2VolumeBox:a}=t,{subdivisionScheme:f,subtreeLevels:c,maximumLevel:l,contentUrlTemplate:h,subtreesUriTemplate:u,basePath:d}=s,A={children:[],lodMetricValue:0,contentUrl:""};if(!l)return Ta.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${h} won't be loaded...`),A;let m=n.localLevel+1,p=r.level+m;if(p>l)return A;let E=cx[f],y=Math.log2(E),T=o&1,b=o>>1&1,C=o>>2&1,w=$e(n.localX,T,1),I=$e(n.localY,b,1),O=$e(n.localZ,C,1),B=$e(r.x,w,m),g=$e(r.y,I,m),x=$e(r.z,O,m),_=$e(n.mortonIndex,o,y),U=m===c&&Ga(e.childSubtreeAvailability,_),N,P,v,tt;if(U){let ie=`${d}/${u}`,ln=hs(ie,p,B,g,x);N=await(0,Jh.load)(ln,Jr,i),tt=0,P={level:p,x:B,y:g,z:x},v={mortonIndex:0,localLevel:0,localX:0,localY:0,localZ:0}}else N=e,tt=(E**m-1)/(E-1)+_,P=r,v={mortonIndex:_,localLevel:m,localX:w,localY:I,localZ:O};if(!Ga(N.tileAvailability,tt))return A;Ga(N.contentAvailability,tt)&&(A.contentUrl=hs(h,p,B,g,x));for(let ie=0;ie<E;ie++){let ln=fx(a,ie,f),Ar=await Na({subtree:N,subtreeData:P,parentData:v,childIndex:ie,implicitOptions:s,loaderOptions:i,s2VolumeBox:ln});(Ar.contentUrl||Ar.children.length)&&A.children.push(Ar)}return A.contentUrl||A.children.length?lx(A,{level:p,x:B,y:g,z:x},s,a):A}function Ga(t,e){let r;return Array.isArray(t)?(r=t[0],t.length>1&&Ta.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=t,"constant"in r?Boolean(r.constant):r.explicitBitstream?dx(e,r.explicitBitstream):!1}function lx(t,e,r,n){let{basePath:o,refine:s,getRefine:i,lodMetricType:a,getTileType:f,rootLodMetricValue:c,rootBoundingVolume:l}=r,h=t.contentUrl&&t.contentUrl.replace(`${o}/`,""),u=c/2**e.level,d=n?.box?{box:n.box}:l,A=hx(d,e,r.subdivisionScheme);return{children:t.children,contentUrl:t.contentUrl,content:{uri:h},id:t.contentUrl,refine:i(s),type:f(t),lodMetricType:a,lodMetricValue:u,geometricError:u,transform:t.transform,boundingVolume:A}}function hx(t,e,r){if(t.region){let{level:n,x:o,y:s,z:i}=e,[a,f,c,l,h,u]=t.region,d=2**n,A=(c-a)/d,[m,p]=[a+A*o,a+A*(o+1)],E=(l-f)/d,[y,T]=[f+E*s,f+E*(s+1)],b,C;if(r==="OCTREE"){let w=(u-h)/d;[b,C]=[h+w*i,h+w*(i+1)]}else[b,C]=[h,u];return{region:[m,y,p,T,b,C]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${JSON.stringify(t)}`)}function $e(t,e,r){return(t<<r)+e}function hs(t,e,r,n,o){let s=ux({level:e,x:r,y:n,z:o});return t.replace(/{level}|{x}|{y}|{z}/gi,i=>s[i])}function ux(t){let e={};for(let r in t)e[`{${r}}`]=t[r];return e}function dx(t,e){let r=Math.floor(t/8),n=t%8;return(e[r]>>n&1)===1}function Pa(t,e=""){if(!e)return Me.EMPTY;let n=e.split("?")[0].split(".").pop();switch(n){case"pnts":return Me.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return Me.SCENEGRAPH;default:return n||Me.EMPTY}}function Ha(t){switch(t){case"REPLACE":case"replace":return Ir.REPLACE;case"ADD":case"add":return Ir.ADD;default:return t}}function Ua(t,e){if(/^[a-z][0-9a-z+.-]*:/i.test(e)){let n=new URL(t,`${e}/`);return decodeURI(n.toString())}else if(t.startsWith("/"))return t;return _r.resolve(e,t)}function zh(t,e){if(!t)return null;let r;if(t.content){let o=t.content.uri||t.content?.url;typeof o<"u"&&(r=Ua(o,e))}return{...t,id:r,contentUrl:r,lodMetricType:he.GEOMETRIC_ERROR,lodMetricValue:t.geometricError,transformMatrix:t.transform,type:Pa(t,r),refine:Ha(t.refine)}}async function Kh(t,e,r){let n=null,o=Vh(t.root);o&&t.root?n=await Qh(t.root,t,e,o,r):n=zh(t.root,e);let s=[];for(s.push(n);s.length>0;){let i=s.pop()||{},a=i.children||[],f=[];for(let c of a){let l=Vh(c),h;l?h=await Qh(c,t,e,l,r):h=zh(c,e),h&&(f.push(h),s.push(h))}i.children=f}return n}async function Qh(t,e,r,n,o){let{subdivisionScheme:s,maximumLevel:i,availableLevels:a,subtreeLevels:f,subtrees:{uri:c}}=n,l=hs(c,0,0,0,0),h=Ua(l,r),u=await(0,jh.load)(h,Jr,o),d=t.content?.uri,A=d?Ua(d,r):"",m=e?.root?.refine,p=t.geometricError,E=t.boundingVolume.extensions?.["3DTILES_bounding_volume_S2"];if(E){let C={box:ls(E),s2VolumeInfo:E};t.boundingVolume=C}let y=t.boundingVolume,T={contentUrlTemplate:A,subtreesUriTemplate:c,subdivisionScheme:s,subtreeLevels:f,maximumLevel:Number.isFinite(a)?a-1:i,refine:m,basePath:r,lodMetricType:he.GEOMETRIC_ERROR,rootLodMetricValue:p,rootBoundingVolume:y,getTileType:Pa,getRefine:Ha};return await Ax(t,r,u,T,o)}async function Ax(t,e,r,n,o){if(!t)return null;let{children:s,contentUrl:i}=await Na({subtree:r,implicitOptions:n,loaderOptions:o}),a,f=null;return i&&(a=i,f={uri:i.replace(`${e}/`,"")}),{...t,id:a,contentUrl:a,lodMetricType:he.GEOMETRIC_ERROR,lodMetricValue:t.geometricError,transformMatrix:t.transform,type:Pa(t,a),refine:Ha(t.refine),content:f||t.content,children:s}}function Vh(t){return t?.extensions?.["3DTILES_implicit_tiling"]||t?.implicitTiling}var tr={dataType:null,batchType:null,id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:Sr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:mx,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function mx(t,e={},r){let n=e["3d-tiles"]||{},o;return n.isTileset==="auto"?o=r?.url&&r.url.indexOf(".json")!==-1:o=n.isTileset,o?px(t,e,r):gx(t,e,r)}async function px(t,e,r){let n=JSON.parse(new TextDecoder().decode(t)),o=r?.url||"",s=Bx(o),i=await Kh(n,s,e||{});return{...n,shape:"tileset3d",loader:tr,url:o,queryString:r?.queryString||"",basePath:s,root:i||n.root,type:In.TILES3D,lodMetricType:he.GEOMETRIC_ERROR,lodMetricValue:n.root?.geometricError||0}}async function gx(t,e,r){let n={content:{shape:"tile3d",featureIds:null}};return await _a(t,0,e,r,n.content),n.content}function Bx(t){return _r.dirname(t)}var us=mr(un(),1);var Xh="https://api.cesium.com/v1/assets";async function ds(t,e){if(!e){let s=await xx(t);for(let i of s.items)i.type==="3DTILES"&&(e=i.id)}let r=await Ex(t,e),{type:n,url:o}=r;return z(n==="3DTILES"&&o),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function xx(t){z(t);let e=Xh,r={Authorization:`Bearer ${t}`},n=await(0,us.fetchFile)(e,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function Ex(t,e){z(t,e);let r={Authorization:`Bearer ${t}`},n=`${Xh}/${e}`,o=await(0,us.fetchFile)(`${n}`,{headers:r});if(!o.ok)throw new Error(o.statusText);let s=await o.json();if(o=await(0,us.fetchFile)(`${n}/endpoint`,{headers:r}),!o.ok)throw new Error(o.statusText);let i=await o.json();return s={...s,...i},s}async function _x(t,e={}){e=e["cesium-ion"]||{};let{accessToken:r}=e,n=e.assetId;if(!Number.isFinite(n)){let o=t.match(/\/([0-9]+)\/tileset.json/);n=o&&o[1]}return ds(r,n)}var ka={...tr,id:"cesium-ion",name:"Cesium Ion",preload:_x,parse:async(t,e,r)=>(e={...e},e["3d-tiles"]=e["cesium-ion"],e.loader=ka,tr.parse(t,e,r)),options:{"cesium-ion":{...tr.options["3d-tiles"],accessToken:null}}};var Hn=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 s=o;o-=BigInt(1024),o=o>=0n?o:0n;let i=new Uint8Array(await t.slice(o,s));for(let a=i.length-1;a>-1;a--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=i[a],r.every((f,c)=>f===e[c])){n=a;break}}while(n===-1&&o>0n);return o+BigInt(n)};var Zh=new Uint8Array([80,75,5,6]),Yh=new Uint8Array([80,75,6,7]),Wh=new Uint8Array([80,75,6,6]),yx=8n;var Cx=12n,Tx=16n;var bx=8n,Mx=24n;var wx=40n,Ix=48n;var qh=async t=>{let e=await Hn(t,Zh),r=BigInt(await t.getUint16(e+yx)),n=BigInt(await t.getUint32(e+Cx)),o=BigInt(await t.getUint32(e+Tx)),s=e-20n,i=0n,a=await t.slice(s,s+4n);if(xe(a,Yh)){i=await t.getBigUint64(s+bx);let f=await t.slice(i,i+4n);if(!xe(f,Wh.buffer))throw new Error("zip64 EoCD not found");r=await t.getBigUint64(i+Mx),n=await t.getBigUint64(i+wx),o=await t.getBigUint64(i+Ix)}else s=0n;return{cdRecordsNumber:r,cdStartOffset:o,cdByteSize:n,offsets:{zip64EoCDOffset:i,zip64EoCDLocatorOffset:s,zipEoCDOffset:e}}};var HF=[{offset:0,size:4,default:new DataView(Zh.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 kF=[{offset:0,size:4,default:new DataView(Yh.buffer).getUint32(0,!0)},{offset:4,size:4,default:0},{offset:8,size:8,name:"eoCDStart"},{offset:16,size:4,default:1}],JF=[{offset:0,size:4,default:new DataView(Wh.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 Sx=20,Fx=24,Rx=28,Dx=30,Ox=32,Lx=42,As=46n,Jn=new Uint8Array([80,75,1,2]),kn=async(t,e)=>{if(t>=e.length)return null;let r=new DataView(await e.slice(t,t+As)),n=r.buffer.slice(0,4);if(!xe(n,Jn.buffer))return null;let o=BigInt(r.getUint32(Sx,!0)),s=BigInt(r.getUint32(Fx,!0)),i=r.getUint16(Dx,!0),a=BigInt(r.getUint16(Ox,!0)),f=r.getUint16(Rx,!0),c=await e.slice(t+As,t+As+BigInt(f+i)),l=c.slice(0,f),h=new TextDecoder().decode(l),u=t+As+BigInt(f),d=r.getUint32(Lx,!0),A=BigInt(d),m=new DataView(c.slice(f,c.byteLength)),p={uncompressedSize:s,compressedSize:o,localHeaderOffset:A,startDisk:a},E=vx(p,m);return{...p,...E,extraFieldLength:i,fileNameLength:f,fileName:h,extraOffset:u}};async function*Yr(t){let{cdStartOffset:e,cdByteSize:r}=await qh(t),n=new He(new DataView(await t.slice(e,e+r))),o=await kn(0n,n);for(;o;)yield o,o=await kn(o.extraOffset+BigInt(o.extraFieldLength),n)}var $h=(...t)=>t[0]+t[1]*16,vx=(t,e)=>{let r=Gx(t),n={};if(r.length>0){let o=r.reduce((a,f)=>a+f.length,0),s=new Uint8Array(e.buffer).findIndex((a,f,c)=>$h(c[f],c[f+1])===1&&$h(c[f+2],c[f+3])===o),i=0;for(let a of r){let f=i;n[a.name]=e.getBigUint64(s+4+f,!0),i=f+a.length}}return n},Gx=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 jF=[{offset:0,size:4,default:new DataView(Jn.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 Nx=8,Ux=18,Px=22,Hx=26,kx=28,ms=30n,Ja=new Uint8Array([80,75,3,4]),er=async(t,e)=>{let r=new DataView(await e.slice(t,t+ms)),n=r.buffer.slice(0,4);if(!xe(n,Ja))return null;let o=r.getUint16(Hx,!0),s=r.getUint16(kx,!0),i=await e.slice(t+ms,t+ms+BigInt(o+s)),a=i.slice(0,o),f=new DataView(i.slice(o,i.byteLength)),c=new TextDecoder().decode(a).split("\\").join("/"),l=t+ms+BigInt(o+s),h=r.getUint16(Nx,!0),u=BigInt(r.getUint32(Ux,!0)),d=BigInt(r.getUint32(Px,!0)),A=4;return d===BigInt(4294967295)&&(d=f.getBigUint64(A,!0),A+=8),u===BigInt(4294967295)&&(u=f.getBigUint64(A,!0),A+=8),l===BigInt(4294967295)&&(l=f.getBigUint64(A,!0)),{fileNameLength:o,fileName:c,extraFieldLength:s,fileDataOffset:l,compressedSize:u,compressionMethod:h}};var ZF=[{offset:0,size:4,default:new DataView(Ja.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 ps=class{constructor(e={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(e,r="base64"){let n=[];for await(let i of e)n.push(i),yield i;let o=await this.concatenate(n),s=await this.hash(o,r);this.options.crypto?.onEnd?.({hash:s})}async concatenate(e){return await mn(e)}};function tu(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+=Jx(n[o])}return e}function Jx(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 eu(t,e){switch(e){case"hex":return t;case"base64":return zx(t);default:throw new Error(e)}}function zx(t){t.length%2!==0&&(t=`0${t}`);let r=(t.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return tu(r)||""}var nu=typeof atob=="function"?atob:typeof Buffer=="function"?Yx:su,Qx=nu("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALB7oCJQhvbmVGdWxsQQAYCG9uZUZ1bGxCABkIb25lRnVsbEMAGghvbmVGdWxsRAAbBWxvb3BzAAEEbG9vcAACBXByaW1lAAMFbG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CAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),za=WebAssembly&&nu!==su?Zx(Qx).buffer:!1,te=Wx(),Qa=240*16*16,ou=Math.floor(Qa*16*1.066666667),Vx=268435456-65536,ru="Parameter must be Buffer, ArrayBuffer or Uint8Array",jx="Parameter exceeds max size of 255.9 Mbytes";za||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function Va(t){var e,r,n,o,s,i,a,f,c,l;let h=Xx(),u=Kx(),d={},A=new Date().getTime();return d.then=function(y){return a=y,p(),d},d.catch=function(y){return f=y,d},t&&typeof t=="object"?typeof Buffer=="function"&&t.constructor===Buffer?i=t:t.constructor===Uint8Array||t.constructor===ArrayBuffer?i=t.constructor===ArrayBuffer?new Uint8Array(t):t:E(new TypeError(ru)):E(new TypeError(ru)),i&&(s=i.length,za&&s>ou?s>Vx?E(new Error(jx)):(e=new WebAssembly.Memory({initial:s>32e6?s>64e6?s>128e6?4096:2048:1024:512}),r=new Uint32Array(e.buffer),o={mem:e,log:console.log},n={imports:o},WebAssembly.instantiate(za,n).then(m)):p(h(i))),d;function m(y){p(u(i,y.instance.exports,r))}function p(y){var T=Boolean(y)?y:c;Boolean(y)&&(l=new Date().getTime()),typeof a=="function"?Boolean(T)&&(a(T,l-A),a=f=null):Boolean(y)&&(c=y)}function E(y){typeof f=="function"&&f(y)}}function Kx(){var t,e,r,n,o,s,i,a,f,c,l,h,u,d=function(A){var m,p,E,y,T,b,C,w,I,O,B,g,x,_,U,N,P,v,tt,pt,Y,ie,ln=new Date().getTime(),Ar=0,S=1732584193,F=-271733879,R=-1732584194,D=271733878,et=0,hn=A.length*8,ao;for(ao=r0(A,u),u[hn>>>5]|=128<<hn%32,u[(hn+64>>>9<<4)+14]=hn,ao=(hn+64>>>9<<4)+15,Y=u;et<ao;)ao>et+ou?(n(S),s(F),a(R),c(D),e(Qa),et=et+Qa*16,S=r(),F=o(),R=i(),D=f(),Ar++):(P=S,v=F,tt=R,pt=D,m=Y[et+0]>>>0,p=Y[et+1]>>>0,E=Y[et+2]>>>0,y=Y[et+3]>>>0,T=Y[et+4]>>>0,b=Y[et+5]>>>0,C=Y[et+6]>>>0,w=Y[et+7]>>>0,I=Y[et+8]>>>0,O=Y[et+9]>>>0,B=Y[et+10]>>>0,g=Y[et+11]>>>0,x=Y[et+12]>>>0,_=Y[et+13]>>>0,U=Y[et+14]>>>0,N=Y[et+15]>>>0,S=G(7,25,S+(F&R|~F&D)+m-680876936)+F,D=G(12,20,D+(S&F|~S&R)+p-389564586)+S,R=G(17,15,R+(D&S|~D&F)+E+606105819)+D,F=G(22,10,F+(R&D|~R&S)+y-1044525330)+R,S=G(7,25,S+(F&R|~F&D)+T-176418897)+F,D=G(12,20,D+(S&F|~S&R)+b+1200080426)+S,R=G(17,15,R+(D&S|~D&F)+C-1473231341)+D,F=G(22,10,F+(R&D|~R&S)+w-45705983)+R,S=G(7,25,S+(F&R|~F&D)+I+1770035416)+F,D=G(12,20,D+(S&F|~S&R)+O-1958414417)+S,R=G(17,15,R+(D&S|~D&F)+B-42063)+D,F=G(22,10,F+(R&D|~R&S)+g-1990404162)+R,S=G(7,25,S+(F&R|~F&D)+x+1804603682)+F,D=G(12,20,D+(S&F|~S&R)+_-40341101)+S,R=G(17,15,R+(D&S|~D&F)+U-1502002290)+D,F=G(22,10,F+(R&D|~R&S)+N+1236535329)+R,S=G(5,27,S+(F&D|R&~D)+p-165796510)+F,D=G(9,23,D+(S&R|F&~R)+C-1069501632)+S,R=G(14,18,R+(D&F|S&~F)+g+643717713)+D,F=G(20,12,F+(R&S|D&~S)+m-373897302)+R,S=G(5,27,S+(F&D|R&~D)+b-701558691)+F,D=G(9,23,D+(S&R|F&~R)+B+38016083)+S,R=G(14,18,R+(D&F|S&~F)+N-660478335)+D,F=G(20,12,F+(R&S|D&~S)+T-405537848)+R,S=G(5,27,S+(F&D|R&~D)+O+568446438)+F,D=G(9,23,D+(S&R|F&~R)+U-1019803690)+S,R=G(14,18,R+(D&F|S&~F)+y-187363961)+D,F=G(20,12,F+(R&S|D&~S)+I+1163531501)+R,S=G(5,27,S+(F&D|R&~D)+_-1444681467)+F,D=G(9,23,D+(S&R|F&~R)+E-51403784)+S,R=G(14,18,R+(D&F|S&~F)+w+1735328473)+D,F=G(20,12,F+(R&S|D&~S)+x-1926607734)+R,S=G(4,28,S+(F^R^D)+b-378558)+F,D=G(11,21,D+(S^F^R)+I-2022574463)+S,R=G(16,16,R+(D^S^F)+g+1839030562)+D,F=G(23,9,F+(R^D^S)+U-35309556)+R,S=G(4,28,S+(F^R^D)+p-1530992060)+F,D=G(11,21,D+(S^F^R)+T+1272893353)+S,R=G(16,16,R+(D^S^F)+w-155497632)+D,F=G(23,9,F+(R^D^S)+B-1094730640)+R,S=G(4,28,S+(F^R^D)+_+681279174)+F,D=G(11,21,D+(S^F^R)+m-358537222)+S,R=G(16,16,R+(D^S^F)+y-722521979)+D,F=G(23,9,F+(R^D^S)+C+76029189)+R,S=G(4,28,S+(F^R^D)+O-640364487)+F,D=G(11,21,D+(S^F^R)+x-421815835)+S,R=G(16,16,R+(D^S^F)+N+530742520)+D,F=G(23,9,F+(R^D^S)+E-995338651)+R,S=G(6,26,S+(R^(F|~D))+m-198630844)+F,D=G(10,22,D+(F^(S|~R))+w+1126891415)+S,R=G(15,17,R+(S^(D|~F))+U-1416354905)+D,F=G(21,11,F+(D^(R|~S))+b-57434055)+R,S=G(6,26,S+(R^(F|~D))+x+1700485571)+F,D=G(10,22,D+(F^(S|~R))+y-1894986606)+S,R=G(15,17,R+(S^(D|~F))+B-1051523)+D,F=G(21,11,F+(D^(R|~S))+p-2054922799)+R,S=G(6,26,S+(R^(F|~D))+I+1873313359)+F,D=G(10,22,D+(F^(S|~R))+N-30611744)+S,R=G(15,17,R+(S^(D|~F))+C-1560198380)+D,F=G(21,11,F+(D^(R|~S))+_+1309151649)+R,S=G(6,26,S+(R^(F|~D))+T-145523070)+F,D=G(10,22,D+(F^(S|~R))+g-1120210379)+S,R=G(15,17,R+(S^(D|~F))+E+718787259)+D,F=G(21,11,F+(D^(R|~S))+O-343485551)+R,et=et+16,S=S+P>>>0,F=F+v>>>0,R=R+tt>>>0,D=D+pt>>>0);return te.endian([S,F,R,D]);function G(dt,co,Kt){return Kt<<dt|Kt>>>co}function r0(dt,co){for(var Kt=-1,Ls=Math.floor((dt.length-1)/4),gt=0,Fc,Rc,Dc,Oc;Ls-8>Kt++;)gt=Kt<<2,co[Kt]=dt[gt+0]|dt[gt+1]<<8|dt[gt+2]<<16|dt[gt+3]<<24;for(Kt--;Ls>Kt++;)gt=Kt<<2,Fc=typeof dt[gt+0]>"u"?0:dt[gt+0],Rc=typeof dt[gt+1]>"u"?0:dt[gt+1],Dc=typeof dt[gt+2]>"u"?0:dt[gt+2],Oc=typeof dt[gt+3]>"u"?0:dt[gt+3],co[Kt]=Fc|Rc<<8|Dc<<16|Oc<<24;return Ls+1}};return function(A,m,p,E){var y;return e=m.loops,t=m.loop,r=m.getA,o=m.getB,i=m.getC,f=m.getD,l=m.getX,n=m.setA,s=m.setB,a=m.setC,c=m.setD,h=m.setX,u=p,y=te.wordsToBytes(d(A)),E&&E.asBytes?y:te.bytesconvertNumberToHex(y)}}function Xx(){var t=function(e,r){var n,o,s,i,a,f,c,l,h,u,d,A,m,p,E,y,T,b,C,w,I,O=new Date().getTime(),B=1732584193,g=-271733879,x=-1732584194,_=271733878,U=e.length*8;I=te.bytesToWords(e);for(var N=0;N<I.length;N++)I[N]=(I[N]<<8|I[N]>>>24)&16711935|(I[N]<<24|I[N]>>>8)&4278255360;I[U>>>5]|=128<<U%32,I[(U+64>>>9<<4)+14]=U;for(var P=0;P<I.length;P+=16)T=B,b=g,C=x,w=_,n=I[P+0]>>>0,o=I[P+1]>>>0,s=I[P+2]>>>0,i=I[P+3]>>>0,a=I[P+4]>>>0,f=I[P+5]>>>0,c=I[P+6]>>>0,l=I[P+7]>>>0,h=I[P+8]>>>0,u=I[P+9]>>>0,d=I[P+10]>>>0,A=I[P+11]>>>0,m=I[P+12]>>>0,p=I[P+13]>>>0,E=I[P+14]>>>0,y=I[P+15]>>>0,B=v(7,25,B+(g&x|~g&_)+n-680876936)+g,_=v(12,20,_+(B&g|~B&x)+o-389564586)+B,x=v(17,15,x+(_&B|~_&g)+s+606105819)+_,g=v(22,10,g+(x&_|~x&B)+i-1044525330)+x,B=v(7,25,B+(g&x|~g&_)+a-176418897)+g,_=v(12,20,_+(B&g|~B&x)+f+1200080426)+B,x=v(17,15,x+(_&B|~_&g)+c-1473231341)+_,g=v(22,10,g+(x&_|~x&B)+l-45705983)+x,B=v(7,25,B+(g&x|~g&_)+h+1770035416)+g,_=v(12,20,_+(B&g|~B&x)+u-1958414417)+B,x=v(17,15,x+(_&B|~_&g)+d-42063)+_,g=v(22,10,g+(x&_|~x&B)+A-1990404162)+x,B=v(7,25,B+(g&x|~g&_)+m+1804603682)+g,_=v(12,20,_+(B&g|~B&x)+p-40341101)+B,x=v(17,15,x+(_&B|~_&g)+E-1502002290)+_,g=v(22,10,g+(x&_|~x&B)+y+1236535329)+x,B=v(5,27,B+(g&_|x&~_)+o-165796510)+g,_=v(9,23,_+(B&x|g&~x)+c-1069501632)+B,x=v(14,18,x+(_&g|B&~g)+A+643717713)+_,g=v(20,12,g+(x&B|_&~B)+n-373897302)+x,B=v(5,27,B+(g&_|x&~_)+f-701558691)+g,_=v(9,23,_+(B&x|g&~x)+d+38016083)+B,x=v(14,18,x+(_&g|B&~g)+y-660478335)+_,g=v(20,12,g+(x&B|_&~B)+a-405537848)+x,B=v(5,27,B+(g&_|x&~_)+u+568446438)+g,_=v(9,23,_+(B&x|g&~x)+E-1019803690)+B,x=v(14,18,x+(_&g|B&~g)+i-187363961)+_,g=v(20,12,g+(x&B|_&~B)+h+1163531501)+x,B=v(5,27,B+(g&_|x&~_)+p-1444681467)+g,_=v(9,23,_+(B&x|g&~x)+s-51403784)+B,x=v(14,18,x+(_&g|B&~g)+l+1735328473)+_,g=v(20,12,g+(x&B|_&~B)+m-1926607734)+x,B=v(4,28,B+(g^x^_)+f-378558)+g,_=v(11,21,_+(B^g^x)+h-2022574463)+B,x=v(16,16,x+(_^B^g)+A+1839030562)+_,g=v(23,9,g+(x^_^B)+E-35309556)+x,B=v(4,28,B+(g^x^_)+o-1530992060)+g,_=v(11,21,_+(B^g^x)+a+1272893353)+B,x=v(16,16,x+(_^B^g)+l-155497632)+_,g=v(23,9,g+(x^_^B)+d-1094730640)+x,B=v(4,28,B+(g^x^_)+p+681279174)+g,_=v(11,21,_+(B^g^x)+n-358537222)+B,x=v(16,16,x+(_^B^g)+i-722521979)+_,g=v(23,9,g+(x^_^B)+c+76029189)+x,B=v(4,28,B+(g^x^_)+u-640364487)+g,_=v(11,21,_+(B^g^x)+m-421815835)+B,x=v(16,16,x+(_^B^g)+y+530742520)+_,g=v(23,9,g+(x^_^B)+s-995338651)+x,B=v(6,26,B+(x^(g|~_))+n-198630844)+g,_=v(10,22,_+(g^(B|~x))+l+1126891415)+B,x=v(15,17,x+(B^(_|~g))+E-1416354905)+_,g=v(21,11,g+(_^(x|~B))+f-57434055)+x,B=v(6,26,B+(x^(g|~_))+m+1700485571)+g,_=v(10,22,_+(g^(B|~x))+i-1894986606)+B,x=v(15,17,x+(B^(_|~g))+d-1051523)+_,g=v(21,11,g+(_^(x|~B))+o-2054922799)+x,B=v(6,26,B+(x^(g|~_))+h+1873313359)+g,_=v(10,22,_+(g^(B|~x))+y-30611744)+B,x=v(15,17,x+(B^(_|~g))+c-1560198380)+_,g=v(21,11,g+(_^(x|~B))+p+1309151649)+x,B=v(6,26,B+(x^(g|~_))+a-145523070)+g,_=v(10,22,_+(g^(B|~x))+A-1120210379)+B,x=v(15,17,x+(B^(_|~g))+s+718787259)+_,g=v(21,11,g+(_^(x|~B))+u-343485551)+x,B=B+T>>>0,g=g+b>>>0,x=x+C>>>0,_=_+w>>>0;return te.endian([B,g,x,_]);function v(tt,pt,Y){return Y<<tt|Y>>>pt}};return function(e,r){var n=te.wordsToBytes(t(e,r)),o=r&&r.asBytes?n:te.bytesconvertNumberToHex(n);return o}}function Zx(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 Yx(t){return Buffer.from(t,"base64").toString("binary")}function su(t){return t}function Wx(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(e,r){return e<<r|e>>>32-r},endian:function(e){if(e.constructor==Number)return te.rotl(e,8)&16711935|te.rotl(e,24)&4278255360;for(var r=0;r<e.length;r++)e[r]=te.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 rr=class extends ps{name="md5";options;constructor(e={}){super(),this.options=e}async hash(e,r){let o=await new Promise((s,i)=>Va(e).then(s).catch(i));return eu(o,r)}};var Wr=class{constructor(e){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(e={}){dn(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 mn(e)}improveError(e){return e.message.includes(this.name)||(e.message=`${this.name} ${e.message}`),e}};var zn=class extends Wr{name="uncompressed";extensions=[];contentEncodings=[];isSupported=!0;options;constructor(e){super(e),this.options=e||{}}compressSync(e){return e}decompressSync(e){return e}async*compressBatches(e){return yield*e}async*decompressBatches(e){return yield*e}};var hr=mr(jd(),1),Be=mr(Kd(),1);var ur=class extends Wr{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(e={}){super(e),this.options=e}async compress(e){if(!Bt&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Er(Be.default.gzip)(e):await Er(Be.default.deflate)(e);return xr(r)}return this.compressSync(e)}async decompress(e){if(!Bt&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Er(Be.default.gunzip)(e):await Er(Be.default.inflate)(e);return xr(r)}return this.decompressSync(e)}compressSync(e){if(!Bt&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?Be.default.gzipSync(e):Be.default.deflateSync(e);return xr(s)}let r=this.options?.deflate||{},n=new Uint8Array(e);return(this.options?.raw?hr.default.deflateRaw:hr.default.deflate)(n,r).buffer}decompressSync(e){if(!Bt&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?Be.default.gunzipSync(e):Be.default.inflateSync(e);return xr(s)}let r=this.options?.deflate||{},n=new Uint8Array(e);return(this.options?.raw?hr.default.inflateRaw:hr.default.inflate)(n,r).buffer}async*compressBatches(e){let r=this.options?.deflate||{},n=new hr.default.Deflate(r);yield*this.transformBatches(n,e)}async*decompressBatches(e){let r=this.options?.deflate||{},n=new hr.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 i of r){let a=new Uint8Array(i);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 Q_={0:async t=>t,8:async t=>await new ur({raw:!0}).decompress(t)},Os=class{fileProvider=null;fileName;archive=null;constructor(e){if(typeof e=="string")if(this.fileName=e,!Bt)this.fileProvider=new Bn(e);else throw new Error("Cannot open file for random access in a WEB browser");else e instanceof dr?(this.fileProvider=e.fileProvider,this.archive=e,this.fileName=e.fileName):ks(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=Yr(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),s=await er(o.localHeaderOffset,this.fileProvider);if(!s)throw new Error("Local file header has not been found in the zip archive`");let i=Q_[s.compressionMethod.toString()];if(!i)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(s.fileDataOffset,s.fileDataOffset+s.compressedSize);r=await i(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=Yr(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 dr=class{fileProvider;fileName;constructor(e,r,n){this.fileProvider=e,this.fileName=n}async getFileWithoutHash(e){return await(await new Os(this.fileProvider).fetch(e)).arrayBuffer()}};function Mc(t){let e=new DataView(t),r={};for(let n=0;n<t.byteLength;n=n+24){let o=e.getBigUint64(n+16,!0),s=V_(t,n,16);r[s]=o}return r}function V_(t,e,r){return[...new Uint8Array(t,e,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function wc(t){let e=Yr(t);return j_(e)}async function j_(t){let e=new rr,r=new TextEncoder,n={};for await(let o of t){let s=o.fileName.split("\\").join("/").toLocaleLowerCase(),i=r.encode(s).buffer,a=await e.hash(i,"hex");n[a]=o.localHeaderOffset}return n}var K_={0:t=>new zn().decompress(t),8:t=>new ur({raw:!0}).decompress(t)},fn=class extends dr{hashTable;constructor(e,r,n){super(e,r,n),this.hashTable=r}async getFile(e){let r=await this.getFileBytes(e.toLocaleLowerCase());if(r||(r=await this.getFileBytes(e)),!r)throw new Error(`No such file in the archive: ${e}`);return r}async getFileBytes(e){let r;if(this.hashTable){let n=new TextEncoder().encode(e).buffer,o=await new rr().hash(n,"hex"),s=this.hashTable[o];if(s===void 0)return null;let i=await er(s,this.fileProvider);if(!i)return null;let a=await this.fileProvider.slice(i.fileDataOffset,i.fileDataOffset+i.compressedSize),f=K_[i.compressionMethod];if(!f)throw Error("Only Deflation compression is supported");r=await f(a)}else r=await this.getFileWithoutHash(e);return r}};var Xd=async(t,e)=>{let r=await Hn(t,Jn),n=await kn(r,t),o;if(n?.fileName!=="@3dtilesIndex1@")o=await wc(t),e?.("3tz doesnt contain hash file, hash info has been composed according to zip archive headers");else{let s=await er(n.localHeaderOffset,t);if(!s)throw new Error("corrupted 3tz zip archive");let i=s.fileDataOffset,a=await t.slice(i,i+s.compressedSize);o=Mc(a)}return new fn(t,o)};var X_="4.3.0-alpha.7",Zd={dataType:null,batchType:null,name:"3tz",id:"3tz",module:"3d-tiles",version:X_,mimeTypes:["application/octet-stream","application/vnd.maxar.archive.3tz+zip"],parse:Z_,extensions:["3tz"],options:{}};async function Z_(t,e={}){return(await Xd(new He(new DataView(t)))).getFile(e["3d-tiles-archive"]?.path??"")}function Ne(t,e,r){if(!e)return r+12;let{magic:o,version:s=1,byteLength:i=12}=t;return z(Array.isArray(o)&&Number.isFinite(s)&&Number.isFinite(i)),e.setUint8(r+0,o[0]),e.setUint8(r+1,o[1]),e.setUint8(r+2,o[2]),e.setUint8(r+3,o[3]),e.setUint32(r+4,s,!0),e.setUint32(r+8,i,!0),r+=12,r}function Ue(t,e,r){t&&t.setUint32(e+8,r,!0)}function Yd(t,e,r,n,o){t={magic:we.COMPOSITE,tiles:[],...t};let s=r;r+=Ne(t,e,r),e&&e.setUint32(r,t.tiles.length,!0),r+=4;for(let i=0;i<t.tiles.length;++i)r+=o(t.tiles[i],e,r,n);return Ue(e,s,r-s),r}function Wd(t,e,r,n){let{featuresLength:o=0,batchTable:s}=t,a=JSON.stringify({BATCH_LENGTH:o}),f=s?JSON.stringify(s):"",c=Tt(a.length,8),l=f?Tt(f.length,8):0;t={magic:we.BATCHED_MODEL,...t};let h=r;r=Ne(t,e,r),e&&(e.setUint32(12,c,!0),e.setUint32(16,0,!0),e.setUint32(20,l,!0),e.setUint32(24,0,!0)),r+=16,r=Ao(e,r,a,8),s&&(r=Ao(e,r,f,8));let u=t.gltfEncoded;return u&&(r=An(e,r,u,u.byteLength)),Ue(e,h,r-h),r}function qd(t,e,r,n){let{featuresLength:o=1,gltfFormat:s=1,gltfUri:i=""}=t,a=i.length,f={INSTANCES_LENGTH:o,POSITION:new Array(o*3).fill(0)},c=JSON.stringify(f),l=c.length;t={magic:we.INSTANCED_MODEL,...t};let h=r;return r=Ne(t,e,0),e&&(e.setUint32(12,l,!0),e.setUint32(16,0,!0),e.setUint32(20,0,!0),e.setUint32(24,0,!0),e.setUint32(28,s,!0)),r+=20,r+=Br(e,r,c,l),r+=Br(e,r,i,a),Ue(e,h,r-h),r}var Y_={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function $d(t,e,r,n){let{featureTableJson:o=Y_}=t,s=JSON.stringify(o);s=Ps(s,4);let{featureTableJsonByteLength:i=s.length}=t,a=new ArrayBuffer(12),f=a.byteLength;t={magic:we.POINT_CLOUD,...t};let c=r;return r+=Ne(t,e,0),e&&(e.setUint32(r+0,i,!0),e.setUint32(r+4,f,!0),e.setUint32(r+8,0,!0),e.setUint32(r+12,0,!0)),r+=16,r+=Br(e,r,s,i),r+=An(e,r,a,f),Ue(e,c,r-c),r}function Sc(t,e){let r=Ic(t,null,0,e),n=new ArrayBuffer(r),o=new DataView(n);return Ic(t,o,0,e),n}function Ic(t,e,r,n){switch(z(typeof t.type=="string"),t.type){case xt.COMPOSITE:return Yd(t,e,r,n,Ic);case xt.POINT_CLOUD:return $d(t,e,r,n);case xt.BATCHED_3D_MODEL:return Wd(t,e,r,n);case xt.INSTANCED_3D_MODEL:return qd(t,e,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var e0={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:Sr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],binary:!0,options:{["3d-tiles"]:{}},encode:async(t,e)=>t0(t,e),encodeSync:t0};function t0(t,e){return Sc(t,e)}return c0(io);})();
7
+ "use strict";var __exports__=(()=>{var rd=Object.create;var co=Object.defineProperty;var nd=Object.getOwnPropertyDescriptor;var od=Object.getOwnPropertyNames;var sd=Object.getPrototypeOf,id=Object.prototype.hasOwnProperty;var it=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),lt=(t,e)=>{for(var r in e)co(t,r,{get:e[r],enumerable:!0})},ao=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of od(e))!id.call(t,o)&&o!==r&&co(t,o,{get:()=>e[o],enumerable:!(n=nd(e,o))||n.enumerable});return t},fo=(t,e,r)=>(ao(t,e,"default"),r&&ao(r,e,"default")),dr=(t,e,r)=>(r=t!=null?rd(sd(t)):{},ao(e||!t||!t.__esModule?co(r,"default",{value:t,enumerable:!0}):r,t)),ad=t=>ao(co({},"__esModule",{value:!0}),t);var fn=it((Z_,Rc)=>{Rc.exports=globalThis.loaders});var ue=it(At=>{"use strict";var Zx=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Yx(t,e){return Object.prototype.hasOwnProperty.call(t,e)}At.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)Yx(r,n)&&(t[n]=r[n])}}return t};At.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var Wx={arraySet:function(t,e,r,n,o){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+n),o);return}for(var s=0;s<n;s++)t[o+s]=e[r+s]},flattenChunks:function(t){var e,r,n,o,s,i;for(n=0,e=0,r=t.length;e<r;e++)n+=t[e].length;for(i=new Uint8Array(n),o=0,e=0,r=t.length;e<r;e++)s=t[e],i.set(s,o),o+=s.length;return i}},qx={arraySet:function(t,e,r,n,o){for(var s=0;s<n;s++)t[o+s]=e[r+s]},flattenChunks:function(t){return[].concat.apply([],t)}};At.setTyped=function(t){t?(At.Buf8=Uint8Array,At.Buf16=Uint16Array,At.Buf32=Int32Array,At.assign(At,Wx)):(At.Buf8=Array,At.Buf16=Array,At.Buf32=Array,At.assign(At,qx))};At.setTyped(Zx)});var wu=it(Wr=>{"use strict";var $x=ue(),tE=4,su=0,iu=1,eE=2;function Yr(t){for(var e=t.length;--e>=0;)t[e]=0}var rE=0,uu=1,nE=2,oE=3,sE=258,Za=29,Kn=256,zn=Kn+1+Za,Zr=30,Ya=19,du=2*zn+1,er=15,za=16,iE=7,Wa=256,Au=16,mu=17,pu=18,Ka=[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],ms=[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],aE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],gu=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],cE=512,de=new Array((zn+2)*2);Yr(de);var Jn=new Array(Zr*2);Yr(Jn);var Qn=new Array(cE);Yr(Qn);var Vn=new Array(sE-oE+1);Yr(Vn);var qa=new Array(Za);Yr(qa);var ps=new Array(Zr);Yr(ps);function Qa(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 Bu,xu,Eu;function Va(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function _u(t){return t<256?Qn[t]:Qn[256+(t>>>7)]}function jn(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}function Ct(t,e,r){t.bi_valid>za-r?(t.bi_buf|=e<<t.bi_valid&65535,jn(t,t.bi_buf),t.bi_buf=e>>za-t.bi_valid,t.bi_valid+=r-za):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function $t(t,e,r){Ct(t,r[e*2],r[e*2+1])}function yu(t,e){var r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1}function fE(t){t.bi_valid===16?(jn(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 lE(t,e){var r=e.dyn_tree,n=e.max_code,o=e.stat_desc.static_tree,s=e.stat_desc.has_stree,i=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,f=e.stat_desc.max_length,c,l,h,u,d,A,m=0;for(u=0;u<=er;u++)t.bl_count[u]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<du;c++)l=t.heap[c],u=r[r[l*2+1]*2+1]+1,u>f&&(u=f,m++),r[l*2+1]=u,!(l>n)&&(t.bl_count[u]++,d=0,l>=a&&(d=i[l-a]),A=r[l*2],t.opt_len+=A*(u+d),s&&(t.static_len+=A*(o[l*2+1]+d)));if(m!==0){do{for(u=f-1;t.bl_count[u]===0;)u--;t.bl_count[u]--,t.bl_count[u+1]+=2,t.bl_count[f]--,m-=2}while(m>0);for(u=f;u!==0;u--)for(l=t.bl_count[u];l!==0;)h=t.heap[--c],!(h>n)&&(r[h*2+1]!==u&&(t.opt_len+=(u-r[h*2+1])*r[h*2],r[h*2+1]=u),l--)}}function Cu(t,e,r){var n=new Array(er+1),o=0,s,i;for(s=1;s<=er;s++)n[s]=o=o+r[s-1]<<1;for(i=0;i<=e;i++){var a=t[i*2+1];a!==0&&(t[i*2]=yu(n[a]++,a))}}function hE(){var t,e,r,n,o,s=new Array(er+1);for(r=0,n=0;n<Za-1;n++)for(qa[n]=r,t=0;t<1<<Ka[n];t++)Vn[r++]=n;for(Vn[r-1]=n,o=0,n=0;n<16;n++)for(ps[n]=o,t=0;t<1<<ms[n];t++)Qn[o++]=n;for(o>>=7;n<Zr;n++)for(ps[n]=o<<7,t=0;t<1<<ms[n]-7;t++)Qn[256+o++]=n;for(e=0;e<=er;e++)s[e]=0;for(t=0;t<=143;)de[t*2+1]=8,t++,s[8]++;for(;t<=255;)de[t*2+1]=9,t++,s[9]++;for(;t<=279;)de[t*2+1]=7,t++,s[7]++;for(;t<=287;)de[t*2+1]=8,t++,s[8]++;for(Cu(de,zn+1,s),t=0;t<Zr;t++)Jn[t*2+1]=5,Jn[t*2]=yu(t,5);Bu=new Qa(de,Ka,Kn+1,zn,er),xu=new Qa(Jn,ms,0,Zr,er),Eu=new Qa(new Array(0),aE,0,Ya,iE)}function Tu(t){var e;for(e=0;e<zn;e++)t.dyn_ltree[e*2]=0;for(e=0;e<Zr;e++)t.dyn_dtree[e*2]=0;for(e=0;e<Ya;e++)t.bl_tree[e*2]=0;t.dyn_ltree[Wa*2]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function bu(t){t.bi_valid>8?jn(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 uE(t,e,r,n){bu(t),n&&(jn(t,r),jn(t,~r)),$x.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function au(t,e,r,n){var o=e*2,s=r*2;return t[o]<t[s]||t[o]===t[s]&&n[e]<=n[r]}function ja(t,e,r){for(var n=t.heap[r],o=r<<1;o<=t.heap_len&&(o<t.heap_len&&au(e,t.heap[o+1],t.heap[o],t.depth)&&o++,!au(e,n,t.heap[o],t.depth));)t.heap[r]=t.heap[o],r=o,o<<=1;t.heap[r]=n}function cu(t,e,r){var n,o,s=0,i,a;if(t.last_lit!==0)do n=t.pending_buf[t.d_buf+s*2]<<8|t.pending_buf[t.d_buf+s*2+1],o=t.pending_buf[t.l_buf+s],s++,n===0?$t(t,o,e):(i=Vn[o],$t(t,i+Kn+1,e),a=Ka[i],a!==0&&(o-=qa[i],Ct(t,o,a)),n--,i=_u(n),$t(t,i,r),a=ms[i],a!==0&&(n-=ps[i],Ct(t,n,a)));while(s<t.last_lit);$t(t,Wa,e)}function Xa(t,e){var r=e.dyn_tree,n=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.elems,i,a,f=-1,c;for(t.heap_len=0,t.heap_max=du,i=0;i<s;i++)r[i*2]!==0?(t.heap[++t.heap_len]=f=i,t.depth[i]=0):r[i*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,i=t.heap_len>>1;i>=1;i--)ja(t,r,i);c=s;do i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],ja(t,r,1),a=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=a,r[c*2]=r[i*2]+r[a*2],t.depth[c]=(t.depth[i]>=t.depth[a]?t.depth[i]:t.depth[a])+1,r[i*2+1]=r[a*2+1]=c,t.heap[1]=c++,ja(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],lE(t,e),Cu(r,f,t.bl_count)}function fu(t,e,r){var n,o=-1,s,i=e[0*2+1],a=0,f=7,c=4;for(i===0&&(f=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)s=i,i=e[(n+1)*2+1],!(++a<f&&s===i)&&(a<c?t.bl_tree[s*2]+=a:s!==0?(s!==o&&t.bl_tree[s*2]++,t.bl_tree[Au*2]++):a<=10?t.bl_tree[mu*2]++:t.bl_tree[pu*2]++,a=0,o=s,i===0?(f=138,c=3):s===i?(f=6,c=3):(f=7,c=4))}function lu(t,e,r){var n,o=-1,s,i=e[0*2+1],a=0,f=7,c=4;for(i===0&&(f=138,c=3),n=0;n<=r;n++)if(s=i,i=e[(n+1)*2+1],!(++a<f&&s===i)){if(a<c)do $t(t,s,t.bl_tree);while(--a!==0);else s!==0?(s!==o&&($t(t,s,t.bl_tree),a--),$t(t,Au,t.bl_tree),Ct(t,a-3,2)):a<=10?($t(t,mu,t.bl_tree),Ct(t,a-3,3)):($t(t,pu,t.bl_tree),Ct(t,a-11,7));a=0,o=s,i===0?(f=138,c=3):s===i?(f=6,c=3):(f=7,c=4)}}function dE(t){var e;for(fu(t,t.dyn_ltree,t.l_desc.max_code),fu(t,t.dyn_dtree,t.d_desc.max_code),Xa(t,t.bl_desc),e=Ya-1;e>=3&&t.bl_tree[gu[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function AE(t,e,r,n){var o;for(Ct(t,e-257,5),Ct(t,r-1,5),Ct(t,n-4,4),o=0;o<n;o++)Ct(t,t.bl_tree[gu[o]*2+1],3);lu(t,t.dyn_ltree,e-1),lu(t,t.dyn_dtree,r-1)}function mE(t){var e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return su;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return iu;for(r=32;r<Kn;r++)if(t.dyn_ltree[r*2]!==0)return iu;return su}var hu=!1;function pE(t){hu||(hE(),hu=!0),t.l_desc=new Va(t.dyn_ltree,Bu),t.d_desc=new Va(t.dyn_dtree,xu),t.bl_desc=new Va(t.bl_tree,Eu),t.bi_buf=0,t.bi_valid=0,Tu(t)}function Mu(t,e,r,n){Ct(t,(rE<<1)+(n?1:0),3),uE(t,e,r,!0)}function gE(t){Ct(t,uu<<1,3),$t(t,Wa,de),fE(t)}function BE(t,e,r,n){var o,s,i=0;t.level>0?(t.strm.data_type===eE&&(t.strm.data_type=mE(t)),Xa(t,t.l_desc),Xa(t,t.d_desc),i=dE(t),o=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=o&&(o=s)):o=s=r+5,r+4<=o&&e!==-1?Mu(t,e,r,n):t.strategy===tE||s===o?(Ct(t,(uu<<1)+(n?1:0),3),cu(t,de,Jn)):(Ct(t,(nE<<1)+(n?1:0),3),AE(t,t.l_desc.max_code+1,t.d_desc.max_code+1,i+1),cu(t,t.dyn_ltree,t.dyn_dtree)),Tu(t),n&&bu(t)}function xE(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[(Vn[r]+Kn+1)*2]++,t.dyn_dtree[_u(e)*2]++),t.last_lit===t.lit_bufsize-1}Wr._tr_init=pE;Wr._tr_stored_block=Mu;Wr._tr_flush_block=BE;Wr._tr_tally=xE;Wr._tr_align=gE});var $a=it((aR,Iu)=>{"use strict";function EE(t,e,r,n){for(var o=t&65535|0,s=t>>>16&65535|0,i=0;r!==0;){i=r>2e3?2e3:r,r-=i;do o=o+e[n++]|0,s=s+o|0;while(--i);o%=65521,s%=65521}return o|s<<16|0}Iu.exports=EE});var tc=it((cR,Su)=>{"use strict";function _E(){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 yE=_E();function CE(t,e,r,n){var o=yE,s=n+r;t^=-1;for(var i=n;i<s;i++)t=t>>>8^o[(t^e[i])&255];return t^-1}Su.exports=CE});var gs=it((fR,Fu)=>{"use strict";Fu.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 Pu=it(re=>{"use strict";var mt=ue(),Gt=wu(),Lu=$a(),Se=tc(),TE=gs(),sr=0,bE=1,ME=3,Le=4,Ru=5,ee=0,Du=1,vt=-2,wE=-3,ec=-5,IE=-1,SE=1,Bs=2,FE=3,RE=4,DE=0,OE=2,ys=8,LE=9,GE=15,vE=8,NE=29,UE=256,nc=UE+1+NE,PE=30,HE=19,kE=2*nc+1,JE=15,J=3,De=258,zt=De+J+1,zE=32,Cs=42,oc=69,xs=73,Es=91,_s=103,rr=113,Zn=666,st=1,Yn=2,nr=3,tn=4,QE=3;function Oe(t,e){return t.msg=TE[e],e}function Ou(t){return(t<<1)-(t>4?9:0)}function Re(t){for(var e=t.length;--e>=0;)t[e]=0}function Fe(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(mt.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 ft(t,e){Gt._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Fe(t.strm)}function j(t,e){t.pending_buf[t.pending++]=e}function Xn(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}function VE(t,e,r,n){var o=t.avail_in;return o>n&&(o=n),o===0?0:(t.avail_in-=o,mt.arraySet(e,t.input,t.next_in,o,r),t.state.wrap===1?t.adler=Lu(t.adler,e,o,r):t.state.wrap===2&&(t.adler=Se(t.adler,e,o,r)),t.next_in+=o,t.total_in+=o,o)}function Gu(t,e){var r=t.max_chain_length,n=t.strstart,o,s,i=t.prev_length,a=t.nice_match,f=t.strstart>t.w_size-zt?t.strstart-(t.w_size-zt):0,c=t.window,l=t.w_mask,h=t.prev,u=t.strstart+De,d=c[n+i-1],A=c[n+i];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do if(o=e,!(c[o+i]!==A||c[o+i-1]!==d||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<u);if(s=De-(u-n),n=u-De,s>i){if(t.match_start=e,i=s,s>=a)break;d=c[n+i-1],A=c[n+i]}}while((e=h[e&l])>f&&--r!==0);return i<=t.lookahead?i:t.lookahead}function or(t){var e=t.w_size,r,n,o,s,i;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-zt)){mt.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);s+=e}if(t.strm.avail_in===0)break;if(n=VE(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=n,t.lookahead+t.insert>=J)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=(t.ins_h<<t.hash_shift^t.window[i+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[i+J-1])&t.hash_mask,t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<J)););}while(t.lookahead<zt&&t.strm.avail_in!==0)}function jE(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(or(t),t.lookahead===0&&e===sr)return st;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,ft(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-zt&&(ft(t,!1),t.strm.avail_out===0))return st}return t.insert=0,e===Le?(ft(t,!0),t.strm.avail_out===0?nr:tn):(t.strstart>t.block_start&&(ft(t,!1),t.strm.avail_out===0),st)}function rc(t,e){for(var r,n;;){if(t.lookahead<zt){if(or(t),t.lookahead<zt&&e===sr)return st;if(t.lookahead===0)break}if(r=0,t.lookahead>=J&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+J-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-zt&&(t.match_length=Gu(t,r)),t.match_length>=J)if(n=Gt._tr_tally(t,t.strstart-t.match_start,t.match_length-J),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=J){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+J-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=Gt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(ft(t,!1),t.strm.avail_out===0))return st}return t.insert=t.strstart<J-1?t.strstart:J-1,e===Le?(ft(t,!0),t.strm.avail_out===0?nr:tn):t.last_lit&&(ft(t,!1),t.strm.avail_out===0)?st:Yn}function qr(t,e){for(var r,n,o;;){if(t.lookahead<zt){if(or(t),t.lookahead<zt&&e===sr)return st;if(t.lookahead===0)break}if(r=0,t.lookahead>=J&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+J-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=J-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-zt&&(t.match_length=Gu(t,r),t.match_length<=5&&(t.strategy===SE||t.match_length===J&&t.strstart-t.match_start>4096)&&(t.match_length=J-1)),t.prev_length>=J&&t.match_length<=t.prev_length){o=t.strstart+t.lookahead-J,n=Gt._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-J),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+J-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=J-1,t.strstart++,n&&(ft(t,!1),t.strm.avail_out===0))return st}else if(t.match_available){if(n=Gt._tr_tally(t,0,t.window[t.strstart-1]),n&&ft(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return st}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Gt._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<J-1?t.strstart:J-1,e===Le?(ft(t,!0),t.strm.avail_out===0?nr:tn):t.last_lit&&(ft(t,!1),t.strm.avail_out===0)?st:Yn}function KE(t,e){for(var r,n,o,s,i=t.window;;){if(t.lookahead<=De){if(or(t),t.lookahead<=De&&e===sr)return st;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=J&&t.strstart>0&&(o=t.strstart-1,n=i[o],n===i[++o]&&n===i[++o]&&n===i[++o])){s=t.strstart+De;do;while(n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&o<s);t.match_length=De-(s-o),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=J?(r=Gt._tr_tally(t,1,t.match_length-J),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Gt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(ft(t,!1),t.strm.avail_out===0))return st}return t.insert=0,e===Le?(ft(t,!0),t.strm.avail_out===0?nr:tn):t.last_lit&&(ft(t,!1),t.strm.avail_out===0)?st:Yn}function XE(t,e){for(var r;;){if(t.lookahead===0&&(or(t),t.lookahead===0)){if(e===sr)return st;break}if(t.match_length=0,r=Gt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(ft(t,!1),t.strm.avail_out===0))return st}return t.insert=0,e===Le?(ft(t,!0),t.strm.avail_out===0?nr:tn):t.last_lit&&(ft(t,!1),t.strm.avail_out===0)?st:Yn}function te(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 $r;$r=[new te(0,0,0,0,jE),new te(4,4,8,4,rc),new te(4,5,16,8,rc),new te(4,6,32,32,rc),new te(4,4,16,16,qr),new te(8,16,32,32,qr),new te(8,16,128,128,qr),new te(8,32,128,256,qr),new te(32,128,258,1024,qr),new te(32,258,258,4096,qr)];function ZE(t){t.window_size=2*t.w_size,Re(t.head),t.max_lazy_match=$r[t.level].max_lazy,t.good_match=$r[t.level].good_length,t.nice_match=$r[t.level].nice_length,t.max_chain_length=$r[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=J-1,t.match_available=0,t.ins_h=0}function YE(){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=ys,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 mt.Buf16(kE*2),this.dyn_dtree=new mt.Buf16((2*PE+1)*2),this.bl_tree=new mt.Buf16((2*HE+1)*2),Re(this.dyn_ltree),Re(this.dyn_dtree),Re(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new mt.Buf16(JE+1),this.heap=new mt.Buf16(2*nc+1),Re(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new mt.Buf16(2*nc+1),Re(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 vu(t){var e;return!t||!t.state?Oe(t,vt):(t.total_in=t.total_out=0,t.data_type=OE,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?Cs:rr,t.adler=e.wrap===2?0:1,e.last_flush=sr,Gt._tr_init(e),ee)}function Nu(t){var e=vu(t);return e===ee&&ZE(t.state),e}function WE(t,e){return!t||!t.state||t.state.wrap!==2?vt:(t.state.gzhead=e,ee)}function Uu(t,e,r,n,o,s){if(!t)return vt;var i=1;if(e===IE&&(e=6),n<0?(i=0,n=-n):n>15&&(i=2,n-=16),o<1||o>LE||r!==ys||n<8||n>15||e<0||e>9||s<0||s>RE)return Oe(t,vt);n===8&&(n=9);var a=new YE;return t.state=a,a.strm=t,a.wrap=i,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+J-1)/J),a.window=new mt.Buf8(a.w_size*2),a.head=new mt.Buf16(a.hash_size),a.prev=new mt.Buf16(a.w_size),a.lit_bufsize=1<<o+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new mt.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=s,a.method=r,Nu(t)}function qE(t,e){return Uu(t,e,ys,GE,vE,DE)}function $E(t,e){var r,n,o,s;if(!t||!t.state||e>Ru||e<0)return t?Oe(t,vt):vt;if(n=t.state,!t.output||!t.input&&t.avail_in!==0||n.status===Zn&&e!==Le)return Oe(t,t.avail_out===0?ec:vt);if(n.strm=t,r=n.last_flush,n.last_flush=e,n.status===Cs)if(n.wrap===2)t.adler=0,j(n,31),j(n,139),j(n,8),n.gzhead?(j(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)),j(n,n.gzhead.time&255),j(n,n.gzhead.time>>8&255),j(n,n.gzhead.time>>16&255),j(n,n.gzhead.time>>24&255),j(n,n.level===9?2:n.strategy>=Bs||n.level<2?4:0),j(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(j(n,n.gzhead.extra.length&255),j(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=Se(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=oc):(j(n,0),j(n,0),j(n,0),j(n,0),j(n,0),j(n,n.level===9?2:n.strategy>=Bs||n.level<2?4:0),j(n,QE),n.status=rr);else{var i=ys+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=Bs||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=zE),i+=31-i%31,n.status=rr,Xn(n,i),n.strstart!==0&&(Xn(n,t.adler>>>16),Xn(n,t.adler&65535)),t.adler=1}if(n.status===oc)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=Se(t.adler,n.pending_buf,n.pending-o,o)),Fe(t),o=n.pending,n.pending===n.pending_buf_size));)j(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=Se(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=xs)}else n.status=xs;if(n.status===xs)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=Se(t.adler,n.pending_buf,n.pending-o,o)),Fe(t),o=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.name.length?s=n.gzhead.name.charCodeAt(n.gzindex++)&255:s=0,j(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>o&&(t.adler=Se(t.adler,n.pending_buf,n.pending-o,o)),s===0&&(n.gzindex=0,n.status=Es)}else n.status=Es;if(n.status===Es)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=Se(t.adler,n.pending_buf,n.pending-o,o)),Fe(t),o=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.comment.length?s=n.gzhead.comment.charCodeAt(n.gzindex++)&255:s=0,j(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>o&&(t.adler=Se(t.adler,n.pending_buf,n.pending-o,o)),s===0&&(n.status=_s)}else n.status=_s;if(n.status===_s&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Fe(t),n.pending+2<=n.pending_buf_size&&(j(n,t.adler&255),j(n,t.adler>>8&255),t.adler=0,n.status=rr)):n.status=rr),n.pending!==0){if(Fe(t),t.avail_out===0)return n.last_flush=-1,ee}else if(t.avail_in===0&&Ou(e)<=Ou(r)&&e!==Le)return Oe(t,ec);if(n.status===Zn&&t.avail_in!==0)return Oe(t,ec);if(t.avail_in!==0||n.lookahead!==0||e!==sr&&n.status!==Zn){var f=n.strategy===Bs?XE(n,e):n.strategy===FE?KE(n,e):$r[n.level].func(n,e);if((f===nr||f===tn)&&(n.status=Zn),f===st||f===nr)return t.avail_out===0&&(n.last_flush=-1),ee;if(f===Yn&&(e===bE?Gt._tr_align(n):e!==Ru&&(Gt._tr_stored_block(n,0,0,!1),e===ME&&(Re(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Fe(t),t.avail_out===0))return n.last_flush=-1,ee}return e!==Le?ee:n.wrap<=0?Du:(n.wrap===2?(j(n,t.adler&255),j(n,t.adler>>8&255),j(n,t.adler>>16&255),j(n,t.adler>>24&255),j(n,t.total_in&255),j(n,t.total_in>>8&255),j(n,t.total_in>>16&255),j(n,t.total_in>>24&255)):(Xn(n,t.adler>>>16),Xn(n,t.adler&65535)),Fe(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?ee:Du)}function t_(t){var e;return!t||!t.state?vt:(e=t.state.status,e!==Cs&&e!==oc&&e!==xs&&e!==Es&&e!==_s&&e!==rr&&e!==Zn?Oe(t,vt):(t.state=null,e===rr?Oe(t,wE):ee))}function e_(t,e){var r=e.length,n,o,s,i,a,f,c,l;if(!t||!t.state||(n=t.state,i=n.wrap,i===2||i===1&&n.status!==Cs||n.lookahead))return vt;for(i===1&&(t.adler=Lu(t.adler,e,r,0)),n.wrap=0,r>=n.w_size&&(i===0&&(Re(n.head),n.strstart=0,n.block_start=0,n.insert=0),l=new mt.Buf8(n.w_size),mt.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,or(n);n.lookahead>=J;){o=n.strstart,s=n.lookahead-(J-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[o+J-1])&n.hash_mask,n.prev[o&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=o,o++;while(--s);n.strstart=o,n.lookahead=J-1,or(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=J-1,n.match_available=0,t.next_in=f,t.input=c,t.avail_in=a,n.wrap=i,ee}re.deflateInit=qE;re.deflateInit2=Uu;re.deflateReset=Nu;re.deflateResetKeep=vu;re.deflateSetHeader=WE;re.deflate=$E;re.deflateEnd=t_;re.deflateSetDictionary=e_;re.deflateInfo="pako deflate (from Nodeca project)"});var sc=it(en=>{"use strict";var Ts=ue(),Hu=!0,ku=!0;try{String.fromCharCode.apply(null,[0])}catch{Hu=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{ku=!1}var Wn=new Ts.Buf8(256);for(Ae=0;Ae<256;Ae++)Wn[Ae]=Ae>=252?6:Ae>=248?5:Ae>=240?4:Ae>=224?3:Ae>=192?2:1;var Ae;Wn[254]=Wn[254]=1;en.string2buf=function(t){var e,r,n,o,s,i=t.length,a=0;for(o=0;o<i;o++)r=t.charCodeAt(o),(r&64512)===55296&&o+1<i&&(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 Ts.Buf8(a),s=0,o=0;s<a;o++)r=t.charCodeAt(o),(r&64512)===55296&&o+1<i&&(n=t.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),r<128?e[s++]=r:r<2048?(e[s++]=192|r>>>6,e[s++]=128|r&63):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|r&63):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|r&63);return e};function Ju(t,e){if(e<65534&&(t.subarray&&ku||!t.subarray&&Hu))return String.fromCharCode.apply(null,Ts.shrinkBuf(t,e));for(var r="",n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r}en.buf2binstring=function(t){return Ju(t,t.length)};en.binstring2buf=function(t){for(var e=new Ts.Buf8(t.length),r=0,n=e.length;r<n;r++)e[r]=t.charCodeAt(r);return e};en.buf2string=function(t,e){var r,n,o,s,i=e||t.length,a=new Array(i*2);for(n=0,r=0;r<i;){if(o=t[r++],o<128){a[n++]=o;continue}if(s=Wn[o],s>4){a[n++]=65533,r+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&r<i;)o=o<<6|t[r++]&63,s--;if(s>1){a[n++]=65533;continue}o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|o&1023)}return Ju(a,n)};en.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+Wn[t[r]]>e?r:e}});var ic=it((uR,zu)=>{"use strict";function r_(){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}zu.exports=r_});var Ku=it(to=>{"use strict";var qn=Pu(),$n=ue(),cc=sc(),fc=gs(),n_=ic(),ju=Object.prototype.toString,o_=0,ac=4,rn=0,Qu=1,Vu=2,s_=-1,i_=0,a_=8;function ir(t){if(!(this instanceof ir))return new ir(t);this.options=$n.assign({level:s_,method:a_,chunkSize:16384,windowBits:15,memLevel:8,strategy:i_,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 n_,this.strm.avail_out=0;var r=qn.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==rn)throw new Error(fc[r]);if(e.header&&qn.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(typeof e.dictionary=="string"?n=cc.string2buf(e.dictionary):ju.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=qn.deflateSetDictionary(this.strm,n),r!==rn)throw new Error(fc[r]);this._dict_set=!0}}ir.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,o,s;if(this.ended)return!1;s=e===~~e?e:e===!0?ac:o_,typeof t=="string"?r.input=cc.string2buf(t):ju.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 $n.Buf8(n),r.next_out=0,r.avail_out=n),o=qn.deflate(r,s),o!==Qu&&o!==rn)return this.onEnd(o),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(s===ac||s===Vu))&&(this.options.to==="string"?this.onData(cc.buf2binstring($n.shrinkBuf(r.output,r.next_out))):this.onData($n.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&o!==Qu);return s===ac?(o=qn.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===rn):(s===Vu&&(this.onEnd(rn),r.avail_out=0),!0)};ir.prototype.onData=function(t){this.chunks.push(t)};ir.prototype.onEnd=function(t){t===rn&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=$n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function lc(t,e){var r=new ir(e);if(r.push(t,!0),r.err)throw r.msg||fc[r.err];return r.result}function c_(t,e){return e=e||{},e.raw=!0,lc(t,e)}function f_(t,e){return e=e||{},e.gzip=!0,lc(t,e)}to.Deflate=ir;to.deflate=lc;to.deflateRaw=c_;to.gzip=f_});var Zu=it((AR,Xu)=>{"use strict";var bs=30,l_=12;Xu.exports=function(e,r){var n,o,s,i,a,f,c,l,h,u,d,A,m,p,E,y,T,b,C,w,I,O,B,g,x;n=e.state,o=e.next_in,g=e.input,s=o+(e.avail_in-5),i=e.next_out,x=e.output,a=i-(r-e.avail_out),f=i+(e.avail_out-257),c=n.dmax,l=n.wsize,h=n.whave,u=n.wnext,d=n.window,A=n.hold,m=n.bits,p=n.lencode,E=n.distcode,y=(1<<n.lenbits)-1,T=(1<<n.distbits)-1;t:do{m<15&&(A+=g[o++]<<m,m+=8,A+=g[o++]<<m,m+=8),b=p[A&y];e:for(;;){if(C=b>>>24,A>>>=C,m-=C,C=b>>>16&255,C===0)x[i++]=b&65535;else if(C&16){w=b&65535,C&=15,C&&(m<C&&(A+=g[o++]<<m,m+=8),w+=A&(1<<C)-1,A>>>=C,m-=C),m<15&&(A+=g[o++]<<m,m+=8,A+=g[o++]<<m,m+=8),b=E[A&T];r:for(;;){if(C=b>>>24,A>>>=C,m-=C,C=b>>>16&255,C&16){if(I=b&65535,C&=15,m<C&&(A+=g[o++]<<m,m+=8,m<C&&(A+=g[o++]<<m,m+=8)),I+=A&(1<<C)-1,I>c){e.msg="invalid distance too far back",n.mode=bs;break t}if(A>>>=C,m-=C,C=i-a,I>C){if(C=I-C,C>h&&n.sane){e.msg="invalid distance too far back",n.mode=bs;break t}if(O=0,B=d,u===0){if(O+=l-C,C<w){w-=C;do x[i++]=d[O++];while(--C);O=i-I,B=x}}else if(u<C){if(O+=l+u-C,C-=u,C<w){w-=C;do x[i++]=d[O++];while(--C);if(O=0,u<w){C=u,w-=C;do x[i++]=d[O++];while(--C);O=i-I,B=x}}}else if(O+=u-C,C<w){w-=C;do x[i++]=d[O++];while(--C);O=i-I,B=x}for(;w>2;)x[i++]=B[O++],x[i++]=B[O++],x[i++]=B[O++],w-=3;w&&(x[i++]=B[O++],w>1&&(x[i++]=B[O++]))}else{O=i-I;do x[i++]=x[O++],x[i++]=x[O++],x[i++]=x[O++],w-=3;while(w>2);w&&(x[i++]=x[O++],w>1&&(x[i++]=x[O++]))}}else if(C&64){e.msg="invalid distance code",n.mode=bs;break t}else{b=E[(b&65535)+(A&(1<<C)-1)];continue r}break}}else if(C&64)if(C&32){n.mode=l_;break t}else{e.msg="invalid literal/length code",n.mode=bs;break t}else{b=p[(b&65535)+(A&(1<<C)-1)];continue e}break}}while(o<s&&i<f);w=m>>3,o-=w,m-=w<<3,A&=(1<<m)-1,e.next_in=o,e.next_out=i,e.avail_in=o<s?5+(s-o):5-(o-s),e.avail_out=i<f?257+(f-i):257-(i-f),n.hold=A,n.bits=m}});var r0=it((mR,e0)=>{"use strict";var Yu=ue(),nn=15,Wu=852,qu=592,$u=0,hc=1,t0=2,h_=[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],u_=[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],d_=[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],A_=[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];e0.exports=function(e,r,n,o,s,i,a,f){var c=f.bits,l=0,h=0,u=0,d=0,A=0,m=0,p=0,E=0,y=0,T=0,b,C,w,I,O,B=null,g=0,x,_=new Yu.Buf16(nn+1),U=new Yu.Buf16(nn+1),N=null,P=0,G,tt,pt;for(l=0;l<=nn;l++)_[l]=0;for(h=0;h<o;h++)_[r[n+h]]++;for(A=c,d=nn;d>=1&&_[d]===0;d--);if(A>d&&(A=d),d===0)return s[i++]=1<<24|64<<16|0,s[i++]=1<<24|64<<16|0,f.bits=1,0;for(u=1;u<d&&_[u]===0;u++);for(A<u&&(A=u),E=1,l=1;l<=nn;l++)if(E<<=1,E-=_[l],E<0)return-1;if(E>0&&(e===$u||d!==1))return-1;for(U[1]=0,l=1;l<nn;l++)U[l+1]=U[l]+_[l];for(h=0;h<o;h++)r[n+h]!==0&&(a[U[r[n+h]]++]=h);if(e===$u?(B=N=a,x=19):e===hc?(B=h_,g-=257,N=u_,P-=257,x=256):(B=d_,N=A_,x=-1),T=0,h=0,l=u,O=i,m=A,p=0,w=-1,y=1<<A,I=y-1,e===hc&&y>Wu||e===t0&&y>qu)return 1;for(;;){G=l-p,a[h]<x?(tt=0,pt=a[h]):a[h]>x?(tt=N[P+a[h]],pt=B[g+a[h]]):(tt=32+64,pt=0),b=1<<l-p,C=1<<m,u=C;do C-=b,s[O+(T>>p)+C]=G<<24|tt<<16|pt|0;while(C!==0);for(b=1<<l-1;T&b;)b>>=1;if(b!==0?(T&=b-1,T+=b):T=0,h++,--_[l]===0){if(l===d)break;l=r[n+a[h]]}if(l>A&&(T&I)!==w){for(p===0&&(p=A),O+=u,m=l-p,E=1<<m;m+p<d&&(E-=_[m+p],!(E<=0));)m++,E<<=1;if(y+=1<<m,e===hc&&y>Wu||e===t0&&y>qu)return 1;w=T&I,s[w]=A<<24|m<<16|O-i|0}}return T!==0&&(s[O+T]=l-p<<24|64<<16|0),f.bits=A,0}});var N0=it(Qt=>{"use strict";var wt=ue(),gc=$a(),ne=tc(),m_=Zu(),eo=r0(),p_=0,I0=1,S0=2,n0=4,g_=5,Ms=6,ar=0,B_=1,x_=2,Nt=-2,F0=-3,Bc=-4,E_=-5,o0=8,R0=1,s0=2,i0=3,a0=4,c0=5,f0=6,l0=7,h0=8,u0=9,d0=10,Ss=11,me=12,uc=13,A0=14,dc=15,m0=16,p0=17,g0=18,B0=19,ws=20,Is=21,x0=22,E0=23,_0=24,y0=25,C0=26,Ac=27,T0=28,b0=29,$=30,xc=31,__=32,y_=852,C_=592,T_=15,b_=T_;function M0(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function M_(){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 wt.Buf16(320),this.work=new wt.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function D0(t){var e;return!t||!t.state?Nt:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=R0,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new wt.Buf32(y_),e.distcode=e.distdyn=new wt.Buf32(C_),e.sane=1,e.back=-1,ar)}function O0(t){var e;return!t||!t.state?Nt:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,D0(t))}function L0(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))?Nt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,O0(t))}function G0(t,e){var r,n;return t?(n=new M_,t.state=n,n.window=null,r=L0(t,e),r!==ar&&(t.state=null),r):Nt}function w_(t){return G0(t,b_)}var w0=!0,mc,pc;function I_(t){if(w0){var e;for(mc=new wt.Buf32(512),pc=new wt.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(eo(I0,t.lens,0,288,mc,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;eo(S0,t.lens,0,32,pc,0,t.work,{bits:5}),w0=!1}t.lencode=mc,t.lenbits=9,t.distcode=pc,t.distbits=5}function v0(t,e,r,n){var o,s=t.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new wt.Buf8(s.wsize)),n>=s.wsize?(wt.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(o=s.wsize-s.wnext,o>n&&(o=n),wt.arraySet(s.window,e,r-n,o,s.wnext),n-=o,n?(wt.arraySet(s.window,e,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}function S_(t,e){var r,n,o,s,i,a,f,c,l,h,u,d,A,m,p=0,E,y,T,b,C,w,I,O,B=new wt.Buf8(4),g,x,_=[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 Nt;r=t.state,r.mode===me&&(r.mode=uc),i=t.next_out,o=t.output,f=t.avail_out,s=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,h=a,u=f,O=ar;t:for(;;)switch(r.mode){case R0:if(r.wrap===0){r.mode=uc;break}for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(r.wrap&2&&c===35615){r.check=0,B[0]=c&255,B[1]=c>>>8&255,r.check=ne(r.check,B,2,0),c=0,l=0,r.mode=s0;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=$;break}if((c&15)!==o0){t.msg="unknown compression method",r.mode=$;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=$;break}r.dmax=1<<I,t.adler=r.check=1,r.mode=c&512?d0:me,c=0,l=0;break;case s0:for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==o0){t.msg="unknown compression method",r.mode=$;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=$;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(B[0]=c&255,B[1]=c>>>8&255,r.check=ne(r.check,B,2,0)),c=0,l=0,r.mode=i0;case i0:for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&(B[0]=c&255,B[1]=c>>>8&255,B[2]=c>>>16&255,B[3]=c>>>24&255,r.check=ne(r.check,B,4,0)),c=0,l=0,r.mode=a0;case a0:for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(B[0]=c&255,B[1]=c>>>8&255,r.check=ne(r.check,B,2,0)),c=0,l=0,r.mode=c0;case c0:if(r.flags&1024){for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(B[0]=c&255,B[1]=c>>>8&255,r.check=ne(r.check,B,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=f0;case f0:if(r.flags&1024&&(d=r.length,d>a&&(d=a),d&&(r.head&&(I=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),wt.arraySet(r.head.extra,n,s,d,I)),r.flags&512&&(r.check=ne(r.check,n,d,s)),a-=d,s+=d,r.length-=d),r.length))break t;r.length=0,r.mode=l0;case l0:if(r.flags&2048){if(a===0)break t;d=0;do I=n[s+d++],r.head&&I&&r.length<65536&&(r.head.name+=String.fromCharCode(I));while(I&&d<a);if(r.flags&512&&(r.check=ne(r.check,n,d,s)),a-=d,s+=d,I)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=h0;case h0:if(r.flags&4096){if(a===0)break t;d=0;do I=n[s+d++],r.head&&I&&r.length<65536&&(r.head.comment+=String.fromCharCode(I));while(I&&d<a);if(r.flags&512&&(r.check=ne(r.check,n,d,s)),a-=d,s+=d,I)break t}else r.head&&(r.head.comment=null);r.mode=u0;case u0:if(r.flags&512){for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=$;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=me;break;case d0:for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}t.adler=r.check=M0(c),c=0,l=0,r.mode=Ss;case Ss:if(r.havedict===0)return t.next_out=i,t.avail_out=f,t.next_in=s,t.avail_in=a,r.hold=c,r.bits=l,x_;t.adler=r.check=1,r.mode=me;case me:if(e===g_||e===Ms)break t;case uc:if(r.last){c>>>=l&7,l-=l&7,r.mode=Ac;break}for(;l<3;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=A0;break;case 1:if(I_(r),r.mode=ws,e===Ms){c>>>=2,l-=2;break t}break;case 2:r.mode=p0;break;case 3:t.msg="invalid block type",r.mode=$}c>>>=2,l-=2;break;case A0:for(c>>>=l&7,l-=l&7;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=$;break}if(r.length=c&65535,c=0,l=0,r.mode=dc,e===Ms)break t;case dc:r.mode=m0;case m0:if(d=r.length,d){if(d>a&&(d=a),d>f&&(d=f),d===0)break t;wt.arraySet(o,n,s,d,i),a-=d,s+=d,f-=d,i+=d,r.length-=d;break}r.mode=me;break;case p0:for(;l<14;){if(a===0)break t;a--,c+=n[s++]<<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=$;break}r.have=0,r.mode=g0;case g0:for(;r.have<r.ncode;){for(;l<3;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.lens[_[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[_[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,g={bits:r.lenbits},O=eo(p_,r.lens,0,19,r.lencode,0,r.work,g),r.lenbits=g.bits,O){t.msg="invalid code lengths set",r.mode=$;break}r.have=0,r.mode=B0;case B0:for(;r.have<r.nlen+r.ndist;){for(;p=r.lencode[c&(1<<r.lenbits)-1],E=p>>>24,y=p>>>16&255,T=p&65535,!(E<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(T<16)c>>>=E,l-=E,r.lens[r.have++]=T;else{if(T===16){for(x=E+2;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c>>>=E,l-=E,r.have===0){t.msg="invalid bit length repeat",r.mode=$;break}I=r.lens[r.have-1],d=3+(c&3),c>>>=2,l-=2}else if(T===17){for(x=E+3;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=E,l-=E,I=0,d=3+(c&7),c>>>=3,l-=3}else{for(x=E+7;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=E,l-=E,I=0,d=11+(c&127),c>>>=7,l-=7}if(r.have+d>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=$;break}for(;d--;)r.lens[r.have++]=I}}if(r.mode===$)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=$;break}if(r.lenbits=9,g={bits:r.lenbits},O=eo(I0,r.lens,0,r.nlen,r.lencode,0,r.work,g),r.lenbits=g.bits,O){t.msg="invalid literal/lengths set",r.mode=$;break}if(r.distbits=6,r.distcode=r.distdyn,g={bits:r.distbits},O=eo(S0,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,g),r.distbits=g.bits,O){t.msg="invalid distances set",r.mode=$;break}if(r.mode=ws,e===Ms)break t;case ws:r.mode=Is;case Is:if(a>=6&&f>=258){t.next_out=i,t.avail_out=f,t.next_in=s,t.avail_in=a,r.hold=c,r.bits=l,m_(t,u),i=t.next_out,o=t.output,f=t.avail_out,s=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,r.mode===me&&(r.back=-1);break}for(r.back=0;p=r.lencode[c&(1<<r.lenbits)-1],E=p>>>24,y=p>>>16&255,T=p&65535,!(E<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(y&&!(y&240)){for(b=E,C=y,w=T;p=r.lencode[w+((c&(1<<b+C)-1)>>b)],E=p>>>24,y=p>>>16&255,T=p&65535,!(b+E<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=b,l-=b,r.back+=b}if(c>>>=E,l-=E,r.back+=E,r.length=T,y===0){r.mode=C0;break}if(y&32){r.back=-1,r.mode=me;break}if(y&64){t.msg="invalid literal/length code",r.mode=$;break}r.extra=y&15,r.mode=x0;case x0:if(r.extra){for(x=r.extra;l<x;){if(a===0)break t;a--,c+=n[s++]<<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=E0;case E0:for(;p=r.distcode[c&(1<<r.distbits)-1],E=p>>>24,y=p>>>16&255,T=p&65535,!(E<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(!(y&240)){for(b=E,C=y,w=T;p=r.distcode[w+((c&(1<<b+C)-1)>>b)],E=p>>>24,y=p>>>16&255,T=p&65535,!(b+E<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=b,l-=b,r.back+=b}if(c>>>=E,l-=E,r.back+=E,y&64){t.msg="invalid distance code",r.mode=$;break}r.offset=T,r.extra=y&15,r.mode=_0;case _0:if(r.extra){for(x=r.extra;l<x;){if(a===0)break t;a--,c+=n[s++]<<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=$;break}r.mode=y0;case y0:if(f===0)break t;if(d=u-f,r.offset>d){if(d=r.offset-d,d>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=$;break}d>r.wnext?(d-=r.wnext,A=r.wsize-d):A=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=o,A=i-r.offset,d=r.length;d>f&&(d=f),f-=d,r.length-=d;do o[i++]=m[A++];while(--d);r.length===0&&(r.mode=Is);break;case C0:if(f===0)break t;o[i++]=r.length,f--,r.mode=Is;break;case Ac:if(r.wrap){for(;l<32;){if(a===0)break t;a--,c|=n[s++]<<l,l+=8}if(u-=f,t.total_out+=u,r.total+=u,u&&(t.adler=r.check=r.flags?ne(r.check,o,u,i-u):gc(r.check,o,u,i-u)),u=f,(r.flags?c:M0(c))!==r.check){t.msg="incorrect data check",r.mode=$;break}c=0,l=0}r.mode=T0;case T0:if(r.wrap&&r.flags){for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=$;break}c=0,l=0}r.mode=b0;case b0:O=B_;break t;case $:O=F0;break t;case xc:return Bc;case __:default:return Nt}return t.next_out=i,t.avail_out=f,t.next_in=s,t.avail_in=a,r.hold=c,r.bits=l,(r.wsize||u!==t.avail_out&&r.mode<$&&(r.mode<Ac||e!==n0))&&v0(t,t.output,t.next_out,u-t.avail_out)?(r.mode=xc,Bc):(h-=t.avail_in,u-=t.avail_out,t.total_in+=h,t.total_out+=u,r.total+=u,r.wrap&&u&&(t.adler=r.check=r.flags?ne(r.check,o,u,t.next_out-u):gc(r.check,o,u,t.next_out-u)),t.data_type=r.bits+(r.last?64:0)+(r.mode===me?128:0)+(r.mode===ws||r.mode===dc?256:0),(h===0&&u===0||e===n0)&&O===ar&&(O=E_),O)}function F_(t){if(!t||!t.state)return Nt;var e=t.state;return e.window&&(e.window=null),t.state=null,ar}function R_(t,e){var r;return!t||!t.state||(r=t.state,!(r.wrap&2))?Nt:(r.head=e,e.done=!1,ar)}function D_(t,e){var r=e.length,n,o,s;return!t||!t.state||(n=t.state,n.wrap!==0&&n.mode!==Ss)?Nt:n.mode===Ss&&(o=1,o=gc(o,e,r,0),o!==n.check)?F0:(s=v0(t,e,r,r),s?(n.mode=xc,Bc):(n.havedict=1,ar))}Qt.inflateReset=O0;Qt.inflateReset2=L0;Qt.inflateResetKeep=D0;Qt.inflateInit=w_;Qt.inflateInit2=G0;Qt.inflate=S_;Qt.inflateEnd=F_;Qt.inflateGetHeader=R_;Qt.inflateSetDictionary=D_;Qt.inflateInfo="pako inflate (from Nodeca project)"});var Ec=it((gR,U0)=>{"use strict";U0.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 H0=it((BR,P0)=>{"use strict";function O_(){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}P0.exports=O_});var J0=it(no=>{"use strict";var on=N0(),ro=ue(),Fs=sc(),nt=Ec(),_c=gs(),L_=ic(),G_=H0(),k0=Object.prototype.toString;function cr(t){if(!(this instanceof cr))return new cr(t);this.options=ro.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 L_,this.strm.avail_out=0;var r=on.inflateInit2(this.strm,e.windowBits);if(r!==nt.Z_OK)throw new Error(_c[r]);if(this.header=new G_,on.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Fs.string2buf(e.dictionary):k0.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=on.inflateSetDictionary(this.strm,e.dictionary),r!==nt.Z_OK)))throw new Error(_c[r])}cr.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,o=this.options.dictionary,s,i,a,f,c,l=!1;if(this.ended)return!1;i=e===~~e?e:e===!0?nt.Z_FINISH:nt.Z_NO_FLUSH,typeof t=="string"?r.input=Fs.binstring2buf(t):k0.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 ro.Buf8(n),r.next_out=0,r.avail_out=n),s=on.inflate(r,nt.Z_NO_FLUSH),s===nt.Z_NEED_DICT&&o&&(s=on.inflateSetDictionary(this.strm,o)),s===nt.Z_BUF_ERROR&&l===!0&&(s=nt.Z_OK,l=!1),s!==nt.Z_STREAM_END&&s!==nt.Z_OK)return this.onEnd(s),this.ended=!0,!1;r.next_out&&(r.avail_out===0||s===nt.Z_STREAM_END||r.avail_in===0&&(i===nt.Z_FINISH||i===nt.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=Fs.utf8border(r.output,r.next_out),f=r.next_out-a,c=Fs.buf2string(r.output,a),r.next_out=f,r.avail_out=n-f,f&&ro.arraySet(r.output,r.output,a,f,0),this.onData(c)):this.onData(ro.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)&&s!==nt.Z_STREAM_END);return s===nt.Z_STREAM_END&&(i=nt.Z_FINISH),i===nt.Z_FINISH?(s=on.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===nt.Z_OK):(i===nt.Z_SYNC_FLUSH&&(this.onEnd(nt.Z_OK),r.avail_out=0),!0)};cr.prototype.onData=function(t){this.chunks.push(t)};cr.prototype.onEnd=function(t){t===nt.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=ro.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function yc(t,e){var r=new cr(e);if(r.push(t,!0),r.err)throw r.msg||_c[r.err];return r.result}function v_(t,e){return e=e||{},e.raw=!0,yc(t,e)}no.Inflate=cr;no.inflate=yc;no.inflateRaw=v_;no.ungzip=yc});var V0=it((ER,Q0)=>{"use strict";var N_=ue().assign,U_=Ku(),P_=J0(),H_=Ec(),z0={};N_(z0,U_,P_,H_);Q0.exports=z0});var j0=it(()=>{});var oo={};lt(oo,{CesiumIonLoader:()=>Ua,TILE3D_TYPE:()=>xt,Tile3DBatchTable:()=>le,Tile3DFeatureTable:()=>Ht,Tile3DSubtreeLoader:()=>Jr,Tile3DWriter:()=>td,Tiles3DArchive:()=>sn,Tiles3DArchiveFileLoader:()=>X0,Tiles3DLoader:()=>qe,_getIonTilesetMetadata:()=>hs});fo(oo,dr(fn(),1));async function Ut(t,e,r,n){return n._parse(t,e,r,n)}function z(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var jt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},cd=jt.self||jt.window||jt.global||{},fd=jt.window||jt.self||jt.global||{},ld=jt.global||jt.self||jt.window||{},hd=jt.document||{};var Bt=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var Dc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),ud=Dc&&parseFloat(Dc[1])||0;var lo=globalThis,dd=globalThis.document||{},ho=globalThis.process||{},Ad=globalThis.console,$_=globalThis.navigator||{};function Oc(t){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&Boolean(process.versions?.electron))return!0;let e=typeof navigator<"u"&&navigator.userAgent,r=t||e;return Boolean(r&&r.indexOf("Electron")>=0)}function Ne(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||Oc()}var Os="4.0.7";function pd(t){try{let e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch{return null}}var uo=class{constructor(e,r,n="sessionStorage"){this.storage=pd(n),this.id=e,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let e={};if(this.storage){let r=this.storage.getItem(this.id);e=r?JSON.parse(r):{}}return Object.assign(this.config,e),this}};function Lc(t){let e;return t<10?e=`${t.toFixed(2)}ms`:t<100?e=`${t.toFixed(1)}ms`:t<1e3?e=`${t.toFixed(0)}ms`:e=`${(t/1e3).toFixed(2)}s`,e}function Gc(t,e=8){let r=Math.max(e-t.length,0);return`${" ".repeat(r)}${t}`}var Ao;(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ao||(Ao={}));var gd=10;function vc(t){return typeof t!="string"?t:(t=t.toUpperCase(),Ao[t]||Ao.WHITE)}function Nc(t,e,r){return!Ne&&typeof t=="string"&&(e&&(t=`\x1B[${vc(e)}m${t}\x1B[39m`),r&&(t=`\x1B[${vc(r)+gd}m${t}\x1B[49m`)),t}function Uc(t,e=["constructor"]){let r=Object.getPrototypeOf(t),n=Object.getOwnPropertyNames(r),o=t;for(let s of n){let i=o[s];typeof i=="function"&&(e.find(a=>s===a)||(o[s]=i.bind(t)))}}function ln(t,e){if(!t)throw new Error(e||"Assertion failed")}function Ue(){let t;if(Ne()&&lo.performance)t=lo?.performance?.now?.();else if("hrtime"in ho){let e=ho?.hrtime?.();t=e[0]*1e3+e[1]/1e6}else t=Date.now();return t}var Ar={debug:Ne()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Bd={enabled:!0,level:0};function mr(){}var Pc={},Hc={once:!0},hn=class{constructor({id:e}={id:""}){this.VERSION=Os,this._startTs=Ue(),this._deltaTs=Ue(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new uo(`__probe-${this.id}__`,Bd),this.timeStamp(`${this.id} started`),Uc(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Ue()-this._startTs).toPrecision(10))}getDelta(){return Number((Ue()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,r){this._storage.setConfiguration({[e]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,r){if(!e)throw new Error(r||"Assertion failed")}warn(e){return this._getLogFunction(0,e,Ar.warn,arguments,Hc)}error(e){return this._getLogFunction(0,e,Ar.error,arguments)}deprecated(e,r){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${r}\` instead`)}removed(e,r){return this.error(`\`${e}\` has been removed. Use \`${r}\` instead`)}probe(e,r){return this._getLogFunction(e,r,Ar.log,arguments,{time:!0,once:!0})}log(e,r){return this._getLogFunction(e,r,Ar.debug,arguments)}info(e,r){return this._getLogFunction(e,r,console.info,arguments)}once(e,r){return this._getLogFunction(e,r,Ar.debug||Ar.info,arguments,Hc)}table(e,r,n){return r?this._getLogFunction(e,r,console.table||mr,n&&[n],{tag:Ed(r)}):mr}time(e,r){return this._getLogFunction(e,r,console.time?console.time:console.info)}timeEnd(e,r){return this._getLogFunction(e,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,r){return this._getLogFunction(e,r,console.timeStamp||mr)}group(e,r,n={collapsed:!1}){let o=kc({logLevel:e,message:r,opts:n}),{collapsed:s}=n;return o.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}groupCollapsed(e,r,n={}){return this.group(e,r,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||mr)}withGroup(e,r,n){this.group(e,r)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=Jc(e)}_getLogFunction(e,r,n,o,s){if(this._shouldLog(e)){s=kc({logLevel:e,message:r,args:o,opts:s}),n=n||s.method,ln(n),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=Ue();let i=s.tag||s.message;if(s.once&&i)if(!Pc[i])Pc[i]=Ue();else return mr;return r=xd(this.id,s.message,s),n.bind(console,r,...s.args)}return mr}};hn.VERSION=Os;function Jc(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return ln(Number.isFinite(e)&&e>=0),e}function kc(t){let{logLevel:e,message:r}=t;t.logLevel=Jc(e);let n=t.args?Array.from(t.args):[];for(;n.length&&n.shift()!==r;);switch(typeof e){case"string":case"function":r!==void 0&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e);break;default:}typeof t.message=="function"&&(t.message=t.message());let o=typeof t.message;return ln(o==="string"||o==="object"),Object.assign(t,{args:n},t.opts)}function xd(t,e,r){if(typeof e=="string"){let n=r.time?Gc(Lc(r.total)):"";e=r.time?`${t}: ${n} ${e}`:`${t}: ${e}`,e=Nc(e,r.color,r.background)}return e}function Ed(t){for(let e in t)for(let r in t[e])return r||"untitled";return"empty"}globalThis.probe={};var Ls=new hn({id:"@probe.gl/log"});function un(t){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,t)}function Gs(t){return globalThis.loaders?.modules?.[t]||null}function _d(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.0-beta.1"),globalThis._loadersgl_.version}var zc=_d();function Qc(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var Kt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},S2=Kt.self||Kt.window||Kt.global||{},F2=Kt.window||Kt.self||Kt.global||{},R2=Kt.global||Kt.self||Kt.window||{},D2=Kt.document||{};var pr=typeof process!="object"||String(process)!=="[object process]"||process.browser,mo=typeof importScripts=="function",O2=typeof window<"u"&&typeof window.orientation<"u",Vc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),L2=Vc&&parseFloat(Vc[1])||0;var vs={};async function Xt(t,e=null,r={},n=null){return e&&(t=jc(t,e,r,n)),vs[t]=vs[t]||yd(t),await vs[t]}function jc(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]:pr?r.CDN?(Qc(r.CDN.startsWith("http")),`${r.CDN}/${e}@${zc}/dist/libs/${n}`):mo?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}async function yd(t){if(t.endsWith("wasm"))return await Td(t);if(!pr)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(t)}catch(r){return console.error(r),null}if(mo)return importScripts(t);let e=await bd(t);return Cd(e,t)}function Cd(t,e){if(!pr){let{requireFromString:n}=globalThis.loaders||{};return n?.(t,e)}if(mo)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 Td(t){let{readFileAsArrayBuffer:e}=globalThis.loaders||{};return pr||!e||t.startsWith("http")?await(await fetch(t)).arrayBuffer():await e(t)}async function bd(t){let{readFileAsText:e}=globalThis.loaders||{};return pr||!e||t.startsWith("http")?await(await fetch(t)).text():await e(t)}function Xc(t,e=5){return typeof t=="string"?t.slice(0,e):ArrayBuffer.isView(t)?Kc(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?Kc(t,0,e):""}function Kc(t,e,r){if(t.byteLength<=e+r)return"";let n=new DataView(t),o="";for(let s=0;s<r;s++)o+=String.fromCharCode(n.getUint8(e+s));return o}function Ns(t){try{return JSON.parse(t)}catch{throw new Error(`Failed to parse JSON from data starting with "${Xc(t)}"`)}}function ge(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 s=0;s<n.length;++s)if(n[s]!==o[s])return!1;return!0}function gr(...t){return Zc(t)}function Zc(t){let e=t.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),r=e.reduce((s,i)=>s+i.byteLength,0),n=new Uint8Array(r),o=0;for(let s of e)n.set(s,o),o+=s.byteLength;return n.buffer}function Pe(t,e,r){let n=r!==void 0?new Uint8Array(t).subarray(e,e+r):new Uint8Array(t).subarray(e);return new Uint8Array(n).buffer}function Tt(t,e){return z(t>=0),z(e>0),t+(e-1)&~(e-1)}function Us(t,e,r){let n;if(t instanceof ArrayBuffer)n=new Uint8Array(t);else{let o=t.byteOffset,s=t.byteLength;n=new Uint8Array(t.buffer||t.arrayBuffer,o,s)}return e.set(n,r),r+Tt(n.byteLength,4)}function Ps(t,e){let r=t.length,o=Math.ceil(r/e)*e-r,s="";for(let i=0;i<o;++i)s+=" ";return t+s}function Br(t,e,r,n){if(t)for(let o=0;o<n;o++)t.setUint8(e+o,r.charCodeAt(o));return e+n}function dn(t,e,r,n){if(t)for(let o=0;o<n;o++)t.setUint8(e+o,r[o]);return e+n}function Yc(t,e,r,n){let o=Tt(r.byteLength,n),s=o-r.byteLength;if(t){let i=new Uint8Array(t.buffer,t.byteOffset+e,r.byteLength),a=new Uint8Array(r);i.set(a);for(let f=0;f<s;++f)t.setUint8(e+r.byteLength+f,32)}return e+=o,e}function po(t,e,r,n){let s=new TextEncoder().encode(r);return e=Yc(t,e,s,n),e}async function An(t){let e=[];for await(let r of t)e.push(r);return gr(...e)}function Wc(t){return t&&typeof t=="object"&&t.isBuffer}function xr(t){if(Wc(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 Er(t){return e=>new Promise((r,n)=>t(e,(o,s)=>o?n(o):r(s)))}var _r={};lt(_r,{dirname:()=>wd,filename:()=>Md,join:()=>Id,resolve:()=>Sd});function qc(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let t=window.location?.pathname;return t?.slice(0,t.lastIndexOf("/")+1)||""}function Md(t){let e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(e+1):""}function wd(t){let e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(0,e):""}function Id(...t){let e="/";return t=t.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${e}`),"")),n!==t.length-1&&(r=r.replace(new RegExp(`${e}$`),"")),r)),t.join(e)}function Sd(...t){let e=[];for(let s=0;s<t.length;s++)e[s]=t[s];let r="",n=!1,o;for(let s=e.length-1;s>=-1&&!n;s--){let i;s>=0?i=e[s]:(o===void 0&&(o=qc()),i=o),i.length!==0&&(r=`${i}/${r}`,n=i.charCodeAt(0)===mn)}return r=Fd(r,!n),n?`/${r}`:r.length>0?r:"."}var mn=47,Hs=46;function Fd(t,e){let r="",n=-1,o=0,s,i=!1;for(let a=0;a<=t.length;++a){if(a<t.length)s=t.charCodeAt(a);else{if(s===mn)break;s=mn}if(s===mn){if(!(n===a-1||o===1))if(n!==a-1&&o===2){if(r.length<2||!i||r.charCodeAt(r.length-1)!==Hs||r.charCodeAt(r.length-2)!==Hs){if(r.length>2){let f=r.length-1,c=f;for(;c>=0&&r.charCodeAt(c)!==mn;--c);if(c!==f){r=c===-1?"":r.slice(0,c),n=a,o=0,i=!1;continue}}else if(r.length===2||r.length===1){r="",n=a,o=0,i=!1;continue}}e&&(r.length>0?r+="/..":r="..",i=!0)}else{let f=t.slice(n+1,a);r.length>0?r+=`/${f}`:r=f,i=!1}n=a,o=0}else s===Hs&&o!==-1?++o:o=-1}return r}var pn=new Error("Not implemented"),go=class{handle;size=0;bigsize=0n;url="";constructor(e,r,n){if(globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(e,r,n);throw Bt?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 pn}async write(e,r,n){throw pn}async stat(){throw pn}async truncate(e){throw pn}async append(e){throw pn}async close(){}};var ks=t=>t?.getUint8&&t?.slice&&t?.length;var gn=class{file;constructor(e,r=!1){this.file=new go(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 yr=t=>{if(t>Number.MAX_SAFE_INTEGER)throw new Error("Offset is out of bounds");return Number(t)},He=class{file;constructor(e){this.file=e}async destroy(){}async getUint8(e){return this.file.getUint8(yr(e))}async getUint16(e){return this.file.getUint16(yr(e),!0)}async getUint32(e){return this.file.getUint32(yr(e),!0)}async getBigUint64(e){return this.file.getBigUint64(yr(e),!0)}async slice(e,r){return this.file.buffer.slice(yr(e),yr(r))}get length(){return BigInt(this.file.byteLength)}};var Rd=1/Math.PI*180,Dd=1/180*Math.PI,Od={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...Od}};var Z=globalThis.mathgl.config;function Js(t,{precision:e=Z.precision}={}){return t=Ld(t),`${parseFloat(t.toPrecision(e))}`}function It(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function zs(t){return $c(t)}function Qs(t){return tf(t)}function $c(t,e){return js(t,r=>r*Dd,e)}function tf(t,e){return js(t,r=>r*Rd,e)}function Vs(t,e,r){return js(t,n=>Math.max(e,Math.min(r,n)))}function bt(t,e,r){let n=Z.EPSILON;r&&(Z.EPSILON=r);try{if(t===e)return!0;if(It(t)&&It(e)){if(t.length!==e.length)return!1;for(let o=0;o<t.length;++o)if(!bt(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)<=Z.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{Z.EPSILON=n}}function Ld(t){return Math.round(t/Z.EPSILON)*Z.EPSILON}function Gd(t){return t.clone?t.clone():new Array(t.length)}function js(t,e,r){if(It(t)){let n=t;r=r||Gd(n);for(let o=0;o<r.length&&o<n.length;++o){let s=typeof t=="number"?t:t[o];r[o]=e(s,o,r)}return r}return e(t)}var Be=class extends 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:It(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Z)}formatString(e){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+Js(this[n],e);return`${e.printTypes?this.constructor.name:""}[${r}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!bt(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 s=e[o],i=typeof r=="number"?r:r[o];this[o]=s+n*(i-s)}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(Z.debug&&!this.validate())throw new Error(`math.gl: ${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 vd(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 k(t){if(!Number.isFinite(t))throw new Error(`Invalid number ${JSON.stringify(t)}`);return t}function xe(t,e,r=""){if(Z.debug&&!vd(t,e))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return t}function at(t,e){if(!t)throw new Error(`math.gl assertion ${e}`)}var Ee=class extends Be{get x(){return this[0]}set x(e){this[0]=k(e)}get y(){return this[1]}set y(e){this[1]=k(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 k(r)}dot(e){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*e[n];return k(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 at(e>=0&&e<this.ELEMENTS,"index is out of range"),k(this[e])}setComponent(e,r){return at(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,Bn=Math.random;function Cr(t){return t>=0?Math.round(t):t%.5===0?Math.floor(t):Math.round(t)}var Qy=Math.PI/180;function Nd(){let t=new q(2);return q!=Float32Array&&(t[0]=0,t[1]=0),t}function ef(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}function rf(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o+r[4],t[1]=r[1]*n+r[3]*o+r[5],t}function Bo(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 xo(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 Vy=function(){let t=Nd();return function(e,r,n,o,s,i){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],s(t,t,i),e[a]=t[0],e[a+1]=t[1];return e}}();function Eo(t,e,r){let n=e[0],o=e[1],s=r[3]*n+r[7]*o||1;return t[0]=(r[0]*n+r[4]*o)/s,t[1]=(r[1]*n+r[5]*o)/s,t}function _o(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[3]*n+r[7]*o+r[11]*s||1;return t[0]=(r[0]*n+r[4]*o+r[8]*s)/i,t[1]=(r[1]*n+r[5]*o+r[9]*s)/i,t[2]=(r[2]*n+r[6]*o+r[10]*s)/i,t}function nf(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 of(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 yo(t,e,r){let n=e[0],o=e[1],s=e[2];return t[0]=r[0]*n+r[3]*o+r[6]*s,t[1]=r[1]*n+r[4]*o+r[7]*s,t[2]=r[2]*n+r[5]*o+r[8]*s,t[3]=e[3],t}var ke=class extends Ee{constructor(e=0,r=0){super(2),It(e)&&arguments.length===1?this.copy(e):(Z.debug&&(k(e),k(r)),this[0]=e,this[1]=r)}set(e,r){return this[0]=e,this[1]=r,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this.check()}fromObject(e){return Z.debug&&(k(e.x),k(e.y)),this[0]=e.x,this[1]=e.y,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return xo(this,this,e),this.check()}transformAsVector(e){return Eo(this,this,e),this.check()}transformByMatrix3(e){return Bo(this,this,e),this.check()}transformByMatrix2x3(e){return rf(this,this,e),this.check()}transformByMatrix2(e){return ef(this,this,e),this.check()}};var Qe={};lt(Qe,{add:()=>kd,angle:()=>Ws,bezier:()=>tA,ceil:()=>Jd,clone:()=>Ud,copy:()=>Pd,create:()=>Co,cross:()=>Je,dist:()=>fA,distance:()=>lf,div:()=>cA,divide:()=>ff,dot:()=>xn,equals:()=>sA,exactEquals:()=>oA,floor:()=>zd,forEach:()=>uA,fromValues:()=>To,hermite:()=>$d,inverse:()=>Yd,len:()=>qs,length:()=>sf,lerp:()=>Wd,max:()=>Vd,min:()=>Qd,mul:()=>aA,multiply:()=>cf,negate:()=>Zd,normalize:()=>Ks,random:()=>eA,rotateX:()=>Xs,rotateY:()=>Zs,rotateZ:()=>Ys,round:()=>jd,scale:()=>Kd,scaleAndAdd:()=>Xd,set:()=>Hd,slerp:()=>qd,sqrDist:()=>lA,sqrLen:()=>hA,squaredDistance:()=>hf,squaredLength:()=>uf,str:()=>nA,sub:()=>iA,subtract:()=>af,transformMat3:()=>En,transformMat4:()=>ze,transformQuat:()=>_n,zero:()=>rA});function Co(){let t=new q(3);return q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ud(t){let e=new q(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function sf(t){let e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function To(t,e,r){let n=new q(3);return n[0]=t,n[1]=e,n[2]=r,n}function Pd(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Hd(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function kd(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function af(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function cf(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function ff(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function Jd(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function zd(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function Qd(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 Vd(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 jd(t,e){return t[0]=Cr(e[0]),t[1]=Cr(e[1]),t[2]=Cr(e[2]),t}function Kd(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function Xd(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 lf(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 hf(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 uf(t){let e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function Zd(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function Yd(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function Ks(t,e){let r=e[0],n=e[1],o=e[2],s=r*r+n*n+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function xn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Je(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[0],a=r[1],f=r[2];return t[0]=o*f-s*a,t[1]=s*i-n*f,t[2]=n*a-o*i,t}function Wd(t,e,r,n){let o=e[0],s=e[1],i=e[2];return t[0]=o+n*(r[0]-o),t[1]=s+n*(r[1]-s),t[2]=i+n*(r[2]-i),t}function qd(t,e,r,n){let o=Math.acos(Math.min(Math.max(xn(e,r),-1),1)),s=Math.sin(o),i=Math.sin((1-n)*o)/s,a=Math.sin(n*o)/s;return t[0]=i*e[0]+a*r[0],t[1]=i*e[1]+a*r[1],t[2]=i*e[2]+a*r[2],t}function $d(t,e,r,n,o,s){let i=s*s,a=i*(2*s-3)+1,f=i*(s-2)+s,c=i*(s-1),l=i*(3-2*s);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 tA(t,e,r,n,o,s){let i=1-s,a=i*i,f=s*s,c=a*i,l=3*s*a,h=3*f*i,u=f*s;return t[0]=e[0]*c+r[0]*l+n[0]*h+o[0]*u,t[1]=e[1]*c+r[1]*l+n[1]*h+o[1]*u,t[2]=e[2]*c+r[2]*l+n[2]*h+o[2]*u,t}function eA(t,e){e=e===void 0?1:e;let r=Bn()*2*Math.PI,n=Bn()*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 ze(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[3]*n+r[7]*o+r[11]*s+r[15];return i=i||1,t[0]=(r[0]*n+r[4]*o+r[8]*s+r[12])/i,t[1]=(r[1]*n+r[5]*o+r[9]*s+r[13])/i,t[2]=(r[2]*n+r[6]*o+r[10]*s+r[14])/i,t}function En(t,e,r){let n=e[0],o=e[1],s=e[2];return t[0]=n*r[0]+o*r[3]+s*r[6],t[1]=n*r[1]+o*r[4]+s*r[7],t[2]=n*r[2]+o*r[5]+s*r[8],t}function _n(t,e,r){let n=r[0],o=r[1],s=r[2],i=r[3],a=e[0],f=e[1],c=e[2],l=o*c-s*f,h=s*a-n*c,u=n*f-o*a,d=o*u-s*h,A=s*l-n*u,m=n*h-o*l,p=i*2;return l*=p,h*=p,u*=p,d*=2,A*=2,m*=2,t[0]=a+l+d,t[1]=f+h+A,t[2]=c+u+m,t}function Xs(t,e,r,n){let o=[],s=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],s[0]=o[0],s[1]=o[1]*Math.cos(n)-o[2]*Math.sin(n),s[2]=o[1]*Math.sin(n)+o[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Zs(t,e,r,n){let o=[],s=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],s[0]=o[2]*Math.sin(n)+o[0]*Math.cos(n),s[1]=o[1],s[2]=o[2]*Math.cos(n)-o[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Ys(t,e,r,n){let o=[],s=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],s[0]=o[0]*Math.cos(n)-o[1]*Math.sin(n),s[1]=o[0]*Math.sin(n)+o[1]*Math.cos(n),s[2]=o[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Ws(t,e){let r=t[0],n=t[1],o=t[2],s=e[0],i=e[1],a=e[2],f=Math.sqrt((r*r+n*n+o*o)*(s*s+i*i+a*a)),c=f&&xn(t,e)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function rA(t){return t[0]=0,t[1]=0,t[2]=0,t}function nA(t){return`vec3(${t[0]}, ${t[1]}, ${t[2]})`}function oA(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function sA(t,e){let r=t[0],n=t[1],o=t[2],s=e[0],i=e[1],a=e[2];return Math.abs(r-s)<=1e-6*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(o-a)<=1e-6*Math.max(1,Math.abs(o),Math.abs(a))}var iA=af,aA=cf,cA=ff,fA=lf,lA=hf,qs=sf,hA=uf,uA=function(){let t=Co();return function(e,r,n,o,s,i){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],s(t,t,i),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}}();var $s=[0,0,0],bo,M=class extends Ee{static get ZERO(){return bo||(bo=new M(0,0,0),Object.freeze(bo)),bo}constructor(e=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&It(e)?this.copy(e):(Z.debug&&(k(e),k(r),k(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 Z.debug&&(k(e.x),k(e.y),k(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]=k(e)}angle(e){return Ws(this,e)}cross(e){return Je(this,this,e),this.check()}rotateX({radians:e,origin:r=$s}){return Xs(this,this,r,e),this.check()}rotateY({radians:e,origin:r=$s}){return Zs(this,this,r,e),this.check()}rotateZ({radians:e,origin:r=$s}){return Ys(this,this,r,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return ze(this,this,e),this.check()}transformAsVector(e){return _o(this,this,e),this.check()}transformByMatrix3(e){return En(this,this,e),this.check()}transformByMatrix2(e){return nf(this,this,e),this.check()}transformByQuaternion(e){return _n(this,this,e),this.check()}};var Mo,br=class extends Ee{static get ZERO(){return Mo||(Mo=new br(0,0,0,0),Object.freeze(Mo)),Mo}constructor(e=0,r=0,n=0,o=0){super(-0,-0,-0,-0),It(e)&&arguments.length===1?this.copy(e):(Z.debug&&(k(e),k(r),k(n),k(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 Z.debug&&(k(e.x),k(e.y),k(e.z),k(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]=k(e)}get w(){return this[3]}set w(e){this[3]=k(e)}transform(e){return ze(this,this,e),this.check()}transformByMatrix3(e){return yo(this,this,e),this.check()}transformByMatrix2(e){return of(this,this,e),this.check()}transformByQuaternion(e){return _n(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}};var Mr=class extends Be{toString(){let e="[";if(Z.printRowMajor){e+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)e+=` ${this[n*this.RANK+r]}`}else{e+="column-major:";for(let r=0;r<this.ELEMENTS;++r)e+=` ${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]=k(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 df(){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 Af(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 mf(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=e[4],a=e[5],f=e[6],c=e[7],l=e[8],h=l*i-a*c,u=-l*s+a*f,d=c*s-i*f,A=r*h+n*u+o*d;return A?(A=1/A,t[0]=h*A,t[1]=(-l*n+o*c)*A,t[2]=(a*n-o*i)*A,t[3]=u*A,t[4]=(l*r-o*f)*A,t[5]=(-a*r+o*s)*A,t[6]=d*A,t[7]=(-c*r+n*f)*A,t[8]=(i*r-n*s)*A,t):null}function pf(t){let e=t[0],r=t[1],n=t[2],o=t[3],s=t[4],i=t[5],a=t[6],f=t[7],c=t[8];return e*(c*s-i*f)+r*(-c*o+i*a)+n*(f*o-s*a)}function ti(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=e[8],u=r[0],d=r[1],A=r[2],m=r[3],p=r[4],E=r[5],y=r[6],T=r[7],b=r[8];return t[0]=u*n+d*i+A*c,t[1]=u*o+d*a+A*l,t[2]=u*s+d*f+A*h,t[3]=m*n+p*i+E*c,t[4]=m*o+p*a+E*l,t[5]=m*s+p*f+E*h,t[6]=y*n+T*i+b*c,t[7]=y*o+T*a+b*l,t[8]=y*s+T*f+b*h,t}function gf(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=e[8],u=r[0],d=r[1];return t[0]=n,t[1]=o,t[2]=s,t[3]=i,t[4]=a,t[5]=f,t[6]=u*n+d*i+c,t[7]=u*o+d*a+l,t[8]=u*s+d*f+h,t}function Bf(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=e[8],u=Math.sin(r),d=Math.cos(r);return t[0]=d*n+u*i,t[1]=d*o+u*a,t[2]=d*s+u*f,t[3]=d*i-u*n,t[4]=d*a-u*o,t[5]=d*f-u*s,t[6]=c,t[7]=l,t[8]=h,t}function ei(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 xf(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r+r,a=n+n,f=o+o,c=r*i,l=n*i,h=n*a,u=o*i,d=o*a,A=o*f,m=s*i,p=s*a,E=s*f;return t[0]=1-h-A,t[3]=l-E,t[6]=u+p,t[1]=l+E,t[4]=1-c-A,t[7]=d-m,t[2]=u-p,t[5]=d+m,t[8]=1-c-h,t}var ri;(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"})(ri||(ri={}));var AA=Object.freeze([1,0,0,0,1,0,0,0,1]),X=class extends Mr{static get IDENTITY(){return pA()}static get ZERO(){return mA()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return ri}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(AA)}fromObject(e){return this.check()}fromQuaternion(e){return xf(this,e),this.check()}set(e,r,n,o,s,i,a,f,c){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this[4]=s,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this.check()}setRowMajor(e,r,n,o,s,i,a,f,c){return this[0]=e,this[1]=o,this[2]=a,this[3]=r,this[4]=s,this[5]=f,this[6]=n,this[7]=i,this[8]=c,this.check()}determinant(){return pf(this)}transpose(){return Af(this,this),this.check()}invert(){return mf(this,this),this.check()}multiplyLeft(e){return ti(this,e,this),this.check()}multiplyRight(e){return ti(this,this,e),this.check()}rotate(e){return Bf(this,this,e),this.check()}scale(e){return Array.isArray(e)?ei(this,this,e):ei(this,this,[e,e]),this.check()}translate(e){return gf(this,this,e),this.check()}transform(e,r){let n;switch(e.length){case 2:n=Bo(r||[-0,-0],e,this);break;case 3:n=En(r||[-0,-0,-0],e,this);break;case 4:n=yo(r||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return xe(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)}},wo,Io=null;function mA(){return wo||(wo=new X([0,0,0,0,0,0,0,0,0]),Object.freeze(wo)),wo}function pA(){return Io||(Io=new X,Object.freeze(Io)),Io}var Cn={};lt(Cn,{add:()=>kA,adjoint:()=>yA,clone:()=>BA,copy:()=>xA,create:()=>gA,decompose:()=>DA,determinant:()=>si,equals:()=>VA,exactEquals:()=>QA,frob:()=>HA,fromQuat:()=>ui,fromQuat2:()=>SA,fromRotation:()=>bA,fromRotationTranslation:()=>_f,fromRotationTranslationScale:()=>OA,fromRotationTranslationScaleOrigin:()=>LA,fromScaling:()=>TA,fromTranslation:()=>CA,fromValues:()=>EA,fromXRotation:()=>MA,fromYRotation:()=>wA,fromZRotation:()=>IA,frustum:()=>di,getRotation:()=>RA,getScaling:()=>yf,getTranslation:()=>FA,identity:()=>Ef,invert:()=>oi,lookAt:()=>pi,mul:()=>jA,multiply:()=>yn,multiplyScalar:()=>JA,multiplyScalarAndAdd:()=>zA,ortho:()=>mi,orthoNO:()=>Tf,orthoZO:()=>NA,perspective:()=>Ai,perspectiveFromFieldOfView:()=>vA,perspectiveNO:()=>Cf,perspectiveZO:()=>GA,rotate:()=>ci,rotateX:()=>fi,rotateY:()=>li,rotateZ:()=>hi,scale:()=>ai,set:()=>_A,str:()=>PA,sub:()=>KA,subtract:()=>bf,targetTo:()=>UA,translate:()=>ii,transpose:()=>ni});function gA(){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 BA(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 xA(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 EA(t,e,r,n,o,s,i,a,f,c,l,h,u,d,A,m){let p=new q(16);return p[0]=t,p[1]=e,p[2]=r,p[3]=n,p[4]=o,p[5]=s,p[6]=i,p[7]=a,p[8]=f,p[9]=c,p[10]=l,p[11]=h,p[12]=u,p[13]=d,p[14]=A,p[15]=m,p}function _A(t,e,r,n,o,s,i,a,f,c,l,h,u,d,A,m,p){return t[0]=e,t[1]=r,t[2]=n,t[3]=o,t[4]=s,t[5]=i,t[6]=a,t[7]=f,t[8]=c,t[9]=l,t[10]=h,t[11]=u,t[12]=d,t[13]=A,t[14]=m,t[15]=p,t}function Ef(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 ni(t,e){if(t===e){let r=e[1],n=e[2],o=e[3],s=e[6],i=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]=s,t[11]=e[14],t[12]=o,t[13]=i,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 oi(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=e[4],a=e[5],f=e[6],c=e[7],l=e[8],h=e[9],u=e[10],d=e[11],A=e[12],m=e[13],p=e[14],E=e[15],y=r*a-n*i,T=r*f-o*i,b=r*c-s*i,C=n*f-o*a,w=n*c-s*a,I=o*c-s*f,O=l*m-h*A,B=l*p-u*A,g=l*E-d*A,x=h*p-u*m,_=h*E-d*m,U=u*E-d*p,N=y*U-T*_+b*x+C*g-w*B+I*O;return N?(N=1/N,t[0]=(a*U-f*_+c*x)*N,t[1]=(o*_-n*U-s*x)*N,t[2]=(m*I-p*w+E*C)*N,t[3]=(u*w-h*I-d*C)*N,t[4]=(f*g-i*U-c*B)*N,t[5]=(r*U-o*g+s*B)*N,t[6]=(p*b-A*I-E*T)*N,t[7]=(l*I-u*b+d*T)*N,t[8]=(i*_-a*g+c*O)*N,t[9]=(n*g-r*_-s*O)*N,t[10]=(A*w-m*b+E*y)*N,t[11]=(h*b-l*w-d*y)*N,t[12]=(a*B-i*x-f*O)*N,t[13]=(r*x-n*B+o*O)*N,t[14]=(m*T-A*C-p*y)*N,t[15]=(l*C-h*T+u*y)*N,t):null}function yA(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=e[4],a=e[5],f=e[6],c=e[7],l=e[8],h=e[9],u=e[10],d=e[11],A=e[12],m=e[13],p=e[14],E=e[15],y=r*a-n*i,T=r*f-o*i,b=r*c-s*i,C=n*f-o*a,w=n*c-s*a,I=o*c-s*f,O=l*m-h*A,B=l*p-u*A,g=l*E-d*A,x=h*p-u*m,_=h*E-d*m,U=u*E-d*p;return t[0]=a*U-f*_+c*x,t[1]=o*_-n*U-s*x,t[2]=m*I-p*w+E*C,t[3]=u*w-h*I-d*C,t[4]=f*g-i*U-c*B,t[5]=r*U-o*g+s*B,t[6]=p*b-A*I-E*T,t[7]=l*I-u*b+d*T,t[8]=i*_-a*g+c*O,t[9]=n*g-r*_-s*O,t[10]=A*w-m*b+E*y,t[11]=h*b-l*w-d*y,t[12]=a*B-i*x-f*O,t[13]=r*x-n*B+o*O,t[14]=m*T-A*C-p*y,t[15]=l*C-h*T+u*y,t}function si(t){let e=t[0],r=t[1],n=t[2],o=t[3],s=t[4],i=t[5],a=t[6],f=t[7],c=t[8],l=t[9],h=t[10],u=t[11],d=t[12],A=t[13],m=t[14],p=t[15],E=e*i-r*s,y=e*a-n*s,T=r*a-n*i,b=c*A-l*d,C=c*m-h*d,w=l*m-h*A,I=e*w-r*C+n*b,O=s*w-i*C+a*b,B=c*T-l*y+h*E,g=d*T-A*y+m*E;return f*I-o*O+p*B-u*g}function yn(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=e[8],u=e[9],d=e[10],A=e[11],m=e[12],p=e[13],E=e[14],y=e[15],T=r[0],b=r[1],C=r[2],w=r[3];return t[0]=T*n+b*a+C*h+w*m,t[1]=T*o+b*f+C*u+w*p,t[2]=T*s+b*c+C*d+w*E,t[3]=T*i+b*l+C*A+w*y,T=r[4],b=r[5],C=r[6],w=r[7],t[4]=T*n+b*a+C*h+w*m,t[5]=T*o+b*f+C*u+w*p,t[6]=T*s+b*c+C*d+w*E,t[7]=T*i+b*l+C*A+w*y,T=r[8],b=r[9],C=r[10],w=r[11],t[8]=T*n+b*a+C*h+w*m,t[9]=T*o+b*f+C*u+w*p,t[10]=T*s+b*c+C*d+w*E,t[11]=T*i+b*l+C*A+w*y,T=r[12],b=r[13],C=r[14],w=r[15],t[12]=T*n+b*a+C*h+w*m,t[13]=T*o+b*f+C*u+w*p,t[14]=T*s+b*c+C*d+w*E,t[15]=T*i+b*l+C*A+w*y,t}function ii(t,e,r){let n=r[0],o=r[1],s=r[2],i,a,f,c,l,h,u,d,A,m,p,E;return e===t?(t[12]=e[0]*n+e[4]*o+e[8]*s+e[12],t[13]=e[1]*n+e[5]*o+e[9]*s+e[13],t[14]=e[2]*n+e[6]*o+e[10]*s+e[14],t[15]=e[3]*n+e[7]*o+e[11]*s+e[15]):(i=e[0],a=e[1],f=e[2],c=e[3],l=e[4],h=e[5],u=e[6],d=e[7],A=e[8],m=e[9],p=e[10],E=e[11],t[0]=i,t[1]=a,t[2]=f,t[3]=c,t[4]=l,t[5]=h,t[6]=u,t[7]=d,t[8]=A,t[9]=m,t[10]=p,t[11]=E,t[12]=i*n+l*o+A*s+e[12],t[13]=a*n+h*o+m*s+e[13],t[14]=f*n+u*o+p*s+e[14],t[15]=c*n+d*o+E*s+e[15]),t}function ai(t,e,r){let n=r[0],o=r[1],s=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]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ci(t,e,r,n){let o=n[0],s=n[1],i=n[2],a=Math.sqrt(o*o+s*s+i*i),f,c,l,h,u,d,A,m,p,E,y,T,b,C,w,I,O,B,g,x,_,U,N,P;return a<1e-6?null:(a=1/a,o*=a,s*=a,i*=a,c=Math.sin(r),f=Math.cos(r),l=1-f,h=e[0],u=e[1],d=e[2],A=e[3],m=e[4],p=e[5],E=e[6],y=e[7],T=e[8],b=e[9],C=e[10],w=e[11],I=o*o*l+f,O=s*o*l+i*c,B=i*o*l-s*c,g=o*s*l-i*c,x=s*s*l+f,_=i*s*l+o*c,U=o*i*l+s*c,N=s*i*l-o*c,P=i*i*l+f,t[0]=h*I+m*O+T*B,t[1]=u*I+p*O+b*B,t[2]=d*I+E*O+C*B,t[3]=A*I+y*O+w*B,t[4]=h*g+m*x+T*_,t[5]=u*g+p*x+b*_,t[6]=d*g+E*x+C*_,t[7]=A*g+y*x+w*_,t[8]=h*U+m*N+T*P,t[9]=u*U+p*N+b*P,t[10]=d*U+E*N+C*P,t[11]=A*U+y*N+w*P,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function fi(t,e,r){let n=Math.sin(r),o=Math.cos(r),s=e[4],i=e[5],a=e[6],f=e[7],c=e[8],l=e[9],h=e[10],u=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]=s*o+c*n,t[5]=i*o+l*n,t[6]=a*o+h*n,t[7]=f*o+u*n,t[8]=c*o-s*n,t[9]=l*o-i*n,t[10]=h*o-a*n,t[11]=u*o-f*n,t}function li(t,e,r){let n=Math.sin(r),o=Math.cos(r),s=e[0],i=e[1],a=e[2],f=e[3],c=e[8],l=e[9],h=e[10],u=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]=s*o-c*n,t[1]=i*o-l*n,t[2]=a*o-h*n,t[3]=f*o-u*n,t[8]=s*n+c*o,t[9]=i*n+l*o,t[10]=a*n+h*o,t[11]=f*n+u*o,t}function hi(t,e,r){let n=Math.sin(r),o=Math.cos(r),s=e[0],i=e[1],a=e[2],f=e[3],c=e[4],l=e[5],h=e[6],u=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]=s*o+c*n,t[1]=i*o+l*n,t[2]=a*o+h*n,t[3]=f*o+u*n,t[4]=c*o-s*n,t[5]=l*o-i*n,t[6]=h*o-a*n,t[7]=u*o-f*n,t}function CA(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 TA(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 bA(t,e,r){let n=r[0],o=r[1],s=r[2],i=Math.sqrt(n*n+o*o+s*s),a,f,c;return i<1e-6?null:(i=1/i,n*=i,o*=i,s*=i,f=Math.sin(e),a=Math.cos(e),c=1-a,t[0]=n*n*c+a,t[1]=o*n*c+s*f,t[2]=s*n*c-o*f,t[3]=0,t[4]=n*o*c-s*f,t[5]=o*o*c+a,t[6]=s*o*c+n*f,t[7]=0,t[8]=n*s*c+o*f,t[9]=o*s*c-n*f,t[10]=s*s*c+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function MA(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 wA(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 IA(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 _f(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=n+n,f=o+o,c=s+s,l=n*a,h=n*f,u=n*c,d=o*f,A=o*c,m=s*c,p=i*a,E=i*f,y=i*c;return t[0]=1-(d+m),t[1]=h+y,t[2]=u-E,t[3]=0,t[4]=h-y,t[5]=1-(l+m),t[6]=A+p,t[7]=0,t[8]=u+E,t[9]=A-p,t[10]=1-(l+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function SA(t,e){let r=new q(3),n=-e[0],o=-e[1],s=-e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=n*n+o*o+s*s+i*i;return h>0?(r[0]=(a*i+l*n+f*s-c*o)*2/h,r[1]=(f*i+l*o+c*n-a*s)*2/h,r[2]=(c*i+l*s+a*o-f*n)*2/h):(r[0]=(a*i+l*n+f*s-c*o)*2,r[1]=(f*i+l*o+c*n-a*s)*2,r[2]=(c*i+l*s+a*o-f*n)*2),_f(t,e,r),t}function FA(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function yf(t,e){let r=e[0],n=e[1],o=e[2],s=e[4],i=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(s*s+i*i+a*a),t[2]=Math.sqrt(f*f+c*c+l*l),t}function RA(t,e){let r=new q(3);yf(r,e);let n=1/r[0],o=1/r[1],s=1/r[2],i=e[0]*n,a=e[1]*o,f=e[2]*s,c=e[4]*n,l=e[5]*o,h=e[6]*s,u=e[8]*n,d=e[9]*o,A=e[10]*s,m=i+l+A,p=0;return m>0?(p=Math.sqrt(m+1)*2,t[3]=.25*p,t[0]=(h-d)/p,t[1]=(u-f)/p,t[2]=(a-c)/p):i>l&&i>A?(p=Math.sqrt(1+i-l-A)*2,t[3]=(h-d)/p,t[0]=.25*p,t[1]=(a+c)/p,t[2]=(u+f)/p):l>A?(p=Math.sqrt(1+l-i-A)*2,t[3]=(u-f)/p,t[0]=(a+c)/p,t[1]=.25*p,t[2]=(h+d)/p):(p=Math.sqrt(1+A-i-l)*2,t[3]=(a-c)/p,t[0]=(u+f)/p,t[1]=(h+d)/p,t[2]=.25*p),t}function DA(t,e,r,n){e[0]=n[12],e[1]=n[13],e[2]=n[14];let o=n[0],s=n[1],i=n[2],a=n[4],f=n[5],c=n[6],l=n[8],h=n[9],u=n[10];r[0]=Math.sqrt(o*o+s*s+i*i),r[1]=Math.sqrt(a*a+f*f+c*c),r[2]=Math.sqrt(l*l+h*h+u*u);let d=1/r[0],A=1/r[1],m=1/r[2],p=o*d,E=s*A,y=i*m,T=a*d,b=f*A,C=c*m,w=l*d,I=h*A,O=u*m,B=p+b+O,g=0;return B>0?(g=Math.sqrt(B+1)*2,t[3]=.25*g,t[0]=(C-I)/g,t[1]=(w-y)/g,t[2]=(E-T)/g):p>b&&p>O?(g=Math.sqrt(1+p-b-O)*2,t[3]=(C-I)/g,t[0]=.25*g,t[1]=(E+T)/g,t[2]=(w+y)/g):b>O?(g=Math.sqrt(1+b-p-O)*2,t[3]=(w-y)/g,t[0]=(E+T)/g,t[1]=.25*g,t[2]=(C+I)/g):(g=Math.sqrt(1+O-p-b)*2,t[3]=(E-T)/g,t[0]=(w+y)/g,t[1]=(C+I)/g,t[2]=.25*g),t}function OA(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=e[3],f=o+o,c=s+s,l=i+i,h=o*f,u=o*c,d=o*l,A=s*c,m=s*l,p=i*l,E=a*f,y=a*c,T=a*l,b=n[0],C=n[1],w=n[2];return t[0]=(1-(A+p))*b,t[1]=(u+T)*b,t[2]=(d-y)*b,t[3]=0,t[4]=(u-T)*C,t[5]=(1-(h+p))*C,t[6]=(m+E)*C,t[7]=0,t[8]=(d+y)*w,t[9]=(m-E)*w,t[10]=(1-(h+A))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function LA(t,e,r,n,o){let s=e[0],i=e[1],a=e[2],f=e[3],c=s+s,l=i+i,h=a+a,u=s*c,d=s*l,A=s*h,m=i*l,p=i*h,E=a*h,y=f*c,T=f*l,b=f*h,C=n[0],w=n[1],I=n[2],O=o[0],B=o[1],g=o[2],x=(1-(m+E))*C,_=(d+b)*C,U=(A-T)*C,N=(d-b)*w,P=(1-(u+E))*w,G=(p+y)*w,tt=(A+T)*I,pt=(p-y)*I,Y=(1-(u+m))*I;return t[0]=x,t[1]=_,t[2]=U,t[3]=0,t[4]=N,t[5]=P,t[6]=G,t[7]=0,t[8]=tt,t[9]=pt,t[10]=Y,t[11]=0,t[12]=r[0]+O-(x*O+N*B+tt*g),t[13]=r[1]+B-(_*O+P*B+pt*g),t[14]=r[2]+g-(U*O+G*B+Y*g),t[15]=1,t}function ui(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r+r,a=n+n,f=o+o,c=r*i,l=n*i,h=n*a,u=o*i,d=o*a,A=o*f,m=s*i,p=s*a,E=s*f;return t[0]=1-h-A,t[1]=l+E,t[2]=u-p,t[3]=0,t[4]=l-E,t[5]=1-c-A,t[6]=d+m,t[7]=0,t[8]=u+p,t[9]=d-m,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function di(t,e,r,n,o,s,i){let a=1/(r-e),f=1/(o-n),c=1/(s-i);return t[0]=s*2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s*2*f,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(o+n)*f,t[10]=(i+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=i*s*2*c,t[15]=0,t}function Cf(t,e,r,n,o){let s=1/Math.tan(e/2);if(t[0]=s/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,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 i=1/(n-o);t[10]=(o+n)*i,t[14]=2*o*n*i}else t[10]=-1,t[14]=-2*n;return t}var Ai=Cf;function GA(t,e,r,n,o){let s=1/Math.tan(e/2);if(t[0]=s/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,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 i=1/(n-o);t[10]=o*i,t[14]=o*n*i}else t[10]=-1,t[14]=-n;return t}function vA(t,e,r,n){let o=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),i=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),f=2/(i+a),c=2/(o+s);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]=-((i-a)*f*.5),t[9]=(o-s)*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 Tf(t,e,r,n,o,s,i){let a=1/(e-r),f=1/(n-o),c=1/(s-i);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]=(i+s)*c,t[15]=1,t}var mi=Tf;function NA(t,e,r,n,o,s,i){let a=1/(e-r),f=1/(n-o),c=1/(s-i);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]=s*c,t[15]=1,t}function pi(t,e,r,n){let o,s,i,a,f,c,l,h,u,d,A=e[0],m=e[1],p=e[2],E=n[0],y=n[1],T=n[2],b=r[0],C=r[1],w=r[2];return Math.abs(A-b)<1e-6&&Math.abs(m-C)<1e-6&&Math.abs(p-w)<1e-6?Ef(t):(h=A-b,u=m-C,d=p-w,o=1/Math.sqrt(h*h+u*u+d*d),h*=o,u*=o,d*=o,s=y*d-T*u,i=T*h-E*d,a=E*u-y*h,o=Math.sqrt(s*s+i*i+a*a),o?(o=1/o,s*=o,i*=o,a*=o):(s=0,i=0,a=0),f=u*a-d*i,c=d*s-h*a,l=h*i-u*s,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]=s,t[1]=f,t[2]=h,t[3]=0,t[4]=i,t[5]=c,t[6]=u,t[7]=0,t[8]=a,t[9]=l,t[10]=d,t[11]=0,t[12]=-(s*A+i*m+a*p),t[13]=-(f*A+c*m+l*p),t[14]=-(h*A+u*m+d*p),t[15]=1,t)}function UA(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=n[0],f=n[1],c=n[2],l=o-r[0],h=s-r[1],u=i-r[2],d=l*l+h*h+u*u;d>0&&(d=1/Math.sqrt(d),l*=d,h*=d,u*=d);let A=f*u-c*h,m=c*l-a*u,p=a*h-f*l;return d=A*A+m*m+p*p,d>0&&(d=1/Math.sqrt(d),A*=d,m*=d,p*=d),t[0]=A,t[1]=m,t[2]=p,t[3]=0,t[4]=h*p-u*m,t[5]=u*A-l*p,t[6]=l*m-h*A,t[7]=0,t[8]=l,t[9]=h,t[10]=u,t[11]=0,t[12]=o,t[13]=s,t[14]=i,t[15]=1,t}function PA(t){return`mat4(${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}, ${t[4]}, ${t[5]}, ${t[6]}, ${t[7]}, ${t[8]}, ${t[9]}, ${t[10]}, ${t[11]}, ${t[12]}, ${t[13]}, ${t[14]}, ${t[15]})`}function HA(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 kA(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 bf(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 JA(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 zA(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 QA(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 VA(t,e){let r=t[0],n=t[1],o=t[2],s=t[3],i=t[4],a=t[5],f=t[6],c=t[7],l=t[8],h=t[9],u=t[10],d=t[11],A=t[12],m=t[13],p=t[14],E=t[15],y=e[0],T=e[1],b=e[2],C=e[3],w=e[4],I=e[5],O=e[6],B=e[7],g=e[8],x=e[9],_=e[10],U=e[11],N=e[12],P=e[13],G=e[14],tt=e[15];return Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-T)<=1e-6*Math.max(1,Math.abs(n),Math.abs(T))&&Math.abs(o-b)<=1e-6*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(s-C)<=1e-6*Math.max(1,Math.abs(s),Math.abs(C))&&Math.abs(i-w)<=1e-6*Math.max(1,Math.abs(i),Math.abs(w))&&Math.abs(a-I)<=1e-6*Math.max(1,Math.abs(a),Math.abs(I))&&Math.abs(f-O)<=1e-6*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(c-B)<=1e-6*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(l-g)<=1e-6*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(h-x)<=1e-6*Math.max(1,Math.abs(h),Math.abs(x))&&Math.abs(u-_)<=1e-6*Math.max(1,Math.abs(u),Math.abs(_))&&Math.abs(d-U)<=1e-6*Math.max(1,Math.abs(d),Math.abs(U))&&Math.abs(A-N)<=1e-6*Math.max(1,Math.abs(A),Math.abs(N))&&Math.abs(m-P)<=1e-6*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(p-G)<=1e-6*Math.max(1,Math.abs(p),Math.abs(G))&&Math.abs(E-tt)<=1e-6*Math.max(1,Math.abs(E),Math.abs(tt))}var jA=yn,KA=bf;function XA(){let t=new q(4);return q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Mf(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 wf(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 If(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 Sf(t){let e=t[0],r=t[1],n=t[2],o=t[3];return e*e+r*r+n*n+o*o}function Ff(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r*r+n*n+o*o+s*s;return i>0&&(i=1/Math.sqrt(i)),t[0]=r*i,t[1]=n*i,t[2]=o*i,t[3]=s*i,t}function Rf(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Df(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=e[3];return t[0]=o+n*(r[0]-o),t[1]=s+n*(r[1]-s),t[2]=i+n*(r[2]-i),t[3]=a+n*(r[3]-a),t}function Of(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3];return t[0]=r[0]*n+r[4]*o+r[8]*s+r[12]*i,t[1]=r[1]*n+r[5]*o+r[9]*s+r[13]*i,t[2]=r[2]*n+r[6]*o+r[10]*s+r[14]*i,t[3]=r[3]*n+r[7]*o+r[11]*s+r[15]*i,t}function Lf(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[0],a=r[1],f=r[2],c=r[3],l=c*n+a*s-f*o,h=c*o+f*n-i*s,u=c*s+i*o-a*n,d=-i*n-a*o-f*s;return t[0]=l*c+d*-i+h*-f-u*-a,t[1]=h*c+d*-a+u*-i-l*-f,t[2]=u*c+d*-f+l*-a-h*-i,t[3]=e[3],t}var CC=function(){let t=XA();return function(e,r,n,o,s,i){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],s(t,t,i),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2],e[a+3]=t[3];return e}}();var xi;(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"})(xi||(xi={}));var YA=45*Math.PI/180,WA=1,gi=.1,Bi=500,qA=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),St=class extends Mr{static get IDENTITY(){return tm()}static get ZERO(){return $A()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return xi}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,s,i,a,f,c,l,h,u,d,A,m,p){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this[4]=s,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this[9]=l,this[10]=h,this[11]=u,this[12]=d,this[13]=A,this[14]=m,this[15]=p,this.check()}setRowMajor(e,r,n,o,s,i,a,f,c,l,h,u,d,A,m,p){return this[0]=e,this[1]=s,this[2]=c,this[3]=d,this[4]=r,this[5]=i,this[6]=l,this[7]=A,this[8]=n,this[9]=a,this[10]=h,this[11]=m,this[12]=o,this[13]=f,this[14]=u,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(qA)}fromObject(e){return this.check()}fromQuaternion(e){return ui(this,e),this.check()}frustum(e){let{left:r,right:n,bottom:o,top:s,near:i=gi,far:a=Bi}=e;return a===1/0?em(this,r,n,o,s,i):di(this,r,n,o,s,i,a),this.check()}lookAt(e){let{eye:r,center:n=[0,0,0],up:o=[0,1,0]}=e;return pi(this,r,n,o),this.check()}ortho(e){let{left:r,right:n,bottom:o,top:s,near:i=gi,far:a=Bi}=e;return mi(this,r,n,o,s,i,a),this.check()}orthographic(e){let{fovy:r=YA,aspect:n=WA,focalDistance:o=1,near:s=gi,far:i=Bi}=e;Gf(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:s,far:i})}perspective(e){let{fovy:r=45*Math.PI/180,aspect:n=1,near:o=.1,far:s=500}=e;return Gf(r),Ai(this,r,n,o,s),this.check()}determinant(){return si(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],s=1/n[1],i=1/n[2];return e[0]=this[0]*o,e[1]=this[1]*s,e[2]=this[2]*i,e[3]=0,e[4]=this[4]*o,e[5]=this[5]*s,e[6]=this[6]*i,e[7]=0,e[8]=this[8]*o,e[9]=this[9]*s,e[10]=this[10]*i,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],s=1/n[1],i=1/n[2];return e[0]=this[0]*o,e[1]=this[1]*s,e[2]=this[2]*i,e[3]=this[4]*o,e[4]=this[5]*s,e[5]=this[6]*i,e[6]=this[8]*o,e[7]=this[9]*s,e[8]=this[10]*i,e}transpose(){return ni(this,this),this.check()}invert(){return oi(this,this),this.check()}multiplyLeft(e){return yn(this,e,this),this.check()}multiplyRight(e){return yn(this,this,e),this.check()}rotateX(e){return fi(this,this,e),this.check()}rotateY(e){return li(this,this,e),this.check()}rotateZ(e){return hi(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,r){return ci(this,this,e,r),this.check()}scale(e){return ai(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return ii(this,this,e),this.check()}transform(e,r){return e.length===4?(r=Of(r||[-0,-0,-0,-0],e,this),xe(r,4),r):this.transformAsPoint(e,r)}transformAsPoint(e,r){let{length:n}=e,o;switch(n){case 2:o=xo(r||[-0,-0],e,this);break;case 3:o=ze(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return xe(o,e.length),o}transformAsVector(e,r){let n;switch(e.length){case 2:n=Eo(r||[-0,-0],e,this);break;case 3:n=_o(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return xe(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])}},So,Fo;function $A(){return So||(So=new St([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(So)),So}function tm(){return Fo||(Fo=new St,Object.freeze(Fo)),Fo}function Gf(t){if(t>Math.PI*2)throw Error("expected radians")}function em(t,e,r,n,o,s){let i=2*s/(r-e),a=2*s/(o-n),f=(r+e)/(r-e),c=(o+n)/(o-n),l=-1,h=-1,u=-2*s;return t[0]=i,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]=h,t[12]=0,t[13]=0,t[14]=u,t[15]=0,t}function vf(){let t=new q(4);return q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Nf(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Ei(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 _i(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=r[0],f=r[1],c=r[2],l=r[3];return t[0]=n*l+i*a+o*c-s*f,t[1]=o*l+i*f+s*a-n*c,t[2]=s*l+i*c+n*f-o*a,t[3]=i*l-n*a-o*f-s*c,t}function Uf(t,e,r){r*=.5;let n=e[0],o=e[1],s=e[2],i=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]=s*f-o*a,t[3]=i*f-n*a,t}function Pf(t,e,r){r*=.5;let n=e[0],o=e[1],s=e[2],i=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]=s*f+n*a,t[3]=i*f-o*a,t}function Hf(t,e,r){r*=.5;let n=e[0],o=e[1],s=e[2],i=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]=s*f+i*a,t[3]=i*f-s*a,t}function kf(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 Tn(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=e[3],f=r[0],c=r[1],l=r[2],h=r[3],u,d,A,m,p;return u=o*f+s*c+i*l+a*h,u<0&&(u=-u,f=-f,c=-c,l=-l,h=-h),1-u>1e-6?(d=Math.acos(u),p=Math.sin(d),A=Math.sin((1-n)*d)/p,m=Math.sin(n*d)/p):(A=1-n,m=n),t[0]=A*o+m*f,t[1]=A*s+m*c,t[2]=A*i+m*l,t[3]=A*a+m*h,t}function Jf(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r*r+n*n+o*o+s*s,a=i?1/i:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-o*a,t[3]=s*a,t}function zf(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function yi(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 s=(o+1)%3,i=(o+2)%3;n=Math.sqrt(e[o*3+o]-e[s*3+s]-e[i*3+i]+1),t[o]=.5*n,n=.5/n,t[3]=(e[s*3+i]-e[i*3+s])*n,t[s]=(e[s*3+o]+e[o*3+s])*n,t[i]=(e[i*3+o]+e[o*3+i])*n}return t}var Qf=Mf;var Vf=wf,jf=Rf,Kf=Df,Xf=If;var Zf=Sf;var Yf=Ff;var Wf=function(){let t=Co(),e=To(1,0,0),r=To(0,1,0);return function(n,o,s){let i=xn(o,s);return i<-.999999?(Je(t,e,o),qs(t)<1e-6&&Je(t,r,o),Ks(t,t),Ei(n,t,Math.PI),n):i>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Je(t,o,s),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+i,Yf(n,n))}}(),NC=function(){let t=vf(),e=vf();return function(r,n,o,s,i,a){return Tn(t,n,i,a),Tn(e,o,s,a),Tn(r,t,e,2*a*(1-a)),r}}(),UC=function(){let t=df();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],Yf(e,yi(e,t))}}();var rm=[0,0,0,1],_e=class extends Be{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 yi(this,e),this.check()}fromAxisRotation(e,r){return Ei(this,e,r),this.check()}identity(){return Nf(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]=k(e)}get y(){return this[1]}set y(e){this[1]=k(e)}get z(){return this[2]}set z(e){this[2]=k(e)}get w(){return this[3]}set w(e){this[3]=k(e)}len(){return Xf(this)}lengthSquared(){return Zf(this)}dot(e){return jf(this,e)}rotationTo(e,r){return Wf(this,e,r),this.check()}add(e){return Qf(this,this,e),this.check()}calculateW(){return kf(this,this),this.check()}conjugate(){return zf(this,this),this.check()}invert(){return Jf(this,this),this.check()}lerp(e,r,n){return n===void 0?this.lerp(this,e,r):(Kf(this,e,r,n),this.check())}multiplyRight(e){return _i(this,this,e),this.check()}multiplyLeft(e){return _i(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 Uf(this,this,e),this.check()}rotateY(e){return Pf(this,this,e),this.check()}rotateZ(e){return Hf(this,this,e),this.check()}scale(e){return Vf(this,this,e),this.check()}slerp(e,r,n){let o,s,i;switch(arguments.length){case 1:({start:o=rm,target:s,ratio:i}=e);break;case 2:o=this,s=e,i=r;break;default:o=e,s=r,i=n}return Tn(this,o,s,i),this.check()}transformVector4(e,r=new br){return Lf(r,e,this),xe(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 Ft={};lt(Ft,{EPSILON1:()=>nm,EPSILON10:()=>um,EPSILON11:()=>dm,EPSILON12:()=>Am,EPSILON13:()=>mm,EPSILON14:()=>pm,EPSILON15:()=>gm,EPSILON16:()=>Bm,EPSILON17:()=>xm,EPSILON18:()=>Em,EPSILON19:()=>_m,EPSILON2:()=>om,EPSILON20:()=>ym,EPSILON3:()=>sm,EPSILON4:()=>im,EPSILON5:()=>am,EPSILON6:()=>cm,EPSILON7:()=>fm,EPSILON8:()=>lm,EPSILON9:()=>hm,PI_OVER_FOUR:()=>Tm,PI_OVER_SIX:()=>bm,PI_OVER_TWO:()=>Cm,TWO_PI:()=>Mm});var nm=.1,om=.01,sm=.001,im=1e-4,am=1e-5,cm=1e-6,fm=1e-7,lm=1e-8,hm=1e-9,um=1e-10,dm=1e-11,Am=1e-12,mm=1e-13,pm=1e-14,gm=1e-15,Bm=1e-16,xm=1e-17,Em=1e-18,_m=1e-19,ym=1e-20,Cm=Math.PI/2,Tm=Math.PI/4,bm=Math.PI/6,Mm=Math.PI*2;var se=6356752314245179e-9,wm={radii:[6378137,6378137,se],radiiSquared:[6378137*6378137,6378137*6378137,se*se],oneOverRadii:[1/6378137,1/6378137,1/se],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(se*se)],maximumRadius:Math.max(6378137,6378137,se),centerToleranceSquared:.1};function Ro(t){return t}var AT=new M;function Im(t,e=[],r=Ro){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 qf(t,e=[]){return Im(t,e,Z._cartographicRadians?Ro:zs)}function Sm(t,e,r=Ro){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 $f(t,e){return Sm(t,e,Z._cartographicRadians?Ro:Qs)}var tl=1e-14,Fm=new M,el={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"}},Ci={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},bn={east:new M,north:new M,up:new M,west:new M,south:new M,down:new M},Rm=new M,Dm=new M,Om=new M;function Ti(t,e,r,n,o,s){let i=el[e]&&el[e][r];at(i&&(!n||n===i));let a,f,c,l=Fm.copy(o);if(bt(l.x,0,tl)&&bt(l.y,0,tl)){let u=Math.sign(l.z);a=Rm.fromArray(Ci[e]),e!=="east"&&e!=="west"&&a.scale(u),f=Dm.fromArray(Ci[r]),r!=="east"&&r!=="west"&&f.scale(u),c=Om.fromArray(Ci[n]),n!=="east"&&n!=="west"&&c.scale(u)}else{let{up:u,east:d,north:A}=bn;d.set(-l.y,l.x,0).normalize(),t.geodeticSurfaceNormal(l,u),A.copy(u).cross(d);let{down:m,west:p,south:E}=bn;m.copy(u).scale(-1),p.copy(d).scale(-1),E.copy(A).scale(-1),a=bn[e],f=bn[r],c=bn[n]}return s[0]=a.x,s[1]=a.y,s[2]=a.z,s[3]=0,s[4]=f.x,s[5]=f.y,s[6]=f.z,s[7]=0,s[8]=c.x,s[9]=c.y,s[10]=c.z,s[11]=0,s[12]=l.x,s[13]=l.y,s[14]=l.z,s[15]=1,s}var wr=new M,Lm=new M,Gm=new M;function rl(t,e,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:o,centerToleranceSquared:s}=e;wr.from(t);let i=wr.x,a=wr.y,f=wr.z,c=n.x,l=n.y,h=n.z,u=i*i*c*c,d=a*a*l*l,A=f*f*h*h,m=u+d+A,p=Math.sqrt(1/m);if(!Number.isFinite(p))return;let E=Lm;if(E.copy(t).scale(p),m<s)return E.to(r);let y=o.x,T=o.y,b=o.z,C=Gm;C.set(E.x*y*2,E.y*T*2,E.z*b*2);let w=(1-p)*wr.len()/(.5*C.len()),I=0,O,B,g,x;do{w-=I,O=1/(1+w*y),B=1/(1+w*T),g=1/(1+w*b);let _=O*O,U=B*B,N=g*g,P=_*O,G=U*B,tt=N*g;x=u*_+d*U+A*N-1;let Y=-2*(u*P*y+d*G*T+A*tt*b);I=x/Y}while(Math.abs(x)>Ft.EPSILON12);return wr.scale([O,B,g]).to(r)}var Do=new M,nl=new M,Um=new M,Pt=new M,Pm=new M,Oo=new M,ie=class{constructor(e=0,r=0,n=0){this.centerToleranceSquared=Ft.EPSILON1,at(e>=0),at(r>=0),at(n>=0),this.radii=new M(e,r,n),this.radiiSquared=new M(e*e,r*r,n*n),this.radiiToTheFourth=new M(e*e*e*e,r*r*r*r,n*n*n*n),this.oneOverRadii=new M(e===0?0:1/e,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new M(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=nl,o=Um,[,,s]=e;this.geodeticSurfaceNormalCartographic(e,n),o.copy(this.radiiSquared).scale(n);let i=Math.sqrt(n.dot(o));return o.scale(1/i),n.scale(s),o.add(n),o.to(r)}cartesianToCartographic(e,r=[0,0,0]){Oo.from(e);let n=this.scaleToGeodeticSurface(Oo,Pt);if(!n)return;let o=this.geodeticSurfaceNormal(n,nl),s=Pm;s.copy(Oo).subtract(n);let i=Math.atan2(o.y,o.x),a=Math.asin(o.z),f=Math.sign(Qe.dot(s,Oo))*Qe.length(s);return $f([i,a,f],r)}eastNorthUpToFixedFrame(e,r=new St){return Ti(this,"east","north","up",e,r)}localFrameToFixedFrame(e,r,n,o,s=new St){return Ti(this,e,r,n,o,s)}geocentricSurfaceNormal(e,r=[0,0,0]){return Do.from(e).normalize().to(r)}geodeticSurfaceNormalCartographic(e,r=[0,0,0]){let n=qf(e),o=n[0],s=n[1],i=Math.cos(s);return Do.set(i*Math.cos(o),i*Math.sin(o),Math.sin(s)).normalize(),Do.to(r)}geodeticSurfaceNormal(e,r=[0,0,0]){return Do.from(e).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(e,r){return rl(e,this,r)}scaleToGeocentricSurface(e,r=[0,0,0]){Pt.from(e);let n=Pt.x,o=Pt.y,s=Pt.z,i=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*i.x+o*o*i.y+s*s*i.z);return Pt.multiplyScalar(a).to(r)}transformPositionToScaledSpace(e,r=[0,0,0]){return Pt.from(e).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(e,r=[0,0,0]){return Pt.from(e).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(e,r=0,n=[0,0,0]){at(bt(this.radii.x,this.radii.y,Ft.EPSILON15)),at(this.radii.z>0),Pt.from(e);let o=Pt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(o)>=this.radii.z-r))return Pt.set(0,0,o).to(n)}};ie.WGS84=new ie(6378137,6378137,se);var ct={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var OT=new M,LT=new M;var Mn=new M,ol=new M,ye=class{constructor(e=[0,0,0],r=0){this.radius=-0,this.center=new M,this.fromCenterRadius(e,r)}fromCenterRadius(e,r){return this.center.from(e),this.radius=r,this}fromCornerPoints(e,r){return r=Mn.from(r),this.center=new M().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 ye(this.center,this.radius)}union(e){let r=this.center,n=this.radius,o=e.center,s=e.radius,i=Mn.copy(o).subtract(r),a=i.magnitude();if(n>=a+s)return this.clone();if(s>=a+n)return e.clone();let f=(n+a+s)*.5;return ol.copy(i).scale((-n+f)/a).add(r),this.center.copy(ol),this.radius=f,this}expand(e){let n=Mn.from(e).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(e){this.center.transform(e);let r=Cn.getScaling(Mn,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=Mn.from(e).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(e){let r=this.center,n=this.radius,s=e.normal.dot(r)+e.distance;return s<-n?ct.OUTSIDE:s<n?ct.INTERSECTING:ct.INSIDE}};var Hm=new M,km=new M,Lo=new M,Go=new M,vo=new M,Jm=new M,zm=new M,ae={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},Ve=class{constructor(e=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){this.center=new M().from(e),this.halfAxes=new X(r)}get halfSize(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new M(e).len(),new M(r).len(),new M(n).len()]}get quaternion(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),o=new M(e).normalize(),s=new M(r).normalize(),i=new M(n).normalize();return new _e().fromMatrix3(new X([...o,...s,...i]))}fromCenterHalfSizeQuaternion(e,r,n){let o=new _e(n),s=new X().fromQuaternion(o);return s[0]=s[0]*r[0],s[1]=s[1]*r[0],s[2]=s[2]*r[0],s[3]=s[3]*r[1],s[4]=s[4]*r[1],s[5]=s[5]*r[1],s[6]=s[6]*r[2],s[7]=s[7]*r[2],s[8]=s[8]*r[2],this.center=new M().from(e),this.halfAxes=s,this}clone(){return new Ve(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new ye){let r=this.halfAxes,n=r.getColumn(0,Lo),o=r.getColumn(1,Go),s=r.getColumn(2,vo),i=Hm.copy(n).add(o).add(s);return e.center.copy(this.center),e.radius=i.magnitude(),e}intersectPlane(e){let r=this.center,n=e.normal,o=this.halfAxes,s=n.x,i=n.y,a=n.z,f=Math.abs(s*o[ae.COLUMN0ROW0]+i*o[ae.COLUMN0ROW1]+a*o[ae.COLUMN0ROW2])+Math.abs(s*o[ae.COLUMN1ROW0]+i*o[ae.COLUMN1ROW1]+a*o[ae.COLUMN1ROW2])+Math.abs(s*o[ae.COLUMN2ROW0]+i*o[ae.COLUMN2ROW1]+a*o[ae.COLUMN2ROW2]),c=n.dot(r)+e.distance;return c<=-f?ct.OUTSIDE:c>=f?ct.INSIDE:ct.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let r=km.from(e).subtract(this.center),n=this.halfAxes,o=n.getColumn(0,Lo),s=n.getColumn(1,Go),i=n.getColumn(2,vo),a=o.magnitude(),f=s.magnitude(),c=i.magnitude();o.normalize(),s.normalize(),i.normalize();let l=0,h;return h=Math.abs(r.dot(o))-a,h>0&&(l+=h*h),h=Math.abs(r.dot(s))-f,h>0&&(l+=h*h),h=Math.abs(r.dot(i))-c,h>0&&(l+=h*h),l}computePlaneDistances(e,r,n=[-0,-0]){let o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,i=this.center,a=this.halfAxes,f=a.getColumn(0,Lo),c=a.getColumn(1,Go),l=a.getColumn(2,vo),h=Jm.copy(f).add(c).add(l).add(i),u=zm.copy(h).subtract(e),d=r.dot(u);return o=Math.min(d,o),s=Math.max(d,s),h.copy(i).add(f).add(c).subtract(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),h.copy(i).add(f).subtract(c).add(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),h.copy(i).add(f).subtract(c).subtract(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),i.copy(h).subtract(f).add(c).add(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),i.copy(h).subtract(f).add(c).subtract(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),i.copy(h).subtract(f).subtract(c).add(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),i.copy(h).subtract(f).subtract(c).subtract(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),n[0]=o,n[1]=s,n}transform(e){this.center.transformAsPoint(e);let r=this.halfAxes.getColumn(0,Lo);r.transformAsPoint(e);let n=this.halfAxes.getColumn(1,Go);n.transformAsPoint(e);let o=this.halfAxes.getColumn(2,vo);return o.transformAsPoint(e),this.halfAxes=new X([...r,...n,...o]),this}getTransform(){throw new Error("not implemented")}};var sl=new M,il=new M,ce=class{constructor(e=[0,0,1],r=0){this.normal=new M,this.distance=-0,this.fromNormalDistance(e,r)}fromNormalDistance(e,r){return at(Number.isFinite(r)),this.normal.from(e).normalize(),this.distance=r,this}fromPointNormal(e,r){e=sl.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),at(bt(this.normal.len(),1)),this.distance=o,this}clone(){return new ce(this.normal,this.distance)}equals(e){return bt(this.distance,e.distance)&&bt(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){let r=il.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=sl.from(e),o=this.getPointDistance(n),s=il.copy(this.normal).scale(o);return n.subtract(s).to(r)}};var al=[new M([1,0,0]),new M([0,1,0]),new M([0,0,1])],cl=new M,Qm=new M,Rt=class{constructor(e=[]){this.planes=e}fromBoundingSphere(e){this.planes.length=2*al.length;let r=e.center,n=e.radius,o=0;for(let s of al){let i=this.planes[o],a=this.planes[o+1];i||(i=this.planes[o]=new ce),a||(a=this.planes[o+1]=new ce);let f=cl.copy(s).scale(-n).add(r);i.fromPointNormal(f,s);let c=cl.copy(s).scale(n).add(r),l=Qm.copy(s).negate();a.fromPointNormal(c,l),o+=2}return this}computeVisibility(e){let r=ct.INSIDE;for(let n of this.planes)switch(e.intersectPlane(n)){case ct.OUTSIDE:return ct.OUTSIDE;case ct.INTERSECTING:r=ct.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(e,r){if(at(Number.isFinite(r),"parentPlaneMask is required."),r===Rt.MASK_OUTSIDE||r===Rt.MASK_INSIDE)return r;let n=Rt.MASK_INSIDE,o=this.planes;for(let s=0;s<this.planes.length;++s){let i=s<31?1<<s:0;if(s<31&&!(r&i))continue;let a=o[s],f=e.intersectPlane(a);if(f===ct.OUTSIDE)return Rt.MASK_OUTSIDE;f===ct.INTERSECTING&&(n|=i)}return n}};Rt.MASK_OUTSIDE=4294967295;Rt.MASK_INSIDE=0;Rt.MASK_INDETERMINATE=2147483647;var qT=new M,$T=new M,tb=new M,eb=new M,rb=new M;var cb=new M,fb=new M,lb=new M,hb=new M,ub=new M,db=new M,Ab=new M,mb=new M,pb=new M,gb=new M,Bb=new M,xb=new M;var Zt=new X,jm=new X,Km=new X,No=new X,fl=new X;function wi(t,e={}){let r=Ft.EPSILON20,n=10,o=0,s=0,i=jm,a=Km;i.identity(),a.copy(t);let f=r*Xm(a);for(;s<n&&Zm(a)>f;)Ym(a,No),fl.copy(No).transpose(),a.multiplyRight(No),a.multiplyLeft(fl),i.multiplyRight(No),++o>2&&(++s,o=0);return e.unitary=i.toTarget(e.unitary),e.diagonal=a.toTarget(e.diagonal),e}function Xm(t){let e=0;for(let r=0;r<9;++r){let n=t[r];e+=n*n}return Math.sqrt(e)}var bi=[1,0,0],Mi=[2,2,1];function Zm(t){let e=0;for(let r=0;r<3;++r){let n=t[Zt.getElementIndex(Mi[r],bi[r])];e+=2*n*n}return Math.sqrt(e)}function Ym(t,e){let r=Ft.EPSILON15,n=0,o=1;for(let c=0;c<3;++c){let l=Math.abs(t[Zt.getElementIndex(Mi[c],bi[c])]);l>n&&(o=c,n=l)}let s=bi[o],i=Mi[o],a=1,f=0;if(Math.abs(t[Zt.getElementIndex(i,s)])>r){let c=t[Zt.getElementIndex(i,i)],l=t[Zt.getElementIndex(s,s)],h=t[Zt.getElementIndex(i,s)],u=(c-l)/2/h,d;u<0?d=-1/(-u+Math.sqrt(1+u*u)):d=1/(u+Math.sqrt(1+u*u)),a=1/Math.sqrt(1+d*d),f=d*a}return X.IDENTITY.to(e),e[Zt.getElementIndex(s,s)]=e[Zt.getElementIndex(i,i)]=a,e[Zt.getElementIndex(i,s)]=f,e[Zt.getElementIndex(s,i)]=-f,e}var Ce=new M,qm=new M,$m=new M,tp=new M,ep=new M,rp=new X,np={diagonal:new X,unitary:new X};function Ii(t,e=new Ve){if(!t||t.length===0)return e.halfAxes=new X([0,0,0,0,0,0,0,0,0]),e.center=new M,e;let r=t.length,n=new M(0,0,0);for(let B of t)n.add(B);let o=1/r;n.multiplyByScalar(o);let s=0,i=0,a=0,f=0,c=0,l=0;for(let B of t){let g=Ce.copy(B).subtract(n);s+=g.x*g.x,i+=g.x*g.y,a+=g.x*g.z,f+=g.y*g.y,c+=g.y*g.z,l+=g.z*g.z}s*=o,i*=o,a*=o,f*=o,c*=o,l*=o;let h=rp;h[0]=s,h[1]=i,h[2]=a,h[3]=i,h[4]=f,h[5]=c,h[6]=a,h[7]=c,h[8]=l;let{unitary:u}=wi(h,np),d=e.halfAxes.copy(u),A=d.getColumn(0,$m),m=d.getColumn(1,tp),p=d.getColumn(2,ep),E=-Number.MAX_VALUE,y=-Number.MAX_VALUE,T=-Number.MAX_VALUE,b=Number.MAX_VALUE,C=Number.MAX_VALUE,w=Number.MAX_VALUE;for(let B of t)Ce.copy(B),E=Math.max(Ce.dot(A),E),y=Math.max(Ce.dot(m),y),T=Math.max(Ce.dot(p),T),b=Math.min(Ce.dot(A),b),C=Math.min(Ce.dot(m),C),w=Math.min(Ce.dot(p),w);A=A.multiplyByScalar(.5*(b+E)),m=m.multiplyByScalar(.5*(C+y)),p=p.multiplyByScalar(.5*(w+T)),e.center.copy(A).add(m).add(p);let I=qm.set(E-b,y-C,T-w).multiplyByScalar(.5),O=new X([I[0],0,0,0,I[1],0,0,0,I[2]]);return e.halfAxes.multiplyRight(O),e}var Ir;(function(t){t[t.ADD=1]="ADD",t[t.REPLACE=2]="REPLACE"})(Ir||(Ir={}));var Te;(function(t){t.EMPTY="empty",t.SCENEGRAPH="scenegraph",t.POINTCLOUD="pointcloud",t.MESH="mesh"})(Te||(Te={}));var wn;(function(t){t.I3S="I3S",t.TILES3D="TILES3D"})(wn||(wn={}));var fe;(function(t){t.GEOMETRIC_ERROR="geometricError",t.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(fe||(fe={}));var Sr="4.3.0-beta.1";var xt={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},Xb=Object.keys(xt),be={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function Si(t,e,r){z(t instanceof ArrayBuffer);let n=new TextDecoder("utf8"),o=new Uint8Array(t,e,r);return n.decode(o)}function ll(t,e=0){let r=new DataView(t);return`${String.fromCharCode(r.getUint8(e+0))}${String.fromCharCode(r.getUint8(e+1))}${String.fromCharCode(r.getUint8(e+2))}${String.fromCharCode(r.getUint8(e+3))}`}var hl="4.3.0-beta.1";var ul={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:hl,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 dl(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 Fi(t){let e=1/0,r=1/0,n=1/0,o=-1/0,s=-1/0,i=-1/0,a=t.POSITION?t.POSITION.value:[],f=a&&a.length;for(let c=0;c<f;c+=3){let l=a[c],h=a[c+1],u=a[c+2];e=l<e?l:e,r=h<r?h:r,n=u<n?u:n,o=l>o?l:o,s=h>s?h:s,i=u>i?u:i}return[[e,r,n],[o,s,i]]}function Ri(t,e,r){let n=dl(e.value),o=r||Al(e);return{name:t,type:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:n}]},nullable:!1,metadata:o}}function Al(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 pl(t,e,r){let n=gl(e.metadata),o=[],s=op(e.attributes);for(let i in t){let a=t[i],f=ml(i,a,s[i]);o.push(f)}if(r){let i=ml("indices",r);o.push(i)}return{fields:o,metadata:n}}function op(t){let e={};for(let r in t){let n=t[r];e[n.name||"undefined"]=n}return e}function ml(t,e,r){let n=r?gl(r.metadata):void 0;return Ri(t,e,n)}function gl(t){Object.entries(t);let e={};for(let r in t)e[`${r}.string`]=JSON.stringify(t[r]);return e}var Bl={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},sp={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},ip=4,In=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),s=o===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let i;switch(o){case this.draco.TRIANGULAR_MESH:i=this.decoder.DecodeBufferToMesh(n,s);break;case this.draco.POINT_CLOUD:i=this.decoder.DecodeBufferToPointCloud(n,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!i.ok()||!s.ptr){let u=`DRACO decompression failed: ${i.error_msg()}`;throw new Error(u)}let a=this._getDracoLoaderData(s,o,r),f=this._getMeshData(s,a,r),c=Fi(f.attributes),l=pl(f.attributes,a,f.indices);return{loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c},...f,schema:l}}finally{this.draco.destroy(n),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,r,n){let o=this._getTopLevelMetadata(e),s=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:s}}_getDracoAttributes(e,r){let n={};for(let o=0;o<e.num_attributes();o++){let s=this.decoder.GetAttribute(e,o),i=this._getAttributeMetadata(e,o);n[s.unique_id()]={unique_id:s.unique_id(),attribute_type:s.attribute_type(),data_type:s.data_type(),num_components:s.num_components(),byte_offset:s.byte_offset(),byte_stride:s.byte_stride(),normalized:s.normalized(),attribute_index:o,metadata:i};let a=this._getQuantizationTransform(s,r);a&&(n[s.unique_id()].quantization_transform=a);let f=this._getOctahedronTransform(s,r);f&&(n[s.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 s of Object.values(e.attributes)){let i=this._deduceAttributeName(s,n);s.name=i;let a=this._getAttributeValues(r,s);if(a){let{value:f,size:c}=a;o[i]={value:f,size:c,byteOffset:s.byte_offset,byteStride:s.byte_stride,normalized:s.normalized}}}return o}_getTriangleListIndices(e){let n=e.num_faces()*3,o=n*ip,s=this.draco._malloc(o);try{return this.decoder.GetTrianglesUInt32Array(e,o,s),new Uint32Array(this.draco.HEAPF32.buffer,s,n).slice()}finally{this.draco._free(s)}}_getTriangleStripIndices(e){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,r),fp(r)}finally{this.draco.destroy(r)}}_getAttributeValues(e,r){let n=sp[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let o=r.num_components,i=e.num_points()*o,a=i*n.BYTES_PER_ELEMENT,f=ap(this.draco,n),c,l=this.draco._malloc(a);try{let h=this.decoder.GetAttribute(e,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,h,f,a,l),c=new n(this.draco.HEAPF32.buffer,l,i).slice()}finally{this.draco._free(l)}return{value:c,size:o}}_deduceAttributeName(e,r){let n=e.unique_id;for(let[i,a]of Object.entries(r.extraAttributes||{}))if(a===n)return i;let o=e.attribute_type;for(let i in Bl)if(this.draco[i]===o)return Bl[i];let s=r.attributeNameEntry||"name";return e.metadata[s]?e.metadata[s].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 s=this.metadataQuerier.GetEntryName(e,o);r[s]=this._getDracoMetadataField(e,s)}return r}_getDracoMetadataField(e,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,r,n);let o=cp(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 s of o)this.decoder.SkipAttributeTransform(this.draco[s])}_getQuantizationTransform(e,r){let{quantizedAttributes:n=[]}=r,o=e.attribute_type();if(n.map(i=>this.decoder[i]).includes(o)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(e))return{quantization_bits:i.quantization_bits(),range:i.range(),min_values:new Float32Array([1,2,3]).map(a=>i.min_value(a))}}finally{this.draco.destroy(i)}}return null}_getOctahedronTransform(e,r){let{octahedronAttributes:n=[]}=r,o=e.attribute_type();if(n.map(i=>this.decoder[i]).includes(o)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(e))return{quantization_bits:i.quantization_bits()}}finally{this.draco.destroy(i)}}return null}};function ap(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 cp(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}function fp(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}var lp="1.5.6",hp="1.4.1",Di=`https://www.gstatic.com/draco/versioned/decoders/${lp}`,Et={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},Oi={[Et.DECODER]:`${Di}/${Et.DECODER}`,[Et.DECODER_WASM]:`${Di}/${Et.DECODER_WASM}`,[Et.FALLBACK_DECODER]:`${Di}/${Et.FALLBACK_DECODER}`,[Et.ENCODER]:`https://raw.githubusercontent.com/google/draco/${hp}/javascript/${Et.ENCODER}`},Li;async function xl(t){let e=t.modules||{};return e.draco3d?Li||=e.draco3d.createDecoderModule({}).then(r=>({draco:r})):Li||=up(t),await Li}async function up(t){let e,r;switch(t.draco&&t.draco.decoderType){case"js":e=await Xt(Oi[Et.FALLBACK_DECODER],"draco",t,Et.FALLBACK_DECODER);break;case"wasm":default:[e,r]=await Promise.all([await Xt(Oi[Et.DECODER],"draco",t,Et.DECODER),await Xt(Oi[Et.DECODER_WASM],"draco",t,Et.DECODER_WASM)])}return e=e||globalThis.DracoDecoderModule,await dp(e,r)}function dp(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t({...r,onModuleLoaded:o=>n({draco:o})})})}var Uo={...ul,parse:Ap};async function Ap(t,e){let{draco:r}=await xl(e),n=new In(r);try{return n.parseSync(t,e?.draco)}finally{n.destroy()}}var mp={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},rt={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},H={...mp,...rt};var Gi={[rt.DOUBLE]:Float64Array,[rt.FLOAT]:Float32Array,[rt.UNSIGNED_SHORT]:Uint16Array,[rt.UNSIGNED_INT]:Uint32Array,[rt.UNSIGNED_BYTE]:Uint8Array,[rt.BYTE]:Int8Array,[rt.SHORT]:Int16Array,[rt.INT]:Int32Array},pp={DOUBLE:rt.DOUBLE,FLOAT:rt.FLOAT,UNSIGNED_SHORT:rt.UNSIGNED_SHORT,UNSIGNED_INT:rt.UNSIGNED_INT,UNSIGNED_BYTE:rt.UNSIGNED_BYTE,BYTE:rt.BYTE,SHORT:rt.SHORT,INT:rt.INT},vi="Failed to convert GL type",ht=class{static fromTypedArray(e){e=ArrayBuffer.isView(e)?e.constructor:e;for(let r in Gi)if(Gi[r]===e)return r;throw new Error(vi)}static fromName(e){let r=pp[e];if(!r)throw new Error(vi);return r}static getArrayType(e){switch(e){case rt.UNSIGNED_SHORT_5_6_5:case rt.UNSIGNED_SHORT_4_4_4_4:case rt.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=Gi[e];if(!r)throw new Error(vi);return r}}static getByteSize(e){return ht.getArrayType(e).BYTES_PER_ELEMENT}static validate(e){return Boolean(ht.getArrayType(e))}static createTypedArray(e,r,n=0,o){o===void 0&&(o=(r.byteLength-n)/ht.getByteSize(e));let s=ht.getArrayType(e);return new s(r,n,o)}};function El(t,e){if(!t)throw new Error(`math.gl assertion failed. ${e}`)}function Ni(t,e=[0,0,0]){let r=t>>11&31,n=t>>5&63,o=t&31;return e[0]=r<<3,e[1]=n<<2,e[2]=o<<3,e}var IM=1/256;var SM=new ke,FM=new M,RM=new ke,DM=new ke,OM=new Uint8Array(1);function _l(t,e=255){return Vs(t,0,e)/e*2-1}function yl(t){return t<0?-1:1}function Cl(t,e,r,n){if(El(n),t<0||t>r||e<0||e>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(n.x=_l(t,r),n.y=_l(e,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){let o=n.x;n.x=(1-Math.abs(n.y))*yl(o),n.y=(1-Math.abs(o))*yl(n.y)}return n.normalize()}function Ui(t,e,r){return Cl(t,e,255,r)}var Ht=class{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(e,r){this.json=e,this.buffer=r}getExtension(e){return this.json.extensions&&this.json.extensions[e]}hasProperty(e){return Boolean(this.json[e])}getGlobalProperty(e,r=H.UNSIGNED_INT,n=1){let o=this.json[e];return o&&Number.isFinite(o.byteOffset)?this._getTypedArrayFromBinary(e,r,n,1,o.byteOffset):o}getPropertyArray(e,r,n){let o=this.json[e];return o&&Number.isFinite(o.byteOffset)?("componentType"in o&&(r=ht.fromName(o.componentType)),this._getTypedArrayFromBinary(e,r,n,this.featuresLength,o.byteOffset)):this._getTypedArrayFromArray(e,r,o)}getProperty(e,r,n,o,s){let i=this.json[e];if(!i)return i;let a=this.getPropertyArray(e,r,n);if(n===1)return a[o];for(let f=0;f<n;++f)s[f]=a[n*o+f];return s}_getTypedArrayFromBinary(e,r,n,o,s){let i=this._cachedTypedArrays,a=i[e];return a||(a=ht.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+s,o*n),i[e]=a),a}_getTypedArrayFromArray(e,r,n){let o=this._cachedTypedArrays,s=o[e];return s||(s=ht.createTypedArray(r,n),o[e]=s),s}};var gp={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Bp={SCALAR:(t,e)=>t[e],VEC2:(t,e)=>[t[2*e+0],t[2*e+1]],VEC3:(t,e)=>[t[3*e+0],t[3*e+1],t[3*e+2]],VEC4:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT2:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT3:(t,e)=>[t[9*e+0],t[9*e+1],t[9*e+2],t[9*e+3],t[9*e+4],t[9*e+5],t[9*e+6],t[9*e+7],t[9*e+8]],MAT4:(t,e)=>[t[16*e+0],t[16*e+1],t[16*e+2],t[16*e+3],t[16*e+4],t[16*e+5],t[16*e+6],t[16*e+7],t[16*e+8],t[16*e+9],t[16*e+10],t[16*e+11],t[16*e+12],t[16*e+13],t[16*e+14],t[16*e+15]]},xp={SCALAR:(t,e,r)=>{e[r]=t},VEC2:(t,e,r)=>{e[2*r+0]=t[0],e[2*r+1]=t[1]},VEC3:(t,e,r)=>{e[3*r+0]=t[0],e[3*r+1]=t[1],e[3*r+2]=t[2]},VEC4:(t,e,r)=>{e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT2:(t,e,r)=>{e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT3:(t,e,r)=>{e[9*r+0]=t[0],e[9*r+1]=t[1],e[9*r+2]=t[2],e[9*r+3]=t[3],e[9*r+4]=t[4],e[9*r+5]=t[5],e[9*r+6]=t[6],e[9*r+7]=t[7],e[9*r+8]=t[8],e[9*r+9]=t[9]},MAT4:(t,e,r)=>{e[16*r+0]=t[0],e[16*r+1]=t[1],e[16*r+2]=t[2],e[16*r+3]=t[3],e[16*r+4]=t[4],e[16*r+5]=t[5],e[16*r+6]=t[6],e[16*r+7]=t[7],e[16*r+8]=t[8],e[16*r+9]=t[9],e[16*r+10]=t[10],e[16*r+11]=t[11],e[16*r+12]=t[12],e[16*r+13]=t[13],e[16*r+14]=t[14],e[16*r+15]=t[15]}};function Tl(t,e,r,n){let{componentType:o}=t;z(t.componentType);let s=typeof o=="string"?ht.fromName(o):o,i=gp[t.type],a=Bp[t.type],f=xp[t.type];return r+=t.byteOffset,{values:ht.createTypedArray(s,e,r,i*n),type:s,size:i,unpacker:a,packer:f}}var Yt=t=>t!==void 0;function bl(t,e,r){if(!e)return null;let n=t.getExtension("3DTILES_batch_table_hierarchy"),o=e.HIERARCHY;return o&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),e.extensions=e.extensions||{},e.extensions["3DTILES_batch_table_hierarchy"]=o,n=o),n?Ep(n,r):null}function Ep(t,e){let r,n,o,s=t.instancesLength,i=t.classes,a=t.classIds,f=t.parentCounts,c=t.parentIds,l=s;Yt(a.byteOffset)&&(a.componentType=defaultValue(a.componentType,GL.UNSIGNED_SHORT),a.type=AttributeType.SCALAR,o=getBinaryAccessor(a),a=o.createArrayBufferView(e.buffer,e.byteOffset+a.byteOffset,s));let h;if(Yt(f))for(Yt(f.byteOffset)&&(f.componentType=defaultValue(f.componentType,GL.UNSIGNED_SHORT),f.type=AttributeType.SCALAR,o=getBinaryAccessor(f),f=o.createArrayBufferView(e.buffer,e.byteOffset+f.byteOffset,s)),h=new Uint16Array(s),l=0,r=0;r<s;++r)h[r]=l,l+=f[r];Yt(c)&&Yt(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,o=getBinaryAccessor(c),c=o.createArrayBufferView(e.buffer,e.byteOffset+c.byteOffset,l));let u=i.length;for(r=0;r<u;++r){let p=i[r].length,E=i[r].instances,y=getBinaryProperties(p,E,e);i[r].instances=combine(y,E)}let d=new Array(u).fill(0),A=new Uint16Array(s);for(r=0;r<s;++r)n=a[r],A[r]=d[n],++d[n];let m={classes:i,classIds:a,classIndexes:A,parentCounts:f,parentIndexes:h,parentIds:c};return Cp(m),m}function Fr(t,e,r){if(!t)return;let n=t.parentCounts;return t.parentIds?r(t,e):n>0?_p(t,e,r):yp(t,e,r)}function _p(t,e,r){let n=t.classIds,o=t.parentCounts,s=t.parentIds,i=t.parentIndexes,a=n.length,f=scratchVisited;f.length=Math.max(f.length,a);let c=++marker,l=scratchStack;for(l.length=0,l.push(e);l.length>0;){if(e=l.pop(),f[e]===c)continue;f[e]=c;let h=r(t,e);if(Yt(h))return h;let u=o[e],d=i[e];for(let A=0;A<u;++A){let m=s[d+A];m!==e&&l.push(m)}}return null}function yp(t,e,r){let n=!0;for(;n;){let o=r(t,e);if(Yt(o))return o;let s=t.parentIds[e];n=s!==e,e=s}throw new Error("traverseHierarchySingleParent")}function Cp(t){let e=[],n=t.classIds.length;for(let o=0;o<n;++o)Ml(t,o,stack)}function Ml(t,e,r){let n=t.parentCounts,o=t.parentIds,s=t.parentIndexes,a=t.classIds.length;if(!Yt(o))return;assert(e<a,`Parent index ${e} exceeds the total number of instances: ${a}`),assert(r.indexOf(e)===-1,"Circular dependency detected in the batch table hierarchy."),r.push(e);let f=Yt(n)?n[e]:1,c=Yt(n)?s[e]:e;for(let l=0;l<f;++l){let h=o[c+l];h!==e&&Ml(t,h,r)}r.pop(e)}function _t(t){return t!=null}var Po=(t,e)=>t,Tp={HIERARCHY:!0,extensions:!0,extras:!0},le=class{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(e,r,n,o={}){z(n>=0),this.json=e||{},this.binary=r,this.featureCount=n,this._extensions=this.json?.extensions||{},this._properties={};for(let s in this.json)Tp[s]||(this._properties[s]=this.json[s]);this._binaryProperties=this._initializeBinaryProperties(),o["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=bl(this,this.json,this.binary))}getExtension(e){return this.json&&this.json.extensions&&this.json.extensions[e]}memorySizeInBytes(){return 0}isClass(e,r){if(this._checkBatchId(e),z(typeof r=="string",r),this._hierarchy){let n=Fr(this._hierarchy,e,(o,s)=>{let i=o.classIds[s];return o.classes[i].name===r});return _t(n)}return!1}isExactClass(e,r){return z(typeof r=="string",r),this.getExactClassName(e)===r}getExactClassName(e){if(this._checkBatchId(e),this._hierarchy){let r=this._hierarchy.classIds[e];return this._hierarchy.classes[r].name}}hasProperty(e,r){return this._checkBatchId(e),z(typeof r=="string",r),_t(this._properties[r])||this._hasPropertyInHierarchy(e,r)}getPropertyNames(e,r){this._checkBatchId(e),r=_t(r)?r:[],r.length=0;let n=Object.keys(this._properties);return r.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(e,r),r}getProperty(e,r){if(this._checkBatchId(e),z(typeof r=="string",r),this._binaryProperties){let o=this._binaryProperties[r];if(_t(o))return this._getBinaryProperty(o,e)}let n=this._properties[r];if(_t(n))return Po(n[e],!0);if(this._hierarchy){let o=this._getHierarchyProperty(e,r);if(_t(o))return o}}setProperty(e,r,n){let o=this.featureCount;if(this._checkBatchId(e),z(typeof r=="string",r),this._binaryProperties){let i=this._binaryProperties[r];if(i){this._setBinaryProperty(i,e,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,e,r,n))return;let s=this._properties[r];_t(s)||(this._properties[r]=new Array(o),s=this._properties[r]),s[e]=Po(n,!0)}_checkBatchId(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(e,r){return e.unpack(e.typedArray,r)}_setBinaryProperty(e,r,n){e.pack(n,e.typedArray,r)}_initializeBinaryProperties(){let e=null;for(let r in this._properties){let n=this._properties[r],o=this._initializeBinaryProperty(r,n);o&&(e=e||{},e[r]=o)}return e}_initializeBinaryProperty(e,r){if("byteOffset"in r){let n=r;z(this.binary,`Property ${e} requires a batch table binary.`),z(n.type,`Property ${e} requires a type.`);let o=Tl(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:o.values,componentCount:o.size,unpack:o.unpacker,pack:o.packer}}return null}_hasPropertyInHierarchy(e,r){if(!this._hierarchy)return!1;let n=Fr(this._hierarchy,e,(o,s)=>{let i=o.classIds[s],a=o.classes[i].instances;return _t(a[r])});return _t(n)}_getPropertyNamesInHierarchy(e,r){Fr(this._hierarchy,e,(n,o)=>{let s=n.classIds[o],i=n.classes[s].instances;for(let a in i)i.hasOwnProperty(a)&&r.indexOf(a)===-1&&r.push(a)})}_getHierarchyProperty(e,r){return Fr(this._hierarchy,e,(n,o)=>{let s=n.classIds[o],i=n.classes[s],a=n.classIndexes[o],f=i.instances[r];return _t(f)?_t(f.typedArray)?this._getBinaryProperty(f,a):Po(f[a],!0):null})}_setHierarchyProperty(e,r,n,o){let s=Fr(this._hierarchy,r,(i,a)=>{let f=i.classIds[a],c=i.classes[f],l=i.classIndexes[a],h=c.instances[n];return _t(h)?(z(a===r,`Inherited property "${n}" is read-only.`),_t(h.typedArray)?this._setBinaryProperty(h,l,o):h[l]=Po(o,!0),!0):!1});return _t(s)}};function Me(t,e,r=0){let n=new DataView(e);if(t.magic=n.getUint32(r,!0),r+=4,t.version=n.getUint32(r,!0),r+=4,t.byteLength=n.getUint32(r,!0),r+=4,t.version!==1)throw new Error(`3D Tile Version ${t.version} not supported`);return r}var Rr=4,wl="b3dm tile in legacy format.";function Dr(t,e,r){let n=new DataView(e),o;t.header=t.header||{};let s=n.getUint32(r,!0);r+=Rr;let i=n.getUint32(r,!0);r+=Rr;let a=n.getUint32(r,!0);r+=Rr;let f=n.getUint32(r,!0);return r+=Rr,a>=570425344?(r-=Rr*2,o=s,a=i,f=0,s=0,i=0,console.warn(wl)):f>=570425344&&(r-=Rr,o=a,a=s,f=i,s=0,i=0,console.warn(wl)),t.header.featureTableJsonByteLength=s,t.header.featureTableBinaryByteLength=i,t.header.batchTableJsonByteLength=a,t.header.batchTableBinaryByteLength=f,t.header.batchLength=o,r}function Or(t,e,r,n){return r=bp(t,e,r,n),r=Mp(t,e,r,n),r}function bp(t,e,r,n){let{featureTableJsonByteLength:o,featureTableBinaryByteLength:s,batchLength:i}=t.header||{};if(t.featureTableJson={BATCH_LENGTH:i||0},o&&o>0){let a=Si(e,r,o);t.featureTableJson=JSON.parse(a)}return r+=o||0,t.featureTableBinary=new Uint8Array(e,r,s),r+=s||0,r}function Mp(t,e,r,n){let{batchTableJsonByteLength:o,batchTableBinaryByteLength:s}=t.header||{};if(o&&o>0){let i=Si(e,r,o);t.batchTableJson=JSON.parse(i),r+=o,s&&s>0&&(t.batchTableBinary=new Uint8Array(e,r,s),t.batchTableBinary=new Uint8Array(t.batchTableBinary),r+=s)}return r}function Pi(t,e,r){if(!e&&(!t||!t.batchIds||!r))return null;let{batchIds:n,isRGB565:o,pointCount:s=0}=t;if(n&&r){let i=new Uint8ClampedArray(s*3);for(let a=0;a<s;a++){let f=n[a],l=r.getProperty(f,"dimensions").map(h=>h*255);i[a*3]=l[0],i[a*3+1]=l[1],i[a*3+2]=l[2]}return{type:H.UNSIGNED_BYTE,value:i,size:3,normalized:!0}}if(e&&o){let i=new Uint8ClampedArray(s*3);for(let a=0;a<s;a++){let f=Ni(e[a]);i[a*3]=f[0],i[a*3+1]=f[1],i[a*3+2]=f[2]}return{type:H.UNSIGNED_BYTE,value:i,size:3,normalized:!0}}return e&&e.length===s*3?{type:H.UNSIGNED_BYTE,value:e,size:3,normalized:!0}:{type:H.UNSIGNED_BYTE,value:e||new Uint8ClampedArray,size:4,normalized:!0}}var Il=new M;function Sl(t,e){if(!e)return null;if(t.isOctEncoded16P){let r=new Float32Array((t.pointsLength||0)*3);for(let n=0;n<(t.pointsLength||0);n++)Ui(e[n*2],e[n*2+1],Il),Il.toArray(r,n*3);return{type:H.FLOAT,size:2,value:r}}return{type:H.FLOAT,size:2,value:e}}function Fl(t,e,r){return t.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,wp(t,e)):{type:H.UNSIGNED_SHORT,value:e,size:3,normalized:!0}:e}function wp(t,e){let r=new M,n=new Float32Array(t.pointCount*3);for(let o=0;o<t.pointCount;o++)r.set(e[o*3],e[o*3+1],e[o*3+2]).scale(1/t.quantizedRange).multiply(t.quantizedVolumeScale).add(t.quantizedVolumeOffset).toArray(n,o*3);return n}async function Rl(t,e,r,n,o){r=Me(t,e,r),r=Dr(t,e,r),r=Or(t,e,r,n),Ip(t);let{featureTable:s,batchTable:i}=Sp(t);return await Lp(t,s,i,n,o),Fp(t,s,n),Rp(t,s,i),Dp(t,s),r}function Ip(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null},t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}function Sp(t){let e=new Ht(t.featureTableJson,t.featureTableBinary),r=e.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");e.featuresLength=r,t.featuresLength=r,t.pointsLength=r,t.pointCount=r,t.rtcCenter=e.getGlobalProperty("RTC_CENTER",H.FLOAT,3);let n=Op(t,e);return{featureTable:e,batchTable:n}}function Fp(t,e,r){if(t.attributes=t.attributes||{positions:null,colors:null,normals:null,batchIds:null},!t.attributes.positions){if(e.hasProperty("POSITION"))t.attributes.positions=e.getPropertyArray("POSITION",H.FLOAT,3);else if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3);if(t.isQuantized=!0,t.quantizedRange=(1<<16)-1,t.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",H.FLOAT,3),!t.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(t.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3),!t.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t.attributes.positions=Fl(t,n,r)}}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function Rp(t,e,r){if(t.attributes=t.attributes||{positions:null,colors:null,normals:null,batchIds:null},!t.attributes.colors){let n=null;e.hasProperty("RGBA")?(n=e.getPropertyArray("RGBA",H.UNSIGNED_BYTE,4),t.isTranslucent=!0):e.hasProperty("RGB")?n=e.getPropertyArray("RGB",H.UNSIGNED_BYTE,3):e.hasProperty("RGB565")&&(n=e.getPropertyArray("RGB565",H.UNSIGNED_SHORT,1),t.isRGB565=!0),t.attributes.colors=Pi(t,n,r)}e.hasProperty("CONSTANT_RGBA")&&(t.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",H.UNSIGNED_BYTE,4))}function Dp(t,e){if(t.attributes=t.attributes||{positions:null,colors:null,normals:null,batchIds:null},!t.attributes.normals){let r=null;e.hasProperty("NORMAL")?r=e.getPropertyArray("NORMAL",H.FLOAT,3):e.hasProperty("NORMAL_OCT16P")&&(r=e.getPropertyArray("NORMAL_OCT16P",H.UNSIGNED_BYTE,2),t.isOctEncoded16P=!0),t.attributes.normals=Sl(t,r)}}function Op(t,e){let r=null;if(!t.batchIds&&e.hasProperty("BATCH_ID")&&(t.batchIds=e.getPropertyArray("BATCH_ID",H.UNSIGNED_SHORT,1),t.batchIds)){let n=e.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");let{batchTableJson:o,batchTableBinary:s}=t;r=new le(o,s,n)}return r}async function Lp(t,e,r,n,o){let s,i,a,f=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"];f&&(a=f.properties);let c=e.getExtension("3DTILES_draco_point_compression");if(c){i=c.properties;let h=c.byteOffset,u=c.byteLength;if(!i||!Number.isFinite(h)||!u)throw new Error("Draco properties, byteOffset, and byteLength must be defined");s=(t.featureTableBinary||[]).slice(h,h+u),t.hasPositions=Number.isFinite(i.POSITION),t.hasColors=Number.isFinite(i.RGB)||Number.isFinite(i.RGBA),t.hasNormals=Number.isFinite(i.NORMAL),t.hasBatchIds=Number.isFinite(i.BATCH_ID),t.isTranslucent=Number.isFinite(i.RGBA)}if(!s)return!0;let l={buffer:s,properties:{...i,...a},featureTableProperties:i,batchTableProperties:a,dequantizeInShader:!1};return await Gp(t,l,n,o)}async function Gp(t,e,r,n){if(!n)return;let o={...r,draco:{...r?.draco,extraAttributes:e.batchTableProperties||{}}};delete o["3d-tiles"];let s=await Ut(e.buffer,Uo,o,n),i=s.attributes.POSITION&&s.attributes.POSITION.value,a=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,f=s.attributes.NORMAL&&s.attributes.NORMAL.value,c=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,l=i&&s.attributes.POSITION.value.quantization,h=f&&s.attributes.NORMAL.value.quantization;if(l){let d=s.POSITION.data.quantization,A=d.range;t.quantizedVolumeScale=new M(A,A,A),t.quantizedVolumeOffset=new M(d.minValues),t.quantizedRange=(1<<d.quantizationBits)-1,t.isQuantizedDraco=!0}h&&(t.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0);let u={};if(e.batchTableProperties)for(let d of Object.keys(e.batchTableProperties))s.attributes[d]&&s.attributes[d].value&&(u[d.toLowerCase()]=s.attributes[d].value);t.attributes={positions:i,colors:Pi(t,a,void 0),normals:f,batchIds:c,...u}}var Ki={};lt(Ki,{createExtMeshFeatures:()=>T1,decode:()=>x1,encode:()=>E1,name:()=>B1});var Dl="4.3.0-beta.1";var vp=globalThis.loaders?.parseImageNode,Hi=typeof Image<"u",ki=typeof ImageBitmap<"u",Np=Boolean(vp),Ji=Bt?!0:Np;function Ol(t){switch(t){case"auto":return ki||Hi||Ji;case"imagebitmap":return ki;case"image":return Hi;case"data":return Ji;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function Ll(){if(ki)return"imagebitmap";if(Hi)return"image";if(Ji)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Gl(t){let e=Up(t);if(!e)throw new Error("Not an image");return e}function Sn(t){switch(Gl(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 Up(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 Pp=/^data:image\/svg\+xml/,Hp=/\.svg((\?|#).*)?$/;function Ho(t){return t&&(Pp.test(t)||Hp.test(t))}function vl(t,e){if(Ho(e)){let n=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return zi(t,e)}function zi(t,e){if(Ho(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function ko(t,e,r){let n=vl(t,r),o=self.URL||self.webkitURL,s=typeof n!="string"&&o.createObjectURL(n);try{return await kp(s||n,e)}finally{s&&o.revokeObjectURL(s)}}async function kp(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=s=>{let i=s instanceof Error?s.message:"error";o(new Error(i))}}catch(s){o(s)}})}var Jp={},Nl=!0;async function Ul(t,e,r){let n;Ho(r)?n=await ko(t,e,r):n=zi(t,r);let o=e&&e.imagebitmap;return await zp(n,o)}async function zp(t,e=null){if((Qp(e)||!Nl)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),Nl=!1}return await createImageBitmap(t)}function Qp(t){for(let e in t||Jp)return!1;return!0}function Pl(t){return!Xp(t,"ftyp",4)||!(t[8]&96)?null:Vp(t)}function Vp(t){switch(jp(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function jp(t,e,r){return String.fromCharCode(...t.slice(e,r))}function Kp(t){return[...t].map(e=>e.charCodeAt(0))}function Xp(t,e,r=0){let n=Kp(e);for(let o=0;o<n.length;++o)if(n[o]!==t[o+r])return!1;return!0}var Wt=!1,Fn=!0;function je(t){let e=Rn(t);return Yp(e)||$p(e)||Wp(e)||qp(e)||Zp(e)}function Zp(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=Pl(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function Yp(t){let e=Rn(t);return e.byteLength>=24&&e.getUint32(0,Wt)===2303741511?{mimeType:"image/png",width:e.getUint32(16,Wt),height:e.getUint32(20,Wt)}:null}function Wp(t){let e=Rn(t);return e.byteLength>=10&&e.getUint32(0,Wt)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,Fn),height:e.getUint16(8,Fn)}:null}function qp(t){let e=Rn(t);return e.byteLength>=14&&e.getUint16(0,Wt)===16973&&e.getUint32(2,Fn)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Fn),height:e.getUint32(22,Fn)}:null}function $p(t){let e=Rn(t);if(!(e.byteLength>=3&&e.getUint16(0,Wt)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:o}=t1(),s=2;for(;s+9<e.byteLength;){let i=e.getUint16(s,Wt);if(o.has(i))return{mimeType:"image/jpeg",height:e.getUint16(s+5,Wt),width:e.getUint16(s+7,Wt)};if(!n.has(i))return null;s+=2,s+=e.getUint16(s,Wt)}return null}function t1(){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 Rn(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 Hl(t,e){let{mimeType:r}=je(t)||{},n=globalThis.loaders?.parseImageNode;return z(n),await n(t,r)}async function kl(t,e,r){e=e||{};let o=(e.image||{}).type||"auto",{url:s}=r||{},i=e1(o),a;switch(i){case"imagebitmap":a=await Ul(t,e,s);break;case"image":a=await ko(t,e,s);break;case"data":a=await Hl(t,e);break;default:z(!1)}return o==="data"&&(a=Sn(a)),a}function e1(t){switch(t){case"auto":case"data":return Ll();default:return Ol(t),t}}var r1=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],n1=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],o1={image:{type:"auto",decode:!0}},Qi={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:Dl,mimeTypes:n1,extensions:r1,parse:kl,tests:[t=>Boolean(je(new DataView(t)))],options:o1};var Vi={};function ji(t){if(Vi[t]===void 0){let e=Bt?i1(t):s1(t);Vi[t]=e}return Vi[t]}function s1(t){let e=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||e,n=globalThis.loaders?.parseImageNode;return Boolean(n)&&r.includes(t)}function i1(t){switch(t){case"image/avif":case"image/webp":return a1(t);default:return!0}}function a1(t){try{return document.createElement("canvas").toDataURL(t).indexOf(`data:${t}`)===0}catch{return!1}}function ot(t,e){if(!t)throw new Error(e||"assert failed: gltf")}var Jo={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zo={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var c1=1.33,Jl=["SCALAR","VEC2","VEC3","VEC4"],f1=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],l1=new Map(f1),h1={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},u1={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},d1={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Qo(t){return Jl[t-1]||Jl[0]}function we(t){let e=l1.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function Lr(t,e){let r=d1[t.componentType],n=h1[t.type],o=u1[t.componentType],s=t.count*n,i=t.count*n*o;ot(i>=0&&i<=e.byteLength);let a=zo[t.componentType],f=Jo[t.type];return{ArrayType:r,length:s,byteLength:i,componentByteSize:a,numberOfComponentsInElement:f}}function Dn(t){let{images:e,bufferViews:r}=t;e=e||[],r=r||[];let n=e.map(i=>i.bufferView);r=r.filter(i=>!n.includes(i));let o=r.reduce((i,a)=>i+a.byteLength,0),s=e.reduce((i,a)=>{let{width:f,height:c}=a.image;return i+f*c},0);return o+Math.ceil(4*s*c1)}function zl(t,e,r){let n=t.bufferViews[r];ot(n);let o=n.buffer,s=e[o];ot(s);let i=(n.byteOffset||0)+s.byteOffset;return new Uint8Array(s.arrayBuffer,i,n.byteLength)}function Ql(t,e,r){let n=typeof r=="number"?t.accessors?.[r]:r;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(r)}`);let o=t.bufferViews?.[n.bufferView||0];if(!o)throw new Error(`No gltf buffer view for accessor ${o}`);let{arrayBuffer:s,byteOffset:i}=e[o.buffer],a=(i||0)+(n.byteOffset||0)+(o.byteOffset||0),{ArrayType:f,length:c,componentByteSize:l,numberOfComponentsInElement:h}=Lr(n,o),u=l*h,d=o.byteStride||u;if(typeof o.byteStride>"u"||o.byteStride===u)return new f(s,a,c);let A=new f(c);for(let m=0;m<n.count;m++){let p=new f(s,a+m*d,h);A.set(p,m*h)}return A}function A1(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var Q=class{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||A1(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){let r=this.getUsedExtensions().find(o=>o===e),n=this.getRequiredExtensions().find(o=>o===e);return typeof r=="string"||typeof n=="string"}getExtension(e){let r=this.getUsedExtensions().find(o=>o===e),n=this.json.extensions||{};return r?n[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(n=>n===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,r){return(e.extensions||{})[r]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,r){if(typeof r=="object")return r;let n=this.json[e]&&this.json[e][r];if(!n)throw new Error(`glTF file error: Could not find ${e}[${r}]`);return n}getTypedArrayForBufferView(e){e=this.getBufferView(e);let r=e.buffer,n=this.gltf.buffers[r];ot(n);let o=(e.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,o,e.byteLength)}getTypedArrayForAccessor(e){let r=this.getAccessor(e);return Ql(this.gltf.json,this.gltf.buffers,r)}getTypedArrayForImageData(e){e=this.getAccessor(e);let r=this.getBufferView(e.bufferView),o=this.getBuffer(r.buffer).data,s=r.byteOffset||0;return new Uint8Array(o,s,r.byteLength)}addApplicationData(e,r){return this.json[e]=r,this}addExtraData(e,r){return this.json.extras=this.json.extras||{},this.json.extras[e]=r,this}addObjectExtension(e,r,n){return e.extensions=e.extensions||{},e.extensions[r]=n,this.registerUsedExtension(r),this}setObjectExtension(e,r,n){let o=e.extensions||{};o[r]=n}removeObjectExtension(e,r){let n=e?.extensions||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let o=this.json.extensionsRemoved;o.includes(r)||o.push(r)}delete n[r]}addExtension(e,r={}){return ot(r),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=r,this.registerUsedExtension(e),r}addRequiredExtension(e,r={}){return ot(r),this.addExtension(e,r),this.registerRequiredExtension(e),r}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let r=this.json.extensionsRemoved;r.includes(e)||r.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){let{nodeIndices:r}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(e){let{meshIndex:r,matrix:n}=e;this.json.nodes=this.json.nodes||[];let o={mesh:r};return n&&(o.matrix=n),this.json.nodes.push(o),this.json.nodes.length-1}addMesh(e){let{attributes:r,indices:n,material:o,mode:s=4}=e,a={primitives:[{attributes:this._addAttributes(r),mode:s}]};if(n){let f=this._addIndices(n);a.primitives[0].indices=f}return Number.isFinite(o)&&(a.primitives[0].material=o),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){let n={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(e,r){let n=je(e),o=r||n?.mimeType,i={bufferView:this.addBufferView(e),mimeType:o};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}addBufferView(e,r=0,n=this.byteLength){let o=e.byteLength;ot(Number.isFinite(o)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);let s={buffer:r,byteOffset:n,byteLength:o};return this.byteLength+=Tt(o,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(s),this.json.bufferViews.length-1}addAccessor(e,r){let n={bufferView:e,type:Qo(r.size),componentType:r.componentType,count:r.count,max:r.max,min:r.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(e,r={size:3}){let n=this.addBufferView(e),o={min:r.min,max:r.max};(!o.min||!o.max)&&(o=this._getAccessorMinMax(e,r.size));let s={size:r.size,componentType:we(e),count:Math.round(e.length/r.size),min:o.min,max:o.max};return this.addAccessor(n,Object.assign(s,r))}addTexture(e){let{imageIndex:r}=e,n={source:r};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){let e=this.byteLength,r=new ArrayBuffer(e),n=new Uint8Array(r),o=0;for(let s of this.sourceBuffers||[])o=Us(s,n,o);this.json?.buffers?.[0]?this.json.buffers[0].byteLength=e:this.json.buffers=[{byteLength:e}],this.gltf.binary=r,this.sourceBuffers=[r],this.gltf.buffers=[{arrayBuffer:r,byteOffset:0,byteLength:r.byteLength}]}_removeStringFromArray(e,r){let n=!0;for(;n;){let o=e.indexOf(r);o>-1?e.splice(o,1):n=!1}}_addAttributes(e={}){let r={};for(let n in e){let o=e[n],s=this._getGltfAttributeName(n),i=this.addBinaryBuffer(o.value,o);r[s]=i}return r}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,r){let n={min:null,max:null};if(e.length<r)return n;n.min=[],n.max=[];let o=e.subarray(0,r);for(let s of o)n.min.push(s),n.max.push(s);for(let s=r;s<e.length;s+=r)for(let i=0;i<r;i++)n.min[0+i]=Math.min(n.min[0+i],e[s+i]),n.max[0+i]=Math.max(n.max[0+i],e[s+i]);return n}};function Vl(t){return(t%1+1)%1}var jl={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},m1={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},Kl={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function On(t,e){return Kl[e]*jl[t]}function Gr(t,e,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let o=t.getTypedArrayForBufferView(e),s=vr(o,"SCALAR",r,n+1);return s instanceof BigInt64Array||s instanceof BigUint64Array?null:s}function vr(t,e,r,n=1){let o=jl[e],s=m1[r],i=Kl[r],a=n*o,f=a*i,c=t.buffer,l=t.byteOffset;return l%i!==0&&(c=new Uint8Array(c).slice(l,l+f).buffer,l=0),new s(c,l,a)}function Nr(t,e,r){let n=`TEXCOORD_${e.texCoord||0}`,o=r.attributes[n],s=t.getTypedArrayForAccessor(o),i=t.gltf.json,a=e.index,f=i.textures?.[a]?.source;if(typeof f<"u"){let c=i.images?.[f]?.mimeType,l=t.gltf.images?.[f];if(l&&typeof l.width<"u"){let h=[];for(let u=0;u<s.length;u+=2){let d=p1(l,c,s,u,e.channels);h.push(d)}return h}}return[]}function Vo(t,e,r,n,o){if(!r?.length)return;let s=[];for(let l of r){let h=n.findIndex(u=>u===l);h===-1&&(h=n.push(l)-1),s.push(h)}let i=new Uint32Array(s),a=t.gltf.buffers.push({arrayBuffer:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength})-1,f=t.addBufferView(i,a,0),c=t.addAccessor(f,{size:1,componentType:we(i),count:i.length});o.attributes[e]=c}function p1(t,e,r,n,o=[0]){let s={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},i=r[n],a=r[n+1],f=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(f=4);let c=g1(i,a,t,f),l=0;for(let h of o){let u=typeof h=="number"?Object.values(s)[h]:s[h],d=c+u.offset,A=Sn(t);if(A.data.length<=d)throw new Error(`${A.data.length} <= ${d}`);let m=A.data[d];l|=m<<u.shift}return l}function g1(t,e,r,n=1){let o=r.width,s=Vl(t)*(o-1),i=Math.round(s),a=r.height,f=Vl(e)*(a-1),c=Math.round(f),l=r.components?r.components:n;return(c*o+i)*l}function jo(t,e,r,n,o){let s=[];for(let i=0;i<e;i++){let a=r[i],f=r[i+1]-r[i];if(f+a>n)break;let c=a/o,l=f/o;s.push(t.slice(c,c+l))}return s}function Ko(t,e,r){let n=[];for(let o=0;o<e;o++){let s=o*r;n.push(t.slice(s,s+r))}return n}function Xo(t,e,r,n){if(r)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){let o=[],s=new TextDecoder("utf8"),i=0;for(let a=0;a<t;a++){let f=n[a+1]-n[a];if(f+i<=e.length){let c=e.subarray(i,f+i),l=s.decode(c);o.push(l),i+=f}}return o}return[]}var Ur="EXT_mesh_features",B1=Ur;async function x1(t,e){let r=new Q(t);_1(r,e)}function E1(t,e){let r=new Q(t);return C1(r,e),r.createBinaryChunk(),r.gltf}function _1(t,e){let r=t.gltf.json;if(r.meshes)for(let n of r.meshes)for(let o of n.primitives)y1(t,o,e)}function y1(t,e,r){if(!r?.gltf?.loadBuffers)return;let o=e.extensions?.[Ur]?.featureIds;if(o)for(let s of o){let i;if(typeof s.attribute<"u"){let a=`_FEATURE_ID_${s.attribute}`,f=e.attributes[a];i=t.getTypedArrayForAccessor(f)}else typeof s.texture<"u"&&r?.gltf?.loadImages?i=Nr(t,s.texture,e):i=[];s.data=i}}function C1(t,e){let r=t.gltf.json.meshes;if(r)for(let n of r)for(let o of n.primitives)b1(t,o)}function T1(t,e,r,n){e.extensions||(e.extensions={});let o=e.extensions[Ur];o||(o={featureIds:[]},e.extensions[Ur]=o);let{featureIds:s}=o,i={featureCount:r.length,propertyTable:n,data:r};s.push(i),t.addObjectExtension(e,Ur,o)}function b1(t,e){let r=e.extensions?.[Ur];if(!r)return;let n=r.featureIds;n.forEach((o,s)=>{if(o.data){let{accessorKey:i,index:a}=M1(e.attributes),f=new Uint32Array(o.data);n[s]={featureCount:f.length,propertyTable:o.propertyTable,attribute:a},t.gltf.buffers.push({arrayBuffer:f.buffer,byteOffset:f.byteOffset,byteLength:f.byteLength});let c=t.addBufferView(f),l=t.addAccessor(c,{size:1,componentType:we(f),count:f.length});e.attributes[i]=l}})}function M1(t){let e="_FEATURE_ID_",r=Object.keys(t).filter(s=>s.indexOf(e)===0),n=-1;for(let s of r){let i=Number(s.substring(e.length));i>n&&(n=i)}return n++,{accessorKey:`${e}${n}`,index:n}}var Yi={};lt(Yi,{createExtStructuralMetadata:()=>X1,decode:()=>I1,encode:()=>S1,name:()=>w1});var Pr="EXT_structural_metadata",w1=Pr;async function I1(t,e){let r=new Q(t);F1(r,e)}function S1(t,e){let r=new Q(t);return j1(r,e),r.createBinaryChunk(),r.gltf}function F1(t,e){if(!e.gltf?.loadBuffers)return;let r=t.getExtension(Pr);r&&(e.gltf?.loadImages&&R1(t,r),D1(t,r))}function R1(t,e){let r=e.propertyTextures,n=t.gltf.json;if(r&&n.meshes)for(let o of n.meshes)for(let s of o.primitives)L1(t,r,s,e)}function D1(t,e){let r=e.schema;if(!r)return;let n=r.classes,o=e.propertyTables;if(n&&o)for(let s in n){let i=O1(o,s);i&&v1(t,r,i)}}function O1(t,e){for(let r of t)if(r.class===e)return r;return null}function L1(t,e,r,n){if(!e)return;let s=r.extensions?.[Pr]?.propertyTextures;if(s)for(let i of s){let a=e[i];G1(t,a,r,n)}}function G1(t,e,r,n){if(!e.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let o=e.class;for(let s in e.properties){let i=`${o}_${s}`,a=e.properties?.[s];if(!a)continue;a.data||(a.data=[]);let f=a.data,c=Nr(t,a,r);c!==null&&(Vo(t,i,c,f,r),a.data=f,n.dataAttributeNames.push(i))}}function v1(t,e,r){let n=e.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let o=r.count;for(let s in n.properties){let i=n.properties[s],a=r.properties?.[s];if(a){let f=N1(t,e,i,o,a);a.data=f}}}function N1(t,e,r,n,o){let s=[],i=o.values,a=t.getTypedArrayForBufferView(i),f=U1(t,r,o,n),c=P1(t,o,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{s=H1(r,n,a,f);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{s=Xo(n,a,f,c);break}case"ENUM":{s=k1(e,r,n,a,f);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return s}function U1(t,e,r,n){return e.array&&typeof e.count>"u"&&typeof r.arrayOffsets<"u"?Gr(t,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function P1(t,e,r){return typeof e.stringOffsets<"u"?Gr(t,e.stringOffsets,e.stringOffsetType||"UINT32",r):null}function H1(t,e,r,n){let o=t.array,s=t.count,i=On(t.type,t.componentType),a=r.byteLength/i,f;return t.componentType?f=vr(r,t.type,t.componentType,a):f=r,o?n?jo(f,e,n,r.length,i):s?Ko(f,e,s):[]:f}function k1(t,e,r,n,o){let s=e.enumType;if(!s)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let i=t.enums?.[s];if(!i)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${s}`);let a=i.valueType||"UINT16",f=On(e.type,a),c=n.byteLength/f,l=vr(n,e.type,a,c);if(l||(l=n),e.array){if(o)return J1({valuesData:l,numberOfElements:r,arrayOffsets:o,valuesDataBytesLength:n.length,elementSize:f,enumEntry:i});let h=e.count;return h?z1(l,r,h,i):[]}return Zi(l,0,r,i)}function J1(t){let{valuesData:e,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:o,elementSize:s,enumEntry:i}=t,a=[];for(let f=0;f<r;f++){let c=n[f],l=n[f+1]-n[f];if(l+c>o)break;let h=c/s,u=l/s,d=Zi(e,h,u,i);a.push(d)}return a}function z1(t,e,r,n){let o=[];for(let s=0;s<e;s++){let i=r*s,a=Zi(t,i,r,n);o.push(a)}return o}function Zi(t,e,r,n){let o=[];for(let s=0;s<r;s++)if(t instanceof BigInt64Array||t instanceof BigUint64Array)o.push("");else{let i=t[e+s],a=Q1(n,i);a?o.push(a.name):o.push("")}return o}function Q1(t,e){for(let r of t.values)if(r.value===e)return r;return null}var V1="schemaClassId";function j1(t,e){let r=t.getExtension(Pr);if(r&&r.propertyTables)for(let n of r.propertyTables){let o=n.class,s=r.schema?.classes?.[o];n.properties&&s&&K1(n,s,t)}}function K1(t,e,r){for(let n in t.properties){let o=t.properties[n].data;if(o){let s=e.properties[n];if(s){let i=W1(o,s,r);t.properties[n]=i}}}}function X1(t,e,r=V1){let n=t.getExtension(Pr);n||(n=t.addExtension(Pr)),n.schema=Z1(e,r,n.schema);let o=Y1(e,r,n.schema);return n.propertyTables||(n.propertyTables=[]),n.propertyTables.push(o)-1}function Z1(t,e,r){let n=r??{id:"schema_id"},o={properties:{}};for(let s of t){let i={type:s.elementType,componentType:s.componentType};o.properties[s.name]=i}return n.classes={},n.classes[e]=o,n}function Y1(t,e,r){let n={class:e,count:0},o=0,s=r.classes?.[e];for(let i of t){if(o===0&&(o=i.values.length),o!==i.values.length&&i.values.length)throw new Error("Illegal values in attributes");s?.properties[i.name]&&(n.properties||(n.properties={}),n.properties[i.name]={values:0,data:i.values})}return n.count=o,n}function W1(t,e,r){let n={values:0};if(e.type==="STRING"){let{stringData:o,stringOffsets:s}=tg(t);n.stringOffsets=Xi(s,r),n.values=Xi(o,r)}else if(e.type==="SCALAR"&&e.componentType){let o=$1(t,e.componentType);n.values=Xi(o,r)}return n}var q1={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:Int32Array,UINT64:Uint32Array,FLOAT32:Float32Array,FLOAT64:Float64Array};function $1(t,e){let r=[];for(let o of t)r.push(Number(o));let n=q1[e];if(!n)throw new Error("Illegal component type");return new n(r)}function tg(t){let e=new TextEncoder,r=[],n=0;for(let f of t){let c=e.encode(f);n+=c.length,r.push(c)}let o=new Uint8Array(n),s=[],i=0;for(let f of r)o.set(f,i),s.push(i),i+=f.length;s.push(i);let a=new Uint32Array(s);return{stringData:o,stringOffsets:a}}function Xi(t,e){return e.gltf.buffers.push({arrayBuffer:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}),e.addBufferView(t)}var Wi={};lt(Wi,{decode:()=>rg,name:()=>eg});var Xl="EXT_feature_metadata",eg=Xl;async function rg(t,e){let r=new Q(t);ng(r,e)}function ng(t,e){if(!e.gltf?.loadBuffers)return;let r=t.getExtension(Xl);r&&(e.gltf?.loadImages&&og(t,r),sg(t,r))}function og(t,e){let r=e.schema;if(!r)return;let n=r.classes,{featureTextures:o}=e;if(n&&o)for(let s in n){let i=n[s],a=ag(o,s);a&&fg(t,a,i)}}function sg(t,e){let r=e.schema;if(!r)return;let n=r.classes,o=e.featureTables;if(n&&o)for(let s in n){let i=ig(o,s);i&&cg(t,r,i)}}function ig(t,e){for(let r in t){let n=t[r];if(n.class===e)return n}return null}function ag(t,e){for(let r in t){let n=t[r];if(n.class===e)return n}return null}function cg(t,e,r){if(!r.class)return;let n=e.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let o=r.count;for(let s in n.properties){let i=n.properties[s],a=r.properties?.[s];if(a){let f=lg(t,e,i,o,a);a.data=f}}}function fg(t,e,r){let n=e.class;for(let o in r.properties){let s=e?.properties?.[o];if(s){let i=mg(t,s,n);s.data=i}}}function lg(t,e,r,n,o){let s=[],i=o.bufferView,a=t.getTypedArrayForBufferView(i),f=hg(t,r,o,n),c=ug(t,r,o,n);return r.type==="STRING"||r.componentType==="STRING"?s=Xo(n,a,f,c):dg(r)&&(s=Ag(r,n,a,f)),s}function hg(t,e,r,n){return e.type==="ARRAY"&&typeof e.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?Gr(t,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function ug(t,e,r,n){return typeof r.stringOffsetBufferView<"u"?Gr(t,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function dg(t){let e=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return e.includes(t.type)||typeof t.componentType<"u"&&e.includes(t.componentType)}function Ag(t,e,r,n){let o=t.type==="ARRAY",s=t.componentCount,i="SCALAR",a=t.componentType||t.type,f=On(i,a),c=r.byteLength/f,l=vr(r,i,a,c);return o?n?jo(l,e,n,r.length,f):s?Ko(l,e,s):[]:l}function mg(t,e,r){let n=t.gltf.json;if(!n.meshes)return[];let o=[];for(let s of n.meshes)for(let i of s.primitives)pg(t,r,e,o,i);return o}function pg(t,e,r,n,o){let s={channels:r.channels,...r.texture},i=Nr(t,s,o);i&&Vo(t,e,i,n,o)}var Zl="4.3.0-beta.1";var Yl="4.3.0-beta.1";var Zo={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},Wl;async function $i(t){un(t.modules);let e=Gs("basis");return e||(Wl||=gg(t),await Wl)}async function gg(t){let e=null,r=null;return[e,r]=await Promise.all([await Xt(Zo.TRANSCODER,"textures",t),await Xt(Zo.TRANSCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await Bg(e,r)}function Bg(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(o=>{let{BasisFile:s,initializeBasis:i}=o;i(),n({BasisFile:s})})})}var qi;async function ta(t){let e=t.modules||{};return e.basisEncoder?e.basisEncoder:(qi=qi||xg(t),await qi)}async function xg(t){let e=null,r=null;return[e,r]=await Promise.all([await Xt(Zo.ENCODER,"textures",t),await Xt(Zo.ENCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await Eg(e,r)}function Eg(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(o=>{let{BasisFile:s,KTX2File:i,initializeBasis:a,BasisEncoder:f}=o;a(),n({BasisFile:s,KTX2File:i,BasisEncoder:f})})})}var Ke={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 _g=["","WEBKIT_","MOZ_"],ql={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"},Yo=null;function $l(t){if(!Yo){t=t||yg()||void 0,Yo=new Set;for(let e of _g)for(let r in ql)if(t&&t.getExtension(`${e}${r}`)){let n=ql[r];Yo.add(n)}}return Yo}function yg(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var Mt=[171,75,84,88,32,50,48,187,13,10,26,10];function th(t){let e=new Uint8Array(t);return!(e.byteLength<Mt.length||e[0]!==Mt[0]||e[1]!==Mt[1]||e[2]!==Mt[2]||e[3]!==Mt[3]||e[4]!==Mt[4]||e[5]!==Mt[5]||e[6]!==Mt[6]||e[7]!==Mt[7]||e[8]!==Mt[8]||e[9]!==Mt[9]||e[10]!==Mt[10]||e[11]!==Mt[11])}var Cg={etc1:{basisFormat:0,compressed:!0,format:Ke.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Ke.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Ke.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:Ke.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Ke.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 rh(t,e){if(e.basis.containerFormat==="auto"){if(th(t)){let n=await ta(e);return eh(n.KTX2File,t,e)}let{BasisFile:r}=await $i(e);return ea(r,t,e)}switch(e.basis.module){case"encoder":let r=await ta(e);switch(e.basis.containerFormat){case"ktx2":return eh(r.KTX2File,t,e);case"basis":default:return ea(r.BasisFile,t,e)}case"transcoder":default:let{BasisFile:n}=await $i(e);return ea(n,t,e)}}function ea(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(),s=[];for(let i=0;i<o;i++){let a=n.getNumLevels(i),f=[];for(let c=0;c<a;c++)f.push(Tg(n,i,c,r));s.push(f)}return s}finally{n.close(),n.delete()}}function Tg(t,e,r,n){let o=t.getImageWidth(e,r),s=t.getImageHeight(e,r),i=t.getHasAlpha(),{compressed:a,format:f,basisFormat:c}=nh(n,i),l=t.getImageTranscodedSizeInBytes(e,r,c),h=new Uint8Array(l);if(!t.transcodeImage(h,e,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:o,height:s,data:h,compressed:a,format:f,hasAlpha:i}}function eh(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(),s=[];for(let i=0;i<o;i++)s.push(bg(n,i,r));return[s]}finally{n.close(),n.delete()}}function bg(t,e,r){let{alphaFlag:n,height:o,width:s}=t.getImageLevelInfo(e,0,0),{compressed:i,format:a,basisFormat:f}=nh(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:s,height:o,data:l,compressed:i,levelSize:c,hasAlpha:n,format:a}}function nh(t,e){let r=t&&t.basis&&t.basis.format;return r==="auto"&&(r=Wo()),typeof r=="object"&&(r=e?r.alpha:r.noAlpha),r=r.toLowerCase(),Cg[r]}function Wo(){let t=$l();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 oh={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:Yl,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"}}},ra={...oh,parse:rh};var Hr=!0,sh=1735152710,sa=12,qo=8,Mg=1313821514,wg=5130562,Ig=0,Sg=0,Fg=1;function Rg(t,e=0){return`${String.fromCharCode(t.getUint8(e+0))}${String.fromCharCode(t.getUint8(e+1))}${String.fromCharCode(t.getUint8(e+2))}${String.fromCharCode(t.getUint8(e+3))}`}function ih(t,e=0,r={}){let n=new DataView(t),{magic:o=sh}=r,s=n.getUint32(e,!1);return s===o||s===sh}function ah(t,e,r=0,n={}){let o=new DataView(e),s=Rg(o,r+0),i=o.getUint32(r+4,Hr),a=o.getUint32(r+8,Hr);switch(Object.assign(t,{header:{byteOffset:r,byteLength:a,hasBinChunk:!1},type:s,version:i,json:{},binChunks:[]}),r+=sa,t.version){case 1:return Dg(t,o,r);case 2:return Og(t,o,r,n={});default:throw new Error(`Invalid GLB version ${t.version}. Only supports version 1 and 2.`)}}function Dg(t,e,r){z(t.header.byteLength>sa+qo);let n=e.getUint32(r+0,Hr),o=e.getUint32(r+4,Hr);return r+=qo,z(o===Ig),na(t,e,r,n),r+=n,r+=oa(t,e,r,t.header.byteLength),r}function Og(t,e,r,n){return z(t.header.byteLength>sa+qo),Lg(t,e,r,n),r+t.header.byteLength}function Lg(t,e,r,n){for(;r+8<=t.header.byteLength;){let o=e.getUint32(r+0,Hr),s=e.getUint32(r+4,Hr);switch(r+=qo,s){case Mg:na(t,e,r,o);break;case wg:oa(t,e,r,o);break;case Sg:n.strict||na(t,e,r,o);break;case Fg:n.strict||oa(t,e,r,o);break;default:break}r+=Tt(o,4)}return r}function na(t,e,r,n){let o=new Uint8Array(e.buffer,r,n),i=new TextDecoder("utf8").decode(o);return t.json=JSON.parse(i),Tt(n,4)}function oa(t,e,r,n){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:e.buffer}),Tt(n,4)}function ia(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;let n=e.baseUri||e.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${t}`);return n.substr(0,n.lastIndexOf("/")+1)+t}var ca={};lt(ca,{decode:()=>jg,name:()=>Vg});var Gg="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9w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CTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",Ng=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Ug=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),Pg={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Hg={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function ch(t,e,r,n,o,s="NONE"){let i=await kg();Qg(i,i.exports[Hg[o]],t,e,r,n,i.exports[Pg[s||"NONE"]])}var aa;async function kg(){return aa||(aa=Jg()),aa}async function Jg(){let t=Gg;WebAssembly.validate(Ng)&&(t=vg,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let e=await WebAssembly.instantiate(zg(t),{});return await e.instance.exports.__wasm_call_ctors(),e.instance}function zg(t){let e=new Uint8Array(t.length);for(let n=0;n<t.length;++n){let o=t.charCodeAt(n);e[n]=o>96?o-71:o>64?o-65:o>47?o+4:o>46?63:62}let r=0;for(let n=0;n<t.length;++n)e[r++]=e[n]<60?Ug[e[n]]:(e[n]-60)*64+e[++n];return e.buffer.slice(0,r)}function Qg(t,e,r,n,o,s,i){let a=t.exports.sbrk,f=n+3&-4,c=a(f*o),l=a(s.length),h=new Uint8Array(t.exports.memory.buffer);h.set(s,l);let u=e(c,n,o,l,s.length);if(u===0&&i&&i(c,f,o),r.set(h.subarray(c,c+n*o)),a(c-a(0)),u!==0)throw new Error(`Malformed buffer data: ${u}`)}var $o="EXT_meshopt_compression",Vg=$o;async function jg(t,e){let r=new Q(t);if(!e?.gltf?.decompressMeshes||!e.gltf?.loadBuffers)return;let n=[];for(let o of t.json.bufferViews||[])n.push(Kg(r,o));await Promise.all(n),r.removeExtension($o)}async function Kg(t,e){let r=t.getObjectExtension(e,$o);if(r){let{byteOffset:n=0,byteLength:o=0,byteStride:s,count:i,mode:a,filter:f="NONE",buffer:c}=r,l=t.gltf.buffers[c],h=new Uint8Array(l.arrayBuffer,l.byteOffset+n,o),u=new Uint8Array(t.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength);await ch(u,i,s,h,a,f),t.removeObjectExtension(e,$o)}}var fa={};lt(fa,{name:()=>Xg,preprocess:()=>Zg});var kr="EXT_texture_webp",Xg=kr;function Zg(t,e){let r=new Q(t);if(!ji("image/webp")){if(r.getRequiredExtensions().includes(kr))throw new Error(`gltf: Required extension ${kr} not supported by browser`);return}let{json:n}=r;for(let o of n.textures||[]){let s=r.getObjectExtension(o,kr);s&&(o.source=s.source),r.removeObjectExtension(o,kr)}r.removeExtension(kr)}var la={};lt(la,{name:()=>Yg,preprocess:()=>Wg});var ts="KHR_texture_basisu",Yg=ts;function Wg(t,e){let r=new Q(t),{json:n}=r;for(let o of n.textures||[]){let s=r.getObjectExtension(o,ts);s&&(o.source=s.source,r.removeObjectExtension(o,ts))}r.removeExtension(ts)}var ua={};lt(ua,{decode:()=>rB,encode:()=>nB,name:()=>tB,preprocess:()=>eB});function fh(t){let e={};for(let r in t){let n=t[r];if(r!=="indices"){let o=ha(n);e[r]=o}}return e}function ha(t){let{buffer:e,size:r,count:n}=qg(t);return{value:e,size:r,byteOffset:0,count:n,type:Qo(r),componentType:we(e)}}function qg(t){let e=t,r=1,n=0;return t&&t.value&&(e=t.value,r=t.size||1),e&&(ArrayBuffer.isView(e)||(e=$g(e,Float32Array)),n=e.length/r),{buffer:e,size:r,count:n}}function $g(t,e,r=!1){return t?Array.isArray(t)?new e(t):r&&!(t instanceof e)?new e(t):t:null}var Ie="KHR_draco_mesh_compression",tB=Ie;function eB(t,e,r){let n=new Q(t);for(let o of lh(n))n.getObjectExtension(o,Ie)}async function rB(t,e,r){if(!e?.gltf?.decompressMeshes)return;let n=new Q(t),o=[];for(let s of lh(n))n.getObjectExtension(s,Ie)&&o.push(oB(n,s,e,r));await Promise.all(o),n.removeExtension(Ie)}function nB(t,e={}){let r=new Q(t);for(let n of r.json.meshes||[])sB(n,e),r.addRequiredExtension(Ie)}async function oB(t,e,r,n){let o=t.getObjectExtension(e,Ie);if(!o)return;let s=t.getTypedArrayForBufferView(o.bufferView),i=Pe(s.buffer,s.byteOffset),a={...r};delete a["3d-tiles"];let f=await Ut(i,Uo,a,n),c=fh(f.attributes);for(let[l,h]of Object.entries(c))if(l in e.attributes){let u=e.attributes[l],d=t.getAccessor(u);d?.min&&d?.max&&(h.min=d.min,h.max=d.max)}e.attributes=c,f.indices&&(e.indices=ha(f.indices)),t.removeObjectExtension(e,Ie),iB(e)}function sB(t,e,r=4,n,o){if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let s=n.DracoWriter.encodeSync({attributes:t}),i=o?.parseSync?.({attributes:t}),a=n._addFauxAttributes(i.attributes),f=n.addBufferView(s);return{primitives:[{attributes:a,mode:r,extensions:{[Ie]:{bufferView:f,attributes:a}}}]}}function iB(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*lh(t){for(let e of t.json.meshes||[])for(let r of e.primitives)yield r}var da={};lt(da,{decode:()=>lB,name:()=>aB});var rs="KHR_texture_transform",aB=rs,es=new M,cB=new X,fB=new X;async function lB(t,e){if(!new Q(t).hasExtension(rs)||!e.gltf?.loadBuffers)return;let o=t.json.materials||[];for(let s=0;s<o.length;s++)hB(s,t)}function hB(t,e){let r=e.json.materials?.[t],n=[r?.pbrMetallicRoughness?.baseColorTexture,r?.emissiveTexture,r?.normalTexture,r?.occlusionTexture,r?.pbrMetallicRoughness?.metallicRoughnessTexture],o=[];for(let s of n)s&&s?.extensions?.[rs]&&uB(e,t,s,o)}function uB(t,e,r,n){let o=dB(r,n);if(!o)return;let s=t.json.meshes||[];for(let i of s)for(let a of i.primitives){let f=a.material;Number.isFinite(f)&&e===f&&AB(t,a,o)}}function dB(t,e){let r=t.extensions?.[rs],{texCoord:n=0}=t,{texCoord:o=n}=r;if(!(e.findIndex(([i,a])=>i===n&&a===o)!==-1)){let i=gB(r);return n!==o&&(t.texCoord=o),e.push([n,o]),{originalTexCoord:n,texCoord:o,matrix:i}}return null}function AB(t,e,r){let{originalTexCoord:n,texCoord:o,matrix:s}=r,i=e.attributes[`TEXCOORD_${n}`];if(Number.isFinite(i)){let a=t.json.accessors?.[i];if(a&&a.bufferView){let f=t.json.bufferViews?.[a.bufferView];if(f){let{arrayBuffer:c,byteOffset:l}=t.buffers[f.buffer],h=(l||0)+(a.byteOffset||0)+(f.byteOffset||0),{ArrayType:u,length:d}=Lr(a,f),A=zo[a.componentType],m=Jo[a.type],p=f.byteStride||A*m,E=new Float32Array(d);for(let y=0;y<a.count;y++){let T=new u(c,h+y*p,2);es.set(T[0],T[1],1),es.transformByMatrix3(s),E.set([es[0],es[1]],y*m)}n===o?mB(a,f,t.buffers,E):pB(o,a,e,t,E)}}}}function mB(t,e,r,n){t.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),e.buffer=r.length-1,e.byteLength=n.buffer.byteLength,e.byteOffset=0,delete e.byteStride}function pB(t,e,r,n,o){n.buffers.push({arrayBuffer:o.buffer,byteOffset:0,byteLength:o.buffer.byteLength});let s=n.json.bufferViews;if(!s)return;s.push({buffer:n.buffers.length-1,byteLength:o.buffer.byteLength,byteOffset:0});let i=n.json.accessors;i&&(i.push({bufferView:s?.length-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),r.attributes[`TEXCOORD_${t}`]=i.length-1)}function gB(t){let{offset:e=[0,0],rotation:r=0,scale:n=[1,1]}=t,o=new X().set(1,0,0,0,1,0,e[0],e[1],1),s=cB.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),i=fB.set(n[0],0,0,0,n[1],0,0,0,1);return o.multiplyRight(s).multiplyRight(i)}var Aa={};lt(Aa,{decode:()=>xB,encode:()=>EB,name:()=>BB});var Xe="KHR_lights_punctual",BB=Xe;async function xB(t){let e=new Q(t),{json:r}=e,n=e.getExtension(Xe);n&&(e.json.lights=n.lights,e.removeExtension(Xe));for(let o of r.nodes||[]){let s=e.getObjectExtension(o,Xe);s&&(o.light=s.light),e.removeObjectExtension(o,Xe)}}async function EB(t){let e=new Q(t),{json:r}=e;if(r.lights){let n=e.addExtension(Xe);ot(!n.lights),n.lights=r.lights,delete r.lights}if(e.json.lights){for(let n of e.json.lights){let o=n.node;e.addObjectExtension(o,Xe,n)}delete e.json.lights}}var ma={};lt(ma,{decode:()=>yB,encode:()=>CB,name:()=>_B});var Ln="KHR_materials_unlit",_B=Ln;async function yB(t){let e=new Q(t),{json:r}=e;for(let n of r.materials||[])n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),e.removeObjectExtension(n,Ln);e.removeExtension(Ln)}function CB(t){let e=new Q(t),{json:r}=e;if(e.materials)for(let n of r.materials||[])n.unlit&&(delete n.unlit,e.addObjectExtension(n,Ln,{}),e.addExtension(Ln))}var pa={};lt(pa,{decode:()=>bB,encode:()=>MB,name:()=>TB});var Gn="KHR_techniques_webgl",TB=Gn;async function bB(t){let e=new Q(t),{json:r}=e,n=e.getExtension(Gn);if(n){let o=wB(n,e);for(let s of r.materials||[]){let i=e.getObjectExtension(s,Gn);i&&(s.technique=Object.assign({},i,o[i.technique]),s.technique.values=IB(s.technique,e)),e.removeObjectExtension(s,Gn)}e.removeExtension(Gn)}}async function MB(t,e){}function wB(t,e){let{programs:r=[],shaders:n=[],techniques:o=[]}=t,s=new TextDecoder;return n.forEach(i=>{if(Number.isFinite(i.bufferView))i.code=s.decode(e.getTypedArrayForBufferView(i.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),r.forEach(i=>{i.fragmentShader=n[i.fragmentShader],i.vertexShader=n[i.vertexShader]}),o.forEach(i=>{i.program=r[i.program]}),o}function IB(t,e){let r=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach(n=>{t.uniforms[n].value&&!(n in r)&&(r[n]=t.uniforms[n].value)}),Object.keys(r).forEach(n=>{typeof r[n]=="object"&&r[n].index!==void 0&&(r[n].texture=e.getTexture(r[n].index))}),r}var hh=[Yi,Ki,ca,fa,la,ua,Aa,ma,pa,da,Wi];function uh(t,e={},r){let n=hh.filter(o=>Ah(o.name,e));for(let o of n)o.preprocess?.(t,e,r)}async function dh(t,e={},r){let n=hh.filter(o=>Ah(o.name,e));for(let o of n)await o.decode?.(t,e,r)}function Ah(t,e){let r=e?.gltf?.excludeExtensions||{};return!(t in r&&!r[t])}var ga="KHR_binary_glTF";function mh(t){let e=new Q(t),{json:r}=e;for(let n of r.images||[]){let o=e.getObjectExtension(n,ga);o&&Object.assign(n,o),e.removeObjectExtension(n,ga)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,e.removeExtension(ga)}var ph={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},FB={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Ba=class{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(e,r){this.json=e.json;let n=e.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${n.asset.version}`);return}if(!r.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),mh(e),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(let r in ph)this._convertTopLevelObjectToArray(e,r)}_convertTopLevelObjectToArray(e,r){let n=e[r];if(!(!n||Array.isArray(n))){e[r]=[];for(let o in n){let s=n[o];s.id=s.id||o;let i=e[r].length;e[r].push(s),this.idToIndexMap[r][o]=i}}}_convertObjectIdsToArrayIndices(e){for(let r in ph)this._convertIdsToIndices(e,r);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(let r of e.textures)this._convertTextureIds(r);for(let r of e.meshes)this._convertMeshIds(r);for(let r of e.nodes)this._convertNodeIds(r);for(let r of e.scenes)this._convertSceneIds(r)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(let r of e.primitives){let{attributes:n,indices:o,material:s}=r;for(let i in n)n[i]=this._convertIdToIndex(n[i],"accessor");o&&(r.indices=this._convertIdToIndex(o,"accessor")),s&&(r.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(r=>this._convertIdToIndex(r,"node"))),e.meshes&&(e.meshes=e.meshes.map(r=>this._convertIdToIndex(r,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(r=>this._convertIdToIndex(r,"node")))}_convertIdsToIndices(e,r){e[r]||(console.warn(`gltf v1: json doesn't contain attribute ${r}`),e[r]=[]);for(let n of e[r])for(let o in n){let s=n[o],i=this._convertIdToIndex(s,o);n[o]=i}}_convertIdToIndex(e,r){let n=FB[r];if(n in this.idToIndexMap){let o=this.idToIndexMap[n][e];if(!Number.isFinite(o))throw new Error(`gltf v1: failed to resolve ${r} with id ${e}`);return o}return e}_updateObjects(e){for(let r of this.json.buffers)delete r.type}_updateMaterial(e){for(let r of e.materials){r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};let n=r.values?.tex||r.values?.texture2d_0||r.values?.diffuseTex,o=e.textures.findIndex(s=>s.id===n);o!==-1&&(r.pbrMetallicRoughness.baseColorTexture={index:o})}}};function gh(t,e={}){return new Ba().normalize(t,e)}async function Bh(t,e,r=0,n,o){return RB(t,e,r,n),gh(t,{normalize:n?.gltf?.normalize}),uh(t,n,o),n?.gltf?.loadBuffers&&t.json.buffers&&await DB(t,n,o),n?.gltf?.loadImages&&await OB(t,n,o),await dh(t,n,o),t}function RB(t,e,r,n){if(n.uri&&(t.baseUri=n.uri),e instanceof ArrayBuffer&&!ih(e,r,n)&&(e=new TextDecoder().decode(e)),typeof e=="string")t.json=Ns(e);else if(e instanceof ArrayBuffer){let i={};r=ah(i,e,r,n.glb),ot(i.type==="glTF",`Invalid GLB magic string ${i.type}`),t._glb=i,t.json=i.json}else ot(!1,"GLTF: must be ArrayBuffer or string");let o=t.json.buffers||[];if(t.buffers=new Array(o.length).fill(null),t._glb&&t._glb.header.hasBinChunk){let{binChunks:i}=t._glb;t.buffers[0]={arrayBuffer:i[0].arrayBuffer,byteOffset:i[0].byteOffset,byteLength:i[0].byteLength}}let s=t.json.images||[];t.images=new Array(s.length).fill({})}async function DB(t,e,r){let n=t.json.buffers||[];for(let o=0;o<n.length;++o){let s=n[o];if(s.uri){let{fetch:i}=r;ot(i);let a=ia(s.uri,e),c=await(await r?.fetch?.(a))?.arrayBuffer?.();t.buffers[o]={arrayBuffer:c,byteOffset:0,byteLength:c.byteLength},delete s.uri}else t.buffers[o]===null&&(t.buffers[o]={arrayBuffer:new ArrayBuffer(s.byteLength),byteOffset:0,byteLength:s.byteLength})}}async function OB(t,e,r){let n=LB(t),o=t.json.images||[],s=[];for(let i of n)s.push(GB(t,o[i],i,e,r));return await Promise.all(s)}function LB(t){let e=new Set,r=t.json.textures||[];for(let n of r)n.source!==void 0&&e.add(n.source);return Array.from(e).sort()}async function GB(t,e,r,n,o){let s;if(e.uri&&!e.hasOwnProperty("bufferView")){let a=ia(e.uri,n),{fetch:f}=o;s=await(await f(a)).arrayBuffer(),e.bufferView={data:s}}if(Number.isFinite(e.bufferView)){let a=zl(t.json,t.buffers,e.bufferView);s=Pe(a.buffer,a.byteOffset,a.byteLength)}ot(s,"glTF image has no data");let i=await Ut(s,[Qi,ra],{...n,mimeType:e.mimeType,basis:n.basis||{format:Wo()}},o);i&&i[0]&&(i={compressed:!0,mipmaps:!1,width:i[0].width,height:i[0].height,data:i[0]}),t.images=t.images||[],t.images[r]=i}var Ze={dataType:null,batchType:null,name:"glTF",id:"gltf",module:"gltf",version:Zl,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:vB,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function vB(t,e={},r){e={...Ze.options,...e},e.gltf={...Ze.options.gltf,...e.gltf};let{byteOffset:n=0}=e;return await Bh({},t,n,e,r)}var NB={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},UB={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Dt={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},PB={magFilter:Dt.TEXTURE_MAG_FILTER,minFilter:Dt.TEXTURE_MIN_FILTER,wrapS:Dt.TEXTURE_WRAP_S,wrapT:Dt.TEXTURE_WRAP_T},HB={[Dt.TEXTURE_MAG_FILTER]:Dt.LINEAR,[Dt.TEXTURE_MIN_FILTER]:Dt.NEAREST_MIPMAP_LINEAR,[Dt.TEXTURE_WRAP_S]:Dt.REPEAT,[Dt.TEXTURE_WRAP_T]:Dt.REPEAT};function kB(){return{id:"default-sampler",parameters:HB}}function JB(t){return UB[t]}function zB(t){return NB[t]}var xa=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(e,r={}){let{json:n,buffers:o=[],images:s=[]}=e,{baseUri:i=""}=e;return ot(n),this.baseUri=i,this.buffers=o,this.images=s,this.jsonUnprocessed=n,this.json=this._resolveTree(e.json,r),this.json}_resolveTree(e,r={}){let n={...e};return this.json=n,e.bufferViews&&(n.bufferViews=e.bufferViews.map((o,s)=>this._resolveBufferView(o,s))),e.images&&(n.images=e.images.map((o,s)=>this._resolveImage(o,s))),e.samplers&&(n.samplers=e.samplers.map((o,s)=>this._resolveSampler(o,s))),e.textures&&(n.textures=e.textures.map((o,s)=>this._resolveTexture(o,s))),e.accessors&&(n.accessors=e.accessors.map((o,s)=>this._resolveAccessor(o,s))),e.materials&&(n.materials=e.materials.map((o,s)=>this._resolveMaterial(o,s))),e.meshes&&(n.meshes=e.meshes.map((o,s)=>this._resolveMesh(o,s))),e.nodes&&(n.nodes=e.nodes.map((o,s)=>this._resolveNode(o,s)),n.nodes=n.nodes.map((o,s)=>this._resolveNodeChildren(o))),e.skins&&(n.skins=e.skins.map((o,s)=>this._resolveSkin(o,s))),e.scenes&&(n.scenes=e.scenes.map((o,s)=>this._resolveScene(o,s))),typeof this.json.scene=="number"&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(e){return this._get(this.json.scenes,e)}getNode(e){return this._get(this.json.nodes,e)}getSkin(e){return this._get(this.json.skins,e)}getMesh(e){return this._get(this.json.meshes,e)}getMaterial(e){return this._get(this.json.materials,e)}getAccessor(e){return this._get(this.json.accessors,e)}getCamera(e){return this._get(this.json.cameras,e)}getTexture(e){return this._get(this.json.textures,e)}getSampler(e){return this._get(this.json.samplers,e)}getImage(e){return this._get(this.json.images,e)}getBufferView(e){return this._get(this.json.bufferViews,e)}getBuffer(e){return this._get(this.json.buffers,e)}_get(e,r){if(typeof r=="object")return r;let n=e&&e[r];return n||console.warn(`glTF file error: Could not find ${e}[${r}]`),n}_resolveScene(e,r){return{...e,id:e.id||`scene-${r}`,nodes:(e.nodes||[]).map(n=>this.getNode(n))}}_resolveNode(e,r){let n={...e,id:e?.id||`node-${r}`};return e.mesh!==void 0&&(n.mesh=this.getMesh(e.mesh)),e.camera!==void 0&&(n.camera=this.getCamera(e.camera)),e.skin!==void 0&&(n.skin=this.getSkin(e.skin)),e.meshes!==void 0&&e.meshes.length&&(n.mesh=e.meshes.reduce((o,s)=>{let i=this.getMesh(s);return o.id=i.id,o.primitives=o.primitives.concat(i.primitives),o},{primitives:[]})),n}_resolveNodeChildren(e){return e.children&&(e.children=e.children.map(r=>this.getNode(r))),e}_resolveSkin(e,r){let n=typeof e.inverseBindMatrices=="number"?this.getAccessor(e.inverseBindMatrices):void 0;return{...e,id:e.id||`skin-${r}`,inverseBindMatrices:n}}_resolveMesh(e,r){let n={...e,id:e.id||`mesh-${r}`,primitives:[]};return e.primitives&&(n.primitives=e.primitives.map(o=>{let s={...o,attributes:{},indices:void 0,material:void 0},i=o.attributes;for(let a in i)s.attributes[a]=this.getAccessor(i[a]);return o.indices!==void 0&&(s.indices=this.getAccessor(o.indices)),o.material!==void 0&&(s.material=this.getMaterial(o.material)),s})),n}_resolveMaterial(e,r){let n={...e,id:e.id||`material-${r}`};if(n.normalTexture&&(n.normalTexture={...n.normalTexture},n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlusionTexture={...n.occlusionTexture},n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emissiveTexture={...n.emissiveTexture},n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||(n.emissiveFactor=n.emissiveTexture?[1,1,1]:[0,0,0]),n.pbrMetallicRoughness){n.pbrMetallicRoughness={...n.pbrMetallicRoughness};let o=n.pbrMetallicRoughness;o.baseColorTexture&&(o.baseColorTexture={...o.baseColorTexture},o.baseColorTexture.texture=this.getTexture(o.baseColorTexture.index)),o.metallicRoughnessTexture&&(o.metallicRoughnessTexture={...o.metallicRoughnessTexture},o.metallicRoughnessTexture.texture=this.getTexture(o.metallicRoughnessTexture.index))}return n}_resolveAccessor(e,r){let n=JB(e.componentType),o=zB(e.type),s=n*o,i={...e,id:e.id||`accessor-${r}`,bytesPerComponent:n,components:o,bytesPerElement:s,value:void 0,bufferView:void 0,sparse:void 0};if(e.bufferView!==void 0&&(i.bufferView=this.getBufferView(e.bufferView)),i.bufferView){let a=i.bufferView.buffer,{ArrayType:f,byteLength:c}=Lr(i,i.bufferView),l=(i.bufferView.byteOffset||0)+(i.byteOffset||0)+a.byteOffset,h=a.arrayBuffer.slice(l,l+c);i.bufferView.byteStride&&(h=this._getValueFromInterleavedBuffer(a,l,i.bufferView.byteStride,i.bytesPerElement,i.count)),i.value=new f(h)}return i}_getValueFromInterleavedBuffer(e,r,n,o,s){let i=new Uint8Array(s*o);for(let a=0;a<s;a++){let f=r+a*n;i.set(new Uint8Array(e.arrayBuffer.slice(f,f+o)),a*o)}return i.buffer}_resolveTexture(e,r){return{...e,id:e.id||`texture-${r}`,sampler:typeof e.sampler=="number"?this.getSampler(e.sampler):kB(),source:typeof e.source=="number"?this.getImage(e.source):void 0}}_resolveSampler(e,r){let n={id:e.id||`sampler-${r}`,...e,parameters:{}};for(let o in n){let s=this._enumSamplerParameter(o);s!==void 0&&(n.parameters[s]=n[o])}return n}_enumSamplerParameter(e){return PB[e]}_resolveImage(e,r){let n={...e,id:e.id||`image-${r}`,image:null,bufferView:e.bufferView!==void 0?this.getBufferView(e.bufferView):void 0},o=this.images[r];return o&&(n.image=o),n}_resolveBufferView(e,r){let n=e.buffer,o=this.buffers[n].arrayBuffer,s=this.buffers[n].byteOffset||0;return e.byteOffset&&(s+=e.byteOffset),{id:`bufferView-${r}`,...e,buffer:this.buffers[n],data:new Uint8Array(o,s,e.byteLength)}}_resolveCamera(e,r){let n={...e,id:e.id||`camera-${r}`};return n.perspective,n.orthographic,n}};function vn(t,e){return new xa().postProcess(t,e)}var ns={URI:0,EMBEDDED:1};function os(t,e,r,n){t.rotateYtoZ=!0;let o=(t.byteOffset||0)+(t.byteLength||0)-r;if(o===0)throw new Error("glTF byte length must be greater than 0.");return t.gltfUpAxis=n?.["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",t.gltfArrayBuffer=Pe(e,r,o),t.gltfByteOffset=0,t.gltfByteLength=o,r%4===0||console.warn(`${t.type}: embedded glb is not aligned to a 4-byte boundary.`),(t.byteOffset||0)+(t.byteLength||0)}async function ss(t,e,r,n){let o=r?.["3d-tiles"]||{};if(QB(t,e,r),o.loadGLTF){if(!n)return;if(t.gltfUrl){let{fetch:s}=n,i=await s(t.gltfUrl,r);t.gltfArrayBuffer=await i.arrayBuffer(),t.gltfByteOffset=0}if(t.gltfArrayBuffer){let s=await Ut(t.gltfArrayBuffer,Ze,r,n);t.gltf=vn(s),t.gpuMemoryUsageInBytes=Dn(t.gltf),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength}}}function QB(t,e,r){switch(e){case ns.URI:if(t.gltfArrayBuffer){let n=new Uint8Array(t.gltfArrayBuffer,t.gltfByteOffset),s=new TextDecoder().decode(n);t.gltfUrl=s.replace(/[\s\0]+$/,"")}delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;break;case ns.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function xh(t,e,r,n,o){r=VB(t,e,r,n,o),await ss(t,ns.EMBEDDED,n,o);let s=t?.gltf?.extensions;return s&&s.CESIUM_RTC&&(t.rtcCenter=s.CESIUM_RTC.center),r}function VB(t,e,r,n,o){r=Me(t,e,r),r=Dr(t,e,r),r=Or(t,e,r,n),r=os(t,e,r,n);let s=new Ht(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=s.getGlobalProperty("RTC_CENTER",H.FLOAT,3),r}async function Eh(t,e,r,n,o){return r=jB(t,e,r,n,o),await ss(t,t.gltfFormat||0,n,o),r}function jB(t,e,r,n,o){if(r=Me(t,e,r),t.version!==1)throw new Error(`Instanced 3D Model version ${t.version} is not supported`);r=Dr(t,e,r);let s=new DataView(e);if(t.gltfFormat=s.getUint32(r,!0),r+=4,r=Or(t,e,r,n),r=os(t,e,r,n),!t?.header?.featureTableJsonByteLength||t.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let i=new Ht(t.featureTableJson,t.featureTableBinary),a=i.getGlobalProperty("INSTANCES_LENGTH");if(i.featuresLength=a,!Number.isFinite(a))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");t.eastNorthUp=i.getGlobalProperty("EAST_NORTH_UP"),t.rtcCenter=i.getGlobalProperty("RTC_CENTER",H.FLOAT,3);let f=new le(t.batchTableJson,t.batchTableBinary,a);return KB(t,i,f,a),r}function KB(t,e,r,n){let o=new Array(n),s=new M,i=new M,a=new M,f=new M,c=new X,l=new _e,h=new M,u={},d=new St,A=[],m=[],p=[],E=[];for(let y=0;y<n;y++){let T;if(e.hasProperty("POSITION"))T=e.getProperty("POSITION",H.FLOAT,3,y,s);else if(e.hasProperty("POSITION_QUANTIZED")){T=e.getProperty("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3,y,s);let g=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3);if(!g)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let x=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",H.FLOAT,3);if(!x)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let _=65535;for(let U=0;U<3;U++)T[U]=T[U]/_*x[U]+g[U]}if(!T)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");s.copy(T),u.translation=s,t.normalUp=e.getProperty("NORMAL_UP",H.FLOAT,3,y,A),t.normalRight=e.getProperty("NORMAL_RIGHT",H.FLOAT,3,y,m);let b=!1;if(t.normalUp){if(!t.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");t.hasCustomOrientation=!0}else{if(t.octNormalUp=e.getProperty("NORMAL_UP_OCT32P",H.UNSIGNED_SHORT,2,y,A),t.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",H.UNSIGNED_SHORT,2,y,m),t.octNormalUp)throw t.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");t.eastNorthUp?(ie.WGS84.eastNorthUpToFixedFrame(s,d),d.getRotationMatrix3(c)):c.identity()}b&&(f.copy(i).cross(a).normalize(),c.setColumn(0,i),c.setColumn(1,a),c.setColumn(2,f)),l.fromMatrix3(c),u.rotation=l,h.set(1,1,1);let C=e.getProperty("SCALE",H.FLOAT,1,y,p);Number.isFinite(C)&&h.multiplyByScalar(C);let w=e.getProperty("SCALE_NON_UNIFORM",H.FLOAT,3,y,A);w&&h.scale(w),u.scale=h;let I=e.getProperty("BATCH_ID",H.UNSIGNED_SHORT,1,y,E);I===void 0&&(I=y);let O=new St().fromQuaternion(u.rotation);d.identity(),d.translate(u.translation),d.multiplyRight(O),d.scale(u.scale);let B=d.clone();o[y]={modelMatrix:B,batchId:I}}t.instances=o}async function _h(t,e,r,n,o,s){r=Me(t,e,r);let i=new DataView(e);for(t.tilesLength=i.getUint32(r,!0),r+=4,t.tiles=[];t.tiles.length<t.tilesLength&&(t.byteLength||0)-r>12;){let a={shape:"tile3d"};t.tiles.push(a),r=await s(e,r,n,o,a)}return r}async function yh(t,e,r,n){if(t.rotateYtoZ=!0,t.gltfUpAxis=r?.["3d-tiles"]?.assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",r?.["3d-tiles"]?.loadGLTF){if(!n)return e.byteLength;let o=await Ut(e,Ze,r,n);t.gltf=vn(o),t.gpuMemoryUsageInBytes=Dn(t.gltf)}else t.gltfArrayBuffer=e;return e.byteLength}async function Ea(t,e=0,r,n,o={shape:"tile3d"}){switch(o.byteOffset=e,o.type=ll(t,e),o.type){case xt.COMPOSITE:return await _h(o,t,e,r,n,Ea);case xt.BATCHED_3D_MODEL:return await xh(o,t,e,r,n);case xt.GLTF:return await yh(o,t,r,n);case xt.INSTANCED_3D_MODEL:return await Eh(o,t,e,r,n);case xt.POINT_CLOUD:return await Rl(o,t,e,r,n);default:throw new Error(`3DTileLoader: unknown type ${o.type}`)}}async function _a(t,e,r){if(new Uint32Array(t.slice(0,4))[0]!==1952609651)throw new Error("Wrong subtree file magic number");if(new Uint32Array(t.slice(4,8))[0]!==1)throw new Error("Wrong subtree file verson, must be 1");let s=Ch(t.slice(8,16)),i=new Uint8Array(t,24,s),f=new TextDecoder("utf8").decode(i),c=JSON.parse(f),l=Ch(t.slice(16,24)),h=new ArrayBuffer(0);if(l&&(h=t.slice(24+s)),await is(c,c.tileAvailability,h,r),Array.isArray(c.contentAvailability))for(let u of c.contentAvailability)await is(c,u,h,r);else await is(c,c.contentAvailability,h,r);return await is(c,c.childSubtreeAvailability,h,r),c}async function is(t,e,r,n){let o=Number.isFinite(e.bitstream)?e.bitstream:e.bufferView;if(typeof o!="number")return;let s=t.bufferViews[o],i=t.buffers[s.buffer];if(!n?.baseUrl)throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(i.uri){let f=`${n?.baseUrl||""}/${i.uri}`,l=await(await n.fetch(f)).arrayBuffer();e.explicitBitstream=new Uint8Array(l,s.byteOffset,s.byteLength);return}let a=t.buffers.slice(0,s.buffer).reduce((f,c)=>f+c.byteLength,0);e.explicitBitstream=new Uint8Array(r.slice(a,a+i.byteLength),s.byteOffset,s.byteLength)}function Ch(t){let e=new DataView(t),r=e.getUint32(0,!0),n=e.getUint32(4,!0);return r+2**32*n}var Jr={dataType:null,batchType:null,id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:Sr,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:_a,options:{}};var Vh=dr(fn(),1);var kh=dr(fn(),1);var Ot=null;try{Ot=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function W(t,e,r){this.low=t|0,this.high=e|0,this.unsigned=!!r}W.prototype.__isLong__;Object.defineProperty(W.prototype,"__isLong__",{value:!0});function ut(t){return(t&&t.__isLong__)===!0}function Th(t){var e=Math.clz32(t&-t);return t?31-e:e}W.isLong=ut;var bh={},Mh={};function Ye(t,e){var r,n,o;return e?(t>>>=0,(o=0<=t&&t<256)&&(n=Mh[t],n)?n:(r=V(t,0,!0),o&&(Mh[t]=r),r)):(t|=0,(o=-128<=t&&t<128)&&(n=bh[t],n)?n:(r=V(t,t<0?-1:0,!1),o&&(bh[t]=r),r))}W.fromInt=Ye;function Lt(t,e){if(isNaN(t))return e?he:kt;if(e){if(t<0)return he;if(t>=Fh)return Oh}else{if(t<=-Ih)return yt;if(t+1>=Ih)return Dh}return t<0?Lt(-t,e).neg():V(t%Qr|0,t/Qr|0,e)}W.fromNumber=Lt;function V(t,e,r){return new W(t,e,r)}W.fromBits=V;var as=Math.pow;function Ca(t,e,r){if(t.length===0)throw Error("empty string");if(typeof e=="number"?(r=e,e=!1):e=!!e,t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return e?he:kt;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return Ca(t.substring(1),e,r).neg();for(var o=Lt(as(r,8)),s=kt,i=0;i<t.length;i+=8){var a=Math.min(8,t.length-i),f=parseInt(t.substring(i,i+a),r);if(a<8){var c=Lt(as(r,a));s=s.mul(c).add(Lt(f))}else s=s.mul(o),s=s.add(Lt(f))}return s.unsigned=e,s}W.fromString=Ca;function Jt(t,e){return typeof t=="number"?Lt(t,e):typeof t=="string"?Ca(t,e):V(t.low,t.high,typeof e=="boolean"?e:t.unsigned)}W.fromValue=Jt;var wh=1<<16,XB=1<<24,Qr=wh*wh,Fh=Qr*Qr,Ih=Fh/2,Sh=Ye(XB),kt=Ye(0);W.ZERO=kt;var he=Ye(0,!0);W.UZERO=he;var zr=Ye(1);W.ONE=zr;var Rh=Ye(1,!0);W.UONE=Rh;var ya=Ye(-1);W.NEG_ONE=ya;var Dh=V(-1,2147483647,!1);W.MAX_VALUE=Dh;var Oh=V(-1,-1,!0);W.MAX_UNSIGNED_VALUE=Oh;var yt=V(0,-2147483648,!1);W.MIN_VALUE=yt;var L=W.prototype;L.toInt=function(){return this.unsigned?this.low>>>0:this.low};L.toNumber=function(){return this.unsigned?(this.high>>>0)*Qr+(this.low>>>0):this.high*Qr+(this.low>>>0)};L.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(yt)){var r=Lt(e),n=this.div(r),o=n.mul(r).sub(this);return n.toString(e)+o.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var s=Lt(as(e,6),this.unsigned),i=this,a="";;){var f=i.div(s),c=i.sub(f.mul(s)).toInt()>>>0,l=c.toString(e);if(i=f,i.isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}};L.getHighBits=function(){return this.high};L.getHighBitsUnsigned=function(){return this.high>>>0};L.getLowBits=function(){return this.low};L.getLowBitsUnsigned=function(){return this.low>>>0};L.getNumBitsAbs=function(){if(this.isNegative())return this.eq(yt)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,r=31;r>0&&!(e&1<<r);r--);return this.high!=0?r+33:r+1};L.isZero=function(){return this.high===0&&this.low===0};L.eqz=L.isZero;L.isNegative=function(){return!this.unsigned&&this.high<0};L.isPositive=function(){return this.unsigned||this.high>=0};L.isOdd=function(){return(this.low&1)===1};L.isEven=function(){return(this.low&1)===0};L.equals=function(e){return ut(e)||(e=Jt(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low};L.eq=L.equals;L.notEquals=function(e){return!this.eq(e)};L.neq=L.notEquals;L.ne=L.notEquals;L.lessThan=function(e){return this.comp(e)<0};L.lt=L.lessThan;L.lessThanOrEqual=function(e){return this.comp(e)<=0};L.lte=L.lessThanOrEqual;L.le=L.lessThanOrEqual;L.greaterThan=function(e){return this.comp(e)>0};L.gt=L.greaterThan;L.greaterThanOrEqual=function(e){return this.comp(e)>=0};L.gte=L.greaterThanOrEqual;L.ge=L.greaterThanOrEqual;L.compare=function(e){if(ut(e)||(e=Jt(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1};L.comp=L.compare;L.negate=function(){return!this.unsigned&&this.eq(yt)?yt:this.not().add(zr)};L.neg=L.negate;L.add=function(e){ut(e)||(e=Jt(e));var r=this.high>>>16,n=this.high&65535,o=this.low>>>16,s=this.low&65535,i=e.high>>>16,a=e.high&65535,f=e.low>>>16,c=e.low&65535,l=0,h=0,u=0,d=0;return d+=s+c,u+=d>>>16,d&=65535,u+=o+f,h+=u>>>16,u&=65535,h+=n+a,l+=h>>>16,h&=65535,l+=r+i,l&=65535,V(u<<16|d,l<<16|h,this.unsigned)};L.subtract=function(e){return ut(e)||(e=Jt(e)),this.add(e.neg())};L.sub=L.subtract;L.multiply=function(e){if(this.isZero())return this;if(ut(e)||(e=Jt(e)),Ot){var r=Ot.mul(this.low,this.high,e.low,e.high);return V(r,Ot.get_high(),this.unsigned)}if(e.isZero())return this.unsigned?he:kt;if(this.eq(yt))return e.isOdd()?yt:kt;if(e.eq(yt))return this.isOdd()?yt:kt;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(Sh)&&e.lt(Sh))return Lt(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,o=this.high&65535,s=this.low>>>16,i=this.low&65535,a=e.high>>>16,f=e.high&65535,c=e.low>>>16,l=e.low&65535,h=0,u=0,d=0,A=0;return A+=i*l,d+=A>>>16,A&=65535,d+=s*l,u+=d>>>16,d&=65535,d+=i*c,u+=d>>>16,d&=65535,u+=o*l,h+=u>>>16,u&=65535,u+=s*c,h+=u>>>16,u&=65535,u+=i*f,h+=u>>>16,u&=65535,h+=n*l+o*c+s*f+i*a,h&=65535,V(d<<16|A,h<<16|u,this.unsigned)};L.mul=L.multiply;L.divide=function(e){if(ut(e)||(e=Jt(e)),e.isZero())throw Error("division by zero");if(Ot){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var r=(this.unsigned?Ot.div_u:Ot.div_s)(this.low,this.high,e.low,e.high);return V(r,Ot.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?he:kt;var n,o,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return he;if(e.gt(this.shru(1)))return Rh;s=he}else{if(this.eq(yt)){if(e.eq(zr)||e.eq(ya))return yt;if(e.eq(yt))return zr;var i=this.shr(1);return n=i.div(e).shl(1),n.eq(kt)?e.isNegative()?zr:ya:(o=this.sub(e.mul(n)),s=n.add(o.div(e)),s)}else if(e.eq(yt))return this.unsigned?he:kt;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=kt}for(o=this;o.gte(e);){n=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),f=a<=48?1:as(2,a-48),c=Lt(n),l=c.mul(e);l.isNegative()||l.gt(o);)n-=f,c=Lt(n,this.unsigned),l=c.mul(e);c.isZero()&&(c=zr),s=s.add(c),o=o.sub(l)}return s};L.div=L.divide;L.modulo=function(e){if(ut(e)||(e=Jt(e)),Ot){var r=(this.unsigned?Ot.rem_u:Ot.rem_s)(this.low,this.high,e.low,e.high);return V(r,Ot.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))};L.mod=L.modulo;L.rem=L.modulo;L.not=function(){return V(~this.low,~this.high,this.unsigned)};L.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};L.clz=L.countLeadingZeros;L.countTrailingZeros=function(){return this.low?Th(this.low):Th(this.high)+32};L.ctz=L.countTrailingZeros;L.and=function(e){return ut(e)||(e=Jt(e)),V(this.low&e.low,this.high&e.high,this.unsigned)};L.or=function(e){return ut(e)||(e=Jt(e)),V(this.low|e.low,this.high|e.high,this.unsigned)};L.xor=function(e){return ut(e)||(e=Jt(e)),V(this.low^e.low,this.high^e.high,this.unsigned)};L.shiftLeft=function(e){return ut(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?V(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):V(0,this.low<<e-32,this.unsigned)};L.shl=L.shiftLeft;L.shiftRight=function(e){return ut(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?V(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):V(this.high>>e-32,this.high>=0?0:-1,this.unsigned)};L.shr=L.shiftRight;L.shiftRightUnsigned=function(e){return ut(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?V(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):e===32?V(this.high,0,this.unsigned):V(this.high>>>e-32,0,this.unsigned)};L.shru=L.shiftRightUnsigned;L.shr_u=L.shiftRightUnsigned;L.rotateLeft=function(e){var r;return ut(e)&&(e=e.toInt()),(e&=63)===0?this:e===32?V(this.high,this.low,this.unsigned):e<32?(r=32-e,V(this.low<<e|this.high>>>r,this.high<<e|this.low>>>r,this.unsigned)):(e-=32,r=32-e,V(this.high<<e|this.low>>>r,this.low<<e|this.high>>>r,this.unsigned))};L.rotl=L.rotateLeft;L.rotateRight=function(e){var r;return ut(e)&&(e=e.toInt()),(e&=63)===0?this:e===32?V(this.high,this.low,this.unsigned):e<32?(r=32-e,V(this.high<<r|this.low>>>e,this.low<<r|this.high>>>e,this.unsigned)):(e-=32,r=32-e,V(this.low<<r|this.high>>>e,this.high<<r|this.low>>>e,this.unsigned))};L.rotr=L.rotateRight;L.toSigned=function(){return this.unsigned?V(this.low,this.high,!1):this};L.toUnsigned=function(){return this.unsigned?this:V(this.low,this.high,!0)};L.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()};L.toBytesLE=function(){var e=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]};L.toBytesBE=function(){var e=this.high,r=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};W.fromBytes=function(e,r,n){return n?W.fromBytesLE(e,r):W.fromBytesBE(e,r)};W.fromBytesLE=function(e,r){return new W(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r)};W.fromBytesBE=function(e,r){return new W(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],r)};var Vr=W;var ZB=16;function Nn(t){t==="X"&&(t="");let e=t.padEnd(ZB,"0");return Vr.fromString(e,!0,16)}function Ta(t){if(t.isZero())return"X";let e=t.countTrailingZeros(),r=e%4;e=(e-r)/4;let n=e;e*=4;let s=t.shiftRightUnsigned(e).toString(16).replace(/0+$/,"");return Array(17-n-s.length).join("0")+s}function ba(t,e){let r=YB(t).shiftRightUnsigned(2);return t.add(Vr.fromNumber(2*e+1-4).multiply(r))}function YB(t){return t.and(t.not().add(1))}var WB=3,qB=30,$B=2*qB+1,Lh=180/Math.PI;function vh(t){if(t.length===0)throw new Error(`Invalid Hilbert quad key ${t}`);let e=t.split("/"),r=parseInt(e[0],10),n=e[1],o=n.length,s=0,i=[0,0];for(let a=o-1;a>=0;a--){s=o-a;let f=n[a],c=0,l=0;f==="1"?l=1:f==="2"?(c=1,l=1):f==="3"&&(c=1);let h=Math.pow(2,s-1);tx(h,i,c,l),i[0]+=h*c,i[1]+=h*l}if(r%2===1){let a=i[0];i[0]=i[1],i[1]=a}return{face:r,ij:i,level:s}}function Nh(t){if(t.isZero())return"";let e=t.toString(2);for(;e.length<WB+$B;)e="0"+e;let r=e.lastIndexOf("1"),n=e.substring(0,3),o=e.substring(3,r),s=o.length/2,i=Vr.fromString(n,!0,2).toString(10),a="";if(s!==0)for(a=Vr.fromString(o,!0,2).toString(4);a.length<s;)a="0"+a;return`${i}/${a}`}function Ma(t,e,r){let n=1<<e;return[(t[0]+r[0])/n,(t[1]+r[1])/n]}function Gh(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function wa(t){return[Gh(t[0]),Gh(t[1])]}function Ia(t,[e,r]){switch(t){case 0:return[1,e,r];case 1:return[-e,1,r];case 2:return[-e,-r,1];case 3:return[-1,-r,-e];case 4:return[r,-1,-e];case 5:return[r,e,-1];default:throw new Error("Invalid face")}}function Sa([t,e,r]){let n=Math.atan2(r,Math.sqrt(t*t+e*e));return[Math.atan2(e,t)*Lh,n*Lh]}function tx(t,e,r,n){if(n===0){r===1&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);let o=e[0];e[0]=e[1],e[1]=o}}function Uh(t){let e=Ma(t.ij,t.level,[.5,.5]),r=wa(e),n=Ia(t.face,r);return Sa(n)}var ex=100;function Fa(t){let{face:e,ij:r,level:n}=t,o=[[0,0],[0,1],[1,1],[1,0],[0,0]],s=Math.max(1,Math.ceil(ex*Math.pow(2,-n))),i=new Float64Array(4*s*2+2),a=0,f=0;for(let c=0;c<4;c++){let l=o[c].slice(0),h=o[c+1],u=(h[0]-l[0])/s,d=(h[1]-l[1])/s;for(let A=0;A<s;A++){l[0]+=u,l[1]+=d;let m=Ma(r,n,l),p=wa(m),E=Ia(e,p),y=Sa(E);Math.abs(y[1])>89.999&&(y[0]=f);let T=y[0]-f;y[0]+=T>180?-360:T<-180?360:0,i[a++]=y[0],i[a++]=y[1],f=y[0]}}return i[a++]=i[0],i[a++]=i[1],i}function jr(t){let e=rx(t);return vh(e)}function rx(t){if(t.indexOf("/")>0)return t;let e=Nn(t);return Nh(e)}function Ra(t){let e=jr(t);return Uh(e)}function Hh(t){let e;if(t.face===2||t.face===5){let r=null,n=0;for(let o=0;o<4;o++){let s=`${t.face}/${o}`,i=jr(s),a=Fa(i);(typeof r>"u"||r===null)&&(r=new Float64Array(4*a.length)),r.set(a,n),n+=a.length}e=Ph(r)}else{let r=Fa(t);e=Ph(r)}return e}function Ph(t){if(t.length%2!==0)throw new Error("Invalid corners");let e=[],r=[];for(let n=0;n<t.length;n+=2)e.push(t[n]),r.push(t[n+1]);return e.sort((n,o)=>n-o),r.sort((n,o)=>n-o),{west:e[0],east:e[e.length-1],north:r[r.length-1],south:r[0]}}function Da(t,e){let r=e?.minimumHeight||0,n=e?.maximumHeight||0,o=jr(t),s=Hh(o),i=s.west,a=s.south,f=s.east,c=s.north,l=[];return l.push(new M(i,c,r)),l.push(new M(f,c,r)),l.push(new M(f,a,r)),l.push(new M(i,a,r)),l.push(new M(i,c,n)),l.push(new M(f,c,n)),l.push(new M(f,a,n)),l.push(new M(i,a,n)),l}function cs(t){let e=t.token,r={minimumHeight:t.minimumHeight,maximumHeight:t.maximumHeight},n=Da(e,r),o=Ra(e),s=o[0],i=o[1],a=ie.WGS84.cartographicToCartesian([s,i,r.maximumHeight]),f=new M(a[0],a[1],a[2]);n.push(f);let c=Ii(n);return[...c.center,...c.halfAxes]}var nx=4,ox=8,sx={QUADTREE:nx,OCTREE:ox};function ix(t,e,r){if(t?.box){let n=Nn(t.s2VolumeInfo.token),o=ba(n,e),s=Ta(o),i={...t.s2VolumeInfo};switch(i.token=s,r){case"OCTREE":let c=t.s2VolumeInfo,l=c.maximumHeight-c.minimumHeight,h=l/2,u=c.minimumHeight+l/2;c.minimumHeight=u-h,c.maximumHeight=u+h;break;default:break}return{box:cs(i),s2VolumeInfo:i}}}async function La(t){let{subtree:e,subtreeData:r={level:0,x:0,y:0,z:0},parentData:n={mortonIndex:0,localLevel:-1,localX:0,localY:0,localZ:0},childIndex:o=0,implicitOptions:s,loaderOptions:i,s2VolumeBox:a}=t,{subdivisionScheme:f,subtreeLevels:c,maximumLevel:l,contentUrlTemplate:h,subtreesUriTemplate:u,basePath:d}=s,A={children:[],lodMetricValue:0,contentUrl:""};if(!l)return Ls.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${h} won't be loaded...`),A;let m=n.localLevel+1,p=r.level+m;if(p>l)return A;let E=sx[f],y=Math.log2(E),T=o&1,b=o>>1&1,C=o>>2&1,w=We(n.localX,T,1),I=We(n.localY,b,1),O=We(n.localZ,C,1),B=We(r.x,w,m),g=We(r.y,I,m),x=We(r.z,O,m),_=We(n.mortonIndex,o,y),U=m===c&&Oa(e.childSubtreeAvailability,_),N,P,G,tt;if(U){let oe=`${d}/${u}`,an=fs(oe,p,B,g,x);N=await(0,kh.load)(an,Jr,i),tt=0,P={level:p,x:B,y:g,z:x},G={mortonIndex:0,localLevel:0,localX:0,localY:0,localZ:0}}else N=e,tt=(E**m-1)/(E-1)+_,P=r,G={mortonIndex:_,localLevel:m,localX:w,localY:I,localZ:O};if(!Oa(N.tileAvailability,tt))return A;Oa(N.contentAvailability,tt)&&(A.contentUrl=fs(h,p,B,g,x));for(let oe=0;oe<E;oe++){let an=ix(a,oe,f),ur=await La({subtree:N,subtreeData:P,parentData:G,childIndex:oe,implicitOptions:s,loaderOptions:i,s2VolumeBox:an});(ur.contentUrl||ur.children.length)&&A.children.push(ur)}return A.contentUrl||A.children.length?ax(A,{level:p,x:B,y:g,z:x},s,a):A}function Oa(t,e){let r;return Array.isArray(t)?(r=t[0],t.length>1&&Ls.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=t,"constant"in r?Boolean(r.constant):r.explicitBitstream?lx(e,r.explicitBitstream):!1}function ax(t,e,r,n){let{basePath:o,refine:s,getRefine:i,lodMetricType:a,getTileType:f,rootLodMetricValue:c,rootBoundingVolume:l}=r,h=t.contentUrl&&t.contentUrl.replace(`${o}/`,""),u=c/2**e.level,d=n?.box?{box:n.box}:l,A=cx(d,e,r.subdivisionScheme);return{children:t.children,contentUrl:t.contentUrl,content:{uri:h},id:t.contentUrl,refine:i(s),type:f(t),lodMetricType:a,lodMetricValue:u,geometricError:u,transform:t.transform,boundingVolume:A}}function cx(t,e,r){if(t.region){let{level:n,x:o,y:s,z:i}=e,[a,f,c,l,h,u]=t.region,d=2**n,A=(c-a)/d,[m,p]=[a+A*o,a+A*(o+1)],E=(l-f)/d,[y,T]=[f+E*s,f+E*(s+1)],b,C;if(r==="OCTREE"){let w=(u-h)/d;[b,C]=[h+w*i,h+w*(i+1)]}else[b,C]=[h,u];return{region:[m,y,p,T,b,C]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${JSON.stringify(t)}`)}function We(t,e,r){return(t<<r)+e}function fs(t,e,r,n,o){let s=fx({level:e,x:r,y:n,z:o});return t.replace(/{level}|{x}|{y}|{z}/gi,i=>s[i])}function fx(t){let e={};for(let r in t)e[`{${r}}`]=t[r];return e}function lx(t,e){let r=Math.floor(t/8),n=t%8;return(e[r]>>n&1)===1}function va(t,e=""){if(!e)return Te.EMPTY;let n=e.split("?")[0].split(".").pop();switch(n){case"pnts":return Te.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return Te.SCENEGRAPH;default:return n||Te.EMPTY}}function Na(t){switch(t){case"REPLACE":case"replace":return Ir.REPLACE;case"ADD":case"add":return Ir.ADD;default:return t}}function Ga(t,e){if(/^[a-z][0-9a-z+.-]*:/i.test(e)){let n=new URL(t,`${e}/`);return decodeURI(n.toString())}else if(t.startsWith("/"))return t;return _r.resolve(e,t)}function Jh(t,e){if(!t)return null;let r;if(t.content){let o=t.content.uri||t.content?.url;typeof o<"u"&&(r=Ga(o,e))}return{...t,id:r,contentUrl:r,lodMetricType:fe.GEOMETRIC_ERROR,lodMetricValue:t.geometricError,transformMatrix:t.transform,type:va(t,r),refine:Na(t.refine)}}async function jh(t,e,r){let n=null,o=Qh(t.root);o&&t.root?n=await zh(t.root,t,e,o,r):n=Jh(t.root,e);let s=[];for(s.push(n);s.length>0;){let i=s.pop()||{},a=i.children||[],f=[];for(let c of a){let l=Qh(c),h;l?h=await zh(c,t,e,l,r):h=Jh(c,e),h&&(f.push(h),s.push(h))}i.children=f}return n}async function zh(t,e,r,n,o){let{subdivisionScheme:s,maximumLevel:i,availableLevels:a,subtreeLevels:f,subtrees:{uri:c}}=n,l=fs(c,0,0,0,0),h=Ga(l,r),u=await(0,Vh.load)(h,Jr,o),d=t.content?.uri,A=d?Ga(d,r):"",m=e?.root?.refine,p=t.geometricError,E=t.boundingVolume.extensions?.["3DTILES_bounding_volume_S2"];if(E){let C={box:cs(E),s2VolumeInfo:E};t.boundingVolume=C}let y=t.boundingVolume,T={contentUrlTemplate:A,subtreesUriTemplate:c,subdivisionScheme:s,subtreeLevels:f,maximumLevel:Number.isFinite(a)?a-1:i,refine:m,basePath:r,lodMetricType:fe.GEOMETRIC_ERROR,rootLodMetricValue:p,rootBoundingVolume:y,getTileType:va,getRefine:Na};return await hx(t,r,u,T,o)}async function hx(t,e,r,n,o){if(!t)return null;let{children:s,contentUrl:i}=await La({subtree:r,implicitOptions:n,loaderOptions:o}),a,f=null;return i&&(a=i,f={uri:i.replace(`${e}/`,"")}),{...t,id:a,contentUrl:a,lodMetricType:fe.GEOMETRIC_ERROR,lodMetricValue:t.geometricError,transformMatrix:t.transform,type:va(t,a),refine:Na(t.refine),content:f||t.content,children:s}}function Qh(t){return t?.extensions?.["3DTILES_implicit_tiling"]||t?.implicitTiling}var qe={dataType:null,batchType:null,id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:Sr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:ux,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function ux(t,e={},r){let n=e["3d-tiles"]||{},o;return n.isTileset==="auto"?o=r?.url&&r.url.indexOf(".json")!==-1:o=n.isTileset,o?dx(t,e,r):Ax(t,e,r)}async function dx(t,e,r){let n=JSON.parse(new TextDecoder().decode(t)),o=r?.url||"",s=mx(o),i=await jh(n,s,e||{});return{...n,shape:"tileset3d",loader:qe,url:o,queryString:r?.queryString||"",basePath:s,root:i||n.root,type:wn.TILES3D,lodMetricType:fe.GEOMETRIC_ERROR,lodMetricValue:n.root?.geometricError||0}}async function Ax(t,e,r){let n={content:{shape:"tile3d",featureIds:null}};return await Ea(t,0,e,r,n.content),n.content}function mx(t){return _r.dirname(t)}var ls=dr(fn(),1);var Kh="https://api.cesium.com/v1/assets";async function hs(t,e){if(!e){let s=await px(t);for(let i of s.items)i.type==="3DTILES"&&(e=i.id)}let r=await gx(t,e),{type:n,url:o}=r;return z(n==="3DTILES"&&o),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function px(t){z(t);let e=Kh,r={Authorization:`Bearer ${t}`},n=await(0,ls.fetchFile)(e,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function gx(t,e){z(t,e);let r={Authorization:`Bearer ${t}`},n=`${Kh}/${e}`,o=await(0,ls.fetchFile)(`${n}`,{headers:r});if(!o.ok)throw new Error(o.statusText);let s=await o.json();if(o=await(0,ls.fetchFile)(`${n}/endpoint`,{headers:r}),!o.ok)throw new Error(o.statusText);let i=await o.json();return s={...s,...i},s}async function Bx(t,e={}){e=e["cesium-ion"]||{};let{accessToken:r}=e,n=e.assetId;if(!Number.isFinite(n)){let o=t.match(/\/([0-9]+)\/tileset.json/);n=o&&o[1]}return hs(r,n)}var Ua={...qe,id:"cesium-ion",name:"Cesium Ion",preload:Bx,parse:async(t,e,r)=>(e={...e},e["3d-tiles"]=e["cesium-ion"],e.loader=Ua,qe.parse(t,e,r)),options:{"cesium-ion":{...qe.options["3d-tiles"],accessToken:null}}};var Un=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 s=o;o-=BigInt(1024),o=o>=0n?o:0n;let i=new Uint8Array(await t.slice(o,s));for(let a=i.length-1;a>-1;a--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=i[a],r.every((f,c)=>f===e[c])){n=a;break}}while(n===-1&&o>0n);return o+BigInt(n)};var Xh=new Uint8Array([80,75,5,6]),Zh=new Uint8Array([80,75,6,7]),Yh=new Uint8Array([80,75,6,6]),xx=8n;var Ex=12n,_x=16n;var yx=8n,Cx=24n;var Tx=40n,bx=48n;var Wh=async t=>{let e=await Un(t,Xh),r=BigInt(await t.getUint16(e+xx)),n=BigInt(await t.getUint32(e+Ex)),o=BigInt(await t.getUint32(e+_x)),s=e-20n,i=0n,a=await t.slice(s,s+4n);if(ge(a,Zh)){i=await t.getBigUint64(s+yx);let f=await t.slice(i,i+4n);if(!ge(f,Yh.buffer))throw new Error("zip64 EoCD not found");r=await t.getBigUint64(i+Cx),n=await t.getBigUint64(i+Tx),o=await t.getBigUint64(i+bx)}else s=0n;return{cdRecordsNumber:r,cdStartOffset:o,cdByteSize:n,offsets:{zip64EoCDOffset:i,zip64EoCDLocatorOffset:s,zipEoCDOffset:e}}};var RF=[{offset:0,size:4,default:new DataView(Xh.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 DF=[{offset:0,size:4,default:new DataView(Zh.buffer).getUint32(0,!0)},{offset:4,size:4,default:0},{offset:8,size:8,name:"eoCDStart"},{offset:16,size:4,default:1}],OF=[{offset:0,size:4,default:new DataView(Yh.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 Mx=20,wx=24,Ix=28,Sx=30,Fx=32,Rx=42,us=46n,Hn=new Uint8Array([80,75,1,2]),Pn=async(t,e)=>{if(t>=e.length)return null;let r=new DataView(await e.slice(t,t+us)),n=r.buffer.slice(0,4);if(!ge(n,Hn.buffer))return null;let o=BigInt(r.getUint32(Mx,!0)),s=BigInt(r.getUint32(wx,!0)),i=r.getUint16(Sx,!0),a=BigInt(r.getUint16(Fx,!0)),f=r.getUint16(Ix,!0),c=await e.slice(t+us,t+us+BigInt(f+i)),l=c.slice(0,f),h=new TextDecoder().decode(l),u=t+us+BigInt(f),d=r.getUint32(Rx,!0),A=BigInt(d),m=new DataView(c.slice(f,c.byteLength)),p={uncompressedSize:s,compressedSize:o,localHeaderOffset:A,startDisk:a},E=Dx(p,m);return{...p,...E,extraFieldLength:i,fileNameLength:f,fileName:h,extraOffset:u}};async function*Kr(t){let{cdStartOffset:e,cdByteSize:r}=await Wh(t),n=new He(new DataView(await t.slice(e,e+r))),o=await Pn(0n,n);for(;o;)yield o,o=await Pn(o.extraOffset+BigInt(o.extraFieldLength),n)}var qh=(...t)=>t[0]+t[1]*16,Dx=(t,e)=>{let r=Ox(t),n={};if(r.length>0){let o=r.reduce((a,f)=>a+f.length,0),s=new Uint8Array(e.buffer).findIndex((a,f,c)=>qh(c[f],c[f+1])===1&&qh(c[f+2],c[f+3])===o),i=0;for(let a of r){let f=i;n[a.name]=e.getBigUint64(s+4+f,!0),i=f+a.length}}return n},Ox=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 NF=[{offset:0,size:4,default:new DataView(Hn.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 Lx=8,Gx=18,vx=22,Nx=26,Ux=28,ds=30n,Pa=new Uint8Array([80,75,3,4]),$e=async(t,e)=>{let r=new DataView(await e.slice(t,t+ds)),n=r.buffer.slice(0,4);if(!ge(n,Pa))return null;let o=r.getUint16(Nx,!0),s=r.getUint16(Ux,!0),i=await e.slice(t+ds,t+ds+BigInt(o+s)),a=i.slice(0,o),f=new DataView(i.slice(o,i.byteLength)),c=new TextDecoder().decode(a).split("\\").join("/"),l=t+ds+BigInt(o+s),h=r.getUint16(Lx,!0),u=BigInt(r.getUint32(Gx,!0)),d=BigInt(r.getUint32(vx,!0)),A=4;return d===BigInt(4294967295)&&(d=f.getBigUint64(A,!0),A+=8),u===BigInt(4294967295)&&(u=f.getBigUint64(A,!0),A+=8),l===BigInt(4294967295)&&(l=f.getBigUint64(A,!0)),{fileNameLength:o,fileName:c,extraFieldLength:s,fileDataOffset:l,compressedSize:u,compressionMethod:h}};var HF=[{offset:0,size:4,default:new DataView(Pa.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 As=class{constructor(e={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(e,r="base64"){let n=[];for await(let i of e)n.push(i),yield i;let o=await this.concatenate(n),s=await this.hash(o,r);this.options.crypto?.onEnd?.({hash:s})}async concatenate(e){return await An(e)}};function $h(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+=Px(n[o])}return e}function Px(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 tu(t,e){switch(e){case"hex":return t;case"base64":return Hx(t);default:throw new Error(e)}}function Hx(t){t.length%2!==0&&(t=`0${t}`);let r=(t.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return $h(r)||""}var ru=typeof atob=="function"?atob:typeof Buffer=="function"?Kx:ou,kx=ru("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG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EQxFQZsb29wRDIWBmxvb3BEMxcGbG9vcEQ0GAhvbmVGdWxsQRkIb25lRnVsbEIaCG9uZUZ1bGxDGwhvbmVGdWxsRBwIdHdvRnVsbEEdCHR3b0Z1bGxCHgh0d29GdWxsQx8IdHdvRnVsbEQgCHRyZUZ1bGxBIQh0cmVGdWxsQiIIdHJlRnVsbEMjCHRyZUZ1bGxEJAhxdWFGdWxsQSUIcXVhRnVsbEImCHF1YUZ1bGxDJwhxdWFGdWxsRCgEZ2V0QSkEZ2V0QioEZ2V0QysEZ2V0RCwEZ2V0WC0Ec2V0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),Ha=WebAssembly&&ru!==ou?jx(kx).buffer:!1,qt=Xx(),ka=240*16*16,nu=Math.floor(ka*16*1.066666667),Jx=268435456-65536,eu="Parameter must be Buffer, ArrayBuffer or Uint8Array",zx="Parameter exceeds max size of 255.9 Mbytes";Ha||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function Ja(t){var e,r,n,o,s,i,a,f,c,l;let h=Vx(),u=Qx(),d={},A=new Date().getTime();return d.then=function(y){return a=y,p(),d},d.catch=function(y){return f=y,d},t&&typeof t=="object"?typeof Buffer=="function"&&t.constructor===Buffer?i=t:t.constructor===Uint8Array||t.constructor===ArrayBuffer?i=t.constructor===ArrayBuffer?new Uint8Array(t):t:E(new TypeError(eu)):E(new TypeError(eu)),i&&(s=i.length,Ha&&s>nu?s>Jx?E(new Error(zx)):(e=new WebAssembly.Memory({initial:s>32e6?s>64e6?s>128e6?4096:2048:1024:512}),r=new Uint32Array(e.buffer),o={mem:e,log:console.log},n={imports:o},WebAssembly.instantiate(Ha,n).then(m)):p(h(i))),d;function m(y){p(u(i,y.instance.exports,r))}function p(y){var T=Boolean(y)?y:c;Boolean(y)&&(l=new Date().getTime()),typeof a=="function"?Boolean(T)&&(a(T,l-A),a=f=null):Boolean(y)&&(c=y)}function E(y){typeof f=="function"&&f(y)}}function Qx(){var t,e,r,n,o,s,i,a,f,c,l,h,u,d=function(A){var m,p,E,y,T,b,C,w,I,O,B,g,x,_,U,N,P,G,tt,pt,Y,oe,an=new Date().getTime(),ur=0,S=1732584193,F=-271733879,R=-1732584194,D=271733878,et=0,cn=A.length*8,so;for(so=ed(A,u),u[cn>>>5]|=128<<cn%32,u[(cn+64>>>9<<4)+14]=cn,so=(cn+64>>>9<<4)+15,Y=u;et<so;)so>et+nu?(n(S),s(F),a(R),c(D),e(ka),et=et+ka*16,S=r(),F=o(),R=i(),D=f(),ur++):(P=S,G=F,tt=R,pt=D,m=Y[et+0]>>>0,p=Y[et+1]>>>0,E=Y[et+2]>>>0,y=Y[et+3]>>>0,T=Y[et+4]>>>0,b=Y[et+5]>>>0,C=Y[et+6]>>>0,w=Y[et+7]>>>0,I=Y[et+8]>>>0,O=Y[et+9]>>>0,B=Y[et+10]>>>0,g=Y[et+11]>>>0,x=Y[et+12]>>>0,_=Y[et+13]>>>0,U=Y[et+14]>>>0,N=Y[et+15]>>>0,S=v(7,25,S+(F&R|~F&D)+m-680876936)+F,D=v(12,20,D+(S&F|~S&R)+p-389564586)+S,R=v(17,15,R+(D&S|~D&F)+E+606105819)+D,F=v(22,10,F+(R&D|~R&S)+y-1044525330)+R,S=v(7,25,S+(F&R|~F&D)+T-176418897)+F,D=v(12,20,D+(S&F|~S&R)+b+1200080426)+S,R=v(17,15,R+(D&S|~D&F)+C-1473231341)+D,F=v(22,10,F+(R&D|~R&S)+w-45705983)+R,S=v(7,25,S+(F&R|~F&D)+I+1770035416)+F,D=v(12,20,D+(S&F|~S&R)+O-1958414417)+S,R=v(17,15,R+(D&S|~D&F)+B-42063)+D,F=v(22,10,F+(R&D|~R&S)+g-1990404162)+R,S=v(7,25,S+(F&R|~F&D)+x+1804603682)+F,D=v(12,20,D+(S&F|~S&R)+_-40341101)+S,R=v(17,15,R+(D&S|~D&F)+U-1502002290)+D,F=v(22,10,F+(R&D|~R&S)+N+1236535329)+R,S=v(5,27,S+(F&D|R&~D)+p-165796510)+F,D=v(9,23,D+(S&R|F&~R)+C-1069501632)+S,R=v(14,18,R+(D&F|S&~F)+g+643717713)+D,F=v(20,12,F+(R&S|D&~S)+m-373897302)+R,S=v(5,27,S+(F&D|R&~D)+b-701558691)+F,D=v(9,23,D+(S&R|F&~R)+B+38016083)+S,R=v(14,18,R+(D&F|S&~F)+N-660478335)+D,F=v(20,12,F+(R&S|D&~S)+T-405537848)+R,S=v(5,27,S+(F&D|R&~D)+O+568446438)+F,D=v(9,23,D+(S&R|F&~R)+U-1019803690)+S,R=v(14,18,R+(D&F|S&~F)+y-187363961)+D,F=v(20,12,F+(R&S|D&~S)+I+1163531501)+R,S=v(5,27,S+(F&D|R&~D)+_-1444681467)+F,D=v(9,23,D+(S&R|F&~R)+E-51403784)+S,R=v(14,18,R+(D&F|S&~F)+w+1735328473)+D,F=v(20,12,F+(R&S|D&~S)+x-1926607734)+R,S=v(4,28,S+(F^R^D)+b-378558)+F,D=v(11,21,D+(S^F^R)+I-2022574463)+S,R=v(16,16,R+(D^S^F)+g+1839030562)+D,F=v(23,9,F+(R^D^S)+U-35309556)+R,S=v(4,28,S+(F^R^D)+p-1530992060)+F,D=v(11,21,D+(S^F^R)+T+1272893353)+S,R=v(16,16,R+(D^S^F)+w-155497632)+D,F=v(23,9,F+(R^D^S)+B-1094730640)+R,S=v(4,28,S+(F^R^D)+_+681279174)+F,D=v(11,21,D+(S^F^R)+m-358537222)+S,R=v(16,16,R+(D^S^F)+y-722521979)+D,F=v(23,9,F+(R^D^S)+C+76029189)+R,S=v(4,28,S+(F^R^D)+O-640364487)+F,D=v(11,21,D+(S^F^R)+x-421815835)+S,R=v(16,16,R+(D^S^F)+N+530742520)+D,F=v(23,9,F+(R^D^S)+E-995338651)+R,S=v(6,26,S+(R^(F|~D))+m-198630844)+F,D=v(10,22,D+(F^(S|~R))+w+1126891415)+S,R=v(15,17,R+(S^(D|~F))+U-1416354905)+D,F=v(21,11,F+(D^(R|~S))+b-57434055)+R,S=v(6,26,S+(R^(F|~D))+x+1700485571)+F,D=v(10,22,D+(F^(S|~R))+y-1894986606)+S,R=v(15,17,R+(S^(D|~F))+B-1051523)+D,F=v(21,11,F+(D^(R|~S))+p-2054922799)+R,S=v(6,26,S+(R^(F|~D))+I+1873313359)+F,D=v(10,22,D+(F^(S|~R))+N-30611744)+S,R=v(15,17,R+(S^(D|~F))+C-1560198380)+D,F=v(21,11,F+(D^(R|~S))+_+1309151649)+R,S=v(6,26,S+(R^(F|~D))+T-145523070)+F,D=v(10,22,D+(F^(S|~R))+g-1120210379)+S,R=v(15,17,R+(S^(D|~F))+E+718787259)+D,F=v(21,11,F+(D^(R|~S))+O-343485551)+R,et=et+16,S=S+P>>>0,F=F+G>>>0,R=R+tt>>>0,D=D+pt>>>0);return qt.endian([S,F,R,D]);function v(dt,io,Vt){return Vt<<dt|Vt>>>io}function ed(dt,io){for(var Vt=-1,Ds=Math.floor((dt.length-1)/4),gt=0,wc,Ic,Sc,Fc;Ds-8>Vt++;)gt=Vt<<2,io[Vt]=dt[gt+0]|dt[gt+1]<<8|dt[gt+2]<<16|dt[gt+3]<<24;for(Vt--;Ds>Vt++;)gt=Vt<<2,wc=typeof dt[gt+0]>"u"?0:dt[gt+0],Ic=typeof dt[gt+1]>"u"?0:dt[gt+1],Sc=typeof dt[gt+2]>"u"?0:dt[gt+2],Fc=typeof dt[gt+3]>"u"?0:dt[gt+3],io[Vt]=wc|Ic<<8|Sc<<16|Fc<<24;return Ds+1}};return function(A,m,p,E){var y;return e=m.loops,t=m.loop,r=m.getA,o=m.getB,i=m.getC,f=m.getD,l=m.getX,n=m.setA,s=m.setB,a=m.setC,c=m.setD,h=m.setX,u=p,y=qt.wordsToBytes(d(A)),E&&E.asBytes?y:qt.bytesconvertNumberToHex(y)}}function Vx(){var t=function(e,r){var n,o,s,i,a,f,c,l,h,u,d,A,m,p,E,y,T,b,C,w,I,O=new Date().getTime(),B=1732584193,g=-271733879,x=-1732584194,_=271733878,U=e.length*8;I=qt.bytesToWords(e);for(var N=0;N<I.length;N++)I[N]=(I[N]<<8|I[N]>>>24)&16711935|(I[N]<<24|I[N]>>>8)&4278255360;I[U>>>5]|=128<<U%32,I[(U+64>>>9<<4)+14]=U;for(var P=0;P<I.length;P+=16)T=B,b=g,C=x,w=_,n=I[P+0]>>>0,o=I[P+1]>>>0,s=I[P+2]>>>0,i=I[P+3]>>>0,a=I[P+4]>>>0,f=I[P+5]>>>0,c=I[P+6]>>>0,l=I[P+7]>>>0,h=I[P+8]>>>0,u=I[P+9]>>>0,d=I[P+10]>>>0,A=I[P+11]>>>0,m=I[P+12]>>>0,p=I[P+13]>>>0,E=I[P+14]>>>0,y=I[P+15]>>>0,B=G(7,25,B+(g&x|~g&_)+n-680876936)+g,_=G(12,20,_+(B&g|~B&x)+o-389564586)+B,x=G(17,15,x+(_&B|~_&g)+s+606105819)+_,g=G(22,10,g+(x&_|~x&B)+i-1044525330)+x,B=G(7,25,B+(g&x|~g&_)+a-176418897)+g,_=G(12,20,_+(B&g|~B&x)+f+1200080426)+B,x=G(17,15,x+(_&B|~_&g)+c-1473231341)+_,g=G(22,10,g+(x&_|~x&B)+l-45705983)+x,B=G(7,25,B+(g&x|~g&_)+h+1770035416)+g,_=G(12,20,_+(B&g|~B&x)+u-1958414417)+B,x=G(17,15,x+(_&B|~_&g)+d-42063)+_,g=G(22,10,g+(x&_|~x&B)+A-1990404162)+x,B=G(7,25,B+(g&x|~g&_)+m+1804603682)+g,_=G(12,20,_+(B&g|~B&x)+p-40341101)+B,x=G(17,15,x+(_&B|~_&g)+E-1502002290)+_,g=G(22,10,g+(x&_|~x&B)+y+1236535329)+x,B=G(5,27,B+(g&_|x&~_)+o-165796510)+g,_=G(9,23,_+(B&x|g&~x)+c-1069501632)+B,x=G(14,18,x+(_&g|B&~g)+A+643717713)+_,g=G(20,12,g+(x&B|_&~B)+n-373897302)+x,B=G(5,27,B+(g&_|x&~_)+f-701558691)+g,_=G(9,23,_+(B&x|g&~x)+d+38016083)+B,x=G(14,18,x+(_&g|B&~g)+y-660478335)+_,g=G(20,12,g+(x&B|_&~B)+a-405537848)+x,B=G(5,27,B+(g&_|x&~_)+u+568446438)+g,_=G(9,23,_+(B&x|g&~x)+E-1019803690)+B,x=G(14,18,x+(_&g|B&~g)+i-187363961)+_,g=G(20,12,g+(x&B|_&~B)+h+1163531501)+x,B=G(5,27,B+(g&_|x&~_)+p-1444681467)+g,_=G(9,23,_+(B&x|g&~x)+s-51403784)+B,x=G(14,18,x+(_&g|B&~g)+l+1735328473)+_,g=G(20,12,g+(x&B|_&~B)+m-1926607734)+x,B=G(4,28,B+(g^x^_)+f-378558)+g,_=G(11,21,_+(B^g^x)+h-2022574463)+B,x=G(16,16,x+(_^B^g)+A+1839030562)+_,g=G(23,9,g+(x^_^B)+E-35309556)+x,B=G(4,28,B+(g^x^_)+o-1530992060)+g,_=G(11,21,_+(B^g^x)+a+1272893353)+B,x=G(16,16,x+(_^B^g)+l-155497632)+_,g=G(23,9,g+(x^_^B)+d-1094730640)+x,B=G(4,28,B+(g^x^_)+p+681279174)+g,_=G(11,21,_+(B^g^x)+n-358537222)+B,x=G(16,16,x+(_^B^g)+i-722521979)+_,g=G(23,9,g+(x^_^B)+c+76029189)+x,B=G(4,28,B+(g^x^_)+u-640364487)+g,_=G(11,21,_+(B^g^x)+m-421815835)+B,x=G(16,16,x+(_^B^g)+y+530742520)+_,g=G(23,9,g+(x^_^B)+s-995338651)+x,B=G(6,26,B+(x^(g|~_))+n-198630844)+g,_=G(10,22,_+(g^(B|~x))+l+1126891415)+B,x=G(15,17,x+(B^(_|~g))+E-1416354905)+_,g=G(21,11,g+(_^(x|~B))+f-57434055)+x,B=G(6,26,B+(x^(g|~_))+m+1700485571)+g,_=G(10,22,_+(g^(B|~x))+i-1894986606)+B,x=G(15,17,x+(B^(_|~g))+d-1051523)+_,g=G(21,11,g+(_^(x|~B))+o-2054922799)+x,B=G(6,26,B+(x^(g|~_))+h+1873313359)+g,_=G(10,22,_+(g^(B|~x))+y-30611744)+B,x=G(15,17,x+(B^(_|~g))+c-1560198380)+_,g=G(21,11,g+(_^(x|~B))+p+1309151649)+x,B=G(6,26,B+(x^(g|~_))+a-145523070)+g,_=G(10,22,_+(g^(B|~x))+A-1120210379)+B,x=G(15,17,x+(B^(_|~g))+s+718787259)+_,g=G(21,11,g+(_^(x|~B))+u-343485551)+x,B=B+T>>>0,g=g+b>>>0,x=x+C>>>0,_=_+w>>>0;return qt.endian([B,g,x,_]);function G(tt,pt,Y){return Y<<tt|Y>>>pt}};return function(e,r){var n=qt.wordsToBytes(t(e,r)),o=r&&r.asBytes?n:qt.bytesconvertNumberToHex(n);return o}}function jx(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 Kx(t){return Buffer.from(t,"base64").toString("binary")}function ou(t){return t}function Xx(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(e,r){return e<<r|e>>>32-r},endian:function(e){if(e.constructor==Number)return qt.rotl(e,8)&16711935|qt.rotl(e,24)&4278255360;for(var r=0;r<e.length;r++)e[r]=qt.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 tr=class extends As{name="md5";options;constructor(e={}){super(),this.options=e}async hash(e,r){let o=await new Promise((s,i)=>Ja(e).then(s).catch(i));return tu(o,r)}};var Xr=class{constructor(e){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(e={}){un(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 An(e)}improveError(e){return e.message.includes(this.name)||(e.message=`${this.name} ${e.message}`),e}};var kn=class extends Xr{name="uncompressed";extensions=[];contentEncodings=[];isSupported=!0;options;constructor(e){super(e),this.options=e||{}}compressSync(e){return e}decompressSync(e){return e}async*compressBatches(e){return yield*e}async*decompressBatches(e){return yield*e}};var fr=dr(V0(),1),pe=dr(j0(),1),lr=class extends Xr{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(e={}){super(e),this.options=e}async compress(e){if(!Bt&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Er(pe.default.gzip)(e):await Er(pe.default.deflate)(e);return xr(r)}return this.compressSync(e)}async decompress(e){if(!Bt&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Er(pe.default.gunzip)(e):await Er(pe.default.inflate)(e);return xr(r)}return this.decompressSync(e)}compressSync(e){if(!Bt&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?pe.default.gzipSync(e):pe.default.deflateSync(e);return xr(s)}let r=this.options?.deflate||{},n=new Uint8Array(e);return(this.options?.raw?fr.default.deflateRaw:fr.default.deflate)(n,r).buffer}decompressSync(e){if(!Bt&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?pe.default.gunzipSync(e):pe.default.inflateSync(e);return xr(s)}let r=this.options?.deflate||{},n=new Uint8Array(e);return(this.options?.raw?fr.default.inflateRaw:fr.default.inflate)(n,r).buffer}async*compressBatches(e){let r=this.options?.deflate||{},n=new fr.default.Deflate(r);yield*this.transformBatches(n,e)}async*decompressBatches(e){let r=this.options?.deflate||{},n=new fr.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 i of r){let a=new Uint8Array(i);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 k_={0:async t=>t,8:async t=>await new lr({raw:!0}).decompress(t)},Rs=class{fileProvider=null;fileName;archive=null;constructor(e){if(typeof e=="string")if(this.fileName=e,!Bt)this.fileProvider=new gn(e);else throw new Error("Cannot open file for random access in a WEB browser");else e instanceof hr?(this.fileProvider=e.fileProvider,this.archive=e,this.fileName=e.fileName):ks(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=Kr(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),s=await $e(o.localHeaderOffset,this.fileProvider);if(!s)throw new Error("Local file header has not been found in the zip archive`");let i=k_[s.compressionMethod.toString()];if(!i)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(s.fileDataOffset,s.fileDataOffset+s.compressedSize);r=await i(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=Kr(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 hr=class{fileProvider;fileName;constructor(e,r,n){this.fileProvider=e,this.fileName=n}async getFileWithoutHash(e){return await(await new Rs(this.fileProvider).fetch(e)).arrayBuffer()}};function Cc(t){let e=new DataView(t),r={};for(let n=0;n<t.byteLength;n=n+24){let o=e.getBigUint64(n+16,!0),s=J_(t,n,16);r[s]=o}return r}function J_(t,e,r){return[...new Uint8Array(t,e,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function Tc(t){let e=Kr(t);return z_(e)}async function z_(t){let e=new tr,r=new TextEncoder,n={};for await(let o of t){let s=o.fileName.split("\\").join("/").toLocaleLowerCase(),i=r.encode(s).buffer,a=await e.hash(i,"hex");n[a]=o.localHeaderOffset}return n}var Q_={0:t=>new kn().decompress(t),8:t=>new lr({raw:!0}).decompress(t)},sn=class extends hr{hashTable;constructor(e,r,n){super(e,r,n),this.hashTable=r}async getFile(e){let r=await this.getFileBytes(e.toLocaleLowerCase());if(r||(r=await this.getFileBytes(e)),!r)throw new Error(`No such file in the archive: ${e}`);return r}async getFileBytes(e){let r;if(this.hashTable){let n=new TextEncoder().encode(e).buffer,o=await new tr().hash(n,"hex"),s=this.hashTable[o];if(s===void 0)return null;let i=await $e(s,this.fileProvider);if(!i)return null;let a=await this.fileProvider.slice(i.fileDataOffset,i.fileDataOffset+i.compressedSize),f=Q_[i.compressionMethod];if(!f)throw Error("Only Deflation compression is supported");r=await f(a)}else r=await this.getFileWithoutHash(e);return r}};var K0=async(t,e)=>{let r=await Un(t,Hn),n=await Pn(r,t),o;if(n?.fileName!=="@3dtilesIndex1@")o=await Tc(t),e?.("3tz doesnt contain hash file, hash info has been composed according to zip archive headers");else{let s=await $e(n.localHeaderOffset,t);if(!s)throw new Error("corrupted 3tz zip archive");let i=s.fileDataOffset,a=await t.slice(i,i+s.compressedSize);o=Cc(a)}return new sn(t,o)};var V_="4.3.0-beta.1",X0={dataType:null,batchType:null,name:"3tz",id:"3tz",module:"3d-tiles",version:V_,mimeTypes:["application/octet-stream","application/vnd.maxar.archive.3tz+zip"],parse:j_,extensions:["3tz"],options:{}};async function j_(t,e={}){return(await K0(new He(new DataView(t)))).getFile(e["3d-tiles-archive"]?.path??"")}function Ge(t,e,r){if(!e)return r+12;let{magic:o,version:s=1,byteLength:i=12}=t;return z(Array.isArray(o)&&Number.isFinite(s)&&Number.isFinite(i)),e.setUint8(r+0,o[0]),e.setUint8(r+1,o[1]),e.setUint8(r+2,o[2]),e.setUint8(r+3,o[3]),e.setUint32(r+4,s,!0),e.setUint32(r+8,i,!0),r+=12,r}function ve(t,e,r){t&&t.setUint32(e+8,r,!0)}function Z0(t,e,r,n,o){t={magic:be.COMPOSITE,tiles:[],...t};let s=r;r+=Ge(t,e,r),e&&e.setUint32(r,t.tiles.length,!0),r+=4;for(let i=0;i<t.tiles.length;++i)r+=o(t.tiles[i],e,r,n);return ve(e,s,r-s),r}function Y0(t,e,r,n){let{featuresLength:o=0,batchTable:s}=t,a=JSON.stringify({BATCH_LENGTH:o}),f=s?JSON.stringify(s):"",c=Tt(a.length,8),l=f?Tt(f.length,8):0;t={magic:be.BATCHED_MODEL,...t};let h=r;r=Ge(t,e,r),e&&(e.setUint32(12,c,!0),e.setUint32(16,0,!0),e.setUint32(20,l,!0),e.setUint32(24,0,!0)),r+=16,r=po(e,r,a,8),s&&(r=po(e,r,f,8));let u=t.gltfEncoded;return u&&(r=dn(e,r,u,u.byteLength)),ve(e,h,r-h),r}function W0(t,e,r,n){let{featuresLength:o=1,gltfFormat:s=1,gltfUri:i=""}=t,a=i.length,f={INSTANCES_LENGTH:o,POSITION:new Array(o*3).fill(0)},c=JSON.stringify(f),l=c.length;t={magic:be.INSTANCED_MODEL,...t};let h=r;return r=Ge(t,e,0),e&&(e.setUint32(12,l,!0),e.setUint32(16,0,!0),e.setUint32(20,0,!0),e.setUint32(24,0,!0),e.setUint32(28,s,!0)),r+=20,r+=Br(e,r,c,l),r+=Br(e,r,i,a),ve(e,h,r-h),r}var K_={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function q0(t,e,r,n){let{featureTableJson:o=K_}=t,s=JSON.stringify(o);s=Ps(s,4);let{featureTableJsonByteLength:i=s.length}=t,a=new ArrayBuffer(12),f=a.byteLength;t={magic:be.POINT_CLOUD,...t};let c=r;return r+=Ge(t,e,0),e&&(e.setUint32(r+0,i,!0),e.setUint32(r+4,f,!0),e.setUint32(r+8,0,!0),e.setUint32(r+12,0,!0)),r+=16,r+=Br(e,r,s,i),r+=dn(e,r,a,f),ve(e,c,r-c),r}function Mc(t,e){let r=bc(t,null,0,e),n=new ArrayBuffer(r),o=new DataView(n);return bc(t,o,0,e),n}function bc(t,e,r,n){switch(z(typeof t.type=="string"),t.type){case xt.COMPOSITE:return Z0(t,e,r,n,bc);case xt.POINT_CLOUD:return q0(t,e,r,n);case xt.BATCHED_3D_MODEL:return Y0(t,e,r,n);case xt.INSTANCED_3D_MODEL:return W0(t,e,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var td={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:Sr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],binary:!0,options:{["3d-tiles"]:{}},encode:async(t,e)=>$0(t,e),encodeSync:$0};function $0(t,e){return Mc(t,e)}return ad(oo);})();
8
8
  /*! Bundled license information:
9
9
 
10
10
  long/index.js: