@loaders.gl/3d-tiles 4.2.3 → 4.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dist.min.js CHANGED
@@ -4,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 qd=Object.create;var ps=Object.defineProperty;var Wd=Object.getOwnPropertyDescriptor;var $d=Object.getOwnPropertyNames;var t1=Object.getPrototypeOf,e1=Object.prototype.hasOwnProperty;var ct=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ut=(e,t)=>{for(var r in t)ps(e,r,{get:t[r],enumerable:!0})},ms=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of $d(t))!e1.call(e,s)&&s!==r&&ps(e,s,{get:()=>t[s],enumerable:!(n=Wd(t,s))||n.enumerable});return e},gs=(e,t,r)=>(ms(e,t,"default"),r&&ms(r,t,"default")),gr=(e,t,r)=>(r=e!=null?qd(t1(e)):{},ms(t||!e||!e.__esModule?ps(r,"default",{value:e,enumerable:!0}):r,e)),r1=e=>ms(ps({},"__esModule",{value:!0}),e);var pn=ct((z_,Yc)=>{Yc.exports=globalThis.loaders});var xe=ct(gt=>{"use strict";var z2=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Q2(e,t){return Object.prototype.hasOwnProperty.call(e,t)}gt.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)Q2(r,n)&&(e[n]=r[n])}}return e};gt.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var V2={arraySet:function(e,t,r,n,s){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),s);return}for(var o=0;o<n;o++)e[s+o]=t[r+o]},flattenChunks:function(e){var t,r,n,s,o,i;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(i=new Uint8Array(n),s=0,t=0,r=e.length;t<r;t++)o=e[t],i.set(o,s),s+=o.length;return i}},j2={arraySet:function(e,t,r,n,s){for(var o=0;o<n;o++)e[s+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};gt.setTyped=function(e){e?(gt.Buf8=Uint8Array,gt.Buf16=Uint16Array,gt.Buf32=Int32Array,gt.assign(gt,V2)):(gt.Buf8=Array,gt.Buf16=Array,gt.Buf32=Array,gt.assign(gt,j2))};gt.setTyped(z2)});var y0=ct(on=>{"use strict";var K2=xe(),X2=4,t0=0,e0=1,Y2=2;function sn(e){for(var t=e.length;--t>=0;)e[t]=0}var Z2=0,a0=1,q2=2,W2=3,$2=258,dc=29,ts=256,Zn=ts+1+dc,nn=30,Ac=19,c0=2*Zn+1,or=15,ac=16,tE=7,mc=256,f0=16,h0=17,l0=18,lc=[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],bo=[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],eE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],u0=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rE=512,Be=new Array((Zn+2)*2);sn(Be);var Yn=new Array(nn*2);sn(Yn);var qn=new Array(rE);sn(qn);var Wn=new Array($2-W2+1);sn(Wn);var pc=new Array(dc);sn(pc);var wo=new Array(nn);sn(wo);function cc(e,t,r,n,s){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=s,this.has_stree=e&&e.length}var d0,A0,m0;function fc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function p0(e){return e<256?qn[e]:qn[256+(e>>>7)]}function $n(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function Mt(e,t,r){e.bi_valid>ac-r?(e.bi_buf|=t<<e.bi_valid&65535,$n(e,e.bi_buf),e.bi_buf=t>>ac-e.bi_valid,e.bi_valid+=r-ac):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function se(e,t,r){Mt(e,r[t*2],r[t*2+1])}function g0(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function nE(e){e.bi_valid===16?($n(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function sE(e,t){var r=t.dyn_tree,n=t.max_code,s=t.stat_desc.static_tree,o=t.stat_desc.has_stree,i=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,f=t.stat_desc.max_length,c,h,l,u,d,A,m=0;for(u=0;u<=or;u++)e.bl_count[u]=0;for(r[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<c0;c++)h=e.heap[c],u=r[r[h*2+1]*2+1]+1,u>f&&(u=f,m++),r[h*2+1]=u,!(h>n)&&(e.bl_count[u]++,d=0,h>=a&&(d=i[h-a]),A=r[h*2],e.opt_len+=A*(u+d),o&&(e.static_len+=A*(s[h*2+1]+d)));if(m!==0){do{for(u=f-1;e.bl_count[u]===0;)u--;e.bl_count[u]--,e.bl_count[u+1]+=2,e.bl_count[f]--,m-=2}while(m>0);for(u=f;u!==0;u--)for(h=e.bl_count[u];h!==0;)l=e.heap[--c],!(l>n)&&(r[l*2+1]!==u&&(e.opt_len+=(u-r[l*2+1])*r[l*2],r[l*2+1]=u),h--)}}function x0(e,t,r){var n=new Array(or+1),s=0,o,i;for(o=1;o<=or;o++)n[o]=s=s+r[o-1]<<1;for(i=0;i<=t;i++){var a=e[i*2+1];a!==0&&(e[i*2]=g0(n[a]++,a))}}function oE(){var e,t,r,n,s,o=new Array(or+1);for(r=0,n=0;n<dc-1;n++)for(pc[n]=r,e=0;e<1<<lc[n];e++)Wn[r++]=n;for(Wn[r-1]=n,s=0,n=0;n<16;n++)for(wo[n]=s,e=0;e<1<<bo[n];e++)qn[s++]=n;for(s>>=7;n<nn;n++)for(wo[n]=s<<7,e=0;e<1<<bo[n]-7;e++)qn[256+s++]=n;for(t=0;t<=or;t++)o[t]=0;for(e=0;e<=143;)Be[e*2+1]=8,e++,o[8]++;for(;e<=255;)Be[e*2+1]=9,e++,o[9]++;for(;e<=279;)Be[e*2+1]=7,e++,o[7]++;for(;e<=287;)Be[e*2+1]=8,e++,o[8]++;for(x0(Be,Zn+1,o),e=0;e<nn;e++)Yn[e*2+1]=5,Yn[e*2]=g0(e,5);d0=new cc(Be,lc,ts+1,Zn,or),A0=new cc(Yn,bo,0,nn,or),m0=new cc(new Array(0),eE,0,Ac,tE)}function B0(e){var t;for(t=0;t<Zn;t++)e.dyn_ltree[t*2]=0;for(t=0;t<nn;t++)e.dyn_dtree[t*2]=0;for(t=0;t<Ac;t++)e.bl_tree[t*2]=0;e.dyn_ltree[mc*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function E0(e){e.bi_valid>8?$n(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function iE(e,t,r,n){E0(e),n&&($n(e,r),$n(e,~r)),K2.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function r0(e,t,r,n){var s=t*2,o=r*2;return e[s]<e[o]||e[s]===e[o]&&n[t]<=n[r]}function hc(e,t,r){for(var n=e.heap[r],s=r<<1;s<=e.heap_len&&(s<e.heap_len&&r0(t,e.heap[s+1],e.heap[s],e.depth)&&s++,!r0(t,n,e.heap[s],e.depth));)e.heap[r]=e.heap[s],r=s,s<<=1;e.heap[r]=n}function n0(e,t,r){var n,s,o=0,i,a;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+o*2]<<8|e.pending_buf[e.d_buf+o*2+1],s=e.pending_buf[e.l_buf+o],o++,n===0?se(e,s,t):(i=Wn[s],se(e,i+ts+1,t),a=lc[i],a!==0&&(s-=pc[i],Mt(e,s,a)),n--,i=p0(n),se(e,i,r),a=bo[i],a!==0&&(n-=wo[i],Mt(e,n,a)));while(o<e.last_lit);se(e,mc,t)}function uc(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,s=t.stat_desc.has_stree,o=t.stat_desc.elems,i,a,f=-1,c;for(e.heap_len=0,e.heap_max=c0,i=0;i<o;i++)r[i*2]!==0?(e.heap[++e.heap_len]=f=i,e.depth[i]=0):r[i*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=f<2?++f:0,r[c*2]=1,e.depth[c]=0,e.opt_len--,s&&(e.static_len-=n[c*2+1]);for(t.max_code=f,i=e.heap_len>>1;i>=1;i--)hc(e,r,i);c=o;do i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],hc(e,r,1),a=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=a,r[c*2]=r[i*2]+r[a*2],e.depth[c]=(e.depth[i]>=e.depth[a]?e.depth[i]:e.depth[a])+1,r[i*2+1]=r[a*2+1]=c,e.heap[1]=c++,hc(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],sE(e,t),x0(r,f,e.bl_count)}function s0(e,t,r){var n,s=-1,o,i=t[0*2+1],a=0,f=7,c=4;for(i===0&&(f=138,c=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)o=i,i=t[(n+1)*2+1],!(++a<f&&o===i)&&(a<c?e.bl_tree[o*2]+=a:o!==0?(o!==s&&e.bl_tree[o*2]++,e.bl_tree[f0*2]++):a<=10?e.bl_tree[h0*2]++:e.bl_tree[l0*2]++,a=0,s=o,i===0?(f=138,c=3):o===i?(f=6,c=3):(f=7,c=4))}function o0(e,t,r){var n,s=-1,o,i=t[0*2+1],a=0,f=7,c=4;for(i===0&&(f=138,c=3),n=0;n<=r;n++)if(o=i,i=t[(n+1)*2+1],!(++a<f&&o===i)){if(a<c)do se(e,o,e.bl_tree);while(--a!==0);else o!==0?(o!==s&&(se(e,o,e.bl_tree),a--),se(e,f0,e.bl_tree),Mt(e,a-3,2)):a<=10?(se(e,h0,e.bl_tree),Mt(e,a-3,3)):(se(e,l0,e.bl_tree),Mt(e,a-11,7));a=0,s=o,i===0?(f=138,c=3):o===i?(f=6,c=3):(f=7,c=4)}}function aE(e){var t;for(s0(e,e.dyn_ltree,e.l_desc.max_code),s0(e,e.dyn_dtree,e.d_desc.max_code),uc(e,e.bl_desc),t=Ac-1;t>=3&&e.bl_tree[u0[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function cE(e,t,r,n){var s;for(Mt(e,t-257,5),Mt(e,r-1,5),Mt(e,n-4,4),s=0;s<n;s++)Mt(e,e.bl_tree[u0[s]*2+1],3);o0(e,e.dyn_ltree,t-1),o0(e,e.dyn_dtree,r-1)}function fE(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return t0;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return e0;for(r=32;r<ts;r++)if(e.dyn_ltree[r*2]!==0)return e0;return t0}var i0=!1;function hE(e){i0||(oE(),i0=!0),e.l_desc=new fc(e.dyn_ltree,d0),e.d_desc=new fc(e.dyn_dtree,A0),e.bl_desc=new fc(e.bl_tree,m0),e.bi_buf=0,e.bi_valid=0,B0(e)}function _0(e,t,r,n){Mt(e,(Z2<<1)+(n?1:0),3),iE(e,t,r,!0)}function lE(e){Mt(e,a0<<1,3),se(e,mc,Be),nE(e)}function uE(e,t,r,n){var s,o,i=0;e.level>0?(e.strm.data_type===Y2&&(e.strm.data_type=fE(e)),uc(e,e.l_desc),uc(e,e.d_desc),i=aE(e),s=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=s&&(s=o)):s=o=r+5,r+4<=s&&t!==-1?_0(e,t,r,n):e.strategy===X2||o===s?(Mt(e,(a0<<1)+(n?1:0),3),n0(e,Be,Yn)):(Mt(e,(q2<<1)+(n?1:0),3),cE(e,e.l_desc.max_code+1,e.d_desc.max_code+1,i+1),n0(e,e.dyn_ltree,e.dyn_dtree)),B0(e),n&&E0(e)}function dE(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(Wn[r]+ts+1)*2]++,e.dyn_dtree[p0(t)*2]++),e.last_lit===e.lit_bufsize-1}on._tr_init=hE;on._tr_stored_block=_0;on._tr_flush_block=uE;on._tr_tally=dE;on._tr_align=lE});var gc=ct((AL,T0)=>{"use strict";function AE(e,t,r,n){for(var s=e&65535|0,o=e>>>16&65535|0,i=0;r!==0;){i=r>2e3?2e3:r,r-=i;do s=s+t[n++]|0,o=o+s|0;while(--i);s%=65521,o%=65521}return s|o<<16|0}T0.exports=AE});var xc=ct((mL,C0)=>{"use strict";function mE(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var pE=mE();function gE(e,t,r,n){var s=pE,o=n+r;e^=-1;for(var i=n;i<o;i++)e=e>>>8^s[(e^t[i])&255];return e^-1}C0.exports=gE});var Io=ct((pL,M0)=>{"use strict";M0.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 O0=ct(ae=>{"use strict";var xt=xe(),Nt=y0(),S0=gc(),Le=xc(),xE=Io(),fr=0,BE=1,EE=3,Ue=4,b0=5,ie=0,w0=1,Gt=-2,_E=-3,Bc=-5,yE=-1,TE=1,So=2,CE=3,ME=4,bE=0,wE=2,Lo=8,IE=9,SE=15,RE=8,FE=29,DE=256,_c=DE+1+FE,LE=30,OE=19,vE=2*_c+1,NE=15,k=3,Ne=258,jt=Ne+k+1,GE=32,Oo=42,yc=69,Ro=73,Fo=91,Do=103,ir=113,rs=666,it=1,ns=2,ar=3,fn=4,UE=3;function Ge(e,t){return e.msg=xE[t],t}function I0(e){return(e<<1)-(e>4?9:0)}function ve(e){for(var t=e.length;--t>=0;)e[t]=0}function Oe(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(xt.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function lt(e,t){Nt._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Oe(e.strm)}function V(e,t){e.pending_buf[e.pending++]=t}function es(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function PE(e,t,r,n){var s=e.avail_in;return s>n&&(s=n),s===0?0:(e.avail_in-=s,xt.arraySet(t,e.input,e.next_in,s,r),e.state.wrap===1?e.adler=S0(e.adler,t,s,r):e.state.wrap===2&&(e.adler=Le(e.adler,t,s,r)),e.next_in+=s,e.total_in+=s,s)}function R0(e,t){var r=e.max_chain_length,n=e.strstart,s,o,i=e.prev_length,a=e.nice_match,f=e.strstart>e.w_size-jt?e.strstart-(e.w_size-jt):0,c=e.window,h=e.w_mask,l=e.prev,u=e.strstart+Ne,d=c[n+i-1],A=c[n+i];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do if(s=t,!(c[s+i]!==A||c[s+i-1]!==d||c[s]!==c[n]||c[++s]!==c[n+1])){n+=2,s++;do;while(c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&n<u);if(o=Ne-(u-n),n=u-Ne,o>i){if(e.match_start=t,i=o,o>=a)break;d=c[n+i-1],A=c[n+i]}}while((t=l[t&h])>f&&--r!==0);return i<=e.lookahead?i:e.lookahead}function cr(e){var t=e.w_size,r,n,s,o,i;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-jt)){xt.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do s=e.head[--r],e.head[r]=s>=t?s-t:0;while(--n);n=t,r=n;do s=e.prev[--r],e.prev[r]=s>=t?s-t:0;while(--n);o+=t}if(e.strm.avail_in===0)break;if(n=PE(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=n,e.lookahead+e.insert>=k)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=(e.ins_h<<e.hash_shift^e.window[i+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[i+k-1])&e.hash_mask,e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<k)););}while(e.lookahead<jt&&e.strm.avail_in!==0)}function HE(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(cr(e),e.lookahead===0&&t===fr)return it;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,lt(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-jt&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=0,t===Ue?(lt(e,!0),e.strm.avail_out===0?ar:fn):(e.strstart>e.block_start&&(lt(e,!1),e.strm.avail_out===0),it)}function Ec(e,t){for(var r,n;;){if(e.lookahead<jt){if(cr(e),e.lookahead<jt&&t===fr)return it;if(e.lookahead===0)break}if(r=0,e.lookahead>=k&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-jt&&(e.match_length=R0(e,r)),e.match_length>=k)if(n=Nt._tr_tally(e,e.strstart-e.match_start,e.match_length-k),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=k){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=Nt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=e.strstart<k-1?e.strstart:k-1,t===Ue?(lt(e,!0),e.strm.avail_out===0?ar:fn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:ns}function an(e,t){for(var r,n,s;;){if(e.lookahead<jt){if(cr(e),e.lookahead<jt&&t===fr)return it;if(e.lookahead===0)break}if(r=0,e.lookahead>=k&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=k-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-jt&&(e.match_length=R0(e,r),e.match_length<=5&&(e.strategy===TE||e.match_length===k&&e.strstart-e.match_start>4096)&&(e.match_length=k-1)),e.prev_length>=k&&e.match_length<=e.prev_length){s=e.strstart+e.lookahead-k,n=Nt._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-k),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=s&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=k-1,e.strstart++,n&&(lt(e,!1),e.strm.avail_out===0))return it}else if(e.match_available){if(n=Nt._tr_tally(e,0,e.window[e.strstart-1]),n&&lt(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return it}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Nt._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<k-1?e.strstart:k-1,t===Ue?(lt(e,!0),e.strm.avail_out===0?ar:fn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:ns}function kE(e,t){for(var r,n,s,o,i=e.window;;){if(e.lookahead<=Ne){if(cr(e),e.lookahead<=Ne&&t===fr)return it;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=k&&e.strstart>0&&(s=e.strstart-1,n=i[s],n===i[++s]&&n===i[++s]&&n===i[++s])){o=e.strstart+Ne;do;while(n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&s<o);e.match_length=Ne-(o-s),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=k?(r=Nt._tr_tally(e,1,e.match_length-k),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Nt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=0,t===Ue?(lt(e,!0),e.strm.avail_out===0?ar:fn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:ns}function JE(e,t){for(var r;;){if(e.lookahead===0&&(cr(e),e.lookahead===0)){if(t===fr)return it;break}if(e.match_length=0,r=Nt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=0,t===Ue?(lt(e,!0),e.strm.avail_out===0?ar:fn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:ns}function oe(e,t,r,n,s){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=s}var cn;cn=[new oe(0,0,0,0,HE),new oe(4,4,8,4,Ec),new oe(4,5,16,8,Ec),new oe(4,6,32,32,Ec),new oe(4,4,16,16,an),new oe(8,16,32,32,an),new oe(8,16,128,128,an),new oe(8,32,128,256,an),new oe(32,128,258,1024,an),new oe(32,258,258,4096,an)];function zE(e){e.window_size=2*e.w_size,ve(e.head),e.max_lazy_match=cn[e.level].max_lazy,e.good_match=cn[e.level].good_length,e.nice_match=cn[e.level].nice_length,e.max_chain_length=cn[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=k-1,e.match_available=0,e.ins_h=0}function QE(){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=Lo,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 xt.Buf16(vE*2),this.dyn_dtree=new xt.Buf16((2*LE+1)*2),this.bl_tree=new xt.Buf16((2*OE+1)*2),ve(this.dyn_ltree),ve(this.dyn_dtree),ve(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new xt.Buf16(NE+1),this.heap=new xt.Buf16(2*_c+1),ve(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new xt.Buf16(2*_c+1),ve(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 F0(e){var t;return!e||!e.state?Ge(e,Gt):(e.total_in=e.total_out=0,e.data_type=wE,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Oo:ir,e.adler=t.wrap===2?0:1,t.last_flush=fr,Nt._tr_init(t),ie)}function D0(e){var t=F0(e);return t===ie&&zE(e.state),t}function VE(e,t){return!e||!e.state||e.state.wrap!==2?Gt:(e.state.gzhead=t,ie)}function L0(e,t,r,n,s,o){if(!e)return Gt;var i=1;if(t===yE&&(t=6),n<0?(i=0,n=-n):n>15&&(i=2,n-=16),s<1||s>IE||r!==Lo||n<8||n>15||t<0||t>9||o<0||o>ME)return Ge(e,Gt);n===8&&(n=9);var a=new QE;return e.state=a,a.strm=e,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=s+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+k-1)/k),a.window=new xt.Buf8(a.w_size*2),a.head=new xt.Buf16(a.hash_size),a.prev=new xt.Buf16(a.w_size),a.lit_bufsize=1<<s+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new xt.Buf8(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=(1+2)*a.lit_bufsize,a.level=t,a.strategy=o,a.method=r,D0(e)}function jE(e,t){return L0(e,t,Lo,SE,RE,bE)}function KE(e,t){var r,n,s,o;if(!e||!e.state||t>b0||t<0)return e?Ge(e,Gt):Gt;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===rs&&t!==Ue)return Ge(e,e.avail_out===0?Bc:Gt);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===Oo)if(n.wrap===2)e.adler=0,V(n,31),V(n,139),V(n,8),n.gzhead?(V(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)),V(n,n.gzhead.time&255),V(n,n.gzhead.time>>8&255),V(n,n.gzhead.time>>16&255),V(n,n.gzhead.time>>24&255),V(n,n.level===9?2:n.strategy>=So||n.level<2?4:0),V(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(V(n,n.gzhead.extra.length&255),V(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Le(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=yc):(V(n,0),V(n,0),V(n,0),V(n,0),V(n,0),V(n,n.level===9?2:n.strategy>=So||n.level<2?4:0),V(n,UE),n.status=ir);else{var i=Lo+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=So||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=GE),i+=31-i%31,n.status=ir,es(n,i),n.strstart!==0&&(es(n,e.adler>>>16),es(n,e.adler&65535)),e.adler=1}if(n.status===yc)if(n.gzhead.extra){for(s=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),Oe(e),s=n.pending,n.pending===n.pending_buf_size));)V(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Ro)}else n.status=Ro;if(n.status===Ro)if(n.gzhead.name){s=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),Oe(e),s=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,V(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),o===0&&(n.gzindex=0,n.status=Fo)}else n.status=Fo;if(n.status===Fo)if(n.gzhead.comment){s=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),Oe(e),s=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,V(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),o===0&&(n.status=Do)}else n.status=Do;if(n.status===Do&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Oe(e),n.pending+2<=n.pending_buf_size&&(V(n,e.adler&255),V(n,e.adler>>8&255),e.adler=0,n.status=ir)):n.status=ir),n.pending!==0){if(Oe(e),e.avail_out===0)return n.last_flush=-1,ie}else if(e.avail_in===0&&I0(t)<=I0(r)&&t!==Ue)return Ge(e,Bc);if(n.status===rs&&e.avail_in!==0)return Ge(e,Bc);if(e.avail_in!==0||n.lookahead!==0||t!==fr&&n.status!==rs){var f=n.strategy===So?JE(n,t):n.strategy===CE?kE(n,t):cn[n.level].func(n,t);if((f===ar||f===fn)&&(n.status=rs),f===it||f===ar)return e.avail_out===0&&(n.last_flush=-1),ie;if(f===ns&&(t===BE?Nt._tr_align(n):t!==b0&&(Nt._tr_stored_block(n,0,0,!1),t===EE&&(ve(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Oe(e),e.avail_out===0))return n.last_flush=-1,ie}return t!==Ue?ie:n.wrap<=0?w0:(n.wrap===2?(V(n,e.adler&255),V(n,e.adler>>8&255),V(n,e.adler>>16&255),V(n,e.adler>>24&255),V(n,e.total_in&255),V(n,e.total_in>>8&255),V(n,e.total_in>>16&255),V(n,e.total_in>>24&255)):(es(n,e.adler>>>16),es(n,e.adler&65535)),Oe(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?ie:w0)}function XE(e){var t;return!e||!e.state?Gt:(t=e.state.status,t!==Oo&&t!==yc&&t!==Ro&&t!==Fo&&t!==Do&&t!==ir&&t!==rs?Ge(e,Gt):(e.state=null,t===ir?Ge(e,_E):ie))}function YE(e,t){var r=t.length,n,s,o,i,a,f,c,h;if(!e||!e.state||(n=e.state,i=n.wrap,i===2||i===1&&n.status!==Oo||n.lookahead))return Gt;for(i===1&&(e.adler=S0(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(i===0&&(ve(n.head),n.strstart=0,n.block_start=0,n.insert=0),h=new xt.Buf8(n.w_size),xt.arraySet(h,t,r-n.w_size,n.w_size,0),t=h,r=n.w_size),a=e.avail_in,f=e.next_in,c=e.input,e.avail_in=r,e.next_in=0,e.input=t,cr(n);n.lookahead>=k;){s=n.strstart,o=n.lookahead-(k-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[s+k-1])&n.hash_mask,n.prev[s&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=s,s++;while(--o);n.strstart=s,n.lookahead=k-1,cr(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=k-1,n.match_available=0,e.next_in=f,e.input=c,e.avail_in=a,n.wrap=i,ie}ae.deflateInit=jE;ae.deflateInit2=L0;ae.deflateReset=D0;ae.deflateResetKeep=F0;ae.deflateSetHeader=VE;ae.deflate=KE;ae.deflateEnd=XE;ae.deflateSetDictionary=YE;ae.deflateInfo="pako deflate (from Nodeca project)"});var Tc=ct(hn=>{"use strict";var vo=xe(),v0=!0,N0=!0;try{String.fromCharCode.apply(null,[0])}catch{v0=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{N0=!1}var ss=new vo.Buf8(256);for(Ee=0;Ee<256;Ee++)ss[Ee]=Ee>=252?6:Ee>=248?5:Ee>=240?4:Ee>=224?3:Ee>=192?2:1;var Ee;ss[254]=ss[254]=1;hn.string2buf=function(e){var t,r,n,s,o,i=e.length,a=0;for(s=0;s<i;s++)r=e.charCodeAt(s),(r&64512)===55296&&s+1<i&&(n=e.charCodeAt(s+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),s++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(t=new vo.Buf8(a),o=0,s=0;o<a;s++)r=e.charCodeAt(s),(r&64512)===55296&&s+1<i&&(n=e.charCodeAt(s+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),s++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|r&63):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|r&63):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|r&63);return t};function G0(e,t){if(t<65534&&(e.subarray&&N0||!e.subarray&&v0))return String.fromCharCode.apply(null,vo.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}hn.buf2binstring=function(e){return G0(e,e.length)};hn.binstring2buf=function(e){for(var t=new vo.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t};hn.buf2string=function(e,t){var r,n,s,o,i=t||e.length,a=new Array(i*2);for(n=0,r=0;r<i;){if(s=e[r++],s<128){a[n++]=s;continue}if(o=ss[s],o>4){a[n++]=65533,r+=o-1;continue}for(s&=o===2?31:o===3?15:7;o>1&&r<i;)s=s<<6|e[r++]&63,o--;if(o>1){a[n++]=65533;continue}s<65536?a[n++]=s:(s-=65536,a[n++]=55296|s>>10&1023,a[n++]=56320|s&1023)}return G0(a,n)};hn.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+ss[e[r]]>t?r:t}});var Cc=ct((BL,U0)=>{"use strict";function ZE(){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}U0.exports=ZE});var J0=ct(as=>{"use strict";var os=O0(),is=xe(),bc=Tc(),wc=Io(),qE=Cc(),k0=Object.prototype.toString,WE=0,Mc=4,ln=0,P0=1,H0=2,$E=-1,t_=0,e_=8;function hr(e){if(!(this instanceof hr))return new hr(e);this.options=is.assign({level:$E,method:e_,chunkSize:16384,windowBits:15,memLevel:8,strategy:t_,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new qE,this.strm.avail_out=0;var r=os.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==ln)throw new Error(wc[r]);if(t.header&&os.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=bc.string2buf(t.dictionary):k0.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=os.deflateSetDictionary(this.strm,n),r!==ln)throw new Error(wc[r]);this._dict_set=!0}}hr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,s,o;if(this.ended)return!1;o=t===~~t?t:t===!0?Mc:WE,typeof e=="string"?r.input=bc.string2buf(e):k0.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new is.Buf8(n),r.next_out=0,r.avail_out=n),s=os.deflate(r,o),s!==P0&&s!==ln)return this.onEnd(s),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(o===Mc||o===H0))&&(this.options.to==="string"?this.onData(bc.buf2binstring(is.shrinkBuf(r.output,r.next_out))):this.onData(is.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&s!==P0);return o===Mc?(s=os.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===ln):(o===H0&&(this.onEnd(ln),r.avail_out=0),!0)};hr.prototype.onData=function(e){this.chunks.push(e)};hr.prototype.onEnd=function(e){e===ln&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=is.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ic(e,t){var r=new hr(t);if(r.push(e,!0),r.err)throw r.msg||wc[r.err];return r.result}function r_(e,t){return t=t||{},t.raw=!0,Ic(e,t)}function n_(e,t){return t=t||{},t.gzip=!0,Ic(e,t)}as.Deflate=hr;as.deflate=Ic;as.deflateRaw=r_;as.gzip=n_});var Q0=ct((_L,z0)=>{"use strict";var No=30,s_=12;z0.exports=function(t,r){var n,s,o,i,a,f,c,h,l,u,d,A,m,p,E,y,C,M,T,I,w,L,x,g,B;n=t.state,s=t.next_in,g=t.input,o=s+(t.avail_in-5),i=t.next_out,B=t.output,a=i-(r-t.avail_out),f=i+(t.avail_out-257),c=n.dmax,h=n.wsize,l=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,C=(1<<n.distbits)-1;t:do{m<15&&(A+=g[s++]<<m,m+=8,A+=g[s++]<<m,m+=8),M=p[A&y];e:for(;;){if(T=M>>>24,A>>>=T,m-=T,T=M>>>16&255,T===0)B[i++]=M&65535;else if(T&16){I=M&65535,T&=15,T&&(m<T&&(A+=g[s++]<<m,m+=8),I+=A&(1<<T)-1,A>>>=T,m-=T),m<15&&(A+=g[s++]<<m,m+=8,A+=g[s++]<<m,m+=8),M=E[A&C];r:for(;;){if(T=M>>>24,A>>>=T,m-=T,T=M>>>16&255,T&16){if(w=M&65535,T&=15,m<T&&(A+=g[s++]<<m,m+=8,m<T&&(A+=g[s++]<<m,m+=8)),w+=A&(1<<T)-1,w>c){t.msg="invalid distance too far back",n.mode=No;break t}if(A>>>=T,m-=T,T=i-a,w>T){if(T=w-T,T>l&&n.sane){t.msg="invalid distance too far back",n.mode=No;break t}if(L=0,x=d,u===0){if(L+=h-T,T<I){I-=T;do B[i++]=d[L++];while(--T);L=i-w,x=B}}else if(u<T){if(L+=h+u-T,T-=u,T<I){I-=T;do B[i++]=d[L++];while(--T);if(L=0,u<I){T=u,I-=T;do B[i++]=d[L++];while(--T);L=i-w,x=B}}}else if(L+=u-T,T<I){I-=T;do B[i++]=d[L++];while(--T);L=i-w,x=B}for(;I>2;)B[i++]=x[L++],B[i++]=x[L++],B[i++]=x[L++],I-=3;I&&(B[i++]=x[L++],I>1&&(B[i++]=x[L++]))}else{L=i-w;do B[i++]=B[L++],B[i++]=B[L++],B[i++]=B[L++],I-=3;while(I>2);I&&(B[i++]=B[L++],I>1&&(B[i++]=B[L++]))}}else if(T&64){t.msg="invalid distance code",n.mode=No;break t}else{M=E[(M&65535)+(A&(1<<T)-1)];continue r}break}}else if(T&64)if(T&32){n.mode=s_;break t}else{t.msg="invalid literal/length code",n.mode=No;break t}else{M=p[(M&65535)+(A&(1<<T)-1)];continue e}break}}while(s<o&&i<f);I=m>>3,s-=I,m-=I<<3,A&=(1<<m)-1,t.next_in=s,t.next_out=i,t.avail_in=s<o?5+(o-s):5-(s-o),t.avail_out=i<f?257+(f-i):257-(i-f),n.hold=A,n.bits=m}});var q0=ct((yL,Z0)=>{"use strict";var V0=xe(),un=15,j0=852,K0=592,X0=0,Sc=1,Y0=2,o_=[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],i_=[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],a_=[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],c_=[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];Z0.exports=function(t,r,n,s,o,i,a,f){var c=f.bits,h=0,l=0,u=0,d=0,A=0,m=0,p=0,E=0,y=0,C=0,M,T,I,w,L,x=null,g=0,B,_=new V0.Buf16(un+1),U=new V0.Buf16(un+1),G=null,P=0,v,at,mt;for(h=0;h<=un;h++)_[h]=0;for(l=0;l<s;l++)_[r[n+l]]++;for(A=c,d=un;d>=1&&_[d]===0;d--);if(A>d&&(A=d),d===0)return o[i++]=1<<24|64<<16|0,o[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,h=1;h<=un;h++)if(E<<=1,E-=_[h],E<0)return-1;if(E>0&&(t===X0||d!==1))return-1;for(U[1]=0,h=1;h<un;h++)U[h+1]=U[h]+_[h];for(l=0;l<s;l++)r[n+l]!==0&&(a[U[r[n+l]]++]=l);if(t===X0?(x=G=a,B=19):t===Sc?(x=o_,g-=257,G=i_,P-=257,B=256):(x=a_,G=c_,B=-1),C=0,l=0,h=u,L=i,m=A,p=0,I=-1,y=1<<A,w=y-1,t===Sc&&y>j0||t===Y0&&y>K0)return 1;for(;;){v=h-p,a[l]<B?(at=0,mt=a[l]):a[l]>B?(at=G[P+a[l]],mt=x[g+a[l]]):(at=32+64,mt=0),M=1<<h-p,T=1<<m,u=T;do T-=M,o[L+(C>>p)+T]=v<<24|at<<16|mt|0;while(T!==0);for(M=1<<h-1;C&M;)M>>=1;if(M!==0?(C&=M-1,C+=M):C=0,l++,--_[h]===0){if(h===d)break;h=r[n+a[l]]}if(h>A&&(C&w)!==I){for(p===0&&(p=A),L+=u,m=h-p,E=1<<m;m+p<d&&(E-=_[m+p],!(E<=0));)m++,E<<=1;if(y+=1<<m,t===Sc&&y>j0||t===Y0&&y>K0)return 1;I=C&w,o[I]=A<<24|m<<16|L-i|0}}return C!==0&&(o[L+C]=h-p<<24|64<<16|0),f.bits=A,0}});var Dd=ct(Kt=>{"use strict";var St=xe(),vc=gc(),ce=xc(),f_=Q0(),cs=q0(),h_=0,Td=1,Cd=2,W0=4,l_=5,Go=6,lr=0,u_=1,d_=2,Ut=-2,Md=-3,Nc=-4,A_=-5,$0=8,bd=1,td=2,ed=3,rd=4,nd=5,sd=6,od=7,id=8,ad=9,cd=10,Ho=11,_e=12,Rc=13,fd=14,Fc=15,hd=16,ld=17,ud=18,dd=19,Uo=20,Po=21,Ad=22,md=23,pd=24,gd=25,xd=26,Dc=27,Bd=28,Ed=29,$=30,Gc=31,m_=32,p_=852,g_=592,x_=15,B_=x_;function _d(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function E_(){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 St.Buf16(320),this.work=new St.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function wd(e){var t;return!e||!e.state?Ut:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=bd,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new St.Buf32(p_),t.distcode=t.distdyn=new St.Buf32(g_),t.sane=1,t.back=-1,lr)}function Id(e){var t;return!e||!e.state?Ut:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,wd(e))}function Sd(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Ut:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Id(e))}function Rd(e,t){var r,n;return e?(n=new E_,e.state=n,n.window=null,r=Sd(e,t),r!==lr&&(e.state=null),r):Ut}function __(e){return Rd(e,B_)}var yd=!0,Lc,Oc;function y_(e){if(yd){var t;for(Lc=new St.Buf32(512),Oc=new St.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(cs(Td,e.lens,0,288,Lc,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;cs(Cd,e.lens,0,32,Oc,0,e.work,{bits:5}),yd=!1}e.lencode=Lc,e.lenbits=9,e.distcode=Oc,e.distbits=5}function Fd(e,t,r,n){var s,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new St.Buf8(o.wsize)),n>=o.wsize?(St.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(s=o.wsize-o.wnext,s>n&&(s=n),St.arraySet(o.window,t,r-n,s,o.wnext),n-=s,n?(St.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=s))),0}function T_(e,t){var r,n,s,o,i,a,f,c,h,l,u,d,A,m,p=0,E,y,C,M,T,I,w,L,x=new St.Buf8(4),g,B,_=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Ut;r=e.state,r.mode===_e&&(r.mode=Rc),i=e.next_out,s=e.output,f=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,c=r.hold,h=r.bits,l=a,u=f,L=lr;t:for(;;)switch(r.mode){case bd:if(r.wrap===0){r.mode=Rc;break}for(;h<16;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(r.wrap&2&&c===35615){r.check=0,x[0]=c&255,x[1]=c>>>8&255,r.check=ce(r.check,x,2,0),c=0,h=0,r.mode=td;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=$;break}if((c&15)!==$0){e.msg="unknown compression method",r.mode=$;break}if(c>>>=4,h-=4,w=(c&15)+8,r.wbits===0)r.wbits=w;else if(w>r.wbits){e.msg="invalid window size",r.mode=$;break}r.dmax=1<<w,e.adler=r.check=1,r.mode=c&512?cd:_e,c=0,h=0;break;case td:for(;h<16;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(r.flags=c,(r.flags&255)!==$0){e.msg="unknown compression method",r.mode=$;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=$;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,r.check=ce(r.check,x,2,0)),c=0,h=0,r.mode=ed;case ed:for(;h<32;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}r.head&&(r.head.time=c),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,x[2]=c>>>16&255,x[3]=c>>>24&255,r.check=ce(r.check,x,4,0)),c=0,h=0,r.mode=rd;case rd:for(;h<16;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,r.check=ce(r.check,x,2,0)),c=0,h=0,r.mode=nd;case nd:if(r.flags&1024){for(;h<16;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,r.check=ce(r.check,x,2,0)),c=0,h=0}else r.head&&(r.head.extra=null);r.mode=sd;case sd:if(r.flags&1024&&(d=r.length,d>a&&(d=a),d&&(r.head&&(w=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),St.arraySet(r.head.extra,n,o,d,w)),r.flags&512&&(r.check=ce(r.check,n,d,o)),a-=d,o+=d,r.length-=d),r.length))break t;r.length=0,r.mode=od;case od:if(r.flags&2048){if(a===0)break t;d=0;do w=n[o+d++],r.head&&w&&r.length<65536&&(r.head.name+=String.fromCharCode(w));while(w&&d<a);if(r.flags&512&&(r.check=ce(r.check,n,d,o)),a-=d,o+=d,w)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=id;case id:if(r.flags&4096){if(a===0)break t;d=0;do w=n[o+d++],r.head&&w&&r.length<65536&&(r.head.comment+=String.fromCharCode(w));while(w&&d<a);if(r.flags&512&&(r.check=ce(r.check,n,d,o)),a-=d,o+=d,w)break t}else r.head&&(r.head.comment=null);r.mode=ad;case ad:if(r.flags&512){for(;h<16;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(c!==(r.check&65535)){e.msg="header crc mismatch",r.mode=$;break}c=0,h=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=_e;break;case cd:for(;h<32;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}e.adler=r.check=_d(c),c=0,h=0,r.mode=Ho;case Ho:if(r.havedict===0)return e.next_out=i,e.avail_out=f,e.next_in=o,e.avail_in=a,r.hold=c,r.bits=h,d_;e.adler=r.check=1,r.mode=_e;case _e:if(t===l_||t===Go)break t;case Rc:if(r.last){c>>>=h&7,h-=h&7,r.mode=Dc;break}for(;h<3;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}switch(r.last=c&1,c>>>=1,h-=1,c&3){case 0:r.mode=fd;break;case 1:if(y_(r),r.mode=Uo,t===Go){c>>>=2,h-=2;break t}break;case 2:r.mode=ld;break;case 3:e.msg="invalid block type",r.mode=$}c>>>=2,h-=2;break;case fd:for(c>>>=h&7,h-=h&7;h<32;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=$;break}if(r.length=c&65535,c=0,h=0,r.mode=Fc,t===Go)break t;case Fc:r.mode=hd;case hd:if(d=r.length,d){if(d>a&&(d=a),d>f&&(d=f),d===0)break t;St.arraySet(s,n,o,d,i),a-=d,o+=d,f-=d,i+=d,r.length-=d;break}r.mode=_e;break;case ld:for(;h<14;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(r.nlen=(c&31)+257,c>>>=5,h-=5,r.ndist=(c&31)+1,c>>>=5,h-=5,r.ncode=(c&15)+4,c>>>=4,h-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=$;break}r.have=0,r.mode=ud;case ud:for(;r.have<r.ncode;){for(;h<3;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}r.lens[_[r.have++]]=c&7,c>>>=3,h-=3}for(;r.have<19;)r.lens[_[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,g={bits:r.lenbits},L=cs(h_,r.lens,0,19,r.lencode,0,r.work,g),r.lenbits=g.bits,L){e.msg="invalid code lengths set",r.mode=$;break}r.have=0,r.mode=dd;case dd:for(;r.have<r.nlen+r.ndist;){for(;p=r.lencode[c&(1<<r.lenbits)-1],E=p>>>24,y=p>>>16&255,C=p&65535,!(E<=h);){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(C<16)c>>>=E,h-=E,r.lens[r.have++]=C;else{if(C===16){for(B=E+2;h<B;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(c>>>=E,h-=E,r.have===0){e.msg="invalid bit length repeat",r.mode=$;break}w=r.lens[r.have-1],d=3+(c&3),c>>>=2,h-=2}else if(C===17){for(B=E+3;h<B;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}c>>>=E,h-=E,w=0,d=3+(c&7),c>>>=3,h-=3}else{for(B=E+7;h<B;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}c>>>=E,h-=E,w=0,d=11+(c&127),c>>>=7,h-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=$;break}for(;d--;)r.lens[r.have++]=w}}if(r.mode===$)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=$;break}if(r.lenbits=9,g={bits:r.lenbits},L=cs(Td,r.lens,0,r.nlen,r.lencode,0,r.work,g),r.lenbits=g.bits,L){e.msg="invalid literal/lengths set",r.mode=$;break}if(r.distbits=6,r.distcode=r.distdyn,g={bits:r.distbits},L=cs(Cd,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,g),r.distbits=g.bits,L){e.msg="invalid distances set",r.mode=$;break}if(r.mode=Uo,t===Go)break t;case Uo:r.mode=Po;case Po:if(a>=6&&f>=258){e.next_out=i,e.avail_out=f,e.next_in=o,e.avail_in=a,r.hold=c,r.bits=h,f_(e,u),i=e.next_out,s=e.output,f=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,c=r.hold,h=r.bits,r.mode===_e&&(r.back=-1);break}for(r.back=0;p=r.lencode[c&(1<<r.lenbits)-1],E=p>>>24,y=p>>>16&255,C=p&65535,!(E<=h);){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(y&&!(y&240)){for(M=E,T=y,I=C;p=r.lencode[I+((c&(1<<M+T)-1)>>M)],E=p>>>24,y=p>>>16&255,C=p&65535,!(M+E<=h);){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}c>>>=M,h-=M,r.back+=M}if(c>>>=E,h-=E,r.back+=E,r.length=C,y===0){r.mode=xd;break}if(y&32){r.back=-1,r.mode=_e;break}if(y&64){e.msg="invalid literal/length code",r.mode=$;break}r.extra=y&15,r.mode=Ad;case Ad:if(r.extra){for(B=r.extra;h<B;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=md;case md:for(;p=r.distcode[c&(1<<r.distbits)-1],E=p>>>24,y=p>>>16&255,C=p&65535,!(E<=h);){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(!(y&240)){for(M=E,T=y,I=C;p=r.distcode[I+((c&(1<<M+T)-1)>>M)],E=p>>>24,y=p>>>16&255,C=p&65535,!(M+E<=h);){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}c>>>=M,h-=M,r.back+=M}if(c>>>=E,h-=E,r.back+=E,y&64){e.msg="invalid distance code",r.mode=$;break}r.offset=C,r.extra=y&15,r.mode=pd;case pd:if(r.extra){for(B=r.extra;h<B;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,h-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=$;break}r.mode=gd;case gd:if(f===0)break t;if(d=u-f,r.offset>d){if(d=r.offset-d,d>r.whave&&r.sane){e.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=s,A=i-r.offset,d=r.length;d>f&&(d=f),f-=d,r.length-=d;do s[i++]=m[A++];while(--d);r.length===0&&(r.mode=Po);break;case xd:if(f===0)break t;s[i++]=r.length,f--,r.mode=Po;break;case Dc:if(r.wrap){for(;h<32;){if(a===0)break t;a--,c|=n[o++]<<h,h+=8}if(u-=f,e.total_out+=u,r.total+=u,u&&(e.adler=r.check=r.flags?ce(r.check,s,u,i-u):vc(r.check,s,u,i-u)),u=f,(r.flags?c:_d(c))!==r.check){e.msg="incorrect data check",r.mode=$;break}c=0,h=0}r.mode=Bd;case Bd:if(r.wrap&&r.flags){for(;h<32;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(c!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=$;break}c=0,h=0}r.mode=Ed;case Ed:L=u_;break t;case $:L=Md;break t;case Gc:return Nc;case m_:default:return Ut}return e.next_out=i,e.avail_out=f,e.next_in=o,e.avail_in=a,r.hold=c,r.bits=h,(r.wsize||u!==e.avail_out&&r.mode<$&&(r.mode<Dc||t!==W0))&&Fd(e,e.output,e.next_out,u-e.avail_out)?(r.mode=Gc,Nc):(l-=e.avail_in,u-=e.avail_out,e.total_in+=l,e.total_out+=u,r.total+=u,r.wrap&&u&&(e.adler=r.check=r.flags?ce(r.check,s,u,e.next_out-u):vc(r.check,s,u,e.next_out-u)),e.data_type=r.bits+(r.last?64:0)+(r.mode===_e?128:0)+(r.mode===Uo||r.mode===Fc?256:0),(l===0&&u===0||t===W0)&&L===lr&&(L=A_),L)}function C_(e){if(!e||!e.state)return Ut;var t=e.state;return t.window&&(t.window=null),e.state=null,lr}function M_(e,t){var r;return!e||!e.state||(r=e.state,!(r.wrap&2))?Ut:(r.head=t,t.done=!1,lr)}function b_(e,t){var r=t.length,n,s,o;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==Ho)?Ut:n.mode===Ho&&(s=1,s=vc(s,t,r,0),s!==n.check)?Md:(o=Fd(e,t,r,r),o?(n.mode=Gc,Nc):(n.havedict=1,lr))}Kt.inflateReset=Id;Kt.inflateReset2=Sd;Kt.inflateResetKeep=wd;Kt.inflateInit=__;Kt.inflateInit2=Rd;Kt.inflate=T_;Kt.inflateEnd=C_;Kt.inflateGetHeader=M_;Kt.inflateSetDictionary=b_;Kt.inflateInfo="pako inflate (from Nodeca project)"});var Uc=ct((CL,Ld)=>{"use strict";Ld.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 vd=ct((ML,Od)=>{"use strict";function w_(){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}Od.exports=w_});var Gd=ct(hs=>{"use strict";var dn=Dd(),fs=xe(),ko=Tc(),st=Uc(),Pc=Io(),I_=Cc(),S_=vd(),Nd=Object.prototype.toString;function ur(e){if(!(this instanceof ur))return new ur(e);this.options=fs.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new I_,this.strm.avail_out=0;var r=dn.inflateInit2(this.strm,t.windowBits);if(r!==st.Z_OK)throw new Error(Pc[r]);if(this.header=new S_,dn.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=ko.string2buf(t.dictionary):Nd.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=dn.inflateSetDictionary(this.strm,t.dictionary),r!==st.Z_OK)))throw new Error(Pc[r])}ur.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,s=this.options.dictionary,o,i,a,f,c,h=!1;if(this.ended)return!1;i=t===~~t?t:t===!0?st.Z_FINISH:st.Z_NO_FLUSH,typeof e=="string"?r.input=ko.binstring2buf(e):Nd.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new fs.Buf8(n),r.next_out=0,r.avail_out=n),o=dn.inflate(r,st.Z_NO_FLUSH),o===st.Z_NEED_DICT&&s&&(o=dn.inflateSetDictionary(this.strm,s)),o===st.Z_BUF_ERROR&&h===!0&&(o=st.Z_OK,h=!1),o!==st.Z_STREAM_END&&o!==st.Z_OK)return this.onEnd(o),this.ended=!0,!1;r.next_out&&(r.avail_out===0||o===st.Z_STREAM_END||r.avail_in===0&&(i===st.Z_FINISH||i===st.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=ko.utf8border(r.output,r.next_out),f=r.next_out-a,c=ko.buf2string(r.output,a),r.next_out=f,r.avail_out=n-f,f&&fs.arraySet(r.output,r.output,a,f,0),this.onData(c)):this.onData(fs.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(h=!0)}while((r.avail_in>0||r.avail_out===0)&&o!==st.Z_STREAM_END);return o===st.Z_STREAM_END&&(i=st.Z_FINISH),i===st.Z_FINISH?(o=dn.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===st.Z_OK):(i===st.Z_SYNC_FLUSH&&(this.onEnd(st.Z_OK),r.avail_out=0),!0)};ur.prototype.onData=function(e){this.chunks.push(e)};ur.prototype.onEnd=function(e){e===st.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=fs.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Hc(e,t){var r=new ur(t);if(r.push(e,!0),r.err)throw r.msg||Pc[r.err];return r.result}function R_(e,t){return t=t||{},t.raw=!0,Hc(e,t)}hs.Inflate=ur;hs.inflate=Hc;hs.inflateRaw=R_;hs.ungzip=Hc});var Hd=ct((wL,Pd)=>{"use strict";var F_=xe().assign,D_=J0(),L_=Gd(),O_=Uc(),Ud={};F_(Ud,D_,L_,O_);Pd.exports=Ud});var kd=ct(()=>{});var ls={};ut(ls,{CesiumIonLoader:()=>ec,TILE3D_TYPE:()=>_t,Tile3DBatchTable:()=>ue,Tile3DFeatureTable:()=>kt,Tile3DSubtreeLoader:()=>Kr,Tile3DWriter:()=>Yd,Tiles3DArchive:()=>An,Tiles3DArchiveFileLoader:()=>zd,Tiles3DLoader:()=>rr,_getIonTilesetMetadata:()=>To});gs(ls,gr(pn(),1));async function Pt(e,t,r,n){return n._parse(e,t,r,n)}function J(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var Yt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},n1=Yt.self||Yt.window||Yt.global||{},s1=Yt.window||Yt.self||Yt.global||{},o1=Yt.global||Yt.self||Yt.window||{},i1=Yt.document||{};var Et=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var Zc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),a1=Zc&&parseFloat(Zc[1])||0;function gn(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function Qo(e){return globalThis.loaders?.modules?.[e]||null}function c1(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.2"),globalThis._loadersgl_.version}var qc=c1();function Wc(e,t){if(!e)throw new Error(t||"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},Z_=Zt.self||Zt.window||Zt.global||{},q_=Zt.window||Zt.self||Zt.global||{},W_=Zt.global||Zt.self||Zt.window||{},$_=Zt.document||{};var xr=typeof process!="object"||String(process)!=="[object process]"||process.browser,xs=typeof importScripts=="function",ty=typeof window<"u"&&typeof window.orientation<"u",$c=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),ey=$c&&parseFloat($c[1])||0;var Vo={};async function qt(e,t=null,r={},n=null){return t&&(e=tf(e,t,r,n)),Vo[e]=Vo[e]||f1(e),await Vo[e]}function tf(e,t,r={},n=null){if(!r.useLocalLibraries&&e.startsWith("http"))return e;n=n||e;let s=r.modules||{};return s[n]?s[n]:xr?r.CDN?(Wc(r.CDN.startsWith("http")),`${r.CDN}/${t}@${qc}/dist/libs/${n}`):xs?`../src/libs/${n}`:`modules/${t}/src/libs/${n}`:`modules/${t}/dist/libs/${n}`}async function f1(e){if(e.endsWith("wasm"))return await l1(e);if(!xr)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(e)}catch(r){return console.error(r),null}if(xs)return importScripts(e);let t=await u1(e);return h1(t,e)}function h1(e,t){if(!xr){let{requireFromString:n}=globalThis.loaders||{};return n?.(e,t)}if(xs)return eval.call(globalThis,e),null;let r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}async function l1(e){let{readFileAsArrayBuffer:t}=globalThis.loaders||{};return xr||!t||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await t(e)}async function u1(e){let{readFileAsText:t}=globalThis.loaders||{};return xr||!t||e.startsWith("http")?await(await fetch(e)).text():await t(e)}function rf(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?ef(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?ef(e,0,t):""}function ef(e,t,r){if(e.byteLength<=t+r)return"";let n=new DataView(e),s="";for(let o=0;o<r;o++)s+=String.fromCharCode(n.getUint8(t+o));return s}function jo(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${rf(e)}"`)}}function Te(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let n=new Uint8Array(e),s=new Uint8Array(t);for(let o=0;o<n.length;++o)if(n[o]!==s[o])return!1;return!0}function Br(...e){return nf(e)}function nf(e){let t=e.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),r=t.reduce((o,i)=>o+i.byteLength,0),n=new Uint8Array(r),s=0;for(let o of t)n.set(o,s),s+=o.byteLength;return n.buffer}function Je(e,t,r){let n=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function bt(e,t){return J(e>=0),J(t>0),e+(t-1)&~(t-1)}function Ko(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let s=e.byteOffset,o=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,s,o)}return t.set(n,r),r+bt(n.byteLength,4)}function Xo(e,t){let r=e.length,s=Math.ceil(r/t)*t-r,o="";for(let i=0;i<s;++i)o+=" ";return e+o}function Er(e,t,r,n){if(e)for(let s=0;s<n;s++)e.setUint8(t+s,r.charCodeAt(s));return t+n}function xn(e,t,r,n){if(e)for(let s=0;s<n;s++)e.setUint8(t+s,r[s]);return t+n}function sf(e,t,r,n){let s=bt(r.byteLength,n),o=s-r.byteLength;if(e){let i=new Uint8Array(e.buffer,e.byteOffset+t,r.byteLength),a=new Uint8Array(r);i.set(a);for(let f=0;f<o;++f)e.setUint8(t+r.byteLength+f,32)}return t+=s,t}function Bs(e,t,r,n){let o=new TextEncoder().encode(r);return t=sf(e,t,o,n),t}async function Bn(e){let t=[];for await(let r of e)t.push(r);return Br(...t)}function of(e){return e&&typeof e=="object"&&e.isBuffer}function _r(e){if(of(e))return e;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function yr(e){return t=>new Promise((r,n)=>e(t,(s,o)=>s?n(s):r(o)))}var Tr={};ut(Tr,{dirname:()=>A1,filename:()=>d1,join:()=>m1,resolve:()=>p1});function af(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf("/")+1)||""}function d1(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function A1(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function m1(...e){let t="/";return e=e.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${t}`),"")),n!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function p1(...e){let t=[];for(let o=0;o<e.length;o++)t[o]=e[o];let r="",n=!1,s;for(let o=t.length-1;o>=-1&&!n;o--){let i;o>=0?i=t[o]:(s===void 0&&(s=af()),i=s),i.length!==0&&(r=`${i}/${r}`,n=i.charCodeAt(0)===En)}return r=g1(r,!n),n?`/${r}`:r.length>0?r:"."}var En=47,Yo=46;function g1(e,t){let r="",n=-1,s=0,o,i=!1;for(let a=0;a<=e.length;++a){if(a<e.length)o=e.charCodeAt(a);else{if(o===En)break;o=En}if(o===En){if(!(n===a-1||s===1))if(n!==a-1&&s===2){if(r.length<2||!i||r.charCodeAt(r.length-1)!==Yo||r.charCodeAt(r.length-2)!==Yo){if(r.length>2){let f=r.length-1,c=f;for(;c>=0&&r.charCodeAt(c)!==En;--c);if(c!==f){r=c===-1?"":r.slice(0,c),n=a,s=0,i=!1;continue}}else if(r.length===2||r.length===1){r="",n=a,s=0,i=!1;continue}}t&&(r.length>0?r+="/..":r="..",i=!0)}else{let f=e.slice(n+1,a);r.length>0?r+=`/${f}`:r=f,i=!1}n=a,s=0}else o===Yo&&s!==-1?++s:s=-1}return r}var _n=new Error("Not implemented"),Es=class{handle;size=0;bigsize=0n;url="";constructor(t,r,n){if(globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(t,r,n);throw Et?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(t,r){throw _n}async write(t,r,n){throw _n}async stat(){throw _n}async truncate(t){throw _n}async append(t){throw _n}async close(){}};var Zo=e=>e?.getUint8&&e?.slice&&e?.length;var yn=class{file;constructor(t,r=!1){this.file=new Es(t,r?"a+":"r")}async truncate(t){await this.file.truncate(t)}async append(t){await this.file.append(t)}async destroy(){await this.file.close()}async getUint8(t){let r=await this.file.read(t,1),n=new Uint8Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint16(t){let r=await this.file.read(t,2),n=new Uint16Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint32(t){let r=await this.file.read(t,4),n=new Uint32Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getBigUint64(t){let r=await this.file.read(t,8),n=new BigInt64Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async slice(t,r){let n=r-t;if(n>Number.MAX_SAFE_INTEGER)throw new Error("too big slice");let s=Number(n);return await this.file.read(t,s)}get length(){return this.file.bigsize}};var Cr=e=>{if(e>Number.MAX_SAFE_INTEGER)throw new Error("Offset is out of bounds");return Number(e)},Tn=class{file;constructor(t){this.file=t}async destroy(){}async getUint8(t){return this.file.getUint8(Cr(t))}async getUint16(t){return this.file.getUint16(Cr(t),!0)}async getUint32(t){return this.file.getUint32(Cr(t),!0)}async getBigUint64(t){return this.file.getBigUint64(Cr(t),!0)}async slice(t,r){return this.file.buffer.slice(Cr(t),Cr(r))}get length(){return BigInt(this.file.byteLength)}};var eT=1/Math.PI*180,rT=1/180*Math.PI,x1={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...x1}};var et=globalThis.mathgl.config;function qo(e,{precision:t=et.precision}={}){return e=B1(e),"".concat(parseFloat(e.toPrecision(t)))}function Wt(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Wo(e,t,r){return _1(e,n=>Math.max(t,Math.min(r,n)))}function _s(e,t,r){let n=et.EPSILON;r&&(et.EPSILON=r);try{if(e===t)return!0;if(Wt(e)&&Wt(t)){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!_s(e[s],t[s]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=et.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{et.EPSILON=n}}function B1(e){return Math.round(e/et.EPSILON)*et.EPSILON}function E1(e){return e.clone?e.clone():new Array(e.length)}function _1(e,t,r){if(Wt(e)){let n=e;r=r||E1(n);for(let s=0;s<r.length&&s<n.length;++s){let o=typeof e=="number"?e:e[s];r[s]=t(o,s,r)}return r}return t(e)}function y1(e){function t(){var r=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var Mr=class extends y1(Array){clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:Wt(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(et)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+qo(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!_s(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let s=0;s<this.ELEMENTS;++s){let o=t[s],i=typeof r=="number"?r:r[s];this[s]=o+n*(i-o)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(et.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function T1(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function rt(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function cf(e,t,r=""){if(et.debug&&!T1(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function $o(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var br=class extends Mr{get x(){return this[0]}set x(t){this[0]=rt(t)}get y(){return this[1]}set y(t){this[1]=rt(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let s=this[n]-t[n];r+=s*s}return rt(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return rt(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return $o(t>=0&&t<this.ELEMENTS,"index is out of range"),rt(this[t])}setComponent(t,r){return $o(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var wr=typeof Float32Array<"u"?Float32Array:Array;var dT=Math.PI/180;function w1(){let e=new wr(2);return wr!=Float32Array&&(e[0]=0,e[1]=0),e}function hf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e}function lf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s+r[4],e[1]=r[1]*n+r[3]*s+r[5],e}function ys(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[3]*s+r[6],e[1]=r[1]*n+r[4]*s+r[7],e}function uf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[4]*s+r[12],e[1]=r[1]*n+r[5]*s+r[13],e}var AT=function(){let e=w1();return function(t,r,n,s,o,i){let a,f;for(r||(r=2),n||(n=0),s?f=Math.min(s*r+n,t.length):f=t.length,a=n;a<f;a+=r)e[0]=t[a],e[1]=t[a+1],o(e,e,i),t[a]=e[0],t[a+1]=e[1];return t}}();function df(e,t,r){let n=t[0],s=t[1],o=r[3]*n+r[7]*s||1;return e[0]=(r[0]*n+r[4]*s)/o,e[1]=(r[1]*n+r[5]*s)/o,e}function Af(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o||1;return e[0]=(r[0]*n+r[4]*s+r[8]*o)/i,e[1]=(r[1]*n+r[5]*s+r[9]*o)/i,e[2]=(r[2]*n+r[6]*s+r[10]*o)/i,e}function mf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e[2]=t[2],e}function pf(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=r[0]*n+r[3]*s+r[6]*o,e[1]=r[1]*n+r[4]*s+r[7]*o,e[2]=r[2]*n+r[5]*s+r[8]*o,e[3]=t[3],e}var ze=class extends br{constructor(t=0,r=0){super(2),Wt(t)&&arguments.length===1?this.copy(t):(et.debug&&(rt(t),rt(r)),this[0]=t,this[1]=r)}set(t,r){return this[0]=t,this[1]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return et.debug&&(rt(t.x),rt(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return uf(this,this,t),this.check()}transformAsVector(t){return df(this,this,t),this.check()}transformByMatrix3(t){return ys(this,this,t),this.check()}transformByMatrix2x3(t){return lf(this,this,t),this.check()}transformByMatrix2(t){return hf(this,this,t),this.check()}};function I1(){let e=new wr(3);return wr!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function S1(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function gf(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[0],a=r[1],f=r[2];return e[0]=s*f-o*a,e[1]=o*i-n*f,e[2]=n*a-s*i,e}function xf(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o+r[15];return i=i||1,e[0]=(r[0]*n+r[4]*s+r[8]*o+r[12])/i,e[1]=(r[1]*n+r[5]*s+r[9]*o+r[13])/i,e[2]=(r[2]*n+r[6]*s+r[10]*o+r[14])/i,e}function Ts(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=n*r[0]+s*r[3]+o*r[6],e[1]=n*r[1]+s*r[4]+o*r[7],e[2]=n*r[2]+s*r[5]+o*r[8],e}function Bf(e,t,r){let n=r[0],s=r[1],o=r[2],i=r[3],a=t[0],f=t[1],c=t[2],h=s*c-o*f,l=o*a-n*c,u=n*f-s*a,d=s*u-o*l,A=o*h-n*u,m=n*l-s*h,p=i*2;return h*=p,l*=p,u*=p,d*=2,A*=2,m*=2,e[0]=a+h+d,e[1]=f+l+A,e[2]=c+u+m,e}function Ef(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0],o[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),o[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function _f(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),o[1]=s[1],o[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function yf(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),o[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),o[2]=s[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Tf(e,t){let r=e[0],n=e[1],s=e[2],o=t[0],i=t[1],a=t[2],f=Math.sqrt((r*r+n*n+s*s)*(o*o+i*i+a*a)),c=f&&S1(e,t)/f;return Math.acos(Math.min(Math.max(c,-1),1))}var TT=function(){let e=I1();return function(t,r,n,s,o,i){let a,f;for(r||(r=3),n||(n=0),s?f=Math.min(s*r+n,t.length):f=t.length,a=n;a<f;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],o(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}}();var ti=[0,0,0],Cs,fe=class extends br{static get ZERO(){return Cs||(Cs=new fe(0,0,0),Object.freeze(Cs)),Cs}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Wt(t)?this.copy(t):(et.debug&&(rt(t),rt(r),rt(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return et.debug&&(rt(t.x),rt(t.y),rt(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=rt(t)}angle(t){return Tf(this,t)}cross(t){return gf(this,this,t),this.check()}rotateX({radians:t,origin:r=ti}){return Ef(this,this,r,t),this.check()}rotateY({radians:t,origin:r=ti}){return _f(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=ti}){return yf(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return xf(this,this,t),this.check()}transformAsVector(t){return Af(this,this,t),this.check()}transformByMatrix3(t){return Ts(this,this,t),this.check()}transformByMatrix2(t){return mf(this,this,t),this.check()}transformByQuaternion(t){return Bf(this,this,t),this.check()}};var Ms=class extends Mr{toString(){let t="[";if(et.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+r])}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=rt(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)r[s]=this[n+s];return r}setColumn(t,r){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)this[n+s]=r[s];return this}};function Cf(e,t){if(e===t){let r=t[1],n=t[2],s=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=s}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function Mf(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],f=t[6],c=t[7],h=t[8],l=h*i-a*c,u=-h*o+a*f,d=c*o-i*f,A=r*l+n*u+s*d;return A?(A=1/A,e[0]=l*A,e[1]=(-h*n+s*c)*A,e[2]=(a*n-s*i)*A,e[3]=u*A,e[4]=(h*r-s*f)*A,e[5]=(-a*r+s*o)*A,e[6]=d*A,e[7]=(-c*r+n*f)*A,e[8]=(i*r-n*o)*A,e):null}function bf(e){let t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],i=e[5],a=e[6],f=e[7],c=e[8];return t*(c*o-i*f)+r*(-c*s+i*a)+n*(f*s-o*a)}function ei(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=r[0],d=r[1],A=r[2],m=r[3],p=r[4],E=r[5],y=r[6],C=r[7],M=r[8];return e[0]=u*n+d*i+A*c,e[1]=u*s+d*a+A*h,e[2]=u*o+d*f+A*l,e[3]=m*n+p*i+E*c,e[4]=m*s+p*a+E*h,e[5]=m*o+p*f+E*l,e[6]=y*n+C*i+M*c,e[7]=y*s+C*a+M*h,e[8]=y*o+C*f+M*l,e}function wf(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=r[0],d=r[1];return e[0]=n,e[1]=s,e[2]=o,e[3]=i,e[4]=a,e[5]=f,e[6]=u*n+d*i+c,e[7]=u*s+d*a+h,e[8]=u*o+d*f+l,e}function If(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=Math.sin(r),d=Math.cos(r);return e[0]=d*n+u*i,e[1]=d*s+u*a,e[2]=d*o+u*f,e[3]=d*i-u*n,e[4]=d*a-u*s,e[5]=d*f-u*o,e[6]=c,e[7]=h,e[8]=l,e}function ri(e,t,r){let n=r[0],s=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=s*t[3],e[4]=s*t[4],e[5]=s*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Sf(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r+r,a=n+n,f=s+s,c=r*i,h=n*i,l=n*a,u=s*i,d=s*a,A=s*f,m=o*i,p=o*a,E=o*f;return e[0]=1-l-A,e[3]=h-E,e[6]=u+p,e[1]=h+E,e[4]=1-c-A,e[7]=d-m,e[2]=u-p,e[5]=d+m,e[8]=1-c-l,e}var ni;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(ni||(ni={}));var R1=Object.freeze([1,0,0,0,1,0,0,0,1]),he=class extends Ms{static get IDENTITY(){return D1()}static get ZERO(){return F1()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return ni}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(R1)}fromObject(t){return this.check()}fromQuaternion(t){return Sf(this,t),this.check()}set(t,r,n,s,o,i,a,f,c){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this[4]=o,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this.check()}setRowMajor(t,r,n,s,o,i,a,f,c){return this[0]=t,this[1]=s,this[2]=a,this[3]=r,this[4]=o,this[5]=f,this[6]=n,this[7]=i,this[8]=c,this.check()}determinant(){return bf(this)}transpose(){return Cf(this,this),this.check()}invert(){return Mf(this,this),this.check()}multiplyLeft(t){return ei(this,t,this),this.check()}multiplyRight(t){return ei(this,this,t),this.check()}rotate(t){return If(this,this,t),this.check()}scale(t){return Array.isArray(t)?ri(this,this,t):ri(this,this,[t,t]),this.check()}translate(t){return wf(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=ys(r||[-0,-0],t,this);break;case 3:n=Ts(r||[-0,-0,-0],t,this);break;case 4:n=pf(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return cf(n,t.length),n}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},bs,ws=null;function F1(){return bs||(bs=new he([0,0,0,0,0,0,0,0,0]),Object.freeze(bs)),bs}function D1(){return ws||(ws=new he,Object.freeze(ws)),ws}var Ir;(function(e){e[e.ADD=1]="ADD",e[e.REPLACE=2]="REPLACE"})(Ir||(Ir={}));var Ce;(function(e){e.EMPTY="empty",e.SCENEGRAPH="scenegraph",e.POINTCLOUD="pointcloud",e.MESH="mesh"})(Ce||(Ce={}));var Cn;(function(e){e.I3S="I3S",e.TILES3D="TILES3D"})(Cn||(Cn={}));var le;(function(e){e.GEOMETRIC_ERROR="geometricError",e.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(le||(le={}));var Sr="4.2.2";var _t={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},AC=Object.keys(_t),Me={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(e,t,r){J(e instanceof ArrayBuffer);let n=new TextDecoder("utf8"),s=new Uint8Array(e,t,r);return n.decode(s)}function Rf(e,t=0){let r=new DataView(e);return`${String.fromCharCode(r.getUint8(t+0))}${String.fromCharCode(r.getUint8(t+1))}${String.fromCharCode(r.getUint8(t+2))}${String.fromCharCode(r.getUint8(t+3))}`}var Ff="4.2.2";var Df={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:Ff,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 Lf(e){switch(e.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 oi(e){let t=1/0,r=1/0,n=1/0,s=-1/0,o=-1/0,i=-1/0,a=e.POSITION?e.POSITION.value:[],f=a&&a.length;for(let c=0;c<f;c+=3){let h=a[c],l=a[c+1],u=a[c+2];t=h<t?h:t,r=l<r?l:r,n=u<n?u:n,s=h>s?h:s,o=l>o?l:o,i=u>i?u:i}return[[t,r,n],[s,o,i]]}function ii(e,t,r){let n=Lf(t.value),s=r||Of(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:s}}function Of(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),t}function Nf(e,t,r){let n=Gf(t.metadata),s=[],o=L1(t.attributes);for(let i in e){let a=e[i],f=vf(i,a,o[i]);s.push(f)}if(r){let i=vf("indices",r);s.push(i)}return{fields:s,metadata:n}}function L1(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function vf(e,t,r){let n=r?Gf(r.metadata):void 0;return ii(e,t,n)}function Gf(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var Uf={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},O1={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},v1=4,Mn=class{draco;decoder;metadataQuerier;constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(r);let s=this.decoder.GetEncodedGeometryType(n),o=s===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let i;switch(s){case this.draco.TRIANGULAR_MESH:i=this.decoder.DecodeBufferToMesh(n,o);break;case this.draco.POINT_CLOUD:i=this.decoder.DecodeBufferToPointCloud(n,o);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!i.ok()||!o.ptr){let u=`DRACO decompression failed: ${i.error_msg()}`;throw new Error(u)}let a=this._getDracoLoaderData(o,s,r),f=this._getMeshData(o,a,r),c=oi(f.attributes),h=Nf(f.attributes,a,f.indices);return{loader:"draco",loaderData:a,header:{vertexCount:o.num_points(),boundingBox:c},...f,schema:h}}finally{this.draco.destroy(n),o&&this.draco.destroy(o)}}_getDracoLoaderData(t,r,n){let s=this._getTopLevelMetadata(t),o=this._getDracoAttributes(t,n);return{geometry_type:r,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:s,attributes:o}}_getDracoAttributes(t,r){let n={};for(let s=0;s<t.num_attributes();s++){let o=this.decoder.GetAttribute(t,s),i=this._getAttributeMetadata(t,s);n[o.unique_id()]={unique_id:o.unique_id(),attribute_type:o.attribute_type(),data_type:o.data_type(),num_components:o.num_components(),byte_offset:o.byte_offset(),byte_stride:o.byte_stride(),normalized:o.normalized(),attribute_index:s,metadata:i};let a=this._getQuantizationTransform(o,r);a&&(n[o.unique_id()].quantization_transform=a);let f=this._getOctahedronTransform(o,r);f&&(n[o.unique_id()].octahedron_transform=f)}return n}_getMeshData(t,r,n){let s=this._getMeshAttributes(r,t,n);if(!s.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:s,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:s,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:s}}_getMeshAttributes(t,r,n){let s={};for(let o of Object.values(t.attributes)){let i=this._deduceAttributeName(o,n);o.name=i;let a=this._getAttributeValues(r,o);if(a){let{value:f,size:c}=a;s[i]={value:f,size:c,byteOffset:o.byte_offset,byteStride:o.byte_stride,normalized:o.normalized}}}return s}_getTriangleListIndices(t){let n=t.num_faces()*3,s=n*v1,o=this.draco._malloc(s);try{return this.decoder.GetTrianglesUInt32Array(t,s,o),new Uint32Array(this.draco.HEAPF32.buffer,o,n).slice()}finally{this.draco._free(o)}}_getTriangleStripIndices(t){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,r),U1(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=O1[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let s=r.num_components,i=t.num_points()*s,a=i*n.BYTES_PER_ELEMENT,f=N1(this.draco,n),c,h=this.draco._malloc(a);try{let l=this.decoder.GetAttribute(t,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,l,f,a,h),c=new n(this.draco.HEAPF32.buffer,h,i).slice()}finally{this.draco._free(h)}return{value:c,size:s}}_deduceAttributeName(t,r){let n=t.unique_id;for(let[i,a]of Object.entries(r.extraAttributes||{}))if(a===n)return i;let s=t.attribute_type;for(let i in Uf)if(this.draco[i]===s)return Uf[i];let o=r.attributeNameEntry||"name";return t.metadata[o]?t.metadata[o].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(t){let r=this.decoder.GetMetadata(t);return this._getDracoMetadata(r)}_getAttributeMetadata(t,r){let n=this.decoder.GetAttributeMetadata(t,r);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(t);for(let s=0;s<n;s++){let o=this.metadataQuerier.GetEntryName(t,s);r[o]=this._getDracoMetadataField(t,o)}return r}_getDracoMetadataField(t,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,r,n);let s=G1(n);return{int:this.metadataQuerier.GetIntEntry(t,r),string:this.metadataQuerier.GetStringEntry(t,r),double:this.metadataQuerier.GetDoubleEntry(t,r),intArray:s}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=t,s=[...r,...n];for(let o of s)this.decoder.SkipAttributeTransform(this.draco[o])}_getQuantizationTransform(t,r){let{quantizedAttributes:n=[]}=r,s=t.attribute_type();if(n.map(i=>this.decoder[i]).includes(s)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(t))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(t,r){let{octahedronAttributes:n=[]}=r,s=t.attribute_type();if(n.map(i=>this.decoder[i]).includes(s)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(t))return{quantization_bits:i.quantization_bits()}}finally{this.draco.destroy(i)}}return null}};function N1(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}function G1(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function U1(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}var P1="1.5.6",H1="1.4.1",ai=`https://www.gstatic.com/draco/versioned/decoders/${P1}`,yt={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},ci={[yt.DECODER]:`${ai}/${yt.DECODER}`,[yt.DECODER_WASM]:`${ai}/${yt.DECODER_WASM}`,[yt.FALLBACK_DECODER]:`${ai}/${yt.FALLBACK_DECODER}`,[yt.ENCODER]:`https://raw.githubusercontent.com/google/draco/${H1}/javascript/${yt.ENCODER}`},fi;async function Pf(e){let t=e.modules||{};return t.draco3d?fi||=t.draco3d.createDecoderModule({}).then(r=>({draco:r})):fi||=k1(e),await fi}async function k1(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await qt(ci[yt.FALLBACK_DECODER],"draco",e,yt.FALLBACK_DECODER);break;case"wasm":default:[t,r]=await Promise.all([await qt(ci[yt.DECODER],"draco",e,yt.DECODER),await qt(ci[yt.DECODER_WASM],"draco",e,yt.DECODER_WASM)])}return t=t||globalThis.DracoDecoderModule,await J1(t,r)}function J1(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e({...r,onModuleLoaded:s=>n({draco:s})})})}var Is={...Df,parse:z1};async function z1(e,t){let{draco:r}=await Pf(t),n=new Mn(r);try{return n.parseSync(e,t?.draco)}finally{n.destroy()}}var Q1={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},nt={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},H={...Q1,...nt};var hi={[nt.DOUBLE]:Float64Array,[nt.FLOAT]:Float32Array,[nt.UNSIGNED_SHORT]:Uint16Array,[nt.UNSIGNED_INT]:Uint32Array,[nt.UNSIGNED_BYTE]:Uint8Array,[nt.BYTE]:Int8Array,[nt.SHORT]:Int16Array,[nt.INT]:Int32Array},V1={DOUBLE:nt.DOUBLE,FLOAT:nt.FLOAT,UNSIGNED_SHORT:nt.UNSIGNED_SHORT,UNSIGNED_INT:nt.UNSIGNED_INT,UNSIGNED_BYTE:nt.UNSIGNED_BYTE,BYTE:nt.BYTE,SHORT:nt.SHORT,INT:nt.INT},li="Failed to convert GL type",dt=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in hi)if(hi[r]===t)return r;throw new Error(li)}static fromName(t){let r=V1[t];if(!r)throw new Error(li);return r}static getArrayType(t){switch(t){case nt.UNSIGNED_SHORT_5_6_5:case nt.UNSIGNED_SHORT_4_4_4_4:case nt.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=hi[t];if(!r)throw new Error(li);return r}}static getByteSize(t){return dt.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(dt.getArrayType(t))}static createTypedArray(t,r,n=0,s){s===void 0&&(s=(r.byteLength-n)/dt.getByteSize(t));let o=dt.getArrayType(t);return new o(r,n,s)}};function Hf(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function ui(e,t=[0,0,0]){let r=e>>11&31,n=e>>5&63,s=e&31;return t[0]=r<<3,t[1]=n<<2,t[2]=s<<3,t}var YC=1/256;var ZC=new ze,qC=new fe,WC=new ze,$C=new ze,tM=new Uint8Array(1);function kf(e,t=255){return Wo(e,0,t)/t*2-1}function Jf(e){return e<0?-1:1}function zf(e,t,r,n){if(Hf(n),e<0||e>r||t<0||t>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(n.x=kf(e,r),n.y=kf(t,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){let s=n.x;n.x=(1-Math.abs(n.y))*Jf(s),n.y=(1-Math.abs(s))*Jf(n.y)}return n.normalize()}function di(e,t,r){return zf(e,t,255,r)}var j1=1/Math.PI*180,K1=1/180*Math.PI,X1={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...X1}};var q=globalThis.mathgl.config;function Ai(e,{precision:t=q.precision}={}){return e=Y1(e),`${parseFloat(e.toPrecision(t))}`}function $t(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function mi(e){return Qf(e)}function pi(e){return Vf(e)}function Qf(e,t){return jf(e,r=>r*K1,t)}function Vf(e,t){return jf(e,r=>r*j1,t)}function wt(e,t,r){let n=q.EPSILON;r&&(q.EPSILON=r);try{if(e===t)return!0;if($t(e)&&$t(t)){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!wt(e[s],t[s]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=q.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{q.EPSILON=n}}function Y1(e){return Math.round(e/q.EPSILON)*q.EPSILON}function Z1(e){return e.clone?e.clone():new Array(e.length)}function jf(e,t,r){if($t(e)){let n=e;r=r||Z1(n);for(let s=0;s<r.length&&s<n.length;++s){let o=typeof e=="number"?e:e[s];r[s]=t(o,s,r)}return r}return t(e)}var be=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:$t(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(q)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+Ai(this[n],t);return`${t.printTypes?this.constructor.name:""}[${r}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!wt(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let s=0;s<this.ELEMENTS;++s){let o=t[s],i=typeof r=="number"?r:r[s];this[s]=o+n*(i-o)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(q.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function q1(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function z(e){if(!Number.isFinite(e))throw new Error(`Invalid number ${JSON.stringify(e)}`);return e}function we(e,t,r=""){if(q.debug&&!q1(e,t))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return e}function ft(e,t){if(!e)throw new Error(`math.gl assertion ${t}`)}var Rr=class extends be{get x(){return this[0]}set x(t){this[0]=z(t)}get y(){return this[1]}set y(t){this[1]=z(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let s=this[n]-t[n];r+=s*s}return z(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return z(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return ft(t>=0&&t<this.ELEMENTS,"index is out of range"),z(this[t])}setComponent(t,r){return ft(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var W=typeof Float32Array<"u"?Float32Array:Array,bn=Math.random;function Fr(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var RM=Math.PI/180;function W1(){let e=new W(2);return W!=Float32Array&&(e[0]=0,e[1]=0),e}function Kf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[3]*s+r[6],e[1]=r[1]*n+r[4]*s+r[7],e}function Xf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[4]*s+r[12],e[1]=r[1]*n+r[5]*s+r[13],e}var FM=function(){let e=W1();return function(t,r,n,s,o,i){let a,f;for(r||(r=2),n||(n=0),s?f=Math.min(s*r+n,t.length):f=t.length,a=n;a<f;a+=r)e[0]=t[a],e[1]=t[a+1],o(e,e,i),t[a]=e[0],t[a+1]=e[1];return t}}();function Yf(e,t,r){let n=t[0],s=t[1],o=r[3]*n+r[7]*s||1;return e[0]=(r[0]*n+r[4]*s)/o,e[1]=(r[1]*n+r[5]*s)/o,e}function Ss(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o||1;return e[0]=(r[0]*n+r[4]*s+r[8]*o)/i,e[1]=(r[1]*n+r[5]*s+r[9]*o)/i,e[2]=(r[2]*n+r[6]*s+r[10]*o)/i,e}function Zf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e[2]=t[2],e}function qf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e[2]=t[2],e[3]=t[3],e}function Rs(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=r[0]*n+r[3]*s+r[6]*o,e[1]=r[1]*n+r[4]*s+r[7]*o,e[2]=r[2]*n+r[5]*s+r[8]*o,e[3]=t[3],e}var je={};ut(je,{add:()=>rA,angle:()=>_i,bezier:()=>mA,ceil:()=>nA,clone:()=>$1,copy:()=>tA,create:()=>Fs,cross:()=>Qe,dist:()=>CA,distance:()=>rh,div:()=>TA,divide:()=>eh,dot:()=>wn,equals:()=>EA,exactEquals:()=>BA,floor:()=>sA,forEach:()=>wA,fromValues:()=>Ds,hermite:()=>AA,inverse:()=>lA,len:()=>yi,length:()=>Wf,lerp:()=>uA,max:()=>iA,min:()=>oA,mul:()=>yA,multiply:()=>th,negate:()=>hA,normalize:()=>gi,random:()=>pA,rotateX:()=>xi,rotateY:()=>Bi,rotateZ:()=>Ei,round:()=>aA,scale:()=>cA,scaleAndAdd:()=>fA,set:()=>eA,slerp:()=>dA,sqrDist:()=>MA,sqrLen:()=>bA,squaredDistance:()=>nh,squaredLength:()=>sh,str:()=>xA,sub:()=>_A,subtract:()=>$f,transformMat3:()=>In,transformMat4:()=>Ve,transformQuat:()=>Sn,zero:()=>gA});function Fs(){let e=new W(3);return W!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function $1(e){let t=new W(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Wf(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function Ds(e,t,r){let n=new W(3);return n[0]=e,n[1]=t,n[2]=r,n}function tA(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function eA(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function rA(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function $f(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function th(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function eh(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function nA(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function sA(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function oA(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function iA(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function aA(e,t){return e[0]=Fr(t[0]),e[1]=Fr(t[1]),e[2]=Fr(t[2]),e}function cA(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function fA(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function rh(e,t){let r=t[0]-e[0],n=t[1]-e[1],s=t[2]-e[2];return Math.sqrt(r*r+n*n+s*s)}function nh(e,t){let r=t[0]-e[0],n=t[1]-e[1],s=t[2]-e[2];return r*r+n*n+s*s}function sh(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function hA(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function lA(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function gi(e,t){let r=t[0],n=t[1],s=t[2],o=r*r+n*n+s*s;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function wn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Qe(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[0],a=r[1],f=r[2];return e[0]=s*f-o*a,e[1]=o*i-n*f,e[2]=n*a-s*i,e}function uA(e,t,r,n){let s=t[0],o=t[1],i=t[2];return e[0]=s+n*(r[0]-s),e[1]=o+n*(r[1]-o),e[2]=i+n*(r[2]-i),e}function dA(e,t,r,n){let s=Math.acos(Math.min(Math.max(wn(t,r),-1),1)),o=Math.sin(s),i=Math.sin((1-n)*s)/o,a=Math.sin(n*s)/o;return e[0]=i*t[0]+a*r[0],e[1]=i*t[1]+a*r[1],e[2]=i*t[2]+a*r[2],e}function AA(e,t,r,n,s,o){let i=o*o,a=i*(2*o-3)+1,f=i*(o-2)+o,c=i*(o-1),h=i*(3-2*o);return e[0]=t[0]*a+r[0]*f+n[0]*c+s[0]*h,e[1]=t[1]*a+r[1]*f+n[1]*c+s[1]*h,e[2]=t[2]*a+r[2]*f+n[2]*c+s[2]*h,e}function mA(e,t,r,n,s,o){let i=1-o,a=i*i,f=o*o,c=a*i,h=3*o*a,l=3*f*i,u=f*o;return e[0]=t[0]*c+r[0]*h+n[0]*l+s[0]*u,e[1]=t[1]*c+r[1]*h+n[1]*l+s[1]*u,e[2]=t[2]*c+r[2]*h+n[2]*l+s[2]*u,e}function pA(e,t){t=t===void 0?1:t;let r=bn()*2*Math.PI,n=bn()*2-1,s=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*s,e[1]=Math.sin(r)*s,e[2]=n*t,e}function Ve(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o+r[15];return i=i||1,e[0]=(r[0]*n+r[4]*s+r[8]*o+r[12])/i,e[1]=(r[1]*n+r[5]*s+r[9]*o+r[13])/i,e[2]=(r[2]*n+r[6]*s+r[10]*o+r[14])/i,e}function In(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=n*r[0]+s*r[3]+o*r[6],e[1]=n*r[1]+s*r[4]+o*r[7],e[2]=n*r[2]+s*r[5]+o*r[8],e}function Sn(e,t,r){let n=r[0],s=r[1],o=r[2],i=r[3],a=t[0],f=t[1],c=t[2],h=s*c-o*f,l=o*a-n*c,u=n*f-s*a,d=s*u-o*l,A=o*h-n*u,m=n*l-s*h,p=i*2;return h*=p,l*=p,u*=p,d*=2,A*=2,m*=2,e[0]=a+h+d,e[1]=f+l+A,e[2]=c+u+m,e}function xi(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0],o[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),o[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Bi(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),o[1]=s[1],o[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Ei(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),o[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),o[2]=s[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function _i(e,t){let r=e[0],n=e[1],s=e[2],o=t[0],i=t[1],a=t[2],f=Math.sqrt((r*r+n*n+s*s)*(o*o+i*i+a*a)),c=f&&wn(e,t)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function gA(e){return e[0]=0,e[1]=0,e[2]=0,e}function xA(e){return`vec3(${e[0]}, ${e[1]}, ${e[2]})`}function BA(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function EA(e,t){let r=e[0],n=e[1],s=e[2],o=t[0],i=t[1],a=t[2];return Math.abs(r-o)<=1e-6*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}var _A=$f,yA=th,TA=eh,CA=rh,MA=nh,yi=Wf,bA=sh,wA=function(){let e=Fs();return function(t,r,n,s,o,i){let a,f;for(r||(r=3),n||(n=0),s?f=Math.min(s*r+n,t.length):f=t.length,a=n;a<f;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],o(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}}();var Ti=[0,0,0],Ls,b=class extends Rr{static get ZERO(){return Ls||(Ls=new b(0,0,0),Object.freeze(Ls)),Ls}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&$t(t)?this.copy(t):(q.debug&&(z(t),z(r),z(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return q.debug&&(z(t.x),z(t.y),z(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=z(t)}angle(t){return _i(this,t)}cross(t){return Qe(this,this,t),this.check()}rotateX({radians:t,origin:r=Ti}){return xi(this,this,r,t),this.check()}rotateY({radians:t,origin:r=Ti}){return Bi(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=Ti}){return Ei(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Ve(this,this,t),this.check()}transformAsVector(t){return Ss(this,this,t),this.check()}transformByMatrix3(t){return In(this,this,t),this.check()}transformByMatrix2(t){return Zf(this,this,t),this.check()}transformByQuaternion(t){return Sn(this,this,t),this.check()}};var Os,Lr=class extends Rr{static get ZERO(){return Os||(Os=new Lr(0,0,0,0),Object.freeze(Os)),Os}constructor(t=0,r=0,n=0,s=0){super(-0,-0,-0,-0),$t(t)&&arguments.length===1?this.copy(t):(q.debug&&(z(t),z(r),z(n),z(s)),this[0]=t,this[1]=r,this[2]=n,this[3]=s)}set(t,r,n,s){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return q.debug&&(z(t.x),z(t.y),z(t.z),z(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=z(t)}get w(){return this[3]}set w(t){this[3]=z(t)}transform(t){return Ve(this,this,t),this.check()}transformByMatrix3(t){return Rs(this,this,t),this.check()}transformByMatrix2(t){return qf(this,this,t),this.check()}transformByQuaternion(t){return Sn(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var Or=class extends be{toString(){let t="[";if(q.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=` ${this[n*this.RANK+r]}`}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=` ${this[r]}`}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=z(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)r[s]=this[n+s];return r}setColumn(t,r){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)this[n+s]=r[s];return this}};function oh(){let e=new W(9);return W!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ih(e,t){if(e===t){let r=t[1],n=t[2],s=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=s}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function ah(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],f=t[6],c=t[7],h=t[8],l=h*i-a*c,u=-h*o+a*f,d=c*o-i*f,A=r*l+n*u+s*d;return A?(A=1/A,e[0]=l*A,e[1]=(-h*n+s*c)*A,e[2]=(a*n-s*i)*A,e[3]=u*A,e[4]=(h*r-s*f)*A,e[5]=(-a*r+s*o)*A,e[6]=d*A,e[7]=(-c*r+n*f)*A,e[8]=(i*r-n*o)*A,e):null}function ch(e){let t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],i=e[5],a=e[6],f=e[7],c=e[8];return t*(c*o-i*f)+r*(-c*s+i*a)+n*(f*s-o*a)}function Ci(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=r[0],d=r[1],A=r[2],m=r[3],p=r[4],E=r[5],y=r[6],C=r[7],M=r[8];return e[0]=u*n+d*i+A*c,e[1]=u*s+d*a+A*h,e[2]=u*o+d*f+A*l,e[3]=m*n+p*i+E*c,e[4]=m*s+p*a+E*h,e[5]=m*o+p*f+E*l,e[6]=y*n+C*i+M*c,e[7]=y*s+C*a+M*h,e[8]=y*o+C*f+M*l,e}function fh(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=r[0],d=r[1];return e[0]=n,e[1]=s,e[2]=o,e[3]=i,e[4]=a,e[5]=f,e[6]=u*n+d*i+c,e[7]=u*s+d*a+h,e[8]=u*o+d*f+l,e}function hh(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=Math.sin(r),d=Math.cos(r);return e[0]=d*n+u*i,e[1]=d*s+u*a,e[2]=d*o+u*f,e[3]=d*i-u*n,e[4]=d*a-u*s,e[5]=d*f-u*o,e[6]=c,e[7]=h,e[8]=l,e}function Mi(e,t,r){let n=r[0],s=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=s*t[3],e[4]=s*t[4],e[5]=s*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function lh(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r+r,a=n+n,f=s+s,c=r*i,h=n*i,l=n*a,u=s*i,d=s*a,A=s*f,m=o*i,p=o*a,E=o*f;return e[0]=1-l-A,e[3]=h-E,e[6]=u+p,e[1]=h+E,e[4]=1-c-A,e[7]=d-m,e[2]=u-p,e[5]=d+m,e[8]=1-c-l,e}var bi;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(bi||(bi={}));var SA=Object.freeze([1,0,0,0,1,0,0,0,1]),Z=class extends Or{static get IDENTITY(){return FA()}static get ZERO(){return RA()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return bi}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(SA)}fromObject(t){return this.check()}fromQuaternion(t){return lh(this,t),this.check()}set(t,r,n,s,o,i,a,f,c){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this[4]=o,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this.check()}setRowMajor(t,r,n,s,o,i,a,f,c){return this[0]=t,this[1]=s,this[2]=a,this[3]=r,this[4]=o,this[5]=f,this[6]=n,this[7]=i,this[8]=c,this.check()}determinant(){return ch(this)}transpose(){return ih(this,this),this.check()}invert(){return ah(this,this),this.check()}multiplyLeft(t){return Ci(this,t,this),this.check()}multiplyRight(t){return Ci(this,this,t),this.check()}rotate(t){return hh(this,this,t),this.check()}scale(t){return Array.isArray(t)?Mi(this,this,t):Mi(this,this,[t,t]),this.check()}translate(t){return fh(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=Kf(r||[-0,-0],t,this);break;case 3:n=In(r||[-0,-0,-0],t,this);break;case 4:n=Rs(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return we(n,t.length),n}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},vs,Ns=null;function RA(){return vs||(vs=new Z([0,0,0,0,0,0,0,0,0]),Object.freeze(vs)),vs}function FA(){return Ns||(Ns=new Z,Object.freeze(Ns)),Ns}var Fn={};ut(Fn,{add:()=>rm,adjoint:()=>GA,clone:()=>LA,copy:()=>OA,create:()=>DA,decompose:()=>KA,determinant:()=>Si,equals:()=>im,exactEquals:()=>om,frob:()=>em,fromQuat:()=>Ni,fromQuat2:()=>QA,fromRotation:()=>HA,fromRotationTranslation:()=>dh,fromRotationTranslationScale:()=>XA,fromRotationTranslationScaleOrigin:()=>YA,fromScaling:()=>PA,fromTranslation:()=>UA,fromValues:()=>vA,fromXRotation:()=>kA,fromYRotation:()=>JA,fromZRotation:()=>zA,frustum:()=>Gi,getRotation:()=>jA,getScaling:()=>Ah,getTranslation:()=>VA,identity:()=>uh,invert:()=>Ii,lookAt:()=>Hi,mul:()=>am,multiply:()=>Rn,multiplyScalar:()=>nm,multiplyScalarAndAdd:()=>sm,ortho:()=>Pi,orthoNO:()=>ph,orthoZO:()=>WA,perspective:()=>Ui,perspectiveFromFieldOfView:()=>qA,perspectiveNO:()=>mh,perspectiveZO:()=>ZA,rotate:()=>Di,rotateX:()=>Li,rotateY:()=>Oi,rotateZ:()=>vi,scale:()=>Fi,set:()=>NA,str:()=>tm,sub:()=>cm,subtract:()=>gh,targetTo:()=>$A,translate:()=>Ri,transpose:()=>wi});function DA(){let e=new W(16);return W!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function LA(e){let t=new W(16);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 OA(e,t){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 vA(e,t,r,n,s,o,i,a,f,c,h,l,u,d,A,m){let p=new W(16);return p[0]=e,p[1]=t,p[2]=r,p[3]=n,p[4]=s,p[5]=o,p[6]=i,p[7]=a,p[8]=f,p[9]=c,p[10]=h,p[11]=l,p[12]=u,p[13]=d,p[14]=A,p[15]=m,p}function NA(e,t,r,n,s,o,i,a,f,c,h,l,u,d,A,m,p){return e[0]=t,e[1]=r,e[2]=n,e[3]=s,e[4]=o,e[5]=i,e[6]=a,e[7]=f,e[8]=c,e[9]=h,e[10]=l,e[11]=u,e[12]=d,e[13]=A,e[14]=m,e[15]=p,e}function uh(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function wi(e,t){if(e===t){let r=t[1],n=t[2],s=t[3],o=t[6],i=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=s,e[13]=i,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function Ii(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],f=t[6],c=t[7],h=t[8],l=t[9],u=t[10],d=t[11],A=t[12],m=t[13],p=t[14],E=t[15],y=r*a-n*i,C=r*f-s*i,M=r*c-o*i,T=n*f-s*a,I=n*c-o*a,w=s*c-o*f,L=h*m-l*A,x=h*p-u*A,g=h*E-d*A,B=l*p-u*m,_=l*E-d*m,U=u*E-d*p,G=y*U-C*_+M*B+T*g-I*x+w*L;return G?(G=1/G,e[0]=(a*U-f*_+c*B)*G,e[1]=(s*_-n*U-o*B)*G,e[2]=(m*w-p*I+E*T)*G,e[3]=(u*I-l*w-d*T)*G,e[4]=(f*g-i*U-c*x)*G,e[5]=(r*U-s*g+o*x)*G,e[6]=(p*M-A*w-E*C)*G,e[7]=(h*w-u*M+d*C)*G,e[8]=(i*_-a*g+c*L)*G,e[9]=(n*g-r*_-o*L)*G,e[10]=(A*I-m*M+E*y)*G,e[11]=(l*M-h*I-d*y)*G,e[12]=(a*x-i*B-f*L)*G,e[13]=(r*B-n*x+s*L)*G,e[14]=(m*C-A*T-p*y)*G,e[15]=(h*T-l*C+u*y)*G,e):null}function GA(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],f=t[6],c=t[7],h=t[8],l=t[9],u=t[10],d=t[11],A=t[12],m=t[13],p=t[14],E=t[15],y=r*a-n*i,C=r*f-s*i,M=r*c-o*i,T=n*f-s*a,I=n*c-o*a,w=s*c-o*f,L=h*m-l*A,x=h*p-u*A,g=h*E-d*A,B=l*p-u*m,_=l*E-d*m,U=u*E-d*p;return e[0]=a*U-f*_+c*B,e[1]=s*_-n*U-o*B,e[2]=m*w-p*I+E*T,e[3]=u*I-l*w-d*T,e[4]=f*g-i*U-c*x,e[5]=r*U-s*g+o*x,e[6]=p*M-A*w-E*C,e[7]=h*w-u*M+d*C,e[8]=i*_-a*g+c*L,e[9]=n*g-r*_-o*L,e[10]=A*I-m*M+E*y,e[11]=l*M-h*I-d*y,e[12]=a*x-i*B-f*L,e[13]=r*B-n*x+s*L,e[14]=m*C-A*T-p*y,e[15]=h*T-l*C+u*y,e}function Si(e){let t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],i=e[5],a=e[6],f=e[7],c=e[8],h=e[9],l=e[10],u=e[11],d=e[12],A=e[13],m=e[14],p=e[15],E=t*i-r*o,y=t*a-n*o,C=r*a-n*i,M=c*A-h*d,T=c*m-l*d,I=h*m-l*A,w=t*I-r*T+n*M,L=o*I-i*T+a*M,x=c*C-h*y+l*E,g=d*C-A*y+m*E;return f*w-s*L+p*x-u*g}function Rn(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=t[9],d=t[10],A=t[11],m=t[12],p=t[13],E=t[14],y=t[15],C=r[0],M=r[1],T=r[2],I=r[3];return e[0]=C*n+M*a+T*l+I*m,e[1]=C*s+M*f+T*u+I*p,e[2]=C*o+M*c+T*d+I*E,e[3]=C*i+M*h+T*A+I*y,C=r[4],M=r[5],T=r[6],I=r[7],e[4]=C*n+M*a+T*l+I*m,e[5]=C*s+M*f+T*u+I*p,e[6]=C*o+M*c+T*d+I*E,e[7]=C*i+M*h+T*A+I*y,C=r[8],M=r[9],T=r[10],I=r[11],e[8]=C*n+M*a+T*l+I*m,e[9]=C*s+M*f+T*u+I*p,e[10]=C*o+M*c+T*d+I*E,e[11]=C*i+M*h+T*A+I*y,C=r[12],M=r[13],T=r[14],I=r[15],e[12]=C*n+M*a+T*l+I*m,e[13]=C*s+M*f+T*u+I*p,e[14]=C*o+M*c+T*d+I*E,e[15]=C*i+M*h+T*A+I*y,e}function Ri(e,t,r){let n=r[0],s=r[1],o=r[2],i,a,f,c,h,l,u,d,A,m,p,E;return t===e?(e[12]=t[0]*n+t[4]*s+t[8]*o+t[12],e[13]=t[1]*n+t[5]*s+t[9]*o+t[13],e[14]=t[2]*n+t[6]*s+t[10]*o+t[14],e[15]=t[3]*n+t[7]*s+t[11]*o+t[15]):(i=t[0],a=t[1],f=t[2],c=t[3],h=t[4],l=t[5],u=t[6],d=t[7],A=t[8],m=t[9],p=t[10],E=t[11],e[0]=i,e[1]=a,e[2]=f,e[3]=c,e[4]=h,e[5]=l,e[6]=u,e[7]=d,e[8]=A,e[9]=m,e[10]=p,e[11]=E,e[12]=i*n+h*s+A*o+t[12],e[13]=a*n+l*s+m*o+t[13],e[14]=f*n+u*s+p*o+t[14],e[15]=c*n+d*s+E*o+t[15]),e}function Fi(e,t,r){let n=r[0],s=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Di(e,t,r,n){let s=n[0],o=n[1],i=n[2],a=Math.sqrt(s*s+o*o+i*i),f,c,h,l,u,d,A,m,p,E,y,C,M,T,I,w,L,x,g,B,_,U,G,P;return a<1e-6?null:(a=1/a,s*=a,o*=a,i*=a,c=Math.sin(r),f=Math.cos(r),h=1-f,l=t[0],u=t[1],d=t[2],A=t[3],m=t[4],p=t[5],E=t[6],y=t[7],C=t[8],M=t[9],T=t[10],I=t[11],w=s*s*h+f,L=o*s*h+i*c,x=i*s*h-o*c,g=s*o*h-i*c,B=o*o*h+f,_=i*o*h+s*c,U=s*i*h+o*c,G=o*i*h-s*c,P=i*i*h+f,e[0]=l*w+m*L+C*x,e[1]=u*w+p*L+M*x,e[2]=d*w+E*L+T*x,e[3]=A*w+y*L+I*x,e[4]=l*g+m*B+C*_,e[5]=u*g+p*B+M*_,e[6]=d*g+E*B+T*_,e[7]=A*g+y*B+I*_,e[8]=l*U+m*G+C*P,e[9]=u*U+p*G+M*P,e[10]=d*U+E*G+T*P,e[11]=A*U+y*G+I*P,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function Li(e,t,r){let n=Math.sin(r),s=Math.cos(r),o=t[4],i=t[5],a=t[6],f=t[7],c=t[8],h=t[9],l=t[10],u=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*s+c*n,e[5]=i*s+h*n,e[6]=a*s+l*n,e[7]=f*s+u*n,e[8]=c*s-o*n,e[9]=h*s-i*n,e[10]=l*s-a*n,e[11]=u*s-f*n,e}function Oi(e,t,r){let n=Math.sin(r),s=Math.cos(r),o=t[0],i=t[1],a=t[2],f=t[3],c=t[8],h=t[9],l=t[10],u=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*s-c*n,e[1]=i*s-h*n,e[2]=a*s-l*n,e[3]=f*s-u*n,e[8]=o*n+c*s,e[9]=i*n+h*s,e[10]=a*n+l*s,e[11]=f*n+u*s,e}function vi(e,t,r){let n=Math.sin(r),s=Math.cos(r),o=t[0],i=t[1],a=t[2],f=t[3],c=t[4],h=t[5],l=t[6],u=t[7];return t!==e&&(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[0]=o*s+c*n,e[1]=i*s+h*n,e[2]=a*s+l*n,e[3]=f*s+u*n,e[4]=c*s-o*n,e[5]=h*s-i*n,e[6]=l*s-a*n,e[7]=u*s-f*n,e}function UA(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function PA(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function HA(e,t,r){let n=r[0],s=r[1],o=r[2],i=Math.sqrt(n*n+s*s+o*o),a,f,c;return i<1e-6?null:(i=1/i,n*=i,s*=i,o*=i,f=Math.sin(t),a=Math.cos(t),c=1-a,e[0]=n*n*c+a,e[1]=s*n*c+o*f,e[2]=o*n*c-s*f,e[3]=0,e[4]=n*s*c-o*f,e[5]=s*s*c+a,e[6]=o*s*c+n*f,e[7]=0,e[8]=n*o*c+s*f,e[9]=s*o*c-n*f,e[10]=o*o*c+a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function kA(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function JA(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function zA(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function dh(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=n+n,f=s+s,c=o+o,h=n*a,l=n*f,u=n*c,d=s*f,A=s*c,m=o*c,p=i*a,E=i*f,y=i*c;return e[0]=1-(d+m),e[1]=l+y,e[2]=u-E,e[3]=0,e[4]=l-y,e[5]=1-(h+m),e[6]=A+p,e[7]=0,e[8]=u+E,e[9]=A-p,e[10]=1-(h+d),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function QA(e,t){let r=new W(3),n=-t[0],s=-t[1],o=-t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=n*n+s*s+o*o+i*i;return l>0?(r[0]=(a*i+h*n+f*o-c*s)*2/l,r[1]=(f*i+h*s+c*n-a*o)*2/l,r[2]=(c*i+h*o+a*s-f*n)*2/l):(r[0]=(a*i+h*n+f*o-c*s)*2,r[1]=(f*i+h*s+c*n-a*o)*2,r[2]=(c*i+h*o+a*s-f*n)*2),dh(e,t,r),e}function VA(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Ah(e,t){let r=t[0],n=t[1],s=t[2],o=t[4],i=t[5],a=t[6],f=t[8],c=t[9],h=t[10];return e[0]=Math.sqrt(r*r+n*n+s*s),e[1]=Math.sqrt(o*o+i*i+a*a),e[2]=Math.sqrt(f*f+c*c+h*h),e}function jA(e,t){let r=new W(3);Ah(r,t);let n=1/r[0],s=1/r[1],o=1/r[2],i=t[0]*n,a=t[1]*s,f=t[2]*o,c=t[4]*n,h=t[5]*s,l=t[6]*o,u=t[8]*n,d=t[9]*s,A=t[10]*o,m=i+h+A,p=0;return m>0?(p=Math.sqrt(m+1)*2,e[3]=.25*p,e[0]=(l-d)/p,e[1]=(u-f)/p,e[2]=(a-c)/p):i>h&&i>A?(p=Math.sqrt(1+i-h-A)*2,e[3]=(l-d)/p,e[0]=.25*p,e[1]=(a+c)/p,e[2]=(u+f)/p):h>A?(p=Math.sqrt(1+h-i-A)*2,e[3]=(u-f)/p,e[0]=(a+c)/p,e[1]=.25*p,e[2]=(l+d)/p):(p=Math.sqrt(1+A-i-h)*2,e[3]=(a-c)/p,e[0]=(u+f)/p,e[1]=(l+d)/p,e[2]=.25*p),e}function KA(e,t,r,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];let s=n[0],o=n[1],i=n[2],a=n[4],f=n[5],c=n[6],h=n[8],l=n[9],u=n[10];r[0]=Math.sqrt(s*s+o*o+i*i),r[1]=Math.sqrt(a*a+f*f+c*c),r[2]=Math.sqrt(h*h+l*l+u*u);let d=1/r[0],A=1/r[1],m=1/r[2],p=s*d,E=o*A,y=i*m,C=a*d,M=f*A,T=c*m,I=h*d,w=l*A,L=u*m,x=p+M+L,g=0;return x>0?(g=Math.sqrt(x+1)*2,e[3]=.25*g,e[0]=(T-w)/g,e[1]=(I-y)/g,e[2]=(E-C)/g):p>M&&p>L?(g=Math.sqrt(1+p-M-L)*2,e[3]=(T-w)/g,e[0]=.25*g,e[1]=(E+C)/g,e[2]=(I+y)/g):M>L?(g=Math.sqrt(1+M-p-L)*2,e[3]=(I-y)/g,e[0]=(E+C)/g,e[1]=.25*g,e[2]=(T+w)/g):(g=Math.sqrt(1+L-p-M)*2,e[3]=(E-C)/g,e[0]=(I+y)/g,e[1]=(T+w)/g,e[2]=.25*g),e}function XA(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=t[3],f=s+s,c=o+o,h=i+i,l=s*f,u=s*c,d=s*h,A=o*c,m=o*h,p=i*h,E=a*f,y=a*c,C=a*h,M=n[0],T=n[1],I=n[2];return e[0]=(1-(A+p))*M,e[1]=(u+C)*M,e[2]=(d-y)*M,e[3]=0,e[4]=(u-C)*T,e[5]=(1-(l+p))*T,e[6]=(m+E)*T,e[7]=0,e[8]=(d+y)*I,e[9]=(m-E)*I,e[10]=(1-(l+A))*I,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function YA(e,t,r,n,s){let o=t[0],i=t[1],a=t[2],f=t[3],c=o+o,h=i+i,l=a+a,u=o*c,d=o*h,A=o*l,m=i*h,p=i*l,E=a*l,y=f*c,C=f*h,M=f*l,T=n[0],I=n[1],w=n[2],L=s[0],x=s[1],g=s[2],B=(1-(m+E))*T,_=(d+M)*T,U=(A-C)*T,G=(d-M)*I,P=(1-(u+E))*I,v=(p+y)*I,at=(A+C)*w,mt=(p-y)*w,X=(1-(u+m))*w;return e[0]=B,e[1]=_,e[2]=U,e[3]=0,e[4]=G,e[5]=P,e[6]=v,e[7]=0,e[8]=at,e[9]=mt,e[10]=X,e[11]=0,e[12]=r[0]+L-(B*L+G*x+at*g),e[13]=r[1]+x-(_*L+P*x+mt*g),e[14]=r[2]+g-(U*L+v*x+X*g),e[15]=1,e}function Ni(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r+r,a=n+n,f=s+s,c=r*i,h=n*i,l=n*a,u=s*i,d=s*a,A=s*f,m=o*i,p=o*a,E=o*f;return e[0]=1-l-A,e[1]=h+E,e[2]=u-p,e[3]=0,e[4]=h-E,e[5]=1-c-A,e[6]=d+m,e[7]=0,e[8]=u+p,e[9]=d-m,e[10]=1-c-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Gi(e,t,r,n,s,o,i){let a=1/(r-t),f=1/(s-n),c=1/(o-i);return e[0]=o*2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*f,e[6]=0,e[7]=0,e[8]=(r+t)*a,e[9]=(s+n)*f,e[10]=(i+o)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=i*o*2*c,e[15]=0,e}function mh(e,t,r,n,s){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,s!=null&&s!==1/0){let i=1/(n-s);e[10]=(s+n)*i,e[14]=2*s*n*i}else e[10]=-1,e[14]=-2*n;return e}var Ui=mh;function ZA(e,t,r,n,s){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,s!=null&&s!==1/0){let i=1/(n-s);e[10]=s*i,e[14]=s*n*i}else e[10]=-1,e[14]=-n;return e}function qA(e,t,r,n){let s=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),f=2/(i+a),c=2/(s+o);return e[0]=f,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-((i-a)*f*.5),e[9]=(s-o)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function ph(e,t,r,n,s,o,i){let a=1/(t-r),f=1/(n-s),c=1/(o-i);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*f,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*a,e[13]=(s+n)*f,e[14]=(i+o)*c,e[15]=1,e}var Pi=ph;function WA(e,t,r,n,s,o,i){let a=1/(t-r),f=1/(n-s),c=1/(o-i);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*f,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=c,e[11]=0,e[12]=(t+r)*a,e[13]=(s+n)*f,e[14]=o*c,e[15]=1,e}function Hi(e,t,r,n){let s,o,i,a,f,c,h,l,u,d,A=t[0],m=t[1],p=t[2],E=n[0],y=n[1],C=n[2],M=r[0],T=r[1],I=r[2];return Math.abs(A-M)<1e-6&&Math.abs(m-T)<1e-6&&Math.abs(p-I)<1e-6?uh(e):(l=A-M,u=m-T,d=p-I,s=1/Math.sqrt(l*l+u*u+d*d),l*=s,u*=s,d*=s,o=y*d-C*u,i=C*l-E*d,a=E*u-y*l,s=Math.sqrt(o*o+i*i+a*a),s?(s=1/s,o*=s,i*=s,a*=s):(o=0,i=0,a=0),f=u*a-d*i,c=d*o-l*a,h=l*i-u*o,s=Math.sqrt(f*f+c*c+h*h),s?(s=1/s,f*=s,c*=s,h*=s):(f=0,c=0,h=0),e[0]=o,e[1]=f,e[2]=l,e[3]=0,e[4]=i,e[5]=c,e[6]=u,e[7]=0,e[8]=a,e[9]=h,e[10]=d,e[11]=0,e[12]=-(o*A+i*m+a*p),e[13]=-(f*A+c*m+h*p),e[14]=-(l*A+u*m+d*p),e[15]=1,e)}function $A(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=n[0],f=n[1],c=n[2],h=s-r[0],l=o-r[1],u=i-r[2],d=h*h+l*l+u*u;d>0&&(d=1/Math.sqrt(d),h*=d,l*=d,u*=d);let A=f*u-c*l,m=c*h-a*u,p=a*l-f*h;return d=A*A+m*m+p*p,d>0&&(d=1/Math.sqrt(d),A*=d,m*=d,p*=d),e[0]=A,e[1]=m,e[2]=p,e[3]=0,e[4]=l*p-u*m,e[5]=u*A-h*p,e[6]=h*m-l*A,e[7]=0,e[8]=h,e[9]=l,e[10]=u,e[11]=0,e[12]=s,e[13]=o,e[14]=i,e[15]=1,e}function tm(e){return`mat4(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]}, ${e[4]}, ${e[5]}, ${e[6]}, ${e[7]}, ${e[8]}, ${e[9]}, ${e[10]}, ${e[11]}, ${e[12]}, ${e[13]}, ${e[14]}, ${e[15]})`}function em(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}function rm(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function gh(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function nm(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function sm(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function om(e,t){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]}function im(e,t){let r=e[0],n=e[1],s=e[2],o=e[3],i=e[4],a=e[5],f=e[6],c=e[7],h=e[8],l=e[9],u=e[10],d=e[11],A=e[12],m=e[13],p=e[14],E=e[15],y=t[0],C=t[1],M=t[2],T=t[3],I=t[4],w=t[5],L=t[6],x=t[7],g=t[8],B=t[9],_=t[10],U=t[11],G=t[12],P=t[13],v=t[14],at=t[15];return Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-C)<=1e-6*Math.max(1,Math.abs(n),Math.abs(C))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(o-T)<=1e-6*Math.max(1,Math.abs(o),Math.abs(T))&&Math.abs(i-I)<=1e-6*Math.max(1,Math.abs(i),Math.abs(I))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(f-L)<=1e-6*Math.max(1,Math.abs(f),Math.abs(L))&&Math.abs(c-x)<=1e-6*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(h-g)<=1e-6*Math.max(1,Math.abs(h),Math.abs(g))&&Math.abs(l-B)<=1e-6*Math.max(1,Math.abs(l),Math.abs(B))&&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-G)<=1e-6*Math.max(1,Math.abs(A),Math.abs(G))&&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-at)<=1e-6*Math.max(1,Math.abs(E),Math.abs(at))}var am=Rn,cm=gh;function fm(){let e=new W(4);return W!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function xh(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function Bh(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function Eh(e){let t=e[0],r=e[1],n=e[2],s=e[3];return Math.sqrt(t*t+r*r+n*n+s*s)}function _h(e){let t=e[0],r=e[1],n=e[2],s=e[3];return t*t+r*r+n*n+s*s}function yh(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r*r+n*n+s*s+o*o;return i>0&&(i=1/Math.sqrt(i)),e[0]=r*i,e[1]=n*i,e[2]=s*i,e[3]=o*i,e}function Th(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function Ch(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=t[3];return e[0]=s+n*(r[0]-s),e[1]=o+n*(r[1]-o),e[2]=i+n*(r[2]-i),e[3]=a+n*(r[3]-a),e}function Mh(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3];return e[0]=r[0]*n+r[4]*s+r[8]*o+r[12]*i,e[1]=r[1]*n+r[5]*s+r[9]*o+r[13]*i,e[2]=r[2]*n+r[6]*s+r[10]*o+r[14]*i,e[3]=r[3]*n+r[7]*s+r[11]*o+r[15]*i,e}function bh(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[0],a=r[1],f=r[2],c=r[3],h=c*n+a*o-f*s,l=c*s+f*n-i*o,u=c*o+i*s-a*n,d=-i*n-a*s-f*o;return e[0]=h*c+d*-i+l*-f-u*-a,e[1]=l*c+d*-a+u*-i-h*-f,e[2]=u*c+d*-f+h*-a-l*-i,e[3]=t[3],e}var nb=function(){let e=fm();return function(t,r,n,s,o,i){let a,f;for(r||(r=4),n||(n=0),s?f=Math.min(s*r+n,t.length):f=t.length,a=n;a<f;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],e[3]=t[a+3],o(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2],t[a+3]=e[3];return t}}();var zi;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(zi||(zi={}));var lm=45*Math.PI/180,um=1,ki=.1,Ji=500,dm=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Rt=class extends Or{static get IDENTITY(){return mm()}static get ZERO(){return Am()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return zi}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,s,o,i,a,f,c,h,l,u,d,A,m,p){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this[4]=o,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this[9]=h,this[10]=l,this[11]=u,this[12]=d,this[13]=A,this[14]=m,this[15]=p,this.check()}setRowMajor(t,r,n,s,o,i,a,f,c,h,l,u,d,A,m,p){return this[0]=t,this[1]=o,this[2]=c,this[3]=d,this[4]=r,this[5]=i,this[6]=h,this[7]=A,this[8]=n,this[9]=a,this[10]=l,this[11]=m,this[12]=s,this[13]=f,this[14]=u,this[15]=p,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(dm)}fromObject(t){return this.check()}fromQuaternion(t){return Ni(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:s,top:o,near:i=ki,far:a=Ji}=t;return a===1/0?pm(this,r,n,s,o,i):Gi(this,r,n,s,o,i,a),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:s=[0,1,0]}=t;return Hi(this,r,n,s),this.check()}ortho(t){let{left:r,right:n,bottom:s,top:o,near:i=ki,far:a=Ji}=t;return Pi(this,r,n,s,o,i,a),this.check()}orthographic(t){let{fovy:r=lm,aspect:n=um,focalDistance:s=1,near:o=ki,far:i=Ji}=t;wh(r);let a=r/2,f=s*Math.tan(a),c=f*n;return this.ortho({left:-c,right:c,bottom:-f,top:f,near:o,far:i})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:s=.1,far:o=500}=t;return wh(r),Ui(this,r,n,s,o),this.check()}determinant(){return Si(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-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),s=1/n[0],o=1/n[1],i=1/n[2];return t[0]=this[0]*s,t[1]=this[1]*o,t[2]=this[2]*i,t[3]=0,t[4]=this[4]*s,t[5]=this[5]*o,t[6]=this[6]*i,t[7]=0,t[8]=this[8]*s,t[9]=this[9]*o,t[10]=this[10]*i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),s=1/n[0],o=1/n[1],i=1/n[2];return t[0]=this[0]*s,t[1]=this[1]*o,t[2]=this[2]*i,t[3]=this[4]*s,t[4]=this[5]*o,t[5]=this[6]*i,t[6]=this[8]*s,t[7]=this[9]*o,t[8]=this[10]*i,t}transpose(){return wi(this,this),this.check()}invert(){return Ii(this,this),this.check()}multiplyLeft(t){return Rn(this,t,this),this.check()}multiplyRight(t){return Rn(this,this,t),this.check()}rotateX(t){return Li(this,this,t),this.check()}rotateY(t){return Oi(this,this,t),this.check()}rotateZ(t){return vi(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return Di(this,this,t,r),this.check()}scale(t){return Fi(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return Ri(this,this,t),this.check()}transform(t,r){return t.length===4?(r=Mh(r||[-0,-0,-0,-0],t,this),we(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,s;switch(n){case 2:s=Xf(r||[-0,-0],t,this);break;case 3:s=Ve(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return we(s,t.length),s}transformAsVector(t,r){let n;switch(t.length){case 2:n=Yf(r||[-0,-0],t,this);break;case 3:n=Ss(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return we(n,t.length),n}transformPoint(t,r){return this.transformAsPoint(t,r)}transformVector(t,r){return this.transformAsPoint(t,r)}transformDirection(t,r){return this.transformAsVector(t,r)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}},Gs,Us;function Am(){return Gs||(Gs=new Rt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Gs)),Gs}function mm(){return Us||(Us=new Rt,Object.freeze(Us)),Us}function wh(e){if(e>Math.PI*2)throw Error("expected radians")}function pm(e,t,r,n,s,o){let i=2*o/(r-t),a=2*o/(s-n),f=(r+t)/(r-t),c=(s+n)/(s-n),h=-1,l=-1,u=-2*o;return e[0]=i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=f,e[9]=c,e[10]=h,e[11]=l,e[12]=0,e[13]=0,e[14]=u,e[15]=0,e}function Ih(){let e=new W(4);return W!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Sh(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Qi(e,t,r){r=r*.5;let n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function Vi(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=r[0],f=r[1],c=r[2],h=r[3];return e[0]=n*h+i*a+s*c-o*f,e[1]=s*h+i*f+o*a-n*c,e[2]=o*h+i*c+n*f-s*a,e[3]=i*h-n*a-s*f-o*c,e}function Rh(e,t,r){r*=.5;let n=t[0],s=t[1],o=t[2],i=t[3],a=Math.sin(r),f=Math.cos(r);return e[0]=n*f+i*a,e[1]=s*f+o*a,e[2]=o*f-s*a,e[3]=i*f-n*a,e}function Fh(e,t,r){r*=.5;let n=t[0],s=t[1],o=t[2],i=t[3],a=Math.sin(r),f=Math.cos(r);return e[0]=n*f-o*a,e[1]=s*f+i*a,e[2]=o*f+n*a,e[3]=i*f-s*a,e}function Dh(e,t,r){r*=.5;let n=t[0],s=t[1],o=t[2],i=t[3],a=Math.sin(r),f=Math.cos(r);return e[0]=n*f+s*a,e[1]=s*f-n*a,e[2]=o*f+i*a,e[3]=i*f-o*a,e}function Lh(e,t){let r=t[0],n=t[1],s=t[2];return e[0]=r,e[1]=n,e[2]=s,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-s*s)),e}function Dn(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=t[3],f=r[0],c=r[1],h=r[2],l=r[3],u,d,A,m,p;return u=s*f+o*c+i*h+a*l,u<0&&(u=-u,f=-f,c=-c,h=-h,l=-l),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),e[0]=A*s+m*f,e[1]=A*o+m*c,e[2]=A*i+m*h,e[3]=A*a+m*l,e}function Oh(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r*r+n*n+s*s+o*o,a=i?1/i:0;return e[0]=-r*a,e[1]=-n*a,e[2]=-s*a,e[3]=o*a,e}function vh(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function ji(e,t){let r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[s*3+s]&&(s=2);let o=(s+1)%3,i=(s+2)%3;n=Math.sqrt(t[s*3+s]-t[o*3+o]-t[i*3+i]+1),e[s]=.5*n,n=.5/n,e[3]=(t[o*3+i]-t[i*3+o])*n,e[o]=(t[o*3+s]+t[s*3+o])*n,e[i]=(t[i*3+s]+t[s*3+i])*n}return e}var Nh=xh;var Gh=Bh,Uh=Th,Ph=Ch,Hh=Eh;var kh=_h;var Jh=yh;var zh=function(){let e=Fs(),t=Ds(1,0,0),r=Ds(0,1,0);return function(n,s,o){let i=wn(s,o);return i<-.999999?(Qe(e,t,s),yi(e)<1e-6&&Qe(e,r,s),gi(e,e),Qi(n,e,Math.PI),n):i>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Qe(e,s,o),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+i,Jh(n,n))}}(),gb=function(){let e=Ih(),t=Ih();return function(r,n,s,o,i,a){return Dn(e,n,i,a),Dn(t,s,o,a),Dn(r,e,t,2*a*(1-a)),r}}(),xb=function(){let e=oh();return function(t,r,n,s){return e[0]=n[0],e[3]=n[1],e[6]=n[2],e[1]=s[0],e[4]=s[1],e[7]=s[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],Jh(t,ji(t,e))}}();var gm=[0,0,0,1],Ie=class extends be{constructor(t=0,r=0,n=0,s=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,n,s)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,r,n,s){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return ji(this,t),this.check()}fromAxisRotation(t,r){return Qi(this,t,r),this.check()}identity(){return Sh(this),this.check()}setAxisAngle(t,r){return this.fromAxisRotation(t,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=z(t)}get y(){return this[1]}set y(t){this[1]=z(t)}get z(){return this[2]}set z(t){this[2]=z(t)}get w(){return this[3]}set w(t){this[3]=z(t)}len(){return Hh(this)}lengthSquared(){return kh(this)}dot(t){return Uh(this,t)}rotationTo(t,r){return zh(this,t,r),this.check()}add(t){return Nh(this,this,t),this.check()}calculateW(){return Lh(this,this),this.check()}conjugate(){return vh(this,this),this.check()}invert(){return Oh(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(Ph(this,t,r,n),this.check())}multiplyRight(t){return Vi(this,this,t),this.check()}multiplyLeft(t){return Vi(this,t,this),this.check()}normalize(){let t=this.len(),r=t>0?1/t:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,t===0&&(this[3]=1),this.check()}rotateX(t){return Rh(this,this,t),this.check()}rotateY(t){return Fh(this,this,t),this.check()}rotateZ(t){return Dh(this,this,t),this.check()}scale(t){return Gh(this,this,t),this.check()}slerp(t,r,n){let s,o,i;switch(arguments.length){case 1:({start:s=gm,target:o,ratio:i}=t);break;case 2:s=this,o=t,i=r;break;default:s=t,o=r,i=n}return Dn(this,s,o,i),this.check()}transformVector4(t,r=new Lr){return bh(r,t,this),we(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,r){return this.setAxisAngle(t,r)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}};var Ht={};ut(Ht,{EPSILON1:()=>xm,EPSILON10:()=>wm,EPSILON11:()=>Im,EPSILON12:()=>Sm,EPSILON13:()=>Rm,EPSILON14:()=>Fm,EPSILON15:()=>Dm,EPSILON16:()=>Lm,EPSILON17:()=>Om,EPSILON18:()=>vm,EPSILON19:()=>Nm,EPSILON2:()=>Bm,EPSILON20:()=>Gm,EPSILON3:()=>Em,EPSILON4:()=>_m,EPSILON5:()=>ym,EPSILON6:()=>Tm,EPSILON7:()=>Cm,EPSILON8:()=>Mm,EPSILON9:()=>bm,PI_OVER_FOUR:()=>Pm,PI_OVER_SIX:()=>Hm,PI_OVER_TWO:()=>Um,TWO_PI:()=>km});var xm=.1,Bm=.01,Em=.001,_m=1e-4,ym=1e-5,Tm=1e-6,Cm=1e-7,Mm=1e-8,bm=1e-9,wm=1e-10,Im=1e-11,Sm=1e-12,Rm=1e-13,Fm=1e-14,Dm=1e-15,Lm=1e-16,Om=1e-17,vm=1e-18,Nm=1e-19,Gm=1e-20,Um=Math.PI/2,Pm=Math.PI/4,Hm=Math.PI/6,km=Math.PI*2;var kt=class{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(t,r){this.json=t,this.buffer=r}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t,r=H.UNSIGNED_INT,n=1){let s=this.json[t];return s&&Number.isFinite(s.byteOffset)?this._getTypedArrayFromBinary(t,r,n,1,s.byteOffset):s}getPropertyArray(t,r,n){let s=this.json[t];return s&&Number.isFinite(s.byteOffset)?("componentType"in s&&(r=dt.fromName(s.componentType)),this._getTypedArrayFromBinary(t,r,n,this.featuresLength,s.byteOffset)):this._getTypedArrayFromArray(t,r,s)}getProperty(t,r,n,s,o){let i=this.json[t];if(!i)return i;let a=this.getPropertyArray(t,r,n);if(n===1)return a[s];for(let f=0;f<n;++f)o[f]=a[n*s+f];return o}_getTypedArrayFromBinary(t,r,n,s,o){let i=this._cachedTypedArrays,a=i[t];return a||(a=dt.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+o,s*n),i[t]=a),a}_getTypedArrayFromArray(t,r,n){let s=this._cachedTypedArrays,o=s[t];return o||(o=dt.createTypedArray(r,n),s[t]=o),o}};var Jm={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zm={SCALAR:(e,t)=>e[t],VEC2:(e,t)=>[e[2*t+0],e[2*t+1]],VEC3:(e,t)=>[e[3*t+0],e[3*t+1],e[3*t+2]],VEC4:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT2:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT3:(e,t)=>[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]],MAT4:(e,t)=>[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]},Qm={SCALAR:(e,t,r)=>{t[r]=e},VEC2:(e,t,r)=>{t[2*r+0]=e[0],t[2*r+1]=e[1]},VEC3:(e,t,r)=>{t[3*r+0]=e[0],t[3*r+1]=e[1],t[3*r+2]=e[2]},VEC4:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT2:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT3:(e,t,r)=>{t[9*r+0]=e[0],t[9*r+1]=e[1],t[9*r+2]=e[2],t[9*r+3]=e[3],t[9*r+4]=e[4],t[9*r+5]=e[5],t[9*r+6]=e[6],t[9*r+7]=e[7],t[9*r+8]=e[8],t[9*r+9]=e[9]},MAT4:(e,t,r)=>{t[16*r+0]=e[0],t[16*r+1]=e[1],t[16*r+2]=e[2],t[16*r+3]=e[3],t[16*r+4]=e[4],t[16*r+5]=e[5],t[16*r+6]=e[6],t[16*r+7]=e[7],t[16*r+8]=e[8],t[16*r+9]=e[9],t[16*r+10]=e[10],t[16*r+11]=e[11],t[16*r+12]=e[12],t[16*r+13]=e[13],t[16*r+14]=e[14],t[16*r+15]=e[15]}};function Qh(e,t,r,n){let{componentType:s}=e;J(e.componentType);let o=typeof s=="string"?dt.fromName(s):s,i=Jm[e.type],a=zm[e.type],f=Qm[e.type];return r+=e.byteOffset,{values:dt.createTypedArray(o,t,r,i*n),type:o,size:i,unpacker:a,packer:f}}var te=e=>e!==void 0;function Vh(e,t,r){if(!t)return null;let n=e.getExtension("3DTILES_batch_table_hierarchy"),s=t.HIERARCHY;return s&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=s,n=s),n?Vm(n,r):null}function Vm(e,t){let r,n,s,o=e.instancesLength,i=e.classes,a=e.classIds,f=e.parentCounts,c=e.parentIds,h=o;te(a.byteOffset)&&(a.componentType=defaultValue(a.componentType,GL.UNSIGNED_SHORT),a.type=AttributeType.SCALAR,s=getBinaryAccessor(a),a=s.createArrayBufferView(t.buffer,t.byteOffset+a.byteOffset,o));let l;if(te(f))for(te(f.byteOffset)&&(f.componentType=defaultValue(f.componentType,GL.UNSIGNED_SHORT),f.type=AttributeType.SCALAR,s=getBinaryAccessor(f),f=s.createArrayBufferView(t.buffer,t.byteOffset+f.byteOffset,o)),l=new Uint16Array(o),h=0,r=0;r<o;++r)l[r]=h,h+=f[r];te(c)&&te(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,s=getBinaryAccessor(c),c=s.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,h));let u=i.length;for(r=0;r<u;++r){let p=i[r].length,E=i[r].instances,y=getBinaryProperties(p,E,t);i[r].instances=combine(y,E)}let d=new Array(u).fill(0),A=new Uint16Array(o);for(r=0;r<o;++r)n=a[r],A[r]=d[n],++d[n];let m={classes:i,classIds:a,classIndexes:A,parentCounts:f,parentIndexes:l,parentIds:c};return Xm(m),m}function vr(e,t,r){if(!e)return;let n=e.parentCounts;return e.parentIds?r(e,t):n>0?jm(e,t,r):Km(e,t,r)}function jm(e,t,r){let n=e.classIds,s=e.parentCounts,o=e.parentIds,i=e.parentIndexes,a=n.length,f=scratchVisited;f.length=Math.max(f.length,a);let c=++marker,h=scratchStack;for(h.length=0,h.push(t);h.length>0;){if(t=h.pop(),f[t]===c)continue;f[t]=c;let l=r(e,t);if(te(l))return l;let u=s[t],d=i[t];for(let A=0;A<u;++A){let m=o[d+A];m!==t&&h.push(m)}}return null}function Km(e,t,r){let n=!0;for(;n;){let s=r(e,t);if(te(s))return s;let o=e.parentIds[t];n=o!==t,t=o}throw new Error("traverseHierarchySingleParent")}function Xm(e){let t=[],n=e.classIds.length;for(let s=0;s<n;++s)jh(e,s,stack)}function jh(e,t,r){let n=e.parentCounts,s=e.parentIds,o=e.parentIndexes,a=e.classIds.length;if(!te(s))return;assert(t<a,`Parent index ${t} exceeds the total number of instances: ${a}`),assert(r.indexOf(t)===-1,"Circular dependency detected in the batch table hierarchy."),r.push(t);let f=te(n)?n[t]:1,c=te(n)?o[t]:t;for(let h=0;h<f;++h){let l=s[c+h];l!==t&&jh(e,l,r)}r.pop(t)}function Tt(e){return e!=null}var Ps=(e,t)=>e,Ym={HIERARCHY:!0,extensions:!0,extras:!0},ue=class{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(t,r,n,s={}){J(n>=0),this.json=t||{},this.binary=r,this.featureCount=n,this._extensions=this.json?.extensions||{},this._properties={};for(let o in this.json)Ym[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),s["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Vh(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,r){if(this._checkBatchId(t),J(typeof r=="string",r),this._hierarchy){let n=vr(this._hierarchy,t,(s,o)=>{let i=s.classIds[o];return s.classes[i].name===r});return Tt(n)}return!1}isExactClass(t,r){return J(typeof r=="string",r),this.getExactClassName(t)===r}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){let r=this._hierarchy.classIds[t];return this._hierarchy.classes[r].name}}hasProperty(t,r){return this._checkBatchId(t),J(typeof r=="string",r),Tt(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=Tt(r)?r:[],r.length=0;let n=Object.keys(this._properties);return r.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(t,r),r}getProperty(t,r){if(this._checkBatchId(t),J(typeof r=="string",r),this._binaryProperties){let s=this._binaryProperties[r];if(Tt(s))return this._getBinaryProperty(s,t)}let n=this._properties[r];if(Tt(n))return Ps(n[t],!0);if(this._hierarchy){let s=this._getHierarchyProperty(t,r);if(Tt(s))return s}}setProperty(t,r,n){let s=this.featureCount;if(this._checkBatchId(t),J(typeof r=="string",r),this._binaryProperties){let i=this._binaryProperties[r];if(i){this._setBinaryProperty(i,t,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,t,r,n))return;let o=this._properties[r];Tt(o)||(this._properties[r]=new Array(s),o=this._properties[r]),o[t]=Ps(n,!0)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,r){return t.unpack(t.typedArray,r)}_setBinaryProperty(t,r,n){t.pack(n,t.typedArray,r)}_initializeBinaryProperties(){let t=null;for(let r in this._properties){let n=this._properties[r],s=this._initializeBinaryProperty(r,n);s&&(t=t||{},t[r]=s)}return t}_initializeBinaryProperty(t,r){if("byteOffset"in r){let n=r;J(this.binary,`Property ${t} requires a batch table binary.`),J(n.type,`Property ${t} requires a type.`);let s=Qh(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:s.values,componentCount:s.size,unpack:s.unpacker,pack:s.packer}}return null}_hasPropertyInHierarchy(t,r){if(!this._hierarchy)return!1;let n=vr(this._hierarchy,t,(s,o)=>{let i=s.classIds[o],a=s.classes[i].instances;return Tt(a[r])});return Tt(n)}_getPropertyNamesInHierarchy(t,r){vr(this._hierarchy,t,(n,s)=>{let o=n.classIds[s],i=n.classes[o].instances;for(let a in i)i.hasOwnProperty(a)&&r.indexOf(a)===-1&&r.push(a)})}_getHierarchyProperty(t,r){return vr(this._hierarchy,t,(n,s)=>{let o=n.classIds[s],i=n.classes[o],a=n.classIndexes[s],f=i.instances[r];return Tt(f)?Tt(f.typedArray)?this._getBinaryProperty(f,a):Ps(f[a],!0):null})}_setHierarchyProperty(t,r,n,s){let o=vr(this._hierarchy,r,(i,a)=>{let f=i.classIds[a],c=i.classes[f],h=i.classIndexes[a],l=c.instances[n];return Tt(l)?(J(a===r,`Inherited property "${n}" is read-only.`),Tt(l.typedArray)?this._setBinaryProperty(l,h,s):l[h]=Ps(s,!0),!0):!1});return Tt(o)}};function Se(e,t,r=0){let n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=4,e.version=n.getUint32(r,!0),r+=4,e.byteLength=n.getUint32(r,!0),r+=4,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var Nr=4,Kh="b3dm tile in legacy format.";function Gr(e,t,r){let n=new DataView(t),s;e.header=e.header||{};let o=n.getUint32(r,!0);r+=Nr;let i=n.getUint32(r,!0);r+=Nr;let a=n.getUint32(r,!0);r+=Nr;let f=n.getUint32(r,!0);return r+=Nr,a>=570425344?(r-=Nr*2,s=o,a=i,f=0,o=0,i=0,console.warn(Kh)):f>=570425344&&(r-=Nr,s=a,a=o,f=i,o=0,i=0,console.warn(Kh)),e.header.featureTableJsonByteLength=o,e.header.featureTableBinaryByteLength=i,e.header.batchTableJsonByteLength=a,e.header.batchTableBinaryByteLength=f,e.header.batchLength=s,r}function Ur(e,t,r,n){return r=Zm(e,t,r,n),r=qm(e,t,r,n),r}function Zm(e,t,r,n){let{featureTableJsonByteLength:s,featureTableBinaryByteLength:o,batchLength:i}=e.header||{};if(e.featureTableJson={BATCH_LENGTH:i||0},s&&s>0){let a=si(t,r,s);e.featureTableJson=JSON.parse(a)}return r+=s||0,e.featureTableBinary=new Uint8Array(t,r,o),r+=o||0,r}function qm(e,t,r,n){let{batchTableJsonByteLength:s,batchTableBinaryByteLength:o}=e.header||{};if(s&&s>0){let i=si(t,r,s);e.batchTableJson=JSON.parse(i),r+=s,o&&o>0&&(e.batchTableBinary=new Uint8Array(t,r,o),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=o)}return r}function Ki(e,t,r){if(!t&&(!e||!e.batchIds||!r))return null;let{batchIds:n,isRGB565:s,pointCount:o=0}=e;if(n&&r){let i=new Uint8ClampedArray(o*3);for(let a=0;a<o;a++){let f=n[a],h=r.getProperty(f,"dimensions").map(l=>l*255);i[a*3]=h[0],i[a*3+1]=h[1],i[a*3+2]=h[2]}return{type:H.UNSIGNED_BYTE,value:i,size:3,normalized:!0}}if(t&&s){let i=new Uint8ClampedArray(o*3);for(let a=0;a<o;a++){let f=ui(t[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 t&&t.length===o*3?{type:H.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:H.UNSIGNED_BYTE,value:t||new Uint8ClampedArray,size:4,normalized:!0}}var Xh=new b;function Yh(e,t){if(!t)return null;if(e.isOctEncoded16P){let r=new Float32Array((e.pointsLength||0)*3);for(let n=0;n<(e.pointsLength||0);n++)di(t[n*2],t[n*2+1],Xh),Xh.toArray(r,n*3);return{type:H.FLOAT,size:2,value:r}}return{type:H.FLOAT,size:2,value:t}}function Zh(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,Wm(e,t)):{type:H.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function Wm(e,t){let r=new b,n=new Float32Array(e.pointCount*3);for(let s=0;s<e.pointCount;s++)r.set(t[s*3],t[s*3+1],t[s*3+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,s*3);return n}async function qh(e,t,r,n,s){r=Se(e,t,r),r=Gr(e,t,r),r=Ur(e,t,r,n),$m(e);let{featureTable:o,batchTable:i}=tp(e);return await op(e,o,i,n,s),ep(e,o,n),rp(e,o,i),np(e,o),r}function $m(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function tp(e){let t=new kt(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",H.FLOAT,3);let n=sp(e,t);return{featureTable:t,batchTable:n}}function ep(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.positions){if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",H.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){let n=t.getPropertyArray("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=(1<<16)-1,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",H.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=Zh(e,n,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function rp(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.colors){let n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",H.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",H.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",H.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=Ki(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",H.UNSIGNED_BYTE,4))}function np(e,t){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.normals){let r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",H.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",H.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=Yh(e,r)}}function sp(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",H.UNSIGNED_SHORT,1),e.batchIds)){let n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");let{batchTableJson:s,batchTableBinary:o}=e;r=new ue(s,o,n)}return r}async function op(e,t,r,n,s){let o,i,a,f=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];f&&(a=f.properties);let c=t.getExtension("3DTILES_draco_point_compression");if(c){i=c.properties;let l=c.byteOffset,u=c.byteLength;if(!i||!Number.isFinite(l)||!u)throw new Error("Draco properties, byteOffset, and byteLength must be defined");o=(e.featureTableBinary||[]).slice(l,l+u),e.hasPositions=Number.isFinite(i.POSITION),e.hasColors=Number.isFinite(i.RGB)||Number.isFinite(i.RGBA),e.hasNormals=Number.isFinite(i.NORMAL),e.hasBatchIds=Number.isFinite(i.BATCH_ID),e.isTranslucent=Number.isFinite(i.RGBA)}if(!o)return!0;let h={buffer:o,properties:{...i,...a},featureTableProperties:i,batchTableProperties:a,dequantizeInShader:!1};return await ip(e,h,n,s)}async function ip(e,t,r,n){if(!n)return;let s={...r,draco:{...r?.draco,extraAttributes:t.batchTableProperties||{}}};delete s["3d-tiles"];let o=await Pt(t.buffer,Is,s,n),i=o.attributes.POSITION&&o.attributes.POSITION.value,a=o.attributes.COLOR_0&&o.attributes.COLOR_0.value,f=o.attributes.NORMAL&&o.attributes.NORMAL.value,c=o.attributes.BATCH_ID&&o.attributes.BATCH_ID.value,h=i&&o.attributes.POSITION.value.quantization,l=f&&o.attributes.NORMAL.value.quantization;if(h){let d=o.POSITION.data.quantization,A=d.range;e.quantizedVolumeScale=new b(A,A,A),e.quantizedVolumeOffset=new b(d.minValues),e.quantizedRange=(1<<d.quantizationBits)-1,e.isQuantizedDraco=!0}l&&(e.octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);let u={};if(t.batchTableProperties)for(let d of Object.keys(t.batchTableProperties))o.attributes[d]&&o.attributes[d].value&&(u[d.toLowerCase()]=o.attributes[d].value);e.attributes={positions:i,colors:Ki(e,a,void 0),normals:f,batchIds:c,...u}}var ea={};ut(ea,{decode:()=>Qp,name:()=>zp});var Wh="4.2.2";var ap=globalThis.loaders?.parseImageNode,Xi=typeof Image<"u",Yi=typeof ImageBitmap<"u",cp=Boolean(ap),Zi=Et?!0:cp;function $h(e){switch(e){case"auto":return Yi||Xi||Zi;case"imagebitmap":return Yi;case"image":return Xi;case"data":return Zi;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function tl(){if(Yi)return"imagebitmap";if(Xi)return"image";if(Zi)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function el(e){let t=fp(e);if(!t)throw new Error("Not an image");return t}function Ln(e){switch(el(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function fp(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var hp=/^data:image\/svg\+xml/,lp=/\.svg((\?|#).*)?$/;function Hs(e){return e&&(hp.test(e)||lp.test(e))}function rl(e,t){if(Hs(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return qi(e,t)}function qi(e,t){if(Hs(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function ks(e,t,r){let n=rl(e,r),s=self.URL||self.webkitURL,o=typeof n!="string"&&s.createObjectURL(n);try{return await up(o||n,t)}finally{o&&s.revokeObjectURL(o)}}async function up(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,s)=>{try{r.onload=()=>n(r),r.onerror=o=>{let i=o instanceof Error?o.message:"error";s(new Error(i))}}catch(o){s(o)}})}var dp={},nl=!0;async function sl(e,t,r){let n;Hs(r)?n=await ks(e,t,r):n=qi(e,r);let s=t&&t.imagebitmap;return await Ap(n,s)}async function Ap(e,t=null){if((mp(t)||!nl)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),nl=!1}return await createImageBitmap(e)}function mp(e){for(let t in e||dp)return!1;return!0}function ol(e){return!Bp(e,"ftyp",4)||!(e[8]&96)?null:pp(e)}function pp(e){switch(gp(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function gp(e,t,r){return String.fromCharCode(...e.slice(t,r))}function xp(e){return[...e].map(t=>t.charCodeAt(0))}function Bp(e,t,r=0){let n=xp(t);for(let s=0;s<n.length;++s)if(n[s]!==e[s+r])return!1;return!0}var ee=!1,On=!0;function Ke(e){let t=vn(e);return _p(t)||Cp(t)||yp(t)||Tp(t)||Ep(t)}function Ep(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=ol(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function _p(e){let t=vn(e);return t.byteLength>=24&&t.getUint32(0,ee)===2303741511?{mimeType:"image/png",width:t.getUint32(16,ee),height:t.getUint32(20,ee)}:null}function yp(e){let t=vn(e);return t.byteLength>=10&&t.getUint32(0,ee)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,On),height:t.getUint16(8,On)}:null}function Tp(e){let t=vn(e);return t.byteLength>=14&&t.getUint16(0,ee)===16973&&t.getUint32(2,On)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,On),height:t.getUint32(22,On)}:null}function Cp(e){let t=vn(e);if(!(t.byteLength>=3&&t.getUint16(0,ee)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=Mp(),o=2;for(;o+9<t.byteLength;){let i=t.getUint16(o,ee);if(s.has(i))return{mimeType:"image/jpeg",height:t.getUint16(o+5,ee),width:t.getUint16(o+7,ee)};if(!n.has(i))return null;o+=2,o+=t.getUint16(o,ee)}return null}function Mp(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function vn(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function il(e,t){let{mimeType:r}=Ke(e)||{},n=globalThis.loaders?.parseImageNode;return J(n),await n(e,r)}async function al(e,t,r){t=t||{};let s=(t.image||{}).type||"auto",{url:o}=r||{},i=bp(s),a;switch(i){case"imagebitmap":a=await sl(e,t,o);break;case"image":a=await ks(e,t,o);break;case"data":a=await il(e,t);break;default:J(!1)}return s==="data"&&(a=Ln(a)),a}function bp(e){switch(e){case"auto":case"data":return tl();default:return $h(e),e}}var wp=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],Ip=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],Sp={image:{type:"auto",decode:!0}},Wi={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:Wh,mimeTypes:Ip,extensions:wp,parse:al,tests:[e=>Boolean(Ke(new DataView(e)))],options:Sp};var $i={};function ta(e){if($i[e]===void 0){let t=Et?Fp(e):Rp(e);$i[e]=t}return $i[e]}function Rp(e){let t=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||t,n=globalThis.loaders?.parseImageNode;return Boolean(n)&&r.includes(e)}function Fp(e){switch(e){case"image/avif":case"image/webp":return Dp(e);default:return!0}}function Dp(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}function ot(e,t){if(!e)throw new Error(t||"assert failed: gltf")}var Js={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zs={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var Lp=1.33,cl=["SCALAR","VEC2","VEC3","VEC4"],Op=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],vp=new Map(Op),Np={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Gp={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Up={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Qs(e){return cl[e-1]||cl[0]}function Pr(e){let t=vp.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Hr(e,t){let r=Up[e.componentType],n=Np[e.type],s=Gp[e.componentType],o=e.count*n,i=e.count*n*s;ot(i>=0&&i<=t.byteLength);let a=zs[e.componentType],f=Js[e.type];return{ArrayType:r,length:o,byteLength:i,componentByteSize:a,numberOfComponentsInElement:f}}function Nn(e){let{images:t,bufferViews:r}=e;t=t||[],r=r||[];let n=t.map(i=>i.bufferView);r=r.filter(i=>!n.includes(i));let s=r.reduce((i,a)=>i+a.byteLength,0),o=t.reduce((i,a)=>{let{width:f,height:c}=a.image;return i+f*c},0);return s+Math.ceil(4*o*Lp)}function fl(e,t,r){let n=e.bufferViews[r];ot(n);let s=n.buffer,o=t[s];ot(o);let i=(n.byteOffset||0)+o.byteOffset;return new Uint8Array(o.arrayBuffer,i,n.byteLength)}function hl(e,t,r){let n=typeof r=="number"?e.accessors?.[r]:r;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(r)}`);let s=e.bufferViews?.[n.bufferView||0];if(!s)throw new Error(`No gltf buffer view for accessor ${s}`);let{arrayBuffer:o,byteOffset:i}=t[s.buffer],a=(i||0)+(n.byteOffset||0)+(s.byteOffset||0),{ArrayType:f,length:c,componentByteSize:h,numberOfComponentsInElement:l}=Hr(n,s),u=h*l,d=s.byteStride||u;if(typeof s.byteStride>"u"||s.byteStride===u)return new f(o,a,c);let A=new f(c);for(let m=0;m<n.count;m++){let p=new f(o,a+m*d,l);A.set(p,m*l)}return A}function Pp(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var K=class{gltf;sourceBuffers;byteLength;constructor(t){this.gltf={json:t?.json||Pp(),buffers:t?.buffers||[],images:t?.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(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}hasExtension(t){let r=this.getUsedExtensions().find(s=>s===t),n=this.getRequiredExtensions().find(s=>s===t);return typeof r=="string"||typeof n=="string"}getExtension(t){let r=this.getUsedExtensions().find(s=>s===t),n=this.json.extensions||{};return r?n[t]:null}getRequiredExtension(t){return this.getRequiredExtensions().find(n=>n===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(t,r){return(t.extensions||{})[r]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,r){if(typeof r=="object")return r;let n=this.json[t]&&this.json[t][r];if(!n)throw new Error(`glTF file error: Could not find ${t}[${r}]`);return n}getTypedArrayForBufferView(t){t=this.getBufferView(t);let r=t.buffer,n=this.gltf.buffers[r];ot(n);let s=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,s,t.byteLength)}getTypedArrayForAccessor(t){let r=this.getAccessor(t);return hl(this.gltf.json,this.gltf.buffers,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);let r=this.getBufferView(t.bufferView),s=this.getBuffer(r.buffer).data,o=r.byteOffset||0;return new Uint8Array(s,o,r.byteLength)}addApplicationData(t,r){return this.json[t]=r,this}addExtraData(t,r){return this.json.extras=this.json.extras||{},this.json.extras[t]=r,this}addObjectExtension(t,r,n){return t.extensions=t.extensions||{},t.extensions[r]=n,this.registerUsedExtension(r),this}setObjectExtension(t,r,n){let s=t.extensions||{};s[r]=n}removeObjectExtension(t,r){let n=t?.extensions||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let s=this.json.extensionsRemoved;s.includes(r)||s.push(r)}delete n[r]}addExtension(t,r={}){return ot(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return ot(r),this.addExtension(t,r),this.registerRequiredExtension(t),r}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===t)||this.json.extensionsRequired.push(t)}removeExtension(t){if(this.json.extensions?.[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let r=this.json.extensionsRemoved;r.includes(t)||r.push(t)}this.json.extensions&&delete this.json.extensions[t],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t)}setDefaultScene(t){this.json.scene=t}addScene(t){let{nodeIndices:r}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(t){let{meshIndex:r,matrix:n}=t;this.json.nodes=this.json.nodes||[];let s={mesh:r};return n&&(s.matrix=n),this.json.nodes.push(s),this.json.nodes.length-1}addMesh(t){let{attributes:r,indices:n,material:s,mode:o=4}=t,a={primitives:[{attributes:this._addAttributes(r),mode:o}]};if(n){let f=this._addIndices(n);a.primitives[0].indices=f}return Number.isFinite(s)&&(a.primitives[0].material=s),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(t){let n={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(t,r){let n=Ke(t),s=r||n?.mimeType,i={bufferView:this.addBufferView(t),mimeType:s};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}addBufferView(t,r=0,n=this.byteLength){let s=t.byteLength;ot(Number.isFinite(s)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let o={buffer:r,byteOffset:n,byteLength:s};return this.byteLength+=bt(s,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(o),this.json.bufferViews.length-1}addAccessor(t,r){let n={bufferView:t,type:Qs(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(t,r={size:3}){let n=this.addBufferView(t),s={min:r.min,max:r.max};(!s.min||!s.max)&&(s=this._getAccessorMinMax(t,r.size));let o={size:r.size,componentType:Pr(t),count:Math.round(t.length/r.size),min:s.min,max:s.max};return this.addAccessor(n,Object.assign(o,r))}addTexture(t){let{imageIndex:r}=t,n={source:r};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){this.gltf.buffers=[];let t=this.byteLength,r=new ArrayBuffer(t),n=new Uint8Array(r),s=0;for(let o of this.sourceBuffers||[])s=Ko(o,n,s);this.json?.buffers?.[0]?this.json.buffers[0].byteLength=t:this.json.buffers=[{byteLength:t}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(t,r){let n=!0;for(;n;){let s=t.indexOf(r);s>-1?t.splice(s,1):n=!1}}_addAttributes(t={}){let r={};for(let n in t){let s=t[n],o=this._getGltfAttributeName(n),i=this.addBinaryBuffer(s.value,s);r[o]=i}return r}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.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 t}}_getAccessorMinMax(t,r){let n={min:null,max:null};if(t.length<r)return n;n.min=[],n.max=[];let s=t.subarray(0,r);for(let o of s)n.min.push(o),n.max.push(o);for(let o=r;o<t.length;o+=r)for(let i=0;i<r;i++)n.min[0+i]=Math.min(n.min[0+i],t[o+i]),n.max[0+i]=Math.max(n.max[0+i],t[o+i]);return n}};function ll(e){return(e%1+1)%1}var ul={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},Hp={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},dl={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function Gn(e,t){return dl[t]*ul[e]}function kr(e,t,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let s=e.getTypedArrayForBufferView(t),o=Jr(s,"SCALAR",r,n+1);return o instanceof BigInt64Array||o instanceof BigUint64Array?null:o}function Jr(e,t,r,n=1){let s=ul[t],o=Hp[r],i=dl[r],a=n*s,f=a*i,c=e.buffer,h=e.byteOffset;return h%i!==0&&(c=new Uint8Array(c).slice(h,h+f).buffer,h=0),new o(c,h,a)}function zr(e,t,r){let n=`TEXCOORD_${t.texCoord||0}`,s=r.attributes[n],o=e.getTypedArrayForAccessor(s),i=e.gltf.json,a=t.index,f=i.textures?.[a]?.source;if(typeof f<"u"){let c=i.images?.[f]?.mimeType,h=e.gltf.images?.[f];if(h&&typeof h.width<"u"){let l=[];for(let u=0;u<o.length;u+=2){let d=kp(h,c,o,u,t.channels);l.push(d)}return l}}return[]}function Vs(e,t,r,n,s){if(!r?.length)return;let o=[];for(let h of r){let l=n.findIndex(u=>u===h);l===-1&&(l=n.push(h)-1),o.push(l)}let i=new Uint32Array(o),a=e.gltf.buffers.push({arrayBuffer:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength})-1,f=e.addBufferView(i,a,0),c=e.addAccessor(f,{size:1,componentType:Pr(i),count:i.length});s.attributes[t]=c}function kp(e,t,r,n,s=[0]){let o={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;t&&(t.indexOf("image/jpeg")!==-1||t.indexOf("image/png")!==-1)&&(f=4);let c=Jp(i,a,e,f),h=0;for(let l of s){let u=typeof l=="number"?Object.values(o)[l]:o[l],d=c+u.offset,A=Ln(e);if(A.data.length<=d)throw new Error(`${A.data.length} <= ${d}`);let m=A.data[d];h|=m<<u.shift}return h}function Jp(e,t,r,n=1){let s=r.width,o=ll(e)*(s-1),i=Math.round(o),a=r.height,f=ll(t)*(a-1),c=Math.round(f),h=r.components?r.components:n;return(c*s+i)*h}function js(e,t,r,n,s){let o=[];for(let i=0;i<t;i++){let a=r[i],f=r[i+1]-r[i];if(f+a>n)break;let c=a/s,h=f/s;o.push(e.slice(c,c+h))}return o}function Ks(e,t,r){let n=[];for(let s=0;s<t;s++){let o=s*r;n.push(e.slice(o,o+r))}return n}function Xs(e,t,r,n){if(r)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){let s=[],o=new TextDecoder("utf8"),i=0;for(let a=0;a<e;a++){let f=n[a+1]-n[a];if(f+i<=t.length){let c=t.subarray(i,f+i),h=o.decode(c);s.push(h),i+=f}}return s}return[]}var Al="EXT_mesh_features",zp=Al;async function Qp(e,t){let r=new K(e);Vp(r,t)}function Vp(e,t){let r=e.gltf.json;if(r.meshes)for(let n of r.meshes)for(let s of n.primitives)jp(e,s,t)}function jp(e,t,r){if(!r?.gltf?.loadBuffers)return;let s=t.extensions?.[Al]?.featureIds;if(s)for(let o of s){let i;if(typeof o.attribute<"u"){let a=`_FEATURE_ID_${o.attribute}`,f=t.attributes[a];i=e.getTypedArrayForAccessor(f)}else typeof o.texture<"u"&&r?.gltf?.loadImages?i=zr(e,o.texture,t):i=[];o.data=i}}var sa={};ut(sa,{decode:()=>Xp,name:()=>Kp});var ra="EXT_structural_metadata",Kp=ra;async function Xp(e,t){let r=new K(e);Yp(r,t)}function Yp(e,t){if(!t.gltf?.loadBuffers)return;let r=e.getExtension(ra);r&&(t.gltf?.loadImages&&Zp(e,r),qp(e,r))}function Zp(e,t){let r=t.propertyTextures,n=e.gltf.json;if(r&&n.meshes)for(let s of n.meshes)for(let o of s.primitives)$p(e,r,o,t)}function qp(e,t){let r=t.schema;if(!r)return;let n=r.classes,s=t.propertyTables;if(n&&s)for(let o in n){let i=Wp(s,o);i&&eg(e,r,i)}}function Wp(e,t){for(let r of e)if(r.class===t)return r;return null}function $p(e,t,r,n){if(!t)return;let o=r.extensions?.[ra]?.propertyTextures;if(o)for(let i of o){let a=t[i];tg(e,a,r,n)}}function tg(e,t,r,n){if(!t.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let s=t.class;for(let o in t.properties){let i=`${s}_${o}`,a=t.properties?.[o];if(!a)continue;a.data||(a.data=[]);let f=a.data,c=zr(e,a,r);c!==null&&(Vs(e,i,c,f,r),a.data=f,n.dataAttributeNames.push(i))}}function eg(e,t,r){let n=t.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let s=r.count;for(let o in n.properties){let i=n.properties[o],a=r.properties?.[o];if(a){let f=rg(e,t,i,s,a);a.data=f}}}function rg(e,t,r,n,s){let o=[],i=s.values,a=e.getTypedArrayForBufferView(i),f=ng(e,r,s,n),c=sg(e,s,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{o=og(r,n,a,f);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{o=Xs(n,a,f,c);break}case"ENUM":{o=ig(t,r,n,a,f);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return o}function ng(e,t,r,n){return t.array&&typeof t.count>"u"&&typeof r.arrayOffsets<"u"?kr(e,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function sg(e,t,r){return typeof t.stringOffsets<"u"?kr(e,t.stringOffsets,t.stringOffsetType||"UINT32",r):null}function og(e,t,r,n){let s=e.array,o=e.count,i=Gn(e.type,e.componentType),a=r.byteLength/i,f;return e.componentType?f=Jr(r,e.type,e.componentType,a):f=r,s?n?js(f,t,n,r.length,i):o?Ks(f,t,o):[]:f}function ig(e,t,r,n,s){let o=t.enumType;if(!o)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let i=e.enums?.[o];if(!i)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${o}`);let a=i.valueType||"UINT16",f=Gn(t.type,a),c=n.byteLength/f,h=Jr(n,t.type,a,c);if(h||(h=n),t.array){if(s)return ag({valuesData:h,numberOfElements:r,arrayOffsets:s,valuesDataBytesLength:n.length,elementSize:f,enumEntry:i});let l=t.count;return l?cg(h,r,l,i):[]}return na(h,0,r,i)}function ag(e){let{valuesData:t,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:s,elementSize:o,enumEntry:i}=e,a=[];for(let f=0;f<r;f++){let c=n[f],h=n[f+1]-n[f];if(h+c>s)break;let l=c/o,u=h/o,d=na(t,l,u,i);a.push(d)}return a}function cg(e,t,r,n){let s=[];for(let o=0;o<t;o++){let i=r*o,a=na(e,i,r,n);s.push(a)}return s}function na(e,t,r,n){let s=[];for(let o=0;o<r;o++)if(e instanceof BigInt64Array||e instanceof BigUint64Array)s.push("");else{let i=e[t+o],a=fg(n,i);a?s.push(a.name):s.push("")}return s}function fg(e,t){for(let r of e.values)if(r.value===t)return r;return null}var oa={};ut(oa,{decode:()=>lg,name:()=>hg});var ml="EXT_feature_metadata",hg=ml;async function lg(e,t){let r=new K(e);ug(r,t)}function ug(e,t){if(!t.gltf?.loadBuffers)return;let r=e.getExtension(ml);r&&(t.gltf?.loadImages&&dg(e,r),Ag(e,r))}function dg(e,t){let r=t.schema;if(!r)return;let n=r.classes,{featureTextures:s}=t;if(n&&s)for(let o in n){let i=n[o],a=pg(s,o);a&&xg(e,a,i)}}function Ag(e,t){let r=t.schema;if(!r)return;let n=r.classes,s=t.featureTables;if(n&&s)for(let o in n){let i=mg(s,o);i&&gg(e,r,i)}}function mg(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function pg(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function gg(e,t,r){if(!r.class)return;let n=t.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let s=r.count;for(let o in n.properties){let i=n.properties[o],a=r.properties?.[o];if(a){let f=Bg(e,t,i,s,a);a.data=f}}}function xg(e,t,r){let n=t.class;for(let s in r.properties){let o=t?.properties?.[s];if(o){let i=Cg(e,o,n);o.data=i}}}function Bg(e,t,r,n,s){let o=[],i=s.bufferView,a=e.getTypedArrayForBufferView(i),f=Eg(e,r,s,n),c=_g(e,r,s,n);return r.type==="STRING"||r.componentType==="STRING"?o=Xs(n,a,f,c):yg(r)&&(o=Tg(r,n,a,f)),o}function Eg(e,t,r,n){return t.type==="ARRAY"&&typeof t.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?kr(e,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function _g(e,t,r,n){return typeof r.stringOffsetBufferView<"u"?kr(e,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function yg(e){let t=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return t.includes(e.type)||typeof e.componentType<"u"&&t.includes(e.componentType)}function Tg(e,t,r,n){let s=e.type==="ARRAY",o=e.componentCount,i="SCALAR",a=e.componentType||e.type,f=Gn(i,a),c=r.byteLength/f,h=Jr(r,i,a,c);return s?n?js(h,t,n,r.length,f):o?Ks(h,t,o):[]:h}function Cg(e,t,r){let n=e.gltf.json;if(!n.meshes)return[];let s=[];for(let o of n.meshes)for(let i of o.primitives)Mg(e,r,t,s,i);return s}function Mg(e,t,r,n,s){let o={channels:r.channels,...r.texture},i=zr(e,o,s);i&&Vs(e,t,i,n,s)}var pl="4.2.2";var gl="4.2.2";var Ys={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},xl;async function aa(e){gn(e.modules);let t=Qo("basis");return t||(xl||=bg(e),await xl)}async function bg(e){let t=null,r=null;return[t,r]=await Promise.all([await qt(Ys.TRANSCODER,"textures",e),await qt(Ys.TRANSCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await wg(t,r)}function wg(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(s=>{let{BasisFile:o,initializeBasis:i}=s;i(),n({BasisFile:o})})})}var ia;async function ca(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(ia=ia||Ig(e),await ia)}async function Ig(e){let t=null,r=null;return[t,r]=await Promise.all([await qt(Ys.ENCODER,"textures",e),await qt(Ys.ENCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await Sg(t,r)}function Sg(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(s=>{let{BasisFile:o,KTX2File:i,initializeBasis:a,BasisEncoder:f}=s;a(),n({BasisFile:o,KTX2File:i,BasisEncoder:f})})})}var Xe={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 Rg=["","WEBKIT_","MOZ_"],Bl={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"},Zs=null;function El(e){if(!Zs){e=e||Fg()||void 0,Zs=new Set;for(let t of Rg)for(let r in Bl)if(e&&e.getExtension(`${t}${r}`)){let n=Bl[r];Zs.add(n)}}return Zs}function Fg(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var N3=new Uint8Array([0]);var _l,yl,Tl,Cl,Ml,bl,wl,Il;(function(e){e[e.NONE=0]="NONE",e[e.BASISLZ=1]="BASISLZ",e[e.ZSTD=2]="ZSTD",e[e.ZLIB=3]="ZLIB"})(_l||(_l={})),function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(yl||(yl={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(Tl||(Tl={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(Cl||(Cl={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(Ml||(Ml={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(bl||(bl={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(wl||(wl={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(Il||(Il={}));var It=[171,75,84,88,32,50,48,187,13,10,26,10];function Sl(e){let t=new Uint8Array(e);return!(t.byteLength<It.length||t[0]!==It[0]||t[1]!==It[1]||t[2]!==It[2]||t[3]!==It[3]||t[4]!==It[4]||t[5]!==It[5]||t[6]!==It[6]||t[7]!==It[7]||t[8]!==It[8]||t[9]!==It[9]||t[10]!==It[10]||t[11]!==It[11])}var Dg={etc1:{basisFormat:0,compressed:!0,format:Xe.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Xe.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Xe.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:Xe.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Xe.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Xe.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 ha(e,t){if(t.basis.containerFormat==="auto"){if(Sl(e)){let n=await ca(t);return Rl(n.KTX2File,e,t)}let{BasisFile:r}=await aa(t);return fa(r,e,t)}switch(t.basis.module){case"encoder":let r=await ca(t);switch(t.basis.containerFormat){case"ktx2":return Rl(r.KTX2File,e,t);case"basis":default:return fa(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:n}=await aa(t);return fa(n,e,t)}}function fa(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let s=n.getNumImages(),o=[];for(let i=0;i<s;i++){let a=n.getNumLevels(i),f=[];for(let c=0;c<a;c++)f.push(Lg(n,i,c,r));o.push(f)}return o}finally{n.close(),n.delete()}}function Lg(e,t,r,n){let s=e.getImageWidth(t,r),o=e.getImageHeight(t,r),i=e.getHasAlpha(),{compressed:a,format:f,basisFormat:c}=Fl(n,i),h=e.getImageTranscodedSizeInBytes(t,r,c),l=new Uint8Array(h);if(!e.transcodeImage(l,t,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:s,height:o,data:l,compressed:a,format:f,hasAlpha:i}}function Rl(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let s=n.getLevels(),o=[];for(let i=0;i<s;i++){o.push(Og(n,i,r));break}return[o]}finally{n.close(),n.delete()}}function Og(e,t,r){let{alphaFlag:n,height:s,width:o}=e.getImageLevelInfo(t,0,0),{compressed:i,format:a,basisFormat:f}=Fl(r,n),c=e.getImageTranscodedSizeInBytes(t,0,0,f),h=new Uint8Array(c);if(!e.transcodeImage(h,t,0,0,f,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:s,data:h,compressed:i,levelSize:c,hasAlpha:n,format:a}}function Fl(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=qs()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),Dg[r]}function qs(){let e=El();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}var Dl={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:gl,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"}}},la={...Dl,parse:ha};var Qr=!0,Ll=1735152710,Aa=12,Ws=8,vg=1313821514,Ng=5130562,Gg=0,Ug=0,Pg=1;function Hg(e,t=0){return`${String.fromCharCode(e.getUint8(t+0))}${String.fromCharCode(e.getUint8(t+1))}${String.fromCharCode(e.getUint8(t+2))}${String.fromCharCode(e.getUint8(t+3))}`}function Ol(e,t=0,r={}){let n=new DataView(e),{magic:s=Ll}=r,o=n.getUint32(t,!1);return o===s||o===Ll}function vl(e,t,r=0,n={}){let s=new DataView(t),o=Hg(s,r+0),i=s.getUint32(r+4,Qr),a=s.getUint32(r+8,Qr);switch(Object.assign(e,{header:{byteOffset:r,byteLength:a,hasBinChunk:!1},type:o,version:i,json:{},binChunks:[]}),r+=Aa,e.version){case 1:return kg(e,s,r);case 2:return Jg(e,s,r,n={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function kg(e,t,r){J(e.header.byteLength>Aa+Ws);let n=t.getUint32(r+0,Qr),s=t.getUint32(r+4,Qr);return r+=Ws,J(s===Gg),ua(e,t,r,n),r+=n,r+=da(e,t,r,e.header.byteLength),r}function Jg(e,t,r,n){return J(e.header.byteLength>Aa+Ws),zg(e,t,r,n),r+e.header.byteLength}function zg(e,t,r,n){for(;r+8<=e.header.byteLength;){let s=t.getUint32(r+0,Qr),o=t.getUint32(r+4,Qr);switch(r+=Ws,o){case vg:ua(e,t,r,s);break;case Ng:da(e,t,r,s);break;case Ug:n.strict||ua(e,t,r,s);break;case Pg:n.strict||da(e,t,r,s);break;default:break}r+=bt(s,4)}return r}function ua(e,t,r,n){let s=new Uint8Array(t.buffer,r,n),i=new TextDecoder("utf8").decode(s);return e.json=JSON.parse(i),bt(n,4)}function da(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),bt(n,4)}function ma(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;let n=t.baseUri||t.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${e}`);return n.substr(0,n.lastIndexOf("/")+1)+e}var ga={};ut(ga,{decode:()=>ex,name:()=>tx});var Qg="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKC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a6QFMAFREMAEMMMFBCUNMIT9tBB",jg=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]),Kg=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]),Xg={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Yg={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function Nl(e,t,r,n,s,o="NONE"){let i=await Zg();$g(i,i.exports[Yg[s]],e,t,r,n,i.exports[Xg[o||"NONE"]])}var pa;async function Zg(){return pa||(pa=qg()),pa}async function qg(){let e=Qg;WebAssembly.validate(jg)&&(e=Vg,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate(Wg(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function Wg(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n){let s=e.charCodeAt(n);t[n]=s>96?s-71:s>64?s-65:s>47?s+4:s>46?63:62}let r=0;for(let n=0;n<e.length;++n)t[r++]=t[n]<60?Kg[t[n]]:(t[n]-60)*64+t[++n];return t.buffer.slice(0,r)}function $g(e,t,r,n,s,o,i){let a=e.exports.sbrk,f=n+3&-4,c=a(f*s),h=a(o.length),l=new Uint8Array(e.exports.memory.buffer);l.set(o,h);let u=t(c,n,s,h,o.length);if(u===0&&i&&i(c,f,s),r.set(l.subarray(c,c+n*s)),a(c-a(0)),u!==0)throw new Error(`Malformed buffer data: ${u}`)}var $s="EXT_meshopt_compression",tx=$s;async function ex(e,t){let r=new K(e);if(!t?.gltf?.decompressMeshes||!t.gltf?.loadBuffers)return;let n=[];for(let s of e.json.bufferViews||[])n.push(rx(r,s));await Promise.all(n),r.removeExtension($s)}async function rx(e,t){let r=e.getObjectExtension(t,$s);if(r){let{byteOffset:n=0,byteLength:s=0,byteStride:o,count:i,mode:a,filter:f="NONE",buffer:c}=r,h=e.gltf.buffers[c],l=new Uint8Array(h.arrayBuffer,h.byteOffset+n,s),u=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);await Nl(u,i,o,l,a,f),e.removeObjectExtension(t,$s)}}var xa={};ut(xa,{name:()=>nx,preprocess:()=>sx});var Vr="EXT_texture_webp",nx=Vr;function sx(e,t){let r=new K(e);if(!ta("image/webp")){if(r.getRequiredExtensions().includes(Vr))throw new Error(`gltf: Required extension ${Vr} not supported by browser`);return}let{json:n}=r;for(let s of n.textures||[]){let o=r.getObjectExtension(s,Vr);o&&(s.source=o.source),r.removeObjectExtension(s,Vr)}r.removeExtension(Vr)}var Ba={};ut(Ba,{name:()=>ox,preprocess:()=>ix});var to="KHR_texture_basisu",ox=to;function ix(e,t){let r=new K(e),{json:n}=r;for(let s of n.textures||[]){let o=r.getObjectExtension(s,to);o&&(s.source=o.source,r.removeObjectExtension(s,to))}r.removeExtension(to)}var _a={};ut(_a,{decode:()=>lx,encode:()=>ux,name:()=>fx,preprocess:()=>hx});function Gl(e){let t={};for(let r in e){let n=e[r];if(r!=="indices"){let s=Ea(n);t[r]=s}}return t}function Ea(e){let{buffer:t,size:r,count:n}=ax(e);return{value:t,size:r,byteOffset:0,count:n,type:Qs(r),componentType:Pr(t)}}function ax(e){let t=e,r=1,n=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=cx(t,Float32Array)),n=t.length/r),{buffer:t,size:r,count:n}}function cx(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Re="KHR_draco_mesh_compression",fx=Re;function hx(e,t,r){let n=new K(e);for(let s of Ul(n))n.getObjectExtension(s,Re)}async function lx(e,t,r){if(!t?.gltf?.decompressMeshes)return;let n=new K(e),s=[];for(let o of Ul(n))n.getObjectExtension(o,Re)&&s.push(dx(n,o,t,r));await Promise.all(s),n.removeExtension(Re)}function ux(e,t={}){let r=new K(e);for(let n of r.json.meshes||[])Ax(n,t),r.addRequiredExtension(Re)}async function dx(e,t,r,n){let s=e.getObjectExtension(t,Re);if(!s)return;let o=e.getTypedArrayForBufferView(s.bufferView),i=Je(o.buffer,o.byteOffset),a={...r};delete a["3d-tiles"];let f=await Pt(i,Is,a,n),c=Gl(f.attributes);for(let[h,l]of Object.entries(c))if(h in t.attributes){let u=t.attributes[h],d=e.getAccessor(u);d?.min&&d?.max&&(l.min=d.min,l.max=d.max)}t.attributes=c,f.indices&&(t.indices=Ea(f.indices)),e.removeObjectExtension(t,Re),mx(t)}function Ax(e,t,r=4,n,s){if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let o=n.DracoWriter.encodeSync({attributes:e}),i=s?.parseSync?.({attributes:e}),a=n._addFauxAttributes(i.attributes),f=n.addBufferView(o);return{primitives:[{attributes:a,mode:r,extensions:{[Re]:{bufferView:f,attributes:a}}}]}}function mx(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*Ul(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var ya={};ut(ya,{decode:()=>Bx,name:()=>px});var ro="KHR_texture_transform",px=ro,eo=new fe,gx=new he,xx=new he;async function Bx(e,t){if(!new K(e).hasExtension(ro)||!t.gltf?.loadBuffers)return;let s=e.json.materials||[];for(let o=0;o<s.length;o++)Ex(o,e)}function Ex(e,t){let r=t.json.materials?.[e],n=[r?.pbrMetallicRoughness?.baseColorTexture,r?.emissiveTexture,r?.normalTexture,r?.occlusionTexture,r?.pbrMetallicRoughness?.metallicRoughnessTexture],s=[];for(let o of n)o&&o?.extensions?.[ro]&&_x(t,e,o,s)}function _x(e,t,r,n){let s=yx(r,n);if(!s)return;let o=e.json.meshes||[];for(let i of o)for(let a of i.primitives){let f=a.material;Number.isFinite(f)&&t===f&&Tx(e,a,s)}}function yx(e,t){let r=e.extensions?.[ro],{texCoord:n=0}=e,{texCoord:s=n}=r;if(!(t.findIndex(([i,a])=>i===n&&a===s)!==-1)){let i=bx(r);return n!==s&&(e.texCoord=s),t.push([n,s]),{originalTexCoord:n,texCoord:s,matrix:i}}return null}function Tx(e,t,r){let{originalTexCoord:n,texCoord:s,matrix:o}=r,i=t.attributes[`TEXCOORD_${n}`];if(Number.isFinite(i)){let a=e.json.accessors?.[i];if(a&&a.bufferView){let f=e.json.bufferViews?.[a.bufferView];if(f){let{arrayBuffer:c,byteOffset:h}=e.buffers[f.buffer],l=(h||0)+(a.byteOffset||0)+(f.byteOffset||0),{ArrayType:u,length:d}=Hr(a,f),A=zs[a.componentType],m=Js[a.type],p=f.byteStride||A*m,E=new Float32Array(d);for(let y=0;y<a.count;y++){let C=new u(c,l+y*p,2);eo.set(C[0],C[1],1),eo.transformByMatrix3(o),E.set([eo[0],eo[1]],y*m)}n===s?Cx(a,f,e.buffers,E):Mx(s,a,t,e,E)}}}}function Cx(e,t,r,n){e.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),t.buffer=r.length-1,t.byteLength=n.buffer.byteLength,t.byteOffset=0,delete t.byteStride}function Mx(e,t,r,n,s){n.buffers.push({arrayBuffer:s.buffer,byteOffset:0,byteLength:s.buffer.byteLength});let o=n.json.bufferViews;if(!o)return;o.push({buffer:n.buffers.length-1,byteLength:s.buffer.byteLength,byteOffset:0});let i=n.json.accessors;i&&(i.push({bufferView:o?.length-1,byteOffset:0,componentType:5126,count:t.count,type:"VEC2"}),r.attributes[`TEXCOORD_${e}`]=i.length-1)}function bx(e){let{offset:t=[0,0],rotation:r=0,scale:n=[1,1]}=e,s=new he().set(1,0,0,0,1,0,t[0],t[1],1),o=gx.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),i=xx.set(n[0],0,0,0,n[1],0,0,0,1);return s.multiplyRight(o).multiplyRight(i)}var Ta={};ut(Ta,{decode:()=>Ix,encode:()=>Sx,name:()=>wx});var Ye="KHR_lights_punctual",wx=Ye;async function Ix(e){let t=new K(e),{json:r}=t,n=t.getExtension(Ye);n&&(t.json.lights=n.lights,t.removeExtension(Ye));for(let s of r.nodes||[]){let o=t.getObjectExtension(s,Ye);o&&(s.light=o.light),t.removeObjectExtension(s,Ye)}}async function Sx(e){let t=new K(e),{json:r}=t;if(r.lights){let n=t.addExtension(Ye);ot(!n.lights),n.lights=r.lights,delete r.lights}if(t.json.lights){for(let n of t.json.lights){let s=n.node;t.addObjectExtension(s,Ye,n)}delete t.json.lights}}var Ca={};ut(Ca,{decode:()=>Fx,encode:()=>Dx,name:()=>Rx});var Un="KHR_materials_unlit",Rx=Un;async function Fx(e){let t=new K(e),{json:r}=t;for(let n of r.materials||[])n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),t.removeObjectExtension(n,Un);t.removeExtension(Un)}function Dx(e){let t=new K(e),{json:r}=t;if(t.materials)for(let n of r.materials||[])n.unlit&&(delete n.unlit,t.addObjectExtension(n,Un,{}),t.addExtension(Un))}var Ma={};ut(Ma,{decode:()=>Ox,encode:()=>vx,name:()=>Lx});var Pn="KHR_techniques_webgl",Lx=Pn;async function Ox(e){let t=new K(e),{json:r}=t,n=t.getExtension(Pn);if(n){let s=Nx(n,t);for(let o of r.materials||[]){let i=t.getObjectExtension(o,Pn);i&&(o.technique=Object.assign({},i,s[i.technique]),o.technique.values=Gx(o.technique,t)),t.removeObjectExtension(o,Pn)}t.removeExtension(Pn)}}async function vx(e,t){}function Nx(e,t){let{programs:r=[],shaders:n=[],techniques:s=[]}=e,o=new TextDecoder;return n.forEach(i=>{if(Number.isFinite(i.bufferView))i.code=o.decode(t.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]}),s.forEach(i=>{i.program=r[i.program]}),s}function Gx(e,t){let r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(n=>{e.uniforms[n].value&&!(n in r)&&(r[n]=e.uniforms[n].value)}),Object.keys(r).forEach(n=>{typeof r[n]=="object"&&r[n].index!==void 0&&(r[n].texture=t.getTexture(r[n].index))}),r}var Pl=[sa,ea,ga,xa,Ba,_a,Ta,Ca,Ma,ya,oa];function Hl(e,t={},r){let n=Pl.filter(s=>Jl(s.name,t));for(let s of n)s.preprocess?.(e,t,r)}async function kl(e,t={},r){let n=Pl.filter(s=>Jl(s.name,t));for(let s of n)await s.decode?.(e,t,r)}function Jl(e,t){let r=t?.gltf?.excludeExtensions||{};return!(e in r&&!r[e])}var ba="KHR_binary_glTF";function zl(e){let t=new K(e),{json:r}=t;for(let n of r.images||[]){let s=t.getObjectExtension(n,ba);s&&Object.assign(n,s),t.removeObjectExtension(n,ba)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(ba)}var Ql={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Px={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},wa=class{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(t,r){this.json=t.json;let n=t.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),zl(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(let r in Ql)this._convertTopLevelObjectToArray(t,r)}_convertTopLevelObjectToArray(t,r){let n=t[r];if(!(!n||Array.isArray(n))){t[r]=[];for(let s in n){let o=n[s];o.id=o.id||s;let i=t[r].length;t[r].push(o),this.idToIndexMap[r][s]=i}}}_convertObjectIdsToArrayIndices(t){for(let r in Ql)this._convertIdsToIndices(t,r);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(let r of t.textures)this._convertTextureIds(r);for(let r of t.meshes)this._convertMeshIds(r);for(let r of t.nodes)this._convertNodeIds(r);for(let r of t.scenes)this._convertSceneIds(r)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(let r of t.primitives){let{attributes:n,indices:s,material:o}=r;for(let i in n)n[i]=this._convertIdToIndex(n[i],"accessor");s&&(r.indices=this._convertIdToIndex(s,"accessor")),o&&(r.material=this._convertIdToIndex(o,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(r=>this._convertIdToIndex(r,"node"))),t.meshes&&(t.meshes=t.meshes.map(r=>this._convertIdToIndex(r,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(r=>this._convertIdToIndex(r,"node")))}_convertIdsToIndices(t,r){t[r]||(console.warn(`gltf v1: json doesn't contain attribute ${r}`),t[r]=[]);for(let n of t[r])for(let s in n){let o=n[s],i=this._convertIdToIndex(o,s);n[s]=i}}_convertIdToIndex(t,r){let n=Px[r];if(n in this.idToIndexMap){let s=this.idToIndexMap[n][t];if(!Number.isFinite(s))throw new Error(`gltf v1: failed to resolve ${r} with id ${t}`);return s}return t}_updateObjects(t){for(let r of this.json.buffers)delete r.type}_updateMaterial(t){for(let r of t.materials){r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};let n=r.values?.tex||r.values?.texture2d_0||r.values?.diffuseTex,s=t.textures.findIndex(o=>o.id===n);s!==-1&&(r.pbrMetallicRoughness.baseColorTexture={index:s})}}};function Vl(e,t={}){return new wa().normalize(e,t)}async function jl(e,t,r=0,n,s){return Hx(e,t,r,n),Vl(e,{normalize:n?.gltf?.normalize}),Hl(e,n,s),n?.gltf?.loadBuffers&&e.json.buffers&&await kx(e,n,s),n?.gltf?.loadImages&&await Jx(e,n,s),await kl(e,n,s),e}function Hx(e,t,r,n){if(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!Ol(t,r,n)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=jo(t);else if(t instanceof ArrayBuffer){let i={};r=vl(i,t,r,n.glb),ot(i.type==="glTF",`Invalid GLB magic string ${i.type}`),e._glb=i,e.json=i.json}else ot(!1,"GLTF: must be ArrayBuffer or string");let s=e.json.buffers||[];if(e.buffers=new Array(s.length).fill(null),e._glb&&e._glb.header.hasBinChunk){let{binChunks:i}=e._glb;e.buffers[0]={arrayBuffer:i[0].arrayBuffer,byteOffset:i[0].byteOffset,byteLength:i[0].byteLength}}let o=e.json.images||[];e.images=new Array(o.length).fill({})}async function kx(e,t,r){let n=e.json.buffers||[];for(let s=0;s<n.length;++s){let o=n[s];if(o.uri){let{fetch:i}=r;ot(i);let a=ma(o.uri,t),c=await(await r?.fetch?.(a))?.arrayBuffer?.();e.buffers[s]={arrayBuffer:c,byteOffset:0,byteLength:c.byteLength},delete o.uri}else e.buffers[s]===null&&(e.buffers[s]={arrayBuffer:new ArrayBuffer(o.byteLength),byteOffset:0,byteLength:o.byteLength})}}async function Jx(e,t,r){let n=zx(e),s=e.json.images||[],o=[];for(let i of n)o.push(Qx(e,s[i],i,t,r));return await Promise.all(o)}function zx(e){let t=new Set,r=e.json.textures||[];for(let n of r)n.source!==void 0&&t.add(n.source);return Array.from(t).sort()}async function Qx(e,t,r,n,s){let o;if(t.uri&&!t.hasOwnProperty("bufferView")){let a=ma(t.uri,n),{fetch:f}=s;o=await(await f(a)).arrayBuffer(),t.bufferView={data:o}}if(Number.isFinite(t.bufferView)){let a=fl(e.json,e.buffers,t.bufferView);o=Je(a.buffer,a.byteOffset,a.byteLength)}ot(o,"glTF image has no data");let i=await Pt(o,[Wi,la],{...n,mimeType:t.mimeType,basis:n.basis||{format:qs()}},s);i&&i[0]&&(i={compressed:!0,mipmaps:!1,width:i[0].width,height:i[0].height,data:i[0]}),e.images=e.images||[],e.images[r]=i}var Ze={dataType:null,batchType:null,name:"glTF",id:"gltf",module:"gltf",version:pl,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:Vx,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function Vx(e,t={},r){t={...Ze.options,...t},t.gltf={...Ze.options.gltf,...t.gltf};let{byteOffset:n=0}=t;return await jl({},e,n,t,r)}var jx={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Kx={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ft={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Xx={magFilter:Ft.TEXTURE_MAG_FILTER,minFilter:Ft.TEXTURE_MIN_FILTER,wrapS:Ft.TEXTURE_WRAP_S,wrapT:Ft.TEXTURE_WRAP_T},Yx={[Ft.TEXTURE_MAG_FILTER]:Ft.LINEAR,[Ft.TEXTURE_MIN_FILTER]:Ft.NEAREST_MIPMAP_LINEAR,[Ft.TEXTURE_WRAP_S]:Ft.REPEAT,[Ft.TEXTURE_WRAP_T]:Ft.REPEAT};function Zx(){return{id:"default-sampler",parameters:Yx}}function qx(e){return Kx[e]}function Wx(e){return jx[e]}var Ia=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(t,r={}){let{json:n,buffers:s=[],images:o=[]}=t,{baseUri:i=""}=t;return ot(n),this.baseUri=i,this.buffers=s,this.images=o,this.jsonUnprocessed=n,this.json=this._resolveTree(t.json,r),this.json}_resolveTree(t,r={}){let n={...t};return this.json=n,t.bufferViews&&(n.bufferViews=t.bufferViews.map((s,o)=>this._resolveBufferView(s,o))),t.images&&(n.images=t.images.map((s,o)=>this._resolveImage(s,o))),t.samplers&&(n.samplers=t.samplers.map((s,o)=>this._resolveSampler(s,o))),t.textures&&(n.textures=t.textures.map((s,o)=>this._resolveTexture(s,o))),t.accessors&&(n.accessors=t.accessors.map((s,o)=>this._resolveAccessor(s,o))),t.materials&&(n.materials=t.materials.map((s,o)=>this._resolveMaterial(s,o))),t.meshes&&(n.meshes=t.meshes.map((s,o)=>this._resolveMesh(s,o))),t.nodes&&(n.nodes=t.nodes.map((s,o)=>this._resolveNode(s,o)),n.nodes=n.nodes.map((s,o)=>this._resolveNodeChildren(s))),t.skins&&(n.skins=t.skins.map((s,o)=>this._resolveSkin(s,o))),t.scenes&&(n.scenes=t.scenes.map((s,o)=>this._resolveScene(s,o))),typeof this.json.scene=="number"&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(t){return this._get(this.json.scenes,t)}getNode(t){return this._get(this.json.nodes,t)}getSkin(t){return this._get(this.json.skins,t)}getMesh(t){return this._get(this.json.meshes,t)}getMaterial(t){return this._get(this.json.materials,t)}getAccessor(t){return this._get(this.json.accessors,t)}getCamera(t){return this._get(this.json.cameras,t)}getTexture(t){return this._get(this.json.textures,t)}getSampler(t){return this._get(this.json.samplers,t)}getImage(t){return this._get(this.json.images,t)}getBufferView(t){return this._get(this.json.bufferViews,t)}getBuffer(t){return this._get(this.json.buffers,t)}_get(t,r){if(typeof r=="object")return r;let n=t&&t[r];return n||console.warn(`glTF file error: Could not find ${t}[${r}]`),n}_resolveScene(t,r){return{...t,id:t.id||`scene-${r}`,nodes:(t.nodes||[]).map(n=>this.getNode(n))}}_resolveNode(t,r){let n={...t,id:t?.id||`node-${r}`};return t.mesh!==void 0&&(n.mesh=this.getMesh(t.mesh)),t.camera!==void 0&&(n.camera=this.getCamera(t.camera)),t.skin!==void 0&&(n.skin=this.getSkin(t.skin)),t.meshes!==void 0&&t.meshes.length&&(n.mesh=t.meshes.reduce((s,o)=>{let i=this.getMesh(o);return s.id=i.id,s.primitives=s.primitives.concat(i.primitives),s},{primitives:[]})),n}_resolveNodeChildren(t){return t.children&&(t.children=t.children.map(r=>this.getNode(r))),t}_resolveSkin(t,r){let n=typeof t.inverseBindMatrices=="number"?this.getAccessor(t.inverseBindMatrices):void 0;return{...t,id:t.id||`skin-${r}`,inverseBindMatrices:n}}_resolveMesh(t,r){let n={...t,id:t.id||`mesh-${r}`,primitives:[]};return t.primitives&&(n.primitives=t.primitives.map(s=>{let o={...s,attributes:{},indices:void 0,material:void 0},i=s.attributes;for(let a in i)o.attributes[a]=this.getAccessor(i[a]);return s.indices!==void 0&&(o.indices=this.getAccessor(s.indices)),s.material!==void 0&&(o.material=this.getMaterial(s.material)),o})),n}_resolveMaterial(t,r){let n={...t,id:t.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 s=n.pbrMetallicRoughness;s.baseColorTexture&&(s.baseColorTexture={...s.baseColorTexture},s.baseColorTexture.texture=this.getTexture(s.baseColorTexture.index)),s.metallicRoughnessTexture&&(s.metallicRoughnessTexture={...s.metallicRoughnessTexture},s.metallicRoughnessTexture.texture=this.getTexture(s.metallicRoughnessTexture.index))}return n}_resolveAccessor(t,r){let n=qx(t.componentType),s=Wx(t.type),o=n*s,i={...t,id:t.id||`accessor-${r}`,bytesPerComponent:n,components:s,bytesPerElement:o,value:void 0,bufferView:void 0,sparse:void 0};if(t.bufferView!==void 0&&(i.bufferView=this.getBufferView(t.bufferView)),i.bufferView){let a=i.bufferView.buffer,{ArrayType:f,byteLength:c}=Hr(i,i.bufferView),h=(i.bufferView.byteOffset||0)+(i.byteOffset||0)+a.byteOffset,l=a.arrayBuffer.slice(h,h+c);i.bufferView.byteStride&&(l=this._getValueFromInterleavedBuffer(a,h,i.bufferView.byteStride,i.bytesPerElement,i.count)),i.value=new f(l)}return i}_getValueFromInterleavedBuffer(t,r,n,s,o){let i=new Uint8Array(o*s);for(let a=0;a<o;a++){let f=r+a*n;i.set(new Uint8Array(t.arrayBuffer.slice(f,f+s)),a*s)}return i.buffer}_resolveTexture(t,r){return{...t,id:t.id||`texture-${r}`,sampler:typeof t.sampler=="number"?this.getSampler(t.sampler):Zx(),source:typeof t.source=="number"?this.getImage(t.source):void 0}}_resolveSampler(t,r){let n={id:t.id||`sampler-${r}`,...t,parameters:{}};for(let s in n){let o=this._enumSamplerParameter(s);o!==void 0&&(n.parameters[o]=n[s])}return n}_enumSamplerParameter(t){return Xx[t]}_resolveImage(t,r){let n={...t,id:t.id||`image-${r}`,image:null,bufferView:t.bufferView!==void 0?this.getBufferView(t.bufferView):void 0},s=this.images[r];return s&&(n.image=s),n}_resolveBufferView(t,r){let n=t.buffer,s=this.buffers[n].arrayBuffer,o=this.buffers[n].byteOffset||0;return t.byteOffset&&(o+=t.byteOffset),{id:`bufferView-${r}`,...t,buffer:this.buffers[n],data:new Uint8Array(s,o,t.byteLength)}}_resolveCamera(t,r){let n={...t,id:t.id||`camera-${r}`};return n.perspective,n.orthographic,n}};function Hn(e,t){return new Ia().postProcess(e,t)}var no={URI:0,EMBEDDED:1};function so(e,t,r,n){e.rotateYtoZ=!0;let s=(e.byteOffset||0)+(e.byteLength||0)-r;if(s===0)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n?.["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=Je(t,r,s),e.gltfByteOffset=0,e.gltfByteLength=s,r%4===0||console.warn(`${e.type}: embedded glb is not aligned to a 4-byte boundary.`),(e.byteOffset||0)+(e.byteLength||0)}async function oo(e,t,r,n){let s=r?.["3d-tiles"]||{};if($x(e,t,r),s.loadGLTF){if(!n)return;if(e.gltfUrl){let{fetch:o}=n,i=await o(e.gltfUrl,r);e.gltfArrayBuffer=await i.arrayBuffer(),e.gltfByteOffset=0}if(e.gltfArrayBuffer){let o=await Pt(e.gltfArrayBuffer,Ze,r,n);e.gltf=Hn(o),e.gpuMemoryUsageInBytes=Nn(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength}}}function $x(e,t,r){switch(t){case no.URI:if(e.gltfArrayBuffer){let n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),o=new TextDecoder().decode(n);e.gltfUrl=o.replace(/[\s\0]+$/,"")}delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case no.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function Kl(e,t,r,n,s){r=tB(e,t,r,n,s),await oo(e,no.EMBEDDED,n,s);let o=e?.gltf?.extensions;return o&&o.CESIUM_RTC&&(e.rtcCenter=o.CESIUM_RTC.center),r}function tB(e,t,r,n,s){r=Se(e,t,r),r=Gr(e,t,r),r=Ur(e,t,r,n),r=so(e,t,r,n);let o=new kt(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=o.getGlobalProperty("RTC_CENTER",H.FLOAT,3),r}var de=6356752314245179e-9,eB={radii:[6378137,6378137,de],radiiSquared:[6378137*6378137,6378137*6378137,de*de],oneOverRadii:[1/6378137,1/6378137,1/de],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(de*de)],maximumRadius:Math.max(6378137,6378137,de),centerToleranceSquared:.1};function io(e){return e}var rS=new b;function rB(e,t=[],r=io){return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function Xl(e,t=[]){return rB(e,t,q._cartographicRadians?io:mi)}function nB(e,t,r=io){return"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):"x"in t?(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function Yl(e,t){return nB(e,t,q._cartographicRadians?io:pi)}var Zl=1e-14,sB=new b,ql={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"}},Sa={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},kn={east:new b,north:new b,up:new b,west:new b,south:new b,down:new b},oB=new b,iB=new b,aB=new b;function Ra(e,t,r,n,s,o){let i=ql[t]&&ql[t][r];ft(i&&(!n||n===i));let a,f,c,h=sB.copy(s);if(wt(h.x,0,Zl)&&wt(h.y,0,Zl)){let u=Math.sign(h.z);a=oB.fromArray(Sa[t]),t!=="east"&&t!=="west"&&a.scale(u),f=iB.fromArray(Sa[r]),r!=="east"&&r!=="west"&&f.scale(u),c=aB.fromArray(Sa[n]),n!=="east"&&n!=="west"&&c.scale(u)}else{let{up:u,east:d,north:A}=kn;d.set(-h.y,h.x,0).normalize(),e.geodeticSurfaceNormal(h,u),A.copy(u).cross(d);let{down:m,west:p,south:E}=kn;m.copy(u).scale(-1),p.copy(d).scale(-1),E.copy(A).scale(-1),a=kn[t],f=kn[r],c=kn[n]}return o[0]=a.x,o[1]=a.y,o[2]=a.z,o[3]=0,o[4]=f.x,o[5]=f.y,o[6]=f.z,o[7]=0,o[8]=c.x,o[9]=c.y,o[10]=c.z,o[11]=0,o[12]=h.x,o[13]=h.y,o[14]=h.z,o[15]=1,o}var jr=new b,cB=new b,fB=new b;function Wl(e,t,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:s,centerToleranceSquared:o}=t;jr.from(e);let i=jr.x,a=jr.y,f=jr.z,c=n.x,h=n.y,l=n.z,u=i*i*c*c,d=a*a*h*h,A=f*f*l*l,m=u+d+A,p=Math.sqrt(1/m);if(!Number.isFinite(p))return;let E=cB;if(E.copy(e).scale(p),m<o)return E.to(r);let y=s.x,C=s.y,M=s.z,T=fB;T.set(E.x*y*2,E.y*C*2,E.z*M*2);let I=(1-p)*jr.len()/(.5*T.len()),w=0,L,x,g,B;do{I-=w,L=1/(1+I*y),x=1/(1+I*C),g=1/(1+I*M);let _=L*L,U=x*x,G=g*g,P=_*L,v=U*x,at=G*g;B=u*_+d*U+A*G-1;let X=-2*(u*P*y+d*v*C+A*at*M);w=B/X}while(Math.abs(B)>Ht.EPSILON12);return jr.scale([L,x,g]).to(r)}var ao=new b,$l=new b,uB=new b,Jt=new b,dB=new b,co=new b,Ae=class{constructor(t=0,r=0,n=0){this.centerToleranceSquared=Ht.EPSILON1,ft(t>=0),ft(r>=0),ft(n>=0),this.radii=new b(t,r,n),this.radiiSquared=new b(t*t,r*r,n*n),this.radiiToTheFourth=new b(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new b(t===0?0:1/t,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new b(t===0?0:1/(t*t),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,r=[0,0,0]){let n=$l,s=uB,[,,o]=t;this.geodeticSurfaceNormalCartographic(t,n),s.copy(this.radiiSquared).scale(n);let i=Math.sqrt(n.dot(s));return s.scale(1/i),n.scale(o),s.add(n),s.to(r)}cartesianToCartographic(t,r=[0,0,0]){co.from(t);let n=this.scaleToGeodeticSurface(co,Jt);if(!n)return;let s=this.geodeticSurfaceNormal(n,$l),o=dB;o.copy(co).subtract(n);let i=Math.atan2(s.y,s.x),a=Math.asin(s.z),f=Math.sign(je.dot(o,co))*je.length(o);return Yl([i,a,f],r)}eastNorthUpToFixedFrame(t,r=new Rt){return Ra(this,"east","north","up",t,r)}localFrameToFixedFrame(t,r,n,s,o=new Rt){return Ra(this,t,r,n,s,o)}geocentricSurfaceNormal(t,r=[0,0,0]){return ao.from(t).normalize().to(r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=Xl(t),s=n[0],o=n[1],i=Math.cos(o);return ao.set(i*Math.cos(s),i*Math.sin(s),Math.sin(o)).normalize(),ao.to(r)}geodeticSurfaceNormal(t,r=[0,0,0]){return ao.from(t).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(t,r){return Wl(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){Jt.from(t);let n=Jt.x,s=Jt.y,o=Jt.z,i=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*i.x+s*s*i.y+o*o*i.z);return Jt.multiplyScalar(a).to(r)}transformPositionToScaledSpace(t,r=[0,0,0]){return Jt.from(t).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(t,r=[0,0,0]){return Jt.from(t).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){ft(wt(this.radii.x,this.radii.y,Ht.EPSILON15)),ft(this.radii.z>0),Jt.from(t);let s=Jt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(s)>=this.radii.z-r))return Jt.set(0,0,s).to(n)}};Ae.WGS84=new Ae(6378137,6378137,de);async function tu(e,t,r,n,s){return r=AB(e,t,r,n,s),await oo(e,e.gltfFormat||0,n,s),r}function AB(e,t,r,n,s){if(r=Se(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=Gr(e,t,r);let o=new DataView(t);if(e.gltfFormat=o.getUint32(r,!0),r+=4,r=Ur(e,t,r,n),r=so(e,t,r,n),!e?.header?.featureTableJsonByteLength||e.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let i=new kt(e.featureTableJson,e.featureTableBinary),a=i.getGlobalProperty("INSTANCES_LENGTH");if(i.featuresLength=a,!Number.isFinite(a))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=i.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=i.getGlobalProperty("RTC_CENTER",H.FLOAT,3);let f=new ue(e.batchTableJson,e.batchTableBinary,a);return mB(e,i,f,a),r}function mB(e,t,r,n){let s=new Array(n),o=new b,i=new b,a=new b,f=new b,c=new Z,h=new Ie,l=new b,u={},d=new Rt,A=[],m=[],p=[],E=[];for(let y=0;y<n;y++){let C;if(t.hasProperty("POSITION"))C=t.getProperty("POSITION",H.FLOAT,3,y,o);else if(t.hasProperty("POSITION_QUANTIZED")){C=t.getProperty("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3,y,o);let g=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3);if(!g)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let B=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",H.FLOAT,3);if(!B)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let _=65535;for(let U=0;U<3;U++)C[U]=C[U]/_*B[U]+g[U]}if(!C)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(C),u.translation=o,e.normalUp=t.getProperty("NORMAL_UP",H.FLOAT,3,y,A),e.normalRight=t.getProperty("NORMAL_RIGHT",H.FLOAT,3,y,m);let M=!1;if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",H.UNSIGNED_SHORT,2,y,A),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",H.UNSIGNED_SHORT,2,y,m),e.octNormalUp)throw e.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");e.eastNorthUp?(Ae.WGS84.eastNorthUpToFixedFrame(o,d),d.getRotationMatrix3(c)):c.identity()}M&&(f.copy(i).cross(a).normalize(),c.setColumn(0,i),c.setColumn(1,a),c.setColumn(2,f)),h.fromMatrix3(c),u.rotation=h,l.set(1,1,1);let T=t.getProperty("SCALE",H.FLOAT,1,y,p);Number.isFinite(T)&&l.multiplyByScalar(T);let I=t.getProperty("SCALE_NON_UNIFORM",H.FLOAT,3,y,A);I&&l.scale(I),u.scale=l;let w=t.getProperty("BATCH_ID",H.UNSIGNED_SHORT,1,y,E);w===void 0&&(w=y);let L=new Rt().fromQuaternion(u.rotation);d.identity(),d.translate(u.translation),d.multiplyRight(L),d.scale(u.scale);let x=d.clone();s[y]={modelMatrix:x,batchId:w}}e.instances=s}async function eu(e,t,r,n,s,o){r=Se(e,t,r);let i=new DataView(t);for(e.tilesLength=i.getUint32(r,!0),r+=4,e.tiles=[];e.tiles.length<e.tilesLength&&(e.byteLength||0)-r>12;){let a={shape:"tile3d"};e.tiles.push(a),r=await o(t,r,n,s,a)}return r}async function ru(e,t,r,n){if(e.rotateYtoZ=!0,e.gltfUpAxis=r?.["3d-tiles"]?.assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",r?.["3d-tiles"]?.loadGLTF){if(!n)return t.byteLength;let s=await Pt(t,Ze,r,n);e.gltf=Hn(s),e.gpuMemoryUsageInBytes=Nn(e.gltf)}else e.gltfArrayBuffer=t;return t.byteLength}async function Fa(e,t=0,r,n,s={shape:"tile3d"}){switch(s.byteOffset=t,s.type=Rf(e,t),s.type){case _t.COMPOSITE:return await eu(s,e,t,r,n,Fa);case _t.BATCHED_3D_MODEL:return await Kl(s,e,t,r,n);case _t.GLTF:return await ru(s,e,r,n);case _t.INSTANCED_3D_MODEL:return await tu(s,e,t,r,n);case _t.POINT_CLOUD:return await qh(s,e,t,r,n);default:throw new Error(`3DTileLoader: unknown type ${s.type}`)}}async function Da(e,t,r){if(new Uint32Array(e.slice(0,4))[0]!==1952609651)throw new Error("Wrong subtree file magic number");if(new Uint32Array(e.slice(4,8))[0]!==1)throw new Error("Wrong subtree file verson, must be 1");let o=nu(e.slice(8,16)),i=new Uint8Array(e,24,o),f=new TextDecoder("utf8").decode(i),c=JSON.parse(f),h=nu(e.slice(16,24)),l=new ArrayBuffer(0);if(h&&(l=e.slice(24+o)),await fo(c,c.tileAvailability,l,r),Array.isArray(c.contentAvailability))for(let u of c.contentAvailability)await fo(c,u,l,r);else await fo(c,c.contentAvailability,l,r);return await fo(c,c.childSubtreeAvailability,l,r),c}async function fo(e,t,r,n){let s=Number.isFinite(t.bitstream)?t.bitstream:t.bufferView;if(typeof s!="number")return;let o=e.bufferViews[s],i=e.buffers[o.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}`,h=await(await n.fetch(f)).arrayBuffer();t.explicitBitstream=new Uint8Array(h,o.byteOffset,o.byteLength);return}let a=e.buffers.slice(0,o.buffer).reduce((f,c)=>f+c.byteLength,0);t.explicitBitstream=new Uint8Array(r.slice(a,a+i.byteLength),o.byteOffset,o.byteLength)}function nu(e){let t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+2**32*n}var Kr={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:Da,options:{}};var Hu=gr(pn(),1);var Nu=gr(pn(),1);function La(e){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 t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function zt(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||La()}var pB=globalThis.self||globalThis.window||globalThis.global,Xr=globalThis.window||globalThis.self||globalThis.global,gB=globalThis.document||{},qe=globalThis.process||{},xB=globalThis.console,KS=globalThis.navigator||{};var ho=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",ZS=zt();function BB(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var lo=class{constructor(t,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=BB(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function su(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function ou(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function uo(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,s=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let o=e.width*r,i=e.height*r,a=["font-size:1px;","padding:".concat(Math.floor(i/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(i,"px;"),"background:url(".concat(s,");"),"background-size:".concat(o,"px ").concat(i,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),a]}var Ao;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ao||(Ao={}));var EB=10;function iu(e){return typeof e!="string"?e:(e=e.toUpperCase(),Ao[e]||Ao.WHITE)}function au(e,t,r){if(!zt&&typeof e=="string"){if(t){let n=iu(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=iu(r);e="\x1B[".concat(n+EB,"m").concat(e,"\x1B[49m")}}return e}function cu(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),s=e;for(let o of n){let i=s[o];typeof i=="function"&&(t.find(a=>o===a)||(s[o]=i.bind(e)))}}function Yr(e,t){if(!e)throw new Error(t||"Assertion failed")}function We(){let e;if(zt()&&Xr.performance){var t,r;e=Xr===null||Xr===void 0||(t=Xr.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in qe){var n;let s=qe===null||qe===void 0||(n=qe.hrtime)===null||n===void 0?void 0:n.call(qe);e=s[0]*1e3+s[1]/1e6}else e=Date.now();return e}var Zr={debug:zt()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},_B={enabled:!0,level:0};function Dt(){}var fu={},hu={once:!0},Jn=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=ho,this._startTs=We(),this._deltaTs=We(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new lo("__probe-".concat(this.id,"__"),_B),this.timeStamp("".concat(this.id," started")),cu(this),Object.seal(this)}set level(t){this.setLevel(t)}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(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){Yr(t,r)}warn(t){return this._getLogFunction(0,t,Zr.warn,arguments,hu)}error(t){return this._getLogFunction(0,t,Zr.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,Zr.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,Zr.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,Zr.debug||Zr.info,arguments,hu)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||Dt,n&&[n],{tag:MB(r)}):Dt}image(t){let{logLevel:r,priority:n,image:s,message:o="",scale:i=1}=t;return this._shouldLog(r||n)?zt()?CB({image:s,message:o,scale:i}):TB({image:s,message:o,scale:i}):Dt}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||Dt)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},s=lu({logLevel:t,message:r,opts:n}),{collapsed:o}=n;return s.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(s)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||Dt)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=uu(t)}_getLogFunction(t,r,n,s,o){if(this._shouldLog(t)){o=lu({logLevel:t,message:r,args:s,opts:o}),n=n||o.method,Yr(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=We();let i=o.tag||o.message;if(o.once&&i)if(!fu[i])fu[i]=We();else return Dt;return r=yB(this.id,o.message,o),n.bind(console,r,...o.args)}return Dt}};Jn.VERSION=ho;function uu(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Yr(Number.isFinite(t)&&t>=0),t}function lu(e){let{logLevel:t,message:r}=e;e.logLevel=uu(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let s=typeof e.message;return Yr(s==="string"||s==="object"),Object.assign(e,{args:n},e.opts)}function yB(e,t,r){if(typeof t=="string"){let n=r.time?ou(su(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=au(t,r.color,r.background)}return t}function TB(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),Dt}function CB(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let o=new Image;return o.onload=()=>{let i=uo(o,r,n);console.log(...i)},o.src=t,Dt}let s=t.nodeName||"";if(s.toLowerCase()==="img")return console.log(...uo(t,r,n)),Dt;if(s.toLowerCase()==="canvas"){let o=new Image;return o.onload=()=>console.log(...uo(o,r,n)),o.src=t.toDataURL(),Dt}return Dt}function MB(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Oa=new Jn({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 Y(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}Y.prototype.__isLong__;Object.defineProperty(Y.prototype,"__isLong__",{value:!0});function At(e){return(e&&e.__isLong__)===!0}function du(e){var t=Math.clz32(e&-e);return e?31-t:t}Y.isLong=At;var Au={},mu={};function $e(e,t){var r,n,s;return t?(e>>>=0,(s=0<=e&&e<256)&&(n=mu[e],n)?n:(r=Q(e,0,!0),s&&(mu[e]=r),r)):(e|=0,(s=-128<=e&&e<128)&&(n=Au[e],n)?n:(r=Q(e,e<0?-1:0,!1),s&&(Au[e]=r),r))}Y.fromInt=$e;function Ot(e,t){if(isNaN(e))return t?me:Qt;if(t){if(e<0)return me;if(e>=Bu)return yu}else{if(e<=-gu)return Ct;if(e+1>=gu)return _u}return e<0?Ot(-e,t).neg():Q(e%Wr|0,e/Wr|0,t)}Y.fromNumber=Ot;function Q(e,t,r){return new Y(e,t,r)}Y.fromBits=Q;var mo=Math.pow;function Na(e,t,r){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(r=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?me:Qt;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return Na(e.substring(1),t,r).neg();for(var s=Ot(mo(r,8)),o=Qt,i=0;i<e.length;i+=8){var a=Math.min(8,e.length-i),f=parseInt(e.substring(i,i+a),r);if(a<8){var c=Ot(mo(r,a));o=o.mul(c).add(Ot(f))}else o=o.mul(s),o=o.add(Ot(f))}return o.unsigned=t,o}Y.fromString=Na;function Vt(e,t){return typeof e=="number"?Ot(e,t):typeof e=="string"?Na(e,t):Q(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}Y.fromValue=Vt;var pu=1<<16,bB=1<<24,Wr=pu*pu,Bu=Wr*Wr,gu=Bu/2,xu=$e(bB),Qt=$e(0);Y.ZERO=Qt;var me=$e(0,!0);Y.UZERO=me;var qr=$e(1);Y.ONE=qr;var Eu=$e(1,!0);Y.UONE=Eu;var va=$e(-1);Y.NEG_ONE=va;var _u=Q(-1,2147483647,!1);Y.MAX_VALUE=_u;var yu=Q(-1,-1,!0);Y.MAX_UNSIGNED_VALUE=yu;var Ct=Q(0,-2147483648,!1);Y.MIN_VALUE=Ct;var O=Y.prototype;O.toInt=function(){return this.unsigned?this.low>>>0:this.low};O.toNumber=function(){return this.unsigned?(this.high>>>0)*Wr+(this.low>>>0):this.high*Wr+(this.low>>>0)};O.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(Ct)){var r=Ot(t),n=this.div(r),s=n.mul(r).sub(this);return n.toString(t)+s.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var o=Ot(mo(t,6),this.unsigned),i=this,a="";;){var f=i.div(o),c=i.sub(f.mul(o)).toInt()>>>0,h=c.toString(t);if(i=f,i.isZero())return h+a;for(;h.length<6;)h="0"+h;a=""+h+a}};O.getHighBits=function(){return this.high};O.getHighBitsUnsigned=function(){return this.high>>>0};O.getLowBits=function(){return this.low};O.getLowBitsUnsigned=function(){return this.low>>>0};O.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Ct)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&!(t&1<<r);r--);return this.high!=0?r+33:r+1};O.isZero=function(){return this.high===0&&this.low===0};O.eqz=O.isZero;O.isNegative=function(){return!this.unsigned&&this.high<0};O.isPositive=function(){return this.unsigned||this.high>=0};O.isOdd=function(){return(this.low&1)===1};O.isEven=function(){return(this.low&1)===0};O.equals=function(t){return At(t)||(t=Vt(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};O.eq=O.equals;O.notEquals=function(t){return!this.eq(t)};O.neq=O.notEquals;O.ne=O.notEquals;O.lessThan=function(t){return this.comp(t)<0};O.lt=O.lessThan;O.lessThanOrEqual=function(t){return this.comp(t)<=0};O.lte=O.lessThanOrEqual;O.le=O.lessThanOrEqual;O.greaterThan=function(t){return this.comp(t)>0};O.gt=O.greaterThan;O.greaterThanOrEqual=function(t){return this.comp(t)>=0};O.gte=O.greaterThanOrEqual;O.ge=O.greaterThanOrEqual;O.compare=function(t){if(At(t)||(t=Vt(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};O.comp=O.compare;O.negate=function(){return!this.unsigned&&this.eq(Ct)?Ct:this.not().add(qr)};O.neg=O.negate;O.add=function(t){At(t)||(t=Vt(t));var r=this.high>>>16,n=this.high&65535,s=this.low>>>16,o=this.low&65535,i=t.high>>>16,a=t.high&65535,f=t.low>>>16,c=t.low&65535,h=0,l=0,u=0,d=0;return d+=o+c,u+=d>>>16,d&=65535,u+=s+f,l+=u>>>16,u&=65535,l+=n+a,h+=l>>>16,l&=65535,h+=r+i,h&=65535,Q(u<<16|d,h<<16|l,this.unsigned)};O.subtract=function(t){return At(t)||(t=Vt(t)),this.add(t.neg())};O.sub=O.subtract;O.multiply=function(t){if(this.isZero())return this;if(At(t)||(t=Vt(t)),Lt){var r=Lt.mul(this.low,this.high,t.low,t.high);return Q(r,Lt.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?me:Qt;if(this.eq(Ct))return t.isOdd()?Ct:Qt;if(t.eq(Ct))return this.isOdd()?Ct:Qt;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(xu)&&t.lt(xu))return Ot(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,s=this.high&65535,o=this.low>>>16,i=this.low&65535,a=t.high>>>16,f=t.high&65535,c=t.low>>>16,h=t.low&65535,l=0,u=0,d=0,A=0;return A+=i*h,d+=A>>>16,A&=65535,d+=o*h,u+=d>>>16,d&=65535,d+=i*c,u+=d>>>16,d&=65535,u+=s*h,l+=u>>>16,u&=65535,u+=o*c,l+=u>>>16,u&=65535,u+=i*f,l+=u>>>16,u&=65535,l+=n*h+s*c+o*f+i*a,l&=65535,Q(d<<16|A,l<<16|u,this.unsigned)};O.mul=O.multiply;O.divide=function(t){if(At(t)||(t=Vt(t)),t.isZero())throw Error("division by zero");if(Lt){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?Lt.div_u:Lt.div_s)(this.low,this.high,t.low,t.high);return Q(r,Lt.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?me:Qt;var n,s,o;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return me;if(t.gt(this.shru(1)))return Eu;o=me}else{if(this.eq(Ct)){if(t.eq(qr)||t.eq(va))return Ct;if(t.eq(Ct))return qr;var i=this.shr(1);return n=i.div(t).shl(1),n.eq(Qt)?t.isNegative()?qr:va:(s=this.sub(t.mul(n)),o=n.add(s.div(t)),o)}else if(t.eq(Ct))return this.unsigned?me:Qt;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=Qt}for(s=this;s.gte(t);){n=Math.max(1,Math.floor(s.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),f=a<=48?1:mo(2,a-48),c=Ot(n),h=c.mul(t);h.isNegative()||h.gt(s);)n-=f,c=Ot(n,this.unsigned),h=c.mul(t);c.isZero()&&(c=qr),o=o.add(c),s=s.sub(h)}return o};O.div=O.divide;O.modulo=function(t){if(At(t)||(t=Vt(t)),Lt){var r=(this.unsigned?Lt.rem_u:Lt.rem_s)(this.low,this.high,t.low,t.high);return Q(r,Lt.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};O.mod=O.modulo;O.rem=O.modulo;O.not=function(){return Q(~this.low,~this.high,this.unsigned)};O.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};O.clz=O.countLeadingZeros;O.countTrailingZeros=function(){return this.low?du(this.low):du(this.high)+32};O.ctz=O.countTrailingZeros;O.and=function(t){return At(t)||(t=Vt(t)),Q(this.low&t.low,this.high&t.high,this.unsigned)};O.or=function(t){return At(t)||(t=Vt(t)),Q(this.low|t.low,this.high|t.high,this.unsigned)};O.xor=function(t){return At(t)||(t=Vt(t)),Q(this.low^t.low,this.high^t.high,this.unsigned)};O.shiftLeft=function(t){return At(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Q(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Q(0,this.low<<t-32,this.unsigned)};O.shl=O.shiftLeft;O.shiftRight=function(t){return At(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Q(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Q(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};O.shr=O.shiftRight;O.shiftRightUnsigned=function(t){return At(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Q(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?Q(this.high,0,this.unsigned):Q(this.high>>>t-32,0,this.unsigned)};O.shru=O.shiftRightUnsigned;O.shr_u=O.shiftRightUnsigned;O.rotateLeft=function(t){var r;return At(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Q(this.high,this.low,this.unsigned):t<32?(r=32-t,Q(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,Q(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))};O.rotl=O.rotateLeft;O.rotateRight=function(t){var r;return At(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Q(this.high,this.low,this.unsigned):t<32?(r=32-t,Q(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,Q(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};O.rotr=O.rotateRight;O.toSigned=function(){return this.unsigned?Q(this.low,this.high,!1):this};O.toUnsigned=function(){return this.unsigned?this:Q(this.low,this.high,!0)};O.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};O.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};O.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};Y.fromBytes=function(t,r,n){return n?Y.fromBytesLE(t,r):Y.fromBytesBE(t,r)};Y.fromBytesLE=function(t,r){return new Y(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};Y.fromBytesBE=function(t,r){return new Y(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)};var $r=Y;var wB=16;function zn(e){e==="X"&&(e="");let t=e.padEnd(wB,"0");return $r.fromString(t,!0,16)}function Ga(e){if(e.isZero())return"X";let t=e.countTrailingZeros(),r=t%4;t=(t-r)/4;let n=t;t*=4;let o=e.shiftRightUnsigned(t).toString(16).replace(/0+$/,"");return Array(17-n-o.length).join("0")+o}function Ua(e,t){let r=IB(e).shiftRightUnsigned(2);return e.add($r.fromNumber(2*t+1-4).multiply(r))}function IB(e){return e.and(e.not().add(1))}var SB=3,RB=30,FB=2*RB+1,Tu=180/Math.PI;function Mu(e){if(e.length===0)throw new Error(`Invalid Hilbert quad key ${e}`);let t=e.split("/"),r=parseInt(t[0],10),n=t[1],s=n.length,o=0,i=[0,0];for(let a=s-1;a>=0;a--){o=s-a;let f=n[a],c=0,h=0;f==="1"?h=1:f==="2"?(c=1,h=1):f==="3"&&(c=1);let l=Math.pow(2,o-1);DB(l,i,c,h),i[0]+=l*c,i[1]+=l*h}if(r%2===1){let a=i[0];i[0]=i[1],i[1]=a}return{face:r,ij:i,level:o}}function bu(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<SB+FB;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),s=t.substring(3,r),o=s.length/2,i=$r.fromString(n,!0,2).toString(10),a="";if(o!==0)for(a=$r.fromString(s,!0,2).toString(4);a.length<o;)a="0"+a;return`${i}/${a}`}function Pa(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function Cu(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Ha(e){return[Cu(e[0]),Cu(e[1])]}function ka(e,[t,r]){switch(e){case 0:return[1,t,r];case 1:return[-t,1,r];case 2:return[-t,-r,1];case 3:return[-1,-r,-t];case 4:return[r,-1,-t];case 5:return[r,t,-1];default:throw new Error("Invalid face")}}function Ja([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*Tu,n*Tu]}function DB(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let s=t[0];t[0]=t[1],t[1]=s}}function wu(e){let t=Pa(e.ij,e.level,[.5,.5]),r=Ha(t),n=ka(e.face,r);return Ja(n)}var LB=100;function za(e){let{face:t,ij:r,level:n}=e,s=[[0,0],[0,1],[1,1],[1,0],[0,0]],o=Math.max(1,Math.ceil(LB*Math.pow(2,-n))),i=new Float64Array(4*o*2+2),a=0,f=0;for(let c=0;c<4;c++){let h=s[c].slice(0),l=s[c+1],u=(l[0]-h[0])/o,d=(l[1]-h[1])/o;for(let A=0;A<o;A++){h[0]+=u,h[1]+=d;let m=Pa(r,n,h),p=Ha(m),E=ka(t,p),y=Ja(E);Math.abs(y[1])>89.999&&(y[0]=f);let C=y[0]-f;y[0]+=C>180?-360:C<-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 tn(e){let t=OB(e);return Mu(t)}function OB(e){if(e.indexOf("/")>0)return e;let t=zn(e);return bu(t)}function Qa(e){let t=tn(e);return wu(t)}function Su(e){let t;if(e.face===2||e.face===5){let r=null,n=0;for(let s=0;s<4;s++){let o=`${e.face}/${s}`,i=tn(o),a=za(i);(typeof r>"u"||r===null)&&(r=new Float64Array(4*a.length)),r.set(a,n),n+=a.length}t=Iu(r)}else{let r=za(e);t=Iu(r)}return t}function Iu(e){if(e.length%2!==0)throw new Error("Invalid corners");let t=[],r=[];for(let n=0;n<e.length;n+=2)t.push(e[n]),r.push(e[n+1]);return t.sort((n,s)=>n-s),r.sort((n,s)=>n-s),{west:t[0],east:t[t.length-1],north:r[r.length-1],south:r[0]}}function Va(e,t){let r=t?.minimumHeight||0,n=t?.maximumHeight||0,s=tn(e),o=Su(s),i=o.west,a=o.south,f=o.east,c=o.north,h=[];return h.push(new b(i,c,r)),h.push(new b(f,c,r)),h.push(new b(f,a,r)),h.push(new b(i,a,r)),h.push(new b(i,c,n)),h.push(new b(f,c,n)),h.push(new b(f,a,n)),h.push(new b(i,a,n)),h}var ht={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var ZR=new b,qR=new b;var Qn=new b,Ru=new b,Fe=class{constructor(t=[0,0,0],r=0){this.radius=-0,this.center=new b,this.fromCenterRadius(t,r)}fromCenterRadius(t,r){return this.center.from(t),this.radius=r,this}fromCornerPoints(t,r){return r=Qn.from(r),this.center=new b().from(t).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new Fe(this.center,this.radius)}union(t){let r=this.center,n=this.radius,s=t.center,o=t.radius,i=Qn.copy(s).subtract(r),a=i.magnitude();if(n>=a+o)return this.clone();if(o>=a+n)return t.clone();let f=(n+a+o)*.5;return Ru.copy(i).scale((-n+f)/a).add(r),this.center.copy(Ru),this.radius=f,this}expand(t){let n=Qn.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=Fn.getScaling(Qn,t);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(t){let r=this.distanceTo(t);return r*r}distanceTo(t){let n=Qn.from(t).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(t){let r=this.center,n=this.radius,o=t.normal.dot(r)+t.distance;return o<-n?ht.OUTSIDE:o<n?ht.INTERSECTING:ht.INSIDE}};var vB=new b,NB=new b,po=new b,go=new b,xo=new b,GB=new b,UB=new b,pe={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},tr=class{constructor(t=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){this.center=new b().from(t),this.halfAxes=new Z(r)}get halfSize(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new b(t).len(),new b(r).len(),new b(n).len()]}get quaternion(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),s=new b(t).normalize(),o=new b(r).normalize(),i=new b(n).normalize();return new Ie().fromMatrix3(new Z([...s,...o,...i]))}fromCenterHalfSizeQuaternion(t,r,n){let s=new Ie(n),o=new Z().fromQuaternion(s);return o[0]=o[0]*r[0],o[1]=o[1]*r[0],o[2]=o[2]*r[0],o[3]=o[3]*r[1],o[4]=o[4]*r[1],o[5]=o[5]*r[1],o[6]=o[6]*r[2],o[7]=o[7]*r[2],o[8]=o[8]*r[2],this.center=new b().from(t),this.halfAxes=o,this}clone(){return new tr(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new Fe){let r=this.halfAxes,n=r.getColumn(0,po),s=r.getColumn(1,go),o=r.getColumn(2,xo),i=vB.copy(n).add(s).add(o);return t.center.copy(this.center),t.radius=i.magnitude(),t}intersectPlane(t){let r=this.center,n=t.normal,s=this.halfAxes,o=n.x,i=n.y,a=n.z,f=Math.abs(o*s[pe.COLUMN0ROW0]+i*s[pe.COLUMN0ROW1]+a*s[pe.COLUMN0ROW2])+Math.abs(o*s[pe.COLUMN1ROW0]+i*s[pe.COLUMN1ROW1]+a*s[pe.COLUMN1ROW2])+Math.abs(o*s[pe.COLUMN2ROW0]+i*s[pe.COLUMN2ROW1]+a*s[pe.COLUMN2ROW2]),c=n.dot(r)+t.distance;return c<=-f?ht.OUTSIDE:c>=f?ht.INSIDE:ht.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=NB.from(t).subtract(this.center),n=this.halfAxes,s=n.getColumn(0,po),o=n.getColumn(1,go),i=n.getColumn(2,xo),a=s.magnitude(),f=o.magnitude(),c=i.magnitude();s.normalize(),o.normalize(),i.normalize();let h=0,l;return l=Math.abs(r.dot(s))-a,l>0&&(h+=l*l),l=Math.abs(r.dot(o))-f,l>0&&(h+=l*l),l=Math.abs(r.dot(i))-c,l>0&&(h+=l*l),h}computePlaneDistances(t,r,n=[-0,-0]){let s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=this.center,a=this.halfAxes,f=a.getColumn(0,po),c=a.getColumn(1,go),h=a.getColumn(2,xo),l=GB.copy(f).add(c).add(h).add(i),u=UB.copy(l).subtract(t),d=r.dot(u);return s=Math.min(d,s),o=Math.max(d,o),l.copy(i).add(f).add(c).subtract(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),l.copy(i).add(f).subtract(c).add(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),l.copy(i).add(f).subtract(c).subtract(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),i.copy(l).subtract(f).add(c).add(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),i.copy(l).subtract(f).add(c).subtract(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),i.copy(l).subtract(f).subtract(c).add(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),i.copy(l).subtract(f).subtract(c).subtract(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),n[0]=s,n[1]=o,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,po);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,go);n.transformAsPoint(t);let s=this.halfAxes.getColumn(2,xo);return s.transformAsPoint(t),this.halfAxes=new Z([...r,...n,...s]),this}getTransform(){throw new Error("not implemented")}};var Fu=new b,Du=new b,ge=class{constructor(t=[0,0,1],r=0){this.normal=new b,this.distance=-0,this.fromNormalDistance(t,r)}fromNormalDistance(t,r){return ft(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=Fu.from(t),this.normal.from(r).normalize();let n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,r,n,s){return this.normal.set(t,r,n),ft(wt(this.normal.len(),1)),this.distance=s,this}clone(){return new ge(this.normal,this.distance)}equals(t){return wt(this.distance,t.distance)&&wt(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=Du.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,r)}projectPointOntoPlane(t,r=[0,0,0]){let n=Fu.from(t),s=this.getPointDistance(n),o=Du.copy(this.normal).scale(s);return n.subtract(o).to(r)}};var Lu=[new b([1,0,0]),new b([0,1,0]),new b([0,0,1])],Ou=new b,PB=new b,vt=class{constructor(t=[]){this.planes=t}fromBoundingSphere(t){this.planes.length=2*Lu.length;let r=t.center,n=t.radius,s=0;for(let o of Lu){let i=this.planes[s],a=this.planes[s+1];i||(i=this.planes[s]=new ge),a||(a=this.planes[s+1]=new ge);let f=Ou.copy(o).scale(-n).add(r);i.fromPointNormal(f,o);let c=Ou.copy(o).scale(n).add(r),h=PB.copy(o).negate();a.fromPointNormal(c,h),s+=2}return this}computeVisibility(t){let r=ht.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case ht.OUTSIDE:return ht.OUTSIDE;case ht.INTERSECTING:r=ht.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(ft(Number.isFinite(r),"parentPlaneMask is required."),r===vt.MASK_OUTSIDE||r===vt.MASK_INSIDE)return r;let n=vt.MASK_INSIDE,s=this.planes;for(let o=0;o<this.planes.length;++o){let i=o<31?1<<o:0;if(o<31&&!(r&i))continue;let a=s[o],f=t.intersectPlane(a);if(f===ht.OUTSIDE)return vt.MASK_OUTSIDE;f===ht.INTERSECTING&&(n|=i)}return n}};vt.MASK_OUTSIDE=4294967295;vt.MASK_INSIDE=0;vt.MASK_INDETERMINATE=2147483647;var mF=new b,pF=new b,gF=new b,xF=new b,BF=new b;var MF=new b,bF=new b,wF=new b,IF=new b,SF=new b,RF=new b,FF=new b,DF=new b,LF=new b,OF=new b,vF=new b,NF=new b;var re=new Z,kB=new Z,JB=new Z,Bo=new Z,vu=new Z;function Xa(e,t={}){let r=Ht.EPSILON20,n=10,s=0,o=0,i=kB,a=JB;i.identity(),a.copy(e);let f=r*zB(a);for(;o<n&&QB(a)>f;)VB(a,Bo),vu.copy(Bo).transpose(),a.multiplyRight(Bo),a.multiplyLeft(vu),i.multiplyRight(Bo),++s>2&&(++o,s=0);return t.unitary=i.toTarget(t.unitary),t.diagonal=a.toTarget(t.diagonal),t}function zB(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var ja=[1,0,0],Ka=[2,2,1];function QB(e){let t=0;for(let r=0;r<3;++r){let n=e[re.getElementIndex(Ka[r],ja[r])];t+=2*n*n}return Math.sqrt(t)}function VB(e,t){let r=Ht.EPSILON15,n=0,s=1;for(let c=0;c<3;++c){let h=Math.abs(e[re.getElementIndex(Ka[c],ja[c])]);h>n&&(s=c,n=h)}let o=ja[s],i=Ka[s],a=1,f=0;if(Math.abs(e[re.getElementIndex(i,o)])>r){let c=e[re.getElementIndex(i,i)],h=e[re.getElementIndex(o,o)],l=e[re.getElementIndex(i,o)],u=(c-h)/2/l,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 Z.IDENTITY.to(t),t[re.getElementIndex(o,o)]=t[re.getElementIndex(i,i)]=a,t[re.getElementIndex(i,o)]=f,t[re.getElementIndex(o,i)]=-f,t}var De=new b,KB=new b,XB=new b,YB=new b,ZB=new b,qB=new Z,WB={diagonal:new Z,unitary:new Z};function Ya(e,t=new tr){if(!e||e.length===0)return t.halfAxes=new Z([0,0,0,0,0,0,0,0,0]),t.center=new b,t;let r=e.length,n=new b(0,0,0);for(let x of e)n.add(x);let s=1/r;n.multiplyByScalar(s);let o=0,i=0,a=0,f=0,c=0,h=0;for(let x of e){let g=De.copy(x).subtract(n);o+=g.x*g.x,i+=g.x*g.y,a+=g.x*g.z,f+=g.y*g.y,c+=g.y*g.z,h+=g.z*g.z}o*=s,i*=s,a*=s,f*=s,c*=s,h*=s;let l=qB;l[0]=o,l[1]=i,l[2]=a,l[3]=i,l[4]=f,l[5]=c,l[6]=a,l[7]=c,l[8]=h;let{unitary:u}=Xa(l,WB),d=t.halfAxes.copy(u),A=d.getColumn(0,XB),m=d.getColumn(1,YB),p=d.getColumn(2,ZB),E=-Number.MAX_VALUE,y=-Number.MAX_VALUE,C=-Number.MAX_VALUE,M=Number.MAX_VALUE,T=Number.MAX_VALUE,I=Number.MAX_VALUE;for(let x of e)De.copy(x),E=Math.max(De.dot(A),E),y=Math.max(De.dot(m),y),C=Math.max(De.dot(p),C),M=Math.min(De.dot(A),M),T=Math.min(De.dot(m),T),I=Math.min(De.dot(p),I);A=A.multiplyByScalar(.5*(M+E)),m=m.multiplyByScalar(.5*(T+y)),p=p.multiplyByScalar(.5*(I+C)),t.center.copy(A).add(m).add(p);let w=KB.set(E-M,y-T,C-I).multiplyByScalar(.5),L=new Z([w[0],0,0,0,w[1],0,0,0,w[2]]);return t.halfAxes.multiplyRight(L),t}function Eo(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=Va(t,r),s=Qa(t),o=s[0],i=s[1],a=Ae.WGS84.cartographicToCartesian([o,i,r.maximumHeight]),f=new b(a[0],a[1],a[2]);n.push(f);let c=Ya(n);return[...c.center,...c.halfAxes]}var $B=4,t2=8,e2={QUADTREE:$B,OCTREE:t2};function r2(e,t,r){if(e?.box){let n=zn(e.s2VolumeInfo.token),s=Ua(n,t),o=Ga(s),i={...e.s2VolumeInfo};switch(i.token=o,r){case"OCTREE":let c=e.s2VolumeInfo,h=c.maximumHeight-c.minimumHeight,l=h/2,u=c.minimumHeight+h/2;c.minimumHeight=u-l,c.maximumHeight=u+l;break;default:break}return{box:Eo(i),s2VolumeInfo:i}}}async function qa(e){let{implicitOptions:t,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,s2VolumeBox:s,loaderOptions:o}=e,{subtree:i,level:a=0,globalData:f={level:0,mortonIndex:0,x:0,y:0,z:0}}=e,{subdivisionScheme:c,subtreeLevels:h,maximumLevel:l,contentUrlTemplate:u,subtreesUriTemplate:d,basePath:A}=t,m={children:[],lodMetricValue:0,contentUrl:""};if(!l)return Oa.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${u} won't be loaded...`),m;let p=a+f.level;if(p>l)return m;let E=e2[c],y=Math.log2(E),C=n&1,M=n>>1&1,T=n>>2&1,I=(E**a-1)/(E-1),w=er(r.mortonIndex,n,y),L=I+w,x=er(r.x,C,1),g=er(r.y,M,1),B=er(r.z,T,1),_=!1;a>=h&&(_=Za(i.childSubtreeAvailability,w));let U=er(f.x,x,a),G=er(f.y,g,a),P=er(f.z,B,a);if(_){let ke=`${A}/${d}`,us=_o(ke,p,U,G,P);i=await(0,Nu.load)(us,Kr,o),f={mortonIndex:w,x,y:g,z:B,level:a},w=0,L=0,x=0,g=0,B=0,a=0}if(!Za(i.tileAvailability,L))return m;Za(i.contentAvailability,L)&&(m.contentUrl=_o(u,p,U,G,P));let mt=a+1,X={mortonIndex:w,x,y:g,z:B};for(let ke=0;ke<E;ke++){let us=r2(s,ke,c),pr=await qa({subtree:i,implicitOptions:t,loaderOptions:o,parentData:X,childIndex:ke,level:mt,globalData:{...f},s2VolumeBox:us});if(pr.contentUrl||pr.children.length){let S=p+1,R=n2(pr,S,{childTileX:x,childTileY:g,childTileZ:B},t,s);m.children.push(R)}}return m}function Za(e,t){let r;return Array.isArray(e)?(r=e[0],e.length>1&&Oa.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=e,"constant"in r?Boolean(r.constant):r.explicitBitstream?i2(t,r.explicitBitstream):!1}function n2(e,t,r,n,s){let{basePath:o,refine:i,getRefine:a,lodMetricType:f,getTileType:c,rootLodMetricValue:h,rootBoundingVolume:l}=n,u=e.contentUrl&&e.contentUrl.replace(`${o}/`,""),d=h/2**t,A=s?.box?{box:s.box}:l,m=s2(t,A,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:u},id:e.contentUrl,refine:a(i),type:c(e),lodMetricType:f,lodMetricValue:d,geometricError:d,transform:e.transform,boundingVolume:m}}function s2(e,t,r){if(t.region){let{childTileX:n,childTileY:s,childTileZ:o}=r,[i,a,f,c,h,l]=t.region,u=2**e,d=(f-i)/u,A=(c-a)/u,m=(l-h)/u,[p,E]=[i+d*n,i+d*(n+1)],[y,C]=[a+A*s,a+A*(s+1)],[M,T]=[h+m*o,h+m*(o+1)];return{region:[p,y,E,C,M,T]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${JSON.stringify(t)}`)}function er(e,t,r){return(e<<r)+t}function _o(e,t,r,n,s){let o=o2({level:t,x:r,y:n,z:s});return e.replace(/{level}|{x}|{y}|{z}/gi,i=>o[i])}function o2(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function i2(e,t){let r=Math.floor(e/8),n=e%8;return(t[r]>>n&1)===1}function $a(e,t=""){if(!t)return Ce.EMPTY;let n=t.split("?")[0].split(".").pop();switch(n){case"pnts":return Ce.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return Ce.SCENEGRAPH;default:return n||Ce.EMPTY}}function tc(e){switch(e){case"REPLACE":case"replace":return Ir.REPLACE;case"ADD":case"add":return Ir.ADD;default:return e}}function Wa(e,t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){let n=new URL(e,`${t}/`);return decodeURI(n.toString())}else if(e.startsWith("/"))return e;return Tr.resolve(t,e)}function Gu(e,t){if(!e)return null;let r;if(e.content){let s=e.content.uri||e.content?.url;typeof s<"u"&&(r=Wa(s,t))}return{...e,id:r,contentUrl:r,lodMetricType:le.GEOMETRIC_ERROR,lodMetricValue:e.geometricError,transformMatrix:e.transform,type:$a(e,r),refine:tc(e.refine)}}async function ku(e,t,r){let n=null,s=Pu(e.root);s&&e.root?n=await Uu(e.root,e,t,s,r):n=Gu(e.root,t);let o=[];for(o.push(n);o.length>0;){let i=o.pop()||{},a=i.children||[],f=[];for(let c of a){let h=Pu(c),l;h?l=await Uu(c,e,t,h,r):l=Gu(c,t),l&&(f.push(l),o.push(l))}i.children=f}return n}async function Uu(e,t,r,n,s){let{subdivisionScheme:o,maximumLevel:i,availableLevels:a,subtreeLevels:f,subtrees:{uri:c}}=n,h=_o(c,0,0,0,0),l=Wa(h,r),u=await(0,Hu.load)(l,Kr,s),d=e.content?.uri,A=d?Wa(d,r):"",m=t?.root?.refine,p=e.geometricError,E=e.boundingVolume.extensions?.["3DTILES_bounding_volume_S2"];if(E){let T={box:Eo(E),s2VolumeInfo:E};e.boundingVolume=T}let y=e.boundingVolume,C={contentUrlTemplate:A,subtreesUriTemplate:c,subdivisionScheme:o,subtreeLevels:f,maximumLevel:Number.isFinite(a)?a-1:i,refine:m,basePath:r,lodMetricType:le.GEOMETRIC_ERROR,rootLodMetricValue:p,rootBoundingVolume:y,getTileType:$a,getRefine:tc};return await a2(e,r,u,C,s)}async function a2(e,t,r,n,s){if(!e)return null;let{children:o,contentUrl:i}=await qa({subtree:r,implicitOptions:n,loaderOptions:s}),a,f=null;return i&&(a=i,f={uri:i.replace(`${t}/`,"")}),{...e,id:a,contentUrl:a,lodMetricType:le.GEOMETRIC_ERROR,lodMetricValue:e.geometricError,transformMatrix:e.transform,type:$a(e,a),refine:tc(e.refine),content:f||e.content,children:o}}function Pu(e){return e?.extensions?.["3DTILES_implicit_tiling"]||e?.implicitTiling}var rr={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:c2,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function c2(e,t={},r){let n=t["3d-tiles"]||{},s;return n.isTileset==="auto"?s=r?.url&&r.url.indexOf(".json")!==-1:s=n.isTileset,s?f2(e,t,r):h2(e,t,r)}async function f2(e,t,r){let n=JSON.parse(new TextDecoder().decode(e)),s=r?.url||"",o=l2(s),i=await ku(n,o,t||{});return{...n,shape:"tileset3d",loader:rr,url:s,queryString:r?.queryString||"",basePath:o,root:i||n.root,type:Cn.TILES3D,lodMetricType:le.GEOMETRIC_ERROR,lodMetricValue:n.root?.geometricError||0}}async function h2(e,t,r){let n={content:{shape:"tile3d",featureIds:null}};return await Fa(e,0,t,r,n.content),n.content}function l2(e){return Tr.dirname(e)}var yo=gr(pn(),1);var Ju="https://api.cesium.com/v1/assets";async function To(e,t){if(!t){let o=await u2(e);for(let i of o.items)i.type==="3DTILES"&&(t=i.id)}let r=await d2(e,t),{type:n,url:s}=r;return J(n==="3DTILES"&&s),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function u2(e){J(e);let t=Ju,r={Authorization:`Bearer ${e}`},n=await(0,yo.fetchFile)(t,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function d2(e,t){J(e,t);let r={Authorization:`Bearer ${e}`},n=`${Ju}/${t}`,s=await(0,yo.fetchFile)(`${n}`,{headers:r});if(!s.ok)throw new Error(s.statusText);let o=await s.json();if(s=await(0,yo.fetchFile)(`${n}/endpoint`,{headers:r}),!s.ok)throw new Error(s.statusText);let i=await s.json();return o={...o,...i},o}async function A2(e,t={}){t=t["cesium-ion"]||{};let{accessToken:r}=t,n=t.assetId;if(!Number.isFinite(n)){let s=e.match(/\/([0-9]+)\/tileset.json/);n=s&&s[1]}return To(r,n)}var ec={...rr,id:"cesium-ion",name:"Cesium Ion",preload:A2,parse:async(e,t,r)=>(t={...t},t["3d-tiles"]=t["cesium-ion"],t.loader=ec,rr.parse(e,t,r)),options:{"cesium-ion":{...rr.options["3d-tiles"],accessToken:null}}};var Vn=async(e,t)=>{let r=[await e.getUint8(e.length-1n),await e.getUint8(e.length-2n),await e.getUint8(e.length-3n),void 0],n=0n;for(let s=e.length-4n;s>-1;s--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=await e.getUint8(s),r.every((o,i)=>o===t[i])){n=s;break}return n};var zu=new Uint8Array([80,75,5,6]),Qu=new Uint8Array([80,75,6,7]),Vu=new Uint8Array([80,75,6,6]),m2=8n;var p2=16n;var g2=8n,x2=24n;var B2=48n;var ju=async e=>{let t=await Vn(e,zu),r=BigInt(await e.getUint16(t+m2)),n=BigInt(await e.getUint32(t+p2)),s=t-20n,o=0n,i=await e.slice(s,s+4n);if(Te(i,Qu)){o=await e.getBigUint64(s+g2);let a=await e.slice(o,o+4n);if(!Te(a,Vu.buffer))throw new Error("zip64 EoCD not found");r=await e.getBigUint64(o+x2),n=await e.getBigUint64(o+B2)}else s=0n;return{cdRecordsNumber:r,cdStartOffset:n,offsets:{zip64EoCDOffset:o,zip64EoCDLocatorOffset:s,zipEoCDOffset:t}}};var GD=[{offset:0,size:4,default:new DataView(zu.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 UD=[{offset:0,size:4,default:new DataView(Qu.buffer).getUint32(0,!0)},{offset:4,size:4,default:0},{offset:8,size:8,name:"eoCDStart"},{offset:16,size:4,default:1}],PD=[{offset:0,size:4,default:new DataView(Vu.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 E2=20n,_2=24n,y2=28n,T2=30n,C2=32n,M2=42n,rc=46n,Kn=new Uint8Array([80,75,1,2]),jn=async(e,t)=>{let r=await t.slice(e,e+4n);if(!Te(r,Kn.buffer))return null;let n=BigInt(await t.getUint32(e+E2)),s=BigInt(await t.getUint32(e+_2)),o=await t.getUint16(e+T2),i=BigInt(await t.getUint16(e+C2)),a=await t.getUint16(e+y2),f=await t.slice(e+rc,e+rc+BigInt(a)),c=new TextDecoder().decode(f),h=e+rc+BigInt(a),l=await t.getUint32(e+M2),u=BigInt(l),d=new DataView(await t.slice(h,h+BigInt(o))),A={uncompressedSize:s,compressedSize:n,localHeaderOffset:u,startDisk:i},m=b2(A,d);return{...A,...m,extraFieldLength:o,fileNameLength:a,fileName:c,extraOffset:h}};async function*en(e){let{cdStartOffset:t}=await ju(e),r=await jn(t,e);for(;r;)yield r,r=await jn(r.extraOffset+BigInt(r.extraFieldLength),e)}var Ku=(...e)=>e[0]+e[1]*16,b2=(e,t)=>{let r=w2(e),n={};if(r.length>0){let s=r.reduce((a,f)=>a+f.length,0),o=new Uint8Array(t.buffer).findIndex((a,f,c)=>Ku(c[f],c[f+1])===1&&Ku(c[f+2],c[f+3])===s),i=0;for(let a of r){let f=i;n[a.name]=t.getBigUint64(o+4+f,!0),i=f+a.length}}return n},w2=e=>{let t=[];return e.uncompressedSize===BigInt(4294967295)&&t.push({name:"uncompressedSize",length:8}),e.compressedSize===BigInt(4294967295)&&t.push({name:"compressedSize",length:8}),e.localHeaderOffset===BigInt(4294967295)&&t.push({name:"localHeaderOffset",length:8}),e.startDisk===BigInt(4294967295)&&t.push({name:"startDisk",length:4}),t};var zD=[{offset:0,size:4,default:new DataView(Kn.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 I2=8n,S2=18n,R2=22n,F2=26n,D2=28n,Co=30n,nc=new Uint8Array([80,75,3,4]),nr=async(e,t)=>{let r=await t.slice(e,e+4n);if(!Te(r,nc))return null;let n=await t.getUint16(e+F2),s=new TextDecoder().decode(await t.slice(e+Co,e+Co+BigInt(n))).split("\\").join("/"),o=await t.getUint16(e+D2),i=e+Co+BigInt(n+o),a=await t.getUint16(e+I2),f=BigInt(await t.getUint32(e+S2)),c=BigInt(await t.getUint32(e+R2)),h=e+Co+BigInt(n),l=4n;return c===BigInt(4294967295)&&(c=await t.getBigUint64(h+l),l+=8n),f===BigInt(4294967295)&&(f=await t.getBigUint64(h+l),l+=8n),i===BigInt(4294967295)&&(i=await t.getBigUint64(h+l)),{fileNameLength:n,fileName:s,extraFieldLength:o,fileDataOffset:i,compressedSize:f,compressionMethod:a}};var jD=[{offset:0,size:4,default:new DataView(nc.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 Mo=class{constructor(t={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(t,r="base64"){let n=[];for await(let i of t)n.push(i),yield i;let s=await this.concatenate(n),o=await this.hash(s,r);this.options.crypto?.onEnd?.({hash:o})}async concatenate(t){return await Bn(t)}};function Xu(e){e=`${e}`;for(let r=0;r<e.length;r++)if(e.charCodeAt(r)>255)return null;let t="";for(let r=0;r<e.length;r+=3){let n=[void 0,void 0,void 0,void 0];n[0]=e.charCodeAt(r)>>2,n[1]=(e.charCodeAt(r)&3)<<4,e.length>r+1&&(n[1]|=e.charCodeAt(r+1)>>4,n[2]=(e.charCodeAt(r+1)&15)<<2),e.length>r+2&&(n[2]|=e.charCodeAt(r+2)>>6,n[3]=e.charCodeAt(r+2)&63);for(let s=0;s<n.length;s++)typeof n[s]>"u"?t+="=":t+=L2(n[s])}return t}function L2(e){if(e<26)return String.fromCharCode(e+"A".charCodeAt(0));if(e<52)return String.fromCharCode(e-26+"a".charCodeAt(0));if(e<62)return String.fromCharCode(e-52+"0".charCodeAt(0));if(e===62)return"+";if(e===63)return"/"}function Yu(e,t){switch(t){case"hex":return e;case"base64":return O2(e);default:throw new Error(t)}}function O2(e){e.length%2!==0&&(e=`0${e}`);let r=(e.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return Xu(r)||""}var qu=typeof atob=="function"?atob:typeof Buffer=="function"?k2:$u,v2=qu("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALB7oCJQhvbmVGdWxsQQAYCG9uZUZ1bGxCABkIb25lRnVsbEMAGghvbmVGdWxsRAAbBWxvb3BzAAEEbG9vcAACBXByaW1lAAMFbG9vcEEABAZsb29wQTEABQZsb29wQTIABgZsb29wQTMABwZsb29wQTQACAVsb29wQgAJBmxvb3BCMQAKBmxvb3BCMgALBmxvb3BCMwAMBmxvb3BCNAANBWxvb3BDAA4GbG9vcEMxAA8GbG9vcEMyABAGbG9vcEMzABEGbG9vcEM0ABIFbG9vcEQAEwZsb29wRDEAFAZsb29wRDIAFQZsb29wRDMAFgZsb29wRDQAFwRnZXRBACgEZ2V0QgApBGdldEMAKgRnZXREACsEZ2V0WAAsBHNldEEALQRzZXRCAC4Ec2V0QwAvBHNldEQAMARzZXRYADEKzA0xWwEBf0EAJAggAEEGdCEBAkADQCMIIAFGDQEjACQEIwEkBSMCJAYjAyQHEAIjBCMAaiQAIwUjAWokASMGIwJqJAIjByMDaiQDIwhBwABqJAgMAAsLIwgjGmokGgsTACMIIxpqJAkQAxAEEAkQDhATC6IBAEEAIwlqKAIAJApBBCMJaigCACQLQQgjCWooAgAkDEEMIwlqKAIAJA1BECMJaigCACQOQRQjCWooAgAkD0EYIwlqKAIAJBBBHC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9vcEE0CQVsb29wQgoGbG9vcEIxCwZsb29wQjIMBmxvb3BCMw0GbG9vcEI0DgVsb29wQw8GbG9vcEMxEAZsb29wQzIRBmxvb3BDMxIGbG9vcEM0EwVsb29wRBQGbG9vcEQxFQZsb29wRDIWBmxvb3BEMxcGbG9vcEQ0GAhvbmVGdWxsQRkIb25lRnVsbEIaCG9uZUZ1bGxDGwhvbmVGdWxsRBwIdHdvRnVsbEEdCHR3b0Z1bGxCHgh0d29GdWxsQx8IdHdvRnVsbEQgCHRyZUZ1bGxBIQh0cmVGdWxsQiIIdHJlRnVsbEMjCHRyZUZ1bGxEJAhxdWFGdWxsQSUIcXVhRnVsbEImCHF1YUZ1bGxDJwhxdWFGdWxsRCgEZ2V0QSkEZ2V0QioEZ2V0QysEZ2V0RCwEZ2V0WC0Ec2V0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),sc=WebAssembly&&qu!==$u?H2(v2).buffer:!1,ne=J2(),oc=240*16*16,Wu=Math.floor(oc*16*1.066666667),N2=268435456-65536,Zu="Parameter must be Buffer, ArrayBuffer or Uint8Array",G2="Parameter exceeds max size of 255.9 Mbytes";sc||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function ic(e){var t,r,n,s,o,i,a,f,c,h;let l=P2(),u=U2(),d={},A=new Date().getTime();return d.then=function(y){return a=y,p(),d},d.catch=function(y){return f=y,d},e&&typeof e=="object"?typeof Buffer=="function"&&e.constructor===Buffer?i=e:e.constructor===Uint8Array||e.constructor===ArrayBuffer?i=e.constructor===ArrayBuffer?new Uint8Array(e):e:E(new TypeError(Zu)):E(new TypeError(Zu)),i&&(o=i.length,sc&&o>Wu?o>N2?E(new Error(G2)):(t=new WebAssembly.Memory({initial:o>32e6?o>64e6?o>128e6?4096:2048:1024:512}),r=new Uint32Array(t.buffer),s={mem:t,log:console.log},n={imports:s},WebAssembly.instantiate(sc,n).then(m)):p(l(i))),d;function m(y){p(u(i,y.instance.exports,r))}function p(y){var C=Boolean(y)?y:c;Boolean(y)&&(h=new Date().getTime()),typeof a=="function"?Boolean(C)&&(a(C,h-A),a=f=null):Boolean(y)&&(c=y)}function E(y){typeof f=="function"&&f(y)}}function U2(){var e,t,r,n,s,o,i,a,f,c,h,l,u,d=function(A){var m,p,E,y,C,M,T,I,w,L,x,g,B,_,U,G,P,v,at,mt,X,ke,us=new Date().getTime(),pr=0,S=1732584193,F=-271733879,R=-1732584194,D=271733878,tt=0,mn=A.length*8,ds;for(ds=Zd(A,u),u[mn>>>5]|=128<<mn%32,u[(mn+64>>>9<<4)+14]=mn,ds=(mn+64>>>9<<4)+15,X=u;tt<ds;)ds>tt+Wu?(n(S),o(F),a(R),c(D),t(oc),tt=tt+oc*16,S=r(),F=s(),R=i(),D=f(),pr++):(P=S,v=F,at=R,mt=D,m=X[tt+0]>>>0,p=X[tt+1]>>>0,E=X[tt+2]>>>0,y=X[tt+3]>>>0,C=X[tt+4]>>>0,M=X[tt+5]>>>0,T=X[tt+6]>>>0,I=X[tt+7]>>>0,w=X[tt+8]>>>0,L=X[tt+9]>>>0,x=X[tt+10]>>>0,g=X[tt+11]>>>0,B=X[tt+12]>>>0,_=X[tt+13]>>>0,U=X[tt+14]>>>0,G=X[tt+15]>>>0,S=N(7,25,S+(F&R|~F&D)+m-680876936)+F,D=N(12,20,D+(S&F|~S&R)+p-389564586)+S,R=N(17,15,R+(D&S|~D&F)+E+606105819)+D,F=N(22,10,F+(R&D|~R&S)+y-1044525330)+R,S=N(7,25,S+(F&R|~F&D)+C-176418897)+F,D=N(12,20,D+(S&F|~S&R)+M+1200080426)+S,R=N(17,15,R+(D&S|~D&F)+T-1473231341)+D,F=N(22,10,F+(R&D|~R&S)+I-45705983)+R,S=N(7,25,S+(F&R|~F&D)+w+1770035416)+F,D=N(12,20,D+(S&F|~S&R)+L-1958414417)+S,R=N(17,15,R+(D&S|~D&F)+x-42063)+D,F=N(22,10,F+(R&D|~R&S)+g-1990404162)+R,S=N(7,25,S+(F&R|~F&D)+B+1804603682)+F,D=N(12,20,D+(S&F|~S&R)+_-40341101)+S,R=N(17,15,R+(D&S|~D&F)+U-1502002290)+D,F=N(22,10,F+(R&D|~R&S)+G+1236535329)+R,S=N(5,27,S+(F&D|R&~D)+p-165796510)+F,D=N(9,23,D+(S&R|F&~R)+T-1069501632)+S,R=N(14,18,R+(D&F|S&~F)+g+643717713)+D,F=N(20,12,F+(R&S|D&~S)+m-373897302)+R,S=N(5,27,S+(F&D|R&~D)+M-701558691)+F,D=N(9,23,D+(S&R|F&~R)+x+38016083)+S,R=N(14,18,R+(D&F|S&~F)+G-660478335)+D,F=N(20,12,F+(R&S|D&~S)+C-405537848)+R,S=N(5,27,S+(F&D|R&~D)+L+568446438)+F,D=N(9,23,D+(S&R|F&~R)+U-1019803690)+S,R=N(14,18,R+(D&F|S&~F)+y-187363961)+D,F=N(20,12,F+(R&S|D&~S)+w+1163531501)+R,S=N(5,27,S+(F&D|R&~D)+_-1444681467)+F,D=N(9,23,D+(S&R|F&~R)+E-51403784)+S,R=N(14,18,R+(D&F|S&~F)+I+1735328473)+D,F=N(20,12,F+(R&S|D&~S)+B-1926607734)+R,S=N(4,28,S+(F^R^D)+M-378558)+F,D=N(11,21,D+(S^F^R)+w-2022574463)+S,R=N(16,16,R+(D^S^F)+g+1839030562)+D,F=N(23,9,F+(R^D^S)+U-35309556)+R,S=N(4,28,S+(F^R^D)+p-1530992060)+F,D=N(11,21,D+(S^F^R)+C+1272893353)+S,R=N(16,16,R+(D^S^F)+I-155497632)+D,F=N(23,9,F+(R^D^S)+x-1094730640)+R,S=N(4,28,S+(F^R^D)+_+681279174)+F,D=N(11,21,D+(S^F^R)+m-358537222)+S,R=N(16,16,R+(D^S^F)+y-722521979)+D,F=N(23,9,F+(R^D^S)+T+76029189)+R,S=N(4,28,S+(F^R^D)+L-640364487)+F,D=N(11,21,D+(S^F^R)+B-421815835)+S,R=N(16,16,R+(D^S^F)+G+530742520)+D,F=N(23,9,F+(R^D^S)+E-995338651)+R,S=N(6,26,S+(R^(F|~D))+m-198630844)+F,D=N(10,22,D+(F^(S|~R))+I+1126891415)+S,R=N(15,17,R+(S^(D|~F))+U-1416354905)+D,F=N(21,11,F+(D^(R|~S))+M-57434055)+R,S=N(6,26,S+(R^(F|~D))+B+1700485571)+F,D=N(10,22,D+(F^(S|~R))+y-1894986606)+S,R=N(15,17,R+(S^(D|~F))+x-1051523)+D,F=N(21,11,F+(D^(R|~S))+p-2054922799)+R,S=N(6,26,S+(R^(F|~D))+w+1873313359)+F,D=N(10,22,D+(F^(S|~R))+G-30611744)+S,R=N(15,17,R+(S^(D|~F))+T-1560198380)+D,F=N(21,11,F+(D^(R|~S))+_+1309151649)+R,S=N(6,26,S+(R^(F|~D))+C-145523070)+F,D=N(10,22,D+(F^(S|~R))+g-1120210379)+S,R=N(15,17,R+(S^(D|~F))+E+718787259)+D,F=N(21,11,F+(D^(R|~S))+L-343485551)+R,tt=tt+16,S=S+P>>>0,F=F+v>>>0,R=R+at>>>0,D=D+mt>>>0);return ne.endian([S,F,R,D]);function N(pt,As,Xt){return Xt<<pt|Xt>>>As}function Zd(pt,As){for(var Xt=-1,zo=Math.floor((pt.length-1)/4),Bt=0,Vc,jc,Kc,Xc;zo-8>Xt++;)Bt=Xt<<2,As[Xt]=pt[Bt+0]|pt[Bt+1]<<8|pt[Bt+2]<<16|pt[Bt+3]<<24;for(Xt--;zo>Xt++;)Bt=Xt<<2,Vc=typeof pt[Bt+0]>"u"?0:pt[Bt+0],jc=typeof pt[Bt+1]>"u"?0:pt[Bt+1],Kc=typeof pt[Bt+2]>"u"?0:pt[Bt+2],Xc=typeof pt[Bt+3]>"u"?0:pt[Bt+3],As[Xt]=Vc|jc<<8|Kc<<16|Xc<<24;return zo+1}};return function(A,m,p,E){var y;return t=m.loops,e=m.loop,r=m.getA,s=m.getB,i=m.getC,f=m.getD,h=m.getX,n=m.setA,o=m.setB,a=m.setC,c=m.setD,l=m.setX,u=p,y=ne.wordsToBytes(d(A)),E&&E.asBytes?y:ne.bytesconvertNumberToHex(y)}}function P2(){var e=function(t,r){var n,s,o,i,a,f,c,h,l,u,d,A,m,p,E,y,C,M,T,I,w,L=new Date().getTime(),x=1732584193,g=-271733879,B=-1732584194,_=271733878,U=t.length*8;w=ne.bytesToWords(t);for(var G=0;G<w.length;G++)w[G]=(w[G]<<8|w[G]>>>24)&16711935|(w[G]<<24|w[G]>>>8)&4278255360;w[U>>>5]|=128<<U%32,w[(U+64>>>9<<4)+14]=U;for(var P=0;P<w.length;P+=16)C=x,M=g,T=B,I=_,n=w[P+0]>>>0,s=w[P+1]>>>0,o=w[P+2]>>>0,i=w[P+3]>>>0,a=w[P+4]>>>0,f=w[P+5]>>>0,c=w[P+6]>>>0,h=w[P+7]>>>0,l=w[P+8]>>>0,u=w[P+9]>>>0,d=w[P+10]>>>0,A=w[P+11]>>>0,m=w[P+12]>>>0,p=w[P+13]>>>0,E=w[P+14]>>>0,y=w[P+15]>>>0,x=v(7,25,x+(g&B|~g&_)+n-680876936)+g,_=v(12,20,_+(x&g|~x&B)+s-389564586)+x,B=v(17,15,B+(_&x|~_&g)+o+606105819)+_,g=v(22,10,g+(B&_|~B&x)+i-1044525330)+B,x=v(7,25,x+(g&B|~g&_)+a-176418897)+g,_=v(12,20,_+(x&g|~x&B)+f+1200080426)+x,B=v(17,15,B+(_&x|~_&g)+c-1473231341)+_,g=v(22,10,g+(B&_|~B&x)+h-45705983)+B,x=v(7,25,x+(g&B|~g&_)+l+1770035416)+g,_=v(12,20,_+(x&g|~x&B)+u-1958414417)+x,B=v(17,15,B+(_&x|~_&g)+d-42063)+_,g=v(22,10,g+(B&_|~B&x)+A-1990404162)+B,x=v(7,25,x+(g&B|~g&_)+m+1804603682)+g,_=v(12,20,_+(x&g|~x&B)+p-40341101)+x,B=v(17,15,B+(_&x|~_&g)+E-1502002290)+_,g=v(22,10,g+(B&_|~B&x)+y+1236535329)+B,x=v(5,27,x+(g&_|B&~_)+s-165796510)+g,_=v(9,23,_+(x&B|g&~B)+c-1069501632)+x,B=v(14,18,B+(_&g|x&~g)+A+643717713)+_,g=v(20,12,g+(B&x|_&~x)+n-373897302)+B,x=v(5,27,x+(g&_|B&~_)+f-701558691)+g,_=v(9,23,_+(x&B|g&~B)+d+38016083)+x,B=v(14,18,B+(_&g|x&~g)+y-660478335)+_,g=v(20,12,g+(B&x|_&~x)+a-405537848)+B,x=v(5,27,x+(g&_|B&~_)+u+568446438)+g,_=v(9,23,_+(x&B|g&~B)+E-1019803690)+x,B=v(14,18,B+(_&g|x&~g)+i-187363961)+_,g=v(20,12,g+(B&x|_&~x)+l+1163531501)+B,x=v(5,27,x+(g&_|B&~_)+p-1444681467)+g,_=v(9,23,_+(x&B|g&~B)+o-51403784)+x,B=v(14,18,B+(_&g|x&~g)+h+1735328473)+_,g=v(20,12,g+(B&x|_&~x)+m-1926607734)+B,x=v(4,28,x+(g^B^_)+f-378558)+g,_=v(11,21,_+(x^g^B)+l-2022574463)+x,B=v(16,16,B+(_^x^g)+A+1839030562)+_,g=v(23,9,g+(B^_^x)+E-35309556)+B,x=v(4,28,x+(g^B^_)+s-1530992060)+g,_=v(11,21,_+(x^g^B)+a+1272893353)+x,B=v(16,16,B+(_^x^g)+h-155497632)+_,g=v(23,9,g+(B^_^x)+d-1094730640)+B,x=v(4,28,x+(g^B^_)+p+681279174)+g,_=v(11,21,_+(x^g^B)+n-358537222)+x,B=v(16,16,B+(_^x^g)+i-722521979)+_,g=v(23,9,g+(B^_^x)+c+76029189)+B,x=v(4,28,x+(g^B^_)+u-640364487)+g,_=v(11,21,_+(x^g^B)+m-421815835)+x,B=v(16,16,B+(_^x^g)+y+530742520)+_,g=v(23,9,g+(B^_^x)+o-995338651)+B,x=v(6,26,x+(B^(g|~_))+n-198630844)+g,_=v(10,22,_+(g^(x|~B))+h+1126891415)+x,B=v(15,17,B+(x^(_|~g))+E-1416354905)+_,g=v(21,11,g+(_^(B|~x))+f-57434055)+B,x=v(6,26,x+(B^(g|~_))+m+1700485571)+g,_=v(10,22,_+(g^(x|~B))+i-1894986606)+x,B=v(15,17,B+(x^(_|~g))+d-1051523)+_,g=v(21,11,g+(_^(B|~x))+s-2054922799)+B,x=v(6,26,x+(B^(g|~_))+l+1873313359)+g,_=v(10,22,_+(g^(x|~B))+y-30611744)+x,B=v(15,17,B+(x^(_|~g))+c-1560198380)+_,g=v(21,11,g+(_^(B|~x))+p+1309151649)+B,x=v(6,26,x+(B^(g|~_))+a-145523070)+g,_=v(10,22,_+(g^(x|~B))+A-1120210379)+x,B=v(15,17,B+(x^(_|~g))+o+718787259)+_,g=v(21,11,g+(_^(B|~x))+u-343485551)+B,x=x+C>>>0,g=g+M>>>0,B=B+T>>>0,_=_+I>>>0;return ne.endian([x,g,B,_]);function v(at,mt,X){return X<<at|X>>>mt}};return function(t,r){var n=ne.wordsToBytes(e(t,r)),s=r&&r.asBytes?n:ne.bytesconvertNumberToHex(n);return s}}function H2(e){var t,r,n,s=-1;for(t=e.length-1,r=new ArrayBuffer(e.length),n=new Uint8Array(r);t>s++;)n[s]=e.charCodeAt(s);return n}function k2(e){return Buffer.from(e,"base64").toString("binary")}function $u(e){return e}function J2(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(t,r){return t<<r|t>>>32-r},endian:function(t){if(t.constructor==Number)return ne.rotl(t,8)&16711935|ne.rotl(t,24)&4278255360;for(var r=0;r<t.length;r++)t[r]=ne.endian(t[r]);return t},bytesToWords:function(t){for(var r=[],n=0,s=0;n<t.length;n++,s+=8)r[s>>>5]|=t[n]<<24-s%32;return r},wordsToBytes:function(t){for(var r=[],n=0;n<t.length*32;n+=8)r.push(t[n>>>5]>>>24-n%32&255);return r},bytesconvertNumberToHex:function(t){for(var r=[],n=0;n<t.length;n++)r.push((t[n]>>>4).toString(16)),r.push((t[n]&15).toString(16));return r.join("")}}}var sr=class extends Mo{name="md5";options;constructor(t={}){super(),this.options=t}async hash(t,r){let s=await new Promise((o,i)=>ic(t).then(o).catch(i));return Yu(s,r)}};var rn=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(t={}){gn(t)}async compress(t){return await this.preload(),this.compressSync(t)}async decompress(t,r){return await this.preload(),this.decompressSync(t,r)}compressSync(t){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(t,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(t){let r=await this.concatenate(t);yield this.compress(r)}async*decompressBatches(t){let r=await this.concatenate(t);yield this.decompress(r)}concatenate(t){return Bn(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var Xn=class extends rn{name="uncompressed";extensions=[];contentEncodings=[];isSupported=!0;options;constructor(t){super(t),this.options=t||{}}compressSync(t){return t}decompressSync(t){return t}async*compressBatches(t){return yield*t}async*decompressBatches(t){return yield*t}};var dr=gr(Hd(),1),ye=gr(kd(),1);var Ar=class extends rn{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(t={}){super(t),this.options=t}async compress(t){if(!Et&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await yr(ye.default.gzip)(t):await yr(ye.default.deflate)(t);return _r(r)}return this.compressSync(t)}async decompress(t){if(!Et&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await yr(ye.default.gunzip)(t):await yr(ye.default.inflate)(t);return _r(r)}return this.decompressSync(t)}compressSync(t){if(!Et&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?ye.default.gzipSync(t):ye.default.deflateSync(t);return _r(o)}let r=this.options?.deflate||{},n=new Uint8Array(t);return(this.options?.raw?dr.default.deflateRaw:dr.default.deflate)(n,r).buffer}decompressSync(t){if(!Et&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?ye.default.gunzipSync(t):ye.default.inflateSync(t);return _r(o)}let r=this.options?.deflate||{},n=new Uint8Array(t);return(this.options?.raw?dr.default.inflateRaw:dr.default.inflate)(n,r).buffer}async*compressBatches(t){let r=this.options?.deflate||{},n=new dr.default.Deflate(r);yield*this.transformBatches(n,t)}async*decompressBatches(t){let r=this.options?.deflate||{},n=new dr.default.Inflate(r);yield*this.transformBatches(n,t)}async*transformBatches(t,r){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(let i of r){let a=new Uint8Array(i);if(!t.push(a,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),s=t.push(n,!0);yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){let t=this._chunks;return this._chunks=[],t}_getError(t=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[t]}`}};var v_={0:async e=>e,8:async e=>await new Ar({raw:!0}).decompress(e)},Jo=class{fileProvider=null;fileName;archive=null;constructor(t){if(typeof t=="string")if(this.fileName=t,!Et)this.fileProvider=new yn(t);else throw new Error("Cannot open file for random access in a WEB browser");else t instanceof mr?(this.fileProvider=t.fileProvider,this.archive=t,this.fileName=t.fileName):Zo(t)&&(this.fileProvider=t)}async destroy(){this.fileProvider&&await this.fileProvider.destroy()}async readdir(){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let t=[],r=en(this.fileProvider);for await(let n of r)t.push(n.fileName);return t}async stat(t){let r=await this.getCDFileHeader(t);return{...r,size:Number(r.uncompressedSize)}}async fetch(t){this.fileName&&t.indexOf(this.fileName)===0&&(t=t.substring(this.fileName.length+1));let r;if(this.archive)r=await this.archive.getFile(t,"http");else{if(!this.fileProvider)throw new Error("No data detected in the zip archive");let s=await this.getCDFileHeader(t),o=await nr(s.localHeaderOffset,this.fileProvider);if(!o)throw new Error("Local file header has not been found in the zip archive`");let i=v_[o.compressionMethod.toString()];if(!i)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(o.fileDataOffset,o.fileDataOffset+o.compressedSize);r=await i(a)}let n=new Response(r);return Object.defineProperty(n,"url",{value:t?`${this.fileName||""}/${t}`:this.fileName||""}),n}async getCDFileHeader(t){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=en(this.fileProvider),n=null;for await(let s of r)if(s.fileName===t){n=s;break}if(!n)throw new Error("File has not been found in the zip archive");return n}};var mr=class{fileProvider;fileName;constructor(t,r,n){this.fileProvider=t,this.fileName=n}async getFileWithoutHash(t){return await(await new Jo(this.fileProvider).fetch(t)).arrayBuffer()}};function kc(e){let t=new DataView(e),r={};for(let n=0;n<e.byteLength;n=n+24){let s=t.getBigUint64(n+16,!0),o=N_(e,n,16);r[o]=s}return r}function N_(e,t,r){return[...new Uint8Array(e,t,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function Jc(e){let t=en(e);return G_(t)}async function G_(e){let t=new sr,r=new TextEncoder,n={};for await(let s of e){let o=s.fileName.split("\\").join("/").toLocaleLowerCase(),i=r.encode(o).buffer,a=await t.hash(i,"hex");n[a]=s.localHeaderOffset}return n}var U_={0:e=>new Xn().decompress(e),8:e=>new Ar({raw:!0}).decompress(e)},An=class extends mr{hashTable;constructor(t,r,n){super(t,r,n),this.hashTable=r}async getFile(t){let r=await this.getFileBytes(t.toLocaleLowerCase());if(r||(r=await this.getFileBytes(t)),!r)throw new Error(`No such file in the archive: ${t}`);return r}async getFileBytes(t){let r;if(this.hashTable){let n=new TextEncoder().encode(t).buffer,s=await new sr().hash(n,"hex"),o=this.hashTable[s];if(o===void 0)return null;let i=await nr(o,this.fileProvider);if(!i)return null;let a=await this.fileProvider.slice(i.fileDataOffset,i.fileDataOffset+i.compressedSize),f=U_[i.compressionMethod];if(!f)throw Error("Only Deflation compression is supported");r=await f(a)}else r=await this.getFileWithoutHash(t);return r}};var Jd=async(e,t)=>{let r=await Vn(e,Kn),n=await jn(r,e),s;if(n?.fileName!=="@3dtilesIndex1@")s=await Jc(e),t?.("3tz doesnt contain hash file, hash info has been composed according to zip archive headers");else{let o=await nr(n.localHeaderOffset,e);if(!o)throw new Error("corrupted 3tz zip archive");let i=o.fileDataOffset,a=await e.slice(i,i+o.compressedSize);s=kc(a)}return new An(e,s)};var P_="4.2.2",zd={dataType:null,batchType:null,name:"3tz",id:"3tz",module:"3d-tiles",version:P_,mimeTypes:["application/octet-stream","application/vnd.maxar.archive.3tz+zip"],parse:H_,extensions:["3tz"],options:{}};async function H_(e,t={}){return(await Jd(new Tn(new DataView(e)))).getFile(t["3d-tiles-archive"]?.path??"")}function Pe(e,t,r){if(!t)return r+12;let{magic:s,version:o=1,byteLength:i=12}=e;return J(Array.isArray(s)&&Number.isFinite(o)&&Number.isFinite(i)),t.setUint8(r+0,s[0]),t.setUint8(r+1,s[1]),t.setUint8(r+2,s[2]),t.setUint8(r+3,s[3]),t.setUint32(r+4,o,!0),t.setUint32(r+8,i,!0),r+=12,r}function He(e,t,r){e&&e.setUint32(t+8,r,!0)}function Qd(e,t,r,n,s){e={magic:Me.COMPOSITE,tiles:[],...e};let o=r;r+=Pe(e,t,r),t&&t.setUint32(r,e.tiles.length,!0),r+=4;for(let i=0;i<e.tiles.length;++i)r+=s(e.tiles[i],t,r,n);return He(t,o,r-o),r}function Vd(e,t,r,n){let{featuresLength:s=0,batchTable:o}=e,a=JSON.stringify({BATCH_LENGTH:s}),f=o?JSON.stringify(o):"",c=bt(a.length,8),h=f?bt(f.length,8):0;e={magic:Me.BATCHED_MODEL,...e};let l=r;r=Pe(e,t,r),t&&(t.setUint32(12,c,!0),t.setUint32(16,0,!0),t.setUint32(20,h,!0),t.setUint32(24,0,!0)),r+=16,r=Bs(t,r,a,8),o&&(r=Bs(t,r,f,8));let u=e.gltfEncoded;return u&&(r=xn(t,r,u,u.byteLength)),He(t,l,r-l),r}function jd(e,t,r,n){let{featuresLength:s=1,gltfFormat:o=1,gltfUri:i=""}=e,a=i.length,f={INSTANCES_LENGTH:s,POSITION:new Array(s*3).fill(0)},c=JSON.stringify(f),h=c.length;e={magic:Me.INSTANCED_MODEL,...e};let l=r;return r=Pe(e,t,0),t&&(t.setUint32(12,h,!0),t.setUint32(16,0,!0),t.setUint32(20,0,!0),t.setUint32(24,0,!0),t.setUint32(28,o,!0)),r+=20,r+=Er(t,r,c,h),r+=Er(t,r,i,a),He(t,l,r-l),r}var k_={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function Kd(e,t,r,n){let{featureTableJson:s=k_}=e,o=JSON.stringify(s);o=Xo(o,4);let{featureTableJsonByteLength:i=o.length}=e,a=new ArrayBuffer(12),f=a.byteLength;e={magic:Me.POINT_CLOUD,...e};let c=r;return r+=Pe(e,t,0),t&&(t.setUint32(r+0,i,!0),t.setUint32(r+4,f,!0),t.setUint32(r+8,0,!0),t.setUint32(r+12,0,!0)),r+=16,r+=Er(t,r,o,i),r+=xn(t,r,a,f),He(t,c,r-c),r}function Qc(e,t){let r=zc(e,null,0,t),n=new ArrayBuffer(r),s=new DataView(n);return zc(e,s,0,t),n}function zc(e,t,r,n){switch(J(typeof e.type=="string"),e.type){case _t.COMPOSITE:return Qd(e,t,r,n,zc);case _t.POINT_CLOUD:return Kd(e,t,r,n);case _t.BATCHED_3D_MODEL:return Vd(e,t,r,n);case _t.INSTANCED_3D_MODEL:return jd(e,t,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var Yd={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(e,t)=>Xd(e,t),encodeSync:Xd};function Xd(e,t){return Qc(e,t)}return r1(ls);})();
7
+ "use strict";var __exports__=(()=>{var qd=Object.create;var ps=Object.defineProperty;var Wd=Object.getOwnPropertyDescriptor;var $d=Object.getOwnPropertyNames;var t1=Object.getPrototypeOf,e1=Object.prototype.hasOwnProperty;var ct=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ut=(e,t)=>{for(var r in t)ps(e,r,{get:t[r],enumerable:!0})},ms=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of $d(t))!e1.call(e,s)&&s!==r&&ps(e,s,{get:()=>t[s],enumerable:!(n=Wd(t,s))||n.enumerable});return e},gs=(e,t,r)=>(ms(e,t,"default"),r&&ms(r,t,"default")),gr=(e,t,r)=>(r=e!=null?qd(t1(e)):{},ms(t||!e||!e.__esModule?ps(r,"default",{value:e,enumerable:!0}):r,e)),r1=e=>ms(ps({},"__esModule",{value:!0}),e);var pn=ct((z_,Yc)=>{Yc.exports=globalThis.loaders});var xe=ct(gt=>{"use strict";var z2=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Q2(e,t){return Object.prototype.hasOwnProperty.call(e,t)}gt.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)Q2(r,n)&&(e[n]=r[n])}}return e};gt.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var V2={arraySet:function(e,t,r,n,s){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),s);return}for(var o=0;o<n;o++)e[s+o]=t[r+o]},flattenChunks:function(e){var t,r,n,s,o,i;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(i=new Uint8Array(n),s=0,t=0,r=e.length;t<r;t++)o=e[t],i.set(o,s),s+=o.length;return i}},j2={arraySet:function(e,t,r,n,s){for(var o=0;o<n;o++)e[s+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};gt.setTyped=function(e){e?(gt.Buf8=Uint8Array,gt.Buf16=Uint16Array,gt.Buf32=Int32Array,gt.assign(gt,V2)):(gt.Buf8=Array,gt.Buf16=Array,gt.Buf32=Array,gt.assign(gt,j2))};gt.setTyped(z2)});var y0=ct(on=>{"use strict";var K2=xe(),X2=4,t0=0,e0=1,Y2=2;function sn(e){for(var t=e.length;--t>=0;)e[t]=0}var Z2=0,a0=1,q2=2,W2=3,$2=258,dc=29,ts=256,Zn=ts+1+dc,nn=30,Ac=19,c0=2*Zn+1,or=15,ac=16,tE=7,mc=256,f0=16,h0=17,l0=18,lc=[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],bo=[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],eE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],u0=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rE=512,Be=new Array((Zn+2)*2);sn(Be);var Yn=new Array(nn*2);sn(Yn);var qn=new Array(rE);sn(qn);var Wn=new Array($2-W2+1);sn(Wn);var pc=new Array(dc);sn(pc);var wo=new Array(nn);sn(wo);function cc(e,t,r,n,s){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=s,this.has_stree=e&&e.length}var d0,A0,m0;function fc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function p0(e){return e<256?qn[e]:qn[256+(e>>>7)]}function $n(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function Mt(e,t,r){e.bi_valid>ac-r?(e.bi_buf|=t<<e.bi_valid&65535,$n(e,e.bi_buf),e.bi_buf=t>>ac-e.bi_valid,e.bi_valid+=r-ac):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function se(e,t,r){Mt(e,r[t*2],r[t*2+1])}function g0(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function nE(e){e.bi_valid===16?($n(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function sE(e,t){var r=t.dyn_tree,n=t.max_code,s=t.stat_desc.static_tree,o=t.stat_desc.has_stree,i=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,f=t.stat_desc.max_length,c,h,l,u,d,A,m=0;for(u=0;u<=or;u++)e.bl_count[u]=0;for(r[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<c0;c++)h=e.heap[c],u=r[r[h*2+1]*2+1]+1,u>f&&(u=f,m++),r[h*2+1]=u,!(h>n)&&(e.bl_count[u]++,d=0,h>=a&&(d=i[h-a]),A=r[h*2],e.opt_len+=A*(u+d),o&&(e.static_len+=A*(s[h*2+1]+d)));if(m!==0){do{for(u=f-1;e.bl_count[u]===0;)u--;e.bl_count[u]--,e.bl_count[u+1]+=2,e.bl_count[f]--,m-=2}while(m>0);for(u=f;u!==0;u--)for(h=e.bl_count[u];h!==0;)l=e.heap[--c],!(l>n)&&(r[l*2+1]!==u&&(e.opt_len+=(u-r[l*2+1])*r[l*2],r[l*2+1]=u),h--)}}function x0(e,t,r){var n=new Array(or+1),s=0,o,i;for(o=1;o<=or;o++)n[o]=s=s+r[o-1]<<1;for(i=0;i<=t;i++){var a=e[i*2+1];a!==0&&(e[i*2]=g0(n[a]++,a))}}function oE(){var e,t,r,n,s,o=new Array(or+1);for(r=0,n=0;n<dc-1;n++)for(pc[n]=r,e=0;e<1<<lc[n];e++)Wn[r++]=n;for(Wn[r-1]=n,s=0,n=0;n<16;n++)for(wo[n]=s,e=0;e<1<<bo[n];e++)qn[s++]=n;for(s>>=7;n<nn;n++)for(wo[n]=s<<7,e=0;e<1<<bo[n]-7;e++)qn[256+s++]=n;for(t=0;t<=or;t++)o[t]=0;for(e=0;e<=143;)Be[e*2+1]=8,e++,o[8]++;for(;e<=255;)Be[e*2+1]=9,e++,o[9]++;for(;e<=279;)Be[e*2+1]=7,e++,o[7]++;for(;e<=287;)Be[e*2+1]=8,e++,o[8]++;for(x0(Be,Zn+1,o),e=0;e<nn;e++)Yn[e*2+1]=5,Yn[e*2]=g0(e,5);d0=new cc(Be,lc,ts+1,Zn,or),A0=new cc(Yn,bo,0,nn,or),m0=new cc(new Array(0),eE,0,Ac,tE)}function B0(e){var t;for(t=0;t<Zn;t++)e.dyn_ltree[t*2]=0;for(t=0;t<nn;t++)e.dyn_dtree[t*2]=0;for(t=0;t<Ac;t++)e.bl_tree[t*2]=0;e.dyn_ltree[mc*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function E0(e){e.bi_valid>8?$n(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function iE(e,t,r,n){E0(e),n&&($n(e,r),$n(e,~r)),K2.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function r0(e,t,r,n){var s=t*2,o=r*2;return e[s]<e[o]||e[s]===e[o]&&n[t]<=n[r]}function hc(e,t,r){for(var n=e.heap[r],s=r<<1;s<=e.heap_len&&(s<e.heap_len&&r0(t,e.heap[s+1],e.heap[s],e.depth)&&s++,!r0(t,n,e.heap[s],e.depth));)e.heap[r]=e.heap[s],r=s,s<<=1;e.heap[r]=n}function n0(e,t,r){var n,s,o=0,i,a;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+o*2]<<8|e.pending_buf[e.d_buf+o*2+1],s=e.pending_buf[e.l_buf+o],o++,n===0?se(e,s,t):(i=Wn[s],se(e,i+ts+1,t),a=lc[i],a!==0&&(s-=pc[i],Mt(e,s,a)),n--,i=p0(n),se(e,i,r),a=bo[i],a!==0&&(n-=wo[i],Mt(e,n,a)));while(o<e.last_lit);se(e,mc,t)}function uc(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,s=t.stat_desc.has_stree,o=t.stat_desc.elems,i,a,f=-1,c;for(e.heap_len=0,e.heap_max=c0,i=0;i<o;i++)r[i*2]!==0?(e.heap[++e.heap_len]=f=i,e.depth[i]=0):r[i*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=f<2?++f:0,r[c*2]=1,e.depth[c]=0,e.opt_len--,s&&(e.static_len-=n[c*2+1]);for(t.max_code=f,i=e.heap_len>>1;i>=1;i--)hc(e,r,i);c=o;do i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],hc(e,r,1),a=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=a,r[c*2]=r[i*2]+r[a*2],e.depth[c]=(e.depth[i]>=e.depth[a]?e.depth[i]:e.depth[a])+1,r[i*2+1]=r[a*2+1]=c,e.heap[1]=c++,hc(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],sE(e,t),x0(r,f,e.bl_count)}function s0(e,t,r){var n,s=-1,o,i=t[0*2+1],a=0,f=7,c=4;for(i===0&&(f=138,c=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)o=i,i=t[(n+1)*2+1],!(++a<f&&o===i)&&(a<c?e.bl_tree[o*2]+=a:o!==0?(o!==s&&e.bl_tree[o*2]++,e.bl_tree[f0*2]++):a<=10?e.bl_tree[h0*2]++:e.bl_tree[l0*2]++,a=0,s=o,i===0?(f=138,c=3):o===i?(f=6,c=3):(f=7,c=4))}function o0(e,t,r){var n,s=-1,o,i=t[0*2+1],a=0,f=7,c=4;for(i===0&&(f=138,c=3),n=0;n<=r;n++)if(o=i,i=t[(n+1)*2+1],!(++a<f&&o===i)){if(a<c)do se(e,o,e.bl_tree);while(--a!==0);else o!==0?(o!==s&&(se(e,o,e.bl_tree),a--),se(e,f0,e.bl_tree),Mt(e,a-3,2)):a<=10?(se(e,h0,e.bl_tree),Mt(e,a-3,3)):(se(e,l0,e.bl_tree),Mt(e,a-11,7));a=0,s=o,i===0?(f=138,c=3):o===i?(f=6,c=3):(f=7,c=4)}}function aE(e){var t;for(s0(e,e.dyn_ltree,e.l_desc.max_code),s0(e,e.dyn_dtree,e.d_desc.max_code),uc(e,e.bl_desc),t=Ac-1;t>=3&&e.bl_tree[u0[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function cE(e,t,r,n){var s;for(Mt(e,t-257,5),Mt(e,r-1,5),Mt(e,n-4,4),s=0;s<n;s++)Mt(e,e.bl_tree[u0[s]*2+1],3);o0(e,e.dyn_ltree,t-1),o0(e,e.dyn_dtree,r-1)}function fE(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return t0;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return e0;for(r=32;r<ts;r++)if(e.dyn_ltree[r*2]!==0)return e0;return t0}var i0=!1;function hE(e){i0||(oE(),i0=!0),e.l_desc=new fc(e.dyn_ltree,d0),e.d_desc=new fc(e.dyn_dtree,A0),e.bl_desc=new fc(e.bl_tree,m0),e.bi_buf=0,e.bi_valid=0,B0(e)}function _0(e,t,r,n){Mt(e,(Z2<<1)+(n?1:0),3),iE(e,t,r,!0)}function lE(e){Mt(e,a0<<1,3),se(e,mc,Be),nE(e)}function uE(e,t,r,n){var s,o,i=0;e.level>0?(e.strm.data_type===Y2&&(e.strm.data_type=fE(e)),uc(e,e.l_desc),uc(e,e.d_desc),i=aE(e),s=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=s&&(s=o)):s=o=r+5,r+4<=s&&t!==-1?_0(e,t,r,n):e.strategy===X2||o===s?(Mt(e,(a0<<1)+(n?1:0),3),n0(e,Be,Yn)):(Mt(e,(q2<<1)+(n?1:0),3),cE(e,e.l_desc.max_code+1,e.d_desc.max_code+1,i+1),n0(e,e.dyn_ltree,e.dyn_dtree)),B0(e),n&&E0(e)}function dE(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(Wn[r]+ts+1)*2]++,e.dyn_dtree[p0(t)*2]++),e.last_lit===e.lit_bufsize-1}on._tr_init=hE;on._tr_stored_block=_0;on._tr_flush_block=uE;on._tr_tally=dE;on._tr_align=lE});var gc=ct((AL,T0)=>{"use strict";function AE(e,t,r,n){for(var s=e&65535|0,o=e>>>16&65535|0,i=0;r!==0;){i=r>2e3?2e3:r,r-=i;do s=s+t[n++]|0,o=o+s|0;while(--i);s%=65521,o%=65521}return s|o<<16|0}T0.exports=AE});var xc=ct((mL,C0)=>{"use strict";function mE(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var pE=mE();function gE(e,t,r,n){var s=pE,o=n+r;e^=-1;for(var i=n;i<o;i++)e=e>>>8^s[(e^t[i])&255];return e^-1}C0.exports=gE});var Io=ct((pL,M0)=>{"use strict";M0.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 O0=ct(ae=>{"use strict";var xt=xe(),Nt=y0(),S0=gc(),Le=xc(),xE=Io(),fr=0,BE=1,EE=3,Ue=4,b0=5,ie=0,w0=1,Gt=-2,_E=-3,Bc=-5,yE=-1,TE=1,So=2,CE=3,ME=4,bE=0,wE=2,Lo=8,IE=9,SE=15,RE=8,FE=29,DE=256,_c=DE+1+FE,LE=30,OE=19,vE=2*_c+1,NE=15,k=3,Ne=258,jt=Ne+k+1,GE=32,Oo=42,yc=69,Ro=73,Fo=91,Do=103,ir=113,rs=666,it=1,ns=2,ar=3,fn=4,UE=3;function Ge(e,t){return e.msg=xE[t],t}function I0(e){return(e<<1)-(e>4?9:0)}function ve(e){for(var t=e.length;--t>=0;)e[t]=0}function Oe(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(xt.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function lt(e,t){Nt._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Oe(e.strm)}function V(e,t){e.pending_buf[e.pending++]=t}function es(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function PE(e,t,r,n){var s=e.avail_in;return s>n&&(s=n),s===0?0:(e.avail_in-=s,xt.arraySet(t,e.input,e.next_in,s,r),e.state.wrap===1?e.adler=S0(e.adler,t,s,r):e.state.wrap===2&&(e.adler=Le(e.adler,t,s,r)),e.next_in+=s,e.total_in+=s,s)}function R0(e,t){var r=e.max_chain_length,n=e.strstart,s,o,i=e.prev_length,a=e.nice_match,f=e.strstart>e.w_size-jt?e.strstart-(e.w_size-jt):0,c=e.window,h=e.w_mask,l=e.prev,u=e.strstart+Ne,d=c[n+i-1],A=c[n+i];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do if(s=t,!(c[s+i]!==A||c[s+i-1]!==d||c[s]!==c[n]||c[++s]!==c[n+1])){n+=2,s++;do;while(c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&n<u);if(o=Ne-(u-n),n=u-Ne,o>i){if(e.match_start=t,i=o,o>=a)break;d=c[n+i-1],A=c[n+i]}}while((t=l[t&h])>f&&--r!==0);return i<=e.lookahead?i:e.lookahead}function cr(e){var t=e.w_size,r,n,s,o,i;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-jt)){xt.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do s=e.head[--r],e.head[r]=s>=t?s-t:0;while(--n);n=t,r=n;do s=e.prev[--r],e.prev[r]=s>=t?s-t:0;while(--n);o+=t}if(e.strm.avail_in===0)break;if(n=PE(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=n,e.lookahead+e.insert>=k)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=(e.ins_h<<e.hash_shift^e.window[i+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[i+k-1])&e.hash_mask,e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<k)););}while(e.lookahead<jt&&e.strm.avail_in!==0)}function HE(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(cr(e),e.lookahead===0&&t===fr)return it;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,lt(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-jt&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=0,t===Ue?(lt(e,!0),e.strm.avail_out===0?ar:fn):(e.strstart>e.block_start&&(lt(e,!1),e.strm.avail_out===0),it)}function Ec(e,t){for(var r,n;;){if(e.lookahead<jt){if(cr(e),e.lookahead<jt&&t===fr)return it;if(e.lookahead===0)break}if(r=0,e.lookahead>=k&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-jt&&(e.match_length=R0(e,r)),e.match_length>=k)if(n=Nt._tr_tally(e,e.strstart-e.match_start,e.match_length-k),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=k){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=Nt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=e.strstart<k-1?e.strstart:k-1,t===Ue?(lt(e,!0),e.strm.avail_out===0?ar:fn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:ns}function an(e,t){for(var r,n,s;;){if(e.lookahead<jt){if(cr(e),e.lookahead<jt&&t===fr)return it;if(e.lookahead===0)break}if(r=0,e.lookahead>=k&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=k-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-jt&&(e.match_length=R0(e,r),e.match_length<=5&&(e.strategy===TE||e.match_length===k&&e.strstart-e.match_start>4096)&&(e.match_length=k-1)),e.prev_length>=k&&e.match_length<=e.prev_length){s=e.strstart+e.lookahead-k,n=Nt._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-k),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=s&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=k-1,e.strstart++,n&&(lt(e,!1),e.strm.avail_out===0))return it}else if(e.match_available){if(n=Nt._tr_tally(e,0,e.window[e.strstart-1]),n&&lt(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return it}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Nt._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<k-1?e.strstart:k-1,t===Ue?(lt(e,!0),e.strm.avail_out===0?ar:fn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:ns}function kE(e,t){for(var r,n,s,o,i=e.window;;){if(e.lookahead<=Ne){if(cr(e),e.lookahead<=Ne&&t===fr)return it;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=k&&e.strstart>0&&(s=e.strstart-1,n=i[s],n===i[++s]&&n===i[++s]&&n===i[++s])){o=e.strstart+Ne;do;while(n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&s<o);e.match_length=Ne-(o-s),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=k?(r=Nt._tr_tally(e,1,e.match_length-k),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Nt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=0,t===Ue?(lt(e,!0),e.strm.avail_out===0?ar:fn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:ns}function JE(e,t){for(var r;;){if(e.lookahead===0&&(cr(e),e.lookahead===0)){if(t===fr)return it;break}if(e.match_length=0,r=Nt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=0,t===Ue?(lt(e,!0),e.strm.avail_out===0?ar:fn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:ns}function oe(e,t,r,n,s){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=s}var cn;cn=[new oe(0,0,0,0,HE),new oe(4,4,8,4,Ec),new oe(4,5,16,8,Ec),new oe(4,6,32,32,Ec),new oe(4,4,16,16,an),new oe(8,16,32,32,an),new oe(8,16,128,128,an),new oe(8,32,128,256,an),new oe(32,128,258,1024,an),new oe(32,258,258,4096,an)];function zE(e){e.window_size=2*e.w_size,ve(e.head),e.max_lazy_match=cn[e.level].max_lazy,e.good_match=cn[e.level].good_length,e.nice_match=cn[e.level].nice_length,e.max_chain_length=cn[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=k-1,e.match_available=0,e.ins_h=0}function QE(){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=Lo,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 xt.Buf16(vE*2),this.dyn_dtree=new xt.Buf16((2*LE+1)*2),this.bl_tree=new xt.Buf16((2*OE+1)*2),ve(this.dyn_ltree),ve(this.dyn_dtree),ve(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new xt.Buf16(NE+1),this.heap=new xt.Buf16(2*_c+1),ve(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new xt.Buf16(2*_c+1),ve(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 F0(e){var t;return!e||!e.state?Ge(e,Gt):(e.total_in=e.total_out=0,e.data_type=wE,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Oo:ir,e.adler=t.wrap===2?0:1,t.last_flush=fr,Nt._tr_init(t),ie)}function D0(e){var t=F0(e);return t===ie&&zE(e.state),t}function VE(e,t){return!e||!e.state||e.state.wrap!==2?Gt:(e.state.gzhead=t,ie)}function L0(e,t,r,n,s,o){if(!e)return Gt;var i=1;if(t===yE&&(t=6),n<0?(i=0,n=-n):n>15&&(i=2,n-=16),s<1||s>IE||r!==Lo||n<8||n>15||t<0||t>9||o<0||o>ME)return Ge(e,Gt);n===8&&(n=9);var a=new QE;return e.state=a,a.strm=e,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=s+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+k-1)/k),a.window=new xt.Buf8(a.w_size*2),a.head=new xt.Buf16(a.hash_size),a.prev=new xt.Buf16(a.w_size),a.lit_bufsize=1<<s+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new xt.Buf8(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=(1+2)*a.lit_bufsize,a.level=t,a.strategy=o,a.method=r,D0(e)}function jE(e,t){return L0(e,t,Lo,SE,RE,bE)}function KE(e,t){var r,n,s,o;if(!e||!e.state||t>b0||t<0)return e?Ge(e,Gt):Gt;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===rs&&t!==Ue)return Ge(e,e.avail_out===0?Bc:Gt);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===Oo)if(n.wrap===2)e.adler=0,V(n,31),V(n,139),V(n,8),n.gzhead?(V(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)),V(n,n.gzhead.time&255),V(n,n.gzhead.time>>8&255),V(n,n.gzhead.time>>16&255),V(n,n.gzhead.time>>24&255),V(n,n.level===9?2:n.strategy>=So||n.level<2?4:0),V(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(V(n,n.gzhead.extra.length&255),V(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Le(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=yc):(V(n,0),V(n,0),V(n,0),V(n,0),V(n,0),V(n,n.level===9?2:n.strategy>=So||n.level<2?4:0),V(n,UE),n.status=ir);else{var i=Lo+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=So||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=GE),i+=31-i%31,n.status=ir,es(n,i),n.strstart!==0&&(es(n,e.adler>>>16),es(n,e.adler&65535)),e.adler=1}if(n.status===yc)if(n.gzhead.extra){for(s=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),Oe(e),s=n.pending,n.pending===n.pending_buf_size));)V(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Ro)}else n.status=Ro;if(n.status===Ro)if(n.gzhead.name){s=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),Oe(e),s=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,V(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),o===0&&(n.gzindex=0,n.status=Fo)}else n.status=Fo;if(n.status===Fo)if(n.gzhead.comment){s=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),Oe(e),s=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,V(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),o===0&&(n.status=Do)}else n.status=Do;if(n.status===Do&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Oe(e),n.pending+2<=n.pending_buf_size&&(V(n,e.adler&255),V(n,e.adler>>8&255),e.adler=0,n.status=ir)):n.status=ir),n.pending!==0){if(Oe(e),e.avail_out===0)return n.last_flush=-1,ie}else if(e.avail_in===0&&I0(t)<=I0(r)&&t!==Ue)return Ge(e,Bc);if(n.status===rs&&e.avail_in!==0)return Ge(e,Bc);if(e.avail_in!==0||n.lookahead!==0||t!==fr&&n.status!==rs){var f=n.strategy===So?JE(n,t):n.strategy===CE?kE(n,t):cn[n.level].func(n,t);if((f===ar||f===fn)&&(n.status=rs),f===it||f===ar)return e.avail_out===0&&(n.last_flush=-1),ie;if(f===ns&&(t===BE?Nt._tr_align(n):t!==b0&&(Nt._tr_stored_block(n,0,0,!1),t===EE&&(ve(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Oe(e),e.avail_out===0))return n.last_flush=-1,ie}return t!==Ue?ie:n.wrap<=0?w0:(n.wrap===2?(V(n,e.adler&255),V(n,e.adler>>8&255),V(n,e.adler>>16&255),V(n,e.adler>>24&255),V(n,e.total_in&255),V(n,e.total_in>>8&255),V(n,e.total_in>>16&255),V(n,e.total_in>>24&255)):(es(n,e.adler>>>16),es(n,e.adler&65535)),Oe(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?ie:w0)}function XE(e){var t;return!e||!e.state?Gt:(t=e.state.status,t!==Oo&&t!==yc&&t!==Ro&&t!==Fo&&t!==Do&&t!==ir&&t!==rs?Ge(e,Gt):(e.state=null,t===ir?Ge(e,_E):ie))}function YE(e,t){var r=t.length,n,s,o,i,a,f,c,h;if(!e||!e.state||(n=e.state,i=n.wrap,i===2||i===1&&n.status!==Oo||n.lookahead))return Gt;for(i===1&&(e.adler=S0(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(i===0&&(ve(n.head),n.strstart=0,n.block_start=0,n.insert=0),h=new xt.Buf8(n.w_size),xt.arraySet(h,t,r-n.w_size,n.w_size,0),t=h,r=n.w_size),a=e.avail_in,f=e.next_in,c=e.input,e.avail_in=r,e.next_in=0,e.input=t,cr(n);n.lookahead>=k;){s=n.strstart,o=n.lookahead-(k-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[s+k-1])&n.hash_mask,n.prev[s&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=s,s++;while(--o);n.strstart=s,n.lookahead=k-1,cr(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=k-1,n.match_available=0,e.next_in=f,e.input=c,e.avail_in=a,n.wrap=i,ie}ae.deflateInit=jE;ae.deflateInit2=L0;ae.deflateReset=D0;ae.deflateResetKeep=F0;ae.deflateSetHeader=VE;ae.deflate=KE;ae.deflateEnd=XE;ae.deflateSetDictionary=YE;ae.deflateInfo="pako deflate (from Nodeca project)"});var Tc=ct(hn=>{"use strict";var vo=xe(),v0=!0,N0=!0;try{String.fromCharCode.apply(null,[0])}catch{v0=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{N0=!1}var ss=new vo.Buf8(256);for(Ee=0;Ee<256;Ee++)ss[Ee]=Ee>=252?6:Ee>=248?5:Ee>=240?4:Ee>=224?3:Ee>=192?2:1;var Ee;ss[254]=ss[254]=1;hn.string2buf=function(e){var t,r,n,s,o,i=e.length,a=0;for(s=0;s<i;s++)r=e.charCodeAt(s),(r&64512)===55296&&s+1<i&&(n=e.charCodeAt(s+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),s++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(t=new vo.Buf8(a),o=0,s=0;o<a;s++)r=e.charCodeAt(s),(r&64512)===55296&&s+1<i&&(n=e.charCodeAt(s+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),s++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|r&63):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|r&63):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|r&63);return t};function G0(e,t){if(t<65534&&(e.subarray&&N0||!e.subarray&&v0))return String.fromCharCode.apply(null,vo.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}hn.buf2binstring=function(e){return G0(e,e.length)};hn.binstring2buf=function(e){for(var t=new vo.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t};hn.buf2string=function(e,t){var r,n,s,o,i=t||e.length,a=new Array(i*2);for(n=0,r=0;r<i;){if(s=e[r++],s<128){a[n++]=s;continue}if(o=ss[s],o>4){a[n++]=65533,r+=o-1;continue}for(s&=o===2?31:o===3?15:7;o>1&&r<i;)s=s<<6|e[r++]&63,o--;if(o>1){a[n++]=65533;continue}s<65536?a[n++]=s:(s-=65536,a[n++]=55296|s>>10&1023,a[n++]=56320|s&1023)}return G0(a,n)};hn.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+ss[e[r]]>t?r:t}});var Cc=ct((BL,U0)=>{"use strict";function ZE(){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}U0.exports=ZE});var J0=ct(as=>{"use strict";var os=O0(),is=xe(),bc=Tc(),wc=Io(),qE=Cc(),k0=Object.prototype.toString,WE=0,Mc=4,ln=0,P0=1,H0=2,$E=-1,t_=0,e_=8;function hr(e){if(!(this instanceof hr))return new hr(e);this.options=is.assign({level:$E,method:e_,chunkSize:16384,windowBits:15,memLevel:8,strategy:t_,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new qE,this.strm.avail_out=0;var r=os.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==ln)throw new Error(wc[r]);if(t.header&&os.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=bc.string2buf(t.dictionary):k0.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=os.deflateSetDictionary(this.strm,n),r!==ln)throw new Error(wc[r]);this._dict_set=!0}}hr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,s,o;if(this.ended)return!1;o=t===~~t?t:t===!0?Mc:WE,typeof e=="string"?r.input=bc.string2buf(e):k0.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new is.Buf8(n),r.next_out=0,r.avail_out=n),s=os.deflate(r,o),s!==P0&&s!==ln)return this.onEnd(s),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(o===Mc||o===H0))&&(this.options.to==="string"?this.onData(bc.buf2binstring(is.shrinkBuf(r.output,r.next_out))):this.onData(is.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&s!==P0);return o===Mc?(s=os.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===ln):(o===H0&&(this.onEnd(ln),r.avail_out=0),!0)};hr.prototype.onData=function(e){this.chunks.push(e)};hr.prototype.onEnd=function(e){e===ln&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=is.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ic(e,t){var r=new hr(t);if(r.push(e,!0),r.err)throw r.msg||wc[r.err];return r.result}function r_(e,t){return t=t||{},t.raw=!0,Ic(e,t)}function n_(e,t){return t=t||{},t.gzip=!0,Ic(e,t)}as.Deflate=hr;as.deflate=Ic;as.deflateRaw=r_;as.gzip=n_});var Q0=ct((_L,z0)=>{"use strict";var No=30,s_=12;z0.exports=function(t,r){var n,s,o,i,a,f,c,h,l,u,d,A,m,p,E,y,C,M,T,I,w,L,x,g,B;n=t.state,s=t.next_in,g=t.input,o=s+(t.avail_in-5),i=t.next_out,B=t.output,a=i-(r-t.avail_out),f=i+(t.avail_out-257),c=n.dmax,h=n.wsize,l=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,C=(1<<n.distbits)-1;t:do{m<15&&(A+=g[s++]<<m,m+=8,A+=g[s++]<<m,m+=8),M=p[A&y];e:for(;;){if(T=M>>>24,A>>>=T,m-=T,T=M>>>16&255,T===0)B[i++]=M&65535;else if(T&16){I=M&65535,T&=15,T&&(m<T&&(A+=g[s++]<<m,m+=8),I+=A&(1<<T)-1,A>>>=T,m-=T),m<15&&(A+=g[s++]<<m,m+=8,A+=g[s++]<<m,m+=8),M=E[A&C];r:for(;;){if(T=M>>>24,A>>>=T,m-=T,T=M>>>16&255,T&16){if(w=M&65535,T&=15,m<T&&(A+=g[s++]<<m,m+=8,m<T&&(A+=g[s++]<<m,m+=8)),w+=A&(1<<T)-1,w>c){t.msg="invalid distance too far back",n.mode=No;break t}if(A>>>=T,m-=T,T=i-a,w>T){if(T=w-T,T>l&&n.sane){t.msg="invalid distance too far back",n.mode=No;break t}if(L=0,x=d,u===0){if(L+=h-T,T<I){I-=T;do B[i++]=d[L++];while(--T);L=i-w,x=B}}else if(u<T){if(L+=h+u-T,T-=u,T<I){I-=T;do B[i++]=d[L++];while(--T);if(L=0,u<I){T=u,I-=T;do B[i++]=d[L++];while(--T);L=i-w,x=B}}}else if(L+=u-T,T<I){I-=T;do B[i++]=d[L++];while(--T);L=i-w,x=B}for(;I>2;)B[i++]=x[L++],B[i++]=x[L++],B[i++]=x[L++],I-=3;I&&(B[i++]=x[L++],I>1&&(B[i++]=x[L++]))}else{L=i-w;do B[i++]=B[L++],B[i++]=B[L++],B[i++]=B[L++],I-=3;while(I>2);I&&(B[i++]=B[L++],I>1&&(B[i++]=B[L++]))}}else if(T&64){t.msg="invalid distance code",n.mode=No;break t}else{M=E[(M&65535)+(A&(1<<T)-1)];continue r}break}}else if(T&64)if(T&32){n.mode=s_;break t}else{t.msg="invalid literal/length code",n.mode=No;break t}else{M=p[(M&65535)+(A&(1<<T)-1)];continue e}break}}while(s<o&&i<f);I=m>>3,s-=I,m-=I<<3,A&=(1<<m)-1,t.next_in=s,t.next_out=i,t.avail_in=s<o?5+(o-s):5-(s-o),t.avail_out=i<f?257+(f-i):257-(i-f),n.hold=A,n.bits=m}});var q0=ct((yL,Z0)=>{"use strict";var V0=xe(),un=15,j0=852,K0=592,X0=0,Sc=1,Y0=2,o_=[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],i_=[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],a_=[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],c_=[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];Z0.exports=function(t,r,n,s,o,i,a,f){var c=f.bits,h=0,l=0,u=0,d=0,A=0,m=0,p=0,E=0,y=0,C=0,M,T,I,w,L,x=null,g=0,B,_=new V0.Buf16(un+1),U=new V0.Buf16(un+1),G=null,P=0,v,at,mt;for(h=0;h<=un;h++)_[h]=0;for(l=0;l<s;l++)_[r[n+l]]++;for(A=c,d=un;d>=1&&_[d]===0;d--);if(A>d&&(A=d),d===0)return o[i++]=1<<24|64<<16|0,o[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,h=1;h<=un;h++)if(E<<=1,E-=_[h],E<0)return-1;if(E>0&&(t===X0||d!==1))return-1;for(U[1]=0,h=1;h<un;h++)U[h+1]=U[h]+_[h];for(l=0;l<s;l++)r[n+l]!==0&&(a[U[r[n+l]]++]=l);if(t===X0?(x=G=a,B=19):t===Sc?(x=o_,g-=257,G=i_,P-=257,B=256):(x=a_,G=c_,B=-1),C=0,l=0,h=u,L=i,m=A,p=0,I=-1,y=1<<A,w=y-1,t===Sc&&y>j0||t===Y0&&y>K0)return 1;for(;;){v=h-p,a[l]<B?(at=0,mt=a[l]):a[l]>B?(at=G[P+a[l]],mt=x[g+a[l]]):(at=32+64,mt=0),M=1<<h-p,T=1<<m,u=T;do T-=M,o[L+(C>>p)+T]=v<<24|at<<16|mt|0;while(T!==0);for(M=1<<h-1;C&M;)M>>=1;if(M!==0?(C&=M-1,C+=M):C=0,l++,--_[h]===0){if(h===d)break;h=r[n+a[l]]}if(h>A&&(C&w)!==I){for(p===0&&(p=A),L+=u,m=h-p,E=1<<m;m+p<d&&(E-=_[m+p],!(E<=0));)m++,E<<=1;if(y+=1<<m,t===Sc&&y>j0||t===Y0&&y>K0)return 1;I=C&w,o[I]=A<<24|m<<16|L-i|0}}return C!==0&&(o[L+C]=h-p<<24|64<<16|0),f.bits=A,0}});var Dd=ct(Kt=>{"use strict";var St=xe(),vc=gc(),ce=xc(),f_=Q0(),cs=q0(),h_=0,Td=1,Cd=2,W0=4,l_=5,Go=6,lr=0,u_=1,d_=2,Ut=-2,Md=-3,Nc=-4,A_=-5,$0=8,bd=1,td=2,ed=3,rd=4,nd=5,sd=6,od=7,id=8,ad=9,cd=10,Ho=11,_e=12,Rc=13,fd=14,Fc=15,hd=16,ld=17,ud=18,dd=19,Uo=20,Po=21,Ad=22,md=23,pd=24,gd=25,xd=26,Dc=27,Bd=28,Ed=29,$=30,Gc=31,m_=32,p_=852,g_=592,x_=15,B_=x_;function _d(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function E_(){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 St.Buf16(320),this.work=new St.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function wd(e){var t;return!e||!e.state?Ut:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=bd,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new St.Buf32(p_),t.distcode=t.distdyn=new St.Buf32(g_),t.sane=1,t.back=-1,lr)}function Id(e){var t;return!e||!e.state?Ut:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,wd(e))}function Sd(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Ut:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Id(e))}function Rd(e,t){var r,n;return e?(n=new E_,e.state=n,n.window=null,r=Sd(e,t),r!==lr&&(e.state=null),r):Ut}function __(e){return Rd(e,B_)}var yd=!0,Lc,Oc;function y_(e){if(yd){var t;for(Lc=new St.Buf32(512),Oc=new St.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(cs(Td,e.lens,0,288,Lc,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;cs(Cd,e.lens,0,32,Oc,0,e.work,{bits:5}),yd=!1}e.lencode=Lc,e.lenbits=9,e.distcode=Oc,e.distbits=5}function Fd(e,t,r,n){var s,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new St.Buf8(o.wsize)),n>=o.wsize?(St.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(s=o.wsize-o.wnext,s>n&&(s=n),St.arraySet(o.window,t,r-n,s,o.wnext),n-=s,n?(St.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=s))),0}function T_(e,t){var r,n,s,o,i,a,f,c,h,l,u,d,A,m,p=0,E,y,C,M,T,I,w,L,x=new St.Buf8(4),g,B,_=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Ut;r=e.state,r.mode===_e&&(r.mode=Rc),i=e.next_out,s=e.output,f=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,c=r.hold,h=r.bits,l=a,u=f,L=lr;t:for(;;)switch(r.mode){case bd:if(r.wrap===0){r.mode=Rc;break}for(;h<16;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(r.wrap&2&&c===35615){r.check=0,x[0]=c&255,x[1]=c>>>8&255,r.check=ce(r.check,x,2,0),c=0,h=0,r.mode=td;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=$;break}if((c&15)!==$0){e.msg="unknown compression method",r.mode=$;break}if(c>>>=4,h-=4,w=(c&15)+8,r.wbits===0)r.wbits=w;else if(w>r.wbits){e.msg="invalid window size",r.mode=$;break}r.dmax=1<<w,e.adler=r.check=1,r.mode=c&512?cd:_e,c=0,h=0;break;case td:for(;h<16;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(r.flags=c,(r.flags&255)!==$0){e.msg="unknown compression method",r.mode=$;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=$;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,r.check=ce(r.check,x,2,0)),c=0,h=0,r.mode=ed;case ed:for(;h<32;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}r.head&&(r.head.time=c),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,x[2]=c>>>16&255,x[3]=c>>>24&255,r.check=ce(r.check,x,4,0)),c=0,h=0,r.mode=rd;case rd:for(;h<16;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,r.check=ce(r.check,x,2,0)),c=0,h=0,r.mode=nd;case nd:if(r.flags&1024){for(;h<16;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,r.check=ce(r.check,x,2,0)),c=0,h=0}else r.head&&(r.head.extra=null);r.mode=sd;case sd:if(r.flags&1024&&(d=r.length,d>a&&(d=a),d&&(r.head&&(w=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),St.arraySet(r.head.extra,n,o,d,w)),r.flags&512&&(r.check=ce(r.check,n,d,o)),a-=d,o+=d,r.length-=d),r.length))break t;r.length=0,r.mode=od;case od:if(r.flags&2048){if(a===0)break t;d=0;do w=n[o+d++],r.head&&w&&r.length<65536&&(r.head.name+=String.fromCharCode(w));while(w&&d<a);if(r.flags&512&&(r.check=ce(r.check,n,d,o)),a-=d,o+=d,w)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=id;case id:if(r.flags&4096){if(a===0)break t;d=0;do w=n[o+d++],r.head&&w&&r.length<65536&&(r.head.comment+=String.fromCharCode(w));while(w&&d<a);if(r.flags&512&&(r.check=ce(r.check,n,d,o)),a-=d,o+=d,w)break t}else r.head&&(r.head.comment=null);r.mode=ad;case ad:if(r.flags&512){for(;h<16;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(c!==(r.check&65535)){e.msg="header crc mismatch",r.mode=$;break}c=0,h=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=_e;break;case cd:for(;h<32;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}e.adler=r.check=_d(c),c=0,h=0,r.mode=Ho;case Ho:if(r.havedict===0)return e.next_out=i,e.avail_out=f,e.next_in=o,e.avail_in=a,r.hold=c,r.bits=h,d_;e.adler=r.check=1,r.mode=_e;case _e:if(t===l_||t===Go)break t;case Rc:if(r.last){c>>>=h&7,h-=h&7,r.mode=Dc;break}for(;h<3;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}switch(r.last=c&1,c>>>=1,h-=1,c&3){case 0:r.mode=fd;break;case 1:if(y_(r),r.mode=Uo,t===Go){c>>>=2,h-=2;break t}break;case 2:r.mode=ld;break;case 3:e.msg="invalid block type",r.mode=$}c>>>=2,h-=2;break;case fd:for(c>>>=h&7,h-=h&7;h<32;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=$;break}if(r.length=c&65535,c=0,h=0,r.mode=Fc,t===Go)break t;case Fc:r.mode=hd;case hd:if(d=r.length,d){if(d>a&&(d=a),d>f&&(d=f),d===0)break t;St.arraySet(s,n,o,d,i),a-=d,o+=d,f-=d,i+=d,r.length-=d;break}r.mode=_e;break;case ld:for(;h<14;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(r.nlen=(c&31)+257,c>>>=5,h-=5,r.ndist=(c&31)+1,c>>>=5,h-=5,r.ncode=(c&15)+4,c>>>=4,h-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=$;break}r.have=0,r.mode=ud;case ud:for(;r.have<r.ncode;){for(;h<3;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}r.lens[_[r.have++]]=c&7,c>>>=3,h-=3}for(;r.have<19;)r.lens[_[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,g={bits:r.lenbits},L=cs(h_,r.lens,0,19,r.lencode,0,r.work,g),r.lenbits=g.bits,L){e.msg="invalid code lengths set",r.mode=$;break}r.have=0,r.mode=dd;case dd:for(;r.have<r.nlen+r.ndist;){for(;p=r.lencode[c&(1<<r.lenbits)-1],E=p>>>24,y=p>>>16&255,C=p&65535,!(E<=h);){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(C<16)c>>>=E,h-=E,r.lens[r.have++]=C;else{if(C===16){for(B=E+2;h<B;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(c>>>=E,h-=E,r.have===0){e.msg="invalid bit length repeat",r.mode=$;break}w=r.lens[r.have-1],d=3+(c&3),c>>>=2,h-=2}else if(C===17){for(B=E+3;h<B;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}c>>>=E,h-=E,w=0,d=3+(c&7),c>>>=3,h-=3}else{for(B=E+7;h<B;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}c>>>=E,h-=E,w=0,d=11+(c&127),c>>>=7,h-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=$;break}for(;d--;)r.lens[r.have++]=w}}if(r.mode===$)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=$;break}if(r.lenbits=9,g={bits:r.lenbits},L=cs(Td,r.lens,0,r.nlen,r.lencode,0,r.work,g),r.lenbits=g.bits,L){e.msg="invalid literal/lengths set",r.mode=$;break}if(r.distbits=6,r.distcode=r.distdyn,g={bits:r.distbits},L=cs(Cd,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,g),r.distbits=g.bits,L){e.msg="invalid distances set",r.mode=$;break}if(r.mode=Uo,t===Go)break t;case Uo:r.mode=Po;case Po:if(a>=6&&f>=258){e.next_out=i,e.avail_out=f,e.next_in=o,e.avail_in=a,r.hold=c,r.bits=h,f_(e,u),i=e.next_out,s=e.output,f=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,c=r.hold,h=r.bits,r.mode===_e&&(r.back=-1);break}for(r.back=0;p=r.lencode[c&(1<<r.lenbits)-1],E=p>>>24,y=p>>>16&255,C=p&65535,!(E<=h);){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(y&&!(y&240)){for(M=E,T=y,I=C;p=r.lencode[I+((c&(1<<M+T)-1)>>M)],E=p>>>24,y=p>>>16&255,C=p&65535,!(M+E<=h);){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}c>>>=M,h-=M,r.back+=M}if(c>>>=E,h-=E,r.back+=E,r.length=C,y===0){r.mode=xd;break}if(y&32){r.back=-1,r.mode=_e;break}if(y&64){e.msg="invalid literal/length code",r.mode=$;break}r.extra=y&15,r.mode=Ad;case Ad:if(r.extra){for(B=r.extra;h<B;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=md;case md:for(;p=r.distcode[c&(1<<r.distbits)-1],E=p>>>24,y=p>>>16&255,C=p&65535,!(E<=h);){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(!(y&240)){for(M=E,T=y,I=C;p=r.distcode[I+((c&(1<<M+T)-1)>>M)],E=p>>>24,y=p>>>16&255,C=p&65535,!(M+E<=h);){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}c>>>=M,h-=M,r.back+=M}if(c>>>=E,h-=E,r.back+=E,y&64){e.msg="invalid distance code",r.mode=$;break}r.offset=C,r.extra=y&15,r.mode=pd;case pd:if(r.extra){for(B=r.extra;h<B;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,h-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=$;break}r.mode=gd;case gd:if(f===0)break t;if(d=u-f,r.offset>d){if(d=r.offset-d,d>r.whave&&r.sane){e.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=s,A=i-r.offset,d=r.length;d>f&&(d=f),f-=d,r.length-=d;do s[i++]=m[A++];while(--d);r.length===0&&(r.mode=Po);break;case xd:if(f===0)break t;s[i++]=r.length,f--,r.mode=Po;break;case Dc:if(r.wrap){for(;h<32;){if(a===0)break t;a--,c|=n[o++]<<h,h+=8}if(u-=f,e.total_out+=u,r.total+=u,u&&(e.adler=r.check=r.flags?ce(r.check,s,u,i-u):vc(r.check,s,u,i-u)),u=f,(r.flags?c:_d(c))!==r.check){e.msg="incorrect data check",r.mode=$;break}c=0,h=0}r.mode=Bd;case Bd:if(r.wrap&&r.flags){for(;h<32;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(c!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=$;break}c=0,h=0}r.mode=Ed;case Ed:L=u_;break t;case $:L=Md;break t;case Gc:return Nc;case m_:default:return Ut}return e.next_out=i,e.avail_out=f,e.next_in=o,e.avail_in=a,r.hold=c,r.bits=h,(r.wsize||u!==e.avail_out&&r.mode<$&&(r.mode<Dc||t!==W0))&&Fd(e,e.output,e.next_out,u-e.avail_out)?(r.mode=Gc,Nc):(l-=e.avail_in,u-=e.avail_out,e.total_in+=l,e.total_out+=u,r.total+=u,r.wrap&&u&&(e.adler=r.check=r.flags?ce(r.check,s,u,e.next_out-u):vc(r.check,s,u,e.next_out-u)),e.data_type=r.bits+(r.last?64:0)+(r.mode===_e?128:0)+(r.mode===Uo||r.mode===Fc?256:0),(l===0&&u===0||t===W0)&&L===lr&&(L=A_),L)}function C_(e){if(!e||!e.state)return Ut;var t=e.state;return t.window&&(t.window=null),e.state=null,lr}function M_(e,t){var r;return!e||!e.state||(r=e.state,!(r.wrap&2))?Ut:(r.head=t,t.done=!1,lr)}function b_(e,t){var r=t.length,n,s,o;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==Ho)?Ut:n.mode===Ho&&(s=1,s=vc(s,t,r,0),s!==n.check)?Md:(o=Fd(e,t,r,r),o?(n.mode=Gc,Nc):(n.havedict=1,lr))}Kt.inflateReset=Id;Kt.inflateReset2=Sd;Kt.inflateResetKeep=wd;Kt.inflateInit=__;Kt.inflateInit2=Rd;Kt.inflate=T_;Kt.inflateEnd=C_;Kt.inflateGetHeader=M_;Kt.inflateSetDictionary=b_;Kt.inflateInfo="pako inflate (from Nodeca project)"});var Uc=ct((CL,Ld)=>{"use strict";Ld.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 vd=ct((ML,Od)=>{"use strict";function w_(){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}Od.exports=w_});var Gd=ct(hs=>{"use strict";var dn=Dd(),fs=xe(),ko=Tc(),st=Uc(),Pc=Io(),I_=Cc(),S_=vd(),Nd=Object.prototype.toString;function ur(e){if(!(this instanceof ur))return new ur(e);this.options=fs.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new I_,this.strm.avail_out=0;var r=dn.inflateInit2(this.strm,t.windowBits);if(r!==st.Z_OK)throw new Error(Pc[r]);if(this.header=new S_,dn.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=ko.string2buf(t.dictionary):Nd.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=dn.inflateSetDictionary(this.strm,t.dictionary),r!==st.Z_OK)))throw new Error(Pc[r])}ur.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,s=this.options.dictionary,o,i,a,f,c,h=!1;if(this.ended)return!1;i=t===~~t?t:t===!0?st.Z_FINISH:st.Z_NO_FLUSH,typeof e=="string"?r.input=ko.binstring2buf(e):Nd.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new fs.Buf8(n),r.next_out=0,r.avail_out=n),o=dn.inflate(r,st.Z_NO_FLUSH),o===st.Z_NEED_DICT&&s&&(o=dn.inflateSetDictionary(this.strm,s)),o===st.Z_BUF_ERROR&&h===!0&&(o=st.Z_OK,h=!1),o!==st.Z_STREAM_END&&o!==st.Z_OK)return this.onEnd(o),this.ended=!0,!1;r.next_out&&(r.avail_out===0||o===st.Z_STREAM_END||r.avail_in===0&&(i===st.Z_FINISH||i===st.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=ko.utf8border(r.output,r.next_out),f=r.next_out-a,c=ko.buf2string(r.output,a),r.next_out=f,r.avail_out=n-f,f&&fs.arraySet(r.output,r.output,a,f,0),this.onData(c)):this.onData(fs.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(h=!0)}while((r.avail_in>0||r.avail_out===0)&&o!==st.Z_STREAM_END);return o===st.Z_STREAM_END&&(i=st.Z_FINISH),i===st.Z_FINISH?(o=dn.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===st.Z_OK):(i===st.Z_SYNC_FLUSH&&(this.onEnd(st.Z_OK),r.avail_out=0),!0)};ur.prototype.onData=function(e){this.chunks.push(e)};ur.prototype.onEnd=function(e){e===st.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=fs.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Hc(e,t){var r=new ur(t);if(r.push(e,!0),r.err)throw r.msg||Pc[r.err];return r.result}function R_(e,t){return t=t||{},t.raw=!0,Hc(e,t)}hs.Inflate=ur;hs.inflate=Hc;hs.inflateRaw=R_;hs.ungzip=Hc});var Hd=ct((wL,Pd)=>{"use strict";var F_=xe().assign,D_=J0(),L_=Gd(),O_=Uc(),Ud={};F_(Ud,D_,L_,O_);Pd.exports=Ud});var kd=ct(()=>{});var ls={};ut(ls,{CesiumIonLoader:()=>ec,TILE3D_TYPE:()=>_t,Tile3DBatchTable:()=>ue,Tile3DFeatureTable:()=>kt,Tile3DSubtreeLoader:()=>Kr,Tile3DWriter:()=>Yd,Tiles3DArchive:()=>An,Tiles3DArchiveFileLoader:()=>zd,Tiles3DLoader:()=>rr,_getIonTilesetMetadata:()=>To});gs(ls,gr(pn(),1));async function Pt(e,t,r,n){return n._parse(e,t,r,n)}function J(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var Yt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},n1=Yt.self||Yt.window||Yt.global||{},s1=Yt.window||Yt.self||Yt.global||{},o1=Yt.global||Yt.self||Yt.window||{},i1=Yt.document||{};var Et=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var Zc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),a1=Zc&&parseFloat(Zc[1])||0;function gn(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function Qo(e){return globalThis.loaders?.modules?.[e]||null}function c1(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version}var qc=c1();function Wc(e,t){if(!e)throw new Error(t||"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},Z_=Zt.self||Zt.window||Zt.global||{},q_=Zt.window||Zt.self||Zt.global||{},W_=Zt.global||Zt.self||Zt.window||{},$_=Zt.document||{};var xr=typeof process!="object"||String(process)!=="[object process]"||process.browser,xs=typeof importScripts=="function",ty=typeof window<"u"&&typeof window.orientation<"u",$c=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),ey=$c&&parseFloat($c[1])||0;var Vo={};async function qt(e,t=null,r={},n=null){return t&&(e=tf(e,t,r,n)),Vo[e]=Vo[e]||f1(e),await Vo[e]}function tf(e,t,r={},n=null){if(!r.useLocalLibraries&&e.startsWith("http"))return e;n=n||e;let s=r.modules||{};return s[n]?s[n]:xr?r.CDN?(Wc(r.CDN.startsWith("http")),`${r.CDN}/${t}@${qc}/dist/libs/${n}`):xs?`../src/libs/${n}`:`modules/${t}/src/libs/${n}`:`modules/${t}/dist/libs/${n}`}async function f1(e){if(e.endsWith("wasm"))return await l1(e);if(!xr)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(e)}catch(r){return console.error(r),null}if(xs)return importScripts(e);let t=await u1(e);return h1(t,e)}function h1(e,t){if(!xr){let{requireFromString:n}=globalThis.loaders||{};return n?.(e,t)}if(xs)return eval.call(globalThis,e),null;let r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}async function l1(e){let{readFileAsArrayBuffer:t}=globalThis.loaders||{};return xr||!t||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await t(e)}async function u1(e){let{readFileAsText:t}=globalThis.loaders||{};return xr||!t||e.startsWith("http")?await(await fetch(e)).text():await t(e)}function rf(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?ef(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?ef(e,0,t):""}function ef(e,t,r){if(e.byteLength<=t+r)return"";let n=new DataView(e),s="";for(let o=0;o<r;o++)s+=String.fromCharCode(n.getUint8(t+o));return s}function jo(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${rf(e)}"`)}}function Te(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let n=new Uint8Array(e),s=new Uint8Array(t);for(let o=0;o<n.length;++o)if(n[o]!==s[o])return!1;return!0}function Br(...e){return nf(e)}function nf(e){let t=e.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),r=t.reduce((o,i)=>o+i.byteLength,0),n=new Uint8Array(r),s=0;for(let o of t)n.set(o,s),s+=o.byteLength;return n.buffer}function Je(e,t,r){let n=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function bt(e,t){return J(e>=0),J(t>0),e+(t-1)&~(t-1)}function Ko(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let s=e.byteOffset,o=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,s,o)}return t.set(n,r),r+bt(n.byteLength,4)}function Xo(e,t){let r=e.length,s=Math.ceil(r/t)*t-r,o="";for(let i=0;i<s;++i)o+=" ";return e+o}function Er(e,t,r,n){if(e)for(let s=0;s<n;s++)e.setUint8(t+s,r.charCodeAt(s));return t+n}function xn(e,t,r,n){if(e)for(let s=0;s<n;s++)e.setUint8(t+s,r[s]);return t+n}function sf(e,t,r,n){let s=bt(r.byteLength,n),o=s-r.byteLength;if(e){let i=new Uint8Array(e.buffer,e.byteOffset+t,r.byteLength),a=new Uint8Array(r);i.set(a);for(let f=0;f<o;++f)e.setUint8(t+r.byteLength+f,32)}return t+=s,t}function Bs(e,t,r,n){let o=new TextEncoder().encode(r);return t=sf(e,t,o,n),t}async function Bn(e){let t=[];for await(let r of e)t.push(r);return Br(...t)}function of(e){return e&&typeof e=="object"&&e.isBuffer}function _r(e){if(of(e))return e;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function yr(e){return t=>new Promise((r,n)=>e(t,(s,o)=>s?n(s):r(o)))}var Tr={};ut(Tr,{dirname:()=>A1,filename:()=>d1,join:()=>m1,resolve:()=>p1});function af(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf("/")+1)||""}function d1(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function A1(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function m1(...e){let t="/";return e=e.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${t}`),"")),n!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function p1(...e){let t=[];for(let o=0;o<e.length;o++)t[o]=e[o];let r="",n=!1,s;for(let o=t.length-1;o>=-1&&!n;o--){let i;o>=0?i=t[o]:(s===void 0&&(s=af()),i=s),i.length!==0&&(r=`${i}/${r}`,n=i.charCodeAt(0)===En)}return r=g1(r,!n),n?`/${r}`:r.length>0?r:"."}var En=47,Yo=46;function g1(e,t){let r="",n=-1,s=0,o,i=!1;for(let a=0;a<=e.length;++a){if(a<e.length)o=e.charCodeAt(a);else{if(o===En)break;o=En}if(o===En){if(!(n===a-1||s===1))if(n!==a-1&&s===2){if(r.length<2||!i||r.charCodeAt(r.length-1)!==Yo||r.charCodeAt(r.length-2)!==Yo){if(r.length>2){let f=r.length-1,c=f;for(;c>=0&&r.charCodeAt(c)!==En;--c);if(c!==f){r=c===-1?"":r.slice(0,c),n=a,s=0,i=!1;continue}}else if(r.length===2||r.length===1){r="",n=a,s=0,i=!1;continue}}t&&(r.length>0?r+="/..":r="..",i=!0)}else{let f=e.slice(n+1,a);r.length>0?r+=`/${f}`:r=f,i=!1}n=a,s=0}else o===Yo&&s!==-1?++s:s=-1}return r}var _n=new Error("Not implemented"),Es=class{handle;size=0;bigsize=0n;url="";constructor(t,r,n){if(globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(t,r,n);throw Et?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(t,r){throw _n}async write(t,r,n){throw _n}async stat(){throw _n}async truncate(t){throw _n}async append(t){throw _n}async close(){}};var Zo=e=>e?.getUint8&&e?.slice&&e?.length;var yn=class{file;constructor(t,r=!1){this.file=new Es(t,r?"a+":"r")}async truncate(t){await this.file.truncate(t)}async append(t){await this.file.append(t)}async destroy(){await this.file.close()}async getUint8(t){let r=await this.file.read(t,1),n=new Uint8Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint16(t){let r=await this.file.read(t,2),n=new Uint16Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint32(t){let r=await this.file.read(t,4),n=new Uint32Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getBigUint64(t){let r=await this.file.read(t,8),n=new BigInt64Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async slice(t,r){let n=r-t;if(n>Number.MAX_SAFE_INTEGER)throw new Error("too big slice");let s=Number(n);return await this.file.read(t,s)}get length(){return this.file.bigsize}};var Cr=e=>{if(e>Number.MAX_SAFE_INTEGER)throw new Error("Offset is out of bounds");return Number(e)},Tn=class{file;constructor(t){this.file=t}async destroy(){}async getUint8(t){return this.file.getUint8(Cr(t))}async getUint16(t){return this.file.getUint16(Cr(t),!0)}async getUint32(t){return this.file.getUint32(Cr(t),!0)}async getBigUint64(t){return this.file.getBigUint64(Cr(t),!0)}async slice(t,r){return this.file.buffer.slice(Cr(t),Cr(r))}get length(){return BigInt(this.file.byteLength)}};var eT=1/Math.PI*180,rT=1/180*Math.PI,x1={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...x1}};var et=globalThis.mathgl.config;function qo(e,{precision:t=et.precision}={}){return e=B1(e),"".concat(parseFloat(e.toPrecision(t)))}function Wt(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Wo(e,t,r){return _1(e,n=>Math.max(t,Math.min(r,n)))}function _s(e,t,r){let n=et.EPSILON;r&&(et.EPSILON=r);try{if(e===t)return!0;if(Wt(e)&&Wt(t)){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!_s(e[s],t[s]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=et.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{et.EPSILON=n}}function B1(e){return Math.round(e/et.EPSILON)*et.EPSILON}function E1(e){return e.clone?e.clone():new Array(e.length)}function _1(e,t,r){if(Wt(e)){let n=e;r=r||E1(n);for(let s=0;s<r.length&&s<n.length;++s){let o=typeof e=="number"?e:e[s];r[s]=t(o,s,r)}return r}return t(e)}function y1(e){function t(){var r=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var Mr=class extends y1(Array){clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:Wt(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(et)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+qo(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!_s(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let s=0;s<this.ELEMENTS;++s){let o=t[s],i=typeof r=="number"?r:r[s];this[s]=o+n*(i-o)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(et.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function T1(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function rt(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function cf(e,t,r=""){if(et.debug&&!T1(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function $o(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var br=class extends Mr{get x(){return this[0]}set x(t){this[0]=rt(t)}get y(){return this[1]}set y(t){this[1]=rt(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let s=this[n]-t[n];r+=s*s}return rt(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return rt(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return $o(t>=0&&t<this.ELEMENTS,"index is out of range"),rt(this[t])}setComponent(t,r){return $o(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var wr=typeof Float32Array<"u"?Float32Array:Array;var dT=Math.PI/180;function w1(){let e=new wr(2);return wr!=Float32Array&&(e[0]=0,e[1]=0),e}function hf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e}function lf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s+r[4],e[1]=r[1]*n+r[3]*s+r[5],e}function ys(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[3]*s+r[6],e[1]=r[1]*n+r[4]*s+r[7],e}function uf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[4]*s+r[12],e[1]=r[1]*n+r[5]*s+r[13],e}var AT=function(){let e=w1();return function(t,r,n,s,o,i){let a,f;for(r||(r=2),n||(n=0),s?f=Math.min(s*r+n,t.length):f=t.length,a=n;a<f;a+=r)e[0]=t[a],e[1]=t[a+1],o(e,e,i),t[a]=e[0],t[a+1]=e[1];return t}}();function df(e,t,r){let n=t[0],s=t[1],o=r[3]*n+r[7]*s||1;return e[0]=(r[0]*n+r[4]*s)/o,e[1]=(r[1]*n+r[5]*s)/o,e}function Af(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o||1;return e[0]=(r[0]*n+r[4]*s+r[8]*o)/i,e[1]=(r[1]*n+r[5]*s+r[9]*o)/i,e[2]=(r[2]*n+r[6]*s+r[10]*o)/i,e}function mf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e[2]=t[2],e}function pf(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=r[0]*n+r[3]*s+r[6]*o,e[1]=r[1]*n+r[4]*s+r[7]*o,e[2]=r[2]*n+r[5]*s+r[8]*o,e[3]=t[3],e}var ze=class extends br{constructor(t=0,r=0){super(2),Wt(t)&&arguments.length===1?this.copy(t):(et.debug&&(rt(t),rt(r)),this[0]=t,this[1]=r)}set(t,r){return this[0]=t,this[1]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return et.debug&&(rt(t.x),rt(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return uf(this,this,t),this.check()}transformAsVector(t){return df(this,this,t),this.check()}transformByMatrix3(t){return ys(this,this,t),this.check()}transformByMatrix2x3(t){return lf(this,this,t),this.check()}transformByMatrix2(t){return hf(this,this,t),this.check()}};function I1(){let e=new wr(3);return wr!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function S1(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function gf(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[0],a=r[1],f=r[2];return e[0]=s*f-o*a,e[1]=o*i-n*f,e[2]=n*a-s*i,e}function xf(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o+r[15];return i=i||1,e[0]=(r[0]*n+r[4]*s+r[8]*o+r[12])/i,e[1]=(r[1]*n+r[5]*s+r[9]*o+r[13])/i,e[2]=(r[2]*n+r[6]*s+r[10]*o+r[14])/i,e}function Ts(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=n*r[0]+s*r[3]+o*r[6],e[1]=n*r[1]+s*r[4]+o*r[7],e[2]=n*r[2]+s*r[5]+o*r[8],e}function Bf(e,t,r){let n=r[0],s=r[1],o=r[2],i=r[3],a=t[0],f=t[1],c=t[2],h=s*c-o*f,l=o*a-n*c,u=n*f-s*a,d=s*u-o*l,A=o*h-n*u,m=n*l-s*h,p=i*2;return h*=p,l*=p,u*=p,d*=2,A*=2,m*=2,e[0]=a+h+d,e[1]=f+l+A,e[2]=c+u+m,e}function Ef(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0],o[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),o[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function _f(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),o[1]=s[1],o[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function yf(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),o[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),o[2]=s[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Tf(e,t){let r=e[0],n=e[1],s=e[2],o=t[0],i=t[1],a=t[2],f=Math.sqrt((r*r+n*n+s*s)*(o*o+i*i+a*a)),c=f&&S1(e,t)/f;return Math.acos(Math.min(Math.max(c,-1),1))}var TT=function(){let e=I1();return function(t,r,n,s,o,i){let a,f;for(r||(r=3),n||(n=0),s?f=Math.min(s*r+n,t.length):f=t.length,a=n;a<f;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],o(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}}();var ti=[0,0,0],Cs,fe=class extends br{static get ZERO(){return Cs||(Cs=new fe(0,0,0),Object.freeze(Cs)),Cs}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Wt(t)?this.copy(t):(et.debug&&(rt(t),rt(r),rt(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return et.debug&&(rt(t.x),rt(t.y),rt(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=rt(t)}angle(t){return Tf(this,t)}cross(t){return gf(this,this,t),this.check()}rotateX({radians:t,origin:r=ti}){return Ef(this,this,r,t),this.check()}rotateY({radians:t,origin:r=ti}){return _f(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=ti}){return yf(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return xf(this,this,t),this.check()}transformAsVector(t){return Af(this,this,t),this.check()}transformByMatrix3(t){return Ts(this,this,t),this.check()}transformByMatrix2(t){return mf(this,this,t),this.check()}transformByQuaternion(t){return Bf(this,this,t),this.check()}};var Ms=class extends Mr{toString(){let t="[";if(et.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+r])}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=rt(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)r[s]=this[n+s];return r}setColumn(t,r){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)this[n+s]=r[s];return this}};function Cf(e,t){if(e===t){let r=t[1],n=t[2],s=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=s}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function Mf(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],f=t[6],c=t[7],h=t[8],l=h*i-a*c,u=-h*o+a*f,d=c*o-i*f,A=r*l+n*u+s*d;return A?(A=1/A,e[0]=l*A,e[1]=(-h*n+s*c)*A,e[2]=(a*n-s*i)*A,e[3]=u*A,e[4]=(h*r-s*f)*A,e[5]=(-a*r+s*o)*A,e[6]=d*A,e[7]=(-c*r+n*f)*A,e[8]=(i*r-n*o)*A,e):null}function bf(e){let t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],i=e[5],a=e[6],f=e[7],c=e[8];return t*(c*o-i*f)+r*(-c*s+i*a)+n*(f*s-o*a)}function ei(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=r[0],d=r[1],A=r[2],m=r[3],p=r[4],E=r[5],y=r[6],C=r[7],M=r[8];return e[0]=u*n+d*i+A*c,e[1]=u*s+d*a+A*h,e[2]=u*o+d*f+A*l,e[3]=m*n+p*i+E*c,e[4]=m*s+p*a+E*h,e[5]=m*o+p*f+E*l,e[6]=y*n+C*i+M*c,e[7]=y*s+C*a+M*h,e[8]=y*o+C*f+M*l,e}function wf(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=r[0],d=r[1];return e[0]=n,e[1]=s,e[2]=o,e[3]=i,e[4]=a,e[5]=f,e[6]=u*n+d*i+c,e[7]=u*s+d*a+h,e[8]=u*o+d*f+l,e}function If(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=Math.sin(r),d=Math.cos(r);return e[0]=d*n+u*i,e[1]=d*s+u*a,e[2]=d*o+u*f,e[3]=d*i-u*n,e[4]=d*a-u*s,e[5]=d*f-u*o,e[6]=c,e[7]=h,e[8]=l,e}function ri(e,t,r){let n=r[0],s=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=s*t[3],e[4]=s*t[4],e[5]=s*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Sf(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r+r,a=n+n,f=s+s,c=r*i,h=n*i,l=n*a,u=s*i,d=s*a,A=s*f,m=o*i,p=o*a,E=o*f;return e[0]=1-l-A,e[3]=h-E,e[6]=u+p,e[1]=h+E,e[4]=1-c-A,e[7]=d-m,e[2]=u-p,e[5]=d+m,e[8]=1-c-l,e}var ni;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(ni||(ni={}));var R1=Object.freeze([1,0,0,0,1,0,0,0,1]),he=class extends Ms{static get IDENTITY(){return D1()}static get ZERO(){return F1()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return ni}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(R1)}fromObject(t){return this.check()}fromQuaternion(t){return Sf(this,t),this.check()}set(t,r,n,s,o,i,a,f,c){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this[4]=o,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this.check()}setRowMajor(t,r,n,s,o,i,a,f,c){return this[0]=t,this[1]=s,this[2]=a,this[3]=r,this[4]=o,this[5]=f,this[6]=n,this[7]=i,this[8]=c,this.check()}determinant(){return bf(this)}transpose(){return Cf(this,this),this.check()}invert(){return Mf(this,this),this.check()}multiplyLeft(t){return ei(this,t,this),this.check()}multiplyRight(t){return ei(this,this,t),this.check()}rotate(t){return If(this,this,t),this.check()}scale(t){return Array.isArray(t)?ri(this,this,t):ri(this,this,[t,t]),this.check()}translate(t){return wf(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=ys(r||[-0,-0],t,this);break;case 3:n=Ts(r||[-0,-0,-0],t,this);break;case 4:n=pf(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return cf(n,t.length),n}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},bs,ws=null;function F1(){return bs||(bs=new he([0,0,0,0,0,0,0,0,0]),Object.freeze(bs)),bs}function D1(){return ws||(ws=new he,Object.freeze(ws)),ws}var Ir;(function(e){e[e.ADD=1]="ADD",e[e.REPLACE=2]="REPLACE"})(Ir||(Ir={}));var Ce;(function(e){e.EMPTY="empty",e.SCENEGRAPH="scenegraph",e.POINTCLOUD="pointcloud",e.MESH="mesh"})(Ce||(Ce={}));var Cn;(function(e){e.I3S="I3S",e.TILES3D="TILES3D"})(Cn||(Cn={}));var le;(function(e){e.GEOMETRIC_ERROR="geometricError",e.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(le||(le={}));var Sr="4.2.4";var _t={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},AC=Object.keys(_t),Me={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(e,t,r){J(e instanceof ArrayBuffer);let n=new TextDecoder("utf8"),s=new Uint8Array(e,t,r);return n.decode(s)}function Rf(e,t=0){let r=new DataView(e);return`${String.fromCharCode(r.getUint8(t+0))}${String.fromCharCode(r.getUint8(t+1))}${String.fromCharCode(r.getUint8(t+2))}${String.fromCharCode(r.getUint8(t+3))}`}var Ff="4.2.4";var Df={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:Ff,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 Lf(e){switch(e.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 oi(e){let t=1/0,r=1/0,n=1/0,s=-1/0,o=-1/0,i=-1/0,a=e.POSITION?e.POSITION.value:[],f=a&&a.length;for(let c=0;c<f;c+=3){let h=a[c],l=a[c+1],u=a[c+2];t=h<t?h:t,r=l<r?l:r,n=u<n?u:n,s=h>s?h:s,o=l>o?l:o,i=u>i?u:i}return[[t,r,n],[s,o,i]]}function ii(e,t,r){let n=Lf(t.value),s=r||Of(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:s}}function Of(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),t}function Nf(e,t,r){let n=Gf(t.metadata),s=[],o=L1(t.attributes);for(let i in e){let a=e[i],f=vf(i,a,o[i]);s.push(f)}if(r){let i=vf("indices",r);s.push(i)}return{fields:s,metadata:n}}function L1(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function vf(e,t,r){let n=r?Gf(r.metadata):void 0;return ii(e,t,n)}function Gf(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var Uf={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},O1={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},v1=4,Mn=class{draco;decoder;metadataQuerier;constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(r);let s=this.decoder.GetEncodedGeometryType(n),o=s===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let i;switch(s){case this.draco.TRIANGULAR_MESH:i=this.decoder.DecodeBufferToMesh(n,o);break;case this.draco.POINT_CLOUD:i=this.decoder.DecodeBufferToPointCloud(n,o);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!i.ok()||!o.ptr){let u=`DRACO decompression failed: ${i.error_msg()}`;throw new Error(u)}let a=this._getDracoLoaderData(o,s,r),f=this._getMeshData(o,a,r),c=oi(f.attributes),h=Nf(f.attributes,a,f.indices);return{loader:"draco",loaderData:a,header:{vertexCount:o.num_points(),boundingBox:c},...f,schema:h}}finally{this.draco.destroy(n),o&&this.draco.destroy(o)}}_getDracoLoaderData(t,r,n){let s=this._getTopLevelMetadata(t),o=this._getDracoAttributes(t,n);return{geometry_type:r,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:s,attributes:o}}_getDracoAttributes(t,r){let n={};for(let s=0;s<t.num_attributes();s++){let o=this.decoder.GetAttribute(t,s),i=this._getAttributeMetadata(t,s);n[o.unique_id()]={unique_id:o.unique_id(),attribute_type:o.attribute_type(),data_type:o.data_type(),num_components:o.num_components(),byte_offset:o.byte_offset(),byte_stride:o.byte_stride(),normalized:o.normalized(),attribute_index:s,metadata:i};let a=this._getQuantizationTransform(o,r);a&&(n[o.unique_id()].quantization_transform=a);let f=this._getOctahedronTransform(o,r);f&&(n[o.unique_id()].octahedron_transform=f)}return n}_getMeshData(t,r,n){let s=this._getMeshAttributes(r,t,n);if(!s.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:s,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:s,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:s}}_getMeshAttributes(t,r,n){let s={};for(let o of Object.values(t.attributes)){let i=this._deduceAttributeName(o,n);o.name=i;let a=this._getAttributeValues(r,o);if(a){let{value:f,size:c}=a;s[i]={value:f,size:c,byteOffset:o.byte_offset,byteStride:o.byte_stride,normalized:o.normalized}}}return s}_getTriangleListIndices(t){let n=t.num_faces()*3,s=n*v1,o=this.draco._malloc(s);try{return this.decoder.GetTrianglesUInt32Array(t,s,o),new Uint32Array(this.draco.HEAPF32.buffer,o,n).slice()}finally{this.draco._free(o)}}_getTriangleStripIndices(t){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,r),U1(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=O1[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let s=r.num_components,i=t.num_points()*s,a=i*n.BYTES_PER_ELEMENT,f=N1(this.draco,n),c,h=this.draco._malloc(a);try{let l=this.decoder.GetAttribute(t,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,l,f,a,h),c=new n(this.draco.HEAPF32.buffer,h,i).slice()}finally{this.draco._free(h)}return{value:c,size:s}}_deduceAttributeName(t,r){let n=t.unique_id;for(let[i,a]of Object.entries(r.extraAttributes||{}))if(a===n)return i;let s=t.attribute_type;for(let i in Uf)if(this.draco[i]===s)return Uf[i];let o=r.attributeNameEntry||"name";return t.metadata[o]?t.metadata[o].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(t){let r=this.decoder.GetMetadata(t);return this._getDracoMetadata(r)}_getAttributeMetadata(t,r){let n=this.decoder.GetAttributeMetadata(t,r);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(t);for(let s=0;s<n;s++){let o=this.metadataQuerier.GetEntryName(t,s);r[o]=this._getDracoMetadataField(t,o)}return r}_getDracoMetadataField(t,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,r,n);let s=G1(n);return{int:this.metadataQuerier.GetIntEntry(t,r),string:this.metadataQuerier.GetStringEntry(t,r),double:this.metadataQuerier.GetDoubleEntry(t,r),intArray:s}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=t,s=[...r,...n];for(let o of s)this.decoder.SkipAttributeTransform(this.draco[o])}_getQuantizationTransform(t,r){let{quantizedAttributes:n=[]}=r,s=t.attribute_type();if(n.map(i=>this.decoder[i]).includes(s)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(t))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(t,r){let{octahedronAttributes:n=[]}=r,s=t.attribute_type();if(n.map(i=>this.decoder[i]).includes(s)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(t))return{quantization_bits:i.quantization_bits()}}finally{this.draco.destroy(i)}}return null}};function N1(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}function G1(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function U1(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}var P1="1.5.6",H1="1.4.1",ai=`https://www.gstatic.com/draco/versioned/decoders/${P1}`,yt={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},ci={[yt.DECODER]:`${ai}/${yt.DECODER}`,[yt.DECODER_WASM]:`${ai}/${yt.DECODER_WASM}`,[yt.FALLBACK_DECODER]:`${ai}/${yt.FALLBACK_DECODER}`,[yt.ENCODER]:`https://raw.githubusercontent.com/google/draco/${H1}/javascript/${yt.ENCODER}`},fi;async function Pf(e){let t=e.modules||{};return t.draco3d?fi||=t.draco3d.createDecoderModule({}).then(r=>({draco:r})):fi||=k1(e),await fi}async function k1(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await qt(ci[yt.FALLBACK_DECODER],"draco",e,yt.FALLBACK_DECODER);break;case"wasm":default:[t,r]=await Promise.all([await qt(ci[yt.DECODER],"draco",e,yt.DECODER),await qt(ci[yt.DECODER_WASM],"draco",e,yt.DECODER_WASM)])}return t=t||globalThis.DracoDecoderModule,await J1(t,r)}function J1(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e({...r,onModuleLoaded:s=>n({draco:s})})})}var Is={...Df,parse:z1};async function z1(e,t){let{draco:r}=await Pf(t),n=new Mn(r);try{return n.parseSync(e,t?.draco)}finally{n.destroy()}}var Q1={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},nt={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},H={...Q1,...nt};var hi={[nt.DOUBLE]:Float64Array,[nt.FLOAT]:Float32Array,[nt.UNSIGNED_SHORT]:Uint16Array,[nt.UNSIGNED_INT]:Uint32Array,[nt.UNSIGNED_BYTE]:Uint8Array,[nt.BYTE]:Int8Array,[nt.SHORT]:Int16Array,[nt.INT]:Int32Array},V1={DOUBLE:nt.DOUBLE,FLOAT:nt.FLOAT,UNSIGNED_SHORT:nt.UNSIGNED_SHORT,UNSIGNED_INT:nt.UNSIGNED_INT,UNSIGNED_BYTE:nt.UNSIGNED_BYTE,BYTE:nt.BYTE,SHORT:nt.SHORT,INT:nt.INT},li="Failed to convert GL type",dt=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in hi)if(hi[r]===t)return r;throw new Error(li)}static fromName(t){let r=V1[t];if(!r)throw new Error(li);return r}static getArrayType(t){switch(t){case nt.UNSIGNED_SHORT_5_6_5:case nt.UNSIGNED_SHORT_4_4_4_4:case nt.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=hi[t];if(!r)throw new Error(li);return r}}static getByteSize(t){return dt.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(dt.getArrayType(t))}static createTypedArray(t,r,n=0,s){s===void 0&&(s=(r.byteLength-n)/dt.getByteSize(t));let o=dt.getArrayType(t);return new o(r,n,s)}};function Hf(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function ui(e,t=[0,0,0]){let r=e>>11&31,n=e>>5&63,s=e&31;return t[0]=r<<3,t[1]=n<<2,t[2]=s<<3,t}var YC=1/256;var ZC=new ze,qC=new fe,WC=new ze,$C=new ze,tM=new Uint8Array(1);function kf(e,t=255){return Wo(e,0,t)/t*2-1}function Jf(e){return e<0?-1:1}function zf(e,t,r,n){if(Hf(n),e<0||e>r||t<0||t>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(n.x=kf(e,r),n.y=kf(t,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){let s=n.x;n.x=(1-Math.abs(n.y))*Jf(s),n.y=(1-Math.abs(s))*Jf(n.y)}return n.normalize()}function di(e,t,r){return zf(e,t,255,r)}var j1=1/Math.PI*180,K1=1/180*Math.PI,X1={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...X1}};var q=globalThis.mathgl.config;function Ai(e,{precision:t=q.precision}={}){return e=Y1(e),`${parseFloat(e.toPrecision(t))}`}function $t(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function mi(e){return Qf(e)}function pi(e){return Vf(e)}function Qf(e,t){return jf(e,r=>r*K1,t)}function Vf(e,t){return jf(e,r=>r*j1,t)}function wt(e,t,r){let n=q.EPSILON;r&&(q.EPSILON=r);try{if(e===t)return!0;if($t(e)&&$t(t)){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!wt(e[s],t[s]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=q.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{q.EPSILON=n}}function Y1(e){return Math.round(e/q.EPSILON)*q.EPSILON}function Z1(e){return e.clone?e.clone():new Array(e.length)}function jf(e,t,r){if($t(e)){let n=e;r=r||Z1(n);for(let s=0;s<r.length&&s<n.length;++s){let o=typeof e=="number"?e:e[s];r[s]=t(o,s,r)}return r}return t(e)}var be=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:$t(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(q)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+Ai(this[n],t);return`${t.printTypes?this.constructor.name:""}[${r}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!wt(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let s=0;s<this.ELEMENTS;++s){let o=t[s],i=typeof r=="number"?r:r[s];this[s]=o+n*(i-o)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(q.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function q1(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function z(e){if(!Number.isFinite(e))throw new Error(`Invalid number ${JSON.stringify(e)}`);return e}function we(e,t,r=""){if(q.debug&&!q1(e,t))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return e}function ft(e,t){if(!e)throw new Error(`math.gl assertion ${t}`)}var Rr=class extends be{get x(){return this[0]}set x(t){this[0]=z(t)}get y(){return this[1]}set y(t){this[1]=z(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let s=this[n]-t[n];r+=s*s}return z(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return z(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return ft(t>=0&&t<this.ELEMENTS,"index is out of range"),z(this[t])}setComponent(t,r){return ft(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var W=typeof Float32Array<"u"?Float32Array:Array,bn=Math.random;function Fr(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var RM=Math.PI/180;function W1(){let e=new W(2);return W!=Float32Array&&(e[0]=0,e[1]=0),e}function Kf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[3]*s+r[6],e[1]=r[1]*n+r[4]*s+r[7],e}function Xf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[4]*s+r[12],e[1]=r[1]*n+r[5]*s+r[13],e}var FM=function(){let e=W1();return function(t,r,n,s,o,i){let a,f;for(r||(r=2),n||(n=0),s?f=Math.min(s*r+n,t.length):f=t.length,a=n;a<f;a+=r)e[0]=t[a],e[1]=t[a+1],o(e,e,i),t[a]=e[0],t[a+1]=e[1];return t}}();function Yf(e,t,r){let n=t[0],s=t[1],o=r[3]*n+r[7]*s||1;return e[0]=(r[0]*n+r[4]*s)/o,e[1]=(r[1]*n+r[5]*s)/o,e}function Ss(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o||1;return e[0]=(r[0]*n+r[4]*s+r[8]*o)/i,e[1]=(r[1]*n+r[5]*s+r[9]*o)/i,e[2]=(r[2]*n+r[6]*s+r[10]*o)/i,e}function Zf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e[2]=t[2],e}function qf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e[2]=t[2],e[3]=t[3],e}function Rs(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=r[0]*n+r[3]*s+r[6]*o,e[1]=r[1]*n+r[4]*s+r[7]*o,e[2]=r[2]*n+r[5]*s+r[8]*o,e[3]=t[3],e}var je={};ut(je,{add:()=>rA,angle:()=>_i,bezier:()=>mA,ceil:()=>nA,clone:()=>$1,copy:()=>tA,create:()=>Fs,cross:()=>Qe,dist:()=>CA,distance:()=>rh,div:()=>TA,divide:()=>eh,dot:()=>wn,equals:()=>EA,exactEquals:()=>BA,floor:()=>sA,forEach:()=>wA,fromValues:()=>Ds,hermite:()=>AA,inverse:()=>lA,len:()=>yi,length:()=>Wf,lerp:()=>uA,max:()=>iA,min:()=>oA,mul:()=>yA,multiply:()=>th,negate:()=>hA,normalize:()=>gi,random:()=>pA,rotateX:()=>xi,rotateY:()=>Bi,rotateZ:()=>Ei,round:()=>aA,scale:()=>cA,scaleAndAdd:()=>fA,set:()=>eA,slerp:()=>dA,sqrDist:()=>MA,sqrLen:()=>bA,squaredDistance:()=>nh,squaredLength:()=>sh,str:()=>xA,sub:()=>_A,subtract:()=>$f,transformMat3:()=>In,transformMat4:()=>Ve,transformQuat:()=>Sn,zero:()=>gA});function Fs(){let e=new W(3);return W!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function $1(e){let t=new W(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Wf(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function Ds(e,t,r){let n=new W(3);return n[0]=e,n[1]=t,n[2]=r,n}function tA(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function eA(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function rA(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function $f(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function th(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function eh(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function nA(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function sA(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function oA(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function iA(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function aA(e,t){return e[0]=Fr(t[0]),e[1]=Fr(t[1]),e[2]=Fr(t[2]),e}function cA(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function fA(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function rh(e,t){let r=t[0]-e[0],n=t[1]-e[1],s=t[2]-e[2];return Math.sqrt(r*r+n*n+s*s)}function nh(e,t){let r=t[0]-e[0],n=t[1]-e[1],s=t[2]-e[2];return r*r+n*n+s*s}function sh(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function hA(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function lA(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function gi(e,t){let r=t[0],n=t[1],s=t[2],o=r*r+n*n+s*s;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function wn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Qe(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[0],a=r[1],f=r[2];return e[0]=s*f-o*a,e[1]=o*i-n*f,e[2]=n*a-s*i,e}function uA(e,t,r,n){let s=t[0],o=t[1],i=t[2];return e[0]=s+n*(r[0]-s),e[1]=o+n*(r[1]-o),e[2]=i+n*(r[2]-i),e}function dA(e,t,r,n){let s=Math.acos(Math.min(Math.max(wn(t,r),-1),1)),o=Math.sin(s),i=Math.sin((1-n)*s)/o,a=Math.sin(n*s)/o;return e[0]=i*t[0]+a*r[0],e[1]=i*t[1]+a*r[1],e[2]=i*t[2]+a*r[2],e}function AA(e,t,r,n,s,o){let i=o*o,a=i*(2*o-3)+1,f=i*(o-2)+o,c=i*(o-1),h=i*(3-2*o);return e[0]=t[0]*a+r[0]*f+n[0]*c+s[0]*h,e[1]=t[1]*a+r[1]*f+n[1]*c+s[1]*h,e[2]=t[2]*a+r[2]*f+n[2]*c+s[2]*h,e}function mA(e,t,r,n,s,o){let i=1-o,a=i*i,f=o*o,c=a*i,h=3*o*a,l=3*f*i,u=f*o;return e[0]=t[0]*c+r[0]*h+n[0]*l+s[0]*u,e[1]=t[1]*c+r[1]*h+n[1]*l+s[1]*u,e[2]=t[2]*c+r[2]*h+n[2]*l+s[2]*u,e}function pA(e,t){t=t===void 0?1:t;let r=bn()*2*Math.PI,n=bn()*2-1,s=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*s,e[1]=Math.sin(r)*s,e[2]=n*t,e}function Ve(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o+r[15];return i=i||1,e[0]=(r[0]*n+r[4]*s+r[8]*o+r[12])/i,e[1]=(r[1]*n+r[5]*s+r[9]*o+r[13])/i,e[2]=(r[2]*n+r[6]*s+r[10]*o+r[14])/i,e}function In(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=n*r[0]+s*r[3]+o*r[6],e[1]=n*r[1]+s*r[4]+o*r[7],e[2]=n*r[2]+s*r[5]+o*r[8],e}function Sn(e,t,r){let n=r[0],s=r[1],o=r[2],i=r[3],a=t[0],f=t[1],c=t[2],h=s*c-o*f,l=o*a-n*c,u=n*f-s*a,d=s*u-o*l,A=o*h-n*u,m=n*l-s*h,p=i*2;return h*=p,l*=p,u*=p,d*=2,A*=2,m*=2,e[0]=a+h+d,e[1]=f+l+A,e[2]=c+u+m,e}function xi(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0],o[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),o[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Bi(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),o[1]=s[1],o[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Ei(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),o[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),o[2]=s[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function _i(e,t){let r=e[0],n=e[1],s=e[2],o=t[0],i=t[1],a=t[2],f=Math.sqrt((r*r+n*n+s*s)*(o*o+i*i+a*a)),c=f&&wn(e,t)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function gA(e){return e[0]=0,e[1]=0,e[2]=0,e}function xA(e){return`vec3(${e[0]}, ${e[1]}, ${e[2]})`}function BA(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function EA(e,t){let r=e[0],n=e[1],s=e[2],o=t[0],i=t[1],a=t[2];return Math.abs(r-o)<=1e-6*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}var _A=$f,yA=th,TA=eh,CA=rh,MA=nh,yi=Wf,bA=sh,wA=function(){let e=Fs();return function(t,r,n,s,o,i){let a,f;for(r||(r=3),n||(n=0),s?f=Math.min(s*r+n,t.length):f=t.length,a=n;a<f;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],o(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}}();var Ti=[0,0,0],Ls,b=class extends Rr{static get ZERO(){return Ls||(Ls=new b(0,0,0),Object.freeze(Ls)),Ls}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&$t(t)?this.copy(t):(q.debug&&(z(t),z(r),z(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return q.debug&&(z(t.x),z(t.y),z(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=z(t)}angle(t){return _i(this,t)}cross(t){return Qe(this,this,t),this.check()}rotateX({radians:t,origin:r=Ti}){return xi(this,this,r,t),this.check()}rotateY({radians:t,origin:r=Ti}){return Bi(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=Ti}){return Ei(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Ve(this,this,t),this.check()}transformAsVector(t){return Ss(this,this,t),this.check()}transformByMatrix3(t){return In(this,this,t),this.check()}transformByMatrix2(t){return Zf(this,this,t),this.check()}transformByQuaternion(t){return Sn(this,this,t),this.check()}};var Os,Lr=class extends Rr{static get ZERO(){return Os||(Os=new Lr(0,0,0,0),Object.freeze(Os)),Os}constructor(t=0,r=0,n=0,s=0){super(-0,-0,-0,-0),$t(t)&&arguments.length===1?this.copy(t):(q.debug&&(z(t),z(r),z(n),z(s)),this[0]=t,this[1]=r,this[2]=n,this[3]=s)}set(t,r,n,s){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return q.debug&&(z(t.x),z(t.y),z(t.z),z(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=z(t)}get w(){return this[3]}set w(t){this[3]=z(t)}transform(t){return Ve(this,this,t),this.check()}transformByMatrix3(t){return Rs(this,this,t),this.check()}transformByMatrix2(t){return qf(this,this,t),this.check()}transformByQuaternion(t){return Sn(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var Or=class extends be{toString(){let t="[";if(q.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=` ${this[n*this.RANK+r]}`}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=` ${this[r]}`}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=z(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)r[s]=this[n+s];return r}setColumn(t,r){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)this[n+s]=r[s];return this}};function oh(){let e=new W(9);return W!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ih(e,t){if(e===t){let r=t[1],n=t[2],s=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=s}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function ah(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],f=t[6],c=t[7],h=t[8],l=h*i-a*c,u=-h*o+a*f,d=c*o-i*f,A=r*l+n*u+s*d;return A?(A=1/A,e[0]=l*A,e[1]=(-h*n+s*c)*A,e[2]=(a*n-s*i)*A,e[3]=u*A,e[4]=(h*r-s*f)*A,e[5]=(-a*r+s*o)*A,e[6]=d*A,e[7]=(-c*r+n*f)*A,e[8]=(i*r-n*o)*A,e):null}function ch(e){let t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],i=e[5],a=e[6],f=e[7],c=e[8];return t*(c*o-i*f)+r*(-c*s+i*a)+n*(f*s-o*a)}function Ci(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=r[0],d=r[1],A=r[2],m=r[3],p=r[4],E=r[5],y=r[6],C=r[7],M=r[8];return e[0]=u*n+d*i+A*c,e[1]=u*s+d*a+A*h,e[2]=u*o+d*f+A*l,e[3]=m*n+p*i+E*c,e[4]=m*s+p*a+E*h,e[5]=m*o+p*f+E*l,e[6]=y*n+C*i+M*c,e[7]=y*s+C*a+M*h,e[8]=y*o+C*f+M*l,e}function fh(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=r[0],d=r[1];return e[0]=n,e[1]=s,e[2]=o,e[3]=i,e[4]=a,e[5]=f,e[6]=u*n+d*i+c,e[7]=u*s+d*a+h,e[8]=u*o+d*f+l,e}function hh(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=Math.sin(r),d=Math.cos(r);return e[0]=d*n+u*i,e[1]=d*s+u*a,e[2]=d*o+u*f,e[3]=d*i-u*n,e[4]=d*a-u*s,e[5]=d*f-u*o,e[6]=c,e[7]=h,e[8]=l,e}function Mi(e,t,r){let n=r[0],s=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=s*t[3],e[4]=s*t[4],e[5]=s*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function lh(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r+r,a=n+n,f=s+s,c=r*i,h=n*i,l=n*a,u=s*i,d=s*a,A=s*f,m=o*i,p=o*a,E=o*f;return e[0]=1-l-A,e[3]=h-E,e[6]=u+p,e[1]=h+E,e[4]=1-c-A,e[7]=d-m,e[2]=u-p,e[5]=d+m,e[8]=1-c-l,e}var bi;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(bi||(bi={}));var SA=Object.freeze([1,0,0,0,1,0,0,0,1]),Z=class extends Or{static get IDENTITY(){return FA()}static get ZERO(){return RA()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return bi}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(SA)}fromObject(t){return this.check()}fromQuaternion(t){return lh(this,t),this.check()}set(t,r,n,s,o,i,a,f,c){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this[4]=o,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this.check()}setRowMajor(t,r,n,s,o,i,a,f,c){return this[0]=t,this[1]=s,this[2]=a,this[3]=r,this[4]=o,this[5]=f,this[6]=n,this[7]=i,this[8]=c,this.check()}determinant(){return ch(this)}transpose(){return ih(this,this),this.check()}invert(){return ah(this,this),this.check()}multiplyLeft(t){return Ci(this,t,this),this.check()}multiplyRight(t){return Ci(this,this,t),this.check()}rotate(t){return hh(this,this,t),this.check()}scale(t){return Array.isArray(t)?Mi(this,this,t):Mi(this,this,[t,t]),this.check()}translate(t){return fh(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=Kf(r||[-0,-0],t,this);break;case 3:n=In(r||[-0,-0,-0],t,this);break;case 4:n=Rs(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return we(n,t.length),n}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},vs,Ns=null;function RA(){return vs||(vs=new Z([0,0,0,0,0,0,0,0,0]),Object.freeze(vs)),vs}function FA(){return Ns||(Ns=new Z,Object.freeze(Ns)),Ns}var Fn={};ut(Fn,{add:()=>rm,adjoint:()=>GA,clone:()=>LA,copy:()=>OA,create:()=>DA,decompose:()=>KA,determinant:()=>Si,equals:()=>im,exactEquals:()=>om,frob:()=>em,fromQuat:()=>Ni,fromQuat2:()=>QA,fromRotation:()=>HA,fromRotationTranslation:()=>dh,fromRotationTranslationScale:()=>XA,fromRotationTranslationScaleOrigin:()=>YA,fromScaling:()=>PA,fromTranslation:()=>UA,fromValues:()=>vA,fromXRotation:()=>kA,fromYRotation:()=>JA,fromZRotation:()=>zA,frustum:()=>Gi,getRotation:()=>jA,getScaling:()=>Ah,getTranslation:()=>VA,identity:()=>uh,invert:()=>Ii,lookAt:()=>Hi,mul:()=>am,multiply:()=>Rn,multiplyScalar:()=>nm,multiplyScalarAndAdd:()=>sm,ortho:()=>Pi,orthoNO:()=>ph,orthoZO:()=>WA,perspective:()=>Ui,perspectiveFromFieldOfView:()=>qA,perspectiveNO:()=>mh,perspectiveZO:()=>ZA,rotate:()=>Di,rotateX:()=>Li,rotateY:()=>Oi,rotateZ:()=>vi,scale:()=>Fi,set:()=>NA,str:()=>tm,sub:()=>cm,subtract:()=>gh,targetTo:()=>$A,translate:()=>Ri,transpose:()=>wi});function DA(){let e=new W(16);return W!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function LA(e){let t=new W(16);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 OA(e,t){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 vA(e,t,r,n,s,o,i,a,f,c,h,l,u,d,A,m){let p=new W(16);return p[0]=e,p[1]=t,p[2]=r,p[3]=n,p[4]=s,p[5]=o,p[6]=i,p[7]=a,p[8]=f,p[9]=c,p[10]=h,p[11]=l,p[12]=u,p[13]=d,p[14]=A,p[15]=m,p}function NA(e,t,r,n,s,o,i,a,f,c,h,l,u,d,A,m,p){return e[0]=t,e[1]=r,e[2]=n,e[3]=s,e[4]=o,e[5]=i,e[6]=a,e[7]=f,e[8]=c,e[9]=h,e[10]=l,e[11]=u,e[12]=d,e[13]=A,e[14]=m,e[15]=p,e}function uh(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function wi(e,t){if(e===t){let r=t[1],n=t[2],s=t[3],o=t[6],i=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=s,e[13]=i,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function Ii(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],f=t[6],c=t[7],h=t[8],l=t[9],u=t[10],d=t[11],A=t[12],m=t[13],p=t[14],E=t[15],y=r*a-n*i,C=r*f-s*i,M=r*c-o*i,T=n*f-s*a,I=n*c-o*a,w=s*c-o*f,L=h*m-l*A,x=h*p-u*A,g=h*E-d*A,B=l*p-u*m,_=l*E-d*m,U=u*E-d*p,G=y*U-C*_+M*B+T*g-I*x+w*L;return G?(G=1/G,e[0]=(a*U-f*_+c*B)*G,e[1]=(s*_-n*U-o*B)*G,e[2]=(m*w-p*I+E*T)*G,e[3]=(u*I-l*w-d*T)*G,e[4]=(f*g-i*U-c*x)*G,e[5]=(r*U-s*g+o*x)*G,e[6]=(p*M-A*w-E*C)*G,e[7]=(h*w-u*M+d*C)*G,e[8]=(i*_-a*g+c*L)*G,e[9]=(n*g-r*_-o*L)*G,e[10]=(A*I-m*M+E*y)*G,e[11]=(l*M-h*I-d*y)*G,e[12]=(a*x-i*B-f*L)*G,e[13]=(r*B-n*x+s*L)*G,e[14]=(m*C-A*T-p*y)*G,e[15]=(h*T-l*C+u*y)*G,e):null}function GA(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],f=t[6],c=t[7],h=t[8],l=t[9],u=t[10],d=t[11],A=t[12],m=t[13],p=t[14],E=t[15],y=r*a-n*i,C=r*f-s*i,M=r*c-o*i,T=n*f-s*a,I=n*c-o*a,w=s*c-o*f,L=h*m-l*A,x=h*p-u*A,g=h*E-d*A,B=l*p-u*m,_=l*E-d*m,U=u*E-d*p;return e[0]=a*U-f*_+c*B,e[1]=s*_-n*U-o*B,e[2]=m*w-p*I+E*T,e[3]=u*I-l*w-d*T,e[4]=f*g-i*U-c*x,e[5]=r*U-s*g+o*x,e[6]=p*M-A*w-E*C,e[7]=h*w-u*M+d*C,e[8]=i*_-a*g+c*L,e[9]=n*g-r*_-o*L,e[10]=A*I-m*M+E*y,e[11]=l*M-h*I-d*y,e[12]=a*x-i*B-f*L,e[13]=r*B-n*x+s*L,e[14]=m*C-A*T-p*y,e[15]=h*T-l*C+u*y,e}function Si(e){let t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],i=e[5],a=e[6],f=e[7],c=e[8],h=e[9],l=e[10],u=e[11],d=e[12],A=e[13],m=e[14],p=e[15],E=t*i-r*o,y=t*a-n*o,C=r*a-n*i,M=c*A-h*d,T=c*m-l*d,I=h*m-l*A,w=t*I-r*T+n*M,L=o*I-i*T+a*M,x=c*C-h*y+l*E,g=d*C-A*y+m*E;return f*w-s*L+p*x-u*g}function Rn(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=t[9],d=t[10],A=t[11],m=t[12],p=t[13],E=t[14],y=t[15],C=r[0],M=r[1],T=r[2],I=r[3];return e[0]=C*n+M*a+T*l+I*m,e[1]=C*s+M*f+T*u+I*p,e[2]=C*o+M*c+T*d+I*E,e[3]=C*i+M*h+T*A+I*y,C=r[4],M=r[5],T=r[6],I=r[7],e[4]=C*n+M*a+T*l+I*m,e[5]=C*s+M*f+T*u+I*p,e[6]=C*o+M*c+T*d+I*E,e[7]=C*i+M*h+T*A+I*y,C=r[8],M=r[9],T=r[10],I=r[11],e[8]=C*n+M*a+T*l+I*m,e[9]=C*s+M*f+T*u+I*p,e[10]=C*o+M*c+T*d+I*E,e[11]=C*i+M*h+T*A+I*y,C=r[12],M=r[13],T=r[14],I=r[15],e[12]=C*n+M*a+T*l+I*m,e[13]=C*s+M*f+T*u+I*p,e[14]=C*o+M*c+T*d+I*E,e[15]=C*i+M*h+T*A+I*y,e}function Ri(e,t,r){let n=r[0],s=r[1],o=r[2],i,a,f,c,h,l,u,d,A,m,p,E;return t===e?(e[12]=t[0]*n+t[4]*s+t[8]*o+t[12],e[13]=t[1]*n+t[5]*s+t[9]*o+t[13],e[14]=t[2]*n+t[6]*s+t[10]*o+t[14],e[15]=t[3]*n+t[7]*s+t[11]*o+t[15]):(i=t[0],a=t[1],f=t[2],c=t[3],h=t[4],l=t[5],u=t[6],d=t[7],A=t[8],m=t[9],p=t[10],E=t[11],e[0]=i,e[1]=a,e[2]=f,e[3]=c,e[4]=h,e[5]=l,e[6]=u,e[7]=d,e[8]=A,e[9]=m,e[10]=p,e[11]=E,e[12]=i*n+h*s+A*o+t[12],e[13]=a*n+l*s+m*o+t[13],e[14]=f*n+u*s+p*o+t[14],e[15]=c*n+d*s+E*o+t[15]),e}function Fi(e,t,r){let n=r[0],s=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Di(e,t,r,n){let s=n[0],o=n[1],i=n[2],a=Math.sqrt(s*s+o*o+i*i),f,c,h,l,u,d,A,m,p,E,y,C,M,T,I,w,L,x,g,B,_,U,G,P;return a<1e-6?null:(a=1/a,s*=a,o*=a,i*=a,c=Math.sin(r),f=Math.cos(r),h=1-f,l=t[0],u=t[1],d=t[2],A=t[3],m=t[4],p=t[5],E=t[6],y=t[7],C=t[8],M=t[9],T=t[10],I=t[11],w=s*s*h+f,L=o*s*h+i*c,x=i*s*h-o*c,g=s*o*h-i*c,B=o*o*h+f,_=i*o*h+s*c,U=s*i*h+o*c,G=o*i*h-s*c,P=i*i*h+f,e[0]=l*w+m*L+C*x,e[1]=u*w+p*L+M*x,e[2]=d*w+E*L+T*x,e[3]=A*w+y*L+I*x,e[4]=l*g+m*B+C*_,e[5]=u*g+p*B+M*_,e[6]=d*g+E*B+T*_,e[7]=A*g+y*B+I*_,e[8]=l*U+m*G+C*P,e[9]=u*U+p*G+M*P,e[10]=d*U+E*G+T*P,e[11]=A*U+y*G+I*P,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function Li(e,t,r){let n=Math.sin(r),s=Math.cos(r),o=t[4],i=t[5],a=t[6],f=t[7],c=t[8],h=t[9],l=t[10],u=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*s+c*n,e[5]=i*s+h*n,e[6]=a*s+l*n,e[7]=f*s+u*n,e[8]=c*s-o*n,e[9]=h*s-i*n,e[10]=l*s-a*n,e[11]=u*s-f*n,e}function Oi(e,t,r){let n=Math.sin(r),s=Math.cos(r),o=t[0],i=t[1],a=t[2],f=t[3],c=t[8],h=t[9],l=t[10],u=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*s-c*n,e[1]=i*s-h*n,e[2]=a*s-l*n,e[3]=f*s-u*n,e[8]=o*n+c*s,e[9]=i*n+h*s,e[10]=a*n+l*s,e[11]=f*n+u*s,e}function vi(e,t,r){let n=Math.sin(r),s=Math.cos(r),o=t[0],i=t[1],a=t[2],f=t[3],c=t[4],h=t[5],l=t[6],u=t[7];return t!==e&&(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[0]=o*s+c*n,e[1]=i*s+h*n,e[2]=a*s+l*n,e[3]=f*s+u*n,e[4]=c*s-o*n,e[5]=h*s-i*n,e[6]=l*s-a*n,e[7]=u*s-f*n,e}function UA(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function PA(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function HA(e,t,r){let n=r[0],s=r[1],o=r[2],i=Math.sqrt(n*n+s*s+o*o),a,f,c;return i<1e-6?null:(i=1/i,n*=i,s*=i,o*=i,f=Math.sin(t),a=Math.cos(t),c=1-a,e[0]=n*n*c+a,e[1]=s*n*c+o*f,e[2]=o*n*c-s*f,e[3]=0,e[4]=n*s*c-o*f,e[5]=s*s*c+a,e[6]=o*s*c+n*f,e[7]=0,e[8]=n*o*c+s*f,e[9]=s*o*c-n*f,e[10]=o*o*c+a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function kA(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function JA(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function zA(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function dh(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=n+n,f=s+s,c=o+o,h=n*a,l=n*f,u=n*c,d=s*f,A=s*c,m=o*c,p=i*a,E=i*f,y=i*c;return e[0]=1-(d+m),e[1]=l+y,e[2]=u-E,e[3]=0,e[4]=l-y,e[5]=1-(h+m),e[6]=A+p,e[7]=0,e[8]=u+E,e[9]=A-p,e[10]=1-(h+d),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function QA(e,t){let r=new W(3),n=-t[0],s=-t[1],o=-t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=n*n+s*s+o*o+i*i;return l>0?(r[0]=(a*i+h*n+f*o-c*s)*2/l,r[1]=(f*i+h*s+c*n-a*o)*2/l,r[2]=(c*i+h*o+a*s-f*n)*2/l):(r[0]=(a*i+h*n+f*o-c*s)*2,r[1]=(f*i+h*s+c*n-a*o)*2,r[2]=(c*i+h*o+a*s-f*n)*2),dh(e,t,r),e}function VA(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Ah(e,t){let r=t[0],n=t[1],s=t[2],o=t[4],i=t[5],a=t[6],f=t[8],c=t[9],h=t[10];return e[0]=Math.sqrt(r*r+n*n+s*s),e[1]=Math.sqrt(o*o+i*i+a*a),e[2]=Math.sqrt(f*f+c*c+h*h),e}function jA(e,t){let r=new W(3);Ah(r,t);let n=1/r[0],s=1/r[1],o=1/r[2],i=t[0]*n,a=t[1]*s,f=t[2]*o,c=t[4]*n,h=t[5]*s,l=t[6]*o,u=t[8]*n,d=t[9]*s,A=t[10]*o,m=i+h+A,p=0;return m>0?(p=Math.sqrt(m+1)*2,e[3]=.25*p,e[0]=(l-d)/p,e[1]=(u-f)/p,e[2]=(a-c)/p):i>h&&i>A?(p=Math.sqrt(1+i-h-A)*2,e[3]=(l-d)/p,e[0]=.25*p,e[1]=(a+c)/p,e[2]=(u+f)/p):h>A?(p=Math.sqrt(1+h-i-A)*2,e[3]=(u-f)/p,e[0]=(a+c)/p,e[1]=.25*p,e[2]=(l+d)/p):(p=Math.sqrt(1+A-i-h)*2,e[3]=(a-c)/p,e[0]=(u+f)/p,e[1]=(l+d)/p,e[2]=.25*p),e}function KA(e,t,r,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];let s=n[0],o=n[1],i=n[2],a=n[4],f=n[5],c=n[6],h=n[8],l=n[9],u=n[10];r[0]=Math.sqrt(s*s+o*o+i*i),r[1]=Math.sqrt(a*a+f*f+c*c),r[2]=Math.sqrt(h*h+l*l+u*u);let d=1/r[0],A=1/r[1],m=1/r[2],p=s*d,E=o*A,y=i*m,C=a*d,M=f*A,T=c*m,I=h*d,w=l*A,L=u*m,x=p+M+L,g=0;return x>0?(g=Math.sqrt(x+1)*2,e[3]=.25*g,e[0]=(T-w)/g,e[1]=(I-y)/g,e[2]=(E-C)/g):p>M&&p>L?(g=Math.sqrt(1+p-M-L)*2,e[3]=(T-w)/g,e[0]=.25*g,e[1]=(E+C)/g,e[2]=(I+y)/g):M>L?(g=Math.sqrt(1+M-p-L)*2,e[3]=(I-y)/g,e[0]=(E+C)/g,e[1]=.25*g,e[2]=(T+w)/g):(g=Math.sqrt(1+L-p-M)*2,e[3]=(E-C)/g,e[0]=(I+y)/g,e[1]=(T+w)/g,e[2]=.25*g),e}function XA(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=t[3],f=s+s,c=o+o,h=i+i,l=s*f,u=s*c,d=s*h,A=o*c,m=o*h,p=i*h,E=a*f,y=a*c,C=a*h,M=n[0],T=n[1],I=n[2];return e[0]=(1-(A+p))*M,e[1]=(u+C)*M,e[2]=(d-y)*M,e[3]=0,e[4]=(u-C)*T,e[5]=(1-(l+p))*T,e[6]=(m+E)*T,e[7]=0,e[8]=(d+y)*I,e[9]=(m-E)*I,e[10]=(1-(l+A))*I,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function YA(e,t,r,n,s){let o=t[0],i=t[1],a=t[2],f=t[3],c=o+o,h=i+i,l=a+a,u=o*c,d=o*h,A=o*l,m=i*h,p=i*l,E=a*l,y=f*c,C=f*h,M=f*l,T=n[0],I=n[1],w=n[2],L=s[0],x=s[1],g=s[2],B=(1-(m+E))*T,_=(d+M)*T,U=(A-C)*T,G=(d-M)*I,P=(1-(u+E))*I,v=(p+y)*I,at=(A+C)*w,mt=(p-y)*w,X=(1-(u+m))*w;return e[0]=B,e[1]=_,e[2]=U,e[3]=0,e[4]=G,e[5]=P,e[6]=v,e[7]=0,e[8]=at,e[9]=mt,e[10]=X,e[11]=0,e[12]=r[0]+L-(B*L+G*x+at*g),e[13]=r[1]+x-(_*L+P*x+mt*g),e[14]=r[2]+g-(U*L+v*x+X*g),e[15]=1,e}function Ni(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r+r,a=n+n,f=s+s,c=r*i,h=n*i,l=n*a,u=s*i,d=s*a,A=s*f,m=o*i,p=o*a,E=o*f;return e[0]=1-l-A,e[1]=h+E,e[2]=u-p,e[3]=0,e[4]=h-E,e[5]=1-c-A,e[6]=d+m,e[7]=0,e[8]=u+p,e[9]=d-m,e[10]=1-c-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Gi(e,t,r,n,s,o,i){let a=1/(r-t),f=1/(s-n),c=1/(o-i);return e[0]=o*2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*f,e[6]=0,e[7]=0,e[8]=(r+t)*a,e[9]=(s+n)*f,e[10]=(i+o)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=i*o*2*c,e[15]=0,e}function mh(e,t,r,n,s){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,s!=null&&s!==1/0){let i=1/(n-s);e[10]=(s+n)*i,e[14]=2*s*n*i}else e[10]=-1,e[14]=-2*n;return e}var Ui=mh;function ZA(e,t,r,n,s){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,s!=null&&s!==1/0){let i=1/(n-s);e[10]=s*i,e[14]=s*n*i}else e[10]=-1,e[14]=-n;return e}function qA(e,t,r,n){let s=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),f=2/(i+a),c=2/(s+o);return e[0]=f,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-((i-a)*f*.5),e[9]=(s-o)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function ph(e,t,r,n,s,o,i){let a=1/(t-r),f=1/(n-s),c=1/(o-i);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*f,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*a,e[13]=(s+n)*f,e[14]=(i+o)*c,e[15]=1,e}var Pi=ph;function WA(e,t,r,n,s,o,i){let a=1/(t-r),f=1/(n-s),c=1/(o-i);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*f,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=c,e[11]=0,e[12]=(t+r)*a,e[13]=(s+n)*f,e[14]=o*c,e[15]=1,e}function Hi(e,t,r,n){let s,o,i,a,f,c,h,l,u,d,A=t[0],m=t[1],p=t[2],E=n[0],y=n[1],C=n[2],M=r[0],T=r[1],I=r[2];return Math.abs(A-M)<1e-6&&Math.abs(m-T)<1e-6&&Math.abs(p-I)<1e-6?uh(e):(l=A-M,u=m-T,d=p-I,s=1/Math.sqrt(l*l+u*u+d*d),l*=s,u*=s,d*=s,o=y*d-C*u,i=C*l-E*d,a=E*u-y*l,s=Math.sqrt(o*o+i*i+a*a),s?(s=1/s,o*=s,i*=s,a*=s):(o=0,i=0,a=0),f=u*a-d*i,c=d*o-l*a,h=l*i-u*o,s=Math.sqrt(f*f+c*c+h*h),s?(s=1/s,f*=s,c*=s,h*=s):(f=0,c=0,h=0),e[0]=o,e[1]=f,e[2]=l,e[3]=0,e[4]=i,e[5]=c,e[6]=u,e[7]=0,e[8]=a,e[9]=h,e[10]=d,e[11]=0,e[12]=-(o*A+i*m+a*p),e[13]=-(f*A+c*m+h*p),e[14]=-(l*A+u*m+d*p),e[15]=1,e)}function $A(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=n[0],f=n[1],c=n[2],h=s-r[0],l=o-r[1],u=i-r[2],d=h*h+l*l+u*u;d>0&&(d=1/Math.sqrt(d),h*=d,l*=d,u*=d);let A=f*u-c*l,m=c*h-a*u,p=a*l-f*h;return d=A*A+m*m+p*p,d>0&&(d=1/Math.sqrt(d),A*=d,m*=d,p*=d),e[0]=A,e[1]=m,e[2]=p,e[3]=0,e[4]=l*p-u*m,e[5]=u*A-h*p,e[6]=h*m-l*A,e[7]=0,e[8]=h,e[9]=l,e[10]=u,e[11]=0,e[12]=s,e[13]=o,e[14]=i,e[15]=1,e}function tm(e){return`mat4(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]}, ${e[4]}, ${e[5]}, ${e[6]}, ${e[7]}, ${e[8]}, ${e[9]}, ${e[10]}, ${e[11]}, ${e[12]}, ${e[13]}, ${e[14]}, ${e[15]})`}function em(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}function rm(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function gh(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function nm(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function sm(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function om(e,t){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]}function im(e,t){let r=e[0],n=e[1],s=e[2],o=e[3],i=e[4],a=e[5],f=e[6],c=e[7],h=e[8],l=e[9],u=e[10],d=e[11],A=e[12],m=e[13],p=e[14],E=e[15],y=t[0],C=t[1],M=t[2],T=t[3],I=t[4],w=t[5],L=t[6],x=t[7],g=t[8],B=t[9],_=t[10],U=t[11],G=t[12],P=t[13],v=t[14],at=t[15];return Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-C)<=1e-6*Math.max(1,Math.abs(n),Math.abs(C))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(o-T)<=1e-6*Math.max(1,Math.abs(o),Math.abs(T))&&Math.abs(i-I)<=1e-6*Math.max(1,Math.abs(i),Math.abs(I))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(f-L)<=1e-6*Math.max(1,Math.abs(f),Math.abs(L))&&Math.abs(c-x)<=1e-6*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(h-g)<=1e-6*Math.max(1,Math.abs(h),Math.abs(g))&&Math.abs(l-B)<=1e-6*Math.max(1,Math.abs(l),Math.abs(B))&&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-G)<=1e-6*Math.max(1,Math.abs(A),Math.abs(G))&&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-at)<=1e-6*Math.max(1,Math.abs(E),Math.abs(at))}var am=Rn,cm=gh;function fm(){let e=new W(4);return W!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function xh(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function Bh(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function Eh(e){let t=e[0],r=e[1],n=e[2],s=e[3];return Math.sqrt(t*t+r*r+n*n+s*s)}function _h(e){let t=e[0],r=e[1],n=e[2],s=e[3];return t*t+r*r+n*n+s*s}function yh(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r*r+n*n+s*s+o*o;return i>0&&(i=1/Math.sqrt(i)),e[0]=r*i,e[1]=n*i,e[2]=s*i,e[3]=o*i,e}function Th(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function Ch(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=t[3];return e[0]=s+n*(r[0]-s),e[1]=o+n*(r[1]-o),e[2]=i+n*(r[2]-i),e[3]=a+n*(r[3]-a),e}function Mh(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3];return e[0]=r[0]*n+r[4]*s+r[8]*o+r[12]*i,e[1]=r[1]*n+r[5]*s+r[9]*o+r[13]*i,e[2]=r[2]*n+r[6]*s+r[10]*o+r[14]*i,e[3]=r[3]*n+r[7]*s+r[11]*o+r[15]*i,e}function bh(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[0],a=r[1],f=r[2],c=r[3],h=c*n+a*o-f*s,l=c*s+f*n-i*o,u=c*o+i*s-a*n,d=-i*n-a*s-f*o;return e[0]=h*c+d*-i+l*-f-u*-a,e[1]=l*c+d*-a+u*-i-h*-f,e[2]=u*c+d*-f+h*-a-l*-i,e[3]=t[3],e}var nb=function(){let e=fm();return function(t,r,n,s,o,i){let a,f;for(r||(r=4),n||(n=0),s?f=Math.min(s*r+n,t.length):f=t.length,a=n;a<f;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],e[3]=t[a+3],o(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2],t[a+3]=e[3];return t}}();var zi;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(zi||(zi={}));var lm=45*Math.PI/180,um=1,ki=.1,Ji=500,dm=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Rt=class extends Or{static get IDENTITY(){return mm()}static get ZERO(){return Am()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return zi}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,s,o,i,a,f,c,h,l,u,d,A,m,p){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this[4]=o,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this[9]=h,this[10]=l,this[11]=u,this[12]=d,this[13]=A,this[14]=m,this[15]=p,this.check()}setRowMajor(t,r,n,s,o,i,a,f,c,h,l,u,d,A,m,p){return this[0]=t,this[1]=o,this[2]=c,this[3]=d,this[4]=r,this[5]=i,this[6]=h,this[7]=A,this[8]=n,this[9]=a,this[10]=l,this[11]=m,this[12]=s,this[13]=f,this[14]=u,this[15]=p,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(dm)}fromObject(t){return this.check()}fromQuaternion(t){return Ni(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:s,top:o,near:i=ki,far:a=Ji}=t;return a===1/0?pm(this,r,n,s,o,i):Gi(this,r,n,s,o,i,a),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:s=[0,1,0]}=t;return Hi(this,r,n,s),this.check()}ortho(t){let{left:r,right:n,bottom:s,top:o,near:i=ki,far:a=Ji}=t;return Pi(this,r,n,s,o,i,a),this.check()}orthographic(t){let{fovy:r=lm,aspect:n=um,focalDistance:s=1,near:o=ki,far:i=Ji}=t;wh(r);let a=r/2,f=s*Math.tan(a),c=f*n;return this.ortho({left:-c,right:c,bottom:-f,top:f,near:o,far:i})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:s=.1,far:o=500}=t;return wh(r),Ui(this,r,n,s,o),this.check()}determinant(){return Si(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-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),s=1/n[0],o=1/n[1],i=1/n[2];return t[0]=this[0]*s,t[1]=this[1]*o,t[2]=this[2]*i,t[3]=0,t[4]=this[4]*s,t[5]=this[5]*o,t[6]=this[6]*i,t[7]=0,t[8]=this[8]*s,t[9]=this[9]*o,t[10]=this[10]*i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),s=1/n[0],o=1/n[1],i=1/n[2];return t[0]=this[0]*s,t[1]=this[1]*o,t[2]=this[2]*i,t[3]=this[4]*s,t[4]=this[5]*o,t[5]=this[6]*i,t[6]=this[8]*s,t[7]=this[9]*o,t[8]=this[10]*i,t}transpose(){return wi(this,this),this.check()}invert(){return Ii(this,this),this.check()}multiplyLeft(t){return Rn(this,t,this),this.check()}multiplyRight(t){return Rn(this,this,t),this.check()}rotateX(t){return Li(this,this,t),this.check()}rotateY(t){return Oi(this,this,t),this.check()}rotateZ(t){return vi(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return Di(this,this,t,r),this.check()}scale(t){return Fi(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return Ri(this,this,t),this.check()}transform(t,r){return t.length===4?(r=Mh(r||[-0,-0,-0,-0],t,this),we(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,s;switch(n){case 2:s=Xf(r||[-0,-0],t,this);break;case 3:s=Ve(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return we(s,t.length),s}transformAsVector(t,r){let n;switch(t.length){case 2:n=Yf(r||[-0,-0],t,this);break;case 3:n=Ss(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return we(n,t.length),n}transformPoint(t,r){return this.transformAsPoint(t,r)}transformVector(t,r){return this.transformAsPoint(t,r)}transformDirection(t,r){return this.transformAsVector(t,r)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}},Gs,Us;function Am(){return Gs||(Gs=new Rt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Gs)),Gs}function mm(){return Us||(Us=new Rt,Object.freeze(Us)),Us}function wh(e){if(e>Math.PI*2)throw Error("expected radians")}function pm(e,t,r,n,s,o){let i=2*o/(r-t),a=2*o/(s-n),f=(r+t)/(r-t),c=(s+n)/(s-n),h=-1,l=-1,u=-2*o;return e[0]=i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=f,e[9]=c,e[10]=h,e[11]=l,e[12]=0,e[13]=0,e[14]=u,e[15]=0,e}function Ih(){let e=new W(4);return W!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Sh(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Qi(e,t,r){r=r*.5;let n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function Vi(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=r[0],f=r[1],c=r[2],h=r[3];return e[0]=n*h+i*a+s*c-o*f,e[1]=s*h+i*f+o*a-n*c,e[2]=o*h+i*c+n*f-s*a,e[3]=i*h-n*a-s*f-o*c,e}function Rh(e,t,r){r*=.5;let n=t[0],s=t[1],o=t[2],i=t[3],a=Math.sin(r),f=Math.cos(r);return e[0]=n*f+i*a,e[1]=s*f+o*a,e[2]=o*f-s*a,e[3]=i*f-n*a,e}function Fh(e,t,r){r*=.5;let n=t[0],s=t[1],o=t[2],i=t[3],a=Math.sin(r),f=Math.cos(r);return e[0]=n*f-o*a,e[1]=s*f+i*a,e[2]=o*f+n*a,e[3]=i*f-s*a,e}function Dh(e,t,r){r*=.5;let n=t[0],s=t[1],o=t[2],i=t[3],a=Math.sin(r),f=Math.cos(r);return e[0]=n*f+s*a,e[1]=s*f-n*a,e[2]=o*f+i*a,e[3]=i*f-o*a,e}function Lh(e,t){let r=t[0],n=t[1],s=t[2];return e[0]=r,e[1]=n,e[2]=s,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-s*s)),e}function Dn(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=t[3],f=r[0],c=r[1],h=r[2],l=r[3],u,d,A,m,p;return u=s*f+o*c+i*h+a*l,u<0&&(u=-u,f=-f,c=-c,h=-h,l=-l),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),e[0]=A*s+m*f,e[1]=A*o+m*c,e[2]=A*i+m*h,e[3]=A*a+m*l,e}function Oh(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r*r+n*n+s*s+o*o,a=i?1/i:0;return e[0]=-r*a,e[1]=-n*a,e[2]=-s*a,e[3]=o*a,e}function vh(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function ji(e,t){let r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[s*3+s]&&(s=2);let o=(s+1)%3,i=(s+2)%3;n=Math.sqrt(t[s*3+s]-t[o*3+o]-t[i*3+i]+1),e[s]=.5*n,n=.5/n,e[3]=(t[o*3+i]-t[i*3+o])*n,e[o]=(t[o*3+s]+t[s*3+o])*n,e[i]=(t[i*3+s]+t[s*3+i])*n}return e}var Nh=xh;var Gh=Bh,Uh=Th,Ph=Ch,Hh=Eh;var kh=_h;var Jh=yh;var zh=function(){let e=Fs(),t=Ds(1,0,0),r=Ds(0,1,0);return function(n,s,o){let i=wn(s,o);return i<-.999999?(Qe(e,t,s),yi(e)<1e-6&&Qe(e,r,s),gi(e,e),Qi(n,e,Math.PI),n):i>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Qe(e,s,o),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+i,Jh(n,n))}}(),gb=function(){let e=Ih(),t=Ih();return function(r,n,s,o,i,a){return Dn(e,n,i,a),Dn(t,s,o,a),Dn(r,e,t,2*a*(1-a)),r}}(),xb=function(){let e=oh();return function(t,r,n,s){return e[0]=n[0],e[3]=n[1],e[6]=n[2],e[1]=s[0],e[4]=s[1],e[7]=s[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],Jh(t,ji(t,e))}}();var gm=[0,0,0,1],Ie=class extends be{constructor(t=0,r=0,n=0,s=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,n,s)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,r,n,s){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return ji(this,t),this.check()}fromAxisRotation(t,r){return Qi(this,t,r),this.check()}identity(){return Sh(this),this.check()}setAxisAngle(t,r){return this.fromAxisRotation(t,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=z(t)}get y(){return this[1]}set y(t){this[1]=z(t)}get z(){return this[2]}set z(t){this[2]=z(t)}get w(){return this[3]}set w(t){this[3]=z(t)}len(){return Hh(this)}lengthSquared(){return kh(this)}dot(t){return Uh(this,t)}rotationTo(t,r){return zh(this,t,r),this.check()}add(t){return Nh(this,this,t),this.check()}calculateW(){return Lh(this,this),this.check()}conjugate(){return vh(this,this),this.check()}invert(){return Oh(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(Ph(this,t,r,n),this.check())}multiplyRight(t){return Vi(this,this,t),this.check()}multiplyLeft(t){return Vi(this,t,this),this.check()}normalize(){let t=this.len(),r=t>0?1/t:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,t===0&&(this[3]=1),this.check()}rotateX(t){return Rh(this,this,t),this.check()}rotateY(t){return Fh(this,this,t),this.check()}rotateZ(t){return Dh(this,this,t),this.check()}scale(t){return Gh(this,this,t),this.check()}slerp(t,r,n){let s,o,i;switch(arguments.length){case 1:({start:s=gm,target:o,ratio:i}=t);break;case 2:s=this,o=t,i=r;break;default:s=t,o=r,i=n}return Dn(this,s,o,i),this.check()}transformVector4(t,r=new Lr){return bh(r,t,this),we(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,r){return this.setAxisAngle(t,r)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}};var Ht={};ut(Ht,{EPSILON1:()=>xm,EPSILON10:()=>wm,EPSILON11:()=>Im,EPSILON12:()=>Sm,EPSILON13:()=>Rm,EPSILON14:()=>Fm,EPSILON15:()=>Dm,EPSILON16:()=>Lm,EPSILON17:()=>Om,EPSILON18:()=>vm,EPSILON19:()=>Nm,EPSILON2:()=>Bm,EPSILON20:()=>Gm,EPSILON3:()=>Em,EPSILON4:()=>_m,EPSILON5:()=>ym,EPSILON6:()=>Tm,EPSILON7:()=>Cm,EPSILON8:()=>Mm,EPSILON9:()=>bm,PI_OVER_FOUR:()=>Pm,PI_OVER_SIX:()=>Hm,PI_OVER_TWO:()=>Um,TWO_PI:()=>km});var xm=.1,Bm=.01,Em=.001,_m=1e-4,ym=1e-5,Tm=1e-6,Cm=1e-7,Mm=1e-8,bm=1e-9,wm=1e-10,Im=1e-11,Sm=1e-12,Rm=1e-13,Fm=1e-14,Dm=1e-15,Lm=1e-16,Om=1e-17,vm=1e-18,Nm=1e-19,Gm=1e-20,Um=Math.PI/2,Pm=Math.PI/4,Hm=Math.PI/6,km=Math.PI*2;var kt=class{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(t,r){this.json=t,this.buffer=r}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t,r=H.UNSIGNED_INT,n=1){let s=this.json[t];return s&&Number.isFinite(s.byteOffset)?this._getTypedArrayFromBinary(t,r,n,1,s.byteOffset):s}getPropertyArray(t,r,n){let s=this.json[t];return s&&Number.isFinite(s.byteOffset)?("componentType"in s&&(r=dt.fromName(s.componentType)),this._getTypedArrayFromBinary(t,r,n,this.featuresLength,s.byteOffset)):this._getTypedArrayFromArray(t,r,s)}getProperty(t,r,n,s,o){let i=this.json[t];if(!i)return i;let a=this.getPropertyArray(t,r,n);if(n===1)return a[s];for(let f=0;f<n;++f)o[f]=a[n*s+f];return o}_getTypedArrayFromBinary(t,r,n,s,o){let i=this._cachedTypedArrays,a=i[t];return a||(a=dt.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+o,s*n),i[t]=a),a}_getTypedArrayFromArray(t,r,n){let s=this._cachedTypedArrays,o=s[t];return o||(o=dt.createTypedArray(r,n),s[t]=o),o}};var Jm={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zm={SCALAR:(e,t)=>e[t],VEC2:(e,t)=>[e[2*t+0],e[2*t+1]],VEC3:(e,t)=>[e[3*t+0],e[3*t+1],e[3*t+2]],VEC4:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT2:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT3:(e,t)=>[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]],MAT4:(e,t)=>[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]},Qm={SCALAR:(e,t,r)=>{t[r]=e},VEC2:(e,t,r)=>{t[2*r+0]=e[0],t[2*r+1]=e[1]},VEC3:(e,t,r)=>{t[3*r+0]=e[0],t[3*r+1]=e[1],t[3*r+2]=e[2]},VEC4:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT2:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT3:(e,t,r)=>{t[9*r+0]=e[0],t[9*r+1]=e[1],t[9*r+2]=e[2],t[9*r+3]=e[3],t[9*r+4]=e[4],t[9*r+5]=e[5],t[9*r+6]=e[6],t[9*r+7]=e[7],t[9*r+8]=e[8],t[9*r+9]=e[9]},MAT4:(e,t,r)=>{t[16*r+0]=e[0],t[16*r+1]=e[1],t[16*r+2]=e[2],t[16*r+3]=e[3],t[16*r+4]=e[4],t[16*r+5]=e[5],t[16*r+6]=e[6],t[16*r+7]=e[7],t[16*r+8]=e[8],t[16*r+9]=e[9],t[16*r+10]=e[10],t[16*r+11]=e[11],t[16*r+12]=e[12],t[16*r+13]=e[13],t[16*r+14]=e[14],t[16*r+15]=e[15]}};function Qh(e,t,r,n){let{componentType:s}=e;J(e.componentType);let o=typeof s=="string"?dt.fromName(s):s,i=Jm[e.type],a=zm[e.type],f=Qm[e.type];return r+=e.byteOffset,{values:dt.createTypedArray(o,t,r,i*n),type:o,size:i,unpacker:a,packer:f}}var te=e=>e!==void 0;function Vh(e,t,r){if(!t)return null;let n=e.getExtension("3DTILES_batch_table_hierarchy"),s=t.HIERARCHY;return s&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=s,n=s),n?Vm(n,r):null}function Vm(e,t){let r,n,s,o=e.instancesLength,i=e.classes,a=e.classIds,f=e.parentCounts,c=e.parentIds,h=o;te(a.byteOffset)&&(a.componentType=defaultValue(a.componentType,GL.UNSIGNED_SHORT),a.type=AttributeType.SCALAR,s=getBinaryAccessor(a),a=s.createArrayBufferView(t.buffer,t.byteOffset+a.byteOffset,o));let l;if(te(f))for(te(f.byteOffset)&&(f.componentType=defaultValue(f.componentType,GL.UNSIGNED_SHORT),f.type=AttributeType.SCALAR,s=getBinaryAccessor(f),f=s.createArrayBufferView(t.buffer,t.byteOffset+f.byteOffset,o)),l=new Uint16Array(o),h=0,r=0;r<o;++r)l[r]=h,h+=f[r];te(c)&&te(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,s=getBinaryAccessor(c),c=s.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,h));let u=i.length;for(r=0;r<u;++r){let p=i[r].length,E=i[r].instances,y=getBinaryProperties(p,E,t);i[r].instances=combine(y,E)}let d=new Array(u).fill(0),A=new Uint16Array(o);for(r=0;r<o;++r)n=a[r],A[r]=d[n],++d[n];let m={classes:i,classIds:a,classIndexes:A,parentCounts:f,parentIndexes:l,parentIds:c};return Xm(m),m}function vr(e,t,r){if(!e)return;let n=e.parentCounts;return e.parentIds?r(e,t):n>0?jm(e,t,r):Km(e,t,r)}function jm(e,t,r){let n=e.classIds,s=e.parentCounts,o=e.parentIds,i=e.parentIndexes,a=n.length,f=scratchVisited;f.length=Math.max(f.length,a);let c=++marker,h=scratchStack;for(h.length=0,h.push(t);h.length>0;){if(t=h.pop(),f[t]===c)continue;f[t]=c;let l=r(e,t);if(te(l))return l;let u=s[t],d=i[t];for(let A=0;A<u;++A){let m=o[d+A];m!==t&&h.push(m)}}return null}function Km(e,t,r){let n=!0;for(;n;){let s=r(e,t);if(te(s))return s;let o=e.parentIds[t];n=o!==t,t=o}throw new Error("traverseHierarchySingleParent")}function Xm(e){let t=[],n=e.classIds.length;for(let s=0;s<n;++s)jh(e,s,stack)}function jh(e,t,r){let n=e.parentCounts,s=e.parentIds,o=e.parentIndexes,a=e.classIds.length;if(!te(s))return;assert(t<a,`Parent index ${t} exceeds the total number of instances: ${a}`),assert(r.indexOf(t)===-1,"Circular dependency detected in the batch table hierarchy."),r.push(t);let f=te(n)?n[t]:1,c=te(n)?o[t]:t;for(let h=0;h<f;++h){let l=s[c+h];l!==t&&jh(e,l,r)}r.pop(t)}function Tt(e){return e!=null}var Ps=(e,t)=>e,Ym={HIERARCHY:!0,extensions:!0,extras:!0},ue=class{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(t,r,n,s={}){J(n>=0),this.json=t||{},this.binary=r,this.featureCount=n,this._extensions=this.json?.extensions||{},this._properties={};for(let o in this.json)Ym[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),s["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Vh(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,r){if(this._checkBatchId(t),J(typeof r=="string",r),this._hierarchy){let n=vr(this._hierarchy,t,(s,o)=>{let i=s.classIds[o];return s.classes[i].name===r});return Tt(n)}return!1}isExactClass(t,r){return J(typeof r=="string",r),this.getExactClassName(t)===r}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){let r=this._hierarchy.classIds[t];return this._hierarchy.classes[r].name}}hasProperty(t,r){return this._checkBatchId(t),J(typeof r=="string",r),Tt(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=Tt(r)?r:[],r.length=0;let n=Object.keys(this._properties);return r.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(t,r),r}getProperty(t,r){if(this._checkBatchId(t),J(typeof r=="string",r),this._binaryProperties){let s=this._binaryProperties[r];if(Tt(s))return this._getBinaryProperty(s,t)}let n=this._properties[r];if(Tt(n))return Ps(n[t],!0);if(this._hierarchy){let s=this._getHierarchyProperty(t,r);if(Tt(s))return s}}setProperty(t,r,n){let s=this.featureCount;if(this._checkBatchId(t),J(typeof r=="string",r),this._binaryProperties){let i=this._binaryProperties[r];if(i){this._setBinaryProperty(i,t,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,t,r,n))return;let o=this._properties[r];Tt(o)||(this._properties[r]=new Array(s),o=this._properties[r]),o[t]=Ps(n,!0)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,r){return t.unpack(t.typedArray,r)}_setBinaryProperty(t,r,n){t.pack(n,t.typedArray,r)}_initializeBinaryProperties(){let t=null;for(let r in this._properties){let n=this._properties[r],s=this._initializeBinaryProperty(r,n);s&&(t=t||{},t[r]=s)}return t}_initializeBinaryProperty(t,r){if("byteOffset"in r){let n=r;J(this.binary,`Property ${t} requires a batch table binary.`),J(n.type,`Property ${t} requires a type.`);let s=Qh(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:s.values,componentCount:s.size,unpack:s.unpacker,pack:s.packer}}return null}_hasPropertyInHierarchy(t,r){if(!this._hierarchy)return!1;let n=vr(this._hierarchy,t,(s,o)=>{let i=s.classIds[o],a=s.classes[i].instances;return Tt(a[r])});return Tt(n)}_getPropertyNamesInHierarchy(t,r){vr(this._hierarchy,t,(n,s)=>{let o=n.classIds[s],i=n.classes[o].instances;for(let a in i)i.hasOwnProperty(a)&&r.indexOf(a)===-1&&r.push(a)})}_getHierarchyProperty(t,r){return vr(this._hierarchy,t,(n,s)=>{let o=n.classIds[s],i=n.classes[o],a=n.classIndexes[s],f=i.instances[r];return Tt(f)?Tt(f.typedArray)?this._getBinaryProperty(f,a):Ps(f[a],!0):null})}_setHierarchyProperty(t,r,n,s){let o=vr(this._hierarchy,r,(i,a)=>{let f=i.classIds[a],c=i.classes[f],h=i.classIndexes[a],l=c.instances[n];return Tt(l)?(J(a===r,`Inherited property "${n}" is read-only.`),Tt(l.typedArray)?this._setBinaryProperty(l,h,s):l[h]=Ps(s,!0),!0):!1});return Tt(o)}};function Se(e,t,r=0){let n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=4,e.version=n.getUint32(r,!0),r+=4,e.byteLength=n.getUint32(r,!0),r+=4,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var Nr=4,Kh="b3dm tile in legacy format.";function Gr(e,t,r){let n=new DataView(t),s;e.header=e.header||{};let o=n.getUint32(r,!0);r+=Nr;let i=n.getUint32(r,!0);r+=Nr;let a=n.getUint32(r,!0);r+=Nr;let f=n.getUint32(r,!0);return r+=Nr,a>=570425344?(r-=Nr*2,s=o,a=i,f=0,o=0,i=0,console.warn(Kh)):f>=570425344&&(r-=Nr,s=a,a=o,f=i,o=0,i=0,console.warn(Kh)),e.header.featureTableJsonByteLength=o,e.header.featureTableBinaryByteLength=i,e.header.batchTableJsonByteLength=a,e.header.batchTableBinaryByteLength=f,e.header.batchLength=s,r}function Ur(e,t,r,n){return r=Zm(e,t,r,n),r=qm(e,t,r,n),r}function Zm(e,t,r,n){let{featureTableJsonByteLength:s,featureTableBinaryByteLength:o,batchLength:i}=e.header||{};if(e.featureTableJson={BATCH_LENGTH:i||0},s&&s>0){let a=si(t,r,s);e.featureTableJson=JSON.parse(a)}return r+=s||0,e.featureTableBinary=new Uint8Array(t,r,o),r+=o||0,r}function qm(e,t,r,n){let{batchTableJsonByteLength:s,batchTableBinaryByteLength:o}=e.header||{};if(s&&s>0){let i=si(t,r,s);e.batchTableJson=JSON.parse(i),r+=s,o&&o>0&&(e.batchTableBinary=new Uint8Array(t,r,o),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=o)}return r}function Ki(e,t,r){if(!t&&(!e||!e.batchIds||!r))return null;let{batchIds:n,isRGB565:s,pointCount:o=0}=e;if(n&&r){let i=new Uint8ClampedArray(o*3);for(let a=0;a<o;a++){let f=n[a],h=r.getProperty(f,"dimensions").map(l=>l*255);i[a*3]=h[0],i[a*3+1]=h[1],i[a*3+2]=h[2]}return{type:H.UNSIGNED_BYTE,value:i,size:3,normalized:!0}}if(t&&s){let i=new Uint8ClampedArray(o*3);for(let a=0;a<o;a++){let f=ui(t[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 t&&t.length===o*3?{type:H.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:H.UNSIGNED_BYTE,value:t||new Uint8ClampedArray,size:4,normalized:!0}}var Xh=new b;function Yh(e,t){if(!t)return null;if(e.isOctEncoded16P){let r=new Float32Array((e.pointsLength||0)*3);for(let n=0;n<(e.pointsLength||0);n++)di(t[n*2],t[n*2+1],Xh),Xh.toArray(r,n*3);return{type:H.FLOAT,size:2,value:r}}return{type:H.FLOAT,size:2,value:t}}function Zh(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,Wm(e,t)):{type:H.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function Wm(e,t){let r=new b,n=new Float32Array(e.pointCount*3);for(let s=0;s<e.pointCount;s++)r.set(t[s*3],t[s*3+1],t[s*3+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,s*3);return n}async function qh(e,t,r,n,s){r=Se(e,t,r),r=Gr(e,t,r),r=Ur(e,t,r,n),$m(e);let{featureTable:o,batchTable:i}=tp(e);return await op(e,o,i,n,s),ep(e,o,n),rp(e,o,i),np(e,o),r}function $m(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function tp(e){let t=new kt(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",H.FLOAT,3);let n=sp(e,t);return{featureTable:t,batchTable:n}}function ep(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.positions){if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",H.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){let n=t.getPropertyArray("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=(1<<16)-1,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",H.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=Zh(e,n,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function rp(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.colors){let n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",H.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",H.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",H.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=Ki(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",H.UNSIGNED_BYTE,4))}function np(e,t){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.normals){let r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",H.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",H.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=Yh(e,r)}}function sp(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",H.UNSIGNED_SHORT,1),e.batchIds)){let n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");let{batchTableJson:s,batchTableBinary:o}=e;r=new ue(s,o,n)}return r}async function op(e,t,r,n,s){let o,i,a,f=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];f&&(a=f.properties);let c=t.getExtension("3DTILES_draco_point_compression");if(c){i=c.properties;let l=c.byteOffset,u=c.byteLength;if(!i||!Number.isFinite(l)||!u)throw new Error("Draco properties, byteOffset, and byteLength must be defined");o=(e.featureTableBinary||[]).slice(l,l+u),e.hasPositions=Number.isFinite(i.POSITION),e.hasColors=Number.isFinite(i.RGB)||Number.isFinite(i.RGBA),e.hasNormals=Number.isFinite(i.NORMAL),e.hasBatchIds=Number.isFinite(i.BATCH_ID),e.isTranslucent=Number.isFinite(i.RGBA)}if(!o)return!0;let h={buffer:o,properties:{...i,...a},featureTableProperties:i,batchTableProperties:a,dequantizeInShader:!1};return await ip(e,h,n,s)}async function ip(e,t,r,n){if(!n)return;let s={...r,draco:{...r?.draco,extraAttributes:t.batchTableProperties||{}}};delete s["3d-tiles"];let o=await Pt(t.buffer,Is,s,n),i=o.attributes.POSITION&&o.attributes.POSITION.value,a=o.attributes.COLOR_0&&o.attributes.COLOR_0.value,f=o.attributes.NORMAL&&o.attributes.NORMAL.value,c=o.attributes.BATCH_ID&&o.attributes.BATCH_ID.value,h=i&&o.attributes.POSITION.value.quantization,l=f&&o.attributes.NORMAL.value.quantization;if(h){let d=o.POSITION.data.quantization,A=d.range;e.quantizedVolumeScale=new b(A,A,A),e.quantizedVolumeOffset=new b(d.minValues),e.quantizedRange=(1<<d.quantizationBits)-1,e.isQuantizedDraco=!0}l&&(e.octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);let u={};if(t.batchTableProperties)for(let d of Object.keys(t.batchTableProperties))o.attributes[d]&&o.attributes[d].value&&(u[d.toLowerCase()]=o.attributes[d].value);e.attributes={positions:i,colors:Ki(e,a,void 0),normals:f,batchIds:c,...u}}var ea={};ut(ea,{decode:()=>Qp,name:()=>zp});var Wh="4.2.4";var ap=globalThis.loaders?.parseImageNode,Xi=typeof Image<"u",Yi=typeof ImageBitmap<"u",cp=Boolean(ap),Zi=Et?!0:cp;function $h(e){switch(e){case"auto":return Yi||Xi||Zi;case"imagebitmap":return Yi;case"image":return Xi;case"data":return Zi;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function tl(){if(Yi)return"imagebitmap";if(Xi)return"image";if(Zi)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function el(e){let t=fp(e);if(!t)throw new Error("Not an image");return t}function Ln(e){switch(el(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function fp(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var hp=/^data:image\/svg\+xml/,lp=/\.svg((\?|#).*)?$/;function Hs(e){return e&&(hp.test(e)||lp.test(e))}function rl(e,t){if(Hs(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return qi(e,t)}function qi(e,t){if(Hs(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function ks(e,t,r){let n=rl(e,r),s=self.URL||self.webkitURL,o=typeof n!="string"&&s.createObjectURL(n);try{return await up(o||n,t)}finally{o&&s.revokeObjectURL(o)}}async function up(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,s)=>{try{r.onload=()=>n(r),r.onerror=o=>{let i=o instanceof Error?o.message:"error";s(new Error(i))}}catch(o){s(o)}})}var dp={},nl=!0;async function sl(e,t,r){let n;Hs(r)?n=await ks(e,t,r):n=qi(e,r);let s=t&&t.imagebitmap;return await Ap(n,s)}async function Ap(e,t=null){if((mp(t)||!nl)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),nl=!1}return await createImageBitmap(e)}function mp(e){for(let t in e||dp)return!1;return!0}function ol(e){return!Bp(e,"ftyp",4)||!(e[8]&96)?null:pp(e)}function pp(e){switch(gp(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function gp(e,t,r){return String.fromCharCode(...e.slice(t,r))}function xp(e){return[...e].map(t=>t.charCodeAt(0))}function Bp(e,t,r=0){let n=xp(t);for(let s=0;s<n.length;++s)if(n[s]!==e[s+r])return!1;return!0}var ee=!1,On=!0;function Ke(e){let t=vn(e);return _p(t)||Cp(t)||yp(t)||Tp(t)||Ep(t)}function Ep(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=ol(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function _p(e){let t=vn(e);return t.byteLength>=24&&t.getUint32(0,ee)===2303741511?{mimeType:"image/png",width:t.getUint32(16,ee),height:t.getUint32(20,ee)}:null}function yp(e){let t=vn(e);return t.byteLength>=10&&t.getUint32(0,ee)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,On),height:t.getUint16(8,On)}:null}function Tp(e){let t=vn(e);return t.byteLength>=14&&t.getUint16(0,ee)===16973&&t.getUint32(2,On)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,On),height:t.getUint32(22,On)}:null}function Cp(e){let t=vn(e);if(!(t.byteLength>=3&&t.getUint16(0,ee)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=Mp(),o=2;for(;o+9<t.byteLength;){let i=t.getUint16(o,ee);if(s.has(i))return{mimeType:"image/jpeg",height:t.getUint16(o+5,ee),width:t.getUint16(o+7,ee)};if(!n.has(i))return null;o+=2,o+=t.getUint16(o,ee)}return null}function Mp(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function vn(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function il(e,t){let{mimeType:r}=Ke(e)||{},n=globalThis.loaders?.parseImageNode;return J(n),await n(e,r)}async function al(e,t,r){t=t||{};let s=(t.image||{}).type||"auto",{url:o}=r||{},i=bp(s),a;switch(i){case"imagebitmap":a=await sl(e,t,o);break;case"image":a=await ks(e,t,o);break;case"data":a=await il(e,t);break;default:J(!1)}return s==="data"&&(a=Ln(a)),a}function bp(e){switch(e){case"auto":case"data":return tl();default:return $h(e),e}}var wp=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],Ip=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],Sp={image:{type:"auto",decode:!0}},Wi={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:Wh,mimeTypes:Ip,extensions:wp,parse:al,tests:[e=>Boolean(Ke(new DataView(e)))],options:Sp};var $i={};function ta(e){if($i[e]===void 0){let t=Et?Fp(e):Rp(e);$i[e]=t}return $i[e]}function Rp(e){let t=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||t,n=globalThis.loaders?.parseImageNode;return Boolean(n)&&r.includes(e)}function Fp(e){switch(e){case"image/avif":case"image/webp":return Dp(e);default:return!0}}function Dp(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}function ot(e,t){if(!e)throw new Error(t||"assert failed: gltf")}var Js={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zs={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var Lp=1.33,cl=["SCALAR","VEC2","VEC3","VEC4"],Op=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],vp=new Map(Op),Np={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Gp={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Up={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Qs(e){return cl[e-1]||cl[0]}function Pr(e){let t=vp.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Hr(e,t){let r=Up[e.componentType],n=Np[e.type],s=Gp[e.componentType],o=e.count*n,i=e.count*n*s;ot(i>=0&&i<=t.byteLength);let a=zs[e.componentType],f=Js[e.type];return{ArrayType:r,length:o,byteLength:i,componentByteSize:a,numberOfComponentsInElement:f}}function Nn(e){let{images:t,bufferViews:r}=e;t=t||[],r=r||[];let n=t.map(i=>i.bufferView);r=r.filter(i=>!n.includes(i));let s=r.reduce((i,a)=>i+a.byteLength,0),o=t.reduce((i,a)=>{let{width:f,height:c}=a.image;return i+f*c},0);return s+Math.ceil(4*o*Lp)}function fl(e,t,r){let n=e.bufferViews[r];ot(n);let s=n.buffer,o=t[s];ot(o);let i=(n.byteOffset||0)+o.byteOffset;return new Uint8Array(o.arrayBuffer,i,n.byteLength)}function hl(e,t,r){let n=typeof r=="number"?e.accessors?.[r]:r;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(r)}`);let s=e.bufferViews?.[n.bufferView||0];if(!s)throw new Error(`No gltf buffer view for accessor ${s}`);let{arrayBuffer:o,byteOffset:i}=t[s.buffer],a=(i||0)+(n.byteOffset||0)+(s.byteOffset||0),{ArrayType:f,length:c,componentByteSize:h,numberOfComponentsInElement:l}=Hr(n,s),u=h*l,d=s.byteStride||u;if(typeof s.byteStride>"u"||s.byteStride===u)return new f(o,a,c);let A=new f(c);for(let m=0;m<n.count;m++){let p=new f(o,a+m*d,l);A.set(p,m*l)}return A}function Pp(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var K=class{gltf;sourceBuffers;byteLength;constructor(t){this.gltf={json:t?.json||Pp(),buffers:t?.buffers||[],images:t?.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(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}hasExtension(t){let r=this.getUsedExtensions().find(s=>s===t),n=this.getRequiredExtensions().find(s=>s===t);return typeof r=="string"||typeof n=="string"}getExtension(t){let r=this.getUsedExtensions().find(s=>s===t),n=this.json.extensions||{};return r?n[t]:null}getRequiredExtension(t){return this.getRequiredExtensions().find(n=>n===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(t,r){return(t.extensions||{})[r]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,r){if(typeof r=="object")return r;let n=this.json[t]&&this.json[t][r];if(!n)throw new Error(`glTF file error: Could not find ${t}[${r}]`);return n}getTypedArrayForBufferView(t){t=this.getBufferView(t);let r=t.buffer,n=this.gltf.buffers[r];ot(n);let s=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,s,t.byteLength)}getTypedArrayForAccessor(t){let r=this.getAccessor(t);return hl(this.gltf.json,this.gltf.buffers,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);let r=this.getBufferView(t.bufferView),s=this.getBuffer(r.buffer).data,o=r.byteOffset||0;return new Uint8Array(s,o,r.byteLength)}addApplicationData(t,r){return this.json[t]=r,this}addExtraData(t,r){return this.json.extras=this.json.extras||{},this.json.extras[t]=r,this}addObjectExtension(t,r,n){return t.extensions=t.extensions||{},t.extensions[r]=n,this.registerUsedExtension(r),this}setObjectExtension(t,r,n){let s=t.extensions||{};s[r]=n}removeObjectExtension(t,r){let n=t?.extensions||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let s=this.json.extensionsRemoved;s.includes(r)||s.push(r)}delete n[r]}addExtension(t,r={}){return ot(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return ot(r),this.addExtension(t,r),this.registerRequiredExtension(t),r}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===t)||this.json.extensionsRequired.push(t)}removeExtension(t){if(this.json.extensions?.[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let r=this.json.extensionsRemoved;r.includes(t)||r.push(t)}this.json.extensions&&delete this.json.extensions[t],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t)}setDefaultScene(t){this.json.scene=t}addScene(t){let{nodeIndices:r}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(t){let{meshIndex:r,matrix:n}=t;this.json.nodes=this.json.nodes||[];let s={mesh:r};return n&&(s.matrix=n),this.json.nodes.push(s),this.json.nodes.length-1}addMesh(t){let{attributes:r,indices:n,material:s,mode:o=4}=t,a={primitives:[{attributes:this._addAttributes(r),mode:o}]};if(n){let f=this._addIndices(n);a.primitives[0].indices=f}return Number.isFinite(s)&&(a.primitives[0].material=s),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(t){let n={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(t,r){let n=Ke(t),s=r||n?.mimeType,i={bufferView:this.addBufferView(t),mimeType:s};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}addBufferView(t,r=0,n=this.byteLength){let s=t.byteLength;ot(Number.isFinite(s)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let o={buffer:r,byteOffset:n,byteLength:s};return this.byteLength+=bt(s,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(o),this.json.bufferViews.length-1}addAccessor(t,r){let n={bufferView:t,type:Qs(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(t,r={size:3}){let n=this.addBufferView(t),s={min:r.min,max:r.max};(!s.min||!s.max)&&(s=this._getAccessorMinMax(t,r.size));let o={size:r.size,componentType:Pr(t),count:Math.round(t.length/r.size),min:s.min,max:s.max};return this.addAccessor(n,Object.assign(o,r))}addTexture(t){let{imageIndex:r}=t,n={source:r};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){this.gltf.buffers=[];let t=this.byteLength,r=new ArrayBuffer(t),n=new Uint8Array(r),s=0;for(let o of this.sourceBuffers||[])s=Ko(o,n,s);this.json?.buffers?.[0]?this.json.buffers[0].byteLength=t:this.json.buffers=[{byteLength:t}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(t,r){let n=!0;for(;n;){let s=t.indexOf(r);s>-1?t.splice(s,1):n=!1}}_addAttributes(t={}){let r={};for(let n in t){let s=t[n],o=this._getGltfAttributeName(n),i=this.addBinaryBuffer(s.value,s);r[o]=i}return r}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.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 t}}_getAccessorMinMax(t,r){let n={min:null,max:null};if(t.length<r)return n;n.min=[],n.max=[];let s=t.subarray(0,r);for(let o of s)n.min.push(o),n.max.push(o);for(let o=r;o<t.length;o+=r)for(let i=0;i<r;i++)n.min[0+i]=Math.min(n.min[0+i],t[o+i]),n.max[0+i]=Math.max(n.max[0+i],t[o+i]);return n}};function ll(e){return(e%1+1)%1}var ul={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},Hp={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},dl={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function Gn(e,t){return dl[t]*ul[e]}function kr(e,t,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let s=e.getTypedArrayForBufferView(t),o=Jr(s,"SCALAR",r,n+1);return o instanceof BigInt64Array||o instanceof BigUint64Array?null:o}function Jr(e,t,r,n=1){let s=ul[t],o=Hp[r],i=dl[r],a=n*s,f=a*i,c=e.buffer,h=e.byteOffset;return h%i!==0&&(c=new Uint8Array(c).slice(h,h+f).buffer,h=0),new o(c,h,a)}function zr(e,t,r){let n=`TEXCOORD_${t.texCoord||0}`,s=r.attributes[n],o=e.getTypedArrayForAccessor(s),i=e.gltf.json,a=t.index,f=i.textures?.[a]?.source;if(typeof f<"u"){let c=i.images?.[f]?.mimeType,h=e.gltf.images?.[f];if(h&&typeof h.width<"u"){let l=[];for(let u=0;u<o.length;u+=2){let d=kp(h,c,o,u,t.channels);l.push(d)}return l}}return[]}function Vs(e,t,r,n,s){if(!r?.length)return;let o=[];for(let h of r){let l=n.findIndex(u=>u===h);l===-1&&(l=n.push(h)-1),o.push(l)}let i=new Uint32Array(o),a=e.gltf.buffers.push({arrayBuffer:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength})-1,f=e.addBufferView(i,a,0),c=e.addAccessor(f,{size:1,componentType:Pr(i),count:i.length});s.attributes[t]=c}function kp(e,t,r,n,s=[0]){let o={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;t&&(t.indexOf("image/jpeg")!==-1||t.indexOf("image/png")!==-1)&&(f=4);let c=Jp(i,a,e,f),h=0;for(let l of s){let u=typeof l=="number"?Object.values(o)[l]:o[l],d=c+u.offset,A=Ln(e);if(A.data.length<=d)throw new Error(`${A.data.length} <= ${d}`);let m=A.data[d];h|=m<<u.shift}return h}function Jp(e,t,r,n=1){let s=r.width,o=ll(e)*(s-1),i=Math.round(o),a=r.height,f=ll(t)*(a-1),c=Math.round(f),h=r.components?r.components:n;return(c*s+i)*h}function js(e,t,r,n,s){let o=[];for(let i=0;i<t;i++){let a=r[i],f=r[i+1]-r[i];if(f+a>n)break;let c=a/s,h=f/s;o.push(e.slice(c,c+h))}return o}function Ks(e,t,r){let n=[];for(let s=0;s<t;s++){let o=s*r;n.push(e.slice(o,o+r))}return n}function Xs(e,t,r,n){if(r)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){let s=[],o=new TextDecoder("utf8"),i=0;for(let a=0;a<e;a++){let f=n[a+1]-n[a];if(f+i<=t.length){let c=t.subarray(i,f+i),h=o.decode(c);s.push(h),i+=f}}return s}return[]}var Al="EXT_mesh_features",zp=Al;async function Qp(e,t){let r=new K(e);Vp(r,t)}function Vp(e,t){let r=e.gltf.json;if(r.meshes)for(let n of r.meshes)for(let s of n.primitives)jp(e,s,t)}function jp(e,t,r){if(!r?.gltf?.loadBuffers)return;let s=t.extensions?.[Al]?.featureIds;if(s)for(let o of s){let i;if(typeof o.attribute<"u"){let a=`_FEATURE_ID_${o.attribute}`,f=t.attributes[a];i=e.getTypedArrayForAccessor(f)}else typeof o.texture<"u"&&r?.gltf?.loadImages?i=zr(e,o.texture,t):i=[];o.data=i}}var sa={};ut(sa,{decode:()=>Xp,name:()=>Kp});var ra="EXT_structural_metadata",Kp=ra;async function Xp(e,t){let r=new K(e);Yp(r,t)}function Yp(e,t){if(!t.gltf?.loadBuffers)return;let r=e.getExtension(ra);r&&(t.gltf?.loadImages&&Zp(e,r),qp(e,r))}function Zp(e,t){let r=t.propertyTextures,n=e.gltf.json;if(r&&n.meshes)for(let s of n.meshes)for(let o of s.primitives)$p(e,r,o,t)}function qp(e,t){let r=t.schema;if(!r)return;let n=r.classes,s=t.propertyTables;if(n&&s)for(let o in n){let i=Wp(s,o);i&&eg(e,r,i)}}function Wp(e,t){for(let r of e)if(r.class===t)return r;return null}function $p(e,t,r,n){if(!t)return;let o=r.extensions?.[ra]?.propertyTextures;if(o)for(let i of o){let a=t[i];tg(e,a,r,n)}}function tg(e,t,r,n){if(!t.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let s=t.class;for(let o in t.properties){let i=`${s}_${o}`,a=t.properties?.[o];if(!a)continue;a.data||(a.data=[]);let f=a.data,c=zr(e,a,r);c!==null&&(Vs(e,i,c,f,r),a.data=f,n.dataAttributeNames.push(i))}}function eg(e,t,r){let n=t.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let s=r.count;for(let o in n.properties){let i=n.properties[o],a=r.properties?.[o];if(a){let f=rg(e,t,i,s,a);a.data=f}}}function rg(e,t,r,n,s){let o=[],i=s.values,a=e.getTypedArrayForBufferView(i),f=ng(e,r,s,n),c=sg(e,s,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{o=og(r,n,a,f);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{o=Xs(n,a,f,c);break}case"ENUM":{o=ig(t,r,n,a,f);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return o}function ng(e,t,r,n){return t.array&&typeof t.count>"u"&&typeof r.arrayOffsets<"u"?kr(e,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function sg(e,t,r){return typeof t.stringOffsets<"u"?kr(e,t.stringOffsets,t.stringOffsetType||"UINT32",r):null}function og(e,t,r,n){let s=e.array,o=e.count,i=Gn(e.type,e.componentType),a=r.byteLength/i,f;return e.componentType?f=Jr(r,e.type,e.componentType,a):f=r,s?n?js(f,t,n,r.length,i):o?Ks(f,t,o):[]:f}function ig(e,t,r,n,s){let o=t.enumType;if(!o)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let i=e.enums?.[o];if(!i)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${o}`);let a=i.valueType||"UINT16",f=Gn(t.type,a),c=n.byteLength/f,h=Jr(n,t.type,a,c);if(h||(h=n),t.array){if(s)return ag({valuesData:h,numberOfElements:r,arrayOffsets:s,valuesDataBytesLength:n.length,elementSize:f,enumEntry:i});let l=t.count;return l?cg(h,r,l,i):[]}return na(h,0,r,i)}function ag(e){let{valuesData:t,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:s,elementSize:o,enumEntry:i}=e,a=[];for(let f=0;f<r;f++){let c=n[f],h=n[f+1]-n[f];if(h+c>s)break;let l=c/o,u=h/o,d=na(t,l,u,i);a.push(d)}return a}function cg(e,t,r,n){let s=[];for(let o=0;o<t;o++){let i=r*o,a=na(e,i,r,n);s.push(a)}return s}function na(e,t,r,n){let s=[];for(let o=0;o<r;o++)if(e instanceof BigInt64Array||e instanceof BigUint64Array)s.push("");else{let i=e[t+o],a=fg(n,i);a?s.push(a.name):s.push("")}return s}function fg(e,t){for(let r of e.values)if(r.value===t)return r;return null}var oa={};ut(oa,{decode:()=>lg,name:()=>hg});var ml="EXT_feature_metadata",hg=ml;async function lg(e,t){let r=new K(e);ug(r,t)}function ug(e,t){if(!t.gltf?.loadBuffers)return;let r=e.getExtension(ml);r&&(t.gltf?.loadImages&&dg(e,r),Ag(e,r))}function dg(e,t){let r=t.schema;if(!r)return;let n=r.classes,{featureTextures:s}=t;if(n&&s)for(let o in n){let i=n[o],a=pg(s,o);a&&xg(e,a,i)}}function Ag(e,t){let r=t.schema;if(!r)return;let n=r.classes,s=t.featureTables;if(n&&s)for(let o in n){let i=mg(s,o);i&&gg(e,r,i)}}function mg(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function pg(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function gg(e,t,r){if(!r.class)return;let n=t.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let s=r.count;for(let o in n.properties){let i=n.properties[o],a=r.properties?.[o];if(a){let f=Bg(e,t,i,s,a);a.data=f}}}function xg(e,t,r){let n=t.class;for(let s in r.properties){let o=t?.properties?.[s];if(o){let i=Cg(e,o,n);o.data=i}}}function Bg(e,t,r,n,s){let o=[],i=s.bufferView,a=e.getTypedArrayForBufferView(i),f=Eg(e,r,s,n),c=_g(e,r,s,n);return r.type==="STRING"||r.componentType==="STRING"?o=Xs(n,a,f,c):yg(r)&&(o=Tg(r,n,a,f)),o}function Eg(e,t,r,n){return t.type==="ARRAY"&&typeof t.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?kr(e,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function _g(e,t,r,n){return typeof r.stringOffsetBufferView<"u"?kr(e,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function yg(e){let t=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return t.includes(e.type)||typeof e.componentType<"u"&&t.includes(e.componentType)}function Tg(e,t,r,n){let s=e.type==="ARRAY",o=e.componentCount,i="SCALAR",a=e.componentType||e.type,f=Gn(i,a),c=r.byteLength/f,h=Jr(r,i,a,c);return s?n?js(h,t,n,r.length,f):o?Ks(h,t,o):[]:h}function Cg(e,t,r){let n=e.gltf.json;if(!n.meshes)return[];let s=[];for(let o of n.meshes)for(let i of o.primitives)Mg(e,r,t,s,i);return s}function Mg(e,t,r,n,s){let o={channels:r.channels,...r.texture},i=zr(e,o,s);i&&Vs(e,t,i,n,s)}var pl="4.2.4";var gl="4.2.4";var Ys={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},xl;async function aa(e){gn(e.modules);let t=Qo("basis");return t||(xl||=bg(e),await xl)}async function bg(e){let t=null,r=null;return[t,r]=await Promise.all([await qt(Ys.TRANSCODER,"textures",e),await qt(Ys.TRANSCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await wg(t,r)}function wg(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(s=>{let{BasisFile:o,initializeBasis:i}=s;i(),n({BasisFile:o})})})}var ia;async function ca(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(ia=ia||Ig(e),await ia)}async function Ig(e){let t=null,r=null;return[t,r]=await Promise.all([await qt(Ys.ENCODER,"textures",e),await qt(Ys.ENCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await Sg(t,r)}function Sg(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(s=>{let{BasisFile:o,KTX2File:i,initializeBasis:a,BasisEncoder:f}=s;a(),n({BasisFile:o,KTX2File:i,BasisEncoder:f})})})}var Xe={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 Rg=["","WEBKIT_","MOZ_"],Bl={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"},Zs=null;function El(e){if(!Zs){e=e||Fg()||void 0,Zs=new Set;for(let t of Rg)for(let r in Bl)if(e&&e.getExtension(`${t}${r}`)){let n=Bl[r];Zs.add(n)}}return Zs}function Fg(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var N3=new Uint8Array([0]);var _l,yl,Tl,Cl,Ml,bl,wl,Il;(function(e){e[e.NONE=0]="NONE",e[e.BASISLZ=1]="BASISLZ",e[e.ZSTD=2]="ZSTD",e[e.ZLIB=3]="ZLIB"})(_l||(_l={})),function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(yl||(yl={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(Tl||(Tl={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(Cl||(Cl={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(Ml||(Ml={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(bl||(bl={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(wl||(wl={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(Il||(Il={}));var It=[171,75,84,88,32,50,48,187,13,10,26,10];function Sl(e){let t=new Uint8Array(e);return!(t.byteLength<It.length||t[0]!==It[0]||t[1]!==It[1]||t[2]!==It[2]||t[3]!==It[3]||t[4]!==It[4]||t[5]!==It[5]||t[6]!==It[6]||t[7]!==It[7]||t[8]!==It[8]||t[9]!==It[9]||t[10]!==It[10]||t[11]!==It[11])}var Dg={etc1:{basisFormat:0,compressed:!0,format:Xe.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Xe.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Xe.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:Xe.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Xe.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Xe.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 ha(e,t){if(t.basis.containerFormat==="auto"){if(Sl(e)){let n=await ca(t);return Rl(n.KTX2File,e,t)}let{BasisFile:r}=await aa(t);return fa(r,e,t)}switch(t.basis.module){case"encoder":let r=await ca(t);switch(t.basis.containerFormat){case"ktx2":return Rl(r.KTX2File,e,t);case"basis":default:return fa(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:n}=await aa(t);return fa(n,e,t)}}function fa(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let s=n.getNumImages(),o=[];for(let i=0;i<s;i++){let a=n.getNumLevels(i),f=[];for(let c=0;c<a;c++)f.push(Lg(n,i,c,r));o.push(f)}return o}finally{n.close(),n.delete()}}function Lg(e,t,r,n){let s=e.getImageWidth(t,r),o=e.getImageHeight(t,r),i=e.getHasAlpha(),{compressed:a,format:f,basisFormat:c}=Fl(n,i),h=e.getImageTranscodedSizeInBytes(t,r,c),l=new Uint8Array(h);if(!e.transcodeImage(l,t,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:s,height:o,data:l,compressed:a,format:f,hasAlpha:i}}function Rl(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let s=n.getLevels(),o=[];for(let i=0;i<s;i++){o.push(Og(n,i,r));break}return[o]}finally{n.close(),n.delete()}}function Og(e,t,r){let{alphaFlag:n,height:s,width:o}=e.getImageLevelInfo(t,0,0),{compressed:i,format:a,basisFormat:f}=Fl(r,n),c=e.getImageTranscodedSizeInBytes(t,0,0,f),h=new Uint8Array(c);if(!e.transcodeImage(h,t,0,0,f,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:s,data:h,compressed:i,levelSize:c,hasAlpha:n,format:a}}function Fl(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=qs()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),Dg[r]}function qs(){let e=El();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}var Dl={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:gl,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"}}},la={...Dl,parse:ha};var Qr=!0,Ll=1735152710,Aa=12,Ws=8,vg=1313821514,Ng=5130562,Gg=0,Ug=0,Pg=1;function Hg(e,t=0){return`${String.fromCharCode(e.getUint8(t+0))}${String.fromCharCode(e.getUint8(t+1))}${String.fromCharCode(e.getUint8(t+2))}${String.fromCharCode(e.getUint8(t+3))}`}function Ol(e,t=0,r={}){let n=new DataView(e),{magic:s=Ll}=r,o=n.getUint32(t,!1);return o===s||o===Ll}function vl(e,t,r=0,n={}){let s=new DataView(t),o=Hg(s,r+0),i=s.getUint32(r+4,Qr),a=s.getUint32(r+8,Qr);switch(Object.assign(e,{header:{byteOffset:r,byteLength:a,hasBinChunk:!1},type:o,version:i,json:{},binChunks:[]}),r+=Aa,e.version){case 1:return kg(e,s,r);case 2:return Jg(e,s,r,n={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function kg(e,t,r){J(e.header.byteLength>Aa+Ws);let n=t.getUint32(r+0,Qr),s=t.getUint32(r+4,Qr);return r+=Ws,J(s===Gg),ua(e,t,r,n),r+=n,r+=da(e,t,r,e.header.byteLength),r}function Jg(e,t,r,n){return J(e.header.byteLength>Aa+Ws),zg(e,t,r,n),r+e.header.byteLength}function zg(e,t,r,n){for(;r+8<=e.header.byteLength;){let s=t.getUint32(r+0,Qr),o=t.getUint32(r+4,Qr);switch(r+=Ws,o){case vg:ua(e,t,r,s);break;case Ng:da(e,t,r,s);break;case Ug:n.strict||ua(e,t,r,s);break;case Pg:n.strict||da(e,t,r,s);break;default:break}r+=bt(s,4)}return r}function ua(e,t,r,n){let s=new Uint8Array(t.buffer,r,n),i=new TextDecoder("utf8").decode(s);return e.json=JSON.parse(i),bt(n,4)}function da(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),bt(n,4)}function ma(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;let n=t.baseUri||t.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${e}`);return n.substr(0,n.lastIndexOf("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]),Kg=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]),Xg={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Yg={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function Nl(e,t,r,n,s,o="NONE"){let i=await Zg();$g(i,i.exports[Yg[s]],e,t,r,n,i.exports[Xg[o||"NONE"]])}var pa;async function Zg(){return pa||(pa=qg()),pa}async function qg(){let e=Qg;WebAssembly.validate(jg)&&(e=Vg,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate(Wg(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function Wg(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n){let s=e.charCodeAt(n);t[n]=s>96?s-71:s>64?s-65:s>47?s+4:s>46?63:62}let r=0;for(let n=0;n<e.length;++n)t[r++]=t[n]<60?Kg[t[n]]:(t[n]-60)*64+t[++n];return t.buffer.slice(0,r)}function $g(e,t,r,n,s,o,i){let a=e.exports.sbrk,f=n+3&-4,c=a(f*s),h=a(o.length),l=new Uint8Array(e.exports.memory.buffer);l.set(o,h);let u=t(c,n,s,h,o.length);if(u===0&&i&&i(c,f,s),r.set(l.subarray(c,c+n*s)),a(c-a(0)),u!==0)throw new Error(`Malformed buffer data: ${u}`)}var $s="EXT_meshopt_compression",tx=$s;async function ex(e,t){let r=new K(e);if(!t?.gltf?.decompressMeshes||!t.gltf?.loadBuffers)return;let n=[];for(let s of e.json.bufferViews||[])n.push(rx(r,s));await Promise.all(n),r.removeExtension($s)}async function rx(e,t){let r=e.getObjectExtension(t,$s);if(r){let{byteOffset:n=0,byteLength:s=0,byteStride:o,count:i,mode:a,filter:f="NONE",buffer:c}=r,h=e.gltf.buffers[c],l=new Uint8Array(h.arrayBuffer,h.byteOffset+n,s),u=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);await Nl(u,i,o,l,a,f),e.removeObjectExtension(t,$s)}}var xa={};ut(xa,{name:()=>nx,preprocess:()=>sx});var Vr="EXT_texture_webp",nx=Vr;function sx(e,t){let r=new K(e);if(!ta("image/webp")){if(r.getRequiredExtensions().includes(Vr))throw new Error(`gltf: Required extension ${Vr} not supported by browser`);return}let{json:n}=r;for(let s of n.textures||[]){let o=r.getObjectExtension(s,Vr);o&&(s.source=o.source),r.removeObjectExtension(s,Vr)}r.removeExtension(Vr)}var Ba={};ut(Ba,{name:()=>ox,preprocess:()=>ix});var to="KHR_texture_basisu",ox=to;function ix(e,t){let r=new K(e),{json:n}=r;for(let s of n.textures||[]){let o=r.getObjectExtension(s,to);o&&(s.source=o.source,r.removeObjectExtension(s,to))}r.removeExtension(to)}var _a={};ut(_a,{decode:()=>lx,encode:()=>ux,name:()=>fx,preprocess:()=>hx});function Gl(e){let t={};for(let r in e){let n=e[r];if(r!=="indices"){let s=Ea(n);t[r]=s}}return t}function Ea(e){let{buffer:t,size:r,count:n}=ax(e);return{value:t,size:r,byteOffset:0,count:n,type:Qs(r),componentType:Pr(t)}}function ax(e){let t=e,r=1,n=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=cx(t,Float32Array)),n=t.length/r),{buffer:t,size:r,count:n}}function cx(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Re="KHR_draco_mesh_compression",fx=Re;function hx(e,t,r){let n=new K(e);for(let s of Ul(n))n.getObjectExtension(s,Re)}async function lx(e,t,r){if(!t?.gltf?.decompressMeshes)return;let n=new K(e),s=[];for(let o of Ul(n))n.getObjectExtension(o,Re)&&s.push(dx(n,o,t,r));await Promise.all(s),n.removeExtension(Re)}function ux(e,t={}){let r=new K(e);for(let n of r.json.meshes||[])Ax(n,t),r.addRequiredExtension(Re)}async function dx(e,t,r,n){let s=e.getObjectExtension(t,Re);if(!s)return;let o=e.getTypedArrayForBufferView(s.bufferView),i=Je(o.buffer,o.byteOffset),a={...r};delete a["3d-tiles"];let f=await Pt(i,Is,a,n),c=Gl(f.attributes);for(let[h,l]of Object.entries(c))if(h in t.attributes){let u=t.attributes[h],d=e.getAccessor(u);d?.min&&d?.max&&(l.min=d.min,l.max=d.max)}t.attributes=c,f.indices&&(t.indices=Ea(f.indices)),e.removeObjectExtension(t,Re),mx(t)}function Ax(e,t,r=4,n,s){if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let o=n.DracoWriter.encodeSync({attributes:e}),i=s?.parseSync?.({attributes:e}),a=n._addFauxAttributes(i.attributes),f=n.addBufferView(o);return{primitives:[{attributes:a,mode:r,extensions:{[Re]:{bufferView:f,attributes:a}}}]}}function mx(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*Ul(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var ya={};ut(ya,{decode:()=>Bx,name:()=>px});var ro="KHR_texture_transform",px=ro,eo=new fe,gx=new he,xx=new he;async function Bx(e,t){if(!new K(e).hasExtension(ro)||!t.gltf?.loadBuffers)return;let s=e.json.materials||[];for(let o=0;o<s.length;o++)Ex(o,e)}function Ex(e,t){let r=t.json.materials?.[e],n=[r?.pbrMetallicRoughness?.baseColorTexture,r?.emissiveTexture,r?.normalTexture,r?.occlusionTexture,r?.pbrMetallicRoughness?.metallicRoughnessTexture],s=[];for(let o of n)o&&o?.extensions?.[ro]&&_x(t,e,o,s)}function _x(e,t,r,n){let s=yx(r,n);if(!s)return;let o=e.json.meshes||[];for(let i of o)for(let a of i.primitives){let f=a.material;Number.isFinite(f)&&t===f&&Tx(e,a,s)}}function yx(e,t){let r=e.extensions?.[ro],{texCoord:n=0}=e,{texCoord:s=n}=r;if(!(t.findIndex(([i,a])=>i===n&&a===s)!==-1)){let i=bx(r);return n!==s&&(e.texCoord=s),t.push([n,s]),{originalTexCoord:n,texCoord:s,matrix:i}}return null}function Tx(e,t,r){let{originalTexCoord:n,texCoord:s,matrix:o}=r,i=t.attributes[`TEXCOORD_${n}`];if(Number.isFinite(i)){let a=e.json.accessors?.[i];if(a&&a.bufferView){let f=e.json.bufferViews?.[a.bufferView];if(f){let{arrayBuffer:c,byteOffset:h}=e.buffers[f.buffer],l=(h||0)+(a.byteOffset||0)+(f.byteOffset||0),{ArrayType:u,length:d}=Hr(a,f),A=zs[a.componentType],m=Js[a.type],p=f.byteStride||A*m,E=new Float32Array(d);for(let y=0;y<a.count;y++){let C=new u(c,l+y*p,2);eo.set(C[0],C[1],1),eo.transformByMatrix3(o),E.set([eo[0],eo[1]],y*m)}n===s?Cx(a,f,e.buffers,E):Mx(s,a,t,e,E)}}}}function Cx(e,t,r,n){e.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),t.buffer=r.length-1,t.byteLength=n.buffer.byteLength,t.byteOffset=0,delete t.byteStride}function Mx(e,t,r,n,s){n.buffers.push({arrayBuffer:s.buffer,byteOffset:0,byteLength:s.buffer.byteLength});let o=n.json.bufferViews;if(!o)return;o.push({buffer:n.buffers.length-1,byteLength:s.buffer.byteLength,byteOffset:0});let i=n.json.accessors;i&&(i.push({bufferView:o?.length-1,byteOffset:0,componentType:5126,count:t.count,type:"VEC2"}),r.attributes[`TEXCOORD_${e}`]=i.length-1)}function bx(e){let{offset:t=[0,0],rotation:r=0,scale:n=[1,1]}=e,s=new he().set(1,0,0,0,1,0,t[0],t[1],1),o=gx.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),i=xx.set(n[0],0,0,0,n[1],0,0,0,1);return s.multiplyRight(o).multiplyRight(i)}var Ta={};ut(Ta,{decode:()=>Ix,encode:()=>Sx,name:()=>wx});var Ye="KHR_lights_punctual",wx=Ye;async function Ix(e){let t=new K(e),{json:r}=t,n=t.getExtension(Ye);n&&(t.json.lights=n.lights,t.removeExtension(Ye));for(let s of r.nodes||[]){let o=t.getObjectExtension(s,Ye);o&&(s.light=o.light),t.removeObjectExtension(s,Ye)}}async function Sx(e){let t=new K(e),{json:r}=t;if(r.lights){let n=t.addExtension(Ye);ot(!n.lights),n.lights=r.lights,delete r.lights}if(t.json.lights){for(let n of t.json.lights){let s=n.node;t.addObjectExtension(s,Ye,n)}delete t.json.lights}}var Ca={};ut(Ca,{decode:()=>Fx,encode:()=>Dx,name:()=>Rx});var Un="KHR_materials_unlit",Rx=Un;async function Fx(e){let t=new K(e),{json:r}=t;for(let n of r.materials||[])n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),t.removeObjectExtension(n,Un);t.removeExtension(Un)}function Dx(e){let t=new K(e),{json:r}=t;if(t.materials)for(let n of r.materials||[])n.unlit&&(delete n.unlit,t.addObjectExtension(n,Un,{}),t.addExtension(Un))}var Ma={};ut(Ma,{decode:()=>Ox,encode:()=>vx,name:()=>Lx});var Pn="KHR_techniques_webgl",Lx=Pn;async function Ox(e){let t=new K(e),{json:r}=t,n=t.getExtension(Pn);if(n){let s=Nx(n,t);for(let o of r.materials||[]){let i=t.getObjectExtension(o,Pn);i&&(o.technique=Object.assign({},i,s[i.technique]),o.technique.values=Gx(o.technique,t)),t.removeObjectExtension(o,Pn)}t.removeExtension(Pn)}}async function vx(e,t){}function Nx(e,t){let{programs:r=[],shaders:n=[],techniques:s=[]}=e,o=new TextDecoder;return n.forEach(i=>{if(Number.isFinite(i.bufferView))i.code=o.decode(t.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]}),s.forEach(i=>{i.program=r[i.program]}),s}function Gx(e,t){let r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(n=>{e.uniforms[n].value&&!(n in r)&&(r[n]=e.uniforms[n].value)}),Object.keys(r).forEach(n=>{typeof r[n]=="object"&&r[n].index!==void 0&&(r[n].texture=t.getTexture(r[n].index))}),r}var Pl=[sa,ea,ga,xa,Ba,_a,Ta,Ca,Ma,ya,oa];function Hl(e,t={},r){let n=Pl.filter(s=>Jl(s.name,t));for(let s of n)s.preprocess?.(e,t,r)}async function kl(e,t={},r){let n=Pl.filter(s=>Jl(s.name,t));for(let s of n)await s.decode?.(e,t,r)}function Jl(e,t){let r=t?.gltf?.excludeExtensions||{};return!(e in r&&!r[e])}var ba="KHR_binary_glTF";function zl(e){let t=new K(e),{json:r}=t;for(let n of r.images||[]){let s=t.getObjectExtension(n,ba);s&&Object.assign(n,s),t.removeObjectExtension(n,ba)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(ba)}var Ql={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Px={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},wa=class{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(t,r){this.json=t.json;let n=t.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),zl(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(let r in Ql)this._convertTopLevelObjectToArray(t,r)}_convertTopLevelObjectToArray(t,r){let n=t[r];if(!(!n||Array.isArray(n))){t[r]=[];for(let s in n){let o=n[s];o.id=o.id||s;let i=t[r].length;t[r].push(o),this.idToIndexMap[r][s]=i}}}_convertObjectIdsToArrayIndices(t){for(let r in Ql)this._convertIdsToIndices(t,r);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(let r of t.textures)this._convertTextureIds(r);for(let r of t.meshes)this._convertMeshIds(r);for(let r of t.nodes)this._convertNodeIds(r);for(let r of t.scenes)this._convertSceneIds(r)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(let r of t.primitives){let{attributes:n,indices:s,material:o}=r;for(let i in n)n[i]=this._convertIdToIndex(n[i],"accessor");s&&(r.indices=this._convertIdToIndex(s,"accessor")),o&&(r.material=this._convertIdToIndex(o,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(r=>this._convertIdToIndex(r,"node"))),t.meshes&&(t.meshes=t.meshes.map(r=>this._convertIdToIndex(r,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(r=>this._convertIdToIndex(r,"node")))}_convertIdsToIndices(t,r){t[r]||(console.warn(`gltf v1: json doesn't contain attribute ${r}`),t[r]=[]);for(let n of t[r])for(let s in n){let o=n[s],i=this._convertIdToIndex(o,s);n[s]=i}}_convertIdToIndex(t,r){let n=Px[r];if(n in this.idToIndexMap){let s=this.idToIndexMap[n][t];if(!Number.isFinite(s))throw new Error(`gltf v1: failed to resolve ${r} with id ${t}`);return s}return t}_updateObjects(t){for(let r of this.json.buffers)delete r.type}_updateMaterial(t){for(let r of t.materials){r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};let n=r.values?.tex||r.values?.texture2d_0||r.values?.diffuseTex,s=t.textures.findIndex(o=>o.id===n);s!==-1&&(r.pbrMetallicRoughness.baseColorTexture={index:s})}}};function Vl(e,t={}){return new wa().normalize(e,t)}async function jl(e,t,r=0,n,s){return Hx(e,t,r,n),Vl(e,{normalize:n?.gltf?.normalize}),Hl(e,n,s),n?.gltf?.loadBuffers&&e.json.buffers&&await kx(e,n,s),n?.gltf?.loadImages&&await Jx(e,n,s),await kl(e,n,s),e}function Hx(e,t,r,n){if(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!Ol(t,r,n)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=jo(t);else if(t instanceof ArrayBuffer){let i={};r=vl(i,t,r,n.glb),ot(i.type==="glTF",`Invalid GLB magic string ${i.type}`),e._glb=i,e.json=i.json}else ot(!1,"GLTF: must be ArrayBuffer or string");let s=e.json.buffers||[];if(e.buffers=new Array(s.length).fill(null),e._glb&&e._glb.header.hasBinChunk){let{binChunks:i}=e._glb;e.buffers[0]={arrayBuffer:i[0].arrayBuffer,byteOffset:i[0].byteOffset,byteLength:i[0].byteLength}}let o=e.json.images||[];e.images=new Array(o.length).fill({})}async function kx(e,t,r){let n=e.json.buffers||[];for(let s=0;s<n.length;++s){let o=n[s];if(o.uri){let{fetch:i}=r;ot(i);let a=ma(o.uri,t),c=await(await r?.fetch?.(a))?.arrayBuffer?.();e.buffers[s]={arrayBuffer:c,byteOffset:0,byteLength:c.byteLength},delete o.uri}else e.buffers[s]===null&&(e.buffers[s]={arrayBuffer:new ArrayBuffer(o.byteLength),byteOffset:0,byteLength:o.byteLength})}}async function Jx(e,t,r){let n=zx(e),s=e.json.images||[],o=[];for(let i of n)o.push(Qx(e,s[i],i,t,r));return await Promise.all(o)}function zx(e){let t=new Set,r=e.json.textures||[];for(let n of r)n.source!==void 0&&t.add(n.source);return Array.from(t).sort()}async function Qx(e,t,r,n,s){let o;if(t.uri&&!t.hasOwnProperty("bufferView")){let a=ma(t.uri,n),{fetch:f}=s;o=await(await f(a)).arrayBuffer(),t.bufferView={data:o}}if(Number.isFinite(t.bufferView)){let a=fl(e.json,e.buffers,t.bufferView);o=Je(a.buffer,a.byteOffset,a.byteLength)}ot(o,"glTF image has no data");let i=await Pt(o,[Wi,la],{...n,mimeType:t.mimeType,basis:n.basis||{format:qs()}},s);i&&i[0]&&(i={compressed:!0,mipmaps:!1,width:i[0].width,height:i[0].height,data:i[0]}),e.images=e.images||[],e.images[r]=i}var Ze={dataType:null,batchType:null,name:"glTF",id:"gltf",module:"gltf",version:pl,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:Vx,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function Vx(e,t={},r){t={...Ze.options,...t},t.gltf={...Ze.options.gltf,...t.gltf};let{byteOffset:n=0}=t;return await jl({},e,n,t,r)}var jx={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Kx={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ft={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Xx={magFilter:Ft.TEXTURE_MAG_FILTER,minFilter:Ft.TEXTURE_MIN_FILTER,wrapS:Ft.TEXTURE_WRAP_S,wrapT:Ft.TEXTURE_WRAP_T},Yx={[Ft.TEXTURE_MAG_FILTER]:Ft.LINEAR,[Ft.TEXTURE_MIN_FILTER]:Ft.NEAREST_MIPMAP_LINEAR,[Ft.TEXTURE_WRAP_S]:Ft.REPEAT,[Ft.TEXTURE_WRAP_T]:Ft.REPEAT};function Zx(){return{id:"default-sampler",parameters:Yx}}function qx(e){return Kx[e]}function Wx(e){return jx[e]}var Ia=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(t,r={}){let{json:n,buffers:s=[],images:o=[]}=t,{baseUri:i=""}=t;return ot(n),this.baseUri=i,this.buffers=s,this.images=o,this.jsonUnprocessed=n,this.json=this._resolveTree(t.json,r),this.json}_resolveTree(t,r={}){let n={...t};return this.json=n,t.bufferViews&&(n.bufferViews=t.bufferViews.map((s,o)=>this._resolveBufferView(s,o))),t.images&&(n.images=t.images.map((s,o)=>this._resolveImage(s,o))),t.samplers&&(n.samplers=t.samplers.map((s,o)=>this._resolveSampler(s,o))),t.textures&&(n.textures=t.textures.map((s,o)=>this._resolveTexture(s,o))),t.accessors&&(n.accessors=t.accessors.map((s,o)=>this._resolveAccessor(s,o))),t.materials&&(n.materials=t.materials.map((s,o)=>this._resolveMaterial(s,o))),t.meshes&&(n.meshes=t.meshes.map((s,o)=>this._resolveMesh(s,o))),t.nodes&&(n.nodes=t.nodes.map((s,o)=>this._resolveNode(s,o)),n.nodes=n.nodes.map((s,o)=>this._resolveNodeChildren(s))),t.skins&&(n.skins=t.skins.map((s,o)=>this._resolveSkin(s,o))),t.scenes&&(n.scenes=t.scenes.map((s,o)=>this._resolveScene(s,o))),typeof this.json.scene=="number"&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(t){return this._get(this.json.scenes,t)}getNode(t){return this._get(this.json.nodes,t)}getSkin(t){return this._get(this.json.skins,t)}getMesh(t){return this._get(this.json.meshes,t)}getMaterial(t){return this._get(this.json.materials,t)}getAccessor(t){return this._get(this.json.accessors,t)}getCamera(t){return this._get(this.json.cameras,t)}getTexture(t){return this._get(this.json.textures,t)}getSampler(t){return this._get(this.json.samplers,t)}getImage(t){return this._get(this.json.images,t)}getBufferView(t){return this._get(this.json.bufferViews,t)}getBuffer(t){return this._get(this.json.buffers,t)}_get(t,r){if(typeof r=="object")return r;let n=t&&t[r];return n||console.warn(`glTF file error: Could not find ${t}[${r}]`),n}_resolveScene(t,r){return{...t,id:t.id||`scene-${r}`,nodes:(t.nodes||[]).map(n=>this.getNode(n))}}_resolveNode(t,r){let n={...t,id:t?.id||`node-${r}`};return t.mesh!==void 0&&(n.mesh=this.getMesh(t.mesh)),t.camera!==void 0&&(n.camera=this.getCamera(t.camera)),t.skin!==void 0&&(n.skin=this.getSkin(t.skin)),t.meshes!==void 0&&t.meshes.length&&(n.mesh=t.meshes.reduce((s,o)=>{let i=this.getMesh(o);return s.id=i.id,s.primitives=s.primitives.concat(i.primitives),s},{primitives:[]})),n}_resolveNodeChildren(t){return t.children&&(t.children=t.children.map(r=>this.getNode(r))),t}_resolveSkin(t,r){let n=typeof t.inverseBindMatrices=="number"?this.getAccessor(t.inverseBindMatrices):void 0;return{...t,id:t.id||`skin-${r}`,inverseBindMatrices:n}}_resolveMesh(t,r){let n={...t,id:t.id||`mesh-${r}`,primitives:[]};return t.primitives&&(n.primitives=t.primitives.map(s=>{let o={...s,attributes:{},indices:void 0,material:void 0},i=s.attributes;for(let a in i)o.attributes[a]=this.getAccessor(i[a]);return s.indices!==void 0&&(o.indices=this.getAccessor(s.indices)),s.material!==void 0&&(o.material=this.getMaterial(s.material)),o})),n}_resolveMaterial(t,r){let n={...t,id:t.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 s=n.pbrMetallicRoughness;s.baseColorTexture&&(s.baseColorTexture={...s.baseColorTexture},s.baseColorTexture.texture=this.getTexture(s.baseColorTexture.index)),s.metallicRoughnessTexture&&(s.metallicRoughnessTexture={...s.metallicRoughnessTexture},s.metallicRoughnessTexture.texture=this.getTexture(s.metallicRoughnessTexture.index))}return n}_resolveAccessor(t,r){let n=qx(t.componentType),s=Wx(t.type),o=n*s,i={...t,id:t.id||`accessor-${r}`,bytesPerComponent:n,components:s,bytesPerElement:o,value:void 0,bufferView:void 0,sparse:void 0};if(t.bufferView!==void 0&&(i.bufferView=this.getBufferView(t.bufferView)),i.bufferView){let a=i.bufferView.buffer,{ArrayType:f,byteLength:c}=Hr(i,i.bufferView),h=(i.bufferView.byteOffset||0)+(i.byteOffset||0)+a.byteOffset,l=a.arrayBuffer.slice(h,h+c);i.bufferView.byteStride&&(l=this._getValueFromInterleavedBuffer(a,h,i.bufferView.byteStride,i.bytesPerElement,i.count)),i.value=new f(l)}return i}_getValueFromInterleavedBuffer(t,r,n,s,o){let i=new Uint8Array(o*s);for(let a=0;a<o;a++){let f=r+a*n;i.set(new Uint8Array(t.arrayBuffer.slice(f,f+s)),a*s)}return i.buffer}_resolveTexture(t,r){return{...t,id:t.id||`texture-${r}`,sampler:typeof t.sampler=="number"?this.getSampler(t.sampler):Zx(),source:typeof t.source=="number"?this.getImage(t.source):void 0}}_resolveSampler(t,r){let n={id:t.id||`sampler-${r}`,...t,parameters:{}};for(let s in n){let o=this._enumSamplerParameter(s);o!==void 0&&(n.parameters[o]=n[s])}return n}_enumSamplerParameter(t){return Xx[t]}_resolveImage(t,r){let n={...t,id:t.id||`image-${r}`,image:null,bufferView:t.bufferView!==void 0?this.getBufferView(t.bufferView):void 0},s=this.images[r];return s&&(n.image=s),n}_resolveBufferView(t,r){let n=t.buffer,s=this.buffers[n].arrayBuffer,o=this.buffers[n].byteOffset||0;return t.byteOffset&&(o+=t.byteOffset),{id:`bufferView-${r}`,...t,buffer:this.buffers[n],data:new Uint8Array(s,o,t.byteLength)}}_resolveCamera(t,r){let n={...t,id:t.id||`camera-${r}`};return n.perspective,n.orthographic,n}};function Hn(e,t){return new Ia().postProcess(e,t)}var no={URI:0,EMBEDDED:1};function so(e,t,r,n){e.rotateYtoZ=!0;let s=(e.byteOffset||0)+(e.byteLength||0)-r;if(s===0)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n?.["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=Je(t,r,s),e.gltfByteOffset=0,e.gltfByteLength=s,r%4===0||console.warn(`${e.type}: embedded glb is not aligned to a 4-byte boundary.`),(e.byteOffset||0)+(e.byteLength||0)}async function oo(e,t,r,n){let s=r?.["3d-tiles"]||{};if($x(e,t,r),s.loadGLTF){if(!n)return;if(e.gltfUrl){let{fetch:o}=n,i=await o(e.gltfUrl,r);e.gltfArrayBuffer=await i.arrayBuffer(),e.gltfByteOffset=0}if(e.gltfArrayBuffer){let o=await Pt(e.gltfArrayBuffer,Ze,r,n);e.gltf=Hn(o),e.gpuMemoryUsageInBytes=Nn(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength}}}function $x(e,t,r){switch(t){case no.URI:if(e.gltfArrayBuffer){let n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),o=new TextDecoder().decode(n);e.gltfUrl=o.replace(/[\s\0]+$/,"")}delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case no.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function Kl(e,t,r,n,s){r=tB(e,t,r,n,s),await oo(e,no.EMBEDDED,n,s);let o=e?.gltf?.extensions;return o&&o.CESIUM_RTC&&(e.rtcCenter=o.CESIUM_RTC.center),r}function tB(e,t,r,n,s){r=Se(e,t,r),r=Gr(e,t,r),r=Ur(e,t,r,n),r=so(e,t,r,n);let o=new kt(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=o.getGlobalProperty("RTC_CENTER",H.FLOAT,3),r}var de=6356752314245179e-9,eB={radii:[6378137,6378137,de],radiiSquared:[6378137*6378137,6378137*6378137,de*de],oneOverRadii:[1/6378137,1/6378137,1/de],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(de*de)],maximumRadius:Math.max(6378137,6378137,de),centerToleranceSquared:.1};function io(e){return e}var rS=new b;function rB(e,t=[],r=io){return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function Xl(e,t=[]){return rB(e,t,q._cartographicRadians?io:mi)}function nB(e,t,r=io){return"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):"x"in t?(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function Yl(e,t){return nB(e,t,q._cartographicRadians?io:pi)}var Zl=1e-14,sB=new b,ql={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"}},Sa={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},kn={east:new b,north:new b,up:new b,west:new b,south:new b,down:new b},oB=new b,iB=new b,aB=new b;function Ra(e,t,r,n,s,o){let i=ql[t]&&ql[t][r];ft(i&&(!n||n===i));let a,f,c,h=sB.copy(s);if(wt(h.x,0,Zl)&&wt(h.y,0,Zl)){let u=Math.sign(h.z);a=oB.fromArray(Sa[t]),t!=="east"&&t!=="west"&&a.scale(u),f=iB.fromArray(Sa[r]),r!=="east"&&r!=="west"&&f.scale(u),c=aB.fromArray(Sa[n]),n!=="east"&&n!=="west"&&c.scale(u)}else{let{up:u,east:d,north:A}=kn;d.set(-h.y,h.x,0).normalize(),e.geodeticSurfaceNormal(h,u),A.copy(u).cross(d);let{down:m,west:p,south:E}=kn;m.copy(u).scale(-1),p.copy(d).scale(-1),E.copy(A).scale(-1),a=kn[t],f=kn[r],c=kn[n]}return o[0]=a.x,o[1]=a.y,o[2]=a.z,o[3]=0,o[4]=f.x,o[5]=f.y,o[6]=f.z,o[7]=0,o[8]=c.x,o[9]=c.y,o[10]=c.z,o[11]=0,o[12]=h.x,o[13]=h.y,o[14]=h.z,o[15]=1,o}var jr=new b,cB=new b,fB=new b;function Wl(e,t,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:s,centerToleranceSquared:o}=t;jr.from(e);let i=jr.x,a=jr.y,f=jr.z,c=n.x,h=n.y,l=n.z,u=i*i*c*c,d=a*a*h*h,A=f*f*l*l,m=u+d+A,p=Math.sqrt(1/m);if(!Number.isFinite(p))return;let E=cB;if(E.copy(e).scale(p),m<o)return E.to(r);let y=s.x,C=s.y,M=s.z,T=fB;T.set(E.x*y*2,E.y*C*2,E.z*M*2);let I=(1-p)*jr.len()/(.5*T.len()),w=0,L,x,g,B;do{I-=w,L=1/(1+I*y),x=1/(1+I*C),g=1/(1+I*M);let _=L*L,U=x*x,G=g*g,P=_*L,v=U*x,at=G*g;B=u*_+d*U+A*G-1;let X=-2*(u*P*y+d*v*C+A*at*M);w=B/X}while(Math.abs(B)>Ht.EPSILON12);return jr.scale([L,x,g]).to(r)}var ao=new b,$l=new b,uB=new b,Jt=new b,dB=new b,co=new b,Ae=class{constructor(t=0,r=0,n=0){this.centerToleranceSquared=Ht.EPSILON1,ft(t>=0),ft(r>=0),ft(n>=0),this.radii=new b(t,r,n),this.radiiSquared=new b(t*t,r*r,n*n),this.radiiToTheFourth=new b(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new b(t===0?0:1/t,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new b(t===0?0:1/(t*t),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,r=[0,0,0]){let n=$l,s=uB,[,,o]=t;this.geodeticSurfaceNormalCartographic(t,n),s.copy(this.radiiSquared).scale(n);let i=Math.sqrt(n.dot(s));return s.scale(1/i),n.scale(o),s.add(n),s.to(r)}cartesianToCartographic(t,r=[0,0,0]){co.from(t);let n=this.scaleToGeodeticSurface(co,Jt);if(!n)return;let s=this.geodeticSurfaceNormal(n,$l),o=dB;o.copy(co).subtract(n);let i=Math.atan2(s.y,s.x),a=Math.asin(s.z),f=Math.sign(je.dot(o,co))*je.length(o);return Yl([i,a,f],r)}eastNorthUpToFixedFrame(t,r=new Rt){return Ra(this,"east","north","up",t,r)}localFrameToFixedFrame(t,r,n,s,o=new Rt){return Ra(this,t,r,n,s,o)}geocentricSurfaceNormal(t,r=[0,0,0]){return ao.from(t).normalize().to(r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=Xl(t),s=n[0],o=n[1],i=Math.cos(o);return ao.set(i*Math.cos(s),i*Math.sin(s),Math.sin(o)).normalize(),ao.to(r)}geodeticSurfaceNormal(t,r=[0,0,0]){return ao.from(t).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(t,r){return Wl(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){Jt.from(t);let n=Jt.x,s=Jt.y,o=Jt.z,i=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*i.x+s*s*i.y+o*o*i.z);return Jt.multiplyScalar(a).to(r)}transformPositionToScaledSpace(t,r=[0,0,0]){return Jt.from(t).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(t,r=[0,0,0]){return Jt.from(t).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){ft(wt(this.radii.x,this.radii.y,Ht.EPSILON15)),ft(this.radii.z>0),Jt.from(t);let s=Jt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(s)>=this.radii.z-r))return Jt.set(0,0,s).to(n)}};Ae.WGS84=new Ae(6378137,6378137,de);async function tu(e,t,r,n,s){return r=AB(e,t,r,n,s),await oo(e,e.gltfFormat||0,n,s),r}function AB(e,t,r,n,s){if(r=Se(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=Gr(e,t,r);let o=new DataView(t);if(e.gltfFormat=o.getUint32(r,!0),r+=4,r=Ur(e,t,r,n),r=so(e,t,r,n),!e?.header?.featureTableJsonByteLength||e.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let i=new kt(e.featureTableJson,e.featureTableBinary),a=i.getGlobalProperty("INSTANCES_LENGTH");if(i.featuresLength=a,!Number.isFinite(a))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=i.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=i.getGlobalProperty("RTC_CENTER",H.FLOAT,3);let f=new ue(e.batchTableJson,e.batchTableBinary,a);return mB(e,i,f,a),r}function mB(e,t,r,n){let s=new Array(n),o=new b,i=new b,a=new b,f=new b,c=new Z,h=new Ie,l=new b,u={},d=new Rt,A=[],m=[],p=[],E=[];for(let y=0;y<n;y++){let C;if(t.hasProperty("POSITION"))C=t.getProperty("POSITION",H.FLOAT,3,y,o);else if(t.hasProperty("POSITION_QUANTIZED")){C=t.getProperty("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3,y,o);let g=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3);if(!g)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let B=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",H.FLOAT,3);if(!B)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let _=65535;for(let U=0;U<3;U++)C[U]=C[U]/_*B[U]+g[U]}if(!C)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(C),u.translation=o,e.normalUp=t.getProperty("NORMAL_UP",H.FLOAT,3,y,A),e.normalRight=t.getProperty("NORMAL_RIGHT",H.FLOAT,3,y,m);let M=!1;if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",H.UNSIGNED_SHORT,2,y,A),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",H.UNSIGNED_SHORT,2,y,m),e.octNormalUp)throw e.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");e.eastNorthUp?(Ae.WGS84.eastNorthUpToFixedFrame(o,d),d.getRotationMatrix3(c)):c.identity()}M&&(f.copy(i).cross(a).normalize(),c.setColumn(0,i),c.setColumn(1,a),c.setColumn(2,f)),h.fromMatrix3(c),u.rotation=h,l.set(1,1,1);let T=t.getProperty("SCALE",H.FLOAT,1,y,p);Number.isFinite(T)&&l.multiplyByScalar(T);let I=t.getProperty("SCALE_NON_UNIFORM",H.FLOAT,3,y,A);I&&l.scale(I),u.scale=l;let w=t.getProperty("BATCH_ID",H.UNSIGNED_SHORT,1,y,E);w===void 0&&(w=y);let L=new Rt().fromQuaternion(u.rotation);d.identity(),d.translate(u.translation),d.multiplyRight(L),d.scale(u.scale);let x=d.clone();s[y]={modelMatrix:x,batchId:w}}e.instances=s}async function eu(e,t,r,n,s,o){r=Se(e,t,r);let i=new DataView(t);for(e.tilesLength=i.getUint32(r,!0),r+=4,e.tiles=[];e.tiles.length<e.tilesLength&&(e.byteLength||0)-r>12;){let a={shape:"tile3d"};e.tiles.push(a),r=await o(t,r,n,s,a)}return r}async function ru(e,t,r,n){if(e.rotateYtoZ=!0,e.gltfUpAxis=r?.["3d-tiles"]?.assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",r?.["3d-tiles"]?.loadGLTF){if(!n)return t.byteLength;let s=await Pt(t,Ze,r,n);e.gltf=Hn(s),e.gpuMemoryUsageInBytes=Nn(e.gltf)}else e.gltfArrayBuffer=t;return t.byteLength}async function Fa(e,t=0,r,n,s={shape:"tile3d"}){switch(s.byteOffset=t,s.type=Rf(e,t),s.type){case _t.COMPOSITE:return await eu(s,e,t,r,n,Fa);case _t.BATCHED_3D_MODEL:return await Kl(s,e,t,r,n);case _t.GLTF:return await ru(s,e,r,n);case _t.INSTANCED_3D_MODEL:return await tu(s,e,t,r,n);case _t.POINT_CLOUD:return await qh(s,e,t,r,n);default:throw new Error(`3DTileLoader: unknown type ${s.type}`)}}async function Da(e,t,r){if(new Uint32Array(e.slice(0,4))[0]!==1952609651)throw new Error("Wrong subtree file magic number");if(new Uint32Array(e.slice(4,8))[0]!==1)throw new Error("Wrong subtree file verson, must be 1");let o=nu(e.slice(8,16)),i=new Uint8Array(e,24,o),f=new TextDecoder("utf8").decode(i),c=JSON.parse(f),h=nu(e.slice(16,24)),l=new ArrayBuffer(0);if(h&&(l=e.slice(24+o)),await fo(c,c.tileAvailability,l,r),Array.isArray(c.contentAvailability))for(let u of c.contentAvailability)await fo(c,u,l,r);else await fo(c,c.contentAvailability,l,r);return await fo(c,c.childSubtreeAvailability,l,r),c}async function fo(e,t,r,n){let s=Number.isFinite(t.bitstream)?t.bitstream:t.bufferView;if(typeof s!="number")return;let o=e.bufferViews[s],i=e.buffers[o.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}`,h=await(await n.fetch(f)).arrayBuffer();t.explicitBitstream=new Uint8Array(h,o.byteOffset,o.byteLength);return}let a=e.buffers.slice(0,o.buffer).reduce((f,c)=>f+c.byteLength,0);t.explicitBitstream=new Uint8Array(r.slice(a,a+i.byteLength),o.byteOffset,o.byteLength)}function nu(e){let t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+2**32*n}var Kr={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:Da,options:{}};var Hu=gr(pn(),1);var Nu=gr(pn(),1);function La(e){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 t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function zt(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||La()}var pB=globalThis.self||globalThis.window||globalThis.global,Xr=globalThis.window||globalThis.self||globalThis.global,gB=globalThis.document||{},qe=globalThis.process||{},xB=globalThis.console,KS=globalThis.navigator||{};var ho=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",ZS=zt();function BB(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var lo=class{constructor(t,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=BB(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function su(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function ou(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function uo(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,s=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let o=e.width*r,i=e.height*r,a=["font-size:1px;","padding:".concat(Math.floor(i/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(i,"px;"),"background:url(".concat(s,");"),"background-size:".concat(o,"px ").concat(i,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),a]}var Ao;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ao||(Ao={}));var EB=10;function iu(e){return typeof e!="string"?e:(e=e.toUpperCase(),Ao[e]||Ao.WHITE)}function au(e,t,r){if(!zt&&typeof e=="string"){if(t){let n=iu(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=iu(r);e="\x1B[".concat(n+EB,"m").concat(e,"\x1B[49m")}}return e}function cu(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),s=e;for(let o of n){let i=s[o];typeof i=="function"&&(t.find(a=>o===a)||(s[o]=i.bind(e)))}}function Yr(e,t){if(!e)throw new Error(t||"Assertion failed")}function We(){let e;if(zt()&&Xr.performance){var t,r;e=Xr===null||Xr===void 0||(t=Xr.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in qe){var n;let s=qe===null||qe===void 0||(n=qe.hrtime)===null||n===void 0?void 0:n.call(qe);e=s[0]*1e3+s[1]/1e6}else e=Date.now();return e}var Zr={debug:zt()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},_B={enabled:!0,level:0};function Dt(){}var fu={},hu={once:!0},Jn=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=ho,this._startTs=We(),this._deltaTs=We(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new lo("__probe-".concat(this.id,"__"),_B),this.timeStamp("".concat(this.id," started")),cu(this),Object.seal(this)}set level(t){this.setLevel(t)}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(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){Yr(t,r)}warn(t){return this._getLogFunction(0,t,Zr.warn,arguments,hu)}error(t){return this._getLogFunction(0,t,Zr.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,Zr.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,Zr.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,Zr.debug||Zr.info,arguments,hu)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||Dt,n&&[n],{tag:MB(r)}):Dt}image(t){let{logLevel:r,priority:n,image:s,message:o="",scale:i=1}=t;return this._shouldLog(r||n)?zt()?CB({image:s,message:o,scale:i}):TB({image:s,message:o,scale:i}):Dt}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||Dt)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},s=lu({logLevel:t,message:r,opts:n}),{collapsed:o}=n;return s.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(s)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||Dt)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=uu(t)}_getLogFunction(t,r,n,s,o){if(this._shouldLog(t)){o=lu({logLevel:t,message:r,args:s,opts:o}),n=n||o.method,Yr(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=We();let i=o.tag||o.message;if(o.once&&i)if(!fu[i])fu[i]=We();else return Dt;return r=yB(this.id,o.message,o),n.bind(console,r,...o.args)}return Dt}};Jn.VERSION=ho;function uu(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Yr(Number.isFinite(t)&&t>=0),t}function lu(e){let{logLevel:t,message:r}=e;e.logLevel=uu(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let s=typeof e.message;return Yr(s==="string"||s==="object"),Object.assign(e,{args:n},e.opts)}function yB(e,t,r){if(typeof t=="string"){let n=r.time?ou(su(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=au(t,r.color,r.background)}return t}function TB(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),Dt}function CB(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let o=new Image;return o.onload=()=>{let i=uo(o,r,n);console.log(...i)},o.src=t,Dt}let s=t.nodeName||"";if(s.toLowerCase()==="img")return console.log(...uo(t,r,n)),Dt;if(s.toLowerCase()==="canvas"){let o=new Image;return o.onload=()=>console.log(...uo(o,r,n)),o.src=t.toDataURL(),Dt}return Dt}function MB(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Oa=new Jn({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 Y(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}Y.prototype.__isLong__;Object.defineProperty(Y.prototype,"__isLong__",{value:!0});function At(e){return(e&&e.__isLong__)===!0}function du(e){var t=Math.clz32(e&-e);return e?31-t:t}Y.isLong=At;var Au={},mu={};function $e(e,t){var r,n,s;return t?(e>>>=0,(s=0<=e&&e<256)&&(n=mu[e],n)?n:(r=Q(e,0,!0),s&&(mu[e]=r),r)):(e|=0,(s=-128<=e&&e<128)&&(n=Au[e],n)?n:(r=Q(e,e<0?-1:0,!1),s&&(Au[e]=r),r))}Y.fromInt=$e;function Ot(e,t){if(isNaN(e))return t?me:Qt;if(t){if(e<0)return me;if(e>=Bu)return yu}else{if(e<=-gu)return Ct;if(e+1>=gu)return _u}return e<0?Ot(-e,t).neg():Q(e%Wr|0,e/Wr|0,t)}Y.fromNumber=Ot;function Q(e,t,r){return new Y(e,t,r)}Y.fromBits=Q;var mo=Math.pow;function Na(e,t,r){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(r=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?me:Qt;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return Na(e.substring(1),t,r).neg();for(var s=Ot(mo(r,8)),o=Qt,i=0;i<e.length;i+=8){var a=Math.min(8,e.length-i),f=parseInt(e.substring(i,i+a),r);if(a<8){var c=Ot(mo(r,a));o=o.mul(c).add(Ot(f))}else o=o.mul(s),o=o.add(Ot(f))}return o.unsigned=t,o}Y.fromString=Na;function Vt(e,t){return typeof e=="number"?Ot(e,t):typeof e=="string"?Na(e,t):Q(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}Y.fromValue=Vt;var pu=1<<16,bB=1<<24,Wr=pu*pu,Bu=Wr*Wr,gu=Bu/2,xu=$e(bB),Qt=$e(0);Y.ZERO=Qt;var me=$e(0,!0);Y.UZERO=me;var qr=$e(1);Y.ONE=qr;var Eu=$e(1,!0);Y.UONE=Eu;var va=$e(-1);Y.NEG_ONE=va;var _u=Q(-1,2147483647,!1);Y.MAX_VALUE=_u;var yu=Q(-1,-1,!0);Y.MAX_UNSIGNED_VALUE=yu;var Ct=Q(0,-2147483648,!1);Y.MIN_VALUE=Ct;var O=Y.prototype;O.toInt=function(){return this.unsigned?this.low>>>0:this.low};O.toNumber=function(){return this.unsigned?(this.high>>>0)*Wr+(this.low>>>0):this.high*Wr+(this.low>>>0)};O.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(Ct)){var r=Ot(t),n=this.div(r),s=n.mul(r).sub(this);return n.toString(t)+s.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var o=Ot(mo(t,6),this.unsigned),i=this,a="";;){var f=i.div(o),c=i.sub(f.mul(o)).toInt()>>>0,h=c.toString(t);if(i=f,i.isZero())return h+a;for(;h.length<6;)h="0"+h;a=""+h+a}};O.getHighBits=function(){return this.high};O.getHighBitsUnsigned=function(){return this.high>>>0};O.getLowBits=function(){return this.low};O.getLowBitsUnsigned=function(){return this.low>>>0};O.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Ct)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&!(t&1<<r);r--);return this.high!=0?r+33:r+1};O.isZero=function(){return this.high===0&&this.low===0};O.eqz=O.isZero;O.isNegative=function(){return!this.unsigned&&this.high<0};O.isPositive=function(){return this.unsigned||this.high>=0};O.isOdd=function(){return(this.low&1)===1};O.isEven=function(){return(this.low&1)===0};O.equals=function(t){return At(t)||(t=Vt(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};O.eq=O.equals;O.notEquals=function(t){return!this.eq(t)};O.neq=O.notEquals;O.ne=O.notEquals;O.lessThan=function(t){return this.comp(t)<0};O.lt=O.lessThan;O.lessThanOrEqual=function(t){return this.comp(t)<=0};O.lte=O.lessThanOrEqual;O.le=O.lessThanOrEqual;O.greaterThan=function(t){return this.comp(t)>0};O.gt=O.greaterThan;O.greaterThanOrEqual=function(t){return this.comp(t)>=0};O.gte=O.greaterThanOrEqual;O.ge=O.greaterThanOrEqual;O.compare=function(t){if(At(t)||(t=Vt(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};O.comp=O.compare;O.negate=function(){return!this.unsigned&&this.eq(Ct)?Ct:this.not().add(qr)};O.neg=O.negate;O.add=function(t){At(t)||(t=Vt(t));var r=this.high>>>16,n=this.high&65535,s=this.low>>>16,o=this.low&65535,i=t.high>>>16,a=t.high&65535,f=t.low>>>16,c=t.low&65535,h=0,l=0,u=0,d=0;return d+=o+c,u+=d>>>16,d&=65535,u+=s+f,l+=u>>>16,u&=65535,l+=n+a,h+=l>>>16,l&=65535,h+=r+i,h&=65535,Q(u<<16|d,h<<16|l,this.unsigned)};O.subtract=function(t){return At(t)||(t=Vt(t)),this.add(t.neg())};O.sub=O.subtract;O.multiply=function(t){if(this.isZero())return this;if(At(t)||(t=Vt(t)),Lt){var r=Lt.mul(this.low,this.high,t.low,t.high);return Q(r,Lt.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?me:Qt;if(this.eq(Ct))return t.isOdd()?Ct:Qt;if(t.eq(Ct))return this.isOdd()?Ct:Qt;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(xu)&&t.lt(xu))return Ot(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,s=this.high&65535,o=this.low>>>16,i=this.low&65535,a=t.high>>>16,f=t.high&65535,c=t.low>>>16,h=t.low&65535,l=0,u=0,d=0,A=0;return A+=i*h,d+=A>>>16,A&=65535,d+=o*h,u+=d>>>16,d&=65535,d+=i*c,u+=d>>>16,d&=65535,u+=s*h,l+=u>>>16,u&=65535,u+=o*c,l+=u>>>16,u&=65535,u+=i*f,l+=u>>>16,u&=65535,l+=n*h+s*c+o*f+i*a,l&=65535,Q(d<<16|A,l<<16|u,this.unsigned)};O.mul=O.multiply;O.divide=function(t){if(At(t)||(t=Vt(t)),t.isZero())throw Error("division by zero");if(Lt){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?Lt.div_u:Lt.div_s)(this.low,this.high,t.low,t.high);return Q(r,Lt.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?me:Qt;var n,s,o;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return me;if(t.gt(this.shru(1)))return Eu;o=me}else{if(this.eq(Ct)){if(t.eq(qr)||t.eq(va))return Ct;if(t.eq(Ct))return qr;var i=this.shr(1);return n=i.div(t).shl(1),n.eq(Qt)?t.isNegative()?qr:va:(s=this.sub(t.mul(n)),o=n.add(s.div(t)),o)}else if(t.eq(Ct))return this.unsigned?me:Qt;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=Qt}for(s=this;s.gte(t);){n=Math.max(1,Math.floor(s.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),f=a<=48?1:mo(2,a-48),c=Ot(n),h=c.mul(t);h.isNegative()||h.gt(s);)n-=f,c=Ot(n,this.unsigned),h=c.mul(t);c.isZero()&&(c=qr),o=o.add(c),s=s.sub(h)}return o};O.div=O.divide;O.modulo=function(t){if(At(t)||(t=Vt(t)),Lt){var r=(this.unsigned?Lt.rem_u:Lt.rem_s)(this.low,this.high,t.low,t.high);return Q(r,Lt.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};O.mod=O.modulo;O.rem=O.modulo;O.not=function(){return Q(~this.low,~this.high,this.unsigned)};O.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};O.clz=O.countLeadingZeros;O.countTrailingZeros=function(){return this.low?du(this.low):du(this.high)+32};O.ctz=O.countTrailingZeros;O.and=function(t){return At(t)||(t=Vt(t)),Q(this.low&t.low,this.high&t.high,this.unsigned)};O.or=function(t){return At(t)||(t=Vt(t)),Q(this.low|t.low,this.high|t.high,this.unsigned)};O.xor=function(t){return At(t)||(t=Vt(t)),Q(this.low^t.low,this.high^t.high,this.unsigned)};O.shiftLeft=function(t){return At(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Q(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Q(0,this.low<<t-32,this.unsigned)};O.shl=O.shiftLeft;O.shiftRight=function(t){return At(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Q(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Q(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};O.shr=O.shiftRight;O.shiftRightUnsigned=function(t){return At(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Q(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?Q(this.high,0,this.unsigned):Q(this.high>>>t-32,0,this.unsigned)};O.shru=O.shiftRightUnsigned;O.shr_u=O.shiftRightUnsigned;O.rotateLeft=function(t){var r;return At(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Q(this.high,this.low,this.unsigned):t<32?(r=32-t,Q(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,Q(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))};O.rotl=O.rotateLeft;O.rotateRight=function(t){var r;return At(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Q(this.high,this.low,this.unsigned):t<32?(r=32-t,Q(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,Q(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};O.rotr=O.rotateRight;O.toSigned=function(){return this.unsigned?Q(this.low,this.high,!1):this};O.toUnsigned=function(){return this.unsigned?this:Q(this.low,this.high,!0)};O.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};O.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};O.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};Y.fromBytes=function(t,r,n){return n?Y.fromBytesLE(t,r):Y.fromBytesBE(t,r)};Y.fromBytesLE=function(t,r){return new Y(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};Y.fromBytesBE=function(t,r){return new Y(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)};var $r=Y;var wB=16;function zn(e){e==="X"&&(e="");let t=e.padEnd(wB,"0");return $r.fromString(t,!0,16)}function Ga(e){if(e.isZero())return"X";let t=e.countTrailingZeros(),r=t%4;t=(t-r)/4;let n=t;t*=4;let o=e.shiftRightUnsigned(t).toString(16).replace(/0+$/,"");return Array(17-n-o.length).join("0")+o}function Ua(e,t){let r=IB(e).shiftRightUnsigned(2);return e.add($r.fromNumber(2*t+1-4).multiply(r))}function IB(e){return e.and(e.not().add(1))}var SB=3,RB=30,FB=2*RB+1,Tu=180/Math.PI;function Mu(e){if(e.length===0)throw new Error(`Invalid Hilbert quad key ${e}`);let t=e.split("/"),r=parseInt(t[0],10),n=t[1],s=n.length,o=0,i=[0,0];for(let a=s-1;a>=0;a--){o=s-a;let f=n[a],c=0,h=0;f==="1"?h=1:f==="2"?(c=1,h=1):f==="3"&&(c=1);let l=Math.pow(2,o-1);DB(l,i,c,h),i[0]+=l*c,i[1]+=l*h}if(r%2===1){let a=i[0];i[0]=i[1],i[1]=a}return{face:r,ij:i,level:o}}function bu(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<SB+FB;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),s=t.substring(3,r),o=s.length/2,i=$r.fromString(n,!0,2).toString(10),a="";if(o!==0)for(a=$r.fromString(s,!0,2).toString(4);a.length<o;)a="0"+a;return`${i}/${a}`}function Pa(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function Cu(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Ha(e){return[Cu(e[0]),Cu(e[1])]}function ka(e,[t,r]){switch(e){case 0:return[1,t,r];case 1:return[-t,1,r];case 2:return[-t,-r,1];case 3:return[-1,-r,-t];case 4:return[r,-1,-t];case 5:return[r,t,-1];default:throw new Error("Invalid face")}}function Ja([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*Tu,n*Tu]}function DB(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let s=t[0];t[0]=t[1],t[1]=s}}function wu(e){let t=Pa(e.ij,e.level,[.5,.5]),r=Ha(t),n=ka(e.face,r);return Ja(n)}var LB=100;function za(e){let{face:t,ij:r,level:n}=e,s=[[0,0],[0,1],[1,1],[1,0],[0,0]],o=Math.max(1,Math.ceil(LB*Math.pow(2,-n))),i=new Float64Array(4*o*2+2),a=0,f=0;for(let c=0;c<4;c++){let h=s[c].slice(0),l=s[c+1],u=(l[0]-h[0])/o,d=(l[1]-h[1])/o;for(let A=0;A<o;A++){h[0]+=u,h[1]+=d;let m=Pa(r,n,h),p=Ha(m),E=ka(t,p),y=Ja(E);Math.abs(y[1])>89.999&&(y[0]=f);let C=y[0]-f;y[0]+=C>180?-360:C<-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 tn(e){let t=OB(e);return Mu(t)}function OB(e){if(e.indexOf("/")>0)return e;let t=zn(e);return bu(t)}function Qa(e){let t=tn(e);return wu(t)}function Su(e){let t;if(e.face===2||e.face===5){let r=null,n=0;for(let s=0;s<4;s++){let o=`${e.face}/${s}`,i=tn(o),a=za(i);(typeof r>"u"||r===null)&&(r=new Float64Array(4*a.length)),r.set(a,n),n+=a.length}t=Iu(r)}else{let r=za(e);t=Iu(r)}return t}function Iu(e){if(e.length%2!==0)throw new Error("Invalid corners");let t=[],r=[];for(let n=0;n<e.length;n+=2)t.push(e[n]),r.push(e[n+1]);return t.sort((n,s)=>n-s),r.sort((n,s)=>n-s),{west:t[0],east:t[t.length-1],north:r[r.length-1],south:r[0]}}function Va(e,t){let r=t?.minimumHeight||0,n=t?.maximumHeight||0,s=tn(e),o=Su(s),i=o.west,a=o.south,f=o.east,c=o.north,h=[];return h.push(new b(i,c,r)),h.push(new b(f,c,r)),h.push(new b(f,a,r)),h.push(new b(i,a,r)),h.push(new b(i,c,n)),h.push(new b(f,c,n)),h.push(new b(f,a,n)),h.push(new b(i,a,n)),h}var ht={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var ZR=new b,qR=new b;var Qn=new b,Ru=new b,Fe=class{constructor(t=[0,0,0],r=0){this.radius=-0,this.center=new b,this.fromCenterRadius(t,r)}fromCenterRadius(t,r){return this.center.from(t),this.radius=r,this}fromCornerPoints(t,r){return r=Qn.from(r),this.center=new b().from(t).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new Fe(this.center,this.radius)}union(t){let r=this.center,n=this.radius,s=t.center,o=t.radius,i=Qn.copy(s).subtract(r),a=i.magnitude();if(n>=a+o)return this.clone();if(o>=a+n)return t.clone();let f=(n+a+o)*.5;return Ru.copy(i).scale((-n+f)/a).add(r),this.center.copy(Ru),this.radius=f,this}expand(t){let n=Qn.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=Fn.getScaling(Qn,t);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(t){let r=this.distanceTo(t);return r*r}distanceTo(t){let n=Qn.from(t).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(t){let r=this.center,n=this.radius,o=t.normal.dot(r)+t.distance;return o<-n?ht.OUTSIDE:o<n?ht.INTERSECTING:ht.INSIDE}};var vB=new b,NB=new b,po=new b,go=new b,xo=new b,GB=new b,UB=new b,pe={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},tr=class{constructor(t=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){this.center=new b().from(t),this.halfAxes=new Z(r)}get halfSize(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new b(t).len(),new b(r).len(),new b(n).len()]}get quaternion(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),s=new b(t).normalize(),o=new b(r).normalize(),i=new b(n).normalize();return new Ie().fromMatrix3(new Z([...s,...o,...i]))}fromCenterHalfSizeQuaternion(t,r,n){let s=new Ie(n),o=new Z().fromQuaternion(s);return o[0]=o[0]*r[0],o[1]=o[1]*r[0],o[2]=o[2]*r[0],o[3]=o[3]*r[1],o[4]=o[4]*r[1],o[5]=o[5]*r[1],o[6]=o[6]*r[2],o[7]=o[7]*r[2],o[8]=o[8]*r[2],this.center=new b().from(t),this.halfAxes=o,this}clone(){return new tr(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new Fe){let r=this.halfAxes,n=r.getColumn(0,po),s=r.getColumn(1,go),o=r.getColumn(2,xo),i=vB.copy(n).add(s).add(o);return t.center.copy(this.center),t.radius=i.magnitude(),t}intersectPlane(t){let r=this.center,n=t.normal,s=this.halfAxes,o=n.x,i=n.y,a=n.z,f=Math.abs(o*s[pe.COLUMN0ROW0]+i*s[pe.COLUMN0ROW1]+a*s[pe.COLUMN0ROW2])+Math.abs(o*s[pe.COLUMN1ROW0]+i*s[pe.COLUMN1ROW1]+a*s[pe.COLUMN1ROW2])+Math.abs(o*s[pe.COLUMN2ROW0]+i*s[pe.COLUMN2ROW1]+a*s[pe.COLUMN2ROW2]),c=n.dot(r)+t.distance;return c<=-f?ht.OUTSIDE:c>=f?ht.INSIDE:ht.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=NB.from(t).subtract(this.center),n=this.halfAxes,s=n.getColumn(0,po),o=n.getColumn(1,go),i=n.getColumn(2,xo),a=s.magnitude(),f=o.magnitude(),c=i.magnitude();s.normalize(),o.normalize(),i.normalize();let h=0,l;return l=Math.abs(r.dot(s))-a,l>0&&(h+=l*l),l=Math.abs(r.dot(o))-f,l>0&&(h+=l*l),l=Math.abs(r.dot(i))-c,l>0&&(h+=l*l),h}computePlaneDistances(t,r,n=[-0,-0]){let s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=this.center,a=this.halfAxes,f=a.getColumn(0,po),c=a.getColumn(1,go),h=a.getColumn(2,xo),l=GB.copy(f).add(c).add(h).add(i),u=UB.copy(l).subtract(t),d=r.dot(u);return s=Math.min(d,s),o=Math.max(d,o),l.copy(i).add(f).add(c).subtract(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),l.copy(i).add(f).subtract(c).add(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),l.copy(i).add(f).subtract(c).subtract(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),i.copy(l).subtract(f).add(c).add(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),i.copy(l).subtract(f).add(c).subtract(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),i.copy(l).subtract(f).subtract(c).add(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),i.copy(l).subtract(f).subtract(c).subtract(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),n[0]=s,n[1]=o,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,po);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,go);n.transformAsPoint(t);let s=this.halfAxes.getColumn(2,xo);return s.transformAsPoint(t),this.halfAxes=new Z([...r,...n,...s]),this}getTransform(){throw new Error("not implemented")}};var Fu=new b,Du=new b,ge=class{constructor(t=[0,0,1],r=0){this.normal=new b,this.distance=-0,this.fromNormalDistance(t,r)}fromNormalDistance(t,r){return ft(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=Fu.from(t),this.normal.from(r).normalize();let n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,r,n,s){return this.normal.set(t,r,n),ft(wt(this.normal.len(),1)),this.distance=s,this}clone(){return new ge(this.normal,this.distance)}equals(t){return wt(this.distance,t.distance)&&wt(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=Du.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,r)}projectPointOntoPlane(t,r=[0,0,0]){let n=Fu.from(t),s=this.getPointDistance(n),o=Du.copy(this.normal).scale(s);return n.subtract(o).to(r)}};var Lu=[new b([1,0,0]),new b([0,1,0]),new b([0,0,1])],Ou=new b,PB=new b,vt=class{constructor(t=[]){this.planes=t}fromBoundingSphere(t){this.planes.length=2*Lu.length;let r=t.center,n=t.radius,s=0;for(let o of Lu){let i=this.planes[s],a=this.planes[s+1];i||(i=this.planes[s]=new ge),a||(a=this.planes[s+1]=new ge);let f=Ou.copy(o).scale(-n).add(r);i.fromPointNormal(f,o);let c=Ou.copy(o).scale(n).add(r),h=PB.copy(o).negate();a.fromPointNormal(c,h),s+=2}return this}computeVisibility(t){let r=ht.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case ht.OUTSIDE:return ht.OUTSIDE;case ht.INTERSECTING:r=ht.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(ft(Number.isFinite(r),"parentPlaneMask is required."),r===vt.MASK_OUTSIDE||r===vt.MASK_INSIDE)return r;let n=vt.MASK_INSIDE,s=this.planes;for(let o=0;o<this.planes.length;++o){let i=o<31?1<<o:0;if(o<31&&!(r&i))continue;let a=s[o],f=t.intersectPlane(a);if(f===ht.OUTSIDE)return vt.MASK_OUTSIDE;f===ht.INTERSECTING&&(n|=i)}return n}};vt.MASK_OUTSIDE=4294967295;vt.MASK_INSIDE=0;vt.MASK_INDETERMINATE=2147483647;var mF=new b,pF=new b,gF=new b,xF=new b,BF=new b;var MF=new b,bF=new b,wF=new b,IF=new b,SF=new b,RF=new b,FF=new b,DF=new b,LF=new b,OF=new b,vF=new b,NF=new b;var re=new Z,kB=new Z,JB=new Z,Bo=new Z,vu=new Z;function Xa(e,t={}){let r=Ht.EPSILON20,n=10,s=0,o=0,i=kB,a=JB;i.identity(),a.copy(e);let f=r*zB(a);for(;o<n&&QB(a)>f;)VB(a,Bo),vu.copy(Bo).transpose(),a.multiplyRight(Bo),a.multiplyLeft(vu),i.multiplyRight(Bo),++s>2&&(++o,s=0);return t.unitary=i.toTarget(t.unitary),t.diagonal=a.toTarget(t.diagonal),t}function zB(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var ja=[1,0,0],Ka=[2,2,1];function QB(e){let t=0;for(let r=0;r<3;++r){let n=e[re.getElementIndex(Ka[r],ja[r])];t+=2*n*n}return Math.sqrt(t)}function VB(e,t){let r=Ht.EPSILON15,n=0,s=1;for(let c=0;c<3;++c){let h=Math.abs(e[re.getElementIndex(Ka[c],ja[c])]);h>n&&(s=c,n=h)}let o=ja[s],i=Ka[s],a=1,f=0;if(Math.abs(e[re.getElementIndex(i,o)])>r){let c=e[re.getElementIndex(i,i)],h=e[re.getElementIndex(o,o)],l=e[re.getElementIndex(i,o)],u=(c-h)/2/l,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 Z.IDENTITY.to(t),t[re.getElementIndex(o,o)]=t[re.getElementIndex(i,i)]=a,t[re.getElementIndex(i,o)]=f,t[re.getElementIndex(o,i)]=-f,t}var De=new b,KB=new b,XB=new b,YB=new b,ZB=new b,qB=new Z,WB={diagonal:new Z,unitary:new Z};function Ya(e,t=new tr){if(!e||e.length===0)return t.halfAxes=new Z([0,0,0,0,0,0,0,0,0]),t.center=new b,t;let r=e.length,n=new b(0,0,0);for(let x of e)n.add(x);let s=1/r;n.multiplyByScalar(s);let o=0,i=0,a=0,f=0,c=0,h=0;for(let x of e){let g=De.copy(x).subtract(n);o+=g.x*g.x,i+=g.x*g.y,a+=g.x*g.z,f+=g.y*g.y,c+=g.y*g.z,h+=g.z*g.z}o*=s,i*=s,a*=s,f*=s,c*=s,h*=s;let l=qB;l[0]=o,l[1]=i,l[2]=a,l[3]=i,l[4]=f,l[5]=c,l[6]=a,l[7]=c,l[8]=h;let{unitary:u}=Xa(l,WB),d=t.halfAxes.copy(u),A=d.getColumn(0,XB),m=d.getColumn(1,YB),p=d.getColumn(2,ZB),E=-Number.MAX_VALUE,y=-Number.MAX_VALUE,C=-Number.MAX_VALUE,M=Number.MAX_VALUE,T=Number.MAX_VALUE,I=Number.MAX_VALUE;for(let x of e)De.copy(x),E=Math.max(De.dot(A),E),y=Math.max(De.dot(m),y),C=Math.max(De.dot(p),C),M=Math.min(De.dot(A),M),T=Math.min(De.dot(m),T),I=Math.min(De.dot(p),I);A=A.multiplyByScalar(.5*(M+E)),m=m.multiplyByScalar(.5*(T+y)),p=p.multiplyByScalar(.5*(I+C)),t.center.copy(A).add(m).add(p);let w=KB.set(E-M,y-T,C-I).multiplyByScalar(.5),L=new Z([w[0],0,0,0,w[1],0,0,0,w[2]]);return t.halfAxes.multiplyRight(L),t}function Eo(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=Va(t,r),s=Qa(t),o=s[0],i=s[1],a=Ae.WGS84.cartographicToCartesian([o,i,r.maximumHeight]),f=new b(a[0],a[1],a[2]);n.push(f);let c=Ya(n);return[...c.center,...c.halfAxes]}var $B=4,t2=8,e2={QUADTREE:$B,OCTREE:t2};function r2(e,t,r){if(e?.box){let n=zn(e.s2VolumeInfo.token),s=Ua(n,t),o=Ga(s),i={...e.s2VolumeInfo};switch(i.token=o,r){case"OCTREE":let c=e.s2VolumeInfo,h=c.maximumHeight-c.minimumHeight,l=h/2,u=c.minimumHeight+h/2;c.minimumHeight=u-l,c.maximumHeight=u+l;break;default:break}return{box:Eo(i),s2VolumeInfo:i}}}async function qa(e){let{implicitOptions:t,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,s2VolumeBox:s,loaderOptions:o}=e,{subtree:i,level:a=0,globalData:f={level:0,mortonIndex:0,x:0,y:0,z:0}}=e,{subdivisionScheme:c,subtreeLevels:h,maximumLevel:l,contentUrlTemplate:u,subtreesUriTemplate:d,basePath:A}=t,m={children:[],lodMetricValue:0,contentUrl:""};if(!l)return Oa.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${u} won't be loaded...`),m;let p=a+f.level;if(p>l)return m;let E=e2[c],y=Math.log2(E),C=n&1,M=n>>1&1,T=n>>2&1,I=(E**a-1)/(E-1),w=er(r.mortonIndex,n,y),L=I+w,x=er(r.x,C,1),g=er(r.y,M,1),B=er(r.z,T,1),_=!1;a>=h&&(_=Za(i.childSubtreeAvailability,w));let U=er(f.x,x,a),G=er(f.y,g,a),P=er(f.z,B,a);if(_){let ke=`${A}/${d}`,us=_o(ke,p,U,G,P);i=await(0,Nu.load)(us,Kr,o),f={mortonIndex:w,x,y:g,z:B,level:a},w=0,L=0,x=0,g=0,B=0,a=0}if(!Za(i.tileAvailability,L))return m;Za(i.contentAvailability,L)&&(m.contentUrl=_o(u,p,U,G,P));let mt=a+1,X={mortonIndex:w,x,y:g,z:B};for(let ke=0;ke<E;ke++){let us=r2(s,ke,c),pr=await qa({subtree:i,implicitOptions:t,loaderOptions:o,parentData:X,childIndex:ke,level:mt,globalData:{...f},s2VolumeBox:us});if(pr.contentUrl||pr.children.length){let S=p+1,R=n2(pr,S,{childTileX:x,childTileY:g,childTileZ:B},t,s);m.children.push(R)}}return m}function Za(e,t){let r;return Array.isArray(e)?(r=e[0],e.length>1&&Oa.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=e,"constant"in r?Boolean(r.constant):r.explicitBitstream?i2(t,r.explicitBitstream):!1}function n2(e,t,r,n,s){let{basePath:o,refine:i,getRefine:a,lodMetricType:f,getTileType:c,rootLodMetricValue:h,rootBoundingVolume:l}=n,u=e.contentUrl&&e.contentUrl.replace(`${o}/`,""),d=h/2**t,A=s?.box?{box:s.box}:l,m=s2(t,A,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:u},id:e.contentUrl,refine:a(i),type:c(e),lodMetricType:f,lodMetricValue:d,geometricError:d,transform:e.transform,boundingVolume:m}}function s2(e,t,r){if(t.region){let{childTileX:n,childTileY:s,childTileZ:o}=r,[i,a,f,c,h,l]=t.region,u=2**e,d=(f-i)/u,A=(c-a)/u,m=(l-h)/u,[p,E]=[i+d*n,i+d*(n+1)],[y,C]=[a+A*s,a+A*(s+1)],[M,T]=[h+m*o,h+m*(o+1)];return{region:[p,y,E,C,M,T]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${JSON.stringify(t)}`)}function er(e,t,r){return(e<<r)+t}function _o(e,t,r,n,s){let o=o2({level:t,x:r,y:n,z:s});return e.replace(/{level}|{x}|{y}|{z}/gi,i=>o[i])}function o2(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function i2(e,t){let r=Math.floor(e/8),n=e%8;return(t[r]>>n&1)===1}function $a(e,t=""){if(!t)return Ce.EMPTY;let n=t.split("?")[0].split(".").pop();switch(n){case"pnts":return Ce.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return Ce.SCENEGRAPH;default:return n||Ce.EMPTY}}function tc(e){switch(e){case"REPLACE":case"replace":return Ir.REPLACE;case"ADD":case"add":return Ir.ADD;default:return e}}function Wa(e,t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){let n=new URL(e,`${t}/`);return decodeURI(n.toString())}else if(e.startsWith("/"))return e;return Tr.resolve(t,e)}function Gu(e,t){if(!e)return null;let r;if(e.content){let s=e.content.uri||e.content?.url;typeof s<"u"&&(r=Wa(s,t))}return{...e,id:r,contentUrl:r,lodMetricType:le.GEOMETRIC_ERROR,lodMetricValue:e.geometricError,transformMatrix:e.transform,type:$a(e,r),refine:tc(e.refine)}}async function ku(e,t,r){let n=null,s=Pu(e.root);s&&e.root?n=await Uu(e.root,e,t,s,r):n=Gu(e.root,t);let o=[];for(o.push(n);o.length>0;){let i=o.pop()||{},a=i.children||[],f=[];for(let c of a){let h=Pu(c),l;h?l=await Uu(c,e,t,h,r):l=Gu(c,t),l&&(f.push(l),o.push(l))}i.children=f}return n}async function Uu(e,t,r,n,s){let{subdivisionScheme:o,maximumLevel:i,availableLevels:a,subtreeLevels:f,subtrees:{uri:c}}=n,h=_o(c,0,0,0,0),l=Wa(h,r),u=await(0,Hu.load)(l,Kr,s),d=e.content?.uri,A=d?Wa(d,r):"",m=t?.root?.refine,p=e.geometricError,E=e.boundingVolume.extensions?.["3DTILES_bounding_volume_S2"];if(E){let T={box:Eo(E),s2VolumeInfo:E};e.boundingVolume=T}let y=e.boundingVolume,C={contentUrlTemplate:A,subtreesUriTemplate:c,subdivisionScheme:o,subtreeLevels:f,maximumLevel:Number.isFinite(a)?a-1:i,refine:m,basePath:r,lodMetricType:le.GEOMETRIC_ERROR,rootLodMetricValue:p,rootBoundingVolume:y,getTileType:$a,getRefine:tc};return await a2(e,r,u,C,s)}async function a2(e,t,r,n,s){if(!e)return null;let{children:o,contentUrl:i}=await qa({subtree:r,implicitOptions:n,loaderOptions:s}),a,f=null;return i&&(a=i,f={uri:i.replace(`${t}/`,"")}),{...e,id:a,contentUrl:a,lodMetricType:le.GEOMETRIC_ERROR,lodMetricValue:e.geometricError,transformMatrix:e.transform,type:$a(e,a),refine:tc(e.refine),content:f||e.content,children:o}}function Pu(e){return e?.extensions?.["3DTILES_implicit_tiling"]||e?.implicitTiling}var rr={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:c2,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function c2(e,t={},r){let n=t["3d-tiles"]||{},s;return n.isTileset==="auto"?s=r?.url&&r.url.indexOf(".json")!==-1:s=n.isTileset,s?f2(e,t,r):h2(e,t,r)}async function f2(e,t,r){let n=JSON.parse(new TextDecoder().decode(e)),s=r?.url||"",o=l2(s),i=await ku(n,o,t||{});return{...n,shape:"tileset3d",loader:rr,url:s,queryString:r?.queryString||"",basePath:o,root:i||n.root,type:Cn.TILES3D,lodMetricType:le.GEOMETRIC_ERROR,lodMetricValue:n.root?.geometricError||0}}async function h2(e,t,r){let n={content:{shape:"tile3d",featureIds:null}};return await Fa(e,0,t,r,n.content),n.content}function l2(e){return Tr.dirname(e)}var yo=gr(pn(),1);var Ju="https://api.cesium.com/v1/assets";async function To(e,t){if(!t){let o=await u2(e);for(let i of o.items)i.type==="3DTILES"&&(t=i.id)}let r=await d2(e,t),{type:n,url:s}=r;return J(n==="3DTILES"&&s),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function u2(e){J(e);let t=Ju,r={Authorization:`Bearer ${e}`},n=await(0,yo.fetchFile)(t,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function d2(e,t){J(e,t);let r={Authorization:`Bearer ${e}`},n=`${Ju}/${t}`,s=await(0,yo.fetchFile)(`${n}`,{headers:r});if(!s.ok)throw new Error(s.statusText);let o=await s.json();if(s=await(0,yo.fetchFile)(`${n}/endpoint`,{headers:r}),!s.ok)throw new Error(s.statusText);let i=await s.json();return o={...o,...i},o}async function A2(e,t={}){t=t["cesium-ion"]||{};let{accessToken:r}=t,n=t.assetId;if(!Number.isFinite(n)){let s=e.match(/\/([0-9]+)\/tileset.json/);n=s&&s[1]}return To(r,n)}var ec={...rr,id:"cesium-ion",name:"Cesium Ion",preload:A2,parse:async(e,t,r)=>(t={...t},t["3d-tiles"]=t["cesium-ion"],t.loader=ec,rr.parse(e,t,r)),options:{"cesium-ion":{...rr.options["3d-tiles"],accessToken:null}}};var Vn=async(e,t)=>{let r=[await e.getUint8(e.length-1n),await e.getUint8(e.length-2n),await e.getUint8(e.length-3n),void 0],n=0n;for(let s=e.length-4n;s>-1;s--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=await e.getUint8(s),r.every((o,i)=>o===t[i])){n=s;break}return n};var zu=new Uint8Array([80,75,5,6]),Qu=new Uint8Array([80,75,6,7]),Vu=new Uint8Array([80,75,6,6]),m2=8n;var p2=16n;var g2=8n,x2=24n;var B2=48n;var ju=async e=>{let t=await Vn(e,zu),r=BigInt(await e.getUint16(t+m2)),n=BigInt(await e.getUint32(t+p2)),s=t-20n,o=0n,i=await e.slice(s,s+4n);if(Te(i,Qu)){o=await e.getBigUint64(s+g2);let a=await e.slice(o,o+4n);if(!Te(a,Vu.buffer))throw new Error("zip64 EoCD not found");r=await e.getBigUint64(o+x2),n=await e.getBigUint64(o+B2)}else s=0n;return{cdRecordsNumber:r,cdStartOffset:n,offsets:{zip64EoCDOffset:o,zip64EoCDLocatorOffset:s,zipEoCDOffset:t}}};var GD=[{offset:0,size:4,default:new DataView(zu.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 UD=[{offset:0,size:4,default:new DataView(Qu.buffer).getUint32(0,!0)},{offset:4,size:4,default:0},{offset:8,size:8,name:"eoCDStart"},{offset:16,size:4,default:1}],PD=[{offset:0,size:4,default:new DataView(Vu.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 E2=20n,_2=24n,y2=28n,T2=30n,C2=32n,M2=42n,rc=46n,Kn=new Uint8Array([80,75,1,2]),jn=async(e,t)=>{let r=await t.slice(e,e+4n);if(!Te(r,Kn.buffer))return null;let n=BigInt(await t.getUint32(e+E2)),s=BigInt(await t.getUint32(e+_2)),o=await t.getUint16(e+T2),i=BigInt(await t.getUint16(e+C2)),a=await t.getUint16(e+y2),f=await t.slice(e+rc,e+rc+BigInt(a)),c=new TextDecoder().decode(f),h=e+rc+BigInt(a),l=await t.getUint32(e+M2),u=BigInt(l),d=new DataView(await t.slice(h,h+BigInt(o))),A={uncompressedSize:s,compressedSize:n,localHeaderOffset:u,startDisk:i},m=b2(A,d);return{...A,...m,extraFieldLength:o,fileNameLength:a,fileName:c,extraOffset:h}};async function*en(e){let{cdStartOffset:t}=await ju(e),r=await jn(t,e);for(;r;)yield r,r=await jn(r.extraOffset+BigInt(r.extraFieldLength),e)}var Ku=(...e)=>e[0]+e[1]*16,b2=(e,t)=>{let r=w2(e),n={};if(r.length>0){let s=r.reduce((a,f)=>a+f.length,0),o=new Uint8Array(t.buffer).findIndex((a,f,c)=>Ku(c[f],c[f+1])===1&&Ku(c[f+2],c[f+3])===s),i=0;for(let a of r){let f=i;n[a.name]=t.getBigUint64(o+4+f,!0),i=f+a.length}}return n},w2=e=>{let t=[];return e.uncompressedSize===BigInt(4294967295)&&t.push({name:"uncompressedSize",length:8}),e.compressedSize===BigInt(4294967295)&&t.push({name:"compressedSize",length:8}),e.localHeaderOffset===BigInt(4294967295)&&t.push({name:"localHeaderOffset",length:8}),e.startDisk===BigInt(4294967295)&&t.push({name:"startDisk",length:4}),t};var zD=[{offset:0,size:4,default:new DataView(Kn.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 I2=8n,S2=18n,R2=22n,F2=26n,D2=28n,Co=30n,nc=new Uint8Array([80,75,3,4]),nr=async(e,t)=>{let r=await t.slice(e,e+4n);if(!Te(r,nc))return null;let n=await t.getUint16(e+F2),s=new TextDecoder().decode(await t.slice(e+Co,e+Co+BigInt(n))).split("\\").join("/"),o=await t.getUint16(e+D2),i=e+Co+BigInt(n+o),a=await t.getUint16(e+I2),f=BigInt(await t.getUint32(e+S2)),c=BigInt(await t.getUint32(e+R2)),h=e+Co+BigInt(n),l=4n;return c===BigInt(4294967295)&&(c=await t.getBigUint64(h+l),l+=8n),f===BigInt(4294967295)&&(f=await t.getBigUint64(h+l),l+=8n),i===BigInt(4294967295)&&(i=await t.getBigUint64(h+l)),{fileNameLength:n,fileName:s,extraFieldLength:o,fileDataOffset:i,compressedSize:f,compressionMethod:a}};var jD=[{offset:0,size:4,default:new DataView(nc.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 Mo=class{constructor(t={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(t,r="base64"){let n=[];for await(let i of t)n.push(i),yield i;let s=await this.concatenate(n),o=await this.hash(s,r);this.options.crypto?.onEnd?.({hash:o})}async concatenate(t){return await Bn(t)}};function Xu(e){e=`${e}`;for(let r=0;r<e.length;r++)if(e.charCodeAt(r)>255)return null;let t="";for(let r=0;r<e.length;r+=3){let n=[void 0,void 0,void 0,void 0];n[0]=e.charCodeAt(r)>>2,n[1]=(e.charCodeAt(r)&3)<<4,e.length>r+1&&(n[1]|=e.charCodeAt(r+1)>>4,n[2]=(e.charCodeAt(r+1)&15)<<2),e.length>r+2&&(n[2]|=e.charCodeAt(r+2)>>6,n[3]=e.charCodeAt(r+2)&63);for(let s=0;s<n.length;s++)typeof n[s]>"u"?t+="=":t+=L2(n[s])}return t}function L2(e){if(e<26)return String.fromCharCode(e+"A".charCodeAt(0));if(e<52)return String.fromCharCode(e-26+"a".charCodeAt(0));if(e<62)return String.fromCharCode(e-52+"0".charCodeAt(0));if(e===62)return"+";if(e===63)return"/"}function Yu(e,t){switch(t){case"hex":return e;case"base64":return O2(e);default:throw new Error(t)}}function O2(e){e.length%2!==0&&(e=`0${e}`);let r=(e.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return Xu(r)||""}var qu=typeof atob=="function"?atob:typeof Buffer=="function"?k2:$u,v2=qu("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIx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vb3BEMxcGbG9vcEQ0GAhvbmVGdWxsQRkIb25lRnVsbEIaCG9uZUZ1bGxDGwhvbmVGdWxsRBwIdHdvRnVsbEEdCHR3b0Z1bGxCHgh0d29GdWxsQx8IdHdvRnVsbEQgCHRyZUZ1bGxBIQh0cmVGdWxsQiIIdHJlRnVsbEMjCHRyZUZ1bGxEJAhxdWFGdWxsQSUIcXVhRnVsbEImCHF1YUZ1bGxDJwhxdWFGdWxsRCgEZ2V0QSkEZ2V0QioEZ2V0QysEZ2V0RCwEZ2V0WC0Ec2V0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),sc=WebAssembly&&qu!==$u?H2(v2).buffer:!1,ne=J2(),oc=240*16*16,Wu=Math.floor(oc*16*1.066666667),N2=268435456-65536,Zu="Parameter must be Buffer, ArrayBuffer or Uint8Array",G2="Parameter exceeds max size of 255.9 Mbytes";sc||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function ic(e){var t,r,n,s,o,i,a,f,c,h;let l=P2(),u=U2(),d={},A=new Date().getTime();return d.then=function(y){return a=y,p(),d},d.catch=function(y){return f=y,d},e&&typeof e=="object"?typeof Buffer=="function"&&e.constructor===Buffer?i=e:e.constructor===Uint8Array||e.constructor===ArrayBuffer?i=e.constructor===ArrayBuffer?new Uint8Array(e):e:E(new TypeError(Zu)):E(new TypeError(Zu)),i&&(o=i.length,sc&&o>Wu?o>N2?E(new Error(G2)):(t=new WebAssembly.Memory({initial:o>32e6?o>64e6?o>128e6?4096:2048:1024:512}),r=new Uint32Array(t.buffer),s={mem:t,log:console.log},n={imports:s},WebAssembly.instantiate(sc,n).then(m)):p(l(i))),d;function m(y){p(u(i,y.instance.exports,r))}function p(y){var C=Boolean(y)?y:c;Boolean(y)&&(h=new Date().getTime()),typeof a=="function"?Boolean(C)&&(a(C,h-A),a=f=null):Boolean(y)&&(c=y)}function E(y){typeof f=="function"&&f(y)}}function U2(){var e,t,r,n,s,o,i,a,f,c,h,l,u,d=function(A){var m,p,E,y,C,M,T,I,w,L,x,g,B,_,U,G,P,v,at,mt,X,ke,us=new Date().getTime(),pr=0,S=1732584193,F=-271733879,R=-1732584194,D=271733878,tt=0,mn=A.length*8,ds;for(ds=Zd(A,u),u[mn>>>5]|=128<<mn%32,u[(mn+64>>>9<<4)+14]=mn,ds=(mn+64>>>9<<4)+15,X=u;tt<ds;)ds>tt+Wu?(n(S),o(F),a(R),c(D),t(oc),tt=tt+oc*16,S=r(),F=s(),R=i(),D=f(),pr++):(P=S,v=F,at=R,mt=D,m=X[tt+0]>>>0,p=X[tt+1]>>>0,E=X[tt+2]>>>0,y=X[tt+3]>>>0,C=X[tt+4]>>>0,M=X[tt+5]>>>0,T=X[tt+6]>>>0,I=X[tt+7]>>>0,w=X[tt+8]>>>0,L=X[tt+9]>>>0,x=X[tt+10]>>>0,g=X[tt+11]>>>0,B=X[tt+12]>>>0,_=X[tt+13]>>>0,U=X[tt+14]>>>0,G=X[tt+15]>>>0,S=N(7,25,S+(F&R|~F&D)+m-680876936)+F,D=N(12,20,D+(S&F|~S&R)+p-389564586)+S,R=N(17,15,R+(D&S|~D&F)+E+606105819)+D,F=N(22,10,F+(R&D|~R&S)+y-1044525330)+R,S=N(7,25,S+(F&R|~F&D)+C-176418897)+F,D=N(12,20,D+(S&F|~S&R)+M+1200080426)+S,R=N(17,15,R+(D&S|~D&F)+T-1473231341)+D,F=N(22,10,F+(R&D|~R&S)+I-45705983)+R,S=N(7,25,S+(F&R|~F&D)+w+1770035416)+F,D=N(12,20,D+(S&F|~S&R)+L-1958414417)+S,R=N(17,15,R+(D&S|~D&F)+x-42063)+D,F=N(22,10,F+(R&D|~R&S)+g-1990404162)+R,S=N(7,25,S+(F&R|~F&D)+B+1804603682)+F,D=N(12,20,D+(S&F|~S&R)+_-40341101)+S,R=N(17,15,R+(D&S|~D&F)+U-1502002290)+D,F=N(22,10,F+(R&D|~R&S)+G+1236535329)+R,S=N(5,27,S+(F&D|R&~D)+p-165796510)+F,D=N(9,23,D+(S&R|F&~R)+T-1069501632)+S,R=N(14,18,R+(D&F|S&~F)+g+643717713)+D,F=N(20,12,F+(R&S|D&~S)+m-373897302)+R,S=N(5,27,S+(F&D|R&~D)+M-701558691)+F,D=N(9,23,D+(S&R|F&~R)+x+38016083)+S,R=N(14,18,R+(D&F|S&~F)+G-660478335)+D,F=N(20,12,F+(R&S|D&~S)+C-405537848)+R,S=N(5,27,S+(F&D|R&~D)+L+568446438)+F,D=N(9,23,D+(S&R|F&~R)+U-1019803690)+S,R=N(14,18,R+(D&F|S&~F)+y-187363961)+D,F=N(20,12,F+(R&S|D&~S)+w+1163531501)+R,S=N(5,27,S+(F&D|R&~D)+_-1444681467)+F,D=N(9,23,D+(S&R|F&~R)+E-51403784)+S,R=N(14,18,R+(D&F|S&~F)+I+1735328473)+D,F=N(20,12,F+(R&S|D&~S)+B-1926607734)+R,S=N(4,28,S+(F^R^D)+M-378558)+F,D=N(11,21,D+(S^F^R)+w-2022574463)+S,R=N(16,16,R+(D^S^F)+g+1839030562)+D,F=N(23,9,F+(R^D^S)+U-35309556)+R,S=N(4,28,S+(F^R^D)+p-1530992060)+F,D=N(11,21,D+(S^F^R)+C+1272893353)+S,R=N(16,16,R+(D^S^F)+I-155497632)+D,F=N(23,9,F+(R^D^S)+x-1094730640)+R,S=N(4,28,S+(F^R^D)+_+681279174)+F,D=N(11,21,D+(S^F^R)+m-358537222)+S,R=N(16,16,R+(D^S^F)+y-722521979)+D,F=N(23,9,F+(R^D^S)+T+76029189)+R,S=N(4,28,S+(F^R^D)+L-640364487)+F,D=N(11,21,D+(S^F^R)+B-421815835)+S,R=N(16,16,R+(D^S^F)+G+530742520)+D,F=N(23,9,F+(R^D^S)+E-995338651)+R,S=N(6,26,S+(R^(F|~D))+m-198630844)+F,D=N(10,22,D+(F^(S|~R))+I+1126891415)+S,R=N(15,17,R+(S^(D|~F))+U-1416354905)+D,F=N(21,11,F+(D^(R|~S))+M-57434055)+R,S=N(6,26,S+(R^(F|~D))+B+1700485571)+F,D=N(10,22,D+(F^(S|~R))+y-1894986606)+S,R=N(15,17,R+(S^(D|~F))+x-1051523)+D,F=N(21,11,F+(D^(R|~S))+p-2054922799)+R,S=N(6,26,S+(R^(F|~D))+w+1873313359)+F,D=N(10,22,D+(F^(S|~R))+G-30611744)+S,R=N(15,17,R+(S^(D|~F))+T-1560198380)+D,F=N(21,11,F+(D^(R|~S))+_+1309151649)+R,S=N(6,26,S+(R^(F|~D))+C-145523070)+F,D=N(10,22,D+(F^(S|~R))+g-1120210379)+S,R=N(15,17,R+(S^(D|~F))+E+718787259)+D,F=N(21,11,F+(D^(R|~S))+L-343485551)+R,tt=tt+16,S=S+P>>>0,F=F+v>>>0,R=R+at>>>0,D=D+mt>>>0);return ne.endian([S,F,R,D]);function N(pt,As,Xt){return Xt<<pt|Xt>>>As}function Zd(pt,As){for(var Xt=-1,zo=Math.floor((pt.length-1)/4),Bt=0,Vc,jc,Kc,Xc;zo-8>Xt++;)Bt=Xt<<2,As[Xt]=pt[Bt+0]|pt[Bt+1]<<8|pt[Bt+2]<<16|pt[Bt+3]<<24;for(Xt--;zo>Xt++;)Bt=Xt<<2,Vc=typeof pt[Bt+0]>"u"?0:pt[Bt+0],jc=typeof pt[Bt+1]>"u"?0:pt[Bt+1],Kc=typeof pt[Bt+2]>"u"?0:pt[Bt+2],Xc=typeof pt[Bt+3]>"u"?0:pt[Bt+3],As[Xt]=Vc|jc<<8|Kc<<16|Xc<<24;return zo+1}};return function(A,m,p,E){var y;return t=m.loops,e=m.loop,r=m.getA,s=m.getB,i=m.getC,f=m.getD,h=m.getX,n=m.setA,o=m.setB,a=m.setC,c=m.setD,l=m.setX,u=p,y=ne.wordsToBytes(d(A)),E&&E.asBytes?y:ne.bytesconvertNumberToHex(y)}}function P2(){var e=function(t,r){var n,s,o,i,a,f,c,h,l,u,d,A,m,p,E,y,C,M,T,I,w,L=new Date().getTime(),x=1732584193,g=-271733879,B=-1732584194,_=271733878,U=t.length*8;w=ne.bytesToWords(t);for(var G=0;G<w.length;G++)w[G]=(w[G]<<8|w[G]>>>24)&16711935|(w[G]<<24|w[G]>>>8)&4278255360;w[U>>>5]|=128<<U%32,w[(U+64>>>9<<4)+14]=U;for(var P=0;P<w.length;P+=16)C=x,M=g,T=B,I=_,n=w[P+0]>>>0,s=w[P+1]>>>0,o=w[P+2]>>>0,i=w[P+3]>>>0,a=w[P+4]>>>0,f=w[P+5]>>>0,c=w[P+6]>>>0,h=w[P+7]>>>0,l=w[P+8]>>>0,u=w[P+9]>>>0,d=w[P+10]>>>0,A=w[P+11]>>>0,m=w[P+12]>>>0,p=w[P+13]>>>0,E=w[P+14]>>>0,y=w[P+15]>>>0,x=v(7,25,x+(g&B|~g&_)+n-680876936)+g,_=v(12,20,_+(x&g|~x&B)+s-389564586)+x,B=v(17,15,B+(_&x|~_&g)+o+606105819)+_,g=v(22,10,g+(B&_|~B&x)+i-1044525330)+B,x=v(7,25,x+(g&B|~g&_)+a-176418897)+g,_=v(12,20,_+(x&g|~x&B)+f+1200080426)+x,B=v(17,15,B+(_&x|~_&g)+c-1473231341)+_,g=v(22,10,g+(B&_|~B&x)+h-45705983)+B,x=v(7,25,x+(g&B|~g&_)+l+1770035416)+g,_=v(12,20,_+(x&g|~x&B)+u-1958414417)+x,B=v(17,15,B+(_&x|~_&g)+d-42063)+_,g=v(22,10,g+(B&_|~B&x)+A-1990404162)+B,x=v(7,25,x+(g&B|~g&_)+m+1804603682)+g,_=v(12,20,_+(x&g|~x&B)+p-40341101)+x,B=v(17,15,B+(_&x|~_&g)+E-1502002290)+_,g=v(22,10,g+(B&_|~B&x)+y+1236535329)+B,x=v(5,27,x+(g&_|B&~_)+s-165796510)+g,_=v(9,23,_+(x&B|g&~B)+c-1069501632)+x,B=v(14,18,B+(_&g|x&~g)+A+643717713)+_,g=v(20,12,g+(B&x|_&~x)+n-373897302)+B,x=v(5,27,x+(g&_|B&~_)+f-701558691)+g,_=v(9,23,_+(x&B|g&~B)+d+38016083)+x,B=v(14,18,B+(_&g|x&~g)+y-660478335)+_,g=v(20,12,g+(B&x|_&~x)+a-405537848)+B,x=v(5,27,x+(g&_|B&~_)+u+568446438)+g,_=v(9,23,_+(x&B|g&~B)+E-1019803690)+x,B=v(14,18,B+(_&g|x&~g)+i-187363961)+_,g=v(20,12,g+(B&x|_&~x)+l+1163531501)+B,x=v(5,27,x+(g&_|B&~_)+p-1444681467)+g,_=v(9,23,_+(x&B|g&~B)+o-51403784)+x,B=v(14,18,B+(_&g|x&~g)+h+1735328473)+_,g=v(20,12,g+(B&x|_&~x)+m-1926607734)+B,x=v(4,28,x+(g^B^_)+f-378558)+g,_=v(11,21,_+(x^g^B)+l-2022574463)+x,B=v(16,16,B+(_^x^g)+A+1839030562)+_,g=v(23,9,g+(B^_^x)+E-35309556)+B,x=v(4,28,x+(g^B^_)+s-1530992060)+g,_=v(11,21,_+(x^g^B)+a+1272893353)+x,B=v(16,16,B+(_^x^g)+h-155497632)+_,g=v(23,9,g+(B^_^x)+d-1094730640)+B,x=v(4,28,x+(g^B^_)+p+681279174)+g,_=v(11,21,_+(x^g^B)+n-358537222)+x,B=v(16,16,B+(_^x^g)+i-722521979)+_,g=v(23,9,g+(B^_^x)+c+76029189)+B,x=v(4,28,x+(g^B^_)+u-640364487)+g,_=v(11,21,_+(x^g^B)+m-421815835)+x,B=v(16,16,B+(_^x^g)+y+530742520)+_,g=v(23,9,g+(B^_^x)+o-995338651)+B,x=v(6,26,x+(B^(g|~_))+n-198630844)+g,_=v(10,22,_+(g^(x|~B))+h+1126891415)+x,B=v(15,17,B+(x^(_|~g))+E-1416354905)+_,g=v(21,11,g+(_^(B|~x))+f-57434055)+B,x=v(6,26,x+(B^(g|~_))+m+1700485571)+g,_=v(10,22,_+(g^(x|~B))+i-1894986606)+x,B=v(15,17,B+(x^(_|~g))+d-1051523)+_,g=v(21,11,g+(_^(B|~x))+s-2054922799)+B,x=v(6,26,x+(B^(g|~_))+l+1873313359)+g,_=v(10,22,_+(g^(x|~B))+y-30611744)+x,B=v(15,17,B+(x^(_|~g))+c-1560198380)+_,g=v(21,11,g+(_^(B|~x))+p+1309151649)+B,x=v(6,26,x+(B^(g|~_))+a-145523070)+g,_=v(10,22,_+(g^(x|~B))+A-1120210379)+x,B=v(15,17,B+(x^(_|~g))+o+718787259)+_,g=v(21,11,g+(_^(B|~x))+u-343485551)+B,x=x+C>>>0,g=g+M>>>0,B=B+T>>>0,_=_+I>>>0;return ne.endian([x,g,B,_]);function v(at,mt,X){return X<<at|X>>>mt}};return function(t,r){var n=ne.wordsToBytes(e(t,r)),s=r&&r.asBytes?n:ne.bytesconvertNumberToHex(n);return s}}function H2(e){var t,r,n,s=-1;for(t=e.length-1,r=new ArrayBuffer(e.length),n=new Uint8Array(r);t>s++;)n[s]=e.charCodeAt(s);return n}function k2(e){return Buffer.from(e,"base64").toString("binary")}function $u(e){return e}function J2(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(t,r){return t<<r|t>>>32-r},endian:function(t){if(t.constructor==Number)return ne.rotl(t,8)&16711935|ne.rotl(t,24)&4278255360;for(var r=0;r<t.length;r++)t[r]=ne.endian(t[r]);return t},bytesToWords:function(t){for(var r=[],n=0,s=0;n<t.length;n++,s+=8)r[s>>>5]|=t[n]<<24-s%32;return r},wordsToBytes:function(t){for(var r=[],n=0;n<t.length*32;n+=8)r.push(t[n>>>5]>>>24-n%32&255);return r},bytesconvertNumberToHex:function(t){for(var r=[],n=0;n<t.length;n++)r.push((t[n]>>>4).toString(16)),r.push((t[n]&15).toString(16));return r.join("")}}}var sr=class extends Mo{name="md5";options;constructor(t={}){super(),this.options=t}async hash(t,r){let s=await new Promise((o,i)=>ic(t).then(o).catch(i));return Yu(s,r)}};var rn=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(t={}){gn(t)}async compress(t){return await this.preload(),this.compressSync(t)}async decompress(t,r){return await this.preload(),this.decompressSync(t,r)}compressSync(t){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(t,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(t){let r=await this.concatenate(t);yield this.compress(r)}async*decompressBatches(t){let r=await this.concatenate(t);yield this.decompress(r)}concatenate(t){return Bn(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var Xn=class extends rn{name="uncompressed";extensions=[];contentEncodings=[];isSupported=!0;options;constructor(t){super(t),this.options=t||{}}compressSync(t){return t}decompressSync(t){return t}async*compressBatches(t){return yield*t}async*decompressBatches(t){return yield*t}};var dr=gr(Hd(),1),ye=gr(kd(),1);var Ar=class extends rn{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(t={}){super(t),this.options=t}async compress(t){if(!Et&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await yr(ye.default.gzip)(t):await yr(ye.default.deflate)(t);return _r(r)}return this.compressSync(t)}async decompress(t){if(!Et&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await yr(ye.default.gunzip)(t):await yr(ye.default.inflate)(t);return _r(r)}return this.decompressSync(t)}compressSync(t){if(!Et&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?ye.default.gzipSync(t):ye.default.deflateSync(t);return _r(o)}let r=this.options?.deflate||{},n=new Uint8Array(t);return(this.options?.raw?dr.default.deflateRaw:dr.default.deflate)(n,r).buffer}decompressSync(t){if(!Et&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?ye.default.gunzipSync(t):ye.default.inflateSync(t);return _r(o)}let r=this.options?.deflate||{},n=new Uint8Array(t);return(this.options?.raw?dr.default.inflateRaw:dr.default.inflate)(n,r).buffer}async*compressBatches(t){let r=this.options?.deflate||{},n=new dr.default.Deflate(r);yield*this.transformBatches(n,t)}async*decompressBatches(t){let r=this.options?.deflate||{},n=new dr.default.Inflate(r);yield*this.transformBatches(n,t)}async*transformBatches(t,r){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(let i of r){let a=new Uint8Array(i);if(!t.push(a,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),s=t.push(n,!0);yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){let t=this._chunks;return this._chunks=[],t}_getError(t=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[t]}`}};var v_={0:async e=>e,8:async e=>await new Ar({raw:!0}).decompress(e)},Jo=class{fileProvider=null;fileName;archive=null;constructor(t){if(typeof t=="string")if(this.fileName=t,!Et)this.fileProvider=new yn(t);else throw new Error("Cannot open file for random access in a WEB browser");else t instanceof mr?(this.fileProvider=t.fileProvider,this.archive=t,this.fileName=t.fileName):Zo(t)&&(this.fileProvider=t)}async destroy(){this.fileProvider&&await this.fileProvider.destroy()}async readdir(){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let t=[],r=en(this.fileProvider);for await(let n of r)t.push(n.fileName);return t}async stat(t){let r=await this.getCDFileHeader(t);return{...r,size:Number(r.uncompressedSize)}}async fetch(t){this.fileName&&t.indexOf(this.fileName)===0&&(t=t.substring(this.fileName.length+1));let r;if(this.archive)r=await this.archive.getFile(t,"http");else{if(!this.fileProvider)throw new Error("No data detected in the zip archive");let s=await this.getCDFileHeader(t),o=await nr(s.localHeaderOffset,this.fileProvider);if(!o)throw new Error("Local file header has not been found in the zip archive`");let i=v_[o.compressionMethod.toString()];if(!i)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(o.fileDataOffset,o.fileDataOffset+o.compressedSize);r=await i(a)}let n=new Response(r);return Object.defineProperty(n,"url",{value:t?`${this.fileName||""}/${t}`:this.fileName||""}),n}async getCDFileHeader(t){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=en(this.fileProvider),n=null;for await(let s of r)if(s.fileName===t){n=s;break}if(!n)throw new Error("File has not been found in the zip archive");return n}};var mr=class{fileProvider;fileName;constructor(t,r,n){this.fileProvider=t,this.fileName=n}async getFileWithoutHash(t){return await(await new Jo(this.fileProvider).fetch(t)).arrayBuffer()}};function kc(e){let t=new DataView(e),r={};for(let n=0;n<e.byteLength;n=n+24){let s=t.getBigUint64(n+16,!0),o=N_(e,n,16);r[o]=s}return r}function N_(e,t,r){return[...new Uint8Array(e,t,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function Jc(e){let t=en(e);return G_(t)}async function G_(e){let t=new sr,r=new TextEncoder,n={};for await(let s of e){let o=s.fileName.split("\\").join("/").toLocaleLowerCase(),i=r.encode(o).buffer,a=await t.hash(i,"hex");n[a]=s.localHeaderOffset}return n}var U_={0:e=>new Xn().decompress(e),8:e=>new Ar({raw:!0}).decompress(e)},An=class extends mr{hashTable;constructor(t,r,n){super(t,r,n),this.hashTable=r}async getFile(t){let r=await this.getFileBytes(t.toLocaleLowerCase());if(r||(r=await this.getFileBytes(t)),!r)throw new Error(`No such file in the archive: ${t}`);return r}async getFileBytes(t){let r;if(this.hashTable){let n=new TextEncoder().encode(t).buffer,s=await new sr().hash(n,"hex"),o=this.hashTable[s];if(o===void 0)return null;let i=await nr(o,this.fileProvider);if(!i)return null;let a=await this.fileProvider.slice(i.fileDataOffset,i.fileDataOffset+i.compressedSize),f=U_[i.compressionMethod];if(!f)throw Error("Only Deflation compression is supported");r=await f(a)}else r=await this.getFileWithoutHash(t);return r}};var Jd=async(e,t)=>{let r=await Vn(e,Kn),n=await jn(r,e),s;if(n?.fileName!=="@3dtilesIndex1@")s=await Jc(e),t?.("3tz doesnt contain hash file, hash info has been composed according to zip archive headers");else{let o=await nr(n.localHeaderOffset,e);if(!o)throw new Error("corrupted 3tz zip archive");let i=o.fileDataOffset,a=await e.slice(i,i+o.compressedSize);s=kc(a)}return new An(e,s)};var P_="4.2.4",zd={dataType:null,batchType:null,name:"3tz",id:"3tz",module:"3d-tiles",version:P_,mimeTypes:["application/octet-stream","application/vnd.maxar.archive.3tz+zip"],parse:H_,extensions:["3tz"],options:{}};async function H_(e,t={}){return(await Jd(new Tn(new DataView(e)))).getFile(t["3d-tiles-archive"]?.path??"")}function Pe(e,t,r){if(!t)return r+12;let{magic:s,version:o=1,byteLength:i=12}=e;return J(Array.isArray(s)&&Number.isFinite(o)&&Number.isFinite(i)),t.setUint8(r+0,s[0]),t.setUint8(r+1,s[1]),t.setUint8(r+2,s[2]),t.setUint8(r+3,s[3]),t.setUint32(r+4,o,!0),t.setUint32(r+8,i,!0),r+=12,r}function He(e,t,r){e&&e.setUint32(t+8,r,!0)}function Qd(e,t,r,n,s){e={magic:Me.COMPOSITE,tiles:[],...e};let o=r;r+=Pe(e,t,r),t&&t.setUint32(r,e.tiles.length,!0),r+=4;for(let i=0;i<e.tiles.length;++i)r+=s(e.tiles[i],t,r,n);return He(t,o,r-o),r}function Vd(e,t,r,n){let{featuresLength:s=0,batchTable:o}=e,a=JSON.stringify({BATCH_LENGTH:s}),f=o?JSON.stringify(o):"",c=bt(a.length,8),h=f?bt(f.length,8):0;e={magic:Me.BATCHED_MODEL,...e};let l=r;r=Pe(e,t,r),t&&(t.setUint32(12,c,!0),t.setUint32(16,0,!0),t.setUint32(20,h,!0),t.setUint32(24,0,!0)),r+=16,r=Bs(t,r,a,8),o&&(r=Bs(t,r,f,8));let u=e.gltfEncoded;return u&&(r=xn(t,r,u,u.byteLength)),He(t,l,r-l),r}function jd(e,t,r,n){let{featuresLength:s=1,gltfFormat:o=1,gltfUri:i=""}=e,a=i.length,f={INSTANCES_LENGTH:s,POSITION:new Array(s*3).fill(0)},c=JSON.stringify(f),h=c.length;e={magic:Me.INSTANCED_MODEL,...e};let l=r;return r=Pe(e,t,0),t&&(t.setUint32(12,h,!0),t.setUint32(16,0,!0),t.setUint32(20,0,!0),t.setUint32(24,0,!0),t.setUint32(28,o,!0)),r+=20,r+=Er(t,r,c,h),r+=Er(t,r,i,a),He(t,l,r-l),r}var k_={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function Kd(e,t,r,n){let{featureTableJson:s=k_}=e,o=JSON.stringify(s);o=Xo(o,4);let{featureTableJsonByteLength:i=o.length}=e,a=new ArrayBuffer(12),f=a.byteLength;e={magic:Me.POINT_CLOUD,...e};let c=r;return r+=Pe(e,t,0),t&&(t.setUint32(r+0,i,!0),t.setUint32(r+4,f,!0),t.setUint32(r+8,0,!0),t.setUint32(r+12,0,!0)),r+=16,r+=Er(t,r,o,i),r+=xn(t,r,a,f),He(t,c,r-c),r}function Qc(e,t){let r=zc(e,null,0,t),n=new ArrayBuffer(r),s=new DataView(n);return zc(e,s,0,t),n}function zc(e,t,r,n){switch(J(typeof e.type=="string"),e.type){case _t.COMPOSITE:return Qd(e,t,r,n,zc);case _t.POINT_CLOUD:return Kd(e,t,r,n);case _t.BATCHED_3D_MODEL:return Vd(e,t,r,n);case _t.INSTANCED_3D_MODEL:return jd(e,t,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var Yd={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(e,t)=>Xd(e,t),encodeSync:Xd};function Xd(e,t){return Qc(e,t)}return r1(ls);})();
8
8
  /*! Bundled license information:
9
9
 
10
10
  long/index.js: